OXEN wallet RPC

Based on the official OXEN wallet RPC, which is based on its Monero counterpart.

First download OXEN from the official releases and create or import a wallet.

Start Wallet RPC

Start the wallet RPC with:

./oxen-wallet-rpc --daemon-address imaginary.stream:22023 --trusted-daemon --rpc-bind-port 12388 --wallet-file testwallet --password "" --disable-rpc-login

Or specify external binding to make it available remotely:

./oxen-wallet-rpc --daemon-address imaginary.stream:22023 --trusted-daemon --rpc-bind-ip 0.0.0.0 --confirm-external-bind --rpc-bind-port 12388 --wallet-file testwallet --password "" --disable-rpc-login

The --daemon-address can point to a remote node like imaginary.stream:22023, or it can point to a local node. --rpc-bind-port can be any number, so long as it is a vacant port and correctly later referenced. --wallet-file must be the corresponding wallet created along with its password. Alternatively, replace --disable-rpc-login with --rpc-login username:password.

Once the wallet RPC is ready, you can make calls to it, either from commandline or a script / app.

RPC Calls

Here are some common RPC calls to get started.

GET_BALANCE

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0,"address_indices":[0,1]}}' -H 'Content-Type: application/json'

CREATE ACCOUNT

curl -X POST http://localhost:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_account","params":{"label":"test-3 account"}}' -H 'Content-Type: application/json'

CREATE ADDRESS

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":2}}' -H 'Content-Type: application/json'

GET ACCOUNTS - show all the ACCOUNTS

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_accounts"}' -H 'Content-Type: application/json'

GET ADDRESSES - account_index: the account you want addresses for

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address","params":{"account_index":0}}' -H 'Content-Type: application/json'

GET INDEX

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_address_index","params":{"address":"LTzetqvtN15Tzjb8kd2eBM15NyuMeq2b17RckSfdgS5eFtjor7rdEThWaW3WitV3zu8oEarjSHVoP4zJ5xSw8vhY8iUGQ8y"}}' -H 'Content-Type: application/json'

GET INCOMING TRANSFER WITH ID

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"account_index":0,"subaddr_indices":[$index_id]}}' -H 'Content-Type: application/json'

SHOW SEED

curl -X POST http://127.0.0.1:12388/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"query_key","params":{"key_type":"mnemonic"}}' -H 'Content-Type: application/json'

Test Wallet

zeal biology diplomat nabbing cottage stunning jump gorilla wise emotion huts ponies twofold mocked soil scamper magically regular meeting mobile amidst jellyfish firm gleeful ponies

spend key: ed092f17281109a6efe83fa051fd7646c1d621420798d030fd2e3981ee89a30b

view key: bcfdeb7078d7327ab80c32e8f9fe17eeb7d73f09d03e53288a082a3ed7a64a05