Wallet Suite
Table of Contents:
getBalance
setProviderAndSigner
signMessage
verifySignatureOffChain
getConnectedChainId
getConnectedChainName
transfer
getBalance
Retrieves the balance of a wallet address on a specific chain.
Parameters:
address
(string): The wallet address for which to retrieve the balance.chainId
(number): The ID of the blockchain network.
Returns: A Promise resolving to a string representing the wallet balance.
setProviderAndSigner
Sets the provider and signer for the wallet using a private key.
Parameters:
privateKey
(string): The private key associated with the wallet.chainId
(number): The ID of the blockchain network.
Returns: A Promise resolving to an object with the provider and signer instances.
signMessage
Signs a message using the wallet's private key.
Parameters:
message
(string): The message to sign.
Returns: A Promise resolving to a string representing the signature.
verifySignatureOffChain
Verifies the authenticity of a signature for an off-chain message.
Parameters:
message
(string): The original message.signature
(string): The signature to verify.address
(string): The address associated with the signature.
Returns: A Promise resolving to a boolean value indicating the verification status.
getConnectedChainId
Retrieves the ID of the currently connected blockchain network.
Returns: A Promise resolving to a number representing the chain ID.
getConnectedChainName
Retrieves the name of the currently connected blockchain network.
Returns: A Promise resolving to a string representing the chain name.
transfer
Transfers a certain amount of a specific token to the specified address.
Parameters:
to
(string): The recipient's address.amount
(string): The amount of tokens to transfer.
Returns: A Promise resolving to a string representing the transaction hash.
Last updated