getContractURI
Get the contract URI of the airdrop contract.
Property | Type | Description |
---|---|---|
Promise | string | the contract URI |
Example
const contractURI = await airdropSdk.getContractURI()
// example contractURI: www.google.com
getFee
Get the fee of the airdrop contract. Each time when a user calls the registerTree method, they need to pay some fee to the contract.
Parameter
No parameter is needed for this method
Response
Property | Type | Description |
---|---|---|
Promise | BigNumber | the fee amount |
Example
const fee = await airdropSdk.getFee()
// example fee: {"type":"BigNumber","hex": "0x1"}
getFeeReceiver
Get the address of the contract fee receiver who receives the contract fee when the user calls registerTree method.
Parameter
No parameter is needed for this method
Response
Property | Type | Description |
---|---|---|
Promise | string | the wallet address of contract fee receiver |
Example
const feeReceiver = await airdropSdk.getFeeReceiver()
// example feeReceiver: 0x0CEE2872EA9E72b7eb5BE52cA34223264450AE9c
getFeeToken
Get the address of the token that the user needs to pay as the contract fee when calling the registerTree method. The token could be a zero address which represents the native token or any other ERC20 token address.
Parameter
No parameter is needed for this method
Response
Property | Type | Description |
---|---|---|
Promise | string | the address of the fee token of the contract |
Example
const feeToken = await airdropSdk.getFeeToken()
// example feeToken: 0xEa3cdB2112886AD7361812363E4cf014A6B67277
getAdjustableFee
Get a boolean value which represents whether the fee token or the fee receiver could be set again.
Parameter
No parameter is needed for this method
Response
Property | Type | Description |
---|---|---|
Promise | boolean | whether the contract fee is adjustable |
Example
const adjustableFee = await airdropSdk.getAdjustableFee()
// example adjustableFee: true
getAirdrop
Get the airdrop information given the ID of a registered airdrop.
Parameter
Argument | Type | Description |
---|---|---|
id | string | the id of the airdrop |
Response
Response:
Property | Type | Description |
---|---|---|
Promise | Airdrop | the info of airdrop |
Airdrop:
Field | Type | Description |
---|---|---|
tokenAddress | string | the address of the crypto token stored in this airdrop |
owner | string | the wallet address of the owner of the airdrop |
root | string | the root value of this airdrop |
supply | BigNumber | the supply amount of the airdrop |
startTime | BigNumber | the unix timestamp of the airdrop start time |
endTime | BigNumber | the unix timestamp of the airdrop end time |
Example
const id = 1
const airdrop = await airdropSdk.getAirdrop(id)
// example:
// ["0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", " 0x0000000000000000000000000000000000000000000000000000000000000000", {"type":"BigNumber","hex":"0x0"}, {"type":"BigNumber","hex":"0x0"}, {"type":"BigNumber","hex":"0x0"}]
getAirdropIds
Get an array of a user's registered airdrop IDs in this contract given the user's wallet address.
Parameter
Argument | Type | Description |
---|---|---|
ownerAddress | string | wallet address of the user |
Response
Property | Type | Description |
---|---|---|
Promise<BigNumber[]> | BigNumber[] | the airdrop Id owned by the user wallet |
Example
const owner = <WALLET_ADDRESS>
const ids = await airdropSdk.getAirdropIds(owner)
// example ids:
// [["0x0000000000000000000000000000000000000000", "0x0000000000000000000000000000000000000000", " 0x0000000000000000000000000000000000000000000000000000000000000000", {"type":"BigNumber","hex":"0x0"}, {"type":"BigNumber","hex":"0x0"}, {"type":"BigNumber","hex":"0x0"}]]
Note: You may need to adjust the code to match your specific markdown rendering system or tool, as not all markdown renderers are the same.