diff --git a/docs/.vuepress/atomicDEX-sidebar.js b/docs/.vuepress/atomicDEX-sidebar.js index 72585a75a..dc6a8df08 100644 --- a/docs/.vuepress/atomicDEX-sidebar.js +++ b/docs/.vuepress/atomicDEX-sidebar.js @@ -12,6 +12,10 @@ let atomicDEXsidebar = { "/basic-docs/atomicdex/atomicdex-methods.md", "RPC Methods for AtomicDEX", ], + [ + "/basic-docs/atomicdex/common-structures.md", + "Common structure objects in AtomicDEX", + ], { title: "Setup", collapsable: true, @@ -46,6 +50,10 @@ let atomicDEXsidebar = { "/basic-docs/atomicdex/atomicdex-tutorials/atomicdex-metrics.md", "DEX Metrics", ], + [ + "/basic-docs/atomicdex/atomicdex-tutorials/listing-a-coin-on-atomicdex.md", + "Adding a new coin to the AtomicDEX-API", + ], [ "/basic-docs/atomicdex/atomicdex-tutorials/how-to-become-a-liquidity-provider.md", "How to Become a Liquidity Provider", @@ -362,6 +370,54 @@ let atomicDEXsidebar = { ["/basic-docs/atomicdex-api-20-dev/get_current_mtp.md", "get_current_mtp"] ] }, + { + title: "Lightning", + collapsable: true, + children: [ + { + title: "Enable", + collapsable: true, + children: [ + ["/basic-docs/atomicdex-api-20-dev/task_enable_lightning_init.md", "task_enable_lightning_init"], + ["/basic-docs/atomicdex-api-20-dev/task_enable_lightning_status.md", "task_enable_lightning_status"], + ["/basic-docs/atomicdex-api-20-dev/task_enable_lightning_cancel.md", "task_enable_lightning_cancel"], + ] + }, + { + title: "Channels", + collapsable: true, + children: [ + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_get_channel_details.md", "get_channel_details"], + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_update_channel.md", "update_channel"], + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_open_channel.md", "open_channel"], + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_get_claimable_balances.md", "get_claimable_balances"], + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_list_closed_channels_by_filter.md", "list_closed_channels_by_filter"], + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_list_open_channels_by_filter.md", "list_open_channels_by_filter"], + ["/basic-docs/atomicdex-api-20-dev/lightning_channels_close_channel.md", "close_channel"] + ] + }, + { + title: "Nodes", + collapsable: true, + children: [ + ["/basic-docs/atomicdex-api-20-dev/lightning_nodes_add_trusted_node.md", "add_trusted_node"], + ["/basic-docs/atomicdex-api-20-dev/lightning_nodes_remove_trusted_node.md", "remove_trusted_node"], + ["/basic-docs/atomicdex-api-20-dev/lightning_nodes_list_trusted_nodes.md", "list_trusted_nodes"], + ["/basic-docs/atomicdex-api-20-dev/lightning_nodes_connect_to_node.md", "connect_to_node"], + ] + }, + { + title: "Payments", + collapsable: true, + children: [ + ["/basic-docs/atomicdex-api-20-dev/lightning_payments_generate_invoice.md", "generate_invoice"], + ["/basic-docs/atomicdex-api-20-dev/lightning_payments_get_payment_details.md", "get_payments_details"], + ["/basic-docs/atomicdex-api-20-dev/lightning_payments_list_payments_by_filter.md", "list_payments_by_filter"], + ["/basic-docs/atomicdex-api-20-dev/lightning_payments_send_payment.md", "send_payment"] + ] + } + ] + }, { title: "HD Wallet Tasks", collapsable: true, diff --git a/docs/.vuepress/public/apis/gecko_api.png b/docs/.vuepress/public/apis/gecko_api.png new file mode 100644 index 000000000..0f6d29868 Binary files /dev/null and b/docs/.vuepress/public/apis/gecko_api.png differ diff --git a/docs/.vuepress/public/apis/nomics_api.png b/docs/.vuepress/public/apis/nomics_api.png new file mode 100644 index 000000000..b646b489c Binary files /dev/null and b/docs/.vuepress/public/apis/nomics_api.png differ diff --git a/docs/.vuepress/public/apis/paprika_api.png b/docs/.vuepress/public/apis/paprika_api.png new file mode 100644 index 000000000..ff450b28f Binary files /dev/null and b/docs/.vuepress/public/apis/paprika_api.png differ diff --git a/docs/.vuepress/public/apis/qtum.png b/docs/.vuepress/public/apis/qtum.png new file mode 100644 index 000000000..f973ff4ff Binary files /dev/null and b/docs/.vuepress/public/apis/qtum.png differ diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_close_channel.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_close_channel.md new file mode 100644 index 000000000..9ab533d59 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_close_channel.md @@ -0,0 +1,22 @@ +### lightning\:\:channels\:\:close_channel + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | +| rpc_channel_id | integer | Channel ID you would like to see the details of | +| force_close | boolean | Optional, defaults to `false`. If `true`, will force closing the channel | + + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::channels::close_channel", + "params": { + "coin": "tBTC-TEST-lightning", + "rpc_channel_id": 1, + "force_close": false + }, + "id": 8 +} +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_get_channel_details.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_get_channel_details.md new file mode 100644 index 000000000..a0cda88ca --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_get_channel_details.md @@ -0,0 +1,21 @@ +### lightning\:\:channels\:\:get_channel_details + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | +| rpc_channel_id | integer | Channel ID you would like to see the details of | + + + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::get_channel_details", + "params": { + "coin": "tBTC-TEST-lightning", + "rpc_channel_id": 1 + }, + "id": 54 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_get_claimable_balances.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_get_claimable_balances.md new file mode 100644 index 000000000..c49c02e89 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_get_claimable_balances.md @@ -0,0 +1,20 @@ +### lightning\:\:channels\:\:get_claimable_balances + +| Parameter | Type | Description | +|--------------------------------|---------|-------------| +| coin | string | A coin ticker | +| include_open_channels_balances | boolean | `true` to include balances from open channels, `false` if not | + + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::get_claimable_balances", + "params": { + "coin": "tBTC-TEST-lightning", + "include_open_channels_balances": false + }, + "id": 762 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_list_closed_channels_by_filter.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_list_closed_channels_by_filter.md new file mode 100644 index 000000000..26ff66370 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_list_closed_channels_by_filter.md @@ -0,0 +1,80 @@ +### lightning\:\:channels\:\:list_closed_channels_by_filter + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | The ticker of the coin you would like to view closed channels for | +| filter | object | [Lightning closed channels filter](/basic-docs/atomicdex/common-structures.html#Lightning_closed_channel_filter) (optional) | +| limit | string | Max number of records to return (optional) | + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::list_closed_channels_by_filter", + "params": { + "coin": "tBTC-TEST-lightning" + }, + "id": 55 +} +``` + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::list_closed_channels_by_filter", + "params": { + "coin": "tBTC-TEST-lightning", + "filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value": null, + "to_funding_value": null, + "closing_tx": null, + "closure_reason": null, + "claiming_tx": null, + "from_claimed_balance": null, + "to_claimed_balance": null, + "channel_type": null, + "channel_visibility": null + }, + "limit": 10, + "paging_options": { + "PageNumber": 1 + } + }, + "id": 55 +} + +``` + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::list_closed_channels_by_filter", + "params": { + "coin": "tBTC-TEST-lightning", + "filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value": null, + "to_funding_value": null, + "closing_tx": null, + "closure_reason": null, + "claiming_tx": null, + "from_claimed_balance": null, + "to_claimed_balance": null, + "channel_type": null, + "channel_visibility": null + }, + "limit": 10, + "paging_options": { + "FromId": 4 + } + }, + "id": 55 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_list_open_channels_by_filter.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_list_open_channels_by_filter.md new file mode 100644 index 000000000..f1c73b90d --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_list_open_channels_by_filter.md @@ -0,0 +1,84 @@ +### lightning\:\:channels\:\:list_open_channels_by_filter + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | The ticker of the coin you would like to view closed channels for | +| filter | object | [Lightning open channels filter](/basic-docs/atomicdex/common-structures.html#Lightning_open_channels_filter) (optional) | +| limit | string | Max number of records to return (optional) | + + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::list_open_channels_by_filter", + "params": { + "coin": "tBTC-TEST-lightning" + }, + "id": 55 +} +``` + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::list_open_channels_by_filter", + "params": { + "coin": "tBTC-TEST-lightning", + "filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value_sats": null, + "to_funding_value_sats": null, + "is_outbound": null, + "from_balance_msat": null, + "to_balance_msat": null, + "from_outbound_capacity_msat": null, + "to_outbound_capacity_msat": null, + "from_inbound_capacity_msat": null, + "to_inbound_capacity_msat": null, + "confirmed": null, + "is_usable": null, + "is_public": null + }, + "limit": 10, + "paging_options": { + "PageNumber": 1 + } + }, + "id": 55 +} + +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::channels::list_open_channels_by_filter", + "params": { + "coin": "tBTC-TEST-lightning", + "filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value_sats": null, + "to_funding_value_sats": null, + "is_outbound": null, + "from_balance_msat": null, + "to_balance_msat": null, + "from_outbound_capacity_msat": null, + "to_outbound_capacity_msat": null, + "from_inbound_capacity_msat": null, + "to_inbound_capacity_msat": null, + "confirmed": null, + "is_usable": null, + "is_public": null + }, + "limit": 10, + "paging_options": { + "FromId": 4 + } + }, + "id": 55 +} +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_open_channel.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_open_channel.md new file mode 100644 index 000000000..f1942334f --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_open_channel.md @@ -0,0 +1,34 @@ + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::channels::open_channel", + "params": { + "coin": "tBTC-TEST-lightning", + "node_address": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9@203.132.94.196:9735", + "amount": { + "type": "Exact", // Accepted values: "Exact", "Max" + "value": 0.004 // Required only if: "type": "Exact" + } + // "push_msat": 0, + // "channel_options": { + // // "proportional_fee_in_millionths_sats": 0, // Default: Coin Config + // // "base_fee_msat": 1000, // Default: Coin Config + // // "cltv_expiry_delta": 72, // Default: Coin Config + // // "max_dust_htlc_exposure_msat": 5000000, // Default: Coin Config + // // "force_close_avoidance_max_fee_satoshis": 1000 // Default: Coin Config + // }, + // "channel_configs" : { + // // "counterparty_locktime": 144, // Default: Coin Config + // // "our_htlc_minimum_msat": 1, // Default: Coin Config + // // "negotiate_scid_privacy": false, // Default: Coin Config + // // "max_inbound_in_flight_htlc_percent": 10, // Default: Coin Config + // // "announced_channel": false, // Default: Coin Config + // // "commit_upfront_shutdown_pubkey": true // Default: Coin Config + // } + } + // "id": null // Accepted values: Integers +} + +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_update_channel.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_update_channel.md new file mode 100644 index 000000000..48af0f164 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_channels_update_channel.md @@ -0,0 +1,21 @@ + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::channels::update_channel", + "params": { + "coin": "tBTC-TEST-lightning", + "rpc_channel_id": 1, + "channel_options": { + // "proportional_fee_in_millionths_sats": 0, // Default: Coin Config + // "base_fee_msat": 1000, // Default: Coin Config + // "cltv_expiry_delta": 72, // Default: Coin Config + // "max_dust_htlc_exposure_msat": 5000000, // Default: Coin Config + // "force_close_avoidance_max_fee_satoshis": 1000 // Default: Coin Config + } + }, + "id": 1 +} + +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_add_trusted_node.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_add_trusted_node.md new file mode 100644 index 000000000..cc381ae8d --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_add_trusted_node.md @@ -0,0 +1,20 @@ +### lightning\:\:nodes\:\:add_trusted_node + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | +| node_id | string | ID of node you would like to add to your trusted list | + + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::nodes::add_trusted_node", + "params": { + "coin": "tBTC-TEST-lightning", + "node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9" + }, + "id": 56 +} +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_connect_to_node.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_connect_to_node.md new file mode 100644 index 000000000..511fc82a2 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_connect_to_node.md @@ -0,0 +1,19 @@ +#### connect\:\:to\:\:node + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | +| node_address | string | URI to a lighning node | + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::nodes::connect_to_node", + "params": { + "coin": "tBTC-TEST-lightning", + "node_address": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9@203.132.94.196:9735" + }, + "id": 1 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_list_trusted_nodes.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_list_trusted_nodes.md new file mode 100644 index 000000000..a0d33100c --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_list_trusted_nodes.md @@ -0,0 +1,17 @@ +### lightning\:\:nodes\:\:list_trusted_nodes + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::nodes::list_trusted_nodes", + "params": { + "coin": "tBTC-TEST-lightning" + }, + "id": 1 +} +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_remove_trusted_node.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_remove_trusted_node.md new file mode 100644 index 000000000..201056a80 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_nodes_remove_trusted_node.md @@ -0,0 +1,19 @@ +### lightning\:\:nodes\:\:remove_trusted_node + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | +| node_id | string | ID of node you would like to remove to your trusted list | + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::nodes::remove_trusted_node", + "params": { + "coin": "tBTC-TEST-lightning", + "node_id": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9" + }, + "id": 1 +} +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_generate_invoice.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_generate_invoice.md new file mode 100644 index 000000000..d4a7080d8 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_generate_invoice.md @@ -0,0 +1,39 @@ +### lightning\:\:payments\:\:generate_invoice + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | Ticker of coin | +| description | object | Description of the invoice | +| amount_in_msat | integer | Max number of records to return (optional) | +| expiry | integer | Epoch timestamp of expiry (optional) | + + + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::payments::generate_invoice", + "params": { + "coin": "tBTC-TEST-lightning", + "description": "test invoice" + }, + "id": 56 +} + +``` + +```json +{ + "userpass": "userpass", + "mmrpc": "2.0", + "method": "lightning::payments::generate_invoice", + "params": { + "coin": "tBTC-TEST-lightning", + "description": "test invoice", + "amount_in_msat": null, + "expiry": null + }, + "id": 56 +} +``` diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_get_payment_details.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_get_payment_details.md new file mode 100644 index 000000000..83d2778b3 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_get_payment_details.md @@ -0,0 +1,19 @@ +### lightning\:\:payments\:\:get_payment_details + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| coin | string | A coin ticker | +| payment_hash | string | The payment hash you would like to view the details for | + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::payments::get_payment_details", + "params": { + "coin": "tBTC-TEST-lightning", + "payment_hash": "32f996e6e0aa88e567318beeadb37b6bc0fddfd3660d4a87726f308ed1ec7b33" + }, + "id": 1 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_list_payments_by_filter.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_list_payments_by_filter.md new file mode 100644 index 000000000..3c7ba1f0d --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_list_payments_by_filter.md @@ -0,0 +1,34 @@ + + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::payments::list_payments_by_filter", + "params": { + "coin": "tBTC-TEST-lightning" + // "filter": null, + // // "filter": { + // // // "payment_type": null, + // // // // "payment_type": { + // // // // "type": "Outbound Payment", // Accepted values: "Outbound Payment", "Inbound Payment" + // // // // "destination": "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134" // Required only if: "type": "Outbound Payment" + // // // // }, + // // // "description": null, // Accepted values: Strings + // // // "status": null, // Accepted values: "pending", "succeeded", "failed" + // // // "from_amount_msat": null, // Accepted values: Integers + // // // "to_amount_msat": null, // Accepted values: Integers + // // // "from_fee_paid_msat": null, // Accepted values: Integers + // // // "to_fee_paid_msat": null, // Accepted values: Integers + // // // "from_timestamp": null, // Accepted values: Integers + // // // "to_timestamp": null // Accepted values: Integers + // // }, + // "limit": 10, + // "paging_options": { + // "PageNumber": 1 + // // "FromId": "d6d3cf3fd5237ed15295847befe00da67c043da1c39a373bff30bd22442eea43" // used instead of: "PageNumber" + // } + } + // "id": null // Accepted values: Integers +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_send_payment.md b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_send_payment.md new file mode 100644 index 000000000..f924de92f --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/lightning_payments_send_payment.md @@ -0,0 +1,26 @@ +### lightning\:\:payments\:\:send_payment + +| Parameter | Type | Description | +|------------|---------|-------------| +| coin | string | A coin ticker | +| payment | object | [Lightning payment object](/basic-docs/atomicdex/common-structures.html#Lightning_payment) | + + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "lightning::payments::send_payment", + "params": { + "coin": "tBTC-TEST-lightning", + "payment": { + "type": "invoice", // Accepted values: "invoice", "keysend" + "invoice": "lntb20u1p32wwxapp5p8gjy2e79jku5tshhq2nkdauv0malqqhzefnqmx9pjwa8h83cmwqdp8xys9xcmpd3sjqsmgd9czq3njv9c8qatrvd5kumcxqrrsscqp79qy9qsqsp5m473qknpecv6ajmwwtjw7keggrwxerymehx6723avhdrlnxmuvhs54zmyrumkasvjp0fvvk2np30cx5xpjs329alvm60rwy3payrnkmsd3n8ahnky3kuxaraa3u4k453yf3age7cszdxhjxjkennpt75erqpsfmy4y" // Required only if: "type": "invoice" + // "destination": "038863cf8ab91046230f561cd5b386cbff8309fa02e3f0c3ed161a3aeb64a643b9", // Required only if: "type": "keysend" + // "amount_in_msat": 1000, // Required only if: "type": "keysend" + // "expiry": 24 // Required only if: "type": "keysend" + } + } + // "id": null // Accepted values: Integers +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_cancel.md b/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_cancel.md new file mode 100644 index 000000000..868340731 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_cancel.md @@ -0,0 +1,17 @@ +### task\:\:enable_lightning\:\:cancel + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| task_id | integer | The task id returned from [task::enable_lightning::init](/basic-docs/atomicdex-api-20-dev/lighting-tasks.html#task_enable_lightning_init) | + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "task::enable_lightning::cancel", + "params": { + "task_id": 0 + }, + "id": 1 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_init.md b/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_init.md new file mode 100644 index 000000000..75ed0f967 --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_init.md @@ -0,0 +1,44 @@ +### task\:\:enable_lightning\:\:init + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| name | string | a name for your channel? | +| listening port | integer | Port listening for broadcasts (optional) | +| color | string | no idea (optional) | +| backup_path | string | no idea (optional) | + + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "task::enable_lightning::init", + "params": { + "ticker": "tBTC-TEST-lightning", + "activation_params": { + "name": "Mm2TestNode" + } + }, + "id": 2 +} + +``` + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "task::enable_lightning::init", + "params": { + "ticker": "tBTC-TEST-lightning", + "activation_params": { + "name": "Mm2TestNode", + "listening_port": 9735, + "color": "000000", + "payment_retries": 5, + "backup_path": null + } + }, + "id": 2 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_status.md b/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_status.md new file mode 100644 index 000000000..6754f833f --- /dev/null +++ b/docs/basic-docs/atomicdex-api-20-dev/task_enable_lightning_status.md @@ -0,0 +1,19 @@ +### task\:\:enable\_lightning\:\:status + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| task_id | integer | The task id returned from [task::enable_lightning::init](/basic-docs/atomicdex-api-20-dev/lighting-tasks.html#task_enable_lightning_init) | +| forget_if_finished | boolean | Optional, defaults to `true`. If `false`, task_is status will still be available after the task has completed | + +```json +{ + "userpass": "{{userpass}}", + "mmrpc": "2.0", + "method": "task::enable_lightning::status", + "params": { + "task_id": 0, + "forget_if_finished": true + }, + "id": 2 +} +``` \ No newline at end of file diff --git a/docs/basic-docs/atomicdex-api-20-dev/withdraw_tasks.md b/docs/basic-docs/atomicdex-api-20-dev/withdraw_tasks.md index 57282b4b0..7e8c0902d 100644 --- a/docs/basic-docs/atomicdex-api-20-dev/withdraw_tasks.md +++ b/docs/basic-docs/atomicdex-api-20-dev/withdraw_tasks.md @@ -412,11 +412,7 @@ curl --url "http://127.0.0.1:7783" --data " \"method\": \"task::withdraw::cancel\", \"mmrpc\": \"2.0\", \"params\": { -<<<<<<< HEAD \"task_id\": 6 -======= - \"task_id\": TASK_ID ->>>>>>> master } }" echo diff --git a/docs/basic-docs/atomicdex/common-structures.md b/docs/basic-docs/atomicdex/common-structures.md new file mode 100644 index 000000000..480897381 --- /dev/null +++ b/docs/basic-docs/atomicdex/common-structures.md @@ -0,0 +1,125 @@ +## Lightning\_close\_channels\_filter + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| channel_id | string | | +| counterparty_node_id | string | | +| funding_tx | string | | +| from_funding_value | integer | | +| to_funding_value | integer | | +| closing_tx | string | | +| closure_reason | string | | +| claiming_tx | string | | +| from_claimed_balance | decimal | | +| to_claimed_balance | decimal | | +| channel_type | string | Accepted values: "Outbound", "Inbound" | +| channel_visibility | string | Accepted values: "Public", "Private" | + + +```json +"filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value": null, + "to_funding_value": null, + "closing_tx": null, + "closure_reason": null, + "claiming_tx": null, + "from_claimed_balance": null, + "to_claimed_balance": null, + "channel_type": null, + "channel_visibility": null +} +``` + +## Lightning\_open\_channels\_filter + +| Parameter | Type | Description | +|----------------------|---------|-------------| +| channel_id | string | | +| counterparty_node_id | string | | +| funding_tx | string | | +| from_funding_value | integer | | +| to_funding_value | integer | | +| closing_tx | string | | +| closure_reason | string | | +| claiming_tx | string | | +| from_claimed_balance | decimal | | +| to_claimed_balance | decimal | | +| channel_type | string | Accepted values: "Outbound", "Inbound" | +| channel_visibility | string | Accepted values: "Public", "Private" | + + +```json +"filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value_sats": null, + "to_funding_value_sats": null, + "is_outbound": null, + "from_balance_msat": null, + "to_balance_msat": null, + "from_outbound_capacity_msat": null, + "to_outbound_capacity_msat": null, + "from_inbound_capacity_msat": null, + "to_inbound_capacity_msat": null, + "confirmed": null, + "is_usable": null, + "is_public": null +} +``` + +## Lightning\_payment + +| Parameter | Type | Description | +|------------------|---------|-------------| +| type | string | Accepted values: `invoice` or `keysend` | +| invoice | string | Required if `invoice`. uniue string representing an invoice. Use [lightning::payments::get_payment_details](/basic-docs/atomicdex/lightning_payments_get_payment_details.html) for more information | +| destination | integer | Required if `keysend`. Destination pubkey to send funds to | +| amount_in_msat | integer | Required if `keysend`. Amount to sent in millisats | +| expiry | integer | Required if `keysend`. Timestamp for expiry of payment broadcast | + + +```json +"filter": { + "channel_id": null, + "counterparty_node_id": null, + "funding_tx": null, + "from_funding_value_sats": null, + "to_funding_value_sats": null, + "is_outbound": null, + "from_balance_msat": null, + "to_balance_msat": null, + "from_outbound_capacity_msat": null, + "to_outbound_capacity_msat": null, + "from_inbound_capacity_msat": null, + "to_inbound_capacity_msat": null, + "confirmed": null, + "is_usable": null, + "is_public": null +} +``` + +## Paging Options + +| Parameter | Type | Description | +|------------|---------|---------------------------------| +| PageNumber | integer | Offset for paginated results | +| FromId | integer | Ignore results priod to this Id | + +Use either value, not both. + +```json +{ + "PageNumber": 1 +} +``` + +```json +{ + "FromId": 4 +} +``` + diff --git a/utils/parse_postman.py b/utils/parse_postman.py new file mode 100755 index 000000000..205a9dfc8 --- /dev/null +++ b/utils/parse_postman.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 +import os +import sys +import json + +'''Use with grep to get method. In future we might be able to auto derive code samples and populate param tables''' + +with open("../postman/collections/mm2_dev.postman_collection.json", 'r') as f: + for line in f.readlines(): + l = line.strip() + if len(l) > 40: + if l.startswith('"raw": "'): + l = l.replace('"raw": "', "")[:-1].replace(r'\r\n', "").replace(r'\"', '"') + print(l)