KAS

KAS

The class that manages KAS API services.

Constructor

new KAS()

Creates an instance of KAS.

Example
caver.kas // `caver.kas` is the KAS instance.

Members

tokenHistory :TokenHistory

Type:

wallet :Wallet

Type:

anchor :Anchor

Type:

kip17 :KIP17

Type:

Methods

initTokenHistoryAPI(chainId, accessKeyId, secretAccessKey, url) → {void}

Sets chain id and authentication key for Token History API.
Since caver.initTokenHistoryAPI calls this function internally, it is recommended to use caver.initTokenHistoryAPI.

Example
caver.kas.initTokenHistoryAPI(1001, 'accessKeyId', 'secretAccessKey', 'https://th-api.klaytnapi.com')
Parameters:
Name Type Description
chainId number

The chain id.

accessKeyId string

The access key id.

secretAccessKey string

The secret access key.

url string

The end point url.

Returns:
Type
void

initWalletAPI(chainId, accessKeyId, secretAccessKey, url) → {void}

Sets chain id and authentication key for Wallet API.
Since caver.initWalletAPI calls this function internally, it is recommended to use caver.initWalletAPI.

Example
caver.kas.initWalletAPI(1001, 'accessKeyId', 'secretAccessKey', 'https://wallet-api.klaytnapi.com')
Parameters:
Name Type Description
chainId number

The chain id.

accessKeyId string

The access key id.

secretAccessKey string

The secret access key.

url string

The end point url.

Returns:
Type
void

initAnchorAPI(chainId, accessKeyId, secretAccessKey, url) → {void}

Sets chain id and authentication key for Anchor API.
Since caver.initAnchorAPI calls this function internally, it is recommended to use caver.initAnchorAPI.

Example
caver.kas.initAnchorAPI(1001, 'accessKeyId', 'secretAccessKey', 'https://anchor-api.klaytnapi.com')
Parameters:
Name Type Description
chainId number

The chain id.

accessKeyId string

The access key id.

secretAccessKey string

The secret access key.

url string

The end point url.

Returns:
Type
void

initKIP17API(chainId, accessKeyId, secretAccessKey, url) → {void}

Sets chain id and authentication key for KIP17 API.
Since caver.initKIP17API calls this function internally, it is recommended to use caver.initKIP17API.

Example
caver.kas.initKIP17API(1001, 'accessKeyId', 'secretAccessKey', 'https://kip17-api.klaytnapi.com')
Parameters:
Name Type Description
chainId number

The chain id.

accessKeyId string

The access key id.

secretAccessKey string

The secret access key.

url string

The end point url.

Returns:
Type
void