new Kip17TokenApi()
- Version:
- 1.0
Kip17Token service.
Methods
approveAll(opts, callback)
Approve/Deny Transfers of All Token Grant or deny authorization to `to` to send all tokens owned by `from` in a specified contract.<p></p> You will see in `Submitted` in the response even when you enter the wrong address or token ID, or when the `from` and `owner` are different. But that does not mean that it is successfully `Committed`). To confirm transaction status, use Get Transaction Receipt from the Wallet API /v2/tx/{transaction-hash}.<p></p>
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~approveAllCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip17TransactionStatusResponse |
approveToken(opts, callback)
Approve/Deny Authorization for Token Transfers Grant or deny authorization to `to` to send a specified token. To deny authorization, enter `0x0000000000000000000000000000000000000000` for `to`. You will see in `Submitted` in the response even when you enter the wrong token ID, the `from` and `owner` are differet. But that does not mean that it is successfully `Committed`. To confirm transaction status, use Get Transaction Receipt from the Wallet API /v2/tx/{transaction-hash}.<p></p> ##### From `from` is the address that sends the transaction. If `from` is an account in the default `account-pool` of KIP-17 or Wallet Service, you can omit the KRN header. <br /> Otherwise you need to include the KRN header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~approveTokenCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip17TransactionStatusResponse |
burnToken(opts, callback)
Burn Token Burns a token. You will see `Submitted` in the response even when you enter the wrong token ID, the `from` and `owner` are different, or when `from` is not authorized to burn the token. But that does not mean that it is successfully `Committed`. To confirm transaction status, use Get Transaction Receipt from the Wallet API /v2/tx/{transaction-hash}.<p></p> ##### From `from` is the address that sends the transaction. If `from` is an account in the default `account-pool` of KIP-17 or Wallet Service, you can omit the KRN header. <br /> Otherwise you need to include the KRN header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~burnTokenCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip17TransactionStatusResponse |
getOwnerTokens(opts, callback)
List Tokens by Address Returns a list of all tokens existent for a contract.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~getOwnerTokensCallback | The callback function, accepting three arguments: error, data, response data is of type: GetOwnerKip17TokensResponse |
getToken(callback)
Get Token Data Returns the data of a specified token. You can use the contract alias in place of the address.<p></p>
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
Kip17TokenApi~getTokenCallback | The callback function, accepting three arguments: error, data, response data is of type: GetKip17TokenResponse |
getTokenHistory(opts, callback)
Get Token Ownership History Returns the transaction history of a specified token from the time it was minted. Each item in the response represents a transfer.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~getTokenHistoryCallback | The callback function, accepting three arguments: error, data, response data is of type: GetKip17TokenHistoryResponse |
listTokens(opts, callback)
Get Token List Returns a list of all tokens minted from a specified KIP-17 contract. You can use the contract alias in place of the address.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~listTokensCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip17TokenListResponse |
mintToken(opts, callback)
Mint Token Mints a new token from a specified KIP-17 contract. You can use the contract alias in place of the address. > NOTE > > Minting a token to an address outside the KAS Account Pool hinders you from sending or burning the token using KAS..
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~mintTokenCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip17TransactionStatusResponse |
transferToken(opts, callback)
Transfer Token Sends a token to a specified address. If the token has a different `sender` and `owner`, the `sender` must be authorized to send the token. You can authorize an account to send tokens via v1/contract/{contract-address-or-alias}/approve/{token-id}.<p></p> You will see `Submitted` in the response even when you enter a wrong token ID. But that does not mean that it is successfully `Committed`. To confirm transaction status, use Get Transaction Receipt from the Wallet API /v2/tx/{transaction-hash}. ##### Sender `sender` is the address that sends the transaction. If it is an account in the default `account-pool` of KIP-17 or Wallet Service, you can omit the KRN header. <br /> Otherwise you need to include the KRN header (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`).
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip17TokenApi~transferTokenCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip17TransactionStatusResponse |
Type Definitions
approveAllCallback(error, data, response)
Callback function to receive the result of the approveAll operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip17TransactionStatusResponse | 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 |
Kip17TransactionStatusResponse | 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 |
Kip17TransactionStatusResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
getOwnerTokensCallback(error, data, response)
Callback function to receive the result of the getOwnerTokens operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
GetOwnerKip17TokensResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
getTokenCallback(error, data, response)
Callback function to receive the result of the getToken operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
GetKip17TokenResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
getTokenHistoryCallback(error, data, response)
Callback function to receive the result of the getTokenHistory operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
GetKip17TokenHistoryResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
listTokensCallback(error, data, response)
Callback function to receive the result of the listTokens operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip17TokenListResponse | 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 |
Kip17TransactionStatusResponse | 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 |
Kip17TransactionStatusResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |