diff --git a/cmd/loop/testdata/sessions/AGENTS.md b/cmd/loop/testdata/sessions/AGENTS.md index d5d131ef..d4b27293 100644 --- a/cmd/loop/testdata/sessions/AGENTS.md +++ b/cmd/loop/testdata/sessions/AGENTS.md @@ -70,6 +70,7 @@ Base URL: `http://127.0.0.1:12345` | `misc/` | `loop terms` | | `quote/` | `loop quote out` (success + verbose), `loop quote in` (help + verbose), `loop quote out` (help), `loop quote in` (deposit_outpoint success), `loop quote in` (positional + last_hop) | | `static/` | `loop static withdraw` (no selection error), `loop static withdraw` (invalid utxo), `loop static withdraw` (all success), `loop static withdraw` (utxo + dest_addr success), `loop static listwithdrawals`, `loop static listswaps` | +| `static-autoloop/` | `loop setparams --loopinsource static-address` (success + no-experimental error), `loop getparams` (static-address loop-in source), `loop suggestswaps` (static loop-in suggestion) | | `static-loop-in/` | `loop static new`, `loop static` (help), `loop static listunspent` (incl alias), `loop static listdeposits`, `loop static summary`, `loop static in` (multiple args/flags cases), `loop static in` (duplicate outpoints), `loop static in` (positional low amount error), `loop static in` (positional + last_hop + payment_timeout), `loop static in` (all cancel) | | `static-filters/` | `loop static listdeposits --filter ...` for each state (deposited/withdrawing/withdrawn/looping_in/looped_in/publish_expired_deposit/sweep_htlc_timeout/htlc_timeout_swept/wait_for_expiry_sweep/expired/failed) | | `swaps/` | `loop listswaps` (success + conflicting filters + loop_out_only filters + loop_in_only), `loop swapinfo` (success + invalid id + id flag errors), `loop abandonswap` (help + invalid id + success) | diff --git a/cmd/loop/testdata/sessions/static-autoloop/01_loop-setparams-static-address.json b/cmd/loop/testdata/sessions/static-autoloop/01_loop-setparams-static-address.json new file mode 100644 index 00000000..d98c19a2 --- /dev/null +++ b/cmd/loop/testdata/sessions/static-autoloop/01_loop-setparams-static-address.json @@ -0,0 +1,151 @@ +{ + "metadata": { + "args": [ + "/home/user/bin/loop", + "setparams", + "--network", + "regtest", + "--loopinsource", + "static-address", + "--minamt", + "250000", + "--maxamt", + "1000000", + "--feepercent", + "5", + "--autoloop", + "--autobudget", + "50000", + "--autoinflight", + "1" + ], + "version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13", + "duration": 32231921, + "clock_start_unix": 1779406641 + }, + "events": [ + { + "time_ms": 10, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/GetLiquidityParams", + "event": "request", + "message_type": "looprpc.GetLiquidityParamsRequest", + "payload": {} + } + }, + { + "time_ms": 16, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/GetLiquidityParams", + "event": "response", + "message_type": "looprpc.LiquidityParameters", + "payload": { + "rules": [ + { + "channel_id": "0", + "swap_type": "LOOP_IN", + "pubkey": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl", + "type": "THRESHOLD", + "incoming_threshold": 0, + "outgoing_threshold": 60 + } + ], + "fee_ppm": "50000", + "sweep_fee_rate_sat_per_vbyte": "0", + "max_swap_fee_ppm": "0", + "max_routing_fee_ppm": "0", + "max_prepay_routing_fee_ppm": "0", + "max_prepay_sat": "0", + "max_miner_fee_sat": "0", + "sweep_conf_target": 100, + "failure_backoff_sec": "86400", + "autoloop": true, + "autoloop_budget_sat": "50000", + "autoloop_budget_start_sec": "0", + "auto_max_in_flight": "1", + "min_swap_amount": "250000", + "max_swap_amount": "1000000", + "htlc_conf_target": 6, + "autoloop_dest_address": "", + "autoloop_budget_refresh_period_sec": "604800", + "autoloop_budget_last_refresh": "1779405910", + "easy_autoloop": false, + "easy_autoloop_local_target_sat": "0", + "account": "", + "account_addr_type": "ADDRESS_TYPE_UNKNOWN", + "easy_asset_params": {}, + "fast_swap_publication": true, + "easy_autoloop_excluded_peers": [], + "loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS" + } + } + }, + { + "time_ms": 18, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/SetLiquidityParams", + "event": "request", + "message_type": "looprpc.SetLiquidityParamsRequest", + "payload": { + "parameters": { + "rules": [ + { + "channel_id": "0", + "swap_type": "LOOP_IN", + "pubkey": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl", + "type": "THRESHOLD", + "incoming_threshold": 0, + "outgoing_threshold": 60 + } + ], + "fee_ppm": "50000", + "sweep_fee_rate_sat_per_vbyte": "0", + "max_swap_fee_ppm": "0", + "max_routing_fee_ppm": "0", + "max_prepay_routing_fee_ppm": "0", + "max_prepay_sat": "0", + "max_miner_fee_sat": "0", + "sweep_conf_target": 100, + "failure_backoff_sec": "86400", + "autoloop": true, + "autoloop_budget_sat": "50000", + "autoloop_budget_start_sec": "0", + "auto_max_in_flight": "1", + "min_swap_amount": "250000", + "max_swap_amount": "1000000", + "htlc_conf_target": 6, + "autoloop_dest_address": "", + "autoloop_budget_refresh_period_sec": "604800", + "autoloop_budget_last_refresh": "1779405910", + "easy_autoloop": false, + "easy_autoloop_local_target_sat": "0", + "account": "", + "account_addr_type": "ADDRESS_TYPE_UNKNOWN", + "easy_asset_params": {}, + "fast_swap_publication": true, + "easy_autoloop_excluded_peers": [], + "loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS" + } + } + } + }, + { + "time_ms": 31, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/SetLiquidityParams", + "event": "response", + "message_type": "looprpc.SetLiquidityParamsResponse", + "payload": {} + } + }, + { + "time_ms": 32, + "kind": "exit", + "data": {} + } + ] +} diff --git a/cmd/loop/testdata/sessions/static-autoloop/02_loop-getparams-static-address.json b/cmd/loop/testdata/sessions/static-autoloop/02_loop-getparams-static-address.json new file mode 100644 index 00000000..5eaec13e --- /dev/null +++ b/cmd/loop/testdata/sessions/static-autoloop/02_loop-getparams-static-address.json @@ -0,0 +1,125 @@ +{ + "metadata": { + "args": [ + "/home/user/bin/loop", + "getparams", + "--network", + "regtest" + ], + "version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13", + "duration": 12324887, + "clock_start_unix": 1779406647 + }, + "events": [ + { + "time_ms": 1, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/GetLiquidityParams", + "event": "request", + "message_type": "looprpc.GetLiquidityParamsRequest", + "payload": {} + } + }, + { + "time_ms": 5, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/GetLiquidityParams", + "event": "response", + "message_type": "looprpc.LiquidityParameters", + "payload": { + "rules": [ + { + "channel_id": "0", + "swap_type": "LOOP_IN", + "pubkey": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl", + "type": "THRESHOLD", + "incoming_threshold": 0, + "outgoing_threshold": 60 + } + ], + "fee_ppm": "50000", + "sweep_fee_rate_sat_per_vbyte": "0", + "max_swap_fee_ppm": "0", + "max_routing_fee_ppm": "0", + "max_prepay_routing_fee_ppm": "0", + "max_prepay_sat": "0", + "max_miner_fee_sat": "0", + "sweep_conf_target": 100, + "failure_backoff_sec": "86400", + "autoloop": true, + "autoloop_budget_sat": "50000", + "autoloop_budget_start_sec": "0", + "auto_max_in_flight": "1", + "min_swap_amount": "250000", + "max_swap_amount": "1000000", + "htlc_conf_target": 6, + "autoloop_dest_address": "", + "autoloop_budget_refresh_period_sec": "604800", + "autoloop_budget_last_refresh": "1779405910", + "easy_autoloop": false, + "easy_autoloop_local_target_sat": "0", + "account": "", + "account_addr_type": "ADDRESS_TYPE_UNKNOWN", + "easy_asset_params": {}, + "fast_swap_publication": true, + "easy_autoloop_excluded_peers": [], + "loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS" + } + } + }, + { + "time_ms": 12, + "kind": "stdout", + "data": { + "lines": [ + "{\n", + " \"account\": \"\",\n", + " \"account_addr_type\": \"ADDRESS_TYPE_UNKNOWN\",\n", + " \"auto_max_in_flight\": \"1\",\n", + " \"autoloop\": true,\n", + " \"autoloop_budget_last_refresh\": \"1779405910\",\n", + " \"autoloop_budget_refresh_period_sec\": \"604800\",\n", + " \"autoloop_budget_sat\": \"50000\",\n", + " \"autoloop_budget_start_sec\": \"0\",\n", + " \"autoloop_dest_address\": \"\",\n", + " \"easy_asset_params\": {},\n", + " \"easy_autoloop\": false,\n", + " \"easy_autoloop_excluded_peers\": [],\n", + " \"easy_autoloop_local_target_sat\": \"0\",\n", + " \"failure_backoff_sec\": \"86400\",\n", + " \"fast_swap_publication\": true,\n", + " \"fee_ppm\": \"50000\",\n", + " \"htlc_conf_target\": 6,\n", + " \"loop_in_source\": \"LOOP_IN_SOURCE_STATIC_ADDRESS\",\n", + " \"max_miner_fee_sat\": \"0\",\n", + " \"max_prepay_routing_fee_ppm\": \"0\",\n", + " \"max_prepay_sat\": \"0\",\n", + " \"max_routing_fee_ppm\": \"0\",\n", + " \"max_swap_amount\": \"1000000\",\n", + " \"max_swap_fee_ppm\": \"0\",\n", + " \"min_swap_amount\": \"250000\",\n", + " \"rules\": [\n", + " {\n", + " \"channel_id\": \"0\",\n", + " \"incoming_threshold\": 0,\n", + " \"outgoing_threshold\": 60,\n", + " \"pubkey\": \"0203789efa712e0938ef53a5dbf0f6046509f65fc53a5bfc7511dc67febea1a165\",\n", + " \"swap_type\": \"LOOP_IN\",\n", + " \"type\": \"THRESHOLD\"\n", + " }\n", + " ],\n", + " \"sweep_conf_target\": 100,\n", + " \"sweep_fee_rate_sat_per_vbyte\": \"0\"\n", + "}\n" + ] + } + }, + { + "time_ms": 12, + "kind": "exit", + "data": {} + } + ] +} diff --git a/cmd/loop/testdata/sessions/static-autoloop/03_loop-suggestswaps-static-loop-in.json b/cmd/loop/testdata/sessions/static-autoloop/03_loop-suggestswaps-static-loop-in.json new file mode 100644 index 00000000..d61584e0 --- /dev/null +++ b/cmd/loop/testdata/sessions/static-autoloop/03_loop-suggestswaps-static-loop-in.json @@ -0,0 +1,101 @@ +{ + "metadata": { + "args": [ + "/home/user/bin/loop", + "suggestswaps", + "--network", + "regtest" + ], + "version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13", + "duration": 44264819, + "clock_start_unix": 1779406653 + }, + "events": [ + { + "time_ms": 1, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/SuggestSwaps", + "event": "request", + "message_type": "looprpc.SuggestSwapsRequest", + "payload": {} + } + }, + { + "time_ms": 43, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/SuggestSwaps", + "event": "response", + "message_type": "looprpc.SuggestSwapsResponse", + "payload": { + "loop_out": [], + "loop_in": [], + "static_loop_in": [ + { + "outpoints": [ + "9cfb0ec5ab2c851b4db5fe372cc3573f4074c436e50b13d2b7d214e45571def9:1" + ], + "max_swap_fee_satoshis": "1828", + "last_hop": "AgN4nvpxLgk471Ol2/D2BGUJ9l/FOlv8dRHcZ/6+oaFl", + "label": "[reserved]: autoloop-in", + "initiator": "autoloop", + "route_hints": [], + "private": false, + "payment_timeout_seconds": 0, + "amount": "500000", + "fast": false + } + ], + "disqualified": [ + { + "channel_id": "127543348887552", + "pubkey": "", + "reason": "AUTO_REASON_CUSTOM_CHANNEL_DATA" + } + ] + } + } + }, + { + "time_ms": 43, + "kind": "stdout", + "data": { + "lines": [ + "{\n", + " \"disqualified\": [\n", + " {\n", + " \"channel_id\": \"127543348887552\",\n", + " \"pubkey\": \"\",\n", + " \"reason\": \"AUTO_REASON_CUSTOM_CHANNEL_DATA\"\n", + " }\n", + " ],\n", + " \"loop_in\": [],\n", + " \"loop_out\": [],\n", + " \"static_loop_in\": [\n", + " {\n", + " \"amount\": \"500000\",\n", + " \"fast\": false,\n", + " \"initiator\": \"autoloop\",\n", + " \"label\": \"[reserved]: autoloop-in\",\n", + " \"last_hop\": \"0203789efa712e0938ef53a5dbf0f6046509f65fc53a5bfc7511dc67febea1a165\",\n", + " \"max_swap_fee_satoshis\": \"1828\",\n", + " \"outpoints\": [\n", + " \"9cfb0ec5ab2c851b4db5fe372cc3573f4074c436e50b13d2b7d214e45571def9:1\"\n", + " ],\n", + " \"payment_timeout_seconds\": 0,\n", + " \"private\": false,\n", + " \"route_hints\": []\n", + " }\n", + " ]\n", + "}\n" + ] + } + }, + { + "time_ms": 44, + "kind": "exit", + "data": {} + } + ] +} diff --git a/cmd/loop/testdata/sessions/static-autoloop/04_loop-setparams-static-address-no-experimental.json b/cmd/loop/testdata/sessions/static-autoloop/04_loop-setparams-static-address-no-experimental.json new file mode 100644 index 00000000..bf22bc72 --- /dev/null +++ b/cmd/loop/testdata/sessions/static-autoloop/04_loop-setparams-static-address-no-experimental.json @@ -0,0 +1,137 @@ +{ + "metadata": { + "args": [ + "/home/user/bin/loop", + "setparams", + "--network", + "regtest", + "--loopinsource", + "static-address" + ], + "version": "0.33.0-beta commit=v0.33.0-beta-74-g6a3c3e1df5f807b450d3ba663f4824f6588e1c13 commit_hash=6a3c3e1df5f807b450d3ba663f4824f6588e1c13", + "run_error": "rpc error: code = FailedPrecondition desc = static address autoloop requires --experimental", + "duration": 12501068, + "clock_start_unix": 1779406912 + }, + "events": [ + { + "time_ms": 4, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/GetLiquidityParams", + "event": "request", + "message_type": "looprpc.GetLiquidityParamsRequest", + "payload": {} + } + }, + { + "time_ms": 11, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/GetLiquidityParams", + "event": "response", + "message_type": "looprpc.LiquidityParameters", + "payload": { + "rules": [], + "fee_ppm": "20000", + "sweep_fee_rate_sat_per_vbyte": "0", + "max_swap_fee_ppm": "0", + "max_routing_fee_ppm": "0", + "max_prepay_routing_fee_ppm": "0", + "max_prepay_sat": "0", + "max_miner_fee_sat": "0", + "sweep_conf_target": 100, + "failure_backoff_sec": "86400", + "autoloop": false, + "autoloop_budget_sat": "335544", + "autoloop_budget_start_sec": "0", + "auto_max_in_flight": "1", + "min_swap_amount": "0", + "max_swap_amount": "0", + "htlc_conf_target": 6, + "autoloop_dest_address": "", + "autoloop_budget_refresh_period_sec": "604800", + "autoloop_budget_last_refresh": "1779406903", + "easy_autoloop": false, + "easy_autoloop_local_target_sat": "0", + "account": "", + "account_addr_type": "ADDRESS_TYPE_UNKNOWN", + "easy_asset_params": {}, + "fast_swap_publication": true, + "easy_autoloop_excluded_peers": [], + "loop_in_source": "LOOP_IN_SOURCE_WALLET" + } + } + }, + { + "time_ms": 11, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/SetLiquidityParams", + "event": "request", + "message_type": "looprpc.SetLiquidityParamsRequest", + "payload": { + "parameters": { + "rules": [], + "fee_ppm": "20000", + "sweep_fee_rate_sat_per_vbyte": "0", + "max_swap_fee_ppm": "0", + "max_routing_fee_ppm": "0", + "max_prepay_routing_fee_ppm": "0", + "max_prepay_sat": "0", + "max_miner_fee_sat": "0", + "sweep_conf_target": 100, + "failure_backoff_sec": "86400", + "autoloop": false, + "autoloop_budget_sat": "335544", + "autoloop_budget_start_sec": "0", + "auto_max_in_flight": "1", + "min_swap_amount": "0", + "max_swap_amount": "0", + "htlc_conf_target": 6, + "autoloop_dest_address": "", + "autoloop_budget_refresh_period_sec": "604800", + "autoloop_budget_last_refresh": "1779406903", + "easy_autoloop": false, + "easy_autoloop_local_target_sat": "0", + "account": "", + "account_addr_type": "ADDRESS_TYPE_UNKNOWN", + "easy_asset_params": {}, + "fast_swap_publication": true, + "easy_autoloop_excluded_peers": [], + "loop_in_source": "LOOP_IN_SOURCE_STATIC_ADDRESS" + } + } + } + }, + { + "time_ms": 12, + "kind": "grpc", + "data": { + "method": "/looprpc.SwapClient/SetLiquidityParams", + "event": "error", + "error": "rpc error: code = FailedPrecondition desc = static address autoloop requires --experimental", + "status": { + "code": 9, + "message": "static address autoloop requires --experimental" + } + } + }, + { + "time_ms": 12, + "kind": "stderr", + "data": { + "lines": [ + "[loop] rpc error: code = FailedPrecondition desc = static address autoloop requires --experimental\n" + ] + } + }, + { + "time_ms": 12, + "kind": "exit", + "data": { + "run_error": "rpc error: code = FailedPrecondition desc = static address autoloop requires --experimental" + } + } + ] +}