Returns true if the account associated with the address is created. It returns false otherwise.
NOTE accountCreated checks if the account exists on the network, so even if a key pair is created, false is returned if the account matching the address does not exist on the actual blockchain network.
Parameters
Return Value
Promise returns Boolean - The existence of an input address.
Returns the account information of a given address. There are two different account types in Klaytn: Externally Owned Account (EOA) and Smart Contract Account. See Klaytn Accounts.
NOTE getAccount returns the account that exists on the network, so even if a key pair is created, null is returned if the account matching the address does not exist on the actual blockchain network.
Parameters
Return Value
Promise returns a JSON object - A JSON object that contains the account information.
Returns the account key of the Externally Owned Account (EOA) of the given address. If the account has AccountKeyLegacy or the account of the given address is a Smart Contract Account, it will return an empty key value. See Account Key.
NOTE getAccountKey returns the account key if the account exists on the network, so even if a key pair is created, null is returned if the account matching the address does not exist on the actual blockchain network.
Parameters
Return Value
Promise returns Object - The account key consist of public key(s) and a key type.
Returns true if an input account has a non-empty codeHash at the time of a specific block number. It returns false if the account is an EOA or a smart contract account which doesn't have codeHash.
Parameters
Return Value
Promise returns Boolean - true means the input parameter is an existing smart contract address.
Generates signed data specific to the Klaytn network. Refer to Klaytn Platform API - klay_sign to know how the signature is generated.
NOTE: This API provides the function to sign a message using an account that exists in your node. The account in the node must be unlocked to sign the message. To sign a transaction, use caver.klay.signTransaction.
Parameters
Return Value
Promise returns String - The message signature signed with the account's private key.
Example
>caver.klay.sign('Message to sign','0x1427ac5d0f1c3174ee6ea05d29a9b05fd31d7579').then(console.log)0xde8bd2f5a45de6b1baea57ed0219735ab60f0ef55c5e31a4b774824abea31bfc34c8bdbca43ed4155e8e6a8e0d11d7aba191ba025e0487ada2bcc422252b81591b
The address of the account you want to query to see if it has been created on the network.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
address
String
The address of the account for which you want to get account information.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
address
String
The address of the account for which you want to get accountKey.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
address
String
The address to get the balance of.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
address
String
The address to get the code from.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
address
String
The address to get the number of transactions from.
blockNumber
number | string
(optional) A block number, the string pending for the pending nonce, or the string earliest or latest as in the default block parameter. If omitted, latest will be used.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
Number
The number of transactions sent from the given address.
address
String
The address of the account you want to check for isContractAccount.
defaultBlock
Number | String
(optional) If you pass this parameter, it will not use the default block set with caver.klay.defaultBlock.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.
message
String
Message to sign.
address
String
The address of the account to sign the message with.
callback
Function
(optional) Optional callback, returns an error object as the first parameter and the result as the second.