Skip to content

Commit

Permalink
Merge pull request #354 from KomodoPlatform/enabled_coins_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
gcharang authored Nov 17, 2024
2 parents b741054 + fd8930d commit 18f702b
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 4 deletions.
8 changes: 8 additions & 0 deletions filepathSlugs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2826,6 +2826,14 @@
"command",
"response-success"
],
"src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx": [
"get-enabled-coins",
"parameters",
"response",
"examples",
"command",
"response-2"
],
"src/pages/komodo-defi-framework/api/v20/get_public_key/index.mdx": [
"get-public-key",
"arguments",
Expand Down
4 changes: 4 additions & 0 deletions src/data/sidebar.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,10 @@
{
"title": "Wallet",
"links": [
{
"title": "get_enabled_coins",
"href": "/komodo-defi-framework/api/v20/get_enabled_coins/"
},
{
"title": "get_public_key",
"href": "/komodo-defi-framework/api/v20/get_public_key/"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/komodo-defi-framework/api/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods:
| | | [get\_claimable\_balances](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-claimable-balances) |
| | [get\_current\_mtp](/komodo-defi-framework/api/v20/get_current_mtp/#get-current-mtp) | |
| [get\_directly\_connected\_peers](/komodo-defi-framework/api/legacy/get_directly_connected_peers/#get-directly-connected-peers) | | |
| [get\_enabled\_coins](/komodo-defi-framework/api/legacy/get_enabled_coins/#get-enabled-coins) | | |
| [get\_enabled\_coins](/komodo-defi-framework/api/legacy/get_enabled_coins/#get-enabled-coins) | [get\_enabled\_coins](/komodo-defi-framework/api/v20/get_enabled_coins/#get-enabled-coins) | |
| [get\_gossip\_mesh](/komodo-defi-framework/api/legacy/get_gossip_mesh/#get-gossip-mesh) | | |
| [get\_gossip\_peer\_topics](/komodo-defi-framework/api/legacy/get_gossip_peer_topics/#get-gossip-peer-topics) | | |
| [get\_gossip\_topic\_peers](/komodo-defi-framework/api/legacy/get_gossip_topic_peers/#get-gossip-topic-peers) | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export const description = "The get_enabled_coins method returns data of coins t

The `get_enabled_coins` method returns data of coins that are currently enabled on the user's Komodo DeFi Framework API node.

<Note>
This function has been deprecated by [get\_enabled\_coins v2.0](/komodo-defi-framework/api/v20/get_enabled_coins/). The v2 method does not return addresses, as it was designed for HD wallets, which generate addresses on the fly.
If you need to get the addresses for coins and have not set `enable_hd` in your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/), use the v1 method.
</Note>

## Arguments

| Structure | Type | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ HD wallets offer several advantages over traditional wallets:
* Access Control: A user who controls the root seed can create new addresses & keypairs which can be shared with a 3rd party, providing limited or regulated access to funds held under specific pairs.

<Note type="info">
To use HD wallet functionality with the Komodo DeFi Framework API, you must include `"enable_hd":true` in your `MM2.json` file.
To use HD wallet functionality with the Komodo DeFi Framework API, you must include `"enable_hd":true` in your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/).
Hardware wallets like [Trezor](https://trezor.io/) are always in HD mode, and this parameter **must** to be set to `true`.
</Note>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
export const title = "Komodo DeFi Framework Method: Get Enabled Coins";
export const description = "The get_enabled_coins method returns data of coins that are currently enabled on the user's Komodo DeFi Framework API node.";

# get\_enabled\_coins

The `get_enabled_coins` method returns data of coins that are currently enabled on the user's Komodo DeFi Framework API node.

## Parameters

| Structure | Type | Description |
| --------- | ---- | ----------- |
| (none) | | |

#### Response

| Structure | Type | Description |
| ------------ | ---------------- | ----------------------------------------------- |
| coins | array of objects | A list of key value pairs for activated tickers |
| coins.ticker | string | the ticker of an activated coin |

<Note>
The \[get\_enabled\_coins v2.0] method does not return addresses, as it was designed for HD wallets, which generate addresses on the fly.
If you need to get the addresses for coins and have not set `enable_hd` in your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/), use the [v1 method](/komodo-defi-framework/api/legacy/get_enabled_coins/#get-enabled-coins).
</Note>

#### 📌 Examples

#### Command

<CodeGroup title="" tag="POST" label="get_enabled_coins" mm2MethodDecorate="true">
```json
{
"userpass": "RPC_UserP@SSW0RD",
"mmrpc": "2.0",
"method": "get_enabled_coins",
"params": {},
"id": 0
}
```
</CodeGroup>

<CollapsibleSection expandedText="Hide Response" collapsedText="Show Response">
#### Response

```json
{
"mmrpc": "2.0",
"result": {
"coins": [
{
"ticker": "ETH"
},
{
"ticker": "PGX-PLG20"
},
{
"ticker": "ATOM-IBC_IRIS"
},
{
"ticker": "NFT_ETH"
},
{
"ticker": "KMD"
},
{
"ticker": "IRIS"
},
{
"ticker": "AAVE-PLG20"
},
{
"ticker": "MINDS-ERC20"
},
{
"ticker": "NFT_MATIC"
},
{
"ticker": "MATIC"
}
]
},
"id": 0
}
```
</CollapsibleSection>
2 changes: 1 addition & 1 deletion src/pages/komodo-defi-framework/changelog/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ This release introduces a range of significant features designed to enhance the

* **HD Wallet:**

* HD wallet functionalities were fully implemented by @shamardy for UTXO and EVM coins, allowing users to enable the feature with `"enable_hd": true`. For Tendermint and Pirate coins, only a single address is supported, following the BIP32/39/44 standards.
* HD wallet functionalities were fully implemented by @shamardy for UTXO and EVM coins, allowing users to enable the feature with `"enable_hd": true` in the [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/). For Tendermint and Pirate coins, only a single address is supported, following the BIP32/39/44 standards.

* This implementation simplifies the process of importing mnemonics from other wallets into the Komodo DeFi Framework (KDF), enabling users to retain their balances, transaction history, and more.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ When running the Komodo DeFi API via commandline with the `mm2` binary, some bas

#### Example for HD Wallets:

If you are using HD wallets, you will need to set `enable_hd` to `true` in to your `MM2.json` file.
If you are using HD wallets, you will need to set `enable_hd` to `true` in to your [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/).

<Note>
Using the same seed phrase with / without setting `enable_hd` to `true`
Expand Down

0 comments on commit 18f702b

Please sign in to comment.