new Kip37ContractApi()
- Version:
- 1.0
Kip37Contract service.
Methods
approveAll(opts, callback)
Grant/Remove Authorization for Token Transfers Grants/cancels authorization to a third party (`to`) to transfer all tokens for a specified contract. ##### From The account that sends the transaction. If the `from` account belongs to a default `account-pool` for either KIP-37 or Wallet, you can omit the KRN.<br /> Otherwise you have to provide the KRN data (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`) in the header.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~approveAllCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37TransactionStatusResponse |
deployContract(opts, callback)
Deploy KIP-37 Contract Deploys a KIP-37 contract. <br/> KIP-37 supports the use of `alias`, which you can use in place of the account address. The `alias` must only contain lowercase letters, numbers and hyphens and begin with a lowercase letter. ##### Options Options for paying the transaction fee. For more details, please refer to Fee Payer Options.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~deployContractCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37DeployResponse |
getContract(callback)
Get KIP-37 Contract Information Queries a specified contract using the alias or the contract address.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
Kip37ContractApi~getContractCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37Contract |
importContract(opts, callback)
Import KIP-37 Contract Import a contract that has already been deployed.<br/> The `alias` must only contain lowercase letters, numbers and hyphens and begin with a lowercase letter. ##### Options Options for paying the transaction fee. For more details, please refer to Fee Payer Options.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~importContractCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37Contract |
listContractsInDeployerPool(opts, callback)
Get KIP-37 Contract Get a list of all KIP-37 contracts by account. The response items will be listed in the order of contract creation request time. <br/><br/> The `status` field in the response can contain the following: - `init`: Initial state before transaction is sent - `submitted`: Contract deployment transaction has been sent - `deployed`: Contract has been deployed - `imported`: Contract list has been imported - `failed`: Contract deployment transaction has failed
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~listContractsInDeployerPoolCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37ContractListResponse |
pauseContract(opts, callback)
Pause KIP-37 Contract Pauses all operations for a specified contract, such as minting, transfering tokens.<br /> You can resume using /v1/{contract-address-or-alias/unpause. ##### Sender The Account that sends the transaction. If the `sender` account belongs to a default `account-pool` for either KIP-37 or Wallet, you can omit the KRN.<br /><br /> Otherwise you have to provide the KRN data (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`) in the header.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~pauseContractCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37TransactionStatusResponse |
putContract(opts, callback)
Edit KIP-37 Contract Information Edits the information of a contract. <br/> ##### Options Options for paying the transaction fee. For more details, please refer to Fee Payer Options.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~putContractCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37Contract |
unpauseContract(opts, callback)
Resume KIP-37 Contract Resumes the operations for a paused contract. ##### Sender The account for sending the transaction. If the `sender` account belongs to a default `account-pool` for either KIP-37 or Wallet, you can omit the KRN.<br /> Otherwise you have to provide the KRN data (`x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}`) in the header.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object | Optional parameters |
callback |
Kip37ContractApi~unpauseContractCallback | The callback function, accepting three arguments: error, data, response data is of type: Kip37TransactionStatusResponse |
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 |
Kip37TransactionStatusResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
deployContractCallback(error, data, response)
Callback function to receive the result of the deployContract operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37DeployResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
getContractCallback(error, data, response)
Callback function to receive the result of the getContract operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37Contract | The data returned by the service call. |
response |
String | The complete HTTP response. |
importContractCallback(error, data, response)
Callback function to receive the result of the importContract operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37Contract | The data returned by the service call. |
response |
String | The complete HTTP response. |
listContractsInDeployerPoolCallback(error, data, response)
Callback function to receive the result of the listContractsInDeployerPool operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37ContractListResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
pauseContractCallback(error, data, response)
Callback function to receive the result of the pauseContract operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37TransactionStatusResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |
putContractCallback(error, data, response)
Callback function to receive the result of the putContract operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37Contract | The data returned by the service call. |
response |
String | The complete HTTP response. |
unpauseContractCallback(error, data, response)
Callback function to receive the result of the unpauseContract operation.
Parameters:
| Name | Type | Description |
|---|---|---|
error |
String | Error message, if any. |
data |
Kip37TransactionStatusResponse | The data returned by the service call. |
response |
String | The complete HTTP response. |