From 6bd53479676c9eb845793f084baf3bf79eeef7b9 Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 17 Oct 2024 01:25:47 +0800 Subject: [PATCH 1/5] add v2 get_enabled_coins method --- filepathSlugs.json | 8 ++ src/data/sidebar.json | 4 + src/pages/komodo-defi-framework/api/index.mdx | 2 +- .../api/legacy/get_enabled_coins/index.mdx | 4 + .../api/v20/get_enabled_coins/index.mdx | 82 +++++++++++++++++++ 5 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx diff --git a/filepathSlugs.json b/filepathSlugs.json index 3a7c3340..9fdc6706 100644 --- a/filepathSlugs.json +++ b/filepathSlugs.json @@ -2816,6 +2816,14 @@ "token-protocol-parse-error-error", "unexpected-token-protocol-error" ], + "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", diff --git a/src/data/sidebar.json b/src/data/sidebar.json index 9bdda563..352a2508 100644 --- a/src/data/sidebar.json +++ b/src/data/sidebar.json @@ -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/" diff --git a/src/pages/komodo-defi-framework/api/index.mdx b/src/pages/komodo-defi-framework/api/index.mdx index 724fb7ce..31a88ab7 100644 --- a/src/pages/komodo-defi-framework/api/index.mdx +++ b/src/pages/komodo-defi-framework/api/index.mdx @@ -38,7 +38,7 @@ Below is a table of the currently available legacy, v2.0 and v2.0 (Dev) methods: | | | [get\_channel\_details](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-channel-details) | | | | [get\_claimable\_balances](/komodo-defi-framework/api/v20-dev/lightning/channels/#get-claimable-balances) | | | | [get\_current\_mtp](/komodo-defi-framework/api/v20-dev/get_current_mtp/#get-current-mtp) | -| [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) | | | diff --git a/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx b/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx index acc6add0..4dda815c 100644 --- a/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx @@ -7,6 +7,10 @@ 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. + + This function is deprecated. Please consider using [get\_enabled\_coins v2.0](/komodo-defi-framework/api/v20/get_enabled_coins/) instead. + + ## Arguments | Structure | Type | Description | diff --git a/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx b/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx new file mode 100644 index 00000000..5e9f4030 --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx @@ -0,0 +1,82 @@ +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 + +**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 | +| ticker | string | the ticker of an activated coin | + +#### 📌 Examples + +#### Command + + + ```json + { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "get_enabled_coins", + "params": {}, + "id": 0 + } + ``` + + + + #### 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 + } + ``` + From 1cf72103cfc30221a4c921fef20e56b832e38204 Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 31 Oct 2024 11:35:32 +0800 Subject: [PATCH 2/5] add note about v2 method not returning addresses --- .../api/legacy/get_enabled_coins/index.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx b/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx index 4dda815c..5fb1d5ef 100644 --- a/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/get_enabled_coins/index.mdx @@ -8,7 +8,8 @@ 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. - This function is deprecated. Please consider using [get\_enabled\_coins v2.0](/komodo-defi-framework/api/v20/get_enabled_coins/) instead. + 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. ## Arguments From ee9b352b3dc7d3e4fcdaae8e800f304f54c6cf4c Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 31 Oct 2024 11:35:56 +0800 Subject: [PATCH 3/5] add linkages for `enable_hd` param in MM2.json --- .../api/v20-dev/hd_wallets_overview/index.mdx | 2 +- src/pages/komodo-defi-framework/changelog/index.mdx | 2 +- .../komodo-defi-framework/setup/configure-mm2-json/index.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/komodo-defi-framework/api/v20-dev/hd_wallets_overview/index.mdx b/src/pages/komodo-defi-framework/api/v20-dev/hd_wallets_overview/index.mdx index 51ba6e50..f69aee11 100644 --- a/src/pages/komodo-defi-framework/api/v20-dev/hd_wallets_overview/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20-dev/hd_wallets_overview/index.mdx @@ -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. - 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`. diff --git a/src/pages/komodo-defi-framework/changelog/index.mdx b/src/pages/komodo-defi-framework/changelog/index.mdx index ef9f500e..e5f6d3dc 100644 --- a/src/pages/komodo-defi-framework/changelog/index.mdx +++ b/src/pages/komodo-defi-framework/changelog/index.mdx @@ -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. diff --git a/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx b/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx index 7fdbfb56..060c63cb 100644 --- a/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx +++ b/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx @@ -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/). Using the same seed phrase with / without setting `enable_hd` to `true` From 9a561b2f8bc906a8a4618cc3b0479f26242981df Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 31 Oct 2024 12:42:46 +0800 Subject: [PATCH 4/5] add links between legacy and v2 method variants --- .../api/v20/get_enabled_coins/index.mdx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx b/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx index 5e9f4030..88158d28 100644 --- a/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx @@ -3,8 +3,6 @@ export const description = "The get_enabled_coins method returns data of coins t # get\_enabled\_coins -**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 @@ -15,10 +13,17 @@ The `get_enabled_coins` method returns data of coins that are currently enabled #### Response -| Structure | Type | Description | -| -------------- | ---------------- | ------------------------------------------------ | -| coins | array of objects | A list of key value pairs for activated tickers | -| ticker | string | the ticker of an activated coin | +| 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 | + + + + 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). + + #### 📌 Examples From b07a168e2f76cd6f85656ac6fd994dc3b5caa8e1 Mon Sep 17 00:00:00 2001 From: smk762 Date: Thu, 31 Oct 2024 04:56:29 +0000 Subject: [PATCH 5/5] [Bot] File and author data updated, validated and updated internal links, formatted md content, checked presence of file and dirs based on sidebar, checked presence of h1 in every file, update Komodo DeFi Framework methods table, adds/updates preview images when base is main --- .../api/v20/get_enabled_coins/index.mdx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx b/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx index 88158d28..b748e900 100644 --- a/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/get_enabled_coins/index.mdx @@ -13,18 +13,16 @@ The `get_enabled_coins` method returns data of coins that are currently enabled #### 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 | - +| 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 | - The [get\_enabled\_coins v2.0] method does not return addresses, as it was designed for HD wallets, which generate addresses on the fly. + 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). - #### 📌 Examples #### Command