Constructor
new KASWallet(walletAPI)
Creates a wallet instance that uses the KAS Wallet API.
This will be used in caver.wallet
with CaverExtKAS.
Parameters:
Name | Type | Description |
---|---|---|
walletAPI |
Wallet | An instance of KAS Wallet api to use. |
Methods
(async) generate(numberOfAccounts) → {Array.<string>}
Generates accounts in the KAS wallet api service with randomly generated key pairs.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
numberOfAccounts |
number |
1
|
The number of accounts to create. |
Returns:
- Type
- Array.<string>
(async) getAccount(address) → {AccountCountByAccountID}
Get the account in KAS Wallet API Service corresponding to the address
Parameters:
Name | Type | Description |
---|---|---|
address |
string | The address of account to query. |
Returns:
(async) isExisted(address) → {boolean}
Returns whether the account corresponding to the address exists
Parameters:
Name | Type | Description |
---|---|---|
address |
string | The address of account to check existence. |
Returns:
- Type
- boolean
(async) remove(address) → {boolean}
Deletes the account that associates with the given address from KAS Wallet API service.
Parameters:
Name | Type | Description |
---|---|---|
address |
string | An address of the account to be deleted in KAS Wallet API service. |
Returns:
- Type
- boolean
(async) disableAccount(address) → {AccountSummary}
Deactivates account in KAS Wallet API Service
Parameters:
Name | Type | Description |
---|---|---|
address |
string | The address of Klaytn account to disable from KAS Wallet API service. |
Returns:
- Type
- AccountSummary
(async) enableAccount(address) → {AccountSummary}
Activates account in KAS Wallet API Service
Parameters:
Name | Type | Description |
---|---|---|
address |
string | The address of Klaytn account to enable from KAS Wallet API service. |
Returns:
- Type
- AccountSummary
(async) sign(address, transaction) → {AbstractTransaction}
- See:
Signs the transaction using one key and return the signed transaction
Parameters:
Name | Type | Description |
---|---|---|
address |
string | An address of account in KAS Wallet API Service. |
transaction |
AbstractTransaction | A transaction object of caver-js. See Klaytn Docs - Transaction for details. |
Returns:
- Type
- AbstractTransaction
(async) signAsFeePayer(address, transaction) → {AbstractFeeDelegatedTransaction}
- See:
Signs the transaction as a fee payer using one key and return the signed transaction
Parameters:
Name | Type | Description |
---|---|---|
address |
string | An address of account in KAS Wallet API Service. |
transaction |
AbstractFeeDelegatedTransaction | A fee delegated transaction object of caver-js. See Klaytn Docs - Fee Delegation Transaction and https://docs.klaytn.com/bapp/sdk/caver-js/api-references/caver.transaction/partial-fee-delegation for details. |
Returns:
- Type
- AbstractFeeDelegatedTransaction
(async) signAsGlobalFeePayer(transaction) → {AbstractFeeDelegatedTransaction}
- See:
Signs the transaction with the global fee payer using one key and return the signed transactionHash
Parameters:
Name | Type | Description |
---|---|---|
transaction |
AbstractFeeDelegatedTransaction | A fee delegated transaction object of caver-js. See Klaytn Docs - Fee Delegation Transaction and Klaytn Docs - Partial Fee Delegation Transaction for details. |
Returns:
- Type
- AbstractFeeDelegatedTransaction