dappkits-rn-mobile-wallet-sdk v0.1.13
Mobile Wallet SDK
Mobile Wallet SDK for React Native
Installation
npm install dappkits-rn-mobile-wallet-sdk
API
Wallet Manager
createLocalWallet(recoveryPhrase, /* walletType */)
: Create local wallet with recovery phrase (12 human-readable words). walletType: 目前沒用到getLocalWallet(walletId)
: (待修改成getLocalWalletWithWalletId(walletId)
) Get local wallet (Wallet
) with wallet id. Returnnull
if given id is not exists.
2.5. (待加)getLocalWalletWithIndex(index)
:
Get local wallet (Wallet
) with index.
getLocalWalletList()
: Get all local wallet as an array ofWallet
object.updateLocalWallentName(index, newName)
: Update wallet name with wallet index.deleteLocalWallet(index)
: Delete wallet from db with wallet index.getLocalWalletAmount()
: Get total amount of local wallets, retrun inint
.setCurrentWalletIndex(index)
: Set current wallet index.getCurrentWalletIndex()
: Get current wallet index.
Wallet
ethSignTx(toAccount, toAmount, txData, gasPrice, gasAmount, chainId)
: Sign ethereum tx.ethSignRawTx(tx)
: Sign ethereum raw tx.ethSendSignedTx(tx)
: Send eth signed tx.ethSign(message)
: Sign eth message.ethSendTransaction(txData, callback)
: Send tx with callback function.tronSendTrx(toAccount, amount, fromAccount)
: Send trx.tronSendTRC10Token(toAccount, amount, tokenID, decimals)
: Send trc 10 token.tronSendTRC20Token(toAccount, toAmount, tokenAddress, decimals)
: Send trc 20 token.tronFreezeTrx(amount, duration, resource, receiverAddress)
: Freeze trx.tronUnfreezeTrx(resource, ownerAddress, receiverAddress)
: Unfreeze trx.getTronAccountResources()
: Get tron resources of this wallet.