Kip7TokenApi

Kip7TokenApi

new Kip7TokenApi()

Version:
  • 1.0

Kip7Token service.

Methods

addMinter(opts, callback)

Add Minter Grants a specified account the authority to mint and burn tokens from a contract. You can remove the authority by using Remove Minter. > NOTE > > `minter` is the address that will be granted the authority. It needs to be managed by Wallet API in order to be use Remove Minter. Otherwise, you have to sign and send the transaction yourself. ##### Sender The account that sends the transaction to grant the authority for tokens. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `sender` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~addMinterCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

approveToken(opts, callback)

Authorize to Send Token Grants authority to `spender` to send a certain amount of tokens from the `owner`'s account. To send the token as an authorized `spender`, use Send Token on Behalf of Owner.<p></p> > NOTE > > `spender` is the address that will be granted the authority. It needs to be managed by Wallet API in order to be use Send Token on Behalf of Owner. ##### Owner The account that owns the token, and grants authority to `spender`. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `owner` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~approveTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

burnFromToken(opts, callback)

Burn Authorized Tokens Burns the tokens from the amount that the `spender` is authorized to send, as specified by the `owner`. The remaining balance of the tokens that the `sender` is allowed to send can be found via Get Token Balance.<p></p> ##### Spender The account that sends the transaction. You can omit the KRN if the `spender` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~burnFromTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

burnToken(opts, callback)

Burn Token Burns tokens. The contract's `totalSupply` will be reduced accordingly. You can find the `totalSupply` by using Get Contract. <p></p> ##### From The account that sends the transaction to burn tokens. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `from` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~burnTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

getTokenAllowance(callback)

Get Approved Balance Returns the remaining balance of the tokens that the `owner` authorized the `spender` to send.<p></p>

Parameters:
Name Type Description
callback Kip7TokenApi~getTokenAllowanceCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TokenBalanceResponse

getTokenBalance(callback)

Get Token Balance &quot;Returns the `owner`'s balance of the tokens from a specified KIP-7 contract. <p></p> \n&quot;

Parameters:
Name Type Description
callback Kip7TokenApi~getTokenBalanceCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TokenBalanceResponse

mintToken(opts, callback)

Mint Token Mints a specified amount of tokens to a specified account address. The contract's `totalSupply` will increase accordingly.<p></p> ##### From The account that sends the transaction. You can enter the Klaytn account address of an authorized Minter, or leave it blank, so it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `from` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`). > NOTE > > Remember that a contract address is not an account address managed by Wallet Service, so it can't in `from`.

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~mintTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

renounceMinter(callback)

Remove Minter Removes the authority granted to a specifed account to mint and burn tokens from a contract. ##### Minter The address whose authority to mint and burn tokens will be removed. You can omit the KRN if the `minter-address` is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
callback Kip7TokenApi~renounceMinterCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

transferFromToken(opts, callback)

Send Token on Behalf of Owner Sends a token with an account authorized via Approve Token Transfer. You can view the remaining balance of authorized tokens by using Get Approved Balance.<p></p> ##### Spender The account that has been granted the authority from the `owner` to send tokens on his/her behalf. You can omit the KRN if the `spender` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~transferFromTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

transferToken(opts, callback)

Send Token Sends a token to a specified address. ##### From The account that sends the transaction to transfer tokens. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. <br/> You can omit the KRN if the `from` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~transferTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

Type Definitions

addMinterCallback(error, data, response)

Callback function to receive the result of the addMinter operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

approveTokenCallback(error, data, response)

Callback function to receive the result of the approveToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

burnFromTokenCallback(error, data, response)

Callback function to receive the result of the burnFromToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

burnTokenCallback(error, data, response)

Callback function to receive the result of the burnToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

getTokenAllowanceCallback(error, data, response)

Callback function to receive the result of the getTokenAllowance operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TokenBalanceResponse

The data returned by the service call.

response String

The complete HTTP response.

getTokenBalanceCallback(error, data, response)

Callback function to receive the result of the getTokenBalance operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TokenBalanceResponse

The data returned by the service call.

response String

The complete HTTP response.

mintTokenCallback(error, data, response)

Callback function to receive the result of the mintToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

renounceMinterCallback(error, data, response)

Callback function to receive the result of the renounceMinter operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

transferFromTokenCallback(error, data, response)

Callback function to receive the result of the transferFromToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

transferTokenCallback(error, data, response)

Callback function to receive the result of the transferToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

Kip7TokenApi

new Kip7TokenApi(apiClientopt)

Constructs a new Kip7TokenApi.

Parameters:
Name Type Attributes Description
apiClient ApiClient <optional>

Optional API client implementation to use, default to ApiClient#instance if unspecified.

Methods

addMinter(opts, callback)

Add Minter Grants a specified account the authority to mint and burn tokens from a contract. You can remove the authority by using Remove Minter. > NOTE > > `minter` is the address that will be granted the authority. It needs to be managed by Wallet API in order to be use Remove Minter. Otherwise, you have to sign and send the transaction yourself. ##### Sender The account that sends the transaction to grant the authority for tokens. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `sender` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~addMinterCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

approveToken(opts, callback)

Authorize to Send Token Grants authority to `spender` to send a certain amount of tokens from the `owner`'s account. To send the token as an authorized `spender`, use Send Token on Behalf of Owner.<p></p> > NOTE > > `spender` is the address that will be granted the authority. It needs to be managed by Wallet API in order to be use Send Token on Behalf of Owner. ##### Owner The account that owns the token, and grants authority to `spender`. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `owner` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~approveTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

burnFromToken(opts, callback)

Burn Authorized Tokens Burns the tokens from the amount that the `spender` is authorized to send, as specified by the `owner`. The remaining balance of the tokens that the `sender` is allowed to send can be found via Get Token Balance.<p></p> ##### Spender The account that sends the transaction. You can omit the KRN if the `spender` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~burnFromTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

burnToken(opts, callback)

Burn Token Burns tokens. The contract's `totalSupply` will be reduced accordingly. You can find the `totalSupply` by using Get Contract. <p></p> ##### From The account that sends the transaction to burn tokens. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `from` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~burnTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

getTokenAllowance(callback)

Get Approved Balance Returns the remaining balance of the tokens that the `owner` authorized the `spender` to send.<p></p>

Parameters:
Name Type Description
callback Kip7TokenApi~getTokenAllowanceCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TokenBalanceResponse

getTokenBalance(callback)

Get Token Balance &quot;Returns the `owner`'s balance of the tokens from a specified KIP-7 contract. <p></p> \n&quot;

Parameters:
Name Type Description
callback Kip7TokenApi~getTokenBalanceCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TokenBalanceResponse

mintToken(opts, callback)

Mint Token Mints a specified amount of tokens to a specified account address. The contract's `totalSupply` will increase accordingly.<p></p> ##### From The account that sends the transaction. You can enter the Klaytn account address of an authorized Minter, or leave it blank, so it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. You can omit the KRN if the `from` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`). > NOTE > > Remember that a contract address is not an account address managed by Wallet Service, so it can't in `from`.

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~mintTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

renounceMinter(callback)

Remove Minter Removes the authority granted to a specifed account to mint and burn tokens from a contract. ##### Minter The address whose authority to mint and burn tokens will be removed. You can omit the KRN if the `minter-address` is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
callback Kip7TokenApi~renounceMinterCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

transferFromToken(opts, callback)

Send Token on Behalf of Owner Sends a token with an account authorized via Approve Token Transfer. You can view the remaining balance of authorized tokens by using Get Approved Balance.<p></p> ##### Spender The account that has been granted the authority from the `owner` to send tokens on his/her behalf. You can omit the KRN if the `spender` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~transferFromTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

transferToken(opts, callback)

Send Token Sends a token to a specified address. ##### From The account that sends the transaction to transfer tokens. If you leave it blank, it will automatically be set to the `deployer` address as default . You can find the `deployer` address by KIP7Deployer. <br/> You can omit the KRN if the `from` address is managed by the KIP-7 or Wallet Service `account-pool`.<br /> Otherwise you have to provide the KRN object in the header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).

Parameters:
Name Type Description
opts Object

Optional parameters

callback Kip7TokenApi~transferTokenCallback

The callback function, accepting three arguments: error, data, response data is of type: Kip7TransactionStatusResponse

Type Definitions

addMinterCallback(error, data, response)

Callback function to receive the result of the addMinter operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

approveTokenCallback(error, data, response)

Callback function to receive the result of the approveToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

burnFromTokenCallback(error, data, response)

Callback function to receive the result of the burnFromToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

burnTokenCallback(error, data, response)

Callback function to receive the result of the burnToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

getTokenAllowanceCallback(error, data, response)

Callback function to receive the result of the getTokenAllowance operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TokenBalanceResponse

The data returned by the service call.

response String

The complete HTTP response.

getTokenBalanceCallback(error, data, response)

Callback function to receive the result of the getTokenBalance operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TokenBalanceResponse

The data returned by the service call.

response String

The complete HTTP response.

mintTokenCallback(error, data, response)

Callback function to receive the result of the mintToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

renounceMinterCallback(error, data, response)

Callback function to receive the result of the renounceMinter operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

transferFromTokenCallback(error, data, response)

Callback function to receive the result of the transferFromToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.

transferTokenCallback(error, data, response)

Callback function to receive the result of the transferToken operation.

Parameters:
Name Type Description
error String

Error message, if any.

data Kip7TransactionStatusResponse

The data returned by the service call.

response String

The complete HTTP response.