Skip to main content

Claim Airdrop Token

Example

To claim a token from an airdrop, you must call claim on dataset(Dataset.TOKEN). claim takes an object of type Build5Request<ClaimAirdroppedTokensTangleRequest> as parameter.

    const otrRequest = await otr(otrAddress).dataset(Dataset.TOKEN).claimAirdrops({
symbol: 'IOTA',
});
OTR Request Deep Link

The SDK provides the helper functions getFireflyDeepLink() and getBloomDeepLink() to generate deep links for OTR requests.

Full How-To Code

import { Dataset } from '@build-5/interfaces';
import { otr, SoonaverseOtrAddress } from '@build-5/sdk';

async function main() {
// @ts-ignore
const otrAddress = SoonaverseOtrAddress[origin];

try {
const otrRequest = await otr(otrAddress).dataset(Dataset.TOKEN).claimAirdrops({
symbol: 'IOTA',
});

var fireflyDeeplink = otrRequest.getFireflyDeepLink();
console.log(fireflyDeeplink);
} catch (e) {
console.log(e);
return;
}
}

main().then(() => process.exit());