diff --git a/.github/workflows/get_data_lint_files_deploy.yml b/.github/workflows/get_data_lint_files_deploy.yml index f998cebeb..c46e7712d 100644 --- a/.github/workflows/get_data_lint_files_deploy.yml +++ b/.github/workflows/get_data_lint_files_deploy.yml @@ -41,13 +41,19 @@ jobs: - name: Enable Corepack run: corepack enable - - name: Cache dependencies + - name: Get npm cache directory + id: npm-cache-dir + shell: bash + run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} + + - name: Cache npm dependencies uses: actions/cache@v4 + id: npm-cache with: - path: ~/.npm - key: npm-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + path: ${{ steps.npm-cache-dir.outputs.dir }} + key: ${{ runner.os }}-npm-${{ hashFiles('utils/js/package-lock.json') }} restore-keys: | - npm-${{ runner.os }}- + ${{ runner.os }}-npm- - name: Generate API methods table if: github.base_ref == 'main' || github.ref == 'refs/heads/main' @@ -157,16 +163,30 @@ jobs: - name: Enable Corepack run: corepack enable - - name: Restore cache + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + + - name: Cache yarn dependencies + uses: actions/cache@v4 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('website-komodoplatform.com/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Cache Next.js build uses: actions/cache@v4 with: path: | website-komodoplatform.com/.next/cache # Generate a new cache whenever packages or source files change. - key: - nextjs-${{ hashFiles('website-komodoplatform.com/yarn.lock') }}-${{ hashFiles('website-komodoplatform.com/**.[jt]s', 'website-komodoplatform.com/**.[jt]sx') }} - # If source files changed but packages didn't, rebuild from a prior cache. - restore-keys: nextjs-${{ hashFiles('website-komodoplatform.com/yarn.lock') }}- + key: ${{ runner.os }}-nextjs-${{ hashFiles('website-komodoplatform.com/yarn.lock') }}-${{ hashFiles('website-komodoplatform.com/src/**/*.[jt]s', 'website-komodoplatform.com/src/**/*.[jt]sx') }} + # If source files changed but packages didn't, rebuild from a prior cache. + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('website-komodoplatform.com/yarn.lock') }}- + ${{ runner.os }}-nextjs- - name: Get updated content, Install deps, build, Add no-index headers before publishing to cloudflare working-directory: website-komodoplatform.com @@ -214,21 +234,19 @@ jobs: rsync -avh --delete $GITHUB_WORKSPACE/utils/_fileData.json src/data/docs/_fileData.json rsync -avh --delete $GITHUB_WORKSPACE/utils/_searchIndex.json src/data/docs/searchIndex.json - # Export and add headers + # Build first to create .next directory, then export + yarn build yarn export echo -e "https://:project.pages.dev/*\n X-Robots-Tag: noindex" > ./out/_headers - name: Publish to Cloudflare Pages - uses: cloudflare/pages-action@v1 + uses: cloudflare/wrangler-action@v3 id: cf_publish with: apiToken: ${{ secrets.CF_API_TOKEN }} accountId: ${{ secrets.CF_ACCOUNT_ID }} - projectName: komodo-docs - directory: ./website-komodoplatform.com/out + command: pages deploy ./website-komodoplatform.com/out --project-name=komodo-docs --branch=${{ steps.vars.outputs.BRANCH_NAME }} gitHubToken: ${{ secrets.GITHUB_TOKEN }} - wranglerVersion: "3" - branch: ${{ steps.vars.outputs.BRANCH_NAME }} - name: Post Comprehensive Preview Comment uses: actions/github-script@v7 @@ -239,7 +257,7 @@ jobs: const prNumber = context.issue.number; const repo = context.repo.repo; const owner = context.repo.owner; - const previewBase = "${{ steps.cf_publish.outputs.url }}/en/docs"; + const previewBase = "${{ steps.cf_publish.outputs.deployment-url }}/en/docs"; const { data: commits } = await github.rest.pulls.listCommits({ owner, @@ -369,7 +387,7 @@ jobs: set -e set -o pipefail echo "PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true" >> $GITHUB_ENV - echo "CF_PUBLISH_URL=${{ steps.cf_publish.outputs.url }}" >> $GITHUB_ENV + echo "CF_PUBLISH_URL=${{ steps.cf_publish.outputs.deployment-url }}" >> $GITHUB_ENV - name: Generate Preview Images if: github.base_ref == 'main' || github.ref == 'refs/heads/main' @@ -412,6 +430,7 @@ jobs: set -e set -o pipefail rm -rf $GITHUB_WORKSPACE/website-komodoplatform.com + rm $GITHUB_WORKSPACE/package.json $GITHUB_WORKSPACE/package-lock.json # - name: Check if diff exists # id: diff_check diff --git a/.github/workflows/update-nodes.yml b/.github/workflows/update-nodes.yml new file mode 100644 index 000000000..ca8c186b4 --- /dev/null +++ b/.github/workflows/update-nodes.yml @@ -0,0 +1,156 @@ +name: Update Server Values in Request Examples + +on: + workflow_dispatch: + # Allow manual triggering + push: + paths: + - 'src/data/requests/kdf/**/*.json' + - 'utils/py/update_request_nodes.py' + branches: + - dev + - main + +jobs: + update-nodes: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Create virtual environment + run: | + python -m venv utils/py/.venv + source utils/py/.venv/bin/activate + pip install --upgrade pip + + - name: Find and update request JSON files + run: | + source utils/py/.venv/bin/activate + + echo "šŸ” Finding request JSON files to update..." + updated_files=() + + # Find all JSON files in the requests directory + find src/data/requests/kdf/ -name "*.json" | while read file; do + echo "šŸ“„ Processing: $file" + + # Run the update script and capture output + if python utils/py/update_request_nodes.py "$file" 2>&1 | grep -q "Successfully updated"; then + echo "āœ… Updated: $file" + echo "$file" >> /tmp/updated_files.txt + else + echo "ā„¹ļø No updates needed for: $file" + fi + done + + # Read updated files list if it exists + if [ -f /tmp/updated_files.txt ]; then + echo "šŸ“‹ Updated files:" + cat /tmp/updated_files.txt + echo "UPDATED_FILES_COUNT=$(wc -l < /tmp/updated_files.txt)" >> $GITHUB_ENV + else + echo "UPDATED_FILES_COUNT=0" >> $GITHUB_ENV + fi + + - name: Check for changes + id: check-changes + run: | + if git diff --quiet; then + echo "No changes detected" + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "Changes detected" + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Show changes + if: steps.check-changes.outputs.has_changes == 'true' + run: | + echo "šŸ“Š Changes summary:" + git diff --stat + echo "" + echo "šŸ” Detailed changes:" + git diff + + - name: Create Pull Request + if: steps.check-changes.outputs.has_changes == 'true' + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: | + šŸ”„ Update server values in request examples + + - Updated ${{ env.UPDATED_FILES_COUNT }} request file(s) with latest server/node values + - Supports ETH/EVM, Tendermint, UTXO, and ZHTLC protocols + - Limits to 3 servers max, prioritizing cipig/komodo domains + - Synchronized with coins repository data + - Addresses issue #360 + title: "šŸ”„ Update server values in request examples" + body: | + ## šŸ“‹ Summary + + This automated PR updates server and node values in documentation request examples to keep them synchronized with the latest data from the [coins repository](https://github.com/KomodoPlatform/coins). + + ## šŸ”§ Protocol Support + + The update script now supports all major coin protocols: + - **ETH/EVM**: Updates `nodes` from coins_config `nodes` + - **Tendermint**: Updates `nodes` from coins_config `rpc_urls` + - **UTXO**: Updates `servers` from coins_config `electrum` + - **ZHTLC**: Updates `light_wallet_d_servers` + `electrum_servers` + + ## šŸ“Š Server Selection + + - Limited to **3 servers maximum** for lightweight payloads + - **Priority domains**: cipig.net, komodo.earth preferred + - **Random selection** when more than 3 servers available + + ## šŸ“Š Changes + + - **Files Updated**: ${{ env.UPDATED_FILES_COUNT }} + - **Source**: https://raw.githubusercontent.com/KomodoPlatform/coins/master/utils/coins_config.json + - **Script**: `utils/py/update_request_nodes.py` + + ## šŸŽÆ Related Issue + + Addresses #360 - Keep electrum server values updated in the postman collection + + ## āœ… Validation + + - [x] All JSON files remain valid after updates + - [x] Only server/node arrays were modified + - [x] Original request structure preserved + + ## šŸ¤– Automation + + This PR was created automatically by the `update-nodes.yml` workflow. + + --- + + **Note**: Please review the changes to ensure the new server/node values are appropriate before merging. + branch: update-nodes-${{ github.run_number }} + delete-branch: true + labels: | + enhancement + automated + CI/CD + P1 + Important task which needs to be completed soon + + - name: Summary + run: | + if [ "${{ steps.check-changes.outputs.has_changes }}" = "true" ]; then + echo "šŸŽ‰ Successfully created PR with updated node values!" + echo "šŸ“Š Updated ${{ env.UPDATED_FILES_COUNT }} file(s)" + else + echo "āœ… All request files are already up-to-date!" + fi \ No newline at end of file diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 50b900c22..8e08b6438 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -90,12 +90,7 @@ CompactTable uses a source attribute that references table data stored in JSON f #### Import and Usage -First import the component at the top of your MDX file: -```jsx -import CompactTable from '@/components/mdx/CompactTable'; -``` - -Then use it with a source reference: +The CompactTable component is globally imported. To use it with a source reference: ```jsx ``` @@ -202,6 +197,77 @@ Also supports sending data directly, but not encouraged. /> ``` +### KdfResponses Component + +The `KdfResponses` component is used to display API responses for Komodo DeFi Framework methods. It automatically generates response examples from centralized JSON data files, ensuring consistency across documentation. + +#### How KdfResponses Works + +KdfResponses pulls response data from JSON files stored in `/src/data/responses/kdf/`: +- Response data is organized by subdirectory: `legacy/`, `v2/`, etc. +- Each JSON file contains multiple response definitions +- Responses are referenced using the `responseKey` attribute + +#### Usage + +The KdfResponses component is globally imported already. To use it: + +```jsx + +``` + +#### Response Key Format + +The `responseKey` attribute follows this pattern: +- `directory/filename.responsename` +- Examples: + - `legacy/coin_activation.LegacyElectrumBch` + - `legacy/coin_activation.LegacyEnableNative` + - `v2/activation.EnableCoinResponse` + +#### JSON Data Structure + +Response data files are located in `/src/data/responses/kdf/` and follow this structure: + +```json +{ + "ResponseName": { + "type": "success", + "title": "Response (successful activation)", + "description": "Optional description of the response", + "data": { + "result": { + "address": "RNacVDT8GwQ54CWe5PkEUemLz3WPapEXH9", + "balance": "0", + "coin": "KMD" + } + } + } +} +``` + +#### When to Use KdfResponses + +- **API method responses**: Display standardized response examples +- **Success responses**: Show expected successful returns +- **Error responses**: Document potential error states +- **Multiple response variations**: Different responses based on request parameters + +#### Benefits + +- **Centralized response management**: Update responses in one place +- **Consistency**: Ensures uniform response structure across docs +- **Validation**: JSON schema validation ensures data integrity +- **Reusability**: Same response data can be referenced from multiple pages +- **Automatic formatting**: Responses are automatically formatted as JSON code blocks + +#### Best Practices + +- Place `KdfResponses` immediately after the corresponding `CodeGroup` request example +- Use descriptive response names that match the method name +- Include both successful and error responses where applicable +- Group related responses in the same JSON file + ## Variables - For Komodo DeFi Framework API methods, the userpass variable should always be `RPC_UserP@SSW0RD` diff --git a/data-for-gpts/all-content.txt b/data-for-gpts/all-content.txt index 2c9b785a4..3ceb8d41f 100644 --- a/data-for-gpts/all-content.txt +++ b/data-for-gpts/all-content.txt @@ -31076,7 +31076,7 @@ The import file was created using: [GitHub - VerusCoin/Verus-Coin-Importer: A si Use at your own risk! export const title = "Komodo DeFi SDK Common Structures: Activation"; export const description = "The Komodo DeFi SDK uses a variety of activation methods, depending on the type of coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Activation Common Structures @@ -31273,7 +31273,7 @@ The `UtxoMergeParams` object defines how often and at which thresholds to merge ``` export const title = "Komodo DeFi Framework Method: Enums"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enums @@ -31548,7 +31548,7 @@ The `ScanPolicyEnum` defines the available scan policies for enabling coins with | `new` | Create a new account record (see [NewAccount](/komodo-defi-framework/api/common_structures/wallet/#new-account)) and immediately set it as the enabled account. | export const title = "Komodo DeFi Framework RPC Errors"; export const description = "A comprehensive list of possible RPC errors in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # KDF RPC Errors @@ -34346,7 +34346,7 @@ This document lists all possible error types that can be returned by the Komodo | ZcashParamsError | An error occurred with the Zcash parameters. | export const title = "Komodo DeFi Framework Method: Common Structures"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Common Structures @@ -34597,7 +34597,7 @@ Within each session object, there are a some values which are required as input ### ErrorResponse export const title = "Komodo DeFi Framework Method: Lightning Common Structures"; export const description = "Lightning Network common structures for Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Lightning Common Structures @@ -34656,7 +34656,7 @@ See [https://github.com/KomodoPlatform/komodo-docs-mdx/pull/31#discussion\\\_r12 ### LightningClosedChannelsFilter export const title = "Komodo DeFi SDK Common Structures: Non-Fungible Tokens"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # NFT Common Structures @@ -34780,7 +34780,7 @@ Sub-object of [TokenProtocol](/komodo-defi-framework/api/common_structures/nfts/ The `WithdrawNftData` object is used for withdrawals of NFTs on ERC721 and ERC1155 contracts. It includes the following items for a given coin or token: export const title = "Komodo DeFi SDK Common Structures: Orders"; export const description = "Each order on the Komodo Defi oderbook can be queried to view full details of each order for a pair, or the best orders for a ticker."; -import CompactTable from '@/components/mdx/CompactTable'; + # Order Common Structures @@ -35018,7 +35018,7 @@ Used within [PairDepth](/komodo-defi-framework/api/common_structures/orders/#pai ``` export const title = "Komodo DeFi Framework Method: Rational Number Type"; export const description = "The Komodo DeFi Framework API now offers the num-rational crate feature. This is used to represent order volumes and prices."; -import CompactTable from '@/components/mdx/CompactTable'; + # Rational Number Type @@ -35058,7 +35058,7 @@ The numerator and denominator are BigInteger numbers represented as a sign and a * `[-1,[1,1]]` represents `-1000000000000000000000000000000010000000000000000000000000000000` = `-4294967297` export const title = "Komodo DeFi SDK Common Structures: Swaps"; export const description = "Each active or completed trade from the Komodo DeFi SDK includes an unique identifier (UUID), a summary of the trade and detailed information relating to each swap event."; -import CompactTable from '@/components/mdx/CompactTable'; + # Swap Common Structures @@ -35130,7 +35130,7 @@ Each swap status will be nested under its associated UUID. ``` export const title = "Komodo Defi SDK Swaps: Maker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the maker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; + # Maker Events @@ -35468,7 +35468,7 @@ The `Finished` event indicates that the swap finished. This event does not have additional data. export const title = "Komodo Defi SDK Swaps: Taker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the taker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; + # Taker Events @@ -36023,7 +36023,7 @@ The `Finished` event indicates that the swap finished. This event does not have additional data. export const title = "Komodo DeFi SDK Common Structures: Wallet Operations"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Wallet Common Structures @@ -52750,7 +52750,7 @@ If you would like to withdraw all NFTs from a token\_address, you must use the ` View the source code at: [https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs](https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs) export const title = "Komodo DeFi Framework Method: Enable Balance Streaming"; export const description = "Using this method, you can enable balance events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Balance Streaming @@ -52854,7 +52854,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Disable Streaming"; export const description = "Using this method, you can disable specific streaming events."; -import CompactTable from '@/components/mdx/CompactTable'; + # Disable Streaming @@ -52921,7 +52921,7 @@ Using this method, you can disable specific streaming events. ``` export const title = "Komodo DeFi Framework Method: Fee Estimator Streaming"; export const description = "Using this method, you can enable the fee estimation stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Fee Estimator Streaming @@ -53037,7 +53037,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Heartbeat Streaming"; export const description = "Using this method, you can enable heartbeat events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Heartbeat Streaming @@ -53130,7 +53130,7 @@ These methods give the user fine-grained control over which event streams to act * Enable transaction history streaming with [stream::tx\_history\_enable](/komodo-defi-framework/api/v20/streaming/tx_history_enable/) export const title = "Komodo DeFi Framework Method: Enable Network Streaming"; export const description = "Using this method, you can enable network events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Network Streaming @@ -53205,7 +53205,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Order Status Streaming"; export const description = "Using this method, you can enable the order status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Order Status Streaming @@ -53275,7 +53275,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Orderbook Streaming"; export const description = "Using this method, you can enable the orderbook stream for a given pair."; -import CompactTable from '@/components/mdx/CompactTable'; + # Orderbook Streaming @@ -53357,7 +53357,7 @@ Here is an example of the stream data you should be able to see in [http://local `data: {"_type":"ORDERBOOK_UPDATE/orbk/KMD:MATIC","message":{"order_type":"NewOrUpdatedItem","order_data":{"pubkey":"026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245","base":"MATIC","rel":"KMD","price":[[1,[4249903049,3]],[1,[1410065408,2]]],"max_volume":[[1,[1477927621,23427]],[1,[1783793664,116]]],"min_volume":[[1,[1223297773,7148]],[1,[552894464,46566]]],"uuid":"b18bb3ab-8476-4a06-9cf6-9744e1bf6442","created_at":1746432644}}} ` export const title = "Komodo DeFi Framework Method: Enable Swap Status Streaming"; export const description = "Using this method, you can enable the swap status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Swap Status Streaming @@ -53427,7 +53427,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Transaction History Streaming"; export const description = "Using this method, you can enable transaction history events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Transaction History Streaming @@ -56657,7 +56657,7 @@ The request was failed due to a Komodo DeFi Framework API internal error. ``` export const title = "Komodo DeFi Framework Method: Add Node to Version Stat"; export const description = "The add_node_to_version_stat method adds a Node's name, IP address, and PeerID to a local database to track which version of KDF it is running."; -import CompactTable from '@/components/mdx/CompactTable'; + # Add Node to Version Stat @@ -56748,7 +56748,7 @@ To allow collection of version stats, added nodes must open ports 42845 (tcp) an ``` export const title = "Komodo DeFi Framework Method: Change Mnemonic Password"; export const description = "The change_mnemonic_password method allows a user to update the password used to encrypt a mnemonic phrase in their local database."; -import CompactTable from '@/components/mdx/CompactTable'; + # Change Mnemonic Password @@ -56810,7 +56810,7 @@ This will need to be updated manually, otherise you will see a log error `Error To view your mnemonic phrase in plain text, use [get\_mnemonic](/komodo-defi-framework/api/v20/utils/get_mnemonic/#get-mnemonic). export const title = "Komodo DeFi Framework Method: Get Current MTP"; export const description = "The get_current_mtp method returns the Median Time Past (MTP) from electrum servers for UTXO coins."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Current MTP @@ -56849,7 +56849,7 @@ The `get_current_mtp` method returns the Median Time Past (MTP) from electrum se ``` 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Enabled Coins @@ -56899,7 +56899,7 @@ The \[get\_enabled\_coins v2.0] method does not return addresses, as it was desi ``` export const title = "Komodo DeFi Framework Method: Get Mnemonic"; export const description = "The get_mnemonic method returns the user's mnemonic seed phrase, in encrypted or plain text format."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Mnemonic @@ -56987,7 +56987,7 @@ The `get_mnemonic` method returns the user's mnemonic seed phrase, in encrypted You can update the password with the [change\_mnemonic\_password](/komodo-defi-framework/api/v20/utils/change_mnemonic_password/#change-mnemonic-password) method. export const title = "Komodo DeFi Framework Method: Get Public Key"; export const description = "The get_public_key method returns the compressed secp256k1 pubkey corresponding to the user's seed phrase."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key @@ -57026,7 +57026,7 @@ The `get_public_key` method returns the compressed secp256k1 pubkey correspondin ``` export const title = "Komodo DeFi Framework Method: Get Public Key Hash"; export const description = "The get_public_key_hash method returns the RIPEMD-160 hash version of your public key."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key Hash @@ -57064,7 +57064,7 @@ The `get_public_key_hash` method returns the [RIPEMD-160](https://en.bitcoin.it/ export const title = "Komodo DeFi Framework Method: Get Shared Database ID"; export const description = "Return the deterministic identifier used as the root directory name for this node's SQLite databases."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Shared Database ID @@ -57101,7 +57101,7 @@ It is used as the root folder name for **all** SQLite databases on the host. ### Error Types 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Token Info @@ -57226,7 +57226,7 @@ For signing with an HD wallet, the [`coins`](https://github.com/KomodoPlatform/c ``` export const title = "Komodo DeFi Framework Method: Sign Message"; export const description = "The method in this document allows you to sign messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Sign Message @@ -57366,7 +57366,7 @@ The `chain` is either `External` or `Internal`, and is expressed as an integer w ``` export const title = "Komodo DeFi Framework Method: Verify Message"; export const description = "The method in this document allows you to verify messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Verify Message @@ -57465,7 +57465,7 @@ The `verify_message` method allows you to confirm the authenticity of a signed m ``` export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck"; export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network."; -import CompactTable from '@/components/mdx/CompactTable'; + # Peer Connection Healthcheck @@ -57511,7 +57511,7 @@ The `peer_connection_healthcheck` method checks if a peer is connected to the KD ``` export const title = "Komodo DeFi Framework Method: Remove Node from Version Stat"; export const description = "Removes a node from the local version stat database in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Remove Node from Version Stat @@ -57547,7 +57547,7 @@ The `remove_node_from_version_stat` method removes a node (by name) from the loc ``` export const title = "Komodo DeFi Framework Method: Send Asked Data"; export const description = "Provide data asynchronously to another component that previously issued a data request via the internal event bus."; -import CompactTable from '@/components/mdx/CompactTable'; + # Send Asked Data @@ -57591,7 +57591,7 @@ This RPC is part of the low-level event-bus mechanism and is **not** used in typ ### Error Types export const title = "Komodo DeFi Framework Method: Start Version Stat Collection"; export const description = "The start_version_stat_collection method initiates storing version statistics for nodes previously registered via the add_node_to_version_stat method."; -import CompactTable from '@/components/mdx/CompactTable'; + # Start Version Stat Collection @@ -57647,7 +57647,7 @@ The `start_version_stat_collection` method initiates storing version statistics ``` export const title = "Komodo DeFi Framework Method: Stop Version Stat Collection"; export const description = "The stop_version_stat_collection method stops the collection of version stats at the end of the current loop interval."; -import CompactTable from '@/components/mdx/CompactTable'; + # Stop Version Stat Collection @@ -57698,7 +57698,7 @@ The `stop_version_stat_collection` method stops the collection of version stats ``` export const title = "Komodo DeFi Framework Method: Cancel MetaMask Connection Task"; export const description = "Cancel a running MetaMask connection task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel MetaMask Connection Task @@ -57761,7 +57761,7 @@ This section provides an overview of the task-managed flow used to initialise a * [Cancel MetaMask Connection](/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/) export const title = "Komodo DeFi Framework Method: Initialise MetaMask Connection Task"; export const description = "Begin a task-managed process that initialises and authenticates MetaMask with the Komodo DeFi Framework node."; -import CompactTable from '@/components/mdx/CompactTable'; + # Initialise MetaMask Connection Task @@ -57802,7 +57802,7 @@ Use this method to begin a task-managed process that establishes a MetaMask cont ### Error Types export const title = "Komodo DeFi Framework Method: MetaMask Connection Task: Status"; export const description = "Query the status of a running MetaMask connection task."; -import CompactTable from '@/components/mdx/CompactTable'; + # MetaMask Connection Task: Status @@ -57867,7 +57867,7 @@ When the task completes successfully, `status` will be `Ok` and `details` will h ### Error Types export const title = "Komodo DeFi Framework Method: Cancel Trezor Initialization Task"; export const description = "Cancel the Trezor initialisation task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel Trezor Initialization Task @@ -57928,7 +57928,7 @@ export const description = "This document provides an overview of Trezor initial * [User Action for Trezor](/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/) export const title = "task::init_trezor::init"; export const description = "Initialise your Trezor device for use in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::init @@ -57979,7 +57979,7 @@ Before using this method, launch the Komodo DeFi Framework API, and plug in your ``` export const title = "task::init_trezor::status"; export const description = "Query the status of Trezor device initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::status @@ -58199,7 +58199,7 @@ No Trezor device detected by the Komodo DeFi Framework API. Make sure it is plug ``` export const title = "task::init_trezor::user_action"; export const description = "Send user action (PIN or passphrase) to the Trezor device during initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + import trezorpin from "@/public/images/docs/api-images/trezor_pin.png"; # Komodo DeFi Framework Method: task::init\_trezor::user\_action @@ -58281,7 +58281,7 @@ Even an incorrect PIN will return `success`. This doesn't mean the PIN was accep ``` export const title = "Komodo DeFi Framework Method: Trezor Connection Status"; export const description = "Check whether a Trezor device linked to the node is currently connected and ready for use."; -import CompactTable from '@/components/mdx/CompactTable'; + # Trezor Connection Status @@ -58317,7 +58317,7 @@ The `trezor_connection_status` method reports the real-time connection state of ### Error Types export const title = "Komodo DeFi Framework Method: Update Version Stat Collection"; export const description = "The update_version_stat_collection method updates the polling interval for version stats collection."; -import CompactTable from '@/components/mdx/CompactTable'; + # Update Version Stat Collection @@ -58371,7 +58371,7 @@ The `update_version_stat_collection` method updates the polling interval for ver export const title = "Komodo DeFi Framework Method: Delete Wallet"; export const description = "Securely deletes a wallet from the Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Delete Wallet @@ -65350,7 +65350,7 @@ If everything installed successfully, a response that is similar to the followin The Komodo DeFi Framework API executable is now built and available here: `~/komodo-defi-framework/target/debug/kdf` export const title = "Komodo DeFi Framework Method: Telegram Alerts for Bot Trading"; export const description = "The Komodo DeFi Framework API Market Maker bot can be configured to send status update alerts via Telegram."; -import CompactTable from '@/components/mdx/CompactTable'; + # Telegram Alerts for Bot Trading diff --git a/data-for-gpts/komodefi-api/all-api-content.txt b/data-for-gpts/komodefi-api/all-api-content.txt index 28de80dab..8fc4a7871 100644 --- a/data-for-gpts/komodefi-api/all-api-content.txt +++ b/data-for-gpts/komodefi-api/all-api-content.txt @@ -1,6 +1,6 @@ export const title = "Komodo DeFi SDK Common Structures: Activation"; export const description = "The Komodo DeFi SDK uses a variety of activation methods, depending on the type of coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Activation Common Structures @@ -197,7 +197,7 @@ The `UtxoMergeParams` object defines how often and at which thresholds to merge ``` export const title = "Komodo DeFi Framework Method: Enums"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enums @@ -472,7 +472,7 @@ The `ScanPolicyEnum` defines the available scan policies for enabling coins with | `new` | Create a new account record (see [NewAccount](/komodo-defi-framework/api/common_structures/wallet/#new-account)) and immediately set it as the enabled account. | export const title = "Komodo DeFi Framework RPC Errors"; export const description = "A comprehensive list of possible RPC errors in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # KDF RPC Errors @@ -3270,7 +3270,7 @@ This document lists all possible error types that can be returned by the Komodo | ZcashParamsError | An error occurred with the Zcash parameters. | export const title = "Komodo DeFi Framework Method: Common Structures"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Common Structures @@ -3521,7 +3521,7 @@ Within each session object, there are a some values which are required as input ### ErrorResponse export const title = "Komodo DeFi Framework Method: Lightning Common Structures"; export const description = "Lightning Network common structures for Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Lightning Common Structures @@ -3580,7 +3580,7 @@ See [https://github.com/KomodoPlatform/komodo-docs-mdx/pull/31#discussion\\\_r12 ### LightningClosedChannelsFilter export const title = "Komodo DeFi SDK Common Structures: Non-Fungible Tokens"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # NFT Common Structures @@ -3704,7 +3704,7 @@ Sub-object of [TokenProtocol](/komodo-defi-framework/api/common_structures/nfts/ The `WithdrawNftData` object is used for withdrawals of NFTs on ERC721 and ERC1155 contracts. It includes the following items for a given coin or token: export const title = "Komodo DeFi SDK Common Structures: Orders"; export const description = "Each order on the Komodo Defi oderbook can be queried to view full details of each order for a pair, or the best orders for a ticker."; -import CompactTable from '@/components/mdx/CompactTable'; + # Order Common Structures @@ -3942,7 +3942,7 @@ Used within [PairDepth](/komodo-defi-framework/api/common_structures/orders/#pai ``` export const title = "Komodo DeFi Framework Method: Rational Number Type"; export const description = "The Komodo DeFi Framework API now offers the num-rational crate feature. This is used to represent order volumes and prices."; -import CompactTable from '@/components/mdx/CompactTable'; + # Rational Number Type @@ -3982,7 +3982,7 @@ The numerator and denominator are BigInteger numbers represented as a sign and a * `[-1,[1,1]]` represents `-1000000000000000000000000000000010000000000000000000000000000000` = `-4294967297` export const title = "Komodo DeFi SDK Common Structures: Swaps"; export const description = "Each active or completed trade from the Komodo DeFi SDK includes an unique identifier (UUID), a summary of the trade and detailed information relating to each swap event."; -import CompactTable from '@/components/mdx/CompactTable'; + # Swap Common Structures @@ -4054,7 +4054,7 @@ Each swap status will be nested under its associated UUID. ``` export const title = "Komodo Defi SDK Swaps: Maker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the maker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; + # Maker Events @@ -4392,7 +4392,7 @@ The `Finished` event indicates that the swap finished. This event does not have additional data. export const title = "Komodo Defi SDK Swaps: Taker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the taker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; + # Taker Events @@ -4947,7 +4947,7 @@ The `Finished` event indicates that the swap finished. This event does not have additional data. export const title = "Komodo DeFi SDK Common Structures: Wallet Operations"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Wallet Common Structures @@ -21674,7 +21674,7 @@ If you would like to withdraw all NFTs from a token\_address, you must use the ` View the source code at: [https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs](https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs) export const title = "Komodo DeFi Framework Method: Enable Balance Streaming"; export const description = "Using this method, you can enable balance events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Balance Streaming @@ -21778,7 +21778,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Disable Streaming"; export const description = "Using this method, you can disable specific streaming events."; -import CompactTable from '@/components/mdx/CompactTable'; + # Disable Streaming @@ -21845,7 +21845,7 @@ Using this method, you can disable specific streaming events. ``` export const title = "Komodo DeFi Framework Method: Fee Estimator Streaming"; export const description = "Using this method, you can enable the fee estimation stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Fee Estimator Streaming @@ -21961,7 +21961,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Heartbeat Streaming"; export const description = "Using this method, you can enable heartbeat events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Heartbeat Streaming @@ -22054,7 +22054,7 @@ These methods give the user fine-grained control over which event streams to act * Enable transaction history streaming with [stream::tx\_history\_enable](/komodo-defi-framework/api/v20/streaming/tx_history_enable/) export const title = "Komodo DeFi Framework Method: Enable Network Streaming"; export const description = "Using this method, you can enable network events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Network Streaming @@ -22129,7 +22129,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Order Status Streaming"; export const description = "Using this method, you can enable the order status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Order Status Streaming @@ -22199,7 +22199,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Orderbook Streaming"; export const description = "Using this method, you can enable the orderbook stream for a given pair."; -import CompactTable from '@/components/mdx/CompactTable'; + # Orderbook Streaming @@ -22281,7 +22281,7 @@ Here is an example of the stream data you should be able to see in [http://local `data: {"_type":"ORDERBOOK_UPDATE/orbk/KMD:MATIC","message":{"order_type":"NewOrUpdatedItem","order_data":{"pubkey":"026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245","base":"MATIC","rel":"KMD","price":[[1,[4249903049,3]],[1,[1410065408,2]]],"max_volume":[[1,[1477927621,23427]],[1,[1783793664,116]]],"min_volume":[[1,[1223297773,7148]],[1,[552894464,46566]]],"uuid":"b18bb3ab-8476-4a06-9cf6-9744e1bf6442","created_at":1746432644}}} ` export const title = "Komodo DeFi Framework Method: Enable Swap Status Streaming"; export const description = "Using this method, you can enable the swap status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Swap Status Streaming @@ -22351,7 +22351,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Transaction History Streaming"; export const description = "Using this method, you can enable transaction history events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Transaction History Streaming @@ -25581,7 +25581,7 @@ The request was failed due to a Komodo DeFi Framework API internal error. ``` export const title = "Komodo DeFi Framework Method: Add Node to Version Stat"; export const description = "The add_node_to_version_stat method adds a Node's name, IP address, and PeerID to a local database to track which version of KDF it is running."; -import CompactTable from '@/components/mdx/CompactTable'; + # Add Node to Version Stat @@ -25672,7 +25672,7 @@ To allow collection of version stats, added nodes must open ports 42845 (tcp) an ``` export const title = "Komodo DeFi Framework Method: Change Mnemonic Password"; export const description = "The change_mnemonic_password method allows a user to update the password used to encrypt a mnemonic phrase in their local database."; -import CompactTable from '@/components/mdx/CompactTable'; + # Change Mnemonic Password @@ -25734,7 +25734,7 @@ This will need to be updated manually, otherise you will see a log error `Error To view your mnemonic phrase in plain text, use [get\_mnemonic](/komodo-defi-framework/api/v20/utils/get_mnemonic/#get-mnemonic). export const title = "Komodo DeFi Framework Method: Get Current MTP"; export const description = "The get_current_mtp method returns the Median Time Past (MTP) from electrum servers for UTXO coins."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Current MTP @@ -25773,7 +25773,7 @@ The `get_current_mtp` method returns the Median Time Past (MTP) from electrum se ``` 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Enabled Coins @@ -25823,7 +25823,7 @@ The \[get\_enabled\_coins v2.0] method does not return addresses, as it was desi ``` export const title = "Komodo DeFi Framework Method: Get Mnemonic"; export const description = "The get_mnemonic method returns the user's mnemonic seed phrase, in encrypted or plain text format."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Mnemonic @@ -25911,7 +25911,7 @@ The `get_mnemonic` method returns the user's mnemonic seed phrase, in encrypted You can update the password with the [change\_mnemonic\_password](/komodo-defi-framework/api/v20/utils/change_mnemonic_password/#change-mnemonic-password) method. export const title = "Komodo DeFi Framework Method: Get Public Key"; export const description = "The get_public_key method returns the compressed secp256k1 pubkey corresponding to the user's seed phrase."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key @@ -25950,7 +25950,7 @@ The `get_public_key` method returns the compressed secp256k1 pubkey correspondin ``` export const title = "Komodo DeFi Framework Method: Get Public Key Hash"; export const description = "The get_public_key_hash method returns the RIPEMD-160 hash version of your public key."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key Hash @@ -25988,7 +25988,7 @@ The `get_public_key_hash` method returns the [RIPEMD-160](https://en.bitcoin.it/ export const title = "Komodo DeFi Framework Method: Get Shared Database ID"; export const description = "Return the deterministic identifier used as the root directory name for this node's SQLite databases."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Shared Database ID @@ -26025,7 +26025,7 @@ It is used as the root folder name for **all** SQLite databases on the host. ### Error Types 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Token Info @@ -26150,7 +26150,7 @@ For signing with an HD wallet, the [`coins`](https://github.com/KomodoPlatform/c ``` export const title = "Komodo DeFi Framework Method: Sign Message"; export const description = "The method in this document allows you to sign messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Sign Message @@ -26290,7 +26290,7 @@ The `chain` is either `External` or `Internal`, and is expressed as an integer w ``` export const title = "Komodo DeFi Framework Method: Verify Message"; export const description = "The method in this document allows you to verify messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Verify Message @@ -26389,7 +26389,7 @@ The `verify_message` method allows you to confirm the authenticity of a signed m ``` export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck"; export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network."; -import CompactTable from '@/components/mdx/CompactTable'; + # Peer Connection Healthcheck @@ -26435,7 +26435,7 @@ The `peer_connection_healthcheck` method checks if a peer is connected to the KD ``` export const title = "Komodo DeFi Framework Method: Remove Node from Version Stat"; export const description = "Removes a node from the local version stat database in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Remove Node from Version Stat @@ -26471,7 +26471,7 @@ The `remove_node_from_version_stat` method removes a node (by name) from the loc ``` export const title = "Komodo DeFi Framework Method: Send Asked Data"; export const description = "Provide data asynchronously to another component that previously issued a data request via the internal event bus."; -import CompactTable from '@/components/mdx/CompactTable'; + # Send Asked Data @@ -26515,7 +26515,7 @@ This RPC is part of the low-level event-bus mechanism and is **not** used in typ ### Error Types export const title = "Komodo DeFi Framework Method: Start Version Stat Collection"; export const description = "The start_version_stat_collection method initiates storing version statistics for nodes previously registered via the add_node_to_version_stat method."; -import CompactTable from '@/components/mdx/CompactTable'; + # Start Version Stat Collection @@ -26571,7 +26571,7 @@ The `start_version_stat_collection` method initiates storing version statistics ``` export const title = "Komodo DeFi Framework Method: Stop Version Stat Collection"; export const description = "The stop_version_stat_collection method stops the collection of version stats at the end of the current loop interval."; -import CompactTable from '@/components/mdx/CompactTable'; + # Stop Version Stat Collection @@ -26622,7 +26622,7 @@ The `stop_version_stat_collection` method stops the collection of version stats ``` export const title = "Komodo DeFi Framework Method: Cancel MetaMask Connection Task"; export const description = "Cancel a running MetaMask connection task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel MetaMask Connection Task @@ -26685,7 +26685,7 @@ This section provides an overview of the task-managed flow used to initialise a * [Cancel MetaMask Connection](/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/) export const title = "Komodo DeFi Framework Method: Initialise MetaMask Connection Task"; export const description = "Begin a task-managed process that initialises and authenticates MetaMask with the Komodo DeFi Framework node."; -import CompactTable from '@/components/mdx/CompactTable'; + # Initialise MetaMask Connection Task @@ -26726,7 +26726,7 @@ Use this method to begin a task-managed process that establishes a MetaMask cont ### Error Types export const title = "Komodo DeFi Framework Method: MetaMask Connection Task: Status"; export const description = "Query the status of a running MetaMask connection task."; -import CompactTable from '@/components/mdx/CompactTable'; + # MetaMask Connection Task: Status @@ -26791,7 +26791,7 @@ When the task completes successfully, `status` will be `Ok` and `details` will h ### Error Types export const title = "Komodo DeFi Framework Method: Cancel Trezor Initialization Task"; export const description = "Cancel the Trezor initialisation task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel Trezor Initialization Task @@ -26852,7 +26852,7 @@ export const description = "This document provides an overview of Trezor initial * [User Action for Trezor](/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/) export const title = "task::init_trezor::init"; export const description = "Initialise your Trezor device for use in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::init @@ -26903,7 +26903,7 @@ Before using this method, launch the Komodo DeFi Framework API, and plug in your ``` export const title = "task::init_trezor::status"; export const description = "Query the status of Trezor device initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::status @@ -27123,7 +27123,7 @@ No Trezor device detected by the Komodo DeFi Framework API. Make sure it is plug ``` export const title = "task::init_trezor::user_action"; export const description = "Send user action (PIN or passphrase) to the Trezor device during initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + import trezorpin from "@/public/images/docs/api-images/trezor_pin.png"; # Komodo DeFi Framework Method: task::init\_trezor::user\_action @@ -27205,7 +27205,7 @@ Even an incorrect PIN will return `success`. This doesn't mean the PIN was accep ``` export const title = "Komodo DeFi Framework Method: Trezor Connection Status"; export const description = "Check whether a Trezor device linked to the node is currently connected and ready for use."; -import CompactTable from '@/components/mdx/CompactTable'; + # Trezor Connection Status @@ -27241,7 +27241,7 @@ The `trezor_connection_status` method reports the real-time connection state of ### Error Types export const title = "Komodo DeFi Framework Method: Update Version Stat Collection"; export const description = "The update_version_stat_collection method updates the polling interval for version stats collection."; -import CompactTable from '@/components/mdx/CompactTable'; + # Update Version Stat Collection @@ -27295,7 +27295,7 @@ The `update_version_stat_collection` method updates the polling interval for ver export const title = "Komodo DeFi Framework Method: Delete Wallet"; export const description = "Securely deletes a wallet from the Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Delete Wallet diff --git a/data-for-gpts/komodefi-api/v20-api-content.txt b/data-for-gpts/komodefi-api/v20-api-content.txt index f4109f5bd..ac3d57629 100644 --- a/data-for-gpts/komodefi-api/v20-api-content.txt +++ b/data-for-gpts/komodefi-api/v20-api-content.txt @@ -7335,7 +7335,7 @@ If you would like to withdraw all NFTs from a token\_address, you must use the ` View the source code at: [https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs](https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs) export const title = "Komodo DeFi Framework Method: Enable Balance Streaming"; export const description = "Using this method, you can enable balance events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Balance Streaming @@ -7439,7 +7439,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Disable Streaming"; export const description = "Using this method, you can disable specific streaming events."; -import CompactTable from '@/components/mdx/CompactTable'; + # Disable Streaming @@ -7506,7 +7506,7 @@ Using this method, you can disable specific streaming events. ``` export const title = "Komodo DeFi Framework Method: Fee Estimator Streaming"; export const description = "Using this method, you can enable the fee estimation stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Fee Estimator Streaming @@ -7622,7 +7622,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Heartbeat Streaming"; export const description = "Using this method, you can enable heartbeat events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Heartbeat Streaming @@ -7715,7 +7715,7 @@ These methods give the user fine-grained control over which event streams to act * Enable transaction history streaming with [stream::tx\_history\_enable](/komodo-defi-framework/api/v20/streaming/tx_history_enable/) export const title = "Komodo DeFi Framework Method: Enable Network Streaming"; export const description = "Using this method, you can enable network events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Network Streaming @@ -7790,7 +7790,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Order Status Streaming"; export const description = "Using this method, you can enable the order status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Order Status Streaming @@ -7860,7 +7860,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Orderbook Streaming"; export const description = "Using this method, you can enable the orderbook stream for a given pair."; -import CompactTable from '@/components/mdx/CompactTable'; + # Orderbook Streaming @@ -7942,7 +7942,7 @@ Here is an example of the stream data you should be able to see in [http://local `data: {"_type":"ORDERBOOK_UPDATE/orbk/KMD:MATIC","message":{"order_type":"NewOrUpdatedItem","order_data":{"pubkey":"026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245","base":"MATIC","rel":"KMD","price":[[1,[4249903049,3]],[1,[1410065408,2]]],"max_volume":[[1,[1477927621,23427]],[1,[1783793664,116]]],"min_volume":[[1,[1223297773,7148]],[1,[552894464,46566]]],"uuid":"b18bb3ab-8476-4a06-9cf6-9744e1bf6442","created_at":1746432644}}} ` export const title = "Komodo DeFi Framework Method: Enable Swap Status Streaming"; export const description = "Using this method, you can enable the swap status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Swap Status Streaming @@ -8012,7 +8012,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Transaction History Streaming"; export const description = "Using this method, you can enable transaction history events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Transaction History Streaming @@ -11242,7 +11242,7 @@ The request was failed due to a Komodo DeFi Framework API internal error. ``` export const title = "Komodo DeFi Framework Method: Add Node to Version Stat"; export const description = "The add_node_to_version_stat method adds a Node's name, IP address, and PeerID to a local database to track which version of KDF it is running."; -import CompactTable from '@/components/mdx/CompactTable'; + # Add Node to Version Stat @@ -11333,7 +11333,7 @@ To allow collection of version stats, added nodes must open ports 42845 (tcp) an ``` export const title = "Komodo DeFi Framework Method: Change Mnemonic Password"; export const description = "The change_mnemonic_password method allows a user to update the password used to encrypt a mnemonic phrase in their local database."; -import CompactTable from '@/components/mdx/CompactTable'; + # Change Mnemonic Password @@ -11395,7 +11395,7 @@ This will need to be updated manually, otherise you will see a log error `Error To view your mnemonic phrase in plain text, use [get\_mnemonic](/komodo-defi-framework/api/v20/utils/get_mnemonic/#get-mnemonic). export const title = "Komodo DeFi Framework Method: Get Current MTP"; export const description = "The get_current_mtp method returns the Median Time Past (MTP) from electrum servers for UTXO coins."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Current MTP @@ -11434,7 +11434,7 @@ The `get_current_mtp` method returns the Median Time Past (MTP) from electrum se ``` 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Enabled Coins @@ -11484,7 +11484,7 @@ The \[get\_enabled\_coins v2.0] method does not return addresses, as it was desi ``` export const title = "Komodo DeFi Framework Method: Get Mnemonic"; export const description = "The get_mnemonic method returns the user's mnemonic seed phrase, in encrypted or plain text format."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Mnemonic @@ -11572,7 +11572,7 @@ The `get_mnemonic` method returns the user's mnemonic seed phrase, in encrypted You can update the password with the [change\_mnemonic\_password](/komodo-defi-framework/api/v20/utils/change_mnemonic_password/#change-mnemonic-password) method. export const title = "Komodo DeFi Framework Method: Get Public Key"; export const description = "The get_public_key method returns the compressed secp256k1 pubkey corresponding to the user's seed phrase."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key @@ -11611,7 +11611,7 @@ The `get_public_key` method returns the compressed secp256k1 pubkey correspondin ``` export const title = "Komodo DeFi Framework Method: Get Public Key Hash"; export const description = "The get_public_key_hash method returns the RIPEMD-160 hash version of your public key."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key Hash @@ -11649,7 +11649,7 @@ The `get_public_key_hash` method returns the [RIPEMD-160](https://en.bitcoin.it/ export const title = "Komodo DeFi Framework Method: Get Shared Database ID"; export const description = "Return the deterministic identifier used as the root directory name for this node's SQLite databases."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Shared Database ID @@ -11686,7 +11686,7 @@ It is used as the root folder name for **all** SQLite databases on the host. ### Error Types 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Token Info @@ -11811,7 +11811,7 @@ For signing with an HD wallet, the [`coins`](https://github.com/KomodoPlatform/c ``` export const title = "Komodo DeFi Framework Method: Sign Message"; export const description = "The method in this document allows you to sign messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Sign Message @@ -11951,7 +11951,7 @@ The `chain` is either `External` or `Internal`, and is expressed as an integer w ``` export const title = "Komodo DeFi Framework Method: Verify Message"; export const description = "The method in this document allows you to verify messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Verify Message @@ -12050,7 +12050,7 @@ The `verify_message` method allows you to confirm the authenticity of a signed m ``` export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck"; export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network."; -import CompactTable from '@/components/mdx/CompactTable'; + # Peer Connection Healthcheck @@ -12096,7 +12096,7 @@ The `peer_connection_healthcheck` method checks if a peer is connected to the KD ``` export const title = "Komodo DeFi Framework Method: Remove Node from Version Stat"; export const description = "Removes a node from the local version stat database in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Remove Node from Version Stat @@ -12132,7 +12132,7 @@ The `remove_node_from_version_stat` method removes a node (by name) from the loc ``` export const title = "Komodo DeFi Framework Method: Send Asked Data"; export const description = "Provide data asynchronously to another component that previously issued a data request via the internal event bus."; -import CompactTable from '@/components/mdx/CompactTable'; + # Send Asked Data @@ -12176,7 +12176,7 @@ This RPC is part of the low-level event-bus mechanism and is **not** used in typ ### Error Types export const title = "Komodo DeFi Framework Method: Start Version Stat Collection"; export const description = "The start_version_stat_collection method initiates storing version statistics for nodes previously registered via the add_node_to_version_stat method."; -import CompactTable from '@/components/mdx/CompactTable'; + # Start Version Stat Collection @@ -12232,7 +12232,7 @@ The `start_version_stat_collection` method initiates storing version statistics ``` export const title = "Komodo DeFi Framework Method: Stop Version Stat Collection"; export const description = "The stop_version_stat_collection method stops the collection of version stats at the end of the current loop interval."; -import CompactTable from '@/components/mdx/CompactTable'; + # Stop Version Stat Collection @@ -12283,7 +12283,7 @@ The `stop_version_stat_collection` method stops the collection of version stats ``` export const title = "Komodo DeFi Framework Method: Cancel MetaMask Connection Task"; export const description = "Cancel a running MetaMask connection task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel MetaMask Connection Task @@ -12346,7 +12346,7 @@ This section provides an overview of the task-managed flow used to initialise a * [Cancel MetaMask Connection](/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/) export const title = "Komodo DeFi Framework Method: Initialise MetaMask Connection Task"; export const description = "Begin a task-managed process that initialises and authenticates MetaMask with the Komodo DeFi Framework node."; -import CompactTable from '@/components/mdx/CompactTable'; + # Initialise MetaMask Connection Task @@ -12387,7 +12387,7 @@ Use this method to begin a task-managed process that establishes a MetaMask cont ### Error Types export const title = "Komodo DeFi Framework Method: MetaMask Connection Task: Status"; export const description = "Query the status of a running MetaMask connection task."; -import CompactTable from '@/components/mdx/CompactTable'; + # MetaMask Connection Task: Status @@ -12452,7 +12452,7 @@ When the task completes successfully, `status` will be `Ok` and `details` will h ### Error Types export const title = "Komodo DeFi Framework Method: Cancel Trezor Initialization Task"; export const description = "Cancel the Trezor initialisation task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel Trezor Initialization Task @@ -12513,7 +12513,7 @@ export const description = "This document provides an overview of Trezor initial * [User Action for Trezor](/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/) export const title = "task::init_trezor::init"; export const description = "Initialise your Trezor device for use in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::init @@ -12564,7 +12564,7 @@ Before using this method, launch the Komodo DeFi Framework API, and plug in your ``` export const title = "task::init_trezor::status"; export const description = "Query the status of Trezor device initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::status @@ -12784,7 +12784,7 @@ No Trezor device detected by the Komodo DeFi Framework API. Make sure it is plug ``` export const title = "task::init_trezor::user_action"; export const description = "Send user action (PIN or passphrase) to the Trezor device during initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + import trezorpin from "@/public/images/docs/api-images/trezor_pin.png"; # Komodo DeFi Framework Method: task::init\_trezor::user\_action @@ -12866,7 +12866,7 @@ Even an incorrect PIN will return `success`. This doesn't mean the PIN was accep ``` export const title = "Komodo DeFi Framework Method: Trezor Connection Status"; export const description = "Check whether a Trezor device linked to the node is currently connected and ready for use."; -import CompactTable from '@/components/mdx/CompactTable'; + # Trezor Connection Status @@ -12902,7 +12902,7 @@ The `trezor_connection_status` method reports the real-time connection state of ### Error Types export const title = "Komodo DeFi Framework Method: Update Version Stat Collection"; export const description = "The update_version_stat_collection method updates the polling interval for version stats collection."; -import CompactTable from '@/components/mdx/CompactTable'; + # Update Version Stat Collection @@ -12956,7 +12956,7 @@ The `update_version_stat_collection` method updates the polling interval for ver export const title = "Komodo DeFi Framework Method: Delete Wallet"; export const description = "Securely deletes a wallet from the Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Delete Wallet diff --git a/data-for-gpts/komodo-defi-framework-content.txt b/data-for-gpts/komodo-defi-framework-content.txt index 1c41fe625..35f788003 100644 --- a/data-for-gpts/komodo-defi-framework-content.txt +++ b/data-for-gpts/komodo-defi-framework-content.txt @@ -1,6 +1,6 @@ export const title = "Komodo DeFi SDK Common Structures: Activation"; export const description = "The Komodo DeFi SDK uses a variety of activation methods, depending on the type of coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Activation Common Structures @@ -197,7 +197,7 @@ The `UtxoMergeParams` object defines how often and at which thresholds to merge ``` export const title = "Komodo DeFi Framework Method: Enums"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enums @@ -472,7 +472,7 @@ The `ScanPolicyEnum` defines the available scan policies for enabling coins with | `new` | Create a new account record (see [NewAccount](/komodo-defi-framework/api/common_structures/wallet/#new-account)) and immediately set it as the enabled account. | export const title = "Komodo DeFi Framework RPC Errors"; export const description = "A comprehensive list of possible RPC errors in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # KDF RPC Errors @@ -3270,7 +3270,7 @@ This document lists all possible error types that can be returned by the Komodo | ZcashParamsError | An error occurred with the Zcash parameters. | export const title = "Komodo DeFi Framework Method: Common Structures"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Common Structures @@ -3521,7 +3521,7 @@ Within each session object, there are a some values which are required as input ### ErrorResponse export const title = "Komodo DeFi Framework Method: Lightning Common Structures"; export const description = "Lightning Network common structures for Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Lightning Common Structures @@ -3580,7 +3580,7 @@ See [https://github.com/KomodoPlatform/komodo-docs-mdx/pull/31#discussion\\\_r12 ### LightningClosedChannelsFilter export const title = "Komodo DeFi SDK Common Structures: Non-Fungible Tokens"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # NFT Common Structures @@ -3704,7 +3704,7 @@ Sub-object of [TokenProtocol](/komodo-defi-framework/api/common_structures/nfts/ The `WithdrawNftData` object is used for withdrawals of NFTs on ERC721 and ERC1155 contracts. It includes the following items for a given coin or token: export const title = "Komodo DeFi SDK Common Structures: Orders"; export const description = "Each order on the Komodo Defi oderbook can be queried to view full details of each order for a pair, or the best orders for a ticker."; -import CompactTable from '@/components/mdx/CompactTable'; + # Order Common Structures @@ -3942,7 +3942,7 @@ Used within [PairDepth](/komodo-defi-framework/api/common_structures/orders/#pai ``` export const title = "Komodo DeFi Framework Method: Rational Number Type"; export const description = "The Komodo DeFi Framework API now offers the num-rational crate feature. This is used to represent order volumes and prices."; -import CompactTable from '@/components/mdx/CompactTable'; + # Rational Number Type @@ -3982,7 +3982,7 @@ The numerator and denominator are BigInteger numbers represented as a sign and a * `[-1,[1,1]]` represents `-1000000000000000000000000000000010000000000000000000000000000000` = `-4294967297` export const title = "Komodo DeFi SDK Common Structures: Swaps"; export const description = "Each active or completed trade from the Komodo DeFi SDK includes an unique identifier (UUID), a summary of the trade and detailed information relating to each swap event."; -import CompactTable from '@/components/mdx/CompactTable'; + # Swap Common Structures @@ -4054,7 +4054,7 @@ Each swap status will be nested under its associated UUID. ``` export const title = "Komodo Defi SDK Swaps: Maker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the maker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; + # Maker Events @@ -4392,7 +4392,7 @@ The `Finished` event indicates that the swap finished. This event does not have additional data. export const title = "Komodo Defi SDK Swaps: Taker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the taker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; + # Taker Events @@ -4947,7 +4947,7 @@ The `Finished` event indicates that the swap finished. This event does not have additional data. export const title = "Komodo DeFi SDK Common Structures: Wallet Operations"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; + # Wallet Common Structures @@ -21674,7 +21674,7 @@ If you would like to withdraw all NFTs from a token\_address, you must use the ` View the source code at: [https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs](https://github.com/KomodoPlatform/komodo-defi-framework/blob/main/mm2src/coins/nft.rs) export const title = "Komodo DeFi Framework Method: Enable Balance Streaming"; export const description = "Using this method, you can enable balance events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Balance Streaming @@ -21778,7 +21778,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Disable Streaming"; export const description = "Using this method, you can disable specific streaming events."; -import CompactTable from '@/components/mdx/CompactTable'; + # Disable Streaming @@ -21845,7 +21845,7 @@ Using this method, you can disable specific streaming events. ``` export const title = "Komodo DeFi Framework Method: Fee Estimator Streaming"; export const description = "Using this method, you can enable the fee estimation stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Fee Estimator Streaming @@ -21961,7 +21961,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Heartbeat Streaming"; export const description = "Using this method, you can enable heartbeat events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Heartbeat Streaming @@ -22054,7 +22054,7 @@ These methods give the user fine-grained control over which event streams to act * Enable transaction history streaming with [stream::tx\_history\_enable](/komodo-defi-framework/api/v20/streaming/tx_history_enable/) export const title = "Komodo DeFi Framework Method: Enable Network Streaming"; export const description = "Using this method, you can enable network events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Network Streaming @@ -22129,7 +22129,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Order Status Streaming"; export const description = "Using this method, you can enable the order status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Order Status Streaming @@ -22199,7 +22199,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Orderbook Streaming"; export const description = "Using this method, you can enable the orderbook stream for a given pair."; -import CompactTable from '@/components/mdx/CompactTable'; + # Orderbook Streaming @@ -22281,7 +22281,7 @@ Here is an example of the stream data you should be able to see in [http://local `data: {"_type":"ORDERBOOK_UPDATE/orbk/KMD:MATIC","message":{"order_type":"NewOrUpdatedItem","order_data":{"pubkey":"026da2fc632afabbb1b86d04a9a012db25eca74db38ba2eccd88552f27f4c0b245","base":"MATIC","rel":"KMD","price":[[1,[4249903049,3]],[1,[1410065408,2]]],"max_volume":[[1,[1477927621,23427]],[1,[1783793664,116]]],"min_volume":[[1,[1223297773,7148]],[1,[552894464,46566]]],"uuid":"b18bb3ab-8476-4a06-9cf6-9744e1bf6442","created_at":1746432644}}} ` export const title = "Komodo DeFi Framework Method: Enable Swap Status Streaming"; export const description = "Using this method, you can enable the swap status stream."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Swap Status Streaming @@ -22351,7 +22351,7 @@ Here is an example of the stream data you should be able to see in [http://local ``` export const title = "Komodo DeFi Framework Method: Enable Transaction History Streaming"; export const description = "Using this method, you can enable transaction history events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; + # Enable Transaction History Streaming @@ -25581,7 +25581,7 @@ The request was failed due to a Komodo DeFi Framework API internal error. ``` export const title = "Komodo DeFi Framework Method: Add Node to Version Stat"; export const description = "The add_node_to_version_stat method adds a Node's name, IP address, and PeerID to a local database to track which version of KDF it is running."; -import CompactTable from '@/components/mdx/CompactTable'; + # Add Node to Version Stat @@ -25672,7 +25672,7 @@ To allow collection of version stats, added nodes must open ports 42845 (tcp) an ``` export const title = "Komodo DeFi Framework Method: Change Mnemonic Password"; export const description = "The change_mnemonic_password method allows a user to update the password used to encrypt a mnemonic phrase in their local database."; -import CompactTable from '@/components/mdx/CompactTable'; + # Change Mnemonic Password @@ -25734,7 +25734,7 @@ This will need to be updated manually, otherise you will see a log error `Error To view your mnemonic phrase in plain text, use [get\_mnemonic](/komodo-defi-framework/api/v20/utils/get_mnemonic/#get-mnemonic). export const title = "Komodo DeFi Framework Method: Get Current MTP"; export const description = "The get_current_mtp method returns the Median Time Past (MTP) from electrum servers for UTXO coins."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Current MTP @@ -25773,7 +25773,7 @@ The `get_current_mtp` method returns the Median Time Past (MTP) from electrum se ``` 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Enabled Coins @@ -25823,7 +25823,7 @@ The \[get\_enabled\_coins v2.0] method does not return addresses, as it was desi ``` export const title = "Komodo DeFi Framework Method: Get Mnemonic"; export const description = "The get_mnemonic method returns the user's mnemonic seed phrase, in encrypted or plain text format."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Mnemonic @@ -25911,7 +25911,7 @@ The `get_mnemonic` method returns the user's mnemonic seed phrase, in encrypted You can update the password with the [change\_mnemonic\_password](/komodo-defi-framework/api/v20/utils/change_mnemonic_password/#change-mnemonic-password) method. export const title = "Komodo DeFi Framework Method: Get Public Key"; export const description = "The get_public_key method returns the compressed secp256k1 pubkey corresponding to the user's seed phrase."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key @@ -25950,7 +25950,7 @@ The `get_public_key` method returns the compressed secp256k1 pubkey correspondin ``` export const title = "Komodo DeFi Framework Method: Get Public Key Hash"; export const description = "The get_public_key_hash method returns the RIPEMD-160 hash version of your public key."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Public Key Hash @@ -25988,7 +25988,7 @@ The `get_public_key_hash` method returns the [RIPEMD-160](https://en.bitcoin.it/ export const title = "Komodo DeFi Framework Method: Get Shared Database ID"; export const description = "Return the deterministic identifier used as the root directory name for this node's SQLite databases."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Shared Database ID @@ -26025,7 +26025,7 @@ It is used as the root folder name for **all** SQLite databases on the host. ### Error Types 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."; -import CompactTable from '@/components/mdx/CompactTable'; + # Get Token Info @@ -26150,7 +26150,7 @@ For signing with an HD wallet, the [`coins`](https://github.com/KomodoPlatform/c ``` export const title = "Komodo DeFi Framework Method: Sign Message"; export const description = "The method in this document allows you to sign messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Sign Message @@ -26290,7 +26290,7 @@ The `chain` is either `External` or `Internal`, and is expressed as an integer w ``` export const title = "Komodo DeFi Framework Method: Verify Message"; export const description = "The method in this document allows you to verify messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Verify Message @@ -26389,7 +26389,7 @@ The `verify_message` method allows you to confirm the authenticity of a signed m ``` export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck"; export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network."; -import CompactTable from '@/components/mdx/CompactTable'; + # Peer Connection Healthcheck @@ -26435,7 +26435,7 @@ The `peer_connection_healthcheck` method checks if a peer is connected to the KD ``` export const title = "Komodo DeFi Framework Method: Remove Node from Version Stat"; export const description = "Removes a node from the local version stat database in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Remove Node from Version Stat @@ -26471,7 +26471,7 @@ The `remove_node_from_version_stat` method removes a node (by name) from the loc ``` export const title = "Komodo DeFi Framework Method: Send Asked Data"; export const description = "Provide data asynchronously to another component that previously issued a data request via the internal event bus."; -import CompactTable from '@/components/mdx/CompactTable'; + # Send Asked Data @@ -26515,7 +26515,7 @@ This RPC is part of the low-level event-bus mechanism and is **not** used in typ ### Error Types export const title = "Komodo DeFi Framework Method: Start Version Stat Collection"; export const description = "The start_version_stat_collection method initiates storing version statistics for nodes previously registered via the add_node_to_version_stat method."; -import CompactTable from '@/components/mdx/CompactTable'; + # Start Version Stat Collection @@ -26571,7 +26571,7 @@ The `start_version_stat_collection` method initiates storing version statistics ``` export const title = "Komodo DeFi Framework Method: Stop Version Stat Collection"; export const description = "The stop_version_stat_collection method stops the collection of version stats at the end of the current loop interval."; -import CompactTable from '@/components/mdx/CompactTable'; + # Stop Version Stat Collection @@ -26622,7 +26622,7 @@ The `stop_version_stat_collection` method stops the collection of version stats ``` export const title = "Komodo DeFi Framework Method: Cancel MetaMask Connection Task"; export const description = "Cancel a running MetaMask connection task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel MetaMask Connection Task @@ -26685,7 +26685,7 @@ This section provides an overview of the task-managed flow used to initialise a * [Cancel MetaMask Connection](/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/) export const title = "Komodo DeFi Framework Method: Initialise MetaMask Connection Task"; export const description = "Begin a task-managed process that initialises and authenticates MetaMask with the Komodo DeFi Framework node."; -import CompactTable from '@/components/mdx/CompactTable'; + # Initialise MetaMask Connection Task @@ -26726,7 +26726,7 @@ Use this method to begin a task-managed process that establishes a MetaMask cont ### Error Types export const title = "Komodo DeFi Framework Method: MetaMask Connection Task: Status"; export const description = "Query the status of a running MetaMask connection task."; -import CompactTable from '@/components/mdx/CompactTable'; + # MetaMask Connection Task: Status @@ -26791,7 +26791,7 @@ When the task completes successfully, `status` will be `Ok` and `details` will h ### Error Types export const title = "Komodo DeFi Framework Method: Cancel Trezor Initialization Task"; export const description = "Cancel the Trezor initialisation task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Cancel Trezor Initialization Task @@ -26852,7 +26852,7 @@ export const description = "This document provides an overview of Trezor initial * [User Action for Trezor](/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/) export const title = "task::init_trezor::init"; export const description = "Initialise your Trezor device for use in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::init @@ -26903,7 +26903,7 @@ Before using this method, launch the Komodo DeFi Framework API, and plug in your ``` export const title = "task::init_trezor::status"; export const description = "Query the status of Trezor device initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + # Komodo DeFi Framework Method: task::init\_trezor::status @@ -27123,7 +27123,7 @@ No Trezor device detected by the Komodo DeFi Framework API. Make sure it is plug ``` export const title = "task::init_trezor::user_action"; export const description = "Send user action (PIN or passphrase) to the Trezor device during initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + import trezorpin from "@/public/images/docs/api-images/trezor_pin.png"; # Komodo DeFi Framework Method: task::init\_trezor::user\_action @@ -27205,7 +27205,7 @@ Even an incorrect PIN will return `success`. This doesn't mean the PIN was accep ``` export const title = "Komodo DeFi Framework Method: Trezor Connection Status"; export const description = "Check whether a Trezor device linked to the node is currently connected and ready for use."; -import CompactTable from '@/components/mdx/CompactTable'; + # Trezor Connection Status @@ -27241,7 +27241,7 @@ The `trezor_connection_status` method reports the real-time connection state of ### Error Types export const title = "Komodo DeFi Framework Method: Update Version Stat Collection"; export const description = "The update_version_stat_collection method updates the polling interval for version stats collection."; -import CompactTable from '@/components/mdx/CompactTable'; + # Update Version Stat Collection @@ -27295,7 +27295,7 @@ The `update_version_stat_collection` method updates the polling interval for ver export const title = "Komodo DeFi Framework Method: Delete Wallet"; export const description = "Securely deletes a wallet from the Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; + # Delete Wallet @@ -34274,7 +34274,7 @@ If everything installed successfully, a response that is similar to the followin The Komodo DeFi Framework API executable is now built and available here: `~/komodo-defi-framework/target/debug/kdf` export const title = "Komodo DeFi Framework Method: Telegram Alerts for Bot Trading"; export const description = "The Komodo DeFi Framework API Market Maker bot can be configured to send status update alerts via Telegram."; -import CompactTable from '@/components/mdx/CompactTable'; + # Telegram Alerts for Bot Trading diff --git a/filepathSlugs.json b/filepathSlugs.json index 21c60965e..c39565aaf 100644 --- a/filepathSlugs.json +++ b/filepathSlugs.json @@ -2633,28 +2633,19 @@ "response", "examples", "utxo-coin-activation", - "response-success", "utxo-coin-activation-with-required-confirmations-requires-notarization-and-mm2-arguments", - "response-success-2", "qtum-qrc-20-coin-activation", - "response-success-3", "error-responses", "enable", "arguments-2", "response-2", "examples-2", "native-utxo-coin-activation", - "response-3", "command-with-required-confirmations-requires-notarization-and-mm2-arguments", - "response-4", "command-for-ethereum-and-erc-20-based-blockchains", - "response-5", "evm-coin-activation-with-gas-station-url-and-policy", - "response-6", "polygon-matic-and-plg-20-activation", - "response-7", - "binance-coin-bnb-and-bep-20-activation", - "response-8" + "binance-coin-bnb-and-bep-20-activation" ], "src/pages/komodo-defi-framework/api/legacy/coins_needed_for_kick_start/index.mdx": [ "coins-needed-for-kick-start", diff --git a/src/data/kdf_responses/legacy/coin_activation.json b/src/data/kdf_responses/legacy/coin_activation.json new file mode 100644 index 000000000..f155526d6 --- /dev/null +++ b/src/data/kdf_responses/legacy/coin_activation.json @@ -0,0 +1,280 @@ +{ + "LegacyEnableEth": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "address": "0x7Bc1bBDD6A0a722fC9bffc49c921B685ECB84b94", + "balance": "12.00283000", + "locked_by_swaps": "0.00000000", + "required_confirmations": 1, + "requires_notarization": false, + "mature_confirmations": 0, + "result": "success" + } + } + ], + "error": [ + { + "title": "Transport error", + "notes": "Connection to ETH node failed", + "json": { + "error": "Transport error: JsonRpcError { client_info: \"coin: ETH\", request: JsonRpcRequest { jsonrpc: \"2.0\", id: \"9\", method: \"eth_getBalance\", params: [String(\"0x7Bc1bBDD6A0a722fC9bffc49c921B685ECB84b94\"), String(\"latest\")] }, error: Transport(\"All electrum servers unavailable!\") }" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] eth:295] Coin ETH is already activated" + } + } + ] + }, + "LegacyElectrumBch": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "address": "1DgpBvyeUNHasBt3h3qzC1p9Z8qTgr6t5m", + "balance": "0.12345678", + "required_confirmations": 1, + "requires_notarization": false, + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to electrum servers", + "json": { + "error": "All electrum servers for BCH are unavailable" + } + } + ] + }, + "LegacyElectrumKmd": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "KMD", + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": "762", + "unspendable_balance": "0", + "mature_confirmations": 100, + "required_confirmations": 10, + "requires_notarization": true, + "result": "success" + } + } + ], + "error": [ + { + "title": "Missing mm2 parameter", + "notes": "mm2 param is not set in coins config or enable request", + "json": { + "error": "lp_coins:943] lp_coins:693] mm2 param is not set neither in coins config nor enable request, assuming that coin is not supported" + } + }, + { + "title": "Invalid min_connected", + "notes": "min_connected should be greater than 0", + "json": { + "error": "rpc:184] dispatcher_legacy:141] lp_commands_legacy:141] lp_coins:4462] utxo_standard:73] utxo_coin_builder:616] Internal error: manager:129] min_connected should be greater than 0" + } + }, + { + "title": "Invalid connection range", + "notes": "min_connected must be <= max_connected", + "json": { + "error": "rpc:184] dispatcher_legacy:141] lp_commands_legacy:141] lp_coins:4462] utxo_standard:73] utxo_coin_builder:616] Internal error: manager:132] min_connected (2) must be <= max_connected (1)" + } + } + ] + }, + "LegacyElectrumQtum": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "QTUM", + "address": "QjXkGgoiycYRm2NbiMpkEHuQt7SB9BKHjz", + "balance": "7.77", + "required_confirmations": 3, + "requires_notarization": false, + "unspendable_balance": "0", + "mature_confirmations": 100, + "result": "success" + } + } + ], + "error": [ + { + "title": "Missing mm2 parameter", + "notes": "mm2 param is not set in coins config or enable request", + "json": { + "error": "lp_coins:943] lp_coins:693] mm2 param is not set neither in coins config nor enable request, assuming that coin is not supported" + } + } + ] + }, + "LegacyEnableNative": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "TKL", + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": "333", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "mature_confirmations": 100, + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to daemon", + "json": { + "error": "Failed to connect to native daemon" + } + } + ] + }, + "LegacyEnableNativeWithParams": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "TKL", + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": "777", + "required_confirmations": 10, + "requires_notarization": true, + "unspendable_balance": "0", + "mature_confirmations": 100, + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to daemon", + "json": { + "error": "Failed to connect to native daemon" + } + } + ] + }, + "LegacyEnableEthGasStation": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "ETH", + "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", + "balance": "50", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "result": "success" + } + } + ], + "error": [ + { + "title": "Gas station error", + "notes": "Unable to fetch gas price from station", + "json": { + "error": "Failed to get gas price from station" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] eth:295] Coin ETH is already activated" + } + } + ] + }, + "LegacyEnableMatic": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "NZDS-PLG20", + "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", + "balance": "350", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to Polygon RPC", + "json": { + "error": "All Polygon RPC servers unavailable" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] Coin NZDS-PLG20 is already activated" + } + } + ] + }, + "LegacyEnableBnb": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "BUSD-BEP20", + "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", + "balance": "45", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to BSC RPC", + "json": { + "error": "All BSC RPC servers unavailable" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] Coin BUSD-BEP20 is already activated" + } + } + ] + } +} \ No newline at end of file diff --git a/src/data/kdf_responses/v2/coin_activation.json b/src/data/kdf_responses/v2/coin_activation.json new file mode 100644 index 000000000..0a066a5d7 --- /dev/null +++ b/src/data/kdf_responses/v2/coin_activation.json @@ -0,0 +1,188 @@ +{ + "TaskEnableZCoinStatus": { + "success": [ + { + "title": "ActivatingCoin - enabling has started", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": "ActivatingCoin" + }, + "id": null + } + }, + { + "title": "UpdatingBlocksCache", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": { + "UpdatingBlocksCache": { + "current_scanned_block": 265930, + "latest_block": 269656 + } + } + }, + "id": null + } + }, + { + "title": "BuildingWalletDb", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": { + "BuildingWalletDb": { + "current_scanned_block": 265311, + "latest_block": 269656 + } + } + }, + "id": null + } + }, + { + "title": "Enabling complete", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "Ok", + "details": { + "ticker": "ZOMBIE", + "current_block": 269657, + "wallet_balance": { + "wallet_type": "Iguana", + "address": "zs1e3puxpnal8ljjrqlxv4jctlyndxnm5a3mj5rarjvp0qv72hmm9caduxk9asu9kyc6erfx4zsauj", + "balance": { + "spendable": "29.99989008", + "unspendable": "0" + } + } + } + }, + "id": null + } + } + ], + "error": [ + { + "title": "CoinCreationError - no Zcash Params", + "notes": "", + "json": { + "error": "Error on platform coin ZOMBIE creation: ZCashParamsNotFound", + "error_path": "lib.z_coin_activation.z_coin", + "error_trace": "lib:104] z_coin_activation:218] z_coin:1007]", + "error_type": "CoinCreationError", + "error_data": { + "ticker": "ZOMBIE", + "error": "ZCashParamsNotFound" + } + } + }, + { + "title": "NoSuchTask", + "notes": "You'll see this if the task number does not exist, or the task has already completed.", + "json": { + "mmrpc": "2.0", + "error": "No such task '1'", + "error_path": "init_standalone_coin", + "error_trace": "init_standalone_coin:119]", + "error_type": "NoSuchTask", + "error_data": 1, + "id": null + } + }, + { + "title": "InvalidRequest", + "notes": "", + "json": { + "mmrpc": "2.0", + "error": "Error parsing request: invalid value: integer `-205`, expected u64", + "error_path": "dispatcher", + "error_trace": "dispatcher:109]", + "error_type": "InvalidRequest", + "error_data": "invalid value: integer `-205`, expected u64", + "id": 42 + } + }, + { + "title": "No Zcash Params (alt format)", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "Error", + "details": { + "error": "Error on platform coin ZOMBIE creation: ZCashParamsNotFound", + "error_path": "lib.z_coin_activation.z_coin", + "error_trace": "lib:103] z_coin_activation:192] z_coin:761]", + "error_type": "CoinCreationError", + "error_data": { + "ticker": "ZOMBIE", + "error": "ZCashParamsNotFound" + } + } + }, + "id": null + } + } + ] + }, + "TaskEnableEthStatus": { + "success": [ + { + "title": "InProgress - ActivatingCoin", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": "ActivatingCoin" + }, + "id": null + } + }, + { + "title": "Ok - Complete", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "Ok", + "details": { + "ticker": "MATIC", + "platform_coin": { + "platform": "ETH", + "ticker": "MATIC" + }, + "current_block": 12345678 + } + }, + "id": null + } + } + ], + "error": [ + { + "title": "No such task", + "notes": "Task ID does not exist or has been completed", + "json": { + "mmrpc": "2.0", + "error": "No such task '5'", + "error_path": "init_standalone_coin", + "error_trace": "init_standalone_coin:119]", + "error_type": "NoSuchTask", + "error_data": 5, + "id": null + } + } + ] + } +} \ No newline at end of file diff --git a/src/data/requests/kdf/legacy/coin_activation.json b/src/data/requests/kdf/legacy/coin_activation.json new file mode 100644 index 000000000..3d4097e64 --- /dev/null +++ b/src/data/requests/kdf/legacy/coin_activation.json @@ -0,0 +1,131 @@ +{ + "LegacyElectrumBch": { + "coin": "BCH", + "method": "electrum", + "servers": [ + { + "url": "bch.electrum3.cipig.net:10055", + "protocol": "TCP" + }, + { + "url": "bch.electrum3.cipig.net:20055", + "protocol": "SSL" + }, + { + "url": "bch.electrum3.cipig.net:30055", + "protocol": "WSS" + } + ], + "min_connected": 1, + "max_connected": 2, + "userpass": "RPC_UserP@SSW0RD" + }, + "LegacyElectrumKmd": { + "coin": "KMD", + "method": "electrum", + "servers": [ + { + "url": "kmd.electrum3.cipig.net:10001", + "protocol": "TCP" + }, + { + "url": "kmd.electrum1.cipig.net:20001", + "protocol": "SSL" + }, + { + "url": "kmd.electrum3.cipig.net:20001", + "protocol": "SSL" + } + ], + "required_confirmations": 10, + "requires_notarization": true, + "mm2": 1, + "userpass": "RPC_UserP@SSW0RD" + }, + "LegacyElectrumQtum": { + "coin": "QTUM", + "method": "electrum", + "servers": [ + { + "url": "qtum.electrum1.cipig.net:20050", + "protocol": "SSL" + }, + { + "url": "qtum.electrum2.cipig.net:20050", + "protocol": "SSL" + }, + { + "url": "qtum.electrum2.cipig.net:10050", + "protocol": "TCP" + } + ], + "swap_contract_address": "0x2f754733acd6d753731c00fee32cb484551cc15d", + "userpass": "RPC_UserP@SSW0RD" + }, + "LegacyEnableNative": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable", + "coin": "TKL" + }, + "LegacyEnableNativeWithParams": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable", + "coin": "TKL", + "mm2": 1, + "required_confirmations": 10, + "requires_notarization": true + }, + "LegacyEnableEth": { + "coin": "ETH", + "method": "enable", + "urls": [ + "https://eth3.cipig.net:18555", + "https://mainnet.gateway.tenderly.co", + "https://ethereum-rpc.publicnode.com" + ], + "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", + "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", + "userpass": "RPC_UserP@SSW0RD" + }, + "LegacyEnableEthGasStation": { + "coin": "ETH", + "userpass": "RPC_UserP@SSW0RD", + "method": "enable", + "urls": [ + "https://eth3.cipig.net:18555", + "https://0xrpc.io/eth", + "https://eth.drpc.org" + ], + "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", + "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", + "gas_station_url": "https://ethgasstation.info/json/ethgasAPI.json", + "gas_station_decimals": 8, + "gas_station_policy": { + "policy": "MeanAverageFast" + } + }, + "LegacyEnableMatic": { + "coin": "NZDS-PLG20", + "method": "enable", + "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "urls": [ + "https://node.komodo.earth:8080/polygon", + "https://pol3.cipig.net:18755", + "https://polygon.gateway.tenderly.co" + ], + "userpass": "RPC_UserP@SSW0RD" + }, + "LegacyEnableBnb": { + "coin": "BUSD-BEP20", + "method": "enable", + "swap_contract_address": "0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31", + "fallback_swap_contract": "0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31", + "urls": [ + "https://bsc1.cipig.net:18655", + "https://bsc2.cipig.net:18655", + "https://bsc3.cipig.net:18655" + ], + "userpass": "RPC_UserP@SSW0RD" + } +} \ No newline at end of file diff --git a/src/data/requests/kdf/v2/coin_activation.json b/src/data/requests/kdf/v2/coin_activation.json new file mode 100644 index 000000000..fd45936de --- /dev/null +++ b/src/data/requests/kdf/v2/coin_activation.json @@ -0,0 +1,824 @@ +{ + "TaskEnableEthInitTrezor": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_eth::init", + "params": { + "ticker": "MATIC", + "gas_station_url": "https://gasstation-mainnet.matic.network/", + "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "swap_v2_contracts": { + "taker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "nft_maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE" + }, + "nodes": [ + { + "url": "https://node.komodo.earth:8080/polygon", + "komodo_proxy": true + }, + { + "url": "https://pol3.cipig.net:18755", + "ws_url": "wss://pol3.cipig.net:38755" + }, + { + "url": "https://polygon-bor-rpc.publicnode.com", + "ws_url": "wss://polygon-bor-rpc.publicnode.com" + } + ], + "erc20_tokens_requests": [ + { + "ticker": "PGX-PLG20", + "required_confirmations": 4 + }, + { + "ticker": "AAVE-PLG20", + "required_confirmations": 4 + } + ], + "required_confirmations": 5, + "path_to_address": { + "account_id": 0, + "chain": "External", + "address_id": 1 + }, + "gap_limit": 20, + "scan_policy": "scan_if_new_wallet", + "min_addresses_number": 3 + } + }, + "TaskEnableEthStatus": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_eth::status", + "params": { + "task_id": 1, + "forget_if_finished": false + } + }, + "TaskEnableEthCancel": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_eth::cancel", + "mmrpc": "2.0", + "params": { + "task_id": 3 + } + }, + "TaskEnableEthUserAction": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_eth::user_action", + "params": { + "task_id": 0, + "user_action": { + "action_type": "TrezorPin", + "pin": "862743" + } + } + }, + "EnableErc20Basic": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_erc20", + "mmrpc": "2.0", + "params": { + "ticker": "BAT-ERC20", + "activation_params": { + "required_confirmations": 3 + } + } + }, + "EnableTendermintTokenBasic": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_tendermint_token", + "mmrpc": "2.0", + "params": { + "ticker": "ATOM-IBC_IRIS", + "activation_params": { + "required_confirmations": 3 + } + } + }, + "EnableEthWithTokensGasStation": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_eth_with_tokens", + "mmrpc": "2.0", + "params": { + "ticker": "ETH", + "gas_station_url": "https://ethgasstation.info/json/ethgasAPI.json", + "gas_station_decimals": 8, + "gas_station_policy": { + "policy": "MeanAverageFast" + }, + "mm2": 1, + "priv_key_policy": { + "type": "ContextPrivKey" + }, + "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", + "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", + "nodes": [ + { + "url": "https://eth3.cipig.net:18555", + "ws_url": "wss://eth3.cipig.net:38555" + }, + { + "url": "https://node.komodo.earth:8080/ethereum", + "komodo_proxy": true + }, + { + "url": "https://eth.drpc.org", + "ws_url": "wss://eth.drpc.org" + } + ], + "tx_history": true, + "erc20_tokens_requests": [ + { + "ticker": "APE-ERC20", + "required_confirmations": 4 + }, + { + "ticker": "BCH-ERC20", + "required_confirmations": 4 + }, + { + "ticker": "MINDS-ERC20", + "required_confirmations": 4 + }, + { + "ticker": "BUSD-ERC20", + "required_confirmations": 4 + } + ], + "required_confirmations": 5, + "requires_notarization": false + } + }, + "EnableEthWithTokensMaticBalancesFalse": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_eth_with_tokens", + "mmrpc": "2.0", + "params": { + "ticker": "MATIC", + "get_balances": false, + "tx_history": false, + "gas_station_url": "https://gasstation-mainnet.matic.network/", + "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "swap_v2_contracts": { + "maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "taker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "nft_maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE" + }, + "nodes": [ + { + "url": "https://node.komodo.earth:8080/polygon", + "komodo_proxy": true + }, + { + "url": "https://pol3.cipig.net:18755", + "ws_url": "wss://pol3.cipig.net:38755" + }, + { + "url": "https://polygon-bor-rpc.publicnode.com", + "ws_url": "wss://polygon-bor-rpc.publicnode.com" + } + ], + "erc20_tokens_requests": [ + { + "ticker": "PGX-PLG20", + "required_confirmations": 4 + }, + { + "ticker": "AAVE-PLG20", + "required_confirmations": 4 + } + ], + "required_confirmations": 5, + "requires_notarization": false + } + }, + "EnableEthWithTokensMaticNft": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_eth_with_tokens", + "mmrpc": "2.0", + "params": { + "ticker": "MATIC", + "get_balances": false, + "tx_history": false, + "nft_req": { + "type": "Moralis", + "info": { + "url": "https://moralis-proxy.komodo.earth" + } + }, + "gas_station_url": "https://gasstation-mainnet.matic.network/", + "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", + "nodes": [ + { + "url": "https://node.komodo.earth:8080/polygon", + "komodo_proxy": true + }, + { + "url": "https://pol3.cipig.net:18755", + "ws_url": "wss://pol3.cipig.net:38755" + }, + { + "url": "https://polygon-bor-rpc.publicnode.com", + "ws_url": "wss://polygon-bor-rpc.publicnode.com" + } + ], + "erc20_tokens_requests": [ + { + "ticker": "PGX-PLG20", + "required_confirmations": 4 + }, + { + "ticker": "AAVE-PLG20", + "required_confirmations": 4 + } + ], + "required_confirmations": 5, + "requires_notarization": false + } + }, + "EnableEthWithTokensWalletConnect": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_eth_with_tokens", + "mmrpc": "2.0", + "params": { + "ticker": "ETH", + "gas_station_url": "https://ethgasstation.info/json/ethgasAPI.json", + "gas_station_decimals": 8, + "gas_station_policy": { + "policy": "MeanAverageFast" + }, + "mm2": 1, + "rpc_mode": "Default", + "priv_key_policy": { + "type": "WalletConnect", + "data": "3569914dd09a5cc4ac92dedab354f06ff5db17ef616233a8ba562cbea51269fd" + }, + "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", + "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", + "nodes": [ + { + "url": "https://eth3.cipig.net:18555", + "ws_url": "wss://eth3.cipig.net:38555" + }, + { + "url": "https://node.komodo.earth:8080/ethereum", + "komodo_proxy": true + }, + { + "url": "https://ethereum-rpc.publicnode.com", + "ws_url": "wss://ethereum-rpc.publicnode.com" + } + ], + "tx_history": true, + "erc20_tokens_requests": [ + { + "ticker": "PEPE-ERC20", + "required_confirmations": 4 + } + ], + "required_confirmations": 5 + } + }, + "EnableTendermintWithAssetsBalancesFalse": { + "method": "enable_tendermint_with_assets", + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "params": { + "ticker": "IRIS", + "tokens_params": [ + { + "ticker": "ATOM-IBC_IRIS" + } + ], + "nodes": [ + { + "url": "https://iris-rpc.alpha.komodo.earth/", + "api_url": "https://iris-api.alpha.komodo.earth/", + "grpc_url": "https://iris-grpc.alpha.komodo.earth/", + "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket" + }, + { + "url": "https://rpc.irishub-1.irisnet.org" + } + ], + "tx_history": true, + "get_balances": false + } + }, + "EnableTendermintWithAssetsBalancesTrue": { + "method": "enable_tendermint_with_assets", + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "params": { + "ticker": "IRIS", + "tokens_params": [ + { + "ticker": "ATOM-IBC_IRIS" + } + ], + "nodes": [ + { + "url": "https://iris-rpc.alpha.komodo.earth/", + "api_url": "https://iris-api.alpha.komodo.earth/", + "grpc_url": "https://iris-grpc.alpha.komodo.earth/", + "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket" + }, + { + "url": "https://rpc.irishub-1.irisnet.org" + } + ], + "get_balances": true + } + }, + "EnableTendermintWithAssetsWalletConnect": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_tendermint_with_assets", + "mmrpc": "2.0", + "params": { + "ticker": "ATOM", + "tx_history": true, + "get_balances": true, + "activation_params": { + "priv_key_policy": { + "type": "WalletConnect", + "data": "3569914dd09a5cc4ac92dedab354f06ff5db17ef616233a8ba562cbea51269fd" + } + }, + "nodes": [ + { + "url": "https://cosmos-rpc.alpha.komodo.earth/", + "api_url": "https://cosmos-api.alpha.komodo.earth/", + "grpc_url": "https://cosmos-grpc.alpha.komodo.earth/", + "ws_url": "wss://cosmos-rpc.alpha.komodo.earth/websocket" + }, + { + "url": "https://cosmoshub.rpc.stakin-nodes.com/" + }, + { + "url": "https://node.komodo.earth:8080/cosmos", + "komodo_proxy": true + } + ], + "tokens_params": [] + } + }, + "EnableBchWithTokensTxHistory": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_bch_with_tokens", + "mmrpc": "2.0", + "params": { + "ticker": "BCH", + "allow_slp_unsafe_conf": false, + "bchd_urls": [ + "https://bchd.dragonhound.info" + ], + "mode": { + "rpc": "Electrum", + "rpc_data": { + "servers": [ + { + "url": "bch.electrum3.cipig.net:10055", + "protocol": "TCP" + }, + { + "url": "bch.electrum3.cipig.net:20055", + "protocol": "SSL" + }, + { + "url": "bch.electrum3.cipig.net:30055", + "protocol": "WSS" + } + ] + } + }, + "tx_history": true, + "slp_tokens_requests": [ + { + "ticker": "ASLP-SLP", + "required_confirmations": 4 + } + ], + "required_confirmations": 5, + "requires_notarization": false, + "address_format": { + "format": "cashaddress", + "network": "bitcoincash" + }, + "utxo_merge_params": { + "merge_at": 50, + "check_every": 10, + "max_merge_at_once": 25 + } + } + }, + "EnableBchWithTokensBalancesFalse": { + "userpass": "RPC_UserP@SSW0RD", + "method": "enable_bch_with_tokens", + "mmrpc": "2.0", + "params": { + "ticker": "BCH", + "allow_slp_unsafe_conf": false, + "bchd_urls": [ + "https://bchd.dragonhound.info" + ], + "mode": { + "rpc": "Electrum", + "rpc_data": { + "servers": [ + { + "url": "bch.electrum3.cipig.net:10055", + "protocol": "TCP" + }, + { + "url": "bch.electrum3.cipig.net:20055", + "protocol": "SSL" + }, + { + "url": "bch.electrum3.cipig.net:30055", + "protocol": "WSS" + } + ] + } + }, + "tx_history": true, + "get_balances": false, + "slp_tokens_requests": [ + { + "ticker": "ASLP-SLP", + "required_confirmations": 4 + } + ] + } + }, + "TaskEnableQtumInit": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_qtum::init", + "params": { + "ticker": "QTUM", + "activation_params": { + "mode": { + "rpc": "Electrum", + "rpc_data": { + "servers": [ + { + "url": "qtum.electrum1.cipig.net:30050", + "protocol": "WSS" + }, + { + "url": "qtum.electrum3.cipig.net:10050", + "protocol": "TCP" + }, + { + "url": "qtum.electrum3.cipig.net:30050", + "protocol": "WSS" + } + ] + } + }, + "scan_policy": "scan_if_new_wallet", + "priv_key_policy": { + "type": "Trezor" + }, + "min_addresses_number": 3, + "gap_limit": 20 + } + } + }, + "TaskEnableQtumStatus": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_qtum::status", + "params": { + "task_id": 0, + "forget_if_finished": false + } + }, + "TaskEnableQtumUserAction": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_qtum::user_action", + "params": { + "task_id": 0, + "user_action": { + "action_type": "TrezorPin", + "pin": "862743" + } + } + }, + "TaskEnableQtumCancel": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_qtum::cancel", + "mmrpc": "2.0", + "params": { + "task_id": 3 + } + }, + "TaskEnableUtxoInit": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_utxo::init", + "params": { + "ticker": "KMD", + "activation_params": { + "mode": { + "rpc": "Electrum", + "rpc_data": { + "servers": [ + { + "url": "kmd.electrum3.cipig.net:20001", + "protocol": "SSL" + }, + { + "url": "kmd.electrum3.cipig.net:10001", + "protocol": "TCP" + }, + { + "url": "kmd.electrum2.cipig.net:30001", + "protocol": "WSS" + } + ] + } + }, + "scan_policy": "scan_if_new_wallet", + "priv_key_policy": { + "type": "Trezor" + }, + "min_addresses_number": 3, + "gap_limit": 20 + } + } + }, + "TaskEnableUtxoStatus": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_utxo::status", + "params": { + "task_id": 1, + "forget_if_finished": false + } + }, + "TaskEnableUtxoUserAction": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_utxo::user_action", + "params": { + "task_id": 1, + "user_action": { + "action_type": "TrezorPin", + "pin": "862743" + } + } + }, + "TaskEnableUtxoCancel": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_utxo::cancel", + "mmrpc": "2.0", + "params": { + "task_id": 1 + } + }, + "TaskEnableTendermintInit": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_tendermint::init", + "params": { + "ticker": "IRIS", + "tokens_params": [ + { + "ticker": "ATOM-IBC_IRIS" + } + ], + "nodes": [ + { + "url": "https://iris-rpc.alpha.komodo.earth/", + "api_url": "https://iris-api.alpha.komodo.earth/", + "grpc_url": "https://iris-grpc.alpha.komodo.earth/", + "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket" + }, + { + "url": "https://rpc.irishub-1.irisnet.org" + } + ] + } + }, + "TaskEnableTendermintStatus": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_tendermint::status", + "params": { + "task_id": 0, + "forget_if_finished": false + } + }, + "TaskEnableTendermintUserAction": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_tendermint::user_action", + "params": { + "task_id": 0, + "user_action": { + "action_type": "TrezorPin", + "pin": "862743" + } + } + }, + "TaskEnableTendermintCancel": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_tendermint::cancel", + "mmrpc": "2.0", + "params": { + "task_id": 3 + } + }, + "TaskEnableBchInit": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_bch::init", + "params": { + "ticker": "BCH", + "activation_params": { + "bchd_urls": [ + "https://bchd.dragonhound.info" + ], + "mode": { + "rpc": "Electrum", + "rpc_data": { + "servers": [ + { + "url": "bch.electrum3.cipig.net:10055", + "protocol": "TCP" + }, + { + "url": "bch.electrum3.cipig.net:20055", + "protocol": "SSL" + }, + { + "url": "bch.electrum3.cipig.net:30055", + "protocol": "WSS" + } + ] + } + }, + "slp_tokens_requests": [ + { + "ticker": "USDF" + }, + { + "ticker": "ASLP-SLP", + "required_confirmations": 3 + } + ], + "tx_history": true, + "required_confirmations": 5, + "requires_notarization": false, + "address_format": { + "format": "cashaddress", + "network": "bitcoincash" + }, + "utxo_merge_params": { + "merge_at": 50, + "check_every": 10, + "max_merge_at_once": 25 + } + } + } + }, + "TaskEnableBchStatus": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_bch::status", + "params": { + "task_id": 0, + "forget_if_finished": false + } + }, + "TaskEnableBchUserAction": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_bch::user_action", + "params": { + "task_id": 0, + "user_action": { + "action_type": "TrezorPin", + "pin": "862743" + } + } + }, + "TaskEnableBchCancel": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_bch::cancel", + "mmrpc": "2.0", + "params": { + "task_id": 3 + } + }, + "TaskEnableZCoinInitBasic": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_z_coin::init", + "mmrpc": "2.0", + "params": { + "ticker": "ZOMBIE", + "activation_params": { + "mode": { + "rpc": "Light", + "rpc_data": { + "electrum_servers": [ + { + "url": "zombie.dragonhound.info:10133", + "protocol": "TCP" + }, + { + "url": "zombie.dragonhound.info:20133", + "protocol": "SSL" + }, + { + "url": "zombie.dragonhound.info:30059", + "protocol": "WSS" + } + ], + "light_wallet_d_servers": [ + "https://zombie.dragonhound.info:1443" + ] + } + }, + "zcash_params_path": "/home/username/path_to/.zcash-params", + "scan_blocks_per_iteration": 100, + "scan_interval_ms": 200 + } + } + }, + "TaskEnableZCoinInitWithSyncParams": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_z_coin::init", + "mmrpc": "2.0", + "params": { + "ticker": "ZOMBIE", + "activation_params": { + "mode": { + "rpc": "Light", + "rpc_data": { + "electrum_servers": [ + { + "url": "zombie.dragonhound.info:10133", + "protocol": "TCP" + }, + { + "url": "zombie.dragonhound.info:20133", + "protocol": "SSL" + }, + { + "url": "zombie.dragonhound.info:30059", + "protocol": "WSS" + } + ], + "light_wallet_d_servers": [ + "https://zombie.dragonhound.info:1443" + ], + "sync_params": { + "height": 2528700 + } + } + }, + "zcash_params_path": "/home/username/path_to/.zcash-params", + "scan_blocks_per_iteration": 100, + "scan_interval_ms": 200 + } + } + }, + "TaskEnableZCoinStatus": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_z_coin::status", + "mmrpc": "2.0", + "params": { + "task_id": 0, + "forget_if_finished": false + } + }, + "TaskEnableZCoinUserAction": { + "userpass": "RPC_UserP@SSW0RD", + "mmrpc": "2.0", + "method": "task::enable_z_coin::user_action", + "params": { + "task_id": 3, + "user_action": { + "action_type": "TrezorPin", + "pin": "862743" + } + } + }, + "TaskEnableZCoinCancel": { + "userpass": "RPC_UserP@SSW0RD", + "method": "task::enable_z_coin::cancel", + "mmrpc": "2.0", + "params": { + "task_id": 3 + } + } +} \ No newline at end of file diff --git a/src/data/responses/.gitignore b/src/data/responses/.gitignore new file mode 100644 index 000000000..e69de29bb diff --git a/src/data/responses/kdf/legacy/coin_activation.json b/src/data/responses/kdf/legacy/coin_activation.json new file mode 100644 index 000000000..a9137df67 --- /dev/null +++ b/src/data/responses/kdf/legacy/coin_activation.json @@ -0,0 +1,266 @@ +{ + "LegacyEnableEth": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "address": "0x7Bc1bBDD6A0a722fC9bffc49c921B685ECB84b94", + "balance": "12.00283000", + "locked_by_swaps": "0.00000000", + "required_confirmations": 1, + "requires_notarization": false, + "mature_confirmations": 0, + "result": "success" + } + } + ], + "error": [ + ] + }, + "LegacyElectrumBch": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "address": "1DgpBvyeUNHasBt3h3qzC1p9Z8qTgr6t5m", + "balance": "0.12345678", + "required_confirmations": 1, + "requires_notarization": false, + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to electrum servers", + "json": { + "error": "All electrum servers for BCH are unavailable" + } + } + ] + }, + "LegacyElectrumKmd": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "KMD", + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": "762", + "unspendable_balance": "0", + "mature_confirmations": 100, + "required_confirmations": 10, + "requires_notarization": true, + "result": "success" + } + } + ], + "error": [ + { + "title": "Missing mm2 parameter", + "notes": "mm2 param is not set in coins config or enable request", + "json": { + "error": "lp_coins:943] lp_coins:693] mm2 param is not set neither in coins config nor enable request, assuming that coin is not supported" + } + }, + { + "title": "Invalid min_connected", + "notes": "min_connected should be greater than 0", + "json": { + "error": "rpc:184] dispatcher_legacy:141] lp_commands_legacy:141] lp_coins:4462] utxo_standard:73] utxo_coin_builder:616] Internal error: manager:129] min_connected should be greater than 0" + } + }, + { + "title": "Invalid connection range", + "notes": "min_connected must be <= max_connected", + "json": { + "error": "rpc:184] dispatcher_legacy:141] lp_commands_legacy:141] lp_coins:4462] utxo_standard:73] utxo_coin_builder:616] Internal error: manager:132] min_connected (2) must be <= max_connected (1)" + } + } + ] + }, + "LegacyElectrumQtum": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "QTUM", + "address": "QjXkGgoiycYRm2NbiMpkEHuQt7SB9BKHjz", + "balance": "7.77", + "required_confirmations": 3, + "requires_notarization": false, + "unspendable_balance": "0", + "mature_confirmations": 100, + "result": "success" + } + } + ], + "error": [ + { + "title": "Missing mm2 parameter", + "notes": "mm2 param is not set in coins config or enable request", + "json": { + "error": "lp_coins:943] lp_coins:693] mm2 param is not set neither in coins config nor enable request, assuming that coin is not supported" + } + } + ] + }, + "LegacyEnableNative": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "TKL", + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": "333", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "mature_confirmations": 100, + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to daemon", + "json": { + "error": "Failed to connect to native daemon" + } + } + ] + }, + "LegacyEnableNativeWithParams": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "TKL", + "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", + "balance": "777", + "required_confirmations": 10, + "requires_notarization": true, + "unspendable_balance": "0", + "mature_confirmations": 100, + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to daemon", + "json": { + "error": "Failed to connect to native daemon" + } + } + ] + }, + "LegacyEnableEthGasStation": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "ETH", + "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", + "balance": "50", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "result": "success" + } + } + ], + "error": [ + { + "title": "Gas station error", + "notes": "Unable to fetch gas price from station", + "json": { + "error": "Failed to get gas price from station" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] eth:295] Coin ETH is already activated" + } + } + ] + }, + "LegacyEnableMatic": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "NZDS-PLG20", + "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", + "balance": "350", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to Polygon RPC", + "json": { + "error": "All Polygon RPC servers unavailable" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] Coin NZDS-PLG20 is already activated" + } + } + ] + }, + "LegacyEnableBnb": { + "success": [ + { + "title": "Success", + "notes": "", + "json": { + "coin": "BUSD-BEP20", + "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", + "balance": "45", + "required_confirmations": 1, + "requires_notarization": false, + "unspendable_balance": "0", + "result": "success" + } + } + ], + "error": [ + { + "title": "Connection failed", + "notes": "Unable to connect to BSC RPC", + "json": { + "error": "All BSC RPC servers unavailable" + } + }, + { + "title": "Already enabled", + "notes": "The coin is already activated", + "json": { + "error": "lp_coins:1308] Coin BUSD-BEP20 is already activated" + } + } + ] + } + } \ No newline at end of file diff --git a/src/data/responses/kdf/v2/coin_activation.json b/src/data/responses/kdf/v2/coin_activation.json new file mode 100644 index 000000000..069168595 --- /dev/null +++ b/src/data/responses/kdf/v2/coin_activation.json @@ -0,0 +1,169 @@ +{ + "TaskEnableZCoinStatus": { + "success": [ + { + "title": "ActivatingCoin - enabling has started", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": "ActivatingCoin" + }, + "id": null + } + }, + { + "title": "UpdatingBlocksCache", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": { + "UpdatingBlocksCache": { + "current_scanned_block": 265930, + "latest_block": 269656 + } + } + }, + "id": null + } + }, + { + "title": "BuildingWalletDb", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": { + "BuildingWalletDb": { + "current_scanned_block": 265311, + "latest_block": 269656 + } + } + }, + "id": null + } + }, + { + "title": "Enabling complete", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "Ok", + "details": { + "ticker": "ZOMBIE", + "current_block": 269657, + "wallet_balance": { + "wallet_type": "Iguana", + "address": "zs1e3puxpnal8ljjrqlxv4jctlyndxnm5a3mj5rarjvp0qv72hmm9caduxk9asu9kyc6erfx4zsauj", + "balance": { + "spendable": "29.99989008", + "unspendable": "0" + } + } + } + }, + "id": null + } + } + ], + "error": [ + { + "title": "CoinCreationError - no Zcash Params", + "notes": "", + "json": { + "error": "Error on platform coin ZOMBIE creation: ZCashParamsNotFound", + "error_path": "lib.z_coin_activation.z_coin", + "error_trace": "lib:104] z_coin_activation:218] z_coin:1007]", + "error_type": "CoinCreationError", + "error_data": { + "ticker": "ZOMBIE", + "error": "ZCashParamsNotFound" + } + } + }, + { + "title": "NoSuchTask", + "notes": "You'll see this if the task number does not exist, or the task has already completed.", + "json": { + "mmrpc": "2.0", + "error": "No such task '1'", + "error_path": "init_standalone_coin", + "error_trace": "init_standalone_coin:119]", + "error_type": "NoSuchTask", + "error_data": 1, + "id": null + } + }, + { + "title": "InvalidRequest", + "notes": "", + "json": { + "mmrpc": "2.0", + "error": "Error parsing request: invalid value: integer `-205`, expected u64", + "error_path": "dispatcher", + "error_trace": "dispatcher:109]", + "error_type": "InvalidRequest", + "error_data": "invalid value: integer `-205`, expected u64", + "id": 42 + } + }, + { + "title": "No Zcash Params (alt format)", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "Error", + "details": { + "error": "Error on platform coin ZOMBIE creation: ZCashParamsNotFound", + "error_path": "lib.z_coin_activation.z_coin", + "error_trace": "lib:103] z_coin_activation:192] z_coin:761]", + "error_type": "CoinCreationError", + "error_data": { + "ticker": "ZOMBIE", + "error": "ZCashParamsNotFound" + } + } + }, + "id": null + } + } + ] + }, + "TaskEnableEthStatus": { + "success": [ + { + "title": "InProgress - ActivatingCoin", + "notes": "", + "json": { + "mmrpc": "2.0", + "result": { + "status": "InProgress", + "details": "ActivatingCoin" + }, + "id": null + } + } + ], + "error": [ + { + "title": "No such task", + "notes": "Task ID does not exist or has been completed", + "json": { + "mmrpc": "2.0", + "error": "No such task '5'", + "error_path": "init_standalone_coin", + "error_trace": "init_standalone_coin:119]", + "error_type": "NoSuchTask", + "error_data": 5, + "id": null + } + } + ] + } +} \ No newline at end of file diff --git a/src/data/tables/legacy/coin_activation.json b/src/data/tables/legacy/coin_activation.json new file mode 100644 index 000000000..813c8cecc --- /dev/null +++ b/src/data/tables/legacy/coin_activation.json @@ -0,0 +1,241 @@ +{ + "ElectrumArguments": { + "data": [ + { + "parameter": "coin", + "type": "string", + "required": true, + "description": "Ticker of coin to activate" + }, + { + "parameter": "servers", + "type": "list of objects", + "required": true, + "description": "A list of standard [ActivationServers](/komodo-defi-framework/api/common_structures/activation/#activation-servers) objects." + }, + { + "parameter": "mm2", + "type": "integer", + "required": false, + "description": "Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1`" + }, + { + "parameter": "min_connected", + "type": "integer", + "required": false, + "default": "1", + "description": "Minimum number of electrum servers to maintain an active connection to." + }, + { + "parameter": "max_connected", + "type": "integer", + "required": false, + "description": "Maximum number of electrum servers to maintain an active connection to. If not set, defaults to all servers in activation request." + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "3", + "description": "Number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap." + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "false", + "description": "If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step." + }, + { + "parameter": "swap_contract_address", + "type": "string", + "required": false, + "description": "QRC20 only. Address of etomic swap smart contract" + }, + { + "parameter": "fallback_swap_contract", + "type": "string", + "required": false, + "description": "QRC20 only. Address of backup etomic swap smart contract" + }, + { + "parameter": "utxo_merge_params", + "type": "object", + "required": false, + "description": "A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses." + } + ] + }, + "ElectrumResponse": { + "data": [ + { + "parameter": "address", + "type": "string", + "required": true, + "description": "the address of the user's `coin` wallet, based on the user's passphrase" + }, + { + "parameter": "balance", + "type": "string (numeric)", + "required": true, + "description": "the amount of `coin` the user holds in their wallet; does not include `unspendable_balance`" + }, + { + "parameter": "unspendable_balance", + "type": "string (numeric)", + "required": true, + "description": "the `coin` balance that is unspendable at the moment (e.g. if the address has immature UTXOs)" + }, + { + "parameter": "coin", + "type": "string", + "required": true, + "description": "the ticker of the enabled coin" + }, + { + "parameter": "required_confirmations", + "type": "number", + "required": true, + "description": "the number of transaction confirmations for which the Komodo DeFi Framework API must wait during the atomic swap process" + }, + { + "parameter": "mature_confirmations", + "type": "number", + "required": false, + "description": "the number of coinbase transaction confirmations required to become mature; UTXO coins only" + }, + { + "parameter": "requires_notarization", + "type": "bool", + "required": true, + "description": "whether the node must wait for a notarization of the selected coin that is performing the atomic swap transactions; applicable only for coins using Komodo dPoW" + }, + { + "parameter": "result", + "type": "string", + "required": true, + "description": "the result of the request; this value either indicates `success`, or an error, or another type of failure" + } + ] + }, + "EnableArguments": { + "data": [ + { + "parameter": "coin", + "type": "string", + "required": true, + "description": "the name of the coin the user desires to enable" + }, + { + "parameter": "urls", + "type": "array of strings", + "required": false, + "description": "required for ETH/ERC20 and other gas model chains - urls of Ethereum RPC nodes to which the user desires to connect" + }, + { + "parameter": "swap_contract_address", + "type": "string", + "required": false, + "description": "required for QRC20 only - address of etomic swap smart contract" + }, + { + "parameter": "fallback_swap_contract", + "type": "string", + "required": false, + "description": "required for QRC20 only - address of backup etomic swap smart contract" + }, + { + "parameter": "gas_station_decimals", + "type": "integer", + "required": false, + "default": "8", + "description": "optional for ETH/ERC20 and other gas model chains - Defines the decimals used to denominate the gas station response to gwei units. For example, the ETH gas station uses 8 decimals, which means that \"average\": 860 is equal to 86 gwei. While the Matic gas station uses 9 decimals, so 860 would mean 860 gwei exactly." + }, + { + "parameter": "gas_station_policy.policy", + "type": "string", + "required": false, + "default": "MeanAverageFast", + "description": "optional for ETH/ERC20 and other gas model chains - Defines the method of gas price calculation from the station response. `\"MeanAverageFast\"` will use the mean between average and fast fields. `\"Average\"` will return a simple average value." + }, + { + "parameter": "mm2", + "type": "integer", + "required": false, + "description": "Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1`" + }, + { + "parameter": "tx_history", + "type": "bool", + "required": false, + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "3", + "description": "Number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap." + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "false", + "description": "If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step." + } + ] + }, + "EnableResponse": { + "data": [ + { + "parameter": "address", + "type": "string", + "required": true, + "description": "the address of the user's `coin` wallet, based on the user's passphrase" + }, + { + "parameter": "balance", + "type": "string (numeric)", + "required": true, + "description": "the amount of `coin` the user holds in their wallet; does not include `unspendable_balance`" + }, + { + "parameter": "unspendable_balance", + "type": "string (numeric)", + "required": true, + "description": "the `coin` balance that is unspendable at the moment (e.g. if the address has immature UTXOs)" + }, + { + "parameter": "coin", + "type": "string", + "required": true, + "description": "the ticker of enabled coin" + }, + { + "parameter": "required_confirmations", + "type": "number", + "required": true, + "description": "Komodo DeFi Framework API will wait for the this number of coin's transaction confirmations during the swap" + }, + { + "parameter": "requires_notarization", + "type": "bool", + "required": true, + "description": "whether the node must wait for a notarization of the selected coin that is performing the atomic swap transactions" + }, + { + "parameter": "mature_confirmations", + "type": "number", + "required": false, + "description": "the number of coinbase transaction confirmations required to become mature; UTXO coins only" + }, + { + "parameter": "result", + "type": "string", + "required": true, + "description": "the result of the request; this value either indicates `success`, or an error or other type of failure" + } + ] + } +} \ No newline at end of file diff --git a/src/data/tables/v2/coin_activation.json b/src/data/tables/v2/coin_activation.json new file mode 100644 index 000000000..75d2d5bc4 --- /dev/null +++ b/src/data/tables/v2/coin_activation.json @@ -0,0 +1,999 @@ +{ + "EnableBchWithTokensArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin. Options: `BCH` or `tBCH`" + }, + { + "parameter": "bchd_urls", + "type": "array of strings", + "required": true, + "description": "A list of BCHD gRPC API server URLs, used for validation of SLP token transactions. It's recommended to add as many servers as possible. The URLs list can be found at [https://bchd.fountainhead.cash/](https://bchd.fountainhead.cash/)." + }, + { + "parameter": "mode", + "type": "object", + "required": true, + "description": "A standard [ActivationMode](/komodo-defi-framework/api/common_structures/activation/#activation-mode) object." + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, spawns a background loop to store the local cache of address(es) transactions." + }, + { + "parameter": "slp_tokens_requests", + "type": "array of objects", + "required": true, + "description": "A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects." + }, + { + "parameter": "address_format", + "type": "object", + "required": false, + "description": "Overwrites the address format from coins file, if set. A standard [AddressFormat](/komodo-defi-framework/api/common_structures/wallet/#address-format) object." + }, + { + "parameter": "allow_slp_unsafe_conf", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, allows bchd_urls to be empty. **Warning:** it is highly unsafe to do so as it may lead to invalid SLP transactions generation and tokens burning." + }, + { + "parameter": "get_balances", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly." + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "value in the coins file, or `3` if not set", + "description": "Confirmations to wait for steps in swap." + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "Has no effect on BCH." + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "utxo_merge_params", + "type": "object", + "required": true, + "description": "A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses." + } + ] + }, + "EnableBchWithTokensResponse": { + "data": [ + { + "parameter": "current_block", + "type": "integer", + "required": true, + "description": "Block height of the coin being activated" + }, + { + "parameter": "bch_addresses_infos", + "type": "object", + "required": true, + "description": "A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter." + }, + { + "parameter": "slp_addresses_infos", + "type": "object", + "required": true, + "description": "A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter." + } + ] + }, + "EnableErc20Arguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the ERC20 like token coin." + }, + { + "parameter": "activation_params.required_confirmations", + "type": "integer", + "required": false, + "default": "value in the coins file if not set", + "description": "Confirmations to wait for steps in swap." + } + ] + }, + "EnableTendermintTokenArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the Tendermint asset." + }, + { + "parameter": "activation_params.required_confirmations", + "type": "integer", + "required": false, + "default": "value in the coins file if not set", + "description": "Confirmations to wait for steps in swap." + } + ] + }, + "EnableEthWithTokensArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin. Options: `ETH`, `AVAX`, `BNB`, `FTM`, `MATIC`, `ONE`, `ETH-ARB20`" + }, + { + "parameter": "mm2", + "type": "integer", + "required": false, + "description": "Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1`" + }, + { + "parameter": "swap_contract_address", + "type": "string", + "required": true, + "description": "Address of etomic swap smart contract" + }, + { + "parameter": "fallback_swap_contract", + "type": "string", + "required": true, + "description": "Address of backup etomic swap smart contract." + }, + { + "parameter": "nodes", + "type": "array of objects", + "required": true, + "description": "A list of standard [CoinNode](/komodo-defi-framework/api/common_structures/activation/#coin-node) objects." + }, + { + "parameter": "erc20_tokens_requests", + "type": "array of objects", + "required": true, + "description": "A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects." + }, + { + "parameter": "gas_station_decimals", + "type": "integer", + "required": false, + "default": "`8`", + "description": "For ETH/ERC20 and other gas model chains. Defines the decimals used to denominate the gas station response to gwei units. For example, the ETH gas station uses 8 decimals, which means that \"average\": 860 is equal to 86 gwei. While the Matic gas station uses 9 decimals, so 860 would mean 860 gwei exactly." + }, + { + "parameter": "gas_station_policy.policy", + "type": "string", + "required": false, + "default": "`\"MeanAverageFast\"`", + "description": "For ETH/ERC20 and other gas model chains. Defines the method of gas price calculation from the station response. `\"MeanAverageFast\"` will use the mean between average and fast fields. `\"Average\"` will return a simple average value." + }, + { + "parameter": "get_balances", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly." + }, + { + "parameter": "priv_key_policy", + "type": "object", + "required": false, + "default": "`{\"type\": \"ContextPrivKey\"}`", + "description": "A standard [PrivKeyPolicy](/komodo-defi-framework/api/common_structures/wallet/#priv-key-policy) object." + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "`3`", + "description": "When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap" + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step." + }, + { + "parameter": "rpc_mode", + "type": "string", + "required": false, + "default": "`Default`", + "description": "Value can be `Metamask` only when the Komodo DeFi Framework is built targeting `wasm`." + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "nft_req", + "type": "object", + "required": false, + "description": "Encapsulates the request parameters for NFT activation, including NFT provider configuration. A standard [NftProvider](/komodo-defi-framework/api/common_structures/nfts/#nft-provider) object." + }, + { + "parameter": "swap_v2_contracts", + "type": "object", + "required": false, + "description": "Must be provided if \"use_trading_proto_v2\" is true in [your configuration](/komodo-defi-framework/setup/configure-mm2-json/). A standard [SwapV2Contracts](/komodo-defi-framework/api/common_structures/activation/#tokens-request) object." + } + ] + }, + "EnableEthWithTokensResponse": { + "data": [ + { + "parameter": "current_block", + "type": "integer", + "required": true, + "description": "Block height of the coin being activated" + }, + { + "parameter": "eth_addresses_infos", + "type": "object", + "required": true, + "description": "A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter." + }, + { + "parameter": "erc20_addresses_infos", + "type": "object", + "required": true, + "description": "A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter." + }, + { + "parameter": "nfts_infos", + "type": "list", + "required": true, + "description": "A list of standard [NftInfoBasic](/komodo-defi-framework/api/common_structures/nfts/#nft-info) objects." + } + ] + }, + "EnableTendermintWithAssetsArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin. Options: `ATOM`, `IRIS`, `OSMOSIS`" + }, + { + "parameter": "mm2", + "type": "integer", + "required": false, + "description": "Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1`" + }, + { + "parameter": "tokens_params", + "type": "array of objects", + "required": true, + "description": "A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects." + }, + { + "parameter": "nodes", + "type": "array of objects", + "required": true, + "description": "A list of [CoinNode objects](/komodo-defi-framework/api/common_structures/activation/#coin-node)." + }, + { + "parameter": "priv_key_policy", + "type": "string", + "required": false, + "default": "`ContextPrivKey`", + "description": "Value can be `ContextPrivKey`,`Trezor` when Komodo DeFi Framework is built for native platforms. value can be `ContextPrivKey`, `Trezor`, `Metamask` when the Komodo DeFi Framework is built targeting `wasm`" + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "`3`", + "description": "When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap" + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step." + }, + { + "parameter": "get_balances", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly." + }, + { + "parameter": "activation_params", + "type": "object", + "required": false, + "description": "Only used with Metamask, Keplr or WalletConnect activations. Defines the [PrivKeyPolicy](/komodo-defi-framework/api/common_structures/wallet/#priv-key-policy) of the connection." + } + ] + }, + "EnableTendermintWithAssetsResponse": { + "data": [ + { + "parameter": "current_block", + "type": "integer", + "required": true, + "description": "Block height of the coin being activated" + }, + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin, as input in the request." + }, + { + "parameter": "address", + "type": "string", + "required": true, + "description": "An address for the activated coin" + }, + { + "parameter": "balance", + "type": "object", + "required": false, + "description": "Only returned when `get_balances` is `true`. A standard [BalanceInfos](/komodo-defi-framework/api/common_structures/wallet/#balance-info) object." + }, + { + "parameter": "tokens_balances", + "type": "array of objects", + "required": false, + "description": "Only returned when `get_balances` is `true`. A list of standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) objects, one for each token." + }, + { + "parameter": "tokens_tickers", + "type": "array", + "required": false, + "description": "Only returned when `get_balances` is `false`. A list of each token which was activated." + } + ] + }, + "TaskEnableEthArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin. Options: `ETH`, `AVAX`, `BNB`, `FTM`, `MATIC`, `ONE`, `ETH-ARB20`" + }, + { + "parameter": "mm2", + "type": "integer", + "required": false, + "description": "Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1`" + }, + { + "parameter": "swap_contract_address", + "type": "string", + "required": true, + "description": "Address of etomic swap smart contract" + }, + { + "parameter": "fallback_swap_contract", + "type": "string", + "required": true, + "description": "Address of backup etomic swap smart contract." + }, + { + "parameter": "nodes", + "type": "array of objects", + "required": true, + "description": "A list of standard [CoinNode](/komodo-defi-framework/api/common_structures/activation/#coin-node) objects." + }, + { + "parameter": "erc20_tokens_requests", + "type": "array of objects", + "required": true, + "description": "A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects." + }, + { + "parameter": "gas_station_url", + "type": "string", + "required": false, + "description": "A url for gas station api." + }, + { + "parameter": "gas_station_decimals", + "type": "integer", + "required": false, + "default": "`8`", + "description": "For ETH/ERC20 and other gas model chains. Defines the decimals used to denominate the gas station response to gwei units. For example, the ETH gas station uses 8 decimals, which means that \"average\": 860 is equal to 86 gwei. While the Matic gas station uses 9 decimals, so 860 would mean 860 gwei exactly." + }, + { + "parameter": "gas_station_policy.policy", + "type": "string", + "required": false, + "default": "`\"MeanAverageFast\"`", + "description": "For ETH/ERC20 and other gas model chains. Defines the method of gas price calculation from the station response. `\"MeanAverageFast\"` will use the mean between average and fast fields. `\"Average\"` will return a simple average value." + }, + { + "parameter": "get_balances", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly." + }, + { + "parameter": "priv_key_policy", + "type": "string", + "required": false, + "default": "`ContextPrivKey`", + "description": "Value can be `ContextPrivKey`,`Trezor` when Komodo DeFi Framework is built for native platforms. value can be `ContextPrivKey`, `Trezor`, `Metamask` when the Komodo DeFi Framework is built targeting `wasm`" + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "`3`", + "description": "When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap" + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step." + }, + { + "parameter": "rpc_mode", + "type": "string", + "required": false, + "default": "`Default`", + "description": "Value can be `Metamask` only when the Komodo DeFi Framework is built targeting `wasm`." + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "nft_req", + "type": "object", + "required": false, + "description": "Non-HD only. encapsulates the request parameters for NFT activation, including NFT provider configuration." + }, + { + "parameter": "min_addresses_number", + "type": "integer", + "required": false, + "description": "HD wallets only. How many additional addreesses to generate at a minimum." + }, + { + "parameter": "scan_policy", + "type": "string", + "required": false, + "description": "HD wallets only. Whether or not to scan for new addresses. Select from `do_not_scan`, `scan_if_new_wallet` or `scan`. Note that `scan` will result in multple requests to the Komodo DeFi Framework." + }, + { + "parameter": "gap_limit", + "type": "integer", + "required": false, + "description": "HD wallets only. The max number of empty addresses in a row. If transactions were sent to an address outside the `gap_limit`, they will not be identified when scanning." + }, + { + "parameter": "path_to_address", + "type": "object", + "required": false, + "description": "HD wallets only. A standard [AddressPath](/komodo-defi-framework/api/common_structures/wallet/#address-path) object." + }, + { + "parameter": "swap_v2_contracts", + "type": "object", + "required": false, + "description": "Must be provided if \"use_trading_proto_v2\" is true in [your configuration](/komodo-defi-framework/setup/configure-mm2-json/). A standard [SwapV2Contracts](/komodo-defi-framework/api/common_structures/activation/#tokens-request) object." + } + ] + }, + "TaskResponse": { + "data": [ + { + "parameter": "task_id", + "type": "integer", + "required": true, + "description": "An identifying number which is used to query task status." + } + ] + }, + "TaskStatusArguments": { + "data": [ + { + "parameter": "task_id", + "type": "integer", + "required": true, + "description": "The identifying number returned when initiating the initialisation process." + }, + { + "parameter": "forget_if_finished", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, will return final response for completed tasks." + } + ] + }, + "TaskUserActionArguments": { + "data": [ + { + "parameter": "task_id", + "type": "integer", + "required": true, + "description": "The identifying number returned when initiating the initialisation process." + }, + { + "parameter": "user_action", + "type": "object", + "required": true, + "description": "Object containing the params below" + }, + { + "parameter": "user_action.action_type", + "type": "string", + "required": true, + "description": "Will be `TrezorPin` for this method" + }, + { + "parameter": "user_action.pin", + "type": "string (number)", + "required": true, + "description": "When the Trezor device is displaying a grid of numbers for PIN entry, this param will contain your Trezor pin, as mapped through your keyboard numpad. See the image below for more information." + } + ] + }, + "TaskUserActionResponse": { + "data": [ + { + "parameter": "result", + "type": "string", + "required": true, + "description": "The outcome of the request." + } + ] + }, + "TaskCancelArguments": { + "data": [ + { + "parameter": "task_id", + "type": "integer", + "required": true, + "description": "The identifying number returned when initiating the enabling process." + } + ] + }, + "TaskCancelResponse": { + "data": [ + { + "parameter": "result", + "type": "string", + "required": true, + "description": "Indicates task cancellation was succesful." + }, + { + "parameter": "error", + "type": "string", + "required": true, + "description": "An error message to explain what went wrong." + }, + { + "parameter": "error_path", + "type": "string", + "required": true, + "description": "An indicator of the class or function which reurned the error." + }, + { + "parameter": "error_trace", + "type": "string", + "required": true, + "description": "An indicator of where in the source code the error was thrown." + }, + { + "parameter": "error_type", + "type": "string", + "required": true, + "description": "An enumerated value for the returned error." + }, + { + "parameter": "error_data", + "type": "string", + "required": true, + "description": "The input task ID which resulted in the error." + } + ] + }, + "TaskEnableQtumArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "The ticker of the coin you want to enable." + }, + { + "parameter": "activation_params", + "type": "object", + "required": true, + "description": "An object containing the actvation parameters below." + }, + { + "parameter": ".priv_key_policy", + "type": "object", + "required": false, + "default": "`{\"type\": \"ContextPrivKey\"}`", + "description": "A standard [PrivKeyPolicy](/komodo-defi-framework/api/common_structures/wallet/#priv-key-policy) object." + }, + { + "parameter": ".min_addresses_number", + "type": "integer", + "required": true, + "description": "How many additional addreesses to generate at a minimum." + }, + { + "parameter": ".scan_policy", + "type": "string", + "required": true, + "description": "Whether or not to scan for new addresses. Select from `do_not_scan`, `scan_if_new_wallet` or `scan`. Note that `scan` will result in multple requests to the Komodo DeFi Framework." + }, + { + "parameter": ".gap_limit", + "type": "integer", + "required": true, + "description": "The max number of empty addresses in a row. If transactions were sent to an address outside the `gap_limit`, they will not be identified when scanning." + }, + { + "parameter": ".mode", + "type": "object", + "required": true, + "description": "An object containing RPC type and data parameters as below." + }, + { + "parameter": "..rpc", + "type": "string", + "required": true, + "description": "UTXO RPC mode. Options: `{ \"rpc\":\"Native\" }` if running a native blockchain node, or `\"rpc\":\"Electrum\"` to use electrum RPCs. If using electrum, a list of electrum servers is required under `rpc_data.servers`" + }, + { + "parameter": "..rpc_data", + "type": "object", + "required": true, + "description": "An object containing electrum server information." + }, + { + "parameter": "...servers", + "type": "list", + "required": true, + "description": "A list of electrum server URLs ([https://github.com/KomodoPlatform/coins/tree/master/electrums](https://github.com/KomodoPlatform/coins/tree/master/electrums))" + }, + { + "parameter": "....url", + "type": "object", + "required": true, + "description": "The url and port of a coins electrum server" + }, + { + "parameter": "....ws_url", + "type": "object", + "required": false, + "description": "Used to define electrum server url/port for websocket connections." + }, + { + "parameter": "....protocol", + "type": "object", + "required": false, + "default": "`TCP`", + "description": "Defines electrum server protocol as `TCP` or `SSL`." + }, + { + "parameter": "....disable_cert_verification", + "type": "boolean", + "required": false, + "description": "For `SSL` electrum connections, this will allow expired certificates." + } + ] + }, + "TaskEnableBchArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin. Options: `BCH` or `tBCH`" + }, + { + "parameter": "bchd_urls", + "type": "array of strings", + "required": true, + "description": "A list of BCHD gRPC API server URLs, used for validation of SLP token transactions. It's recommended to add as many servers as possible. The URLs list can be found at [https://bchd.fountainhead.cash/](https://bchd.fountainhead.cash/)." + }, + { + "parameter": "mode", + "type": "object", + "required": true, + "description": "A standard [ActivationMode](/komodo-defi-framework/api/common_structures/activation/#activation-mode) object." + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, spawns a background loop to store the local cache of address(es) transactions." + }, + { + "parameter": "slp_tokens_requests", + "type": "array of objects", + "required": true, + "description": "A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects." + }, + { + "parameter": "address_format", + "type": "object", + "required": false, + "description": "Overwrites the address format from coins file, if set. A standard [AddressFormat](/komodo-defi-framework/api/common_structures/wallet/#address-format) object." + }, + { + "parameter": "allow_slp_unsafe_conf", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, allows bchd_urls to be empty. **Warning:** it is highly unsafe to do so as it may lead to invalid SLP transactions generation and tokens burning." + }, + { + "parameter": "get_balances", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly." + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "value in the coins file, or `3` if not set", + "description": "Confirmations to wait for steps in swap." + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "Has no effect on BCH." + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "utxo_merge_params", + "type": "object", + "required": true, + "description": "A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses." + } + ] + }, + "TaskEnableTendermintArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin. Options: `ATOM`, `IRIS`, `OSMOSIS`" + }, + { + "parameter": "mm2", + "type": "integer", + "required": false, + "description": "Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1`" + }, + { + "parameter": "tokens_params", + "type": "array of objects", + "required": true, + "description": "A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects." + }, + { + "parameter": "nodes", + "type": "array of objects", + "required": true, + "description": "A list of [CoinNode objects](/komodo-defi-framework/api/common_structures/activation/#coin-node)." + }, + { + "parameter": "priv_key_policy", + "type": "string", + "required": false, + "default": "`ContextPrivKey`", + "description": "Value can be `ContextPrivKey`,`Trezor` when Komodo DeFi Framework is built for native platforms. value can be `ContextPrivKey`, `Trezor`, `Metamask` when the Komodo DeFi Framework is built targeting `wasm`" + }, + { + "parameter": "tx_history", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my_tx_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method" + }, + { + "parameter": "required_confirmations", + "type": "integer", + "required": false, + "default": "`3`", + "description": "When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap" + }, + { + "parameter": "requires_notarization", + "type": "boolean", + "required": false, + "default": "`false`", + "description": "If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step." + }, + { + "parameter": "get_balances", + "type": "boolean", + "required": false, + "default": "`true`", + "description": "If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly." + } + ] + }, + "TaskEnableZCoinArguments": { + "data": [ + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of coin to activate" + }, + { + "parameter": "activation_params", + "type": "object", + "required": true, + "description": "A standard [ActivationRpcData](/komodo-defi-framework/api/common_structures/activation/#activation-rpc-data) object." + } + ] + }, + "TaskStatusResponse": { + "data": [ + { + "parameter": "status", + "type": "string", + "required": true, + "description": "A short indication of how the enabling is progressing." + }, + { + "parameter": "details", + "type": "object", + "required": true, + "description": "Depending on the state of enabling progress, this will contain different information as shown in the responses below." + } + ] + }, + "TaskStatusResponseReady": { + "data": [ + { + "parameter": "current_block", + "type": "integer", + "required": true, + "description": "Block height of the coin being activated" + }, + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the coin being activated." + }, + { + "parameter": "wallet_balance", + "type": "object", + "required": true, + "description": "A standard [WalletBalanceInfo](/komodo-defi-framework/api/common_structures/wallet/#wallet-balance-info) object. Note: the structure may vary based on the `get_balances` parameter value in the activation request." + } + ] + }, + "TaskStatusTendermintResponse": { + "data": [ + { + "parameter": "current_block", + "type": "integer", + "required": true, + "description": "Block height of the coin being activated" + }, + { + "parameter": "ticker", + "type": "string", + "required": true, + "description": "Ticker of the platform protocol coin, as input in the request." + }, + { + "parameter": "address", + "type": "string", + "required": true, + "description": "An address for the activated coin" + }, + { + "parameter": "balance", + "type": "object", + "required": false, + "description": "Only returned when `get_balances` is `true`. A standard [BalanceInfos](/komodo-defi-framework/api/common_structures/wallet/#balance-info) object." + }, + { + "parameter": "tokens_balances", + "type": "array of objects", + "required": false, + "description": "Only returned when `get_balances` is `true`. A list of standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) objects, one for each token." + }, + { + "parameter": "tokens_tickers", + "type": "array", + "required": false, + "description": "Only returned when `get_balances` is `false`. A list of each token which was activated." + } + ] + }, + "TaskStatusInProgress": { + "data": [ + { + "parameter": "status", + "type": "string", + "required": true, + "description": "Will return `InProgress` if task is not yet comepleted" + }, + { + "parameter": "details", + "type": "string", + "required": true, + "description": "An indication of the current step of the activation process" + } + ] + }, + "TaskStatusErrorResponse": { + "data": [ + { + "parameter": "status", + "type": "string", + "required": true, + "description": "A short indication of how the requested process is progressing." + }, + { + "parameter": "details.result", + "type": "object", + "required": true, + "description": "Depending on the state of process progress, this will contain different information as detailed in the items below." + } + ] + } +} \ No newline at end of file diff --git a/src/pages/komodo-defi-framework/api/common_structures/activation/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/activation/index.mdx index b86d8c576..69b37a5cb 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/activation/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/activation/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi SDK Common Structures: Activation"; export const description = "The Komodo DeFi SDK uses a variety of activation methods, depending on the type of coin."; -import CompactTable from '@/components/mdx/CompactTable'; # Activation Common Structures diff --git a/src/pages/komodo-defi-framework/api/common_structures/enums/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/enums/index.mdx index d7a2b25a8..ab932151f 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/enums/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/enums/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enums"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; # Enums diff --git a/src/pages/komodo-defi-framework/api/common_structures/error_types/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/error_types/index.mdx index 931ffcd6c..bb66ecbc9 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/error_types/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/error_types/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework RPC Errors"; export const description = "A comprehensive list of possible RPC errors in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; # KDF RPC Errors diff --git a/src/pages/komodo-defi-framework/api/common_structures/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/index.mdx index 3b9136ff1..a9802f3b6 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Common Structures"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; # Common Structures diff --git a/src/pages/komodo-defi-framework/api/common_structures/lightning/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/lightning/index.mdx index 6ab42bce7..7e641a97e 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/lightning/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/lightning/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Lightning Common Structures"; export const description = "Lightning Network common structures for Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; # Lightning Common Structures diff --git a/src/pages/komodo-defi-framework/api/common_structures/nfts/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/nfts/index.mdx index 2301e495b..b102b1c97 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/nfts/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/nfts/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi SDK Common Structures: Non-Fungible Tokens"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; # NFT Common Structures diff --git a/src/pages/komodo-defi-framework/api/common_structures/orders/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/orders/index.mdx index f00ff1ae0..89f8e1bd9 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/orders/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/orders/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi SDK Common Structures: Orders"; export const description = "Each order on the Komodo Defi oderbook can be queried to view full details of each order for a pair, or the best orders for a ticker."; -import CompactTable from '@/components/mdx/CompactTable'; # Order Common Structures diff --git a/src/pages/komodo-defi-framework/api/common_structures/rational_number_note/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/rational_number_note/index.mdx index a82b8f28e..9f574d5d3 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/rational_number_note/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/rational_number_note/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Rational Number Type"; export const description = "The Komodo DeFi Framework API now offers the num-rational crate feature. This is used to represent order volumes and prices."; -import CompactTable from '@/components/mdx/CompactTable'; # Rational Number Type diff --git a/src/pages/komodo-defi-framework/api/common_structures/swaps/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/swaps/index.mdx index 0a67ac33f..ca0ede872 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/swaps/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/swaps/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi SDK Common Structures: Swaps"; export const description = "Each active or completed trade from the Komodo DeFi SDK includes an unique identifier (UUID), a summary of the trade and detailed information relating to each swap event."; -import CompactTable from '@/components/mdx/CompactTable'; # Swap Common Structures diff --git a/src/pages/komodo-defi-framework/api/common_structures/swaps/maker_events/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/swaps/maker_events/index.mdx index db9682448..d78c13137 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/swaps/maker_events/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/swaps/maker_events/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo Defi SDK Swaps: Maker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the maker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; # Maker Events diff --git a/src/pages/komodo-defi-framework/api/common_structures/swaps/taker_events/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/swaps/taker_events/index.mdx index 45bd9f86c..fc4b71260 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/swaps/taker_events/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/swaps/taker_events/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo Defi SDK Swaps: Taker Events"; export const description = "A description of events and outcomes for each step of an atomic swap from the taker's perspective."; -import CompactTable from '@/components/mdx/CompactTable'; # Taker Events diff --git a/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx index 83883cb77..de141e6fc 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi SDK Common Structures: Wallet Operations"; export const description = "Starting with version beta-2.1.3434, the Komodo DeFi SDK supports the standardized protocol format called mmrpc 2.0."; -import CompactTable from '@/components/mdx/CompactTable'; # Wallet Common Structures diff --git a/src/pages/komodo-defi-framework/api/legacy/coin_activation/index.mdx b/src/pages/komodo-defi-framework/api/legacy/coin_activation/index.mdx index c035d362d..12d3ddaef 100644 --- a/src/pages/komodo-defi-framework/api/legacy/coin_activation/index.mdx +++ b/src/pages/komodo-defi-framework/api/legacy/coin_activation/index.mdx @@ -63,173 +63,31 @@ Komodo DeFi Framework is a true cross chain, cross protocol Decentralized Exchan #### Arguments -| Structure | Type | Description | | -| ------------------------ | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | -| coin | string | Ticker of coin to activate | | -| servers | list of objects | A list of standard [ActivationServers](/komodo-defi-framework/api/common_structures/activation/#activation-servers) objects. | | -| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | | -| min\_connected | integer | Optional, defaults to `1`. Minimum number of electrum servers to maintain an active connection to. | | -| max\_connected | integer | Optional. Maximum number of electrum servers to maintain an active connection to. If not set, defaults to all servers in activation request. | | -| required\_confirmations | integer | Optional, defaults to `3`. Number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap. | | -| requires\_notarization | boolean | Optional, defaults to `false`. If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | | -| swap\_contract\_address | string | QRC20 only. Address of etomic swap smart contract | | -| fallback\_swap\_contract | string | QRC20 only. Address of backup etomic swap smart contract | | -| utxo\_merge\_params | object | A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses. | | + #### Response -| Structure | Type | Description | -| ----------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| address | string | the address of the user's `coin` wallet, based on the user's passphrase | -| balance | string (numeric) | the amount of `coin` the user holds in their wallet; does not include `unspendable_balance` | -| unspendable\_balance | string (numeric) | the `coin` balance that is unspendable at the moment (e.g. if the address has immature UTXOs) | -| coin | string | the ticker of the enabled coin | -| required\_confirmations | number | the number of transaction confirmations for which the Komodo DeFi Framework API must wait during the atomic swap process | -| mature\_confirmations | number (optional) | the number of coinbase transaction confirmations required to become mature; UTXO coins only | -| requires\_notarization | bool | whether the node must wait for a notarization of the selected coin that is performing the atomic swap transactions; applicable only for coins using Komodo dPoW | -| result | string | the result of the request; this value either indicates `success`, or an error, or another type of failure | + #### šŸ“Œ Examples #### UTXO coin activation {{label : 'electrum', tag : 'legacy'}} - - ```json - { - "coin": "BCH", - "method": "electrum", - "servers": [ - { - "url": "bch.imaginary.cash:50002", - "protocol": "SSL", - "ws_url": "bch.imaginary.cash:50004" - }, - { - "url": "bch.soul-dev.com:50002", - "protocol": "SSL", - "ws_url": "bch.soul-dev.com:50004" - }, - { - "url": "cashnode.bch.ninja:50002", - "protocol": "SSL", - "ws_url": "cashnode.bch.ninja:50004" - }, - { - "url": "electrum3.cipig.net:20055", - "protocol": "SSL", - "ws_url": "electrum3.cipig.net:30055" - }, - { - "url": "electrum3.cipig.net:10055" - } - ], - "min_connected": 1, - "max_connected": 2, - "userpass": "RPC_UserP@SSW0RD" - } - ``` - - - - #### Response (Success) - - ```json - { - "coin": "LTC", - "address": "Lh2zFS66gP5qF1bRxoCXT6bMw8YShjoRry", - "balance": "7.62", - "unspendable_balance": "0", - "mature_confirmations": 100, - "required_confirmations": 3, - "requires_notarization": false, - "result": "success" - } - ``` - + + + #### UTXO coin activation with `required_confirmations`, `requires_notarization` and `mm2` arguments {{label : 'electrum', tag : 'legacy'}} - - ```json - { - "coin": "KMD", - "method": "electrum", - "servers": [ - { - "url": "electrum1.cipig.net:10001" - }, - { - "url": "electrum2.cipig.net:10001" - }, - { - "url": "electrum3.cipig.net:10001" - } - ], - "required_confirmations": 10, - "requires_notarization": true, - "mm2": 1, - "userpass": "RPC_UserP@SSW0RD" - } - ``` - - - - #### Response (Success) - - ```json - { - "coin": "KMD", - "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", - "balance": "762", - "unspendable_balance": "0", - "mature_confirmations": 100, - "required_confirmations": 10, - "requires_notarization": true, - "result": "success" - } - ``` - + + + #### QTUM/QRC20 coin activation {{label : 'electrum', tag : 'legacy'}} - - ```json - { - "coin": "QTUM", - "method": "electrum", - "servers": [ - { - "url": "electrum1.cipig.net:10050" - }, - { - "url": "electrum2.cipig.net:10050" - }, - { - "url": "electrum3.cipig.net:10050" - } - ], - "swap_contract_address": "0x2f754733acd6d753731c00fee32cb484551cc15d", - "userpass": "RPC_UserP@SSW0RD" - } - ``` - - - - #### Response (Success) - - ```json - { - "coin": "QTUM", - "address": "QjXkGgoiycYRm2NbiMpkEHuQt7SB9BKHjz", - "balance": "7.77", - "required_confirmations": 3, - "requires_notarization": false, - "unspendable_balance": "0", - "mature_confirmations": 100, - "result": "success" - } - ``` - + + + #### Error responses @@ -261,237 +119,49 @@ If max\_connected is \< min\_connected, you will see the following error: #### Arguments -| Structure | Type | Description | -| --------------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| coin | string | the name of the coin the user desires to enable | -| urls | array of strings (required for ETH/ERC20 and other gas model chains) | urls of Ethereum RPC nodes to which the user desires to connect | -| swap\_contract\_address | string (required for QRC20 only) | address of etomic swap smart contract | -| fallback\_swap\_contract | string (required for QRC20 only) | address of backup etomic swap smart contract | -| gas\_station\_decimals | integer (optional for ETH/ERC20 and other gas model chains) | Defines the decimals used to denominate the gas station response to gwei units. For example, the ETH gas station uses 8 decimals, which means that "average": 860 is equal to 86 gwei. While the Matic gas station uses 9 decimals, so 860 would mean 860 gwei exactly. Defaults to `8` | -| gas\_station\_policy.policy | string (optional for ETH/ERC20 and other gas model chains) | Defines the method of gas price calculation from the station response. `"MeanAverageFast"` will use the mean between average and fast fields. `"Average"` will return a simple average value. Defaults to `"MeanAverageFast"`. | -| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | -| tx\_history | bool | If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| required\_confirmations | integer (optional, defaults to `3`) | Number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap. | -| requires\_notarization | boolean (optional, defaults to `false`) | If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | + #### Response -| Structure | Type | Description | -| ----------------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------ | -| address | string | the address of the user's `coin` wallet, based on the user's passphrase | -| balance | string (numeric) | the amount of `coin` the user holds in their wallet; does not include `unspendable_balance` | -| unspendable\_balance | string (numeric) | the `coin` balance that is unspendable at the moment (e.g. if the address has immature UTXOs) | -| coin | string | the ticker of enabled coin | -| required\_confirmations | number | Komodo DeFi Framework API will wait for the this number of coin's transaction confirmations during the swap | -| requires\_notarization | bool | whether the node must wait for a notarization of the selected coin that is performing the atomic swap transactions | -| mature\_confirmations | number (optional) | the number of coinbase transaction confirmations required to become mature; UTXO coins only | -| result | string | the result of the request; this value either indicates `success`, or an error or other type of failure | + #### šŸ“Œ Examples #### Native UTXO coin activation {{label : 'enable', tag : 'legacy'}} - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable", - "coin": "TKL" - } - ``` - - - - #### Response - - ```json - { - "coin": "TKL", - "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", - "balance": "333", - "required_confirmations": 1, - "requires_notarization": false, - "unspendable_balance": "0", - "mature_confirmations": 100, - "result": "success" - } - ``` - + + + #### Command (With `required_confirmations`, `requires_notarization` and `mm2` arguments) - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable", - "coin": "TKL", - "mm2": 1, - "required_confirmations": 10, - "requires_notarization": true - } - ``` - - - - #### Response - - ```json - { - "coin": "TKL", - "address": "RQNUR7qLgPUgZxYbvU9x5Kw93f6LU898CQ", - "balance": "777", - "required_confirmations": 10, - "requires_notarization": true, - "unspendable_balance": "0", - "mature_confirmations": 100, - "result": "success" - } - ``` - + + + #### Command (for Ethereum and ERC20-based blockchains) - - ```json - { - "coin": "ETH", - "method": "enable", - "urls": [ - "http://eth1.cipig.net:18555", - "http://eth2.cipig.net:18555", - "http://eth3.cipig.net:18555" - ], - "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", - "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", - "userpass": "RPC_UserP@SSW0RD" - } - ``` - - - - #### Response - - ```json - { - "coin": "ETH", - "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", - "balance": "50", - "required_confirmations": 1, - "requires_notarization": false, - "unspendable_balance": "0", - "result": "success" - } - ``` - + + + #### EVM coin activation with gas\_station\_url and policy {{label : 'enable', tag : 'legacy'}} - - ```json - { - "coin": "ETH", - "userpass": "RPC_UserP@SSW0RD", - "method": "enable", - "urls": [ - "http://eth1.cipig.net:18555", - "http://eth2.cipig.net:18555", - "http://eth3.cipig.net:18555" - ], - "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", - "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", - "gas_station_url": "https://ethgasstation.info/json/ethgasAPI.json", - "gas_station_decimals": 8, - "gas_station_policy": { - "policy": "MeanAverageFast" - } - } - ``` - - - - #### Response - - ```json - { - "coin": "ETH", - "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", - "balance": "50", - "required_confirmations": 1, - "requires_notarization": false, - "unspendable_balance": "0", - "result": "success" - } - ``` - + + + #### Polygon (MATIC) and PLG20 activation {{label : 'enable', tag : 'legacy'}} - - ```json - { - "coin": "NZDS-PLG20", - "method": "enable", - "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "urls": [ - "https://polygon-rpc.com" - ], - "userpass": "RPC_UserP@SSW0RD" - } - ``` - - - - #### Response - - ```json - { - "coin": "NZDS-PLG20", - "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", - "balance": "350", - "required_confirmations": 1, - "requires_notarization": false, - "unspendable_balance": "0", - "result": "success" - } - ``` - + + + #### Binance Coin (BNB) and BEP20 activation {{label : 'enable', tag : 'legacy'}} - - ```json - { - "coin": "BUSD-BEP20", - "method": "enable", - "swap_contract_address": "0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31", - "fallback_swap_contract": "0xeDc5b89Fe1f0382F9E4316069971D90a0951DB31", - "urls": [ - "http://bsc1.cipig.net:8655", - "http://bsc2.cipig.net:8655", - "http://bsc3.cipig.net:8655" - ], - "userpass": "RPC_UserP@SSW0RD" - } - ``` - - - - #### Response - - ```json - { - "coin": "BUSD-BEP20", - "address": "0x3c7aad7b693e94f13b61d4be4abaeaf802b2e3b5", - "balance": "45", - "required_confirmations": 1, - "requires_notarization": false, - "unspendable_balance": "0", - "result": "success" - } - ``` - + + + For enabling Z coins, refer to the [ZHTLC activation tasks](/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_z_coin/) in the v2.0 Dev API. diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_bch_with_tokens/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_bch_with_tokens/index.mdx index 26771b0d2..6e1367c38 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_bch_with_tokens/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_bch_with_tokens/index.mdx @@ -11,20 +11,7 @@ The Komodo DeFi Framework supports Bitcoin Cash SLP tokens. Using this method, y ### Request Parameters -| Parameter | Type | Description | -| ------------------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the platform protocol coin. Options: `BCH` or `tBCH` | -| bchd\_urls | array of strings | A list of BCHD gRPC API server URLs, used for validation of SLP token transactions. It's recommended to add as many servers as possible. The URLs list can be found at [https://bchd.fountainhead.cash/](https://bchd.fountainhead.cash/). | -| mode | object | A standard [ActivationMode](/komodo-defi-framework/api/common_structures/activation/#activation-mode) object. | -| tx\_history | boolean | If `true`, spawns a background loop to store the local cache of address(es) transactions. Defaults to `false`. | -| slp\_tokens\_requests | array of objects | A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects. | -| address\_format | object | Optional. Overwrites the address format from coins file, if set. A standard [AddressFormat](/komodo-defi-framework/api/common_structures/wallet/#address-format) object. | -| allow\_slp\_unsafe\_conf | boolean | Optional, defaults to `false`. If `true`, allows bchd\_urls to be empty. **Warning:** it is highly unsafe to do so as it may lead to invalid SLP transactions generation and tokens burning. | -| get\_balances | boolean | Optional, defaults to `true`. If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly. | -| required\_confirmations | integer | Optional, defaults to value in the coins file, or `3` if not set. Confirmations to wait for steps in swap. | -| requires\_notarization | boolean | Optional, defaults to `true`. Has no effect on BCH. | -| tx\_history | boolean | Optional, defaults to `true`. If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| utxo\_merge\_params | object | A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses. | + * Go to: [https://github.com/KomodoPlatform/coins/tree/master/electrums](https://github.com/KomodoPlatform/coins/tree/master/electrums) for a full list of nodes/servers. @@ -32,11 +19,7 @@ The Komodo DeFi Framework supports Bitcoin Cash SLP tokens. Using this method, y ### Response Parameters -| Parameter | Type | Description | -| --------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| current\_block | integer | Block height of the coin being activated | -| bch\_addresses\_infos | object | A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter. | -| slp\_addresses\_infos | object | A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter. | + bch\_addresses\_infos and slp\_addresses\_infos are the same. This should be consolidated in the api. @@ -46,59 +29,7 @@ The Komodo DeFi Framework supports Bitcoin Cash SLP tokens. Using this method, y #### Request with tx\_history, cashaddress format, and automated utxo merging. - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_bch_with_tokens", - "mmrpc": "2.0", - "params": { - "ticker": "BCH", - "allow_slp_unsafe_conf": false, - "bchd_urls": [ - "https://bchd.dragonhound.info" - ], - "mode": { - "rpc": "Electrum", - "rpc_data": { - "servers": [ - { - "url": "bch.imaginary.cash:50002", - "protocol": "SSL" - }, - { - "url": "cashnode.bch.ninja:50002", - "protocol": "SSL" - }, - { - "url": "electrum3.cipig.net:20055", - "protocol": "SSL" - } - ] - } - }, - "tx_history": true, - "slp_tokens_requests": [ - { - "ticker": "ASLP-SLP", - "required_confirmations": 4 - } - ], - "required_confirmations": 5, - "requires_notarization": false, - "address_format": { - "format": "cashaddress", - "network": "bitcoincash" - }, - "utxo_merge_params": { - "merge_at": 50, - "check_every": 10, - "max_merge_at_once": 25 - } - } - } - ``` - + #### Response @@ -142,49 +73,7 @@ The Komodo DeFi Framework supports Bitcoin Cash SLP tokens. Using this method, y #### Request with `get_balances` set to false - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_bch_with_tokens", - "mmrpc": "2.0", - "params": { - "ticker": "BCH", - "allow_slp_unsafe_conf": false, - "bchd_urls": [ - "https://bchd.dragonhound.info" - ], - "mode": { - "rpc": "Electrum", - "rpc_data": { - "servers": [ - { - "url": "bch.imaginary.cash:50002", - "protocol": "SSL" - }, - { - "url": "cashnode.bch.ninja:50002", - "protocol": "SSL" - }, - { - "url": "electrum3.cipig.net:20055", - "protocol": "SSL" - } - ] - } - }, - "tx_history": true, - "get_balances": false, - "slp_tokens_requests": [ - { - "ticker": "ASLP-SLP", - "required_confirmations": 4 - } - ] - } - } - ``` - + #### Response diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_erc20/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_erc20/index.mdx index 3e8c2781e..d9e42c558 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_erc20/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_erc20/index.mdx @@ -6,26 +6,9 @@ export const description = The `enable_erc20` method allows you to activate additional ERC20 like tokens of a EVM type platform coin. Before using this method, you first need to use the [enable\_eth\_with\_tokens](/komodo-defi-framework/api/v20/coin_activation/enable_eth_with_tokens/) method. -| parameter | Type | Description | -| ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the ERC20 like token coin. | -| activation\_params.required\_confirmations | integer | Optional. Confirmations to wait for steps in swap. Defaults to value in the coins file if not set. | + - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_erc20", - "mmrpc": "2.0", - "params": { - "ticker": "BAT-ERC20", - "activation_params": { - "required_confirmations": 3 - } - } - } - ``` - + ## Response diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_eth_with_tokens/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_eth_with_tokens/index.mdx index adb2f8509..d8f565822 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_eth_with_tokens/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_eth_with_tokens/index.mdx @@ -8,24 +8,7 @@ Additionally, it supports ERC20 tokens on the ETH chain and associated ERC20 lik ### Request Parameters -| Parameter | Type | Description | -| --------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the platform protocol coin. Options: `ETH`, `AVAX`, `BNB`, `FTM`, `MATIC`, `ONE`, `ETH-ARB20` | -| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | -| swap\_contract\_address | string | Address of etomic swap smart contract | -| fallback\_swap\_contract | string | Address of backup etomic swap smart contract. | -| nodes | array of objects | A list of standard [CoinNode](/komodo-defi-framework/api/common_structures/activation/#coin-node) objects. | -| erc20\_tokens\_requests | array of objects | A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects. | -| gas\_station\_decimals | integer | Optional, for ETH/ERC20 and other gas model chains. Defaults to `8`. Defines the decimals used to denominate the gas station response to gwei units. For example, the ETH gas station uses 8 decimals, which means that "average": 860 is equal to 86 gwei. While the Matic gas station uses 9 decimals, so 860 would mean 860 gwei exactly. | -| gas\_station\_policy.policy | string | Optional, for ETH/ERC20 and other gas model chains. Defaults to `"MeanAverageFast"`. Defines the method of gas price calculation from the station response. `"MeanAverageFast"` will use the mean between average and fast fields. `"Average"` will return a simple average value. | -| get\_balances | boolean | Optional, defaults to `true`. If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly. | -| priv\_key\_policy | object | Optional. A standard [PrivKeyPolicy](/komodo-defi-framework/api/common_structures/wallet/#priv-key-policy) object. Defaults to `{"type": "ContextPrivKey"}`. | -| required\_confirmations | integer | Optional, defaults to `3`. When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap | -| requires\_notarization | boolean | Optional, defaults to `false`. If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | -| rpc\_mode | string | Optional, defaults to `Default`. Value can be `Metamask` only when the Komodo DeFi Framework is built targeting `wasm`. | -| tx\_history | boolean | Optional, defaults to `false`. If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| nft\_req | object | Optional, encapsulates the request parameters for NFT activation, including NFT provider configuration. A standard [NftProvider](/komodo-defi-framework/api/common_structures/nfts/#nft-provider) object. | -| swap\_v2\_contracts | object | Optional, must be provided if "use\_trading\_proto\_v2" is true in [your configuration](/komodo-defi-framework/setup/configure-mm2-json/). A standard [SwapV2Contracts](/komodo-defi-framework/api/common_structures/activation/#tokens-request) object. | + When running in HD mode, do not use the `nft_req` object paramater when activating your NFT network coins. Instead, use the [enable\_nft](/komodo-defi-framework/api/v20/non_fungible_tokens/enable_nft/) method after activating. @@ -33,75 +16,13 @@ Additionally, it supports ERC20 tokens on the ETH chain and associated ERC20 lik ### Response Parameters -| Parameter | Type | Description | -| ----------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| current\_block | integer | Block height of the coin being activated | -| eth\_addresses\_infos | object | A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter. | -| erc20\_addresses\_infos | object | A standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) object. Note: the structure may vary based on the value of the `get_balances` parameter. | -| nfts\_infos | list | A list of standard [NftInfoBasic](/komodo-defi-framework/api/common_structures/nfts/#nft-info) objects. | + ### šŸ“Œ Examples #### Request including optional gas station parameters - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_eth_with_tokens", - "mmrpc": "2.0", - "params": { - "ticker": "ETH", - "gas_station_url": "https://ethgasstation.info/json/ethgasAPI.json", - "gas_station_decimals": 8, - "gas_station_policy": { - "policy": "MeanAverageFast" - }, - "mm2": 1, - "priv_key_policy": { - "type": "ContextPrivKey" - }, - "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", - "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", - "nodes": [ - { - "url": "https://eth1.cipig.net:18555", - "komodo_proxy": false - }, - { - "url": "https://eth2.cipig.net:18555", - "komodo_proxy": false - }, - { - "url": "https://eth3.cipig.net:18555", - "komodo_proxy": false - } - ], - "tx_history": true, - "erc20_tokens_requests": [ - { - "ticker": "APE-ERC20", - "required_confirmations": 4 - }, - { - "ticker": "BCH-ERC20", - "required_confirmations": 4 - }, - { - "ticker": "MINDS-ERC20", - "required_confirmations": 4 - }, - { - "ticker": "BUSD-ERC20", - "required_confirmations": 4 - } - ], - "required_confirmations": 5, - "requires_notarization": false - } - } - ``` - + #### Response @@ -158,51 +79,7 @@ Additionally, it supports ERC20 tokens on the ETH chain and associated ERC20 lik #### Request with `get_balances` set to false - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_eth_with_tokens", - "mmrpc": "2.0", - "params": { - "ticker": "MATIC", - "get_balances": false, - "tx_history": false, - "gas_station_url": "https://gasstation-mainnet.matic.network/", - "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "swap_v2_contracts": { - "maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "taker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "nft_maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE" - }, - "nodes": [ - { - "url": "https://polygon-rpc.com" - }, - { - "url": "https://node.komodo.earth:8080/polygon" - }, - { - "url": "https://block-proxy.komodo.earth/rpc/matic" - } - ], - "erc20_tokens_requests": [ - { - "ticker": "PGX-PLG20", - "required_confirmations": 4 - }, - { - "ticker": "AAVE-PLG20", - "required_confirmations": 4 - } - ], - "required_confirmations": 5, - "requires_notarization": false - } - } - ``` - + #### Response @@ -241,52 +118,7 @@ Additionally, it supports ERC20 tokens on the ETH chain and associated ERC20 lik #### Request including NFT initialization - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_eth_with_tokens", - "mmrpc": "2.0", - "params": { - "ticker": "MATIC", - "get_balances": false, - "tx_history": false, - "nft_req": { - "type": "Moralis", - "info": { - "url": "https://moralis-proxy.komodo.earth" - } - }, - "gas_station_url": "https://gasstation-mainnet.matic.network/", - "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "nodes": [ - { - "url": "https://polygon-rpc.com" - }, - { - "url": "https://node.komodo.earth:8080/polygon" - }, - { - "url": "https://block-proxy.komodo.earth/rpc/matic" - } - ], - "erc20_tokens_requests": [ - { - "ticker": "PGX-PLG20", - "required_confirmations": 4 - }, - { - "ticker": "AAVE-PLG20", - "required_confirmations": 4 - } - ], - "required_confirmations": 5, - "requires_notarization": false - } - } - ``` - + #### Response @@ -342,53 +174,7 @@ Additionally, it supports ERC20 tokens on the ETH chain and associated ERC20 lik Prior to coin activation using WalletConnect, you need to establish a connection with [wc\_new\_connection](/komodo-defi-framework/api/v20-dev/wc_new_connection/#wc-new-connection) - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_eth_with_tokens", - "mmrpc": "2.0", - "params": { - "ticker": "ETH", - "gas_station_url": "https://ethgasstation.info/json/ethgasAPI.json", - "gas_station_decimals": 8, - "gas_station_policy": { - "policy": "MeanAverageFast" - }, - "mm2": 1, - "rpc_mode": "Default", - "priv_key_policy": { - "type": "WalletConnect", - "data": "3569914dd09a5cc4ac92dedab354f06ff5db17ef616233a8ba562cbea51269fd" - }, - "swap_contract_address": "0x24ABE4c71FC658C91313b6552cd40cD808b3Ea80", - "fallback_swap_contract": "0x8500AFc0bc5214728082163326C2FF0C73f4a871", - "nodes": [ - { - "url": "https://eth1.cipig.net:18555", - "komodo_proxy": false - }, - { - "url": "https://eth2.cipig.net:18555", - "komodo_proxy": false - }, - { - "url": "https://eth3.cipig.net:18555", - "komodo_proxy": false - } - ], - "tx_history": true, - "erc20_tokens_requests": [ - { - "ticker": "PEPE-ERC20", - "required_confirmations": 4 - } - ], - "required_confirmations": 5 - } - } - ``` - + #### Response diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_token/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_token/index.mdx index aaeea5e19..262e88906 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_token/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_token/index.mdx @@ -6,26 +6,9 @@ export const description = The `enable_tendermint_token` method allows you to activate additional Tendermint assets. Before using this method, you first need to use the [enable\_tendermint\_with\_assets](/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_with_assets/) method. -| parameter | Type | Description | -| ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the Tendermint asset. | -| activation\_params.required\_confirmations | integer | Optional. Confirmations to wait for steps in swap. Defaults to value in the coins file if not set. | + - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_tendermint_token", - "mmrpc": "2.0", - "params": { - "ticker": "ATOM-IBC_IRIS", - "activation_params": { - "required_confirmations": 3 - } - } - } - ``` - + ## Response diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_with_assets/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_with_assets/index.mdx index 88a9b10ef..77de4f8f9 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_with_assets/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/enable_tendermint_with_assets/index.mdx @@ -7,65 +7,17 @@ Use this method to activate Tendermint coins (COSMOS/IRIS/OSMOSIS) and IBC asset ### Request Parameters -| Parameter | Type | Description | -| ----------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the platform protocol coin. Options: `ATOM`, `IRIS`, `OSMOSIS` | -| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | -| tokens\_params | array of objects | A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects. | -| nodes | array of objects | A list of [CoinNode objects](/komodo-defi-framework/api/common_structures/activation/#coin-node). | -| priv\_key\_policy | string | Optional, defaults to `ContextPrivKey`. value can be `ContextPrivKey`,`Trezor` when Komodo DeFi Framework is built for native platforms. value can be `ContextPrivKey`, `Trezor`, `Metamask` when the Komodo DeFi Framework is built targeting `wasm` | -| tx\_history | boolean | Optional, defaults to `false`. If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| required\_confirmations | integer | Optional, defaults to `3`. When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap | -| requires\_notarization | boolean | Optional, defaults to `false`. If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | -| get\_balances | boolean | Optional, defaults to `true`. If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly. | -| activation\_params | object | Optional, only used with Metamask, Keplr or WalletConnect activations. Defines the [PrivKeyPolicy](/komodo-defi-framework/api/common_structures/wallet/#priv-key-policy) of the connection. | + ### Response Parameters -| Parameter | Type | Description | -| ---------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| current\_block | integer | Block height of the coin being activated | -| ticker | string | Ticker of the platform protocol coin, as input in the request. | -| address | string | An address for the activated coin | -| balance | object | Only returned when `get_balances` is `true`. A standard [BalanceInfos](/komodo-defi-framework/api/common_structures/wallet/#balance-info) object. | -| tokens\_balances | array of objects | Only returned when `get_balances` is `true`. A list of standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) objects, one for each token. | -| tokens\_tickers | array | Only returned when `get_balances` is `false`. A list of each token which was activated. | + ### šŸ“Œ Examples #### Request with `get_balances` set to `false` - - ```json - { - "method": "enable_tendermint_with_assets", - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "params": { - "ticker": "IRIS", - "tokens_params": [ - { - "ticker": "ATOM-IBC_IRIS" - } - ], - "nodes": [ - { - "url": "https://iris-rpc.alpha.komodo.earth/", - "api_url": "https://iris-api.alpha.komodo.earth/", - "grpc_url": "https://iris-grpc.alpha.komodo.earth/", - "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket" - }, - { - "url": "https://rpc.irishub-1.irisnet.org", - "komodo_proxy": false - } - ], - "tx_history": true, - "get_balances": false - } - } - ``` - + #### Response @@ -86,36 +38,7 @@ Use this method to activate Tendermint coins (COSMOS/IRIS/OSMOSIS) and IBC asset #### Request with token activation and `get_balances` as `true` - - ```json - { - "method": "enable_tendermint_with_assets", - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "params": { - "ticker": "IRIS", - "tokens_params": [ - { - "ticker": "ATOM-IBC_IRIS" - } - ], - "nodes": [ - { - "url": "https://iris-rpc.alpha.komodo.earth/", - "api_url": "https://iris-api.alpha.komodo.earth/", - "grpc_url": "https://iris-grpc.alpha.komodo.earth/", - "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket" - }, - { - "url": "https://rpc.irishub-1.irisnet.org", - "komodo_proxy": false - } - ], - "get_balances": true - } - } - ``` - + #### Response @@ -145,38 +68,7 @@ Use this method to activate Tendermint coins (COSMOS/IRIS/OSMOSIS) and IBC asset #### Request for Metamask / WalletConnect activation - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "enable_tendermint_with_assets", - "mmrpc": "2.0", - "params": { - "ticker": "ATOM", - "tx_history": true, - "get_balances": true, - "activation_params": { - "priv_key_policy": { - "type": "WalletConnect", - "data": "3569914dd09a5cc4ac92dedab354f06ff5db17ef616233a8ba562cbea51269fd" - } - }, - "nodes": [ - { - "url": "https://cosmos-rpc.alpha.komodo.earth/", - "api_url": "https://cosmos-api.alpha.komodo.earth/", - "grpc_url": "https://cosmos-grpc.alpha.komodo.earth/", - "ws_url": "wss://cosmos-rpc.alpha.komodo.earth/websocket" - }, - { - "url": "https://cosmoshub.rpc.stakin-nodes.com/" - } - ], - "tokens_params": [] - } - } - ``` - + #### Response diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_bch/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_bch/index.mdx index 5b2d329f5..e15b642f7 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_bch/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_bch/index.mdx @@ -16,93 +16,17 @@ Use this method for task managed activation of BCH and SLP tokens. Refer to the #### Arguments -| Parameter | Type | Description | -| ------------------------ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the platform protocol coin. Options: `BCH` or `tBCH` | -| bchd\_urls | array of strings | A list of BCHD gRPC API server URLs, used for validation of SLP token transactions. It's recommended to add as many servers as possible. The URLs list can be found at [https://bchd.fountainhead.cash/](https://bchd.fountainhead.cash/). | -| mode | object | A standard [ActivationMode](/komodo-defi-framework/api/common_structures/activation/#activation-mode) object. | -| tx\_history | boolean | If `true`, spawns a background loop to store the local cache of address(es) transactions. Defaults to `false`. | -| slp\_tokens\_requests | array of objects | A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects. | -| address\_format | object | Optional. Overwrites the address format from coins file, if set. A standard [AddressFormat](/komodo-defi-framework/api/common_structures/wallet/#address-format) object. | -| allow\_slp\_unsafe\_conf | boolean | Optional, defaults to `false`. If `true`, allows bchd\_urls to be empty. **Warning:** it is highly unsafe to do so as it may lead to invalid SLP transactions generation and tokens burning. | -| get\_balances | boolean | Optional, defaults to `true`. If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly. | -| required\_confirmations | integer | Optional, defaults to value in the coins file, or `3` if not set. Confirmations to wait for steps in swap. | -| requires\_notarization | boolean | Optional, defaults to `true`. Has no effect on BCH. | -| tx\_history | boolean | Optional, defaults to `true`. If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| utxo\_merge\_params | object | A standard [UtxoMergeParams](/komodo-defi-framework/api/common_structures/activation/#utxo-merge-params) object. Used to reduce a wallet's UTXO count in cases where it is causing significantly slower RPC responses. | -| | | | + #### Response -| Parameter | Type | Description | -| --------- | ------- | --------------------------------------------------------- | -| task\_id | integer | An identifying number which is used to query task status. | + #### šŸ“Œ Examples #### Activation in Trezor mode - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_bch::init", - "params": { - "ticker": "BCH", - "activation_params": { - "bchd_urls": [ - "https://bchd.dragonhound.info" - ], - "mode": { - "rpc": "Electrum", - "rpc_data": { - "servers": [ - { - "url": "bch.imaginary.cash:50002", - "protocol": "SSL" - }, - { - "url": "cashnode.bch.ninja:50002", - "protocol": "SSL" - }, - { - "url": "bch.soul-dev.com:50002", - "protocol": "SSL" - }, - { - "url": "electrum3.cipig.net:20055", - "protocol": "SSL" - } - ] - } - }, - "slp_tokens_requests": [ - { - "ticker": "USDF" - }, - { - "ticker": "ASLP-SLP", - "required_confirmations": 3 - } - ], - "tx_history": true, - "required_confirmations": 5, - "requires_notarization": false, - "address_format": { - "format": "cashaddress", - "network": "bitcoincash" - }, - "utxo_merge_params": { - "merge_at": 50, - "check_every": 10, - "max_merge_at_once": 25 - } - } - } - } - ``` - + #### Response @@ -129,31 +53,13 @@ The response will return the following: #### Arguments -| Parameter | Type | Description | -| -------------------- | ------- | ----------------------------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| forget\_if\_finished | boolean | If `false`, will return final response for completed tasks. Optional, defaults to `true`. | + #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_bch::status", - "params": { - "task_id": 0, - "forget_if_finished": false - } - } - ``` - + -| Parameter | Type | Description | -| --------- | ------ | --------------------------------------------------------------------------------------------------------------------- | -| status | string | A short indication of how the enabling is progressing. | -| details | object | Depending on the state of enabling progress, this will contain different information as shown in the responses below. | + Possible `status` values while activation is in progress: @@ -288,22 +194,7 @@ If the `task::enable_bch::status` returns `UserActionRequired`, we need to use t #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_bch::user_action", - "params": { - "task_id": 0, - "user_action": { - "action_type": "TrezorPin", - "pin": "862743" - } - } - } - ``` - + #### Response (success) @@ -338,18 +229,7 @@ If you want to cancel the enabling process before it has completed, you can use | error\_type | string | An enumerated value for the returned error. | | error\_data | string | The input task ID which resulted in the error. | - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_bch::cancel", - "mmrpc": "2.0", - "params": { - "task_id": 3 - } - } - ``` - + #### Response (success) diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_eth/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_eth/index.mdx index ed721ae93..74bdece0c 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_eth/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_eth/index.mdx @@ -12,29 +12,7 @@ Use this method for task managed activation of ETH/EVM coins & tokens. Refer to #### Arguments -| Parameter | Type | Description | -| --------------------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the platform protocol coin. Options: `ETH`, `AVAX`, `BNB`, `FTM`, `MATIC`, `ONE`, `ETH-ARB20` | -| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | -| swap\_contract\_address | string | Address of etomic swap smart contract | -| fallback\_swap\_contract | string | Address of backup etomic swap smart contract. | -| nodes | array of objects | A list of standard [CoinNode](/komodo-defi-framework/api/common_structures/activation/#coin-node) objects. | -| erc20\_tokens\_requests | array of objects | A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects. | -| gas\_station\_url | string | Optional, a url for gas station api. | -| gas\_station\_decimals | integer | Optional, for ETH/ERC20 and other gas model chains. Defaults to `8`. Defines the decimals used to denominate the gas station response to gwei units. For example, the ETH gas station uses 8 decimals, which means that "average": 860 is equal to 86 gwei. While the Matic gas station uses 9 decimals, so 860 would mean 860 gwei exactly. | -| gas\_station\_policy.policy | string | Optional, for ETH/ERC20 and other gas model chains. Defaults to `"MeanAverageFast"`. Defines the method of gas price calculation from the station response. `"MeanAverageFast"` will use the mean between average and fast fields. `"Average"` will return a simple average value. | -| get\_balances | boolean | Optional, defaults to `true`. If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly. | -| priv\_key\_policy | string | Optional, defaults to `ContextPrivKey`. value can be `ContextPrivKey`,`Trezor` when Komodo DeFi Framework is built for native platforms. value can be `ContextPrivKey`, `Trezor`, `Metamask` when the Komodo DeFi Framework is built targeting `wasm` | -| required\_confirmations | integer | Optional, defaults to `3`. When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap | -| requires\_notarization | boolean | Optional, defaults to `false`. If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | -| rpc\_mode | string | Optional, defaults to `Default`. Value can be `Metamask` only when the Komodo DeFi Framework is built targeting `wasm`. | -| tx\_history | boolean | Optional, defaults to `false`. If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| nft\_req | object | Optional, non-HD only. encapsulates the request parameters for NFT activation, including NFT provider configuration. | -| min\_addresses\_number | integer | Optional, HD wallets only. How many additional addreesses to generate at a minimum. | -| scan\_policy | string | Optional, HD wallets only. Whether or not to scan for new addresses. Select from `do_not_scan`, `scan_if_new_wallet` or `scan`. Note that `scan` will result in multple requests to the Komodo DeFi Framework. | -| gap\_limit | integer | Optional, HD wallets only. The max number of empty addresses in a row. If transactions were sent to an address outside the `gap_limit`, they will not be identified when scanning. | -| path\_to\_address | object | Optional, HD wallets only. A standard [AddressPath](/komodo-defi-framework/api/common_structures/wallet/#address-path) object. | -| swap\_v2\_contracts | object | Optional, must be provided if "use\_trading\_proto\_v2" is true in [your configuration](/komodo-defi-framework/setup/configure-mm2-json/). A standard [SwapV2Contracts](/komodo-defi-framework/api/common_structures/activation/#tokens-request) object. | + ### Response @@ -55,61 +33,13 @@ Once complete, `status` will be `Ok`, and the `details` object will have the fo #### Response -| Parameter | Type | Description | -| --------- | ------- | --------------------------------------------------------- | -| task\_id | integer | An identifying number which is used to query task status. | + #### šŸ“Œ Examples #### Activation in Trezor mode - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_eth::init", - "params": { - "ticker": "MATIC", - "gas_station_url": "https://gasstation-mainnet.matic.network/", - "swap_contract_address": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "fallback_swap_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "swap_v2_contracts": { - "taker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE", - "nft_maker_swap_v2_contract": "0x9130b257D37A52E52F21054c4DA3450c72f595CE" - }, - "nodes": [ - { - "url": "https://polygon-rpc.com" - }, - { - "url": "https://poly-rpc.gateway.pokt.network" - } - ], - "erc20_tokens_requests": [ - { - "ticker": "PGX-PLG20", - "required_confirmations": 4 - }, - { - "ticker": "AAVE-PLG20", - "required_confirmations": 4 - } - ], - "required_confirmations": 5, - "path_to_address": { - "account_id": 0, - "chain": "External", - "address_id": 1 - }, - "gap_limit": 20, - "scan_policy": "scan_if_new_wallet", - "min_addresses_number": 3 - } - } - ``` - + #### Response @@ -136,34 +66,15 @@ The response will return the following: #### Arguments -| Parameter | Type | Description | -| -------------------- | ------- | ----------------------------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| forget\_if\_finished | boolean | If `false`, will return final response for completed tasks. Optional, defaults to `true`. | + #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_eth::status", - "params": { - "task_id": 1, - "forget_if_finished": false - } - } - ``` - + #### Response (ready, successful, HD mode) -| Parameter | Type | Description | -| --------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| current\_block | integer | Block height of the coin being activated | -| ticker | string | Ticker of the coin being activated. | -| wallet\_balance | object | A standard [WalletBalanceInfo](/komodo-defi-framework/api/common_structures/wallet/#wallet-balance-info) object. Note: the structure may vary based on the `get_balances` parameter value in the acttivation request. | + ```json @@ -303,41 +214,19 @@ If the `task::enable_eth::status` returns `UserActionRequired`, we need to use t #### Arguments -| Parameter | Type | Description | -| ------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| user\_action | object | Object containing the params below | -| user\_action.action\_type | string | Will be `TrezorPin` for this method | -| user\_action.pin | string (number) | When the Trezor device is displaying a grid of numbers for PIN entry, this param will contain your Trezor pin, as mapped through your keyboard numpad. See the image below for more information. | + #### Response -| Parameter | Type | Description | -| --------- | ------ | --------------------------- | -| result | string | The outcome of the request. | + #### šŸ“Œ Examples #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_eth::user_action", - "params": { - "task_id": 0, - "user_action": { - "action_type": "TrezorPin", - "pin": "862743" - } - } - } - ``` - + #### Response (success) @@ -357,33 +246,13 @@ If you want to cancel the enabling process before it has completed, you can use #### Arguments -| Structure | Type | Description | -| --------- | ------- | --------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the enabling process. | + #### Response -| Structure | Type | Description | -| ------------ | ------ | -------------------------------------------------------------- | -| result | string | Indicates task cancellation was succesful. | -| error | string | An error message to explain what went wrong. | -| error\_path | string | An indicator of the class or function which reurned the error. | -| error\_trace | string | An indicator of where in the source code the error was thrown. | -| error\_type | string | An enumerated value for the returned error. | -| error\_data | string | The input task ID which resulted in the error. | + - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_eth::cancel", - "mmrpc": "2.0", - "params": { - "task_id": 3 - } - } - ``` - + #### Response (success) diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_qtum/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_qtum/index.mdx index c39aac045..523f2be40 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_qtum/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_qtum/index.mdx @@ -12,68 +12,17 @@ Use this method for task managed activation of QTUM coins and tokens. Refer to t #### Arguments -| Parameter | Type | Description | -| ------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | The ticker of the coin you want to enable. | -| activation\_params | object | An object containing the actvation parameters below. | -| .priv\_key\_policy | object | Optional. A standard [PrivKeyPolicy](/komodo-defi-framework/api/common_structures/wallet/#priv-key-policy) object. Defaults to `{"type": "ContextPrivKey"}`. | -| .min\_addresses\_number | integer | How many additional addreesses to generate at a minimum. | -| .scan\_policy | string | Whether or not to scan for new addresses. Select from `do_not_scan`, `scan_if_new_wallet` or `scan`. Note that `scan` will result in multple requests to the Komodo DeFi Framework. | -| .gap\_limit | integer | The max number of empty addresses in a row. If transactions were sent to an address outside the `gap_limit`, they will not be identified when scanning. | -| .mode | object | An object containing RPC type and data parameters as below. | -| ..rpc | string | UTXO RPC mode. Options: `{ "rpc":"Native" }` if running a native blockchain node, or `"rpc":"Electrum"` to use electrum RPCs. If using electrum, a list of electrum servers is required under `rpc_data.servers` | -| ..rpc\_data | object | An object containing electrum server information. | -| ...servers | list | A list of electrum server URLs ([https://github.com/KomodoPlatform/coins/tree/master/electrums](https://github.com/KomodoPlatform/coins/tree/master/electrums)) | -| ....url | object | The url and port of a coins electrum server | -| ....ws\_url | object | Optional. Used to define electrum server url/port for websocket connections. | -| ....protocol | object | Defines electrum server protocol as `TCP` or `SSL`. Defaults to `TCP` | -| ....disable\_cert\_verification | boolean | Optional. For `SSL` electrum connections, this will allow expired certificates. | + #### Response -| Parameter | Type | Description | -| --------- | ------- | --------------------------------------------------------- | -| task\_id | integer | An identifying number which is used to query task status. | + #### šŸ“Œ Examples #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_qtum::init", - "params": { - "ticker": "QTUM", - "activation_params": { - "mode": { - "rpc": "Electrum", - "rpc_data": { - "servers": [ - { - "url": "electrum2.cipig.net:10050" - }, - { - "url": "electrum3.cipig.net:20050", - "ws_url": "electrum3.cipig.net:30050", - "protocol": "SSL" - } - ] - } - }, - "scan_policy": "scan_if_new_wallet", - "priv_key_policy": { - "type": "Trezor" - }, - "min_addresses_number": 3, - "gap_limit": 20 - } - } - } - ``` - + #### Response @@ -100,26 +49,11 @@ The response will return the following: #### Arguments -| Parameter | Type | Description | -| -------------------- | ------- | ----------------------------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| forget\_if\_finished | boolean | If `false`, will return final response for completed tasks. Optional, defaults to `true`. | + #### Request - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_qtum::status", - "params": { - "task_id": 0, - "forget_if_finished": false - } - } - ``` - + The response formats for this method are the same as the [task managed activation](/komodo-defi-framework/api/v20/coin_activation/task_managed/) responses. @@ -129,41 +63,19 @@ If the `task::enable_qtum::status` returns `UserActionRequired`, we need to use #### Arguments -| Parameter | Type | Description | -| ------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| user\_action | object | Object containing the params below | -| user\_action.action\_type | string | Will be `TrezorPin` for this method | -| user\_action.pin | string (number) | When the Trezor device is displaying a grid of numbers for PIN entry, this param will contain your Trezor pin, as mapped through your keyboard numpad. See the image below for more information. | + #### Response -| Parameter | Type | Description | -| --------- | ------ | --------------------------- | -| result | string | The outcome of the request. | + #### šŸ“Œ Examples #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_qtum::user_action", - "params": { - "task_id": 0, - "user_action": { - "action_type": "TrezorPin", - "pin": "862743" - } - } - } - ``` - + #### Response (success) @@ -207,37 +119,17 @@ If you want to cancel the enabling process before it has completed, you can use #### Arguments -| Structure | Type | Description | -| --------- | ------- | --------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the enabling process. | + #### Response -| Structure | Type | Description | -| ------------ | ------ | -------------------------------------------------------------- | -| result | string | Indicates task cancellation was succesful. | -| error | string | An error message to explain what went wrong. | -| error\_path | string | An indicator of the class or function which reurned the error. | -| error\_trace | string | An indicator of where in the source code the error was thrown. | -| error\_type | string | An enumerated value for the returned error. | -| error\_data | string | The input task ID which resulted in the error. | + #### šŸ“Œ Examples #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_qtum::cancel", - "mmrpc": "2.0", - "params": { - "task_id": 3 - } - } - ``` - + #### Response (success) diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_tendermint/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_tendermint/index.mdx index b62fe6c34..7ffc091e4 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_tendermint/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_tendermint/index.mdx @@ -12,57 +12,17 @@ Use this method for task managed activation of Tendermint coins & tokens. Refer #### Arguments -| Parameter | Type | Description | -| ----------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of the platform protocol coin. Options: `ATOM`, `IRIS`, `OSMOSIS` | -| mm2 | integer | Required if not set in `coins` file. Informs the Komodo DeFi Framework API whether or not the coin is expected to function. Accepted values are `0` or `1` | -| tokens\_params | array of objects | A list of standard [TokensRequest](/komodo-defi-framework/api/common_structures/activation/#tokens-request) objects. | -| nodes | array of objects | A list of [CoinNode objects](/komodo-defi-framework/api/common_structures/activation/#coin-node). | -| priv\_key\_policy | string | Optional, defaults to `ContextPrivKey`. value can be `ContextPrivKey`,`Trezor` when Komodo DeFi Framework is built for native platforms. value can be `ContextPrivKey`, `Trezor`, `Metamask` when the Komodo DeFi Framework is built targeting `wasm` | -| tx\_history | boolean | Optional, defaults to `false`. If `true` the Komodo DeFi Framework API will preload transaction history as a background process. Must be set to `true` to use the [my\_tx\_history](/komodo-defi-framework/api/legacy/my_tx_history/#my-tx-history) method | -| required\_confirmations | integer | Optional, defaults to `3`. When the platform coin is involved, the number of confirmations for the Komodo DeFi Framework API to wait during the transaction steps of an atomic swap | -| requires\_notarization | boolean | Optional, defaults to `false`. If `true`, coins protected by [Komodo Platform's dPoW security](https://satindergrewal.medium.com/delayed-proof-of-work-explained-9a74250dbb86) will wait for a notarization before progressing to the next atomic swap transactions step. | -| get\_balances | boolean | Optional, defaults to `true`. If `false`, coin and token balances will not be returned in the response, and the response will be returned more quickly. | + #### Response -| Parameter | Type | Description | -| --------- | ------- | --------------------------------------------------------- | -| task\_id | integer | An identifying number which is used to query task status. | + #### šŸ“Œ Examples #### Activation in Trezor mode - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_tendermint::init", - "params": { - "ticker": "IRIS", - "tokens_params": [ - { - "ticker": "ATOM-IBC_IRIS" - } - ], - "nodes": [ - { - "url": "https://iris-rpc.alpha.komodo.earth/", - "api_url": "https://iris-api.alpha.komodo.earth/", - "grpc_url": "https://iris-grpc.alpha.komodo.earth/", - "ws_url": "wss://iris-rpc.alpha.komodo.earth/websocket" - }, - { - "url": "https://rpc.irishub-1.irisnet.org", - "komodo_proxy": false - } - ] - } - } - ``` - + #### Response @@ -89,38 +49,17 @@ The response will return the following: #### Arguments -| Parameter | Type | Description | -| -------------------- | ------- | ----------------------------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| forget\_if\_finished | boolean | If `false`, will return final response for completed tasks. Optional, defaults to `true`. | + #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_tendermint::status", - "params": { - "task_id": 0, - "forget_if_finished": false - } - } - ``` - + #### Response -| Parameter | Type | Description | -| ---------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| current\_block | integer | Block height of the coin being activated | -| ticker | string | Ticker of the platform protocol coin, as input in the request. | -| address | string | An address for the activated coin | -| balance | object | Only returned when `get_balances` is `true`. A standard [BalanceInfos](/komodo-defi-framework/api/common_structures/wallet/#balance-info) object. | -| tokens\_balances | array of objects | Only returned when `get_balances` is `true`. A list of standard [AddressInfo](/komodo-defi-framework/api/common_structures/wallet/#address-info) objects, one for each token. | -| tokens\_tickers | array | Only returned when `get_balances` is `false`. A list of each token which was activated. | -| | | | + + +\| | | | ```json @@ -330,22 +269,7 @@ If the `task::enable_tendermint::status` returns `UserActionRequired`, we need t #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_tendermint::user_action", - "params": { - "task_id": 0, - "user_action": { - "action_type": "TrezorPin", - "pin": "862743" - } - } - } - ``` - + #### Response (success) @@ -380,18 +304,7 @@ If you want to cancel the enabling process before it has completed, you can use | error\_type | string | An enumerated value for the returned error. | | error\_data | string | The input task ID which resulted in the error. | - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_tendermint::cancel", - "mmrpc": "2.0", - "params": { - "task_id": 3 - } - } - ``` - + #### Response (success) diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_utxo/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_utxo/index.mdx index 9fd068fc9..f65e90619 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_utxo/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_utxo/index.mdx @@ -39,41 +39,7 @@ Use this method for task managed activation of UTXO coins like KMD, LTC, BTC & D #### Activation in Trezor mode - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_utxo::init", - "params": { - "ticker": "KMD", - "activation_params": { - "mode": { - "rpc": "Electrum", - "rpc_data": { - "servers": [ - { - "url": "electrum2.cipig.net:10001" - }, - { - "url": "electrum3.cipig.net:20001", - "ws_url": "electrum3.cipig.net:30001", - "protocol": "SSL" - } - ] - } - }, - "scan_policy": "scan_if_new_wallet", - "priv_key_policy": { - "type": "Trezor" - }, - "min_addresses_number": 3, - "gap_limit": 20 - } - } - } - ``` - + #### Response @@ -107,19 +73,7 @@ The response will return the following: #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_utxo::status", - "params": { - "task_id": 1, - "forget_if_finished": false - } - } - ``` - + | Parameter | Type | Description | | --------- | ------ | --------------------------------------------------------------------------------------------------------------------- | @@ -272,22 +226,7 @@ If the `task::enable_utxo::status` returns `UserActionRequired`, we need to use #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_utxo::user_action", - "params": { - "task_id": 1, - "user_action": { - "action_type": "TrezorPin", - "pin": "862743" - } - } - } - ``` - + #### Response (success) @@ -322,18 +261,7 @@ If you want to cancel the enabling process before it has completed, you can use | error\_type | string | An enumerated value for the returned error. | | error\_data | string | The input task ID which resulted in the error. | - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_utxo::cancel", - "mmrpc": "2.0", - "params": { - "task_id": 1 - } - } - ``` - + #### Response (success) diff --git a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_z_coin/index.mdx b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_z_coin/index.mdx index d9bdd4c46..6aebc4ad7 100644 --- a/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_z_coin/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/coin_activation/task_managed/enable_z_coin/index.mdx @@ -30,92 +30,21 @@ To get the transaction history for ZHTLC coins, you need to use the [z\_coin\_tx #### Arguments -| Structure | Type | Description | -| ------------------ | ------ | -------------------------------------------------------------------------------------------------------------------- | -| ticker | string | Ticker of coin to activate | -| activation\_params | object | A standard [ActivationRpcData](/komodo-defi-framework/api/common_structures/activation/#activation-rpc-data) object. | + #### Response -| Structure | Type | Description | -| --------- | ------- | --------------------------------------------------------- | -| task\_id | integer | An identifying number which is used to query task status. | + #### šŸ“Œ Examples #### Enable Z coin without any optional parameters - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_z_coin::init", - "mmrpc": "2.0", - "params": { - "ticker": "ZOMBIE", - "activation_params": { - "mode": { - "rpc": "Light", - "rpc_data": { - "electrum_servers": [ - { - "url": "zombie.dragonhound.info:10133" - }, - { - "url": "zombie.dragonhound.info:20133", - "protocol": "SSL", - "ws_url": "zombie.dragonhound.info:30059" - } - ], - "light_wallet_d_servers": [ - "http://zombie.dragonhound.info:1443" - ] - } - }, - "zcash_params_path": "/home/username/path_to/.zcash-params", - "scan_blocks_per_iteration": 100, - "scan_interval_ms": 200 - } - } - } - ``` - + #### Sync from block 2528700, with custom `.zcash-params` path and scan params - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_z_coin::init", - "mmrpc": "2.0", - "params": { - "ticker": "ZOMBIE", - "activation_params": { - "mode": { - "rpc": "Light", - "rpc_data": { - "electrum_servers": [ - { - "url": "zombie.dragonhound.info:10133" - } - ], - "light_wallet_d_servers": [ - "http://zombie.dragonhound.info:1443" - ], - "sync_params": { - "height": 2528700 - } - } - }, - "zcash_params_path": "/home/username/path_to/.zcash-params", - "scan_blocks_per_iteration": 100, - "scan_interval_ms": 200 - } - } - } - ``` - + #### Sync from sapling activation height (earliest) @@ -215,17 +144,11 @@ Z coins need to build sync a local block cache and wallet database before they c #### Arguments -| Parameter | Type | Description | -| -------------------- | ------- | ---------------------------------------------------------------------------------------- | -| task\_id | integer | The identifying number returned when initiating the initialisation process. | -| forget\_if\_finished | boolean | If `false`, will return final response for completed tasks. Optional, defaults to `true` | + #### Response -| Parameter | Type | Description | -| --------- | ------ | --------------------------------------------------------------------------------------------------------------------- | -| status | string | A short indication of how the enabling is progressing. | -| details | object | Depending on the state of enabling progress, this will contain different information as shown in the responses below. | + Possible `status` values while activation is in progress: @@ -247,19 +170,7 @@ Once complete, `status` will be `Ok`, and the `details` object will have the fo #### Status of Z coin activation - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_z_coin::status", - "mmrpc": "2.0", - "params": { - "task_id": 0, - "forget_if_finished": false - } - } - ``` - + #### Response (ActivatingCoin - enabling has started) @@ -442,22 +353,7 @@ If the `task::enable_z_coin::status` returns `UserActionRequired`, we need to us | --------- | ------ | --------------------------- | | result | string | The outcome of the request. | - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "mmrpc": "2.0", - "method": "task::enable_z_coin::user_action", - "params": { - "task_id": 3, - "user_action": { - "action_type": "TrezorPin", - "pin": "862743" - } - } - } - ``` - + #### Response (success) @@ -496,18 +392,7 @@ If you want to cancel the enabling process before it has completed, you can use #### Command - - ```json - { - "userpass": "RPC_UserP@SSW0RD", - "method": "task::enable_z_coin::cancel", - "mmrpc": "2.0", - "params": { - "task_id": 3 - } - } - ``` - + #### Response (success) diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/balance_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/balance_enable/index.mdx index 4e6cb1123..1eb3d453b 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/balance_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/balance_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enable Balance Streaming"; export const description = "Using this method, you can enable balance events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; # Enable Balance Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/disable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/disable/index.mdx index 7eebadd28..6f898c1da 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/disable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/disable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Disable Streaming"; export const description = "Using this method, you can disable specific streaming events."; -import CompactTable from '@/components/mdx/CompactTable'; # Disable Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/fee_estimator/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/fee_estimator/index.mdx index fb4448f11..0380d26cd 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/fee_estimator/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/fee_estimator/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Fee Estimator Streaming"; export const description = "Using this method, you can enable the fee estimation stream."; -import CompactTable from '@/components/mdx/CompactTable'; # Fee Estimator Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/heartbeat_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/heartbeat_enable/index.mdx index a921eff1a..dd5dab199 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/heartbeat_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/heartbeat_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enable Heartbeat Streaming"; export const description = "Using this method, you can enable heartbeat events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; # Enable Heartbeat Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/network_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/network_enable/index.mdx index 4611fdf15..3158eb510 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/network_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/network_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enable Network Streaming"; export const description = "Using this method, you can enable network events streaming."; -import CompactTable from '@/components/mdx/CompactTable'; # Enable Network Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/order_status_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/order_status_enable/index.mdx index 88ede5dd3..cb2f0b6b8 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/order_status_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/order_status_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enable Order Status Streaming"; export const description = "Using this method, you can enable the order status stream."; -import CompactTable from '@/components/mdx/CompactTable'; # Enable Order Status Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/orderbook_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/orderbook_enable/index.mdx index ffbbd610a..2f21ebb9f 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/orderbook_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/orderbook_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Orderbook Streaming"; export const description = "Using this method, you can enable the orderbook stream for a given pair."; -import CompactTable from '@/components/mdx/CompactTable'; # Orderbook Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/swap_status_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/swap_status_enable/index.mdx index 4efaac89e..7125c8c1b 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/swap_status_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/swap_status_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enable Swap Status Streaming"; export const description = "Using this method, you can enable the swap status stream."; -import CompactTable from '@/components/mdx/CompactTable'; # Enable Swap Status Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/streaming/tx_history_enable/index.mdx b/src/pages/komodo-defi-framework/api/v20/streaming/tx_history_enable/index.mdx index 7eb3a3d59..8b183adcd 100644 --- a/src/pages/komodo-defi-framework/api/v20/streaming/tx_history_enable/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/streaming/tx_history_enable/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Enable Transaction History Streaming"; export const description = "Using this method, you can enable transaction history events streaming for a specific coin."; -import CompactTable from '@/components/mdx/CompactTable'; # Enable Transaction History Streaming diff --git a/src/pages/komodo-defi-framework/api/v20/utils/add_node_to_version_stat/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/add_node_to_version_stat/index.mdx index 32c654938..1d85925c3 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/add_node_to_version_stat/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/add_node_to_version_stat/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Add Node to Version Stat"; export const description = "The add_node_to_version_stat method adds a Node's name, IP address, and PeerID to a local database to track which version of KDF it is running."; -import CompactTable from '@/components/mdx/CompactTable'; # Add Node to Version Stat diff --git a/src/pages/komodo-defi-framework/api/v20/utils/change_mnemonic_password/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/change_mnemonic_password/index.mdx index a2b4436e0..3f561f237 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/change_mnemonic_password/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/change_mnemonic_password/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Change Mnemonic Password"; export const description = "The change_mnemonic_password method allows a user to update the password used to encrypt a mnemonic phrase in their local database."; -import CompactTable from '@/components/mdx/CompactTable'; # Change Mnemonic Password diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_current_mtp/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_current_mtp/index.mdx index b5bfe34cd..013567fa9 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_current_mtp/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_current_mtp/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Get Current MTP"; export const description = "The get_current_mtp method returns the Median Time Past (MTP) from electrum servers for UTXO coins."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Current MTP diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_enabled_coins/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_enabled_coins/index.mdx index 2352be825..fca709117 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_enabled_coins/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_enabled_coins/index.mdx @@ -1,6 +1,5 @@ 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."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Enabled Coins diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_mnemonic/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_mnemonic/index.mdx index bb84b8da0..8b44413dc 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_mnemonic/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_mnemonic/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Get Mnemonic"; export const description = "The get_mnemonic method returns the user's mnemonic seed phrase, in encrypted or plain text format."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Mnemonic diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_public_key/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_public_key/index.mdx index 252659d55..7af82e448 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_public_key/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_public_key/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Get Public Key"; export const description = "The get_public_key method returns the compressed secp256k1 pubkey corresponding to the user's seed phrase."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Public Key diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_public_key_hash/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_public_key_hash/index.mdx index 7e808b987..9a9638961 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_public_key_hash/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_public_key_hash/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Get Public Key Hash"; export const description = "The get_public_key_hash method returns the RIPEMD-160 hash version of your public key."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Public Key Hash diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_shared_db_id/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_shared_db_id/index.mdx index 310a33846..ff14c9921 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_shared_db_id/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_shared_db_id/index.mdx @@ -1,7 +1,6 @@ export const title = "Komodo DeFi Framework Method: Get Shared Database ID"; export const description = "Return the deterministic identifier used as the root directory name for this node's SQLite databases."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Shared Database ID diff --git a/src/pages/komodo-defi-framework/api/v20/utils/get_token_info/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/get_token_info/index.mdx index 793382484..93c685484 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/get_token_info/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/get_token_info/index.mdx @@ -1,6 +1,5 @@ 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."; -import CompactTable from '@/components/mdx/CompactTable'; # Get Token Info diff --git a/src/pages/komodo-defi-framework/api/v20/utils/message_signing/sign_message/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/message_signing/sign_message/index.mdx index cb56648e7..a977c3017 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/message_signing/sign_message/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/message_signing/sign_message/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Sign Message"; export const description = "The method in this document allows you to sign messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; # Sign Message diff --git a/src/pages/komodo-defi-framework/api/v20/utils/message_signing/verify_message/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/message_signing/verify_message/index.mdx index 261794597..c91d9b8e8 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/message_signing/verify_message/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/message_signing/verify_message/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Verify Message"; export const description = "The method in this document allows you to verify messages for all coins supported by Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; # Verify Message diff --git a/src/pages/komodo-defi-framework/api/v20/utils/peer_connection_healthcheck/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/peer_connection_healthcheck/index.mdx index 25719a98d..0ea336728 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/peer_connection_healthcheck/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/peer_connection_healthcheck/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Peer Connection Healthcheck"; export const description = "The peer_connection_healthcheck method checks if a peer is connected to the KDF network."; -import CompactTable from '@/components/mdx/CompactTable'; # Peer Connection Healthcheck diff --git a/src/pages/komodo-defi-framework/api/v20/utils/remove_node_from_version_stat/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/remove_node_from_version_stat/index.mdx index 35d535cde..4dae55e97 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/remove_node_from_version_stat/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/remove_node_from_version_stat/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Remove Node from Version Stat"; export const description = "Removes a node from the local version stat database in Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; # Remove Node from Version Stat diff --git a/src/pages/komodo-defi-framework/api/v20/utils/send_asked_data/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/send_asked_data/index.mdx index 246a08017..c6f12bac2 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/send_asked_data/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/send_asked_data/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Send Asked Data"; export const description = "Provide data asynchronously to another component that previously issued a data request via the internal event bus."; -import CompactTable from '@/components/mdx/CompactTable'; # Send Asked Data diff --git a/src/pages/komodo-defi-framework/api/v20/utils/start_version_stat_collection/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/start_version_stat_collection/index.mdx index 9b0eb7084..c31ffd070 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/start_version_stat_collection/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/start_version_stat_collection/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Start Version Stat Collection"; export const description = "The start_version_stat_collection method initiates storing version statistics for nodes previously registered via the add_node_to_version_stat method."; -import CompactTable from '@/components/mdx/CompactTable'; # Start Version Stat Collection diff --git a/src/pages/komodo-defi-framework/api/v20/utils/stop_version_stat_collection/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/stop_version_stat_collection/index.mdx index 16bd6fab1..8791c2334 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/stop_version_stat_collection/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/stop_version_stat_collection/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Stop Version Stat Collection"; export const description = "The stop_version_stat_collection method stops the collection of version stats at the end of the current loop interval."; -import CompactTable from '@/components/mdx/CompactTable'; # Stop Version Stat Collection diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/index.mdx index 35334d52c..081fd28c7 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/cancel/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Cancel MetaMask Connection Task"; export const description = "Cancel a running MetaMask connection task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; # Cancel MetaMask Connection Task diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/init/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/init/index.mdx index 87926f8b6..49448fea4 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/init/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/init/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Initialise MetaMask Connection Task"; export const description = "Begin a task-managed process that initialises and authenticates MetaMask with the Komodo DeFi Framework node."; -import CompactTable from '@/components/mdx/CompactTable'; # Initialise MetaMask Connection Task diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/status/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/status/index.mdx index d7b457380..b70e74333 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/status/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_connect_metamask/status/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: MetaMask Connection Task: Status"; export const description = "Query the status of a running MetaMask connection task."; -import CompactTable from '@/components/mdx/CompactTable'; # MetaMask Connection Task: Status diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/cancel/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/cancel/index.mdx index 983f06571..9c430f404 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/cancel/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/cancel/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Cancel Trezor Initialization Task"; export const description = "Cancel the Trezor initialisation task in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; # Cancel Trezor Initialization Task diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/init/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/init/index.mdx index 75e05034b..d495d78b8 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/init/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/init/index.mdx @@ -1,6 +1,5 @@ export const title = "task::init_trezor::init"; export const description = "Initialise your Trezor device for use in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; # Komodo DeFi Framework Method: task::init\_trezor::init diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/status/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/status/index.mdx index 9f04f0643..dd7a0f85e 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/status/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/status/index.mdx @@ -1,6 +1,5 @@ export const title = "task::init_trezor::status"; export const description = "Query the status of Trezor device initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; # Komodo DeFi Framework Method: task::init\_trezor::status diff --git a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/index.mdx index 91d58958e..769902728 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/task_init_trezor/user_action/index.mdx @@ -1,6 +1,6 @@ export const title = "task::init_trezor::user_action"; export const description = "Send user action (PIN or passphrase) to the Trezor device during initialisation in the Komodo DeFi Framework API."; -import CompactTable from '@/components/mdx/CompactTable'; + import trezorpin from "@/public/images/docs/api-images/trezor_pin.png"; # Komodo DeFi Framework Method: task::init\_trezor::user\_action diff --git a/src/pages/komodo-defi-framework/api/v20/utils/trezor_connection_status/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/trezor_connection_status/index.mdx index e7874b1b0..1a84998dc 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/trezor_connection_status/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/trezor_connection_status/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Trezor Connection Status"; export const description = "Check whether a Trezor device linked to the node is currently connected and ready for use."; -import CompactTable from '@/components/mdx/CompactTable'; # Trezor Connection Status diff --git a/src/pages/komodo-defi-framework/api/v20/utils/update_version_stat_collection/index.mdx b/src/pages/komodo-defi-framework/api/v20/utils/update_version_stat_collection/index.mdx index d91a62615..2162d6e08 100644 --- a/src/pages/komodo-defi-framework/api/v20/utils/update_version_stat_collection/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/utils/update_version_stat_collection/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Update Version Stat Collection"; export const description = "The update_version_stat_collection method updates the polling interval for version stats collection."; -import CompactTable from '@/components/mdx/CompactTable'; # Update Version Stat Collection diff --git a/src/pages/komodo-defi-framework/api/v20/wallet/delete_wallet/index.mdx b/src/pages/komodo-defi-framework/api/v20/wallet/delete_wallet/index.mdx index 02bcc1346..07617c88c 100644 --- a/src/pages/komodo-defi-framework/api/v20/wallet/delete_wallet/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/wallet/delete_wallet/index.mdx @@ -1,8 +1,6 @@ export const title = "Komodo DeFi Framework Method: Delete Wallet"; export const description = "Securely deletes a wallet from the Komodo DeFi Framework."; -import CompactTable from '@/components/mdx/CompactTable'; - # Delete Wallet ## delete\_wallet {{label : 'delete_wallet', tag : 'API-v2'}} diff --git a/src/pages/komodo-defi-framework/setup/telegram-alerts/index.mdx b/src/pages/komodo-defi-framework/setup/telegram-alerts/index.mdx index 39bbcb593..681703dc2 100644 --- a/src/pages/komodo-defi-framework/setup/telegram-alerts/index.mdx +++ b/src/pages/komodo-defi-framework/setup/telegram-alerts/index.mdx @@ -1,6 +1,5 @@ export const title = "Komodo DeFi Framework Method: Telegram Alerts for Bot Trading"; export const description = "The Komodo DeFi Framework API Market Maker bot can be configured to send status update alerts via Telegram."; -import CompactTable from '@/components/mdx/CompactTable'; # Telegram Alerts for Bot Trading diff --git a/utils/js/validate_update_internal_links_userpass.js b/utils/js/validate_update_internal_links_userpass.js index 68ee31748..cd9cc9a6c 100644 --- a/utils/js/validate_update_internal_links_userpass.js +++ b/utils/js/validate_update_internal_links_userpass.js @@ -128,7 +128,29 @@ async function processFile(filePath, filepathSlugs) { attr.value === "true" ) ) { - // console.log(node) + // Check if it has a source attribute (new format) + const sourceAttr = node.attributes.find( + (attr) => + attr.type === "mdxJsxAttribute" && + attr.name === "source" + ); + + + + if (sourceAttr) { + // If source attribute exists, validate it + if (typeof sourceAttr.value !== "string" || sourceAttr.value.length === 0) { + throw new Error( + `CodeGroup with mm2MethodDecorate="true" has invalid source attribute value in file ${filePath}. Source must be a non-empty string.` + ); + } + if (node.children.length === 0) { + // Valid new format with source attribute and no children - skip processing + return SKIP; + } + } + + // Original format with child JSON code block const originalChild = node.children[0]; if (node.children.length !== 1 || originalChild.lang !== "json") { throw new Error( @@ -151,6 +173,7 @@ code node: ${JSON.stringify(node, null, 2)}`); } } catch (error) { + console.error(error) throw new Error(`Error: ${JSON.stringify(error, null, 2)} Filepath: ${filePath} diff --git a/utils/py/README_update_nodes.md b/utils/py/README_update_nodes.md new file mode 100644 index 000000000..4eac09eb1 --- /dev/null +++ b/utils/py/README_update_nodes.md @@ -0,0 +1,305 @@ +# Node Update Script + +This script addresses [GitHub Issue #360](https://github.com/KomodoPlatform/komodo-docs-mdx/issues/360) by automatically updating server and node values in documentation request examples with the latest data from the [coins repository](https://github.com/KomodoPlatform/coins). + +## Overview + +The Komodo DeFi Framework documentation includes example request JSON files that show how to interact with various APIs. These examples contain server URLs (electrum servers, RPC nodes, light wallet servers) that can become outdated over time. This script automates the process of keeping those server values synchronized with the authoritative source in the coins repository. + +## How It Works + +1. **Fetches Latest Data**: Downloads the latest `coins_config.json` from the coins repository +2. **Identifies Tickers**: Scans request JSON files for ticker symbols +3. **Detects Protocol Type**: Automatically determines coin protocol (ETH, Tendermint, UTXO, ZHTLC) +4. **Server Selection**: Selects up to 3 servers, prioritizing domains containing 'cipig' or 'komodo' +5. **Updates Servers**: Replaces server/node arrays with the selected values from the coins configuration +6. **Protocol-Specific Mapping**: Maps different server types based on coin protocol +7. **Preserves Structure**: Maintains the original JSON structure and formatting + +## Usage + +### Prerequisites + +Make sure you have the Python virtual environment activated: + +```bash +source utils/py/.venv/bin/activate +``` + +### Basic Usage + +Update a single file in-place: +```bash +python utils/py/update_request_nodes.py src/data/requests/kdf/v2/coin_activation.json +``` + +Update a file and save to a different location: +```bash +python utils/py/update_request_nodes.py input.json output.json +``` + +### Command Line Options + +- `input_file` (required): Path to the input request JSON file +- `output_file` (optional): Path to save the updated file. If not specified, updates the input file in-place +- `-v, --verbose`: Enable verbose logging for debugging + +### Examples + +#### Update coin activation examples +```bash +python utils/py/update_request_nodes.py src/data/requests/kdf/v2/coin_activation.json +``` + +#### Batch update multiple files +```bash +find src/data/requests/kdf/ -name "*.json" -exec python utils/py/update_request_nodes.py {} \; +``` + +#### Test mode (save to different file) +```bash +python utils/py/update_request_nodes.py src/data/requests/kdf/v2/coin_activation.json /tmp/test_output.json +``` + +## Supported Coin Protocols + +The script automatically detects and handles different coin protocols: + +### ETH/EVM Chains (ETH, MATIC, BNB, AVAX, etc.) +- **coins_config field**: `nodes` +- **request field**: `nodes` +- **Example coins**: ETH, MATIC, BNB, AVAX, FTM + +### Tendermint/Cosmos Chains +- **coins_config field**: `rpc_urls` +- **request field**: `nodes` +- **Example coins**: ATOM, IRIS, OSMOSIS + +### UTXO Chains (Bitcoin-like) +- **coins_config field**: `electrum` +- **request field**: `servers` (nested under `mode.rpc_data.servers`) +- **Example coins**: BTC, LTC, KMD, QTUM, BCH + +### ZHTLC Chains (Privacy coins) +- **coins_config fields**: `light_wallet_d_servers` + `electrum` +- **request fields**: `light_wallet_d_servers` + `electrum_servers` +- **Example coins**: ARRR, ZOMBIE + +## Supported JSON Formats + +The script can handle various JSON structures: + +### Single Request Object +```json +{ + "method": "task::enable_eth::init", + "params": { + "ticker": "MATIC", + "nodes": [...] + } +} +``` + +### Multiple Request Objects +```json +{ + "Request1": { + "params": { + "ticker": "MATIC", + "nodes": [...] + } + }, + "Request2": { + "params": { + "ticker": "BTC", + "nodes": [...] + } + } +} +``` + +### Array of Requests +```json +[ + { + "params": { + "ticker": "MATIC", + "nodes": [...] + } + } +] +``` + +## Server Format Conversion + +The script automatically converts between the coins repository format and the documentation format based on protocol type: + +### ETH/EVM Nodes +**Coins Repository Format:** +```json +"nodes": [ + { + "url": "https://example.com:8545", + "ws_url": "wss://example.com:8546", + "komodo_proxy": true + } +] +``` + +**Documentation Format:** +```json +"nodes": [ + { + "url": "https://example.com:8545" + } +] +``` + +### Tendermint RPC URLs +**Coins Repository Format:** +```json +"rpc_urls": [ + { + "url": "https://cosmos-rpc.example.com/", + "api_url": "https://cosmos-api.example.com/", + "grpc_url": "https://cosmos-grpc.example.com/", + "ws_url": "wss://cosmos-rpc.example.com/websocket" + } +] +``` + +**Documentation Format:** +```json +"nodes": [ + { + "url": "https://cosmos-rpc.example.com/", + "api_url": "https://cosmos-api.example.com/", + "grpc_url": "https://cosmos-grpc.example.com/", + "ws_url": "wss://cosmos-rpc.example.com/websocket" + } +] +``` + +### UTXO Electrum Servers +**Coins Repository Format:** +```json +"electrum": [ + { + "url": "btc.electrum1.cipig.net:10000", + "protocol": "TCP", + "contact": [...] + } +] +``` + +**Documentation Format:** +```json +"servers": [ + { + "url": "btc.electrum1.cipig.net:10000", + "protocol": "TCP" + } +] +``` + +### ZHTLC Light Wallet Servers +**Coins Repository Format:** +```json +"light_wallet_d_servers": [ + "https://piratelightd1.example.com:443" +], +"electrum": [ + { + "url": "arrr.electrum1.cipig.net:10008", + "protocol": "TCP" + } +] +``` + +**Documentation Format:** +```json +"light_wallet_d_servers": [ + "https://piratelightd1.example.com:443" +], +"electrum_servers": [ + { + "url": "arrr.electrum1.cipig.net:10008", + "protocol": "TCP" + } +] +``` + +## Automation + +For CI/CD integration, you can create a script that updates all request files: + +```bash +#!/bin/bash +# Update all request JSON files +find src/data/requests/kdf -name "*.json" | while read file; do + echo "Updating $file..." + python utils/py/update_request_nodes.py "$file" +done +``` + +## Error Handling + +The script includes comprehensive error handling: + +- **Network Issues**: Graceful handling of connection failures when fetching coins_config.json +- **Invalid JSON**: Clear error messages for malformed JSON files +- **Missing Files**: File existence validation before processing +- **Missing Tickers**: Warnings for tickers not found in the coins configuration +- **Missing Nodes**: Warnings for coins without node configurations + +## Logging + +The script provides detailed logging: + +- **INFO**: Normal operation status and update summaries +- **WARNING**: Non-critical issues like missing tickers +- **ERROR**: Critical failures that prevent execution +- **DEBUG**: Detailed operation information (with `-v` flag) + +## Server Selection Logic + +To keep JSON payloads lightweight, the script limits server selections to 3 maximum: + +1. **Priority Selection**: Servers containing 'cipig' or 'komodo' in their domains are preferred +2. **Random Selection**: If more than 3 servers are available, selection is randomized within priority groups +3. **Fallback**: If fewer than 3 priority servers exist, the remainder is filled from regular servers + +## Example Output + +``` +2025-08-07 15:56:34,085 - INFO - Loaded request file: coin_activation.json +2025-08-07 15:56:34,085 - INFO - Fetching coins configuration from https://raw.githubusercontent.com/... +2025-08-07 15:56:34,521 - INFO - Successfully fetched configuration for 769 coins +2025-08-07 15:56:34,521 - DEBUG - Detected protocol 'UTXO' for ticker 'KMD' +2025-08-07 15:56:34,521 - DEBUG - Selected 3 servers from 9 available (9 priority, 0 regular) +2025-08-07 15:56:34,521 - INFO - Updated UTXO electrum servers for ticker 'KMD': 9 -> 3 servers +2025-08-07 15:56:34,521 - INFO - Updated request object: TaskEnableUtxoInit +2025-08-07 15:56:34,522 - INFO - āœ… Successfully updated 16 request(s) with latest server/node values +2025-08-07 15:56:34,523 - INFO - šŸŽ‰ Update completed successfully! +``` + +## Integration with CI/CD + +This script can be integrated into GitHub Actions workflows to automatically keep request examples up-to-date. See the example workflow in `.github/workflows/update-nodes.yml` for a complete CI/CD solution. + +## Troubleshooting + +### Script shows "No updates were needed" +- Verify that the JSON file contains a `ticker` field +- Check that the ticker exists in the coins repository +- Ensure the request has a `nodes` array to update + +### Network errors when fetching coins_config.json +- Check internet connectivity +- Verify that the coins repository URL is accessible +- Consider using a local copy of coins_config.json for testing + +### JSON parsing errors +- Validate your input JSON file with a JSON validator +- Check for trailing commas or other syntax issues +- Ensure proper UTF-8 encoding \ No newline at end of file diff --git a/utils/py/batch_update_nodes.py b/utils/py/batch_update_nodes.py new file mode 100755 index 000000000..1e85cc01f --- /dev/null +++ b/utils/py/batch_update_nodes.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python3 +""" +Batch script to update node values in all request JSON files + +This script finds all JSON files in the requests directory and updates their +node values using the update_request_nodes.py script. + +Usage: + python batch_update_nodes.py [--dry-run] [--directory ] +""" + +import os +import sys +import subprocess +import argparse +import logging +from pathlib import Path + +# Configure logging +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') +logger = logging.getLogger(__name__) + +def find_request_files(directory: Path) -> list[Path]: + """Find all JSON files in the requests directory""" + json_files = [] + + if not directory.exists(): + logger.error(f"Directory does not exist: {directory}") + return json_files + + # Find all .json files recursively + for json_file in directory.rglob("*.json"): + json_files.append(json_file) + + logger.info(f"Found {len(json_files)} JSON files to process") + return json_files + +def update_file(json_file: Path, dry_run: bool = False) -> bool: + """Update a single JSON file using the update_request_nodes.py script""" + + script_path = Path(__file__).parent / "update_request_nodes.py" + + if not script_path.exists(): + logger.error(f"Update script not found: {script_path}") + return False + + try: + if dry_run: + # For dry run, we'll just try to load and validate the file + import json + with open(json_file, 'r', encoding='utf-8') as f: + data = json.load(f) + logger.info(f"[DRY RUN] Would update: {json_file}") + return True + else: + # Run the actual update script + cmd = [sys.executable, str(script_path), str(json_file)] + result = subprocess.run(cmd, capture_output=True, text=True) + + if result.returncode == 0: + # Check if any updates were actually made + if "Successfully updated" in result.stdout: + logger.info(f"āœ… Updated: {json_file}") + return True + else: + logger.info(f"ā„¹ļø No updates needed: {json_file}") + return False + else: + logger.error(f"āŒ Failed to update {json_file}: {result.stderr}") + return False + + except Exception as e: + logger.error(f"āŒ Error processing {json_file}: {e}") + return False + +def main(): + """Main entry point""" + parser = argparse.ArgumentParser( + description="Batch update node values in all request JSON files" + ) + parser.add_argument( + "--directory", + "-d", + default="src/data/requests/kdf", + help="Directory to search for JSON files (default: src/data/requests/kdf)" + ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Show what would be updated without making changes" + ) + parser.add_argument( + "--verbose", + "-v", + action="store_true", + help="Enable verbose logging" + ) + + args = parser.parse_args() + + if args.verbose: + logging.getLogger().setLevel(logging.DEBUG) + + # Convert to absolute path relative to the script's location + if not os.path.isabs(args.directory): + # If relative path, make it relative to the workspace root (2 levels up from this script) + workspace_root = Path(__file__).parent.parent.parent + directory = workspace_root / args.directory + else: + directory = Path(args.directory) + + logger.info(f"šŸ” Searching for JSON files in: {directory}") + + # Find all request files + json_files = find_request_files(directory) + + if not json_files: + logger.info("No JSON files found to process") + return + + # Process each file + updated_count = 0 + error_count = 0 + + for json_file in json_files: + try: + if update_file(json_file, args.dry_run): + updated_count += 1 + except Exception as e: + logger.error(f"Unexpected error processing {json_file}: {e}") + error_count += 1 + + # Summary + total_files = len(json_files) + skipped_count = total_files - updated_count - error_count + + logger.info("=" * 50) + logger.info("šŸ“Š BATCH UPDATE SUMMARY") + logger.info("=" * 50) + logger.info(f"Total files processed: {total_files}") + logger.info(f"Files updated: {updated_count}") + logger.info(f"Files skipped (no updates needed): {skipped_count}") + logger.info(f"Errors: {error_count}") + + if args.dry_run: + logger.info("šŸ” This was a dry run - no files were actually modified") + else: + if updated_count > 0: + logger.info("šŸŽ‰ Batch update completed successfully!") + else: + logger.info("āœ… All files were already up-to-date!") + + if error_count > 0: + sys.exit(1) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/utils/py/update_request_nodes.py b/utils/py/update_request_nodes.py new file mode 100755 index 000000000..cf9bf68c1 --- /dev/null +++ b/utils/py/update_request_nodes.py @@ -0,0 +1,518 @@ +#!/usr/bin/env python3 +""" +Script to update node values in request JSON files with latest data from coins_config.json + +This script addresses GitHub issue #360 by keeping electrum/node server values updated +in documentation request examples by syncing them with the latest values from the +coins repository. + +Usage: + python update_request_nodes.py [output_file] + +If output_file is not provided, the input file will be updated in-place. +""" + +import json +import sys +import argparse +import logging +import urllib.request +import random +from pathlib import Path +from typing import Dict, List, Any, Optional + +# Configure logging +logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') +logger = logging.getLogger(__name__) + +# URL to fetch the latest coins configuration +COINS_CONFIG_URL = "https://raw.githubusercontent.com/KomodoPlatform/coins/master/utils/coins_config.json" + +def fetch_coins_config() -> Dict[str, Any]: + """Fetch the latest coins configuration from the coins repository""" + try: + logger.info(f"Fetching coins configuration from {COINS_CONFIG_URL}") + with urllib.request.urlopen(COINS_CONFIG_URL) as response: + data = json.loads(response.read().decode('utf-8')) + logger.info(f"Successfully fetched configuration for {len(data)} coins") + return data + except Exception as e: + logger.error(f"Failed to fetch coins configuration: {e}") + raise + +def extract_method_from_request(request_data: Dict[str, Any]) -> Optional[str]: + """Extract the method name from a request object""" + if isinstance(request_data, dict) and 'method' in request_data: + return request_data['method'] + return None + +def extract_ticker_from_request(request_data: Dict[str, Any]) -> Optional[str]: + """Extract the ticker symbol from a request object""" + # Look for ticker in params + if 'params' in request_data: + params = request_data['params'] + if isinstance(params, dict): + if 'ticker' in params: + return params['ticker'] + elif 'coin' in params: + return params['coin'] + + # Look for ticker in other common locations + elif 'ticker' in request_data: + return request_data['ticker'] + elif 'coin' in request_data: + return request_data['coin'] + + return None + +def select_preferred_servers(servers: List[Dict[str, Any]], max_count: int = 3) -> List[Dict[str, Any]]: + """Select up to max_count servers, preferring cipig/komodo domains""" + if len(servers) <= max_count: + return servers + + # Separate servers into priority and non-priority + priority_servers = [] + regular_servers = [] + + for server in servers: + url = server.get('url', '') + if 'cipig' in url.lower() or 'komodo' in url.lower(): + priority_servers.append(server) + else: + regular_servers.append(server) + + selected_servers = [] + + # First, add priority servers (up to max_count) + if priority_servers: + if len(priority_servers) <= max_count: + selected_servers.extend(priority_servers) + else: + # Randomly select from priority servers + selected_servers.extend(random.sample(priority_servers, max_count)) + + # If we need more servers and have regular ones available + remaining_slots = max_count - len(selected_servers) + if remaining_slots > 0 and regular_servers: + if len(regular_servers) <= remaining_slots: + selected_servers.extend(regular_servers) + else: + # Randomly select from regular servers + selected_servers.extend(random.sample(regular_servers, remaining_slots)) + + logger.debug(f"Selected {len(selected_servers)} servers from {len(servers)} available ({len(priority_servers)} priority, {len(regular_servers)} regular)") + return selected_servers + +def select_preferred_urls(urls: List[str], max_count: int = 3) -> List[str]: + """Select up to max_count URLs, preferring cipig/komodo domains""" + if len(urls) <= max_count: + return urls + + # Separate URLs into priority and non-priority + priority_urls = [] + regular_urls = [] + + for url in urls: + if 'cipig' in url.lower() or 'komodo' in url.lower(): + priority_urls.append(url) + else: + regular_urls.append(url) + + selected_urls = [] + + # First, add priority URLs (up to max_count) + if priority_urls: + if len(priority_urls) <= max_count: + selected_urls.extend(priority_urls) + else: + # Randomly select from priority URLs + selected_urls.extend(random.sample(priority_urls, max_count)) + + # If we need more URLs and have regular ones available + remaining_slots = max_count - len(selected_urls) + if remaining_slots > 0 and regular_urls: + if len(regular_urls) <= remaining_slots: + selected_urls.extend(regular_urls) + else: + # Randomly select from regular URLs + selected_urls.extend(random.sample(regular_urls, remaining_slots)) + + logger.debug(f"Selected {len(selected_urls)} URLs from {len(urls)} available ({len(priority_urls)} priority, {len(regular_urls)} regular)") + return selected_urls + +def detect_coin_protocol(coin_config: Dict[str, Any]) -> str: + """Detect the coin protocol type from the coin configuration""" + if 'protocol' in coin_config: + protocol_type = coin_config['protocol'].get('type', '').upper() + if protocol_type in ['TENDERMINT', 'COSMOS']: + return 'TENDERMINT' + elif protocol_type in ['UTXO', 'QTUM', 'BCH']: + return 'UTXO' + elif protocol_type in ['ZHTLC', 'ZEC']: + return 'ZHTLC' + elif protocol_type in ['ETH', 'ERC20', 'MATIC', 'BNB', 'AVAX', 'FTM', 'ONE']: + return 'ETH' + + # Fallback: detect by available server types + if 'rpc_urls' in coin_config: + return 'TENDERMINT' + elif 'light_wallet_d_servers' in coin_config: + return 'ZHTLC' + elif 'electrum' in coin_config: + return 'UTXO' + elif 'nodes' in coin_config: + return 'ETH' + + return 'UNKNOWN' + +def update_tendermint_nodes(request_data: Dict[str, Any], coin_config: Dict[str, Any], ticker: str) -> bool: + """Update Tendermint coin nodes (rpc_urls → nodes)""" + if 'rpc_urls' not in coin_config: + logger.warning(f"No rpc_urls found for Tendermint ticker '{ticker}' in coins configuration") + return False + + # Select up to 3 preferred RPC URLs and convert to nodes format + selected_rpc_urls = select_preferred_servers(coin_config['rpc_urls'], max_count=3) + + # Convert selected rpc_urls to nodes format (preserve all fields) + new_nodes = [] + for rpc_url in selected_rpc_urls: + node = {"url": rpc_url["url"]} + # Preserve additional fields like api_url, grpc_url, ws_url, komodo_proxy + for field in ['api_url', 'grpc_url', 'ws_url', 'komodo_proxy']: + if field in rpc_url: + node[field] = rpc_url[field] + new_nodes.append(node) + + # Update nodes in params + if 'params' in request_data and isinstance(request_data['params'], dict): + params = request_data['params'] + if 'nodes' in params: + old_nodes = params['nodes'] + params['nodes'] = new_nodes + logger.info(f"Updated Tendermint nodes for ticker '{ticker}': {len(old_nodes)} -> {len(new_nodes)} nodes") + return True + + # Check root level for nodes + if 'nodes' in request_data: + old_nodes = request_data['nodes'] + request_data['nodes'] = new_nodes + logger.info(f"Updated Tendermint nodes for ticker '{ticker}': {len(old_nodes)} -> {len(new_nodes)} nodes") + return True + + return False + +def update_utxo_electrum_servers(request_data: Dict[str, Any], coin_config: Dict[str, Any], ticker: str) -> bool: + """Update UTXO coin electrum servers (electrum → servers)""" + if 'electrum' not in coin_config: + logger.warning(f"No electrum servers found for UTXO ticker '{ticker}' in coins configuration") + return False + + # Select up to 3 preferred electrum servers and convert to servers format + selected_electrum = select_preferred_servers(coin_config['electrum'], max_count=3) + + # Convert selected electrum to servers format + new_servers = [] + for electrum in selected_electrum: + server = {"url": electrum["url"]} + # Preserve protocol if specified + if 'protocol' in electrum: + server['protocol'] = electrum['protocol'] + # Add other optional fields + for field in ['ws_url', 'disable_cert_verification']: + if field in electrum: + server[field] = electrum[field] + new_servers.append(server) + + # Look for electrum servers nested in mode.rpc_data.servers (common pattern) + if 'params' in request_data and isinstance(request_data['params'], dict): + params = request_data['params'] + + # Handle nested activation_params.mode.rpc_data.servers + if 'activation_params' in params and 'mode' in params['activation_params']: + mode = params['activation_params']['mode'] + if 'rpc_data' in mode and 'servers' in mode['rpc_data']: + old_servers = mode['rpc_data']['servers'] + mode['rpc_data']['servers'] = new_servers + logger.info(f"Updated UTXO electrum servers for ticker '{ticker}': {len(old_servers)} -> {len(new_servers)} servers") + return True + + # Handle direct mode.rpc_data.servers + if 'mode' in params and 'rpc_data' in params['mode']: + rpc_data = params['mode']['rpc_data'] + if 'servers' in rpc_data: + old_servers = rpc_data['servers'] + rpc_data['servers'] = new_servers + logger.info(f"Updated UTXO electrum servers for ticker '{ticker}': {len(old_servers)} -> {len(new_servers)} servers") + return True + else: + # Legacy method + if request_data['method'] == 'electrum': + old_servers = request_data['servers'] + request_data['servers'] = new_servers + logger.info(f"Updated UTXO electrum servers for ticker '{ticker}': {len(old_servers)} -> {len(new_servers)} servers") + return True + elif request_data['method'] == 'enable': + if 'urls' in request_data: + old_servers = request_data['urls'] + request_data['urls'] = [ i['url'] for i in new_servers ] + logger.info(f"Updated UTXO electrum urls for ticker '{ticker}': {len(old_servers)} -> {len(new_servers)} servers") + return True + return False + +def update_zhtlc_servers(request_data: Dict[str, Any], coin_config: Dict[str, Any], ticker: str) -> bool: + """Update ZHTLC coin servers (light_wallet_d_servers and electrum)""" + updated = False + + # Update light_wallet_d_servers (select up to 3) + if 'light_wallet_d_servers' in coin_config: + new_lwd_servers = select_preferred_urls(coin_config['light_wallet_d_servers'], max_count=3) + + # Look for light_wallet_d_servers in nested structure + if 'params' in request_data and isinstance(request_data['params'], dict): + params = request_data['params'] + + # Handle nested activation_params.mode.rpc_data.light_wallet_d_servers + if 'activation_params' in params and 'mode' in params['activation_params']: + mode = params['activation_params']['mode'] + if 'rpc_data' in mode and 'light_wallet_d_servers' in mode['rpc_data']: + old_lwd = mode['rpc_data']['light_wallet_d_servers'] + mode['rpc_data']['light_wallet_d_servers'] = new_lwd_servers + logger.info(f"Updated ZHTLC light_wallet_d_servers for ticker '{ticker}': {len(old_lwd)} -> {len(new_lwd_servers)} servers") + updated = True + + # Handle direct mode.rpc_data.light_wallet_d_servers + elif 'mode' in params and 'rpc_data' in params['mode']: + rpc_data = params['mode']['rpc_data'] + if 'light_wallet_d_servers' in rpc_data: + old_lwd = rpc_data['light_wallet_d_servers'] + rpc_data['light_wallet_d_servers'] = new_lwd_servers + logger.info(f"Updated ZHTLC light_wallet_d_servers for ticker '{ticker}': {len(old_lwd)} -> {len(new_lwd_servers)} servers") + updated = True + + # Update electrum_servers (from electrum field in coins_config, select up to 3) + if 'electrum' in coin_config: + # Select up to 3 preferred electrum servers + selected_electrum = select_preferred_servers(coin_config['electrum'], max_count=3) + + # Convert selected electrum to electrum_servers format (simpler than UTXO) + new_electrum_servers = [] + for electrum in selected_electrum: + server = {"url": electrum["url"]} + if 'protocol' in electrum: + server['protocol'] = electrum['protocol'] + if 'ws_url' in electrum: + server['ws_url'] = electrum['ws_url'] + new_electrum_servers.append(server) + + # Look for electrum_servers in nested structure + if 'params' in request_data and isinstance(request_data['params'], dict): + params = request_data['params'] + + # Handle nested activation_params.mode.rpc_data.electrum_servers + if 'activation_params' in params and 'mode' in params['activation_params']: + mode = params['activation_params']['mode'] + if 'rpc_data' in mode and 'electrum_servers' in mode['rpc_data']: + old_electrum = mode['rpc_data']['electrum_servers'] + mode['rpc_data']['electrum_servers'] = new_electrum_servers + logger.info(f"Updated ZHTLC electrum_servers for ticker '{ticker}': {len(old_electrum)} -> {len(new_electrum_servers)} servers") + updated = True + + # Handle direct mode.rpc_data.electrum_servers + elif 'mode' in params and 'rpc_data' in params['mode']: + rpc_data = params['mode']['rpc_data'] + if 'electrum_servers' in rpc_data: + old_electrum = rpc_data['electrum_servers'] + rpc_data['electrum_servers'] = new_electrum_servers + logger.info(f"Updated ZHTLC electrum_servers for ticker '{ticker}': {len(old_electrum)} -> {len(new_electrum_servers)} servers") + updated = True + + return updated + +def update_eth_nodes(request_data: Dict[str, Any], coin_config: Dict[str, Any], ticker: str) -> bool: + """Update ETH-like coin nodes (nodes → nodes) - original functionality""" + if 'nodes' not in coin_config: + logger.warning(f"No nodes found for ETH ticker '{ticker}' in coins configuration") + return False + + # Select up to 3 preferred nodes and convert coins_config node format to request format + selected_nodes = select_preferred_servers(coin_config['nodes'], max_count=3) + + new_nodes = [] + for node in selected_nodes: + request_node = {"url": node["url"]} + # Preserve other fields that might be present + for field in ['ws_url', 'komodo_proxy']: + if field in node: + request_node[field] = node[field] + new_nodes.append(request_node) + + # Look for nodes in params first, then in the root of the request + if 'params' in request_data and isinstance(request_data['params'], dict): + params = request_data['params'] + if 'nodes' in params: + old_nodes = params['nodes'] + params['nodes'] = new_nodes + logger.info(f"Updated ETH nodes for ticker '{ticker}': {len(old_nodes)} -> {len(new_nodes)} nodes") + return True + + # Check root level for nodes + if 'nodes' in request_data: + old_nodes = request_data['nodes'] + request_data['nodes'] = new_nodes + logger.info(f"Updated ETH nodes for ticker '{ticker}': {len(old_nodes)} -> {len(new_nodes)} nodes") + return True + + elif request_data['method'] == 'enable': + if 'urls' in request_data: + old_urls = request_data['urls'] + request_data['urls'] = [ i['url'] for i in new_nodes ] + logger.info(f"Updated ETH nodes for ticker '{ticker}': {len(old_urls)} -> {len(new_nodes)} nodes") + return True + return False + +def update_nodes_in_request(request_data: Dict[str, Any], coins_config: Dict[str, Any], request_name: str = "Unknown") -> bool: + """ + Update server/node arrays in a request object based on coin protocol type + + Args: + request_data: The request object to update + coins_config: The coins configuration data + request_name: Name/identifier of the request for logging + + Returns: + bool: True if any servers/nodes were updated, False otherwise + """ + method = extract_method_from_request(request_data) + ticker = extract_ticker_from_request(request_data) + + if method: + logger.debug(f"Scanning method '{method}' in request '{request_name}'") + else: + logger.debug(f"Scanning request '{request_name}' (no method field)") + + if not ticker: + logger.debug(f"No ticker found in request '{request_name}'") + return False + + if ticker not in coins_config: + logger.warning(f"Ticker '{ticker}' not found in coins configuration") + return False + + coin_config = coins_config[ticker] + protocol = detect_coin_protocol(coin_config) + + logger.debug(f"Detected protocol '{protocol}' for ticker '{ticker}'") + + # Route to appropriate update function based on protocol + if protocol == 'TENDERMINT': + return update_tendermint_nodes(request_data, coin_config, ticker) + elif protocol == 'UTXO': + return update_utxo_electrum_servers(request_data, coin_config, ticker) + elif protocol == 'ZHTLC': + return update_zhtlc_servers(request_data, coin_config, ticker) + elif protocol == 'ETH': + return update_eth_nodes(request_data, coin_config, ticker) + else: + logger.warning(f"Unknown or unsupported protocol '{protocol}' for ticker '{ticker}'") + return False + +def process_request_file(input_file: Path, output_file: Optional[Path] = None) -> None: + """Process a request JSON file and update node values""" + + # Read the input file + try: + with open(input_file, 'r', encoding='utf-8') as f: + request_data = json.load(f) + logger.info(f"Loaded request file: {input_file}") + except Exception as e: + logger.error(f"Failed to read input file {input_file}: {e}") + raise + + # Fetch the latest coins configuration + coins_config = fetch_coins_config() + + # Process the request data + updates_made = 0 + + # Handle the case where the file contains multiple request objects + if isinstance(request_data, dict): + for key, request_obj in request_data.items(): + if isinstance(request_obj, dict): + if update_nodes_in_request(request_obj, coins_config, key): + updates_made += 1 + method = extract_method_from_request(request_obj) + if method: + logger.info(f"Updated request object '{key}' (method: {method})") + else: + logger.info(f"Updated request object: {key}") + elif isinstance(request_data, list): + # Handle array of requests + for i, request_obj in enumerate(request_data): + if isinstance(request_obj, dict): + request_name = f"index_{i}" + if update_nodes_in_request(request_obj, coins_config, request_name): + updates_made += 1 + method = extract_method_from_request(request_obj) + if method: + logger.info(f"Updated request object at index {i} (method: {method})") + else: + logger.info(f"Updated request object at index {i}") + else: + # Single request object + if update_nodes_in_request(request_data, coins_config, "single_request"): + updates_made += 1 + method = extract_method_from_request(request_data) + if method: + logger.info(f"Updated single request object (method: {method})") + else: + logger.info("Updated single request object") + + # Determine output file + if output_file is None: + output_file = input_file + + # Write the updated data + try: + with open(output_file, 'w', encoding='utf-8') as f: + json.dump(request_data, f, indent=2, ensure_ascii=False) + logger.info(f"Saved updated file: {output_file}") + except Exception as e: + logger.error(f"Failed to write output file {output_file}: {e}") + raise + + if updates_made > 0: + logger.info(f"āœ… Successfully updated {updates_made} request(s) with latest server/node values") + else: + logger.info("ā„¹ļø No updates were needed - no matching tickers with compatible server configurations found") + +def main(): + """Main entry point""" + parser = argparse.ArgumentParser( + description="Update node values in request JSON files with latest data from coins_config.json" + ) + parser.add_argument("input_file", help="Path to the input request JSON file") + parser.add_argument("output_file", nargs="?", help="Path to the output file (optional, defaults to input_file)") + parser.add_argument("-v", "--verbose", action="store_true", help="Enable verbose logging") + + args = parser.parse_args() + + if args.verbose: + logging.getLogger().setLevel(logging.DEBUG) + + input_file = Path(args.input_file) + output_file = Path(args.output_file) if args.output_file else None + + if not input_file.exists(): + logger.error(f"Input file does not exist: {input_file}") + sys.exit(1) + + try: + process_request_file(input_file, output_file) + logger.info("šŸŽ‰ Update completed successfully!") + except Exception as e: + logger.error(f"āŒ Update failed: {e}") + sys.exit(1) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/utils/py/validate_kdf_responses.py b/utils/py/validate_kdf_responses.py new file mode 100644 index 000000000..0135afcb2 --- /dev/null +++ b/utils/py/validate_kdf_responses.py @@ -0,0 +1,448 @@ +#!/usr/bin/env python3 +""" +KDF Responses Validation Script + +Validates the structure and content of KDF response JSON files to ensure +they follow the expected format for the KdfResponses component. + +Usage: + python validate_responses/kdf.py + +Features: +- Validates JSON structure and syntax +- Checks required fields and data types +- Validates response categories (success/error) +- Ensures consistent naming conventions +- Provides detailed error reporting +- Optional auto-fix for minor formatting issues +""" + +import json +import os +import sys +from pathlib import Path +from typing import Dict, List, Tuple, Any, Optional +import argparse +import re + + +class ValidationError: + def __init__(self, file_path: str, error_type: str, message: str, location: str = ""): + self.file_path = file_path + self.error_type = error_type + self.message = message + self.location = location + + def __str__(self): + location_str = f" [{self.location}]" if self.location else "" + return f"[{self.error_type}] {self.file_path}{location_str}: {self.message}" + + +class KdfResponseValidator: + def __init__(self): + self.errors: List[ValidationError] = [] + self.warnings: List[ValidationError] = [] + self.fixes_applied: List[str] = [] + + # Valid response types + self.valid_response_types = {'success', 'error'} + + # Valid request key pattern (alphanumeric, PascalCase with optional leading numeric) + self.request_key_pattern = re.compile(r'^[A-Z0-9][a-zA-Z0-9]*$') + + def validate_all(self) -> Tuple[bool, List[ValidationError], List[ValidationError]]: + """Validate all KDF response files.""" + base_path = Path('src/data/responses/kdf') + + if not base_path.exists(): + self.errors.append(ValidationError( + str(base_path), + "MISSING_DIRECTORY", + "KDF responses directory does not exist" + )) + return False, self.errors, self.warnings + + # Validate legacy and v2 directories + for version in ['legacy', 'v2']: + version_path = base_path / version + if version_path.exists(): + self._validate_directory(version_path, version) + else: + self.errors.append(ValidationError( + str(version_path), + "MISSING_DIRECTORY", + f"Missing {version} directory" + )) + + # Check request/response alignment + self._validate_request_response_alignment() + + return len(self.errors) == 0, self.errors, self.warnings + + def _validate_directory(self, dir_path: Path, version: str): + """Validate all JSON files in a directory.""" + json_files = list(dir_path.glob('*.json')) + + if not json_files: + self.warnings.append(ValidationError( + str(dir_path), + "EMPTY_DIRECTORY", + f"No JSON files found in {version} directory" + )) + return + + for json_file in json_files: + self._validate_file(json_file, version) + + def _validate_file(self, file_path: Path, version: str): + """Validate a single JSON file.""" + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read().strip() + + if not content: + self.errors.append(ValidationError( + str(file_path), + "EMPTY_FILE", + "File is empty" + )) + return + + # Parse JSON + try: + data = json.loads(content) + except json.JSONDecodeError as e: + self.errors.append(ValidationError( + str(file_path), + "INVALID_JSON", + f"JSON syntax error: {e.msg} at line {e.lineno}, column {e.colno}" + )) + return + + # Validate structure + self._validate_file_structure(file_path, data) + + except Exception as e: + self.errors.append(ValidationError( + str(file_path), + "FILE_ERROR", + f"Error reading file: {str(e)}" + )) + + def _validate_file_structure(self, file_path: Path, data: Dict): + """Validate the overall structure of a response file.""" + if not data: + self.warnings.append(ValidationError( + str(file_path), + "EMPTY_DATA", + "File contains no request definitions" + )) + return + + # Validate each request key and its responses + for request_key, responses in data.items(): + self._validate_request_key(file_path, request_key) + self._validate_response_structure(file_path, request_key, responses) + + def _validate_request_key(self, file_path: Path, request_key: str): + """Validate request key naming convention.""" + + if not self.request_key_pattern.match(request_key): + self.errors.append(ValidationError( + str(file_path), + "INVALID_KEY_FORMAT", + f"Request key '{request_key}' should follow PascalCase/camelCase pattern", + request_key + )) + + # Check for common issues + if request_key.lower() != request_key and request_key.upper() != request_key: + if '_' in request_key: + self.warnings.append(ValidationError( + str(file_path), + "KEY_STYLE_WARNING", + f"Request key '{request_key}' contains underscores, consider camelCase", + request_key + )) + + def _validate_response_structure(self, file_path: Path, request_key: str, responses: Any): + """Validate the structure of responses for a request key.""" + if not isinstance(responses, dict): + self.errors.append(ValidationError( + str(file_path), + "INVALID_RESPONSES_TYPE", + f"Responses must be an object, got {type(responses).__name__}", + request_key + )) + return + + # Check for required response types + has_success = 'success' in responses + has_error = 'error' in responses + + if not has_success and not has_error: + self.errors.append(ValidationError( + str(file_path), + "MISSING_RESPONSE_TYPES", + "Must have at least 'success' or 'error' responses", + request_key + )) + return + + # Validate each response type + for response_type, response_list in responses.items(): + if response_type not in self.valid_response_types: + self.errors.append(ValidationError( + str(file_path), + "INVALID_RESPONSE_TYPE", + f"Invalid response type '{response_type}', must be 'success' or 'error'", + f"{request_key}.{response_type}" + )) + continue + + self._validate_response_list(file_path, request_key, response_type, response_list) + + def _validate_response_list(self, file_path: Path, request_key: str, response_type: str, response_list: Any): + """Validate a list of responses.""" + if not isinstance(response_list, list): + self.errors.append(ValidationError( + str(file_path), + "INVALID_RESPONSE_LIST", + f"Response list must be an array, got {type(response_list).__name__}", + f"{request_key}.{response_type}" + )) + return + + if not response_list: + self.warnings.append(ValidationError( + str(file_path), + "EMPTY_RESPONSE_LIST", + f"Empty {response_type} response list", + f"{request_key}.{response_type}" + )) + return + + for idx, response in enumerate(response_list): + self._validate_response_item(file_path, request_key, response_type, idx, response) + + def _validate_response_item(self, file_path: Path, request_key: str, response_type: str, idx: int, response: Any): + """Validate a single response item.""" + location = f"{request_key}.{response_type}[{idx}]" + + if not isinstance(response, dict): + self.errors.append(ValidationError( + str(file_path), + "INVALID_RESPONSE_ITEM", + f"Response item must be an object, got {type(response).__name__}", + location + )) + return + + # Check required fields + required_fields = {'title', 'json'} + missing_fields = required_fields - set(response.keys()) + + if missing_fields: + self.errors.append(ValidationError( + str(file_path), + "MISSING_REQUIRED_FIELDS", + f"Missing required fields: {', '.join(missing_fields)}", + location + )) + + # Validate individual fields + if 'title' in response: + self._validate_title_field(file_path, location, response['title']) + + if 'notes' in response: + self._validate_notes_field(file_path, location, response['notes']) + + if 'json' in response: + self._validate_json_field(file_path, location, response['json']) + + def _validate_title_field(self, file_path: Path, location: str, title: Any): + """Validate the title field.""" + if not isinstance(title, str): + self.errors.append(ValidationError( + str(file_path), + "INVALID_TITLE_TYPE", + f"Title must be a string, got {type(title).__name__}", + f"{location}.title" + )) + return + + if not title.strip(): + self.errors.append(ValidationError( + str(file_path), + "EMPTY_TITLE", + "Title cannot be empty", + f"{location}.title" + )) + + def _validate_notes_field(self, file_path: Path, location: str, notes: Any): + """Validate the notes field.""" + if not isinstance(notes, str): + self.errors.append(ValidationError( + str(file_path), + "INVALID_NOTES_TYPE", + f"Notes must be a string, got {type(notes).__name__}", + f"{location}.notes" + )) + + def _validate_json_field(self, file_path: Path, location: str, json_data: Any): + """Validate the json field.""" + if json_data is None: + self.errors.append(ValidationError( + str(file_path), + "NULL_JSON_DATA", + "JSON field cannot be null", + f"{location}.json" + )) + return + + # JSON field should be a valid JSON structure (object, array, etc.) + if not isinstance(json_data, (dict, list, str, int, float, bool)): + self.errors.append(ValidationError( + str(file_path), + "INVALID_JSON_TYPE", + f"JSON field contains invalid type: {type(json_data).__name__}", + f"{location}.json" + )) + + # For API responses, usually expect objects + if isinstance(json_data, dict): + # Common validation for API response format + if 'mmrpc' in json_data: + # V2 API format validation + if json_data.get('mmrpc') != '2.0': + self.warnings.append(ValidationError( + str(file_path), + "UNEXPECTED_MMRPC_VERSION", + f"Expected mmrpc version '2.0', got '{json_data.get('mmrpc')}'", + f"{location}.json.mmrpc" + )) + + def _validate_request_response_alignment(self): + """Validate that requests have corresponding responses and vice versa.""" + # Load request data + requests_by_version = {} + for version in ['legacy', 'v2']: + requests_path = Path(f'src/data/requests/kdf/{version}') + if requests_path.exists(): + requests_by_version[version] = self._load_request_keys(requests_path) + + # Load response data + responses_by_version = {} + for version in ['legacy', 'v2']: + responses_path = Path(f'src/data/responses/kdf/{version}') + if responses_path.exists(): + responses_by_version[version] = self._load_response_keys(responses_path) + + # Compare and report mismatches + for version in ['legacy', 'v2']: + request_keys = requests_by_version.get(version, set()) + response_keys = responses_by_version.get(version, set()) + + # Requests without responses + missing_responses = request_keys - response_keys + for key in missing_responses: + self.warnings.append(ValidationError( + f"src/data/responses/kdf/{version}/", + "MISSING_RESPONSE", + f"Request '{key}' exists but has no corresponding response data", + f"{version}/{key}" + )) + + # Responses without requests + missing_requests = response_keys - request_keys + for key in missing_requests: + self.warnings.append(ValidationError( + f"src/data/requests/kdf/{version}/", + "MISSING_REQUEST", + f"Response '{key}' exists but has no corresponding request data", + f"{version}/{key}" + )) + + def _load_request_keys(self, requests_path: Path) -> set: + """Load all request keys from requests directory.""" + request_keys = set() + try: + for json_file in requests_path.glob('*.json'): + with open(json_file, 'r', encoding='utf-8') as f: + data = json.load(f) + if isinstance(data, dict): + request_keys.update(data.keys()) + except Exception as e: + self.warnings.append(ValidationError( + str(requests_path), + "REQUEST_LOAD_ERROR", + f"Error loading request keys: {str(e)}" + )) + return request_keys + + def _load_response_keys(self, responses_path: Path) -> set: + """Load all response keys from responses directory.""" + response_keys = set() + try: + for json_file in responses_path.glob('*.json'): + with open(json_file, 'r', encoding='utf-8') as f: + data = json.load(f) + if isinstance(data, dict): + response_keys.update(data.keys()) + except Exception as e: + self.warnings.append(ValidationError( + str(responses_path), + "RESPONSE_LOAD_ERROR", + f"Error loading response keys: {str(e)}" + )) + return response_keys + + +def main(): + """Main execution function.""" + parser = argparse.ArgumentParser(description='Validate KDF response JSON files') + parser.add_argument('--verbose', '-v', action='store_true', + help='Show detailed output including warnings') + + args = parser.parse_args() + + # Change to repo root directory + script_dir = Path(__file__).parent + repo_root = script_dir.parent.parent + os.chdir(repo_root) + + print("šŸ” Validating KDF response files...") + print(f"šŸ“‚ Working directory: {os.getcwd()}") + + validator = KdfResponseValidator() + success, errors, warnings = validator.validate_all() + + # Report results + if errors: + print(f"\nāŒ Validation failed with {len(errors)} error(s):") + for error in errors: + print(f" {error}") + + if warnings and args.verbose: + print(f"\nāš ļø {len(warnings)} warning(s):") + for warning in warnings: + print(f" {warning}") + + if validator.fixes_applied: + print(f"\nšŸ”§ Applied {len(validator.fixes_applied)} fix(es):") + for fix in validator.fixes_applied: + print(f" {fix}") + + if success: + if warnings: + print(f"\nāœ… Validation passed with {len(warnings)} warning(s)") + else: + print("\nāœ… All validations passed!") + return 0 + else: + print(f"\nāŒ Validation failed") + return 1 + + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file