claimAirdrop
Claims an airdrop.
Usage
example.ts
import { mintclub } from 'mint.club-v2-sdk'
await mintclub.network('base').airdrop.claimAirdrop({
airdropId: 1
})
Return Value
Promise<TransactionReceipt>
Returns a promise that resolves to a TransactionReceipt
object when the transaction is successful.
Parameters
airdropId
- Type:
number
Airdrop id.
example.ts
import { mintclub, wei } from 'mint.club-v2-sdk'
await mintclub.network('base').airdrop.claimAirdrop({
airdropId: 1
})
onSignatureRequest (optional)
- Type:
onSignatureRequest?: () => void;
- Default:
undefined
Callback function for when the user is requested to sign the transaction.
await mintclub.network('base').airdrop.claimAirdrop({
airdropId: 1,
onSignatureRequest: () => {}
})
onSigned (optional)
- Type:
onSigned?: (txHash: '0x${string}') => void;
- Default:
undefined
Callback function for when the user is signs the transaction.
await mintclub.network('base').airdrop.claimAirdrop({
airdropId: 1,
onSigned: (txHash) => {}
})
onSuccess (optional)
- Type:
onSuccess?: (receipt: TransactionReceipt) => void;
- Default:
undefined
Callback function for when the transaction is successful.
await mintclub.network('base').airdrop.claimAirdrop({
airdropId: 1,
onSuccess: (receipt) => {}
})
onError (optional)
- Type:
onError?: (error: unknown) => void;
- Default:
undefined
Callback function for when the transaction fails. This also includes when the user rejects the transaction.
await mintclub.network('base').airdrop.claimAirdrop({
airdropId: 1,
onError: (error) => {}
})