-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
723 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
481 changes: 453 additions & 28 deletions
481
postman/collections/komodo_defi.postman_collection.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
88 changes: 88 additions & 0 deletions
88
src/pages/komodo-defi-framework/api/v20/utils/get_token_info/index.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
export const title = "Komodo DeFi Framework Method: Get Token Info"; | ||
export const description = "The `get_token_info` method returns the ticker and decimals values (required for activation) given a platform and contract as input."; | ||
|
||
# get\_token\_info | ||
|
||
The `get_token_info` method returns the ticker and decimals values (required for activation) given a platform and contract as input. | ||
The platform parent coin (e.g. ETH, AVAX, MATIC etc) must be activated before using this method. After requesting the token info, you will be able to activate the custom token. | ||
|
||
<Note> | ||
Custom tokens will be `wallet_only` - i.e. you can send and recieve tokens, but will not be able to do atomic swaps. | ||
To apply for a formal listing of the custom token, please [review the requirements](/komodo-defi-framework/tutorials/listing-a-new-coin/) in our "coins" github repository, and get in our with our team on the [KomodoPlatform Discord](https://komodoplatform.com/discord). | ||
</Note> | ||
|
||
## Arguments | ||
|
||
| Structure | Type | Description | | ||
| ----------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| protocol.type | string | Token type - e.g `ERC20` for tokens on the Ethereum network | | ||
| protocol.protocol\_data | object | Required for tokens only. | | ||
| protocol.protocol\_data.platform | string | The parent coin of the token's platform - e.g `MATIC` for PLG20 tokens | | ||
| protocol.protocol\_data.contract\_address | string | **Must be mixed case** The identifying hex string for the token's contract. Can be found on sites like [EthScan](https://etherscan.io/), [BscScan](https://bscscan.com/) & [PolygonScan](https://polygonscan.com/) | | ||
|
||
### Response | ||
|
||
| Structure | Type | Description | | ||
| ------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| type | string | Token type - e.g `PLG20` for tokens on the Polygon network | | ||
| info.symbol | string | The ticker of the token linked to the contract address and network requested | | ||
| info.decimals | integer | Defines the number of digits after the decimal point that should be used to display the orderbook amounts, balance, and the value of inputs to be used in the case of order creation or a `withdraw` transaction. The default value used for a UTXO type coin (Bitcoin Protocol) is `8` and the default value used for a ERC20 Token is `18`. It is **very important** for this value to be set correctly. For example, if this value was set as `9` for BTC, a command to withdraw `1 BTC` tries to withdraw `10^9` satoshis of Bitcoin, i.e., `10 BTC` | | ||
|
||
### 📌 Examples | ||
|
||
#### Get Token Info on Avalanche | ||
|
||
<CodeGroup title="Get Token Info" tag="POST" label="get_token_info" mm2MethodDecorate="true"> | ||
```json | ||
{ | ||
"userpass": "RPC_UserP@SSW0RD", | ||
"mmrpc": "2.0", | ||
"method": "get_token_info", | ||
"params": { | ||
"protocol": { | ||
"type": "ERC20", | ||
"protocol_data": { | ||
"platform": "AVAX", | ||
"contract_address": "0x4f3c5C53279536fFcfe8bCafb78E612E933D53c6" | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
</CodeGroup> | ||
|
||
<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response"> | ||
#### Response (success) | ||
|
||
```json | ||
{ | ||
"mmrpc": "2.0", | ||
"result": { | ||
"type": "ERC20", | ||
"info": { | ||
"symbol": "PNIC", | ||
"decimals": 18 | ||
} | ||
}, | ||
"id": null | ||
} | ||
``` | ||
</CollapsibleSection> | ||
|
||
### Error Responses | ||
|
||
#### InvalidRequest: Protocol parent coin not active | ||
|
||
```json | ||
{ | ||
"mmrpc": "2.0", | ||
"error": "No such coin AVAX", | ||
"error_path": "tokens.lp_coins", | ||
"error_trace": "tokens:68] lp_coins:4744]", | ||
"error_type": "NoSuchCoin", | ||
"error_data": { | ||
"coin": "AVAX" | ||
}, | ||
"id": null | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export const title = "Komodo DeFi Framework Method: v2 Utilities"; | ||
export const description = | ||
"This section includes utility methods for the Komodo DeFi Framework."; | ||
|
||
# v2 Utility Methods | ||
|
||
* [get\_current\_mtp](/komodo-defi-framework/api/v20/utils/get_current_mtp/) | ||
* [get\_token\_info](/komodo-defi-framework/api/v20/utils/get_token_info/) | ||
* [peer\_connection\_healthcheck](/komodo-defi-framework/api/v20/utils/peer_connection_healthcheck/) |
File renamed without changes.