Last updated
Last updated
caver.transaction
는 트랜잭션 관련 기능을 제공하는 패키지입니다.
각 트랜잭션 클래스에 대한 자세한 설명이 있습니다:
Decodes RLP-encoded transaction string, a raw transaction, and returns a instance.
Parameters
Return Value
Example
Queries a transaction from Klaytn and converts to a caver transaction instance.
Parameters
Return Value
Example
Recovers the public key strings from signatures
field of the given transaction.
Parameters
Return Value
Example
Recovers the public key strings from feePayerSignatures
field of the given transaction.
Parameters
Return Value
Example
Signs the transaction as a transaction sender with the private key(s) in the keyring
and appends signatures
in the transaction object.
Parameters
Return Value
Promise
는 객체
를 반환: 서명된 트랜잭션입니다.
Example
트랜잭션 fee payer
로서 서명하며, keyring
내 개인키를 사용하여 트랜잭션 객체에 feePayerSignatures
를 첨부합니다.
transaction.feePayer
가 정의되어 있지 않은 경우, 주어진 keyring의 주소는 transaction.feePayer
로 설정됩니다.
참고 이 함수는 "수수료 대납" 트랜잭션 또는 "수수료 부분 대납" 트랜잭션에서만 작동합니다.
Parameters
Return Value
Promise
returning object
: The signed transaction.
Example
Appends signatures
to the transaction.
Parameters
Example
Appends feePayerSignatures
to the transaction.
NOTE This function works only for "fee-delegated" transactions or "fee-delegated with ratio" transactions.
Parameters
Example
Collects signs in each RLP-encoded transaction string in the given array, combines them with the transaction instance, and returns a RLP-encoded transaction string which includes all signs. Note that the transaction instance doesn't necessarily be signed in advance. If the transaction is either a type of "fee-delegated" or "fee-delegated with ratio", feePayerSignatures
is also merged and included in the output RLP-encoded transaction string.
Parameters
Return Value
Example
RLP 인코딩된 트랜잭션 문자열을 반환합니다.
Return Value
Example
Return Value
Example
transactionHash
를 반환합니다.
Return Value
Example
Return Value
Example
트랜잭션 전송자의 서명을 만들기 위한 RLP 인코딩된 트랜잭션 문자열을 반환합니다. 반환된 RLP 인코딩된 트랜잭션 문자열은 서명에 추가되는 것이 아니라, 이 서명을 생성하는 데 사용된다는 점을 참고하세요.
Return Value
Example
수수료 납부자의 서명을 생성하기 위한 RLP 인코딩된 트랜잭션 문자열을 반환합니다. Note that the returned RLP-encoded transaction string is not added with the signature and rather is used to generate this signature.
NOTE This function works only for "fee-delegated" transactions or "fee-delegated with ratio" transactions.
Return Value
Example
트랜잭션의 선택 사항 변수들을 기입해 줍니다.
이 메서드는 트랜잭션의 선택 변수 gasPrice
, nonce
, 또는 chainId
가 정의되지 않은 경우, 각각의 기본값을 조회하여 연결된 Klaytn Node에 JSON RPC 호출을 함으로서 이 값들을 지정시킵니다.
Return Value
Promise
는 void
을 반환합니다.
Example
signatures
에서 공개키 스트링을 복구합니다.
Return Value
Example
feePayerSignatures
필드에서 공개키 문자열을 복구합니다.
Return Value
Example
Before the Magma hard fork, suggestGasPrice
returns the unit price of the network. After the Magma hard fork, suggestGasPrice
returns baseFee * 2
which is recommended to use as gasPrice.
Return Value
Promise
returning string
: The suggested gas price in hexadecimal string.
Example
NOTE caver.transaction.getTransactionByHash
is supported since caver-js .
Promise
returning object
: An instance of . If it fails to receive a transaction object from Klaytn, an error occurs.
NOTE caver.transaction.recoverPublicKeys
is supported since caver-js .
NOTE caver.transaction.recoverFeePayerPublicKeys
is supported since caver-js .
For transaction, use , or otherwise, use in . If the user has not defined an index
, transaction.sign
signs the transaction using all the private keys used by the role. If index
is defined, the transaction.sign
signs the transaction using only one private key at the given index.
For signing a transaction as a fee payer, use in keyring
. 사용자가 index
를 정의하지 않았다면, transaction.signAsFeePayer
이 해당 역할에 의해 사용되는 모든 개인키를 가지고 트랜잭션에 서명합니다. index
가 정의되어 있다면, transaction.signAsFeePayer
이 주어진 인덱스에 대응하는 하나의 개인키를 가지고 트랜잭션에 서명합니다.
If the keyring
to be used for signing the transaction was added to caver.wallet
, you can use .
For information on how to make the RLP-encoded string for each transaction type, see .
rawTransaction
문자열을 반환합니다(RLP 인코딩된 트랜잭션 문자열). This function is same with .
For information on how to make the transaction hash for each transaction type, see .
Returns a of transaction.
The is a hash of the transaction except for the fee payer's address and signature, so and are the same for basic transactions.
For information on how to make the for each transaction type, see .
For information on how to make a RLP-encoded transaction string to generate the transaction sender's signature for each transaction type, see .
For information on how to make a RLP-encoded transaction string to generate the fee payer's signature for each transaction type, see .
Use to get gasPrice
, to get nonce
and call to get chainId
.
참고 transaction.recoverPublicKeys
는 caver-js 부터 지원됩니다.
참고 transaction.recoverFeePayerPublicKeys
는 caver-js 부터 지원됩니다.
Returns suggested gas price. This function is used to set gasPrice field in the .
NOTE transaction.suggestGasPrice
is supported since caver-js .