Bitcoin Forum
November 06, 2025, 05:09:42 AM *
News: Pumpkin carving contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Submarine swaps via JSON-RPC API?  (Read 37 times)
electrumiyut (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 04, 2025, 04:09:06 AM
 #1

How can one automate doing submarine swaps via the JSON-RPC API? I am writing a liquidity helper script for Bitcart (similar to BTCPay Server) that uses an electrum wallet under the hood.

I see there is get_submarine_swap_providers(), but when I try to run this command on my wallet I get

Error: RPC Error: {'code': -32601, 'message': 'Procedure not found'}

I can run it in the console fine in my other electrum wallets.

Does it have to be enabled somehow? Or is this just not supported in the JSON-RPC API? I don't have GUI access to the wallet running underneath bitcart, just JSON-RPC access.
nc50lc
Legendary
*
Online Online

Activity: 2954
Merit: 7840


Self-proclaimed Genius


View Profile
November 04, 2025, 08:57:09 AM
 #2

I can run it in the console fine in my other electrum wallets.
That RPC command "get_submarine_swap_providers()" was only added recently in the latest version 4.6.2.
Is the Electrum backend that you're using updated to the latest version?

You can check it in the release notes, here: github.com/spesmilo/electrum/blob/master/RELEASE-NOTES


electrumiyut (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 05, 2025, 01:05:50 AM
 #3

Aah yes, that would be the reason  Grin

I'll work to get us updated to the newest version

In the GUI, one must enable nostr. In the API, is there anything I need to do before running get_submarine_swap_providers()?
nc50lc
Legendary
*
Online Online

Activity: 2954
Merit: 7840


Self-proclaimed Genius


View Profile
November 05, 2025, 04:15:03 AM
 #4

-snip- is there anything I need to do before running get_submarine_swap_providers()?
The command just requires a loaded wallet,
Nostr should be enabled by default and loaded with pre-configured Nostr relays where those swap providers are queried from.

And for the dependencies, if you're running from python source; your secp256k1 should be compiled with schnorrsig module enabled.
Else, the daemon will run but the command wont work.

electrumiyut (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
November 05, 2025, 01:53:34 PM
 #5

Great thanks for all the help!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!