WIP Transfer Native Cryptocurrency
In this tutorial, we will walk you through the process of transferring native cryptocurrency between two wallets using the Eniblock SDK.
Overview​
Creating a wallet using the Eniblock SDK is a straightforward process that involves instantiating the SDK, creating a new wallet instance, and managing the accounts within the wallet.
- Login (responsibility of the application creator): Your customer accesses your decentralized application (dApp) and "Login" or "Sign in".
- Transfer cryptocurrency (responsibility of the application creator): The customer sends some cryptocurrency, entering the recipient's wallet address, the amount of cryptocurrency to send, and any additional transaction details (e.g., fees). The user confirms the transaction details and proceeds to the next step.
- Load secret share (responsibility of Eniblock): The application securely retrieves the user's secret share from their chosen cloud storage provider. The secret share is temporarily loaded into the application to apply the transaction signing process (cf Store and retrieve a Wallet).
- Check identity (responsibility of Eniblock): Eniblock services verify the identity of the end-user based on the authentication performed by your IDP
- Generate the (TSS) signature (responsibility of Eniblock): Upon the user's initiation of the transaction, the user's secret share, combined with the shares of Eniblock, is used to create a valid signature without revealing the complete private key.
- Submit transaction (responsibility of the application creator): The application submits the signed transaction to the relevant blockchain network for processing and confirmation. The user receives a notification about the transaction status and can monitor the progress within the wallet interface (cf Get notified of Incoming Cryptocurrency Transactions.
Step 1 - Create a wallet​
Live Editor
Step 2 - Top up the wallet​
To top up your wallet:
- Run the code of the Step 1 section and collect the address of the wallet.
- Follow this FAQ entry: How to top up a wallet on the Polygon Testnet?
Step 3 - Check the balance​
Verify the balance of your account. After topping up the wallet, you will have the ability to send MATIC tokens.
Live Editor
Step 4 - Send crypto currency and get confirmation​
Here we retrieve the wallet, build a transfer transaction, send it and wait for a notification that confirms it is mined. Indeed, a transaction must be mined (i.e. integrated into the blockchain) with enough confirmation blocks to be considered as effective.
Live Editor
API References​
- Eniblock class
- Wallet namespace
- Wallet class
- Account namespace
- Account class
- Account address
- Account getNativeBalance
- BalanceResult
- Account.buildTransfer() method
- TransferParams type
- NativeTransferParams interface
- TransactionExecutor class
- TransactionExecutor.estimate() method
- EstimateResult interface
- TransactionExecutor.send() method
- Ethers TransactionResponse class