new TransactionHelper(chainId)
constructor
Parameters:
| Name | Type | Description |
|---|---|---|
chainId |
string | chain id |
Methods
-
afterAirdropPayFailure(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, airdropBugdetAddress)
-
After airdrop pay function, this is called after the pay is failed
Parameters:
Name Type Description brandedTokenAddressstring branded token address airdropAddressstring airdrop contract address spenderAddressstring spender address estimatedPayAmountBigNumber estimated pay amount in weis estimatedAirdropAmountBigNumber estimated airdrop amount airdropBugdetAddressstring airdrop budget holder address Returns:
- Type
- promise.<result>
-
afterAirdropPaySuccess(brandedTokenAddress, airdropAddress, spenderAddress, estimatedPayAmount, estimatedAirdropAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount, actualAirdropAmount, airdropBugdetAddress)
-
After airdrop pay function, this is called after the pay is successfull
Parameters:
Name Type Description brandedTokenAddressstring branded token address airdropAddressstring airdrop contract address spenderAddressstring spender address estimatedPayAmountBigNumber estimated pay amount in weis estimatedAirdropAmountBigNumber estimated airdrop amount beneficiaryAddressstring beneficiary address actualBeneficiaryAmountBigNumber actual beneficiary amount in weis commissionBeneficiaryAddressstring commission beneficiary address actualCommissionBeneficiaryAmountBigNumber actual commission beneficiary amount actualAirdropAmountBigNumber actual airdrop amount airdropBugdetAddressstring airdrop budget holder address Returns:
- Type
- promise.<result>
-
afterPayFailure(brandedTokenAddress, spenderAddress, estimatedPayAmount)
-
After pay function, this is called after the pay is failed
Parameters:
Name Type Description brandedTokenAddressstring branded token address spenderAddressstring spender address estimatedPayAmountBigNumber estimated pay amount in weis Returns:
- Type
- promise.<result>
-
afterPaySuccess(brandedTokenAddress, spenderAddress, estimatedPayAmount, beneficiaryAddress, actualBeneficiaryAmount, commissionBeneficiaryAddress, actualCommissionBeneficiaryAmount)
-
After pay function, this is called after the pay is successfull
Parameters:
Name Type Description brandedTokenAddressstring branded token address spenderAddressstring spender address estimatedPayAmountBigNumber estimated pay amount in weis beneficiaryAddressstring beneficiary address actualBeneficiaryAmountBigNumber actual beneficiary amount in weis commissionBeneficiaryAddressstring commission beneficiary address actualCommissionBeneficiaryAmountBigNumber actual commission beneficiary amount Returns:
- Type
- promise.<result>
-
beforeAirdropPay(brandedTokenAddress, airdropAddress, spenderAddress, totalTransferAmount, airdropBalanceToUse, airdropBugdetAddress)
-
Before airdrop pay function, this is called before the pay is called
Parameters:
Name Type Description brandedTokenAddressstring branded token address airdropAddressstring airdrop contract address spenderAddressstring spender address totalTransferAmountBigNumber estimated pay amount in weis airdropBalanceToUseBigNumber estimated airdrop amount airdropBugdetAddressstring airdrop budget holder address Returns:
- Type
- promise.<array.<result>>
-
beforePay(brandedTokenAddress, spenderAddress, estimatedPayAmount)
-
Before pay function, this is called before the pay is called
Parameters:
Name Type Description brandedTokenAddressstring branded token address spenderAddressstring spender address estimatedPayAmountBigNumber estimated pay amount in weis Returns:
- Type
- promise.<result>
-
clearUserDetailCache(airdropContractAddress, owner)
-
Clear user detail cache for the user addressess
Parameters:
Name Type Description airdropContractAddressstring airdrop contract address ownerstring Account address Returns:
- Type
- promise.<result>
-
creditAirdropBalance(airdropContractAddress, owner, bigAmount)
-
Credit airdrop balance in db and clear cache It decreases airdrop_used_amount for user in user_airdrop_details table Clears the cache
Parameters:
Name Type Description airdropContractAddressstring airdrop contract address ownerstring Account address bigAmountBigNumber amount to be credited Returns:
- Type
- promise.<result>
-
creditBalance(brandedTokenAddress, owner, bigAmount)
-
Credit balance in cache
Parameters:
Name Type Description brandedTokenAddressstring branded token address ownerstring Account address bigAmountBigNumber amount to be credited Returns:
- Type
- promise.<result>
-
debitAirdropBalance(airdropContractAddress, owner, bigAmount)
-
Debit airdrop balance in db and clear cache It increases airdrop_used_amount for user in user_airdrop_details table Clears the cache
Parameters:
Name Type Description airdropContractAddressstring airdrop contract address ownerstring Account address bigAmountBigNumber amount to be debited Returns:
- Type
- promise.<result>
-
debitBalance(brandedTokenAddress, owner, bigAmount)
-
Debit balance in cache
Parameters:
Name Type Description brandedTokenAddressstring branded token address ownerstring Account address bigAmountBigNumber amount to be debited Returns:
- Type
- promise.<result>
-
getActualAmountsFromDecodedEvents(decodedEvent, eventName)
-
Get actual beneficiary amount, actual commission amount and actual airdrop amount from decoded events
Parameters:
Name Type Description decodedEventObject Decoded event from receipt eventNamestring Event name Returns:
- Type
- result
-
getActualAmountsFromReceipt(transactionReceipt, addressToNameMap, eventName)
-
Get actual beneficiary amount, actual commission amount and actual airdrop amount from transaction receipt
Parameters:
Name Type Description transactionReceiptObject transaction receipt addressToNameMapObject address to name map object eventNamestring Event name Returns:
- Type
- result
-
isAllResponseSuccessful(results)
-
Check if all response is success
Parameters:
Name Type Description resultsarray response array Returns:
- Type
- boolean
-
updateAirdropBalance(airdropContractAddress, owner, toCreditBigAmount)
-
Update airdrop balance
Parameters:
Name Type Description airdropContractAddressstring airdrop contract address ownerstring Account address toCreditBigAmountBigNumber to credit amount - this can be negative also Returns:
- Type
- promise.<result>
-
updateBalance(brandedTokenAddress, owner, toCreditBigAmount)
-
Update balance to cache
Parameters:
Name Type Description brandedTokenAddressstring branded token address ownerstring Account address toCreditBigAmountBigNumber to credit amount - this can be negative also Returns:
- Type
- promise.<result>