Withdraw

withdraw methods for launcher presale.

After purchasing presale tokens, users have two options for withdrawal:

Withdraw

After a user purchases a certain amount of presale tokens during the presale, they can then withdraw them from the presale and store them in their own wallet account.

Parameter

ArgumentTypeDescription
amountstringThe amount of presale token to be withdrawn from presale contract.
signerSignerAn instance that represents a wallet address.

Response

FieldtypeDescription
typenumberThe EIP-2718 type of this transaction.
chainIdnumberThe id of the network.
noncenumberThe nonce used as part of the proof-of-work to mine this block.
maxPriorityFeePerGasBigNumberThe price (in wei) per unit of gas for this transaction.
maxFeePerGasBigNumberThe maximum price (in wei) per unit of gas this transaction will pay for (the combined EIP-1559 block's base fee and this transaction's priority fee).
gasPriceBigNumberThe price (in wei) per unit of gas this transaction will pay.
gasLimitBigNumberThe maximum amount of gas that this block was permitted to use.
tostringThe address of the target.
valueBigNumberThe amount (in wei) this transaction is sending.
datastringTransaction data.
accessListAccessListishThe AccessList to include; only available for EIP-2930 and EIP-1559 transactions.
hashstringTransaction hash.
vnumberValues for the transaction's signature.
rstringValues for the transaction's signature.
sstringValues for the transaction's signature.
fromstringThe sender address of the transaction.
confirmationsnumberThe number of blocks that have been mined (including the initial block) since this transaction.

Example

await presaleSdk.withdraw('20', signer)

 

WithdrawAll

Users can opt to withdraw all purchased presale tokens at once and transfer them to their account. This only requires a 'signer' representing the wallet address. The response provides similar transaction details as the 'Withdraw' function.

Parameter

ArgumentTypeDescription
signerSignerAn instance that represents a wallet address.

Response

FieldtypeDescription
typenumberThe EIP-2718 type of this transaction.
chainIdnumberThe id of the network.
noncenumberThe nonce used as part of the proof-of-work to mine this block.
maxPriorityFeePerGasBigNumberThe price (in wei) per unit of gas for this transaction.
maxFeePerGasBigNumberThe maximum price (in wei) per unit of gas this transaction will pay for (the combined EIP-1559 block's base fee and this transaction's priority fee).
gasPriceBigNumberThe price (in wei) per unit of gas this transaction will pay.
gasLimitBigNumberThe maximum amount of gas that this block was permitted to use.
tostringThe address of the target.
valueBigNumberThe amount (in wei) this transaction is sending.
datastringTransaction data.
accessListAccessListishThe AccessList to include; only available for EIP-2930 and EIP-1559 transactions.
hashstringTransaction hash.
vnumberValues for the transaction's signature.
rstringValues for the transaction's signature.
sstringValues for the transaction's signature.
fromstringThe sender address of the transaction.
confirmationsnumberThe number of blocks that have been mined (including the initial block) since this transaction.

Example

await presaleSdk.withdrawAll(signer)