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
| Argument | Type | Description | 
|---|---|---|
| amount | string | The amount of presale token to be withdrawn from presale contract. | 
| signer | Signer | An instance that represents a wallet address. | 
Response
| Field | type | Description | 
|---|---|---|
| type | number | The EIP-2718 type of this transaction. | 
| chainId | number | The id of the network. | 
| nonce | number | The nonce used as part of the proof-of-work to mine this block. | 
| maxPriorityFeePerGas | BigNumber | The price (in wei) per unit of gas for this transaction. | 
| maxFeePerGas | BigNumber | The 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). | 
| gasPrice | BigNumber | The price (in wei) per unit of gas this transaction will pay. | 
| gasLimit | BigNumber | The maximum amount of gas that this block was permitted to use. | 
| to | string | The address of the target. | 
| value | BigNumber | The amount (in wei) this transaction is sending. | 
| data | string | Transaction data. | 
| accessList | AccessListish | The AccessList to include; only available for EIP-2930 and EIP-1559 transactions. | 
| hash | string | Transaction hash. | 
| v | number | Values for the transaction's signature. | 
| r | string | Values for the transaction's signature. | 
| s | string | Values for the transaction's signature. | 
| from | string | The sender address of the transaction. | 
| confirmations | number | The 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
| Argument | Type | Description | 
|---|---|---|
| signer | Signer | An instance that represents a wallet address. | 
Response
| Field | type | Description | 
|---|---|---|
| type | number | The EIP-2718 type of this transaction. | 
| chainId | number | The id of the network. | 
| nonce | number | The nonce used as part of the proof-of-work to mine this block. | 
| maxPriorityFeePerGas | BigNumber | The price (in wei) per unit of gas for this transaction. | 
| maxFeePerGas | BigNumber | The 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). | 
| gasPrice | BigNumber | The price (in wei) per unit of gas this transaction will pay. | 
| gasLimit | BigNumber | The maximum amount of gas that this block was permitted to use. | 
| to | string | The address of the target. | 
| value | BigNumber | The amount (in wei) this transaction is sending. | 
| data | string | Transaction data. | 
| accessList | AccessListish | The AccessList to include; only available for EIP-2930 and EIP-1559 transactions. | 
| hash | string | Transaction hash. | 
| v | number | Values for the transaction's signature. | 
| r | string | Values for the transaction's signature. | 
| s | string | Values for the transaction's signature. | 
| from | string | The sender address of the transaction. | 
| confirmations | number | The number of blocks that have been mined (including the initial block) since this transaction. | 
Example
await presaleSdk.withdrawAll(signer)