Skip to content

@gala-chain/chaincodeAPI


API > checkAllowances

Function: checkAllowances()

checkAllowances(ctx, applicableAllowances, tokenInstanceKey, action, callingOnBehalf): Promise\<BigNumber>

Parameters

ctx: GalaChainContext

applicableAllowances: TokenAllowance[]

tokenInstanceKey: TokenInstanceKey

action: AllowanceType

callingOnBehalf: string

Returns

Promise<BigNumber>

Description

Given an array of allowances,

  1. clean up and delete expired / fully used allowances
  2. Match the remaining allowances against the TokenInstanceKey and AllowanceType
  3. Sum up and return the total useable allowance quantity available

Source

chaincode/src/allowances/checkAllowances.ts:122