Wallet
- walletBalance
- walletDefaultAddress
- walletDelete
- walletExport
- walletHas
- walletImport
- walletList
- walletNew
- walletSetDefault
- walletSign
- walletSignMessage
- walletValidateAddress
- walletVerify
walletBalance
walletBalance (address: string): Promise<string>
Returns the balance of the given address at the current head of the chain.
Parameters:
address
:string
Returns:
Promise<string>
Source: index.d.ts, line 776, character 15
walletDefaultAddress
walletDefaultAddress (): Promise<string>
Returns the address marked as default in the wallet.
Returns:
Promise<string>
Source: index.d.ts, line 780, character 22
walletDelete
walletDelete (address: string): Promise<void>
Deletes an address from the wallet.
Parameters:
address
:string
Returns:
Promise<void>
Source: index.d.ts, line 784, character 14
walletExport
walletExport (address: string): Promise<KeyInfo>
Returns the private key of an address in the wallet.
Parameters:
address
:string
Returns:
Promise<KeyInfo>
Source: index.d.ts, line 788, character 14
walletHas
walletHas (address: string): Promise<boolean>
Indicates whether the given address is in the wallet.
Parameters:
address
:string
Returns:
Promise<boolean>
Source: index.d.ts, line 792, character 11
walletImport
walletImport (keyInfo: KeyInfo): Promise<string>
Receives a KeyInfo, which includes a private key, and imports it into the wallet.
Parameters:
keyInfo
:KeyInfo
Returns:
Promise<string>
Source: index.d.ts, line 796, character 14
walletList
walletList (): Promise<Array<string>>
Lists all the addresses in the wallet.
Returns:
Promise<Array<string>>
Source: index.d.ts, line 800, character 12
walletNew
walletNew (keyType: string): Promise<string>
Creates a new address in the wallet with the given sigType. Available key types: bls, secp256k1, secp256k1-ledger Support for numerical types: 1 - secp256k1, 2 - BLS is deprecated
Parameters:
keyType
:string
Returns:
Promise<string>
Source: index.d.ts, line 806, character 11
walletSetDefault
walletSetDefault (address: string): Promise<void>
Marks the given address as as the default one.
Parameters:
address
:string
Returns:
Promise<void>
Source: index.d.ts, line 810, character 18
walletSign
walletSign (address: string, bytes: string): Promise<Signature>
Signs the given bytes using the given address.
Parameters:
address
:string
bytes
:string
Returns:
Promise<Signature>
Source: index.d.ts, line 814, character 12
walletSignMessage
walletSignMessage (address: string, message: Message): Promise<SignedMessage>
Signs the given message using the given address.
Parameters:
address
:string
message
:Message
Returns:
Promise<SignedMessage>
Source: index.d.ts, line 818, character 19
walletValidateAddress
walletValidateAddress (str: string): Promise<string>
Validates whether a given string can be decoded as a well-formed address
Parameters:
str
:string
Returns:
Promise<string>
Source: index.d.ts, line 822, character 23
walletVerify
walletVerify (address: string, bytes: string, signature: Signature): Promise<boolean>
Takes an address, a signature, and some bytes, and indicates whether the signature is valid. The address does not have to be in the wallet.
Parameters:
address
:string
bytes
:string
signature
:Signature
Returns:
Promise<boolean>