Wallet Foreign API
The Foreign API is the side of the wallet other people call. A sender posts a slate to it and gets back a partially signed one, a payer's invoice comes back finalised, and a mining node asks it to build the coinbase output that pays this wallet.
- Endpoint:
http://127.0.0.1:3415/v2/foreign, started withepic-wallet listen - Protocol: JSON-RPC 2.0 over HTTP POST
- Credential: none
- Default bind:
api_listen_interfaceis127.0.0.1andapi_listen_portis 3415 (config/src/types.rs:71)
No credential is possible here, because the counterparty completing a transfer is a stranger who must be able to reach the surface. The default bind is loopback, so a counterparty reaching this wallet over HTTP needs the interface widened or a reverse proxy in front of it, and whatever is in front is the only place access can be restricted. Taking delivery over the epicbox relay instead needs no inbound port at all.
The same six methods are served from the owner listener when owner_api_include_foreign is true
(controller/src/controller.rs:151).
- Endpoint
http://127.0.0.1:3415/v2/foreign- Credential
- None. This is what a counterparty pays you through
- Methods here
- 6
- Documented against
- node 4.0.3, wallet 4.0.0
check_version
Read onlyReport the Foreign API and supported slate versions.
- Surface
/v2/foreignon port 3415- Parameters
- none
- Declared in
- api/src/foreign_rpc.rs:65
This method takes no parameters.
{
"jsonrpc": "2.0",
"id": 1,
"method": "check_version",
"params": []
}N/Abuild_coinbase
Changes stateBuild a coinbase output and kernel for a candidate block.
- Surface
/v2/foreignon port 3415- Parameters
- 1 positional
- Declared in
- api/src/foreign_rpc.rs:116
{
"jsonrpc": "2.0",
"id": 1,
"method": "build_coinbase",
"params": [
{
"fees": 0,
"height": 1,
"key_id": null
}
]
}N/Abuild_foundation
Changes stateBuild the foundation output and kernel for a candidate block.
- Surface
/v2/foreignon port 3415- Parameters
- 1 positional
- Declared in
- api/src/foreign_rpc.rs:119
{
"jsonrpc": "2.0",
"id": 1,
"method": "build_foundation",
"params": [
{
"fees": 0,
"height": 1,
"key_id": null
}
]
}N/Averify_slate_messages
Read onlyVerify message signatures attached to a slate.
- Surface
/v2/foreignon port 3415- Parameters
- 1 positional
- Declared in
- api/src/foreign_rpc.rs:201
{
"jsonrpc": "2.0",
"id": 1,
"method": "verify_slate_messages",
"params": [
{}
]
}N/Areceive_tx
Changes stateAdd the listener wallet output and signature to an incoming slate.
- Surface
/v2/foreignon port 3415- Parameters
- 4 positional
- Declared in
- api/src/foreign_rpc.rs:359
{
"jsonrpc": "2.0",
"id": 1,
"method": "receive_tx",
"params": [
{},
null,
null,
null
]
}N/Afinalize_invoice_tx
Changes stateFinalize an invoice slate after the payer has funded it.
- Surface
/v2/foreignon port 3415- Parameters
- 1 positional
- Declared in
- api/src/foreign_rpc.rs:532
{
"jsonrpc": "2.0",
"id": 1,
"method": "finalize_invoice_tx",
"params": [
{}
]
}N/ASource
api/src/foreign_rpc.rs:65defines the six methodscontroller/src/controller.rs:209is the standalone listenerlibwallet/src/api_impl/foreign.rsfor the implementation behind them