Constructor
new CaverExtKAS(chainId, accessKeyId, secretAccessKey)
Creates an instance of caver extension KAS.
This constructor sets the configurations used by each KAS API services with parameters.
When initializing the KAS API in the constructor, initialize the authentication key used in the Node API, Wallet API, Token History API, and Anchor API at once with KAS Production URL as default.
If you want to initialize each service or use an endpoint URL other than the production URL set as default,
you need to initialize it for each service using initNodeAPI, initTokenHistoryAPI, initWalletAPI, and initAnchorAPI.
Parameters:
Name | Type | Description |
---|---|---|
chainId |
number | The chain id. |
accessKeyId |
string | The access key id. |
secretAccessKey |
string | The secret access key. |
Members
wallet :KASWallet
The wallet member variable of CaverExtKAS is a KASWallet that operates by using the KAS Wallet API.
If you want to use the in-memory wallet provided by caver-js as it is, you can create an instance of KeyringContainer with const keyringContainer = new caver.keyringContainer()
.
Type:
kas :KAS
Type:
Methods
initKASAPI(chainId, accessKeyId, secretAccessKey) → {void}
Sets chain id and authentication key. This function sets the configurations used by each KAS API services.
Parameters:
Name | Type | Description |
---|---|---|
chainId |
number | The chain id. |
accessKeyId |
string | The access key id. |
secretAccessKey |
string | The secret access key. |
Returns:
- Type
- void
initNodeAPI(chainId, accessKeyId, secretAccessKey, urlopt) → {void}
Sets chain id and authentication key for Node API.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chainId |
number | The chain id. |
|
accessKeyId |
string | The access key id. |
|
secretAccessKey |
string | The secret access key. |
|
url |
string |
<optional> |
The end point url. |
Returns:
- Type
- void
initTokenHistoryAPI(chainId, accessKeyId, secretAccessKey, urlopt) → {void}
Sets chain id and authentication key for Token History API.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chainId |
number | The chain id. |
|
accessKeyId |
string | The access key id. |
|
secretAccessKey |
string | The secret access key. |
|
url |
string |
<optional> |
The end point url. |
Returns:
- Type
- void
initWalletAPI(chainId, accessKeyId, secretAccessKey, urlopt) → {void}
Sets chain id and authentication key for Wallet API.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chainId |
number | The chain id. |
|
accessKeyId |
string | The access key id. |
|
secretAccessKey |
string | The secret access key. |
|
url |
string |
<optional> |
The end point url. |
Returns:
- Type
- void
initAnchorAPI(chainId, accessKeyId, secretAccessKey, urlopt) → {void}
Sets chain id and authentication key for Anchor API.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chainId |
number | The chain id. |
|
accessKeyId |
string | The access key id. |
|
secretAccessKey |
string | The secret access key. |
|
url |
string |
<optional> |
The end point url. |
Returns:
- Type
- void
initKIP17API(chainId, accessKeyId, secretAccessKey, urlopt) → {void}
Sets chain id and authentication key for KIP17 API.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
chainId |
number | The chain id. |
|
accessKeyId |
string | The access key id. |
|
secretAccessKey |
string | The secret access key. |
|
url |
string |
<optional> |
The end point url. |
Returns:
- Type
- void