Crowdsale

crowdsale()

Creates a Crowdsale builder class instance, which provides methods to build transactions for the Crowdsale Pallet on The Root Network. It expects four parameters:

  • api: the trnApi to use for interaction.

  • signer: the signer to use for signing transactions.

  • walletAddress: the wallet address to use for interaction. Note: It should be the EOA address for the signer, not the FuturePass address.

  • assetId: the Sale ID to target.

Example:

const crowdsaleBuilder = await TransactionBuilder.crowdsale(api, signer, walletAddress, saleId)

The crowdsale method provides developers with capabilities to claim, participate and reddem vouchers extrinsic.

claim()

Claims the voucher for the sale. It has no parameter.

Example:

const crowdsaleBuilder = await TransactionBuilder.crowdsale(api, signer, walletAddress, saleId).claim();

participate()

Participates in the sale with the amount. It expects one parameter:

  • amount: the amount to participate with. It can be a number, bigint or string.

Example:

const crowdsaleBuilder = await TransactionBuilder.crowdsale(api, signer, walletAddress, saleId).participate(amount);

redeem()

Sets the base extrinsic to redeem the voucher for the sale with the quantity. It expects one parameter:

  • quantity: the quantity to redeem.

Example:

const crowdsaleBuilder = await TransactionBuilder.crowdsale(api, signer, walletAddress, saleId).redeem(1);

Last updated

© 2023 -> ♾️