Account
klay_accountCreated
입력된 주소의 계정이 존재하는 경우 true를 반환합니다. 해당 주소의 계정이 존재하지 않으면 false를 반환합니다.
Parameters
account
20-byte DATA
Address
block number or hash
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
Boolean
입력으로 받은 주소가 존재하는지 여부를 반환합니다.
Example
// Request
curl -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"klay_accountCreated","params":["0xa4f42d4d2a3a13874406435500950c9bf2d783db","latest"],"id":1}' https://public-en-baobab.klaytn.net
// Result
{
"jsonrpc":"2.0",
"id":1,
"result":true
}klay_accounts
Returns a list of addresses owned by client.
Parameters
None
Return Value
Array of 20-byte DATA
Addresses owned by the client.
Example
klay_encodeAccountKey
RLP(Recursive Length Prefix)를 사용해 계정 키를 인코딩합니다.
Parameters
key
JSON DATA
계정 키 객체
Return Value
DATA
RLP로 인코딩된 계정 키
Example
klay_decodeAccountKey
RLP 인코딩된 계정 키를 디코딩합니다.
Parameters
DATA
RLP encoded account key
Return Value
keytype
QUANTITY
Integer value indicating account key type.
key
JSON DATA
Account key object
Example
klay_getAccount
입력으로 받은 주소의 계정 정보를 반환합니다. Klaytn에는 스마트 컨트랙트 계정과 외부 소유 계정(EOA)이 있습니다. 자세한 내용은 Klaytn 계정을 참고해주세요.
Parameters
address
20-byte DATA
Address
block number or hash
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
Account
계정 유형에 따라 다른 속성을 반환합니다.
Example
klay_getAccountKey
입력으로 받은 주소의 외부 소유 계정(EOA)에 해당하는 계정의 키를 반환합니다. 해당 계정이 AccountKeyLegacy이거나 입력으로 받은 주소의 계정이 스마트 컨트랙트 계정이면 빈 값을 반환합니다. 자세한 내용은 계정 키를 참고해주세요.
Parameters
20-byte DATA
Address
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
AccountKey
계정 키는 1개 이상의 공개 키와 1가지 키 타입으로 구성됩니다.
Example
klay_getBalance
Returns the balance of the account of given address.
Parameters
address
20-byte DATA
Address to check for balance.
block number or hash
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
QUANTITY
Integer of the current balance in peb.
Example
klay_getCode
Returns code at a given address.
Parameters
20-byte DATA
Address
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
DATA
The code from the given address.
Example
klay_getTransactionCount
Returns the number of transactions sent from an address.
Parameters
20-byte DATA
Address
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
QUANTITY
Integer of the number of transactions send from this address.
Example
klay_isContractAccount
특정 번호의 블록 시간에서 입력으로 받은 계정의 codeHash가 비어 있지 않은 경우 true를 반환합니다. 해당 계정이 EOA이거나 codeHash가 비어 있는 스마트 컨트랙트 계정이면 false를 반환합니다.
Parameters
account
20-byte DATA
Address
block number or hash
QUANTITY | TAG | HASH
Integer or hexadecimal block number, or the string "earliest", "latest" or "pending" as in the default block parameter, or block hash.
NOTE: In versions earlier than Klaytn v1.7.0, only integer block number, the string "earliest" and "latest" are available.
Return Value
Boolean
리턴값이 true이면 매개변수가 기존에 있는 스마트 컨트랙트 계정 주소입니다.
Example
klay_sign
The sign method calculates a Klaytn-specific signature with:
Adding a prefix to the message makes the calculated signature recognizable as a Klaytn-specific signature. This prevents misuse where a malicious dApp can sign arbitrary data, e.g., transaction, and use the signature to impersonate the victim.
NOTE: The address to sign with must be unlocked.
Parameters
account
20-byte DATA
Address
message
N-byte DATA
Message to sign
Return Value
DATA
Signature
Example
Last updated
Was this helpful?