跳到主要内容

读取Epic钱包状态

Endpoint
http://127.0.0.1:3420/v3/owner
Credential
Token from open_wallet, inside the encrypted envelope. Loopback only
Methods here
8
Documented against
node 4.0.3, wallet 4.0.0

The balance breakdown, and whether it was validated against the node.

Surface
/v3/owner on port 3420
Parameters
3 named
Declared in
api/src/owner_rpc_s.rs:452
  • Returns a two-element array, not an object: [validated_against_node, WalletInfo]. It is the only method on this surface shaped that way.
  • Every amount is a string count of freemen. Parse before doing arithmetic and divide by 100,000,000 for EPIC.
Parameters

Session token. Every method on this surface needs it.

Ask the node before answering. False returns the last known state.

Confirmations before an output counts as spendable. Use 3 on usernet.

10 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "retrieve_summary_info",
  "params": {
    "token": "<token from open_wallet>",
    "refresh_from_node": true,
    "minimum_confirmations": 10
  }
}
Response13 lines
[
  true,
  {
    "amount_awaiting_confirmation": "0",
    "amount_awaiting_finalization": "0",
    "amount_currently_spendable": "0",
    "amount_immature": "0",
    "amount_locked": "0",
    "last_confirmed_height": "1439",
    "minimum_confirmations": "3",
    "total": "0"
  }
]

The outputs this wallet knows about, paged.

Surface
/v3/owner on port 3420
Parameters
7 named
Declared in
api/src/owner_rpc_s.rs:253
  • Returns an object with a pager, not a bare array.
  • The paging fields are optional. With no limit, a large wallet returns every record in one response.
Parameters

Session token. Every method on this surface needs it.

Include already-spent outputs.

Refresh against the node first.

Restrict to one transaction log id.

Page size. Omitting it returns everything.

Page offset.

asc or desc.

14 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "retrieve_outputs",
  "params": {
    "token": "<token from open_wallet>",
    "include_spent": false,
    "refresh_from_node": true,
    "tx_id": null,
    "limit": 10,
    "offset": 0,
    "sort_order": "desc"
  }
}
Response11 lines
{
  "outputs": [],
  "pager": {
    "limit": 10,
    "offset": 0,
    "records_read": 0,
    "sort_order": "desc",
    "total_records": 0
  },
  "refresh_from_node": true
}

retrieve_txs

Read only

The transaction log, paged.

Surface
/v3/owner on port 3420
Parameters
7 named
Declared in
api/src/owner_rpc_s.rs:385
  • The counterparty address is populated only for epicbox transfers. File and HTTP leave it empty, so the log alone cannot tell you who paid you.
  • fee is an Option and is not set on received transactions.
Parameters

Session token. Every method on this surface needs it.

Refresh against the node first.

One log id.

One slate uuid.

Page size.

Page offset.

asc or desc.

14 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "retrieve_txs",
  "params": {
    "token": "<token from open_wallet>",
    "refresh_from_node": true,
    "tx_id": null,
    "tx_slate_id": null,
    "limit": 10,
    "offset": 0,
    "sort_order": "desc"
  }
}
Response11 lines
{
  "pager": {
    "limit": 10,
    "offset": 0,
    "records_read": 0,
    "sort_order": "desc",
    "total_records": 0
  },
  "refresh_from_node": true,
  "txs": []
}

node_height

Read only

The height the wallet believes the chain is at, and whether the node answered.

Surface
/v3/owner on port 3420
Parameters
1 named
Declared in
api/src/owner_rpc_s.rs:1441
  • updated_from_node false means the wallet could not reach the node and is reporting its last known height.
  • height is a string, like every other u64 on this surface.
Parameters

Session token. Every method on this surface needs it.

8 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "node_height",
  "params": {
    "token": "<token from open_wallet>"
  }
}
Response5 lines
{
  "header_hash": "9abbd80483f9b082a9362ebac0aba5619bdba7cf647cb15f5ed33102faf3cd1b",
  "height": "1439",
  "updated_from_node": true
}

The epicbox address for a derivation index.

Surface
/v3/owner on port 3420
Parameters
2 named
Declared in
api/src/owner_rpc_s.rs:1995
  • derivation_index is required, not optional. Pass 0 explicitly.
  • Every derivation uses index 0, so a wallet has one epicbox address.
Parameters

Session token. Every method on this surface needs it.

Which index to derive. Only 0 is meaningful today.

9 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_public_address",
  "params": {
    "token": "<token from open_wallet>",
    "derivation_index": 0
  }
}
Response5 lines
{
  "domain": "epicbox.epiccash.com",
  "port": 443,
  "public_key": "esXWittbitgGAF91Hzgh25kH4sfeQWDXm2dNuq3Wc9ARS27ZE14X"
}

The payment proof address for a derivation index.

Surface
/v3/owner on port 3420
Parameters
2 named
Declared in
api/src/owner_rpc_s.rs:2033
  • Returns a bare hex string rather than an object.
Parameters

Session token. Every method on this surface needs it.

Which index to derive.

9 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_public_proof_address",
  "params": {
    "token": "<token from open_wallet>",
    "derivation_index": 0
  }
}
Response1 lines
"15c54be15016d08852f8254e0489b3365057efb32cfdc44bf34cdd9423504d4f"

get_stored_tx

Read only

The stored transaction object for a log entry, if one was kept.

Surface
/v3/owner on port 3420
Parameters
3 named
Declared in
api/src/owner_rpc_s.rs:1282
  • This is what makes reposting a transaction possible, and it lives in saved_txs on disk.
Parameters

Session token. Every method on this surface needs it.

Transaction log id.

Slate uuid.

10 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_stored_tx",
  "params": {
    "token": "<token from open_wallet>",
    "id": null,
    "slate_id": null
  }
}
Response
N/A

Recent messages from the background updater thread.

Surface
/v3/owner on port 3420
Parameters
1 named
Declared in
api/src/owner_rpc_s.rs:1957
  • Each message is an externally tagged enum, so the variant name is the key. Useful for showing scan progress in a UI.
Parameters

How many messages to return.

8 lines
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "get_updater_messages",
  "params": {
    "count": 3
  }
}
Response14 lines
[
  {
    "Scanning": [
      "Starting UTXO scan",
      0
    ]
  },
  {
    "UpdatingTransactions": "Updating transactions"
  },
  {
    "UpdatingOutputs": "Updating outputs from node"
  }
]

下一页