Сессия кошелька и аккаунты
- Endpoint
http://127.0.0.1:3420/v3/owner- Credential
- Token from open_wallet, inside the encrypted envelope. Loopback only
- Methods here
- 10
- Documented against
- node 4.0.3, wallet 4.0.0
init_secure_api
Read onlyExchange public keys and establish the shared secret for the encrypted envelope.
- Surface
/v3/owneron port 3420- Parameters
- 1 named
- Declared in
- api/src/owner_rpc_s.rs:1495
- The only call on this surface that is not encrypted, because it is what sets encryption up.
- The shared secret is the raw x coordinate of the resulting point, 32 bytes, not hashed. It is used directly as the AES-256 key.
{
"jsonrpc": "2.0",
"id": 1,
"method": "init_secure_api",
"params": {
"ecdh_pubkey": "<your compressed secp256k1 public key, hex>"
}
}N/Aopen_wallet
Read onlyUnlock the wallet with its password and receive the session token.
Takes the wallet password. Everything that can spend is gated behind the token this returns, so treat the token as a credential with the same weight.
- Surface
/v3/owneron port 3420- Parameters
- 2 named
- Declared in
- api/src/owner_rpc_s.rs:1720
{
"jsonrpc": "2.0",
"id": 1,
"method": "open_wallet",
"params": {
"name": null,
"password": "<wallet password>"
}
}N/Aclose_wallet
Read onlyClose the wallet and invalidate its token.
- Surface
/v3/owneron port 3420- Parameters
- 1 named
- Declared in
- api/src/owner_rpc_s.rs:1753
{
"jsonrpc": "2.0",
"id": 1,
"method": "close_wallet",
"params": {
"name": null
}
}N/Aaccounts
Read onlyEvery account label in this wallet, with its derivation path.
- Surface
/v3/owneron port 3420- Parameters
- 1 named
- Declared in
- api/src/owner_rpc_s.rs:78
- Each account is one BIP32 derivation path inside the wallet seed. The path identifier is one depth byte followed by four big-endian child indices.
- A label this method does not return resolves to the active account when passed as src_acct_name or dest_acct_name.
{
"jsonrpc": "2.0",
"id": 1,
"method": "accounts",
"params": {
"token": "<token from open_wallet>"
}
}[
{
"label": "default",
"path": "0200000000000000000000000000000000"
}
]create_account_path
Read onlyCreate a new account label.
- Surface
/v3/owneron port 3420- Parameters
- 2 named
- Declared in
- api/src/owner_rpc_s.rs:111
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_account_path",
"params": {
"token": "<token from open_wallet>",
"label": "savings"
}
}N/Aset_active_account
Read onlyChoose which account later calls draw from and credit.
- Surface
/v3/owneron port 3420- Parameters
- 2 named
- Declared in
- api/src/owner_rpc_s.rs:144
- The active account is state on the wallet instance, shared by every token the listener serves, and it is not written to disk. A restarted listener starts on default unless epic-wallet was given -a.
- To choose an account for one call without changing the active one, pass src_acct_name in InitTxArgs or dest_acct_name to the Foreign API.
{
"jsonrpc": "2.0",
"id": 1,
"method": "set_active_account",
"params": {
"token": "<token from open_wallet>",
"label": "default"
}
}N/Acreate_config
Read onlyWrite a wallet configuration file for a chain type.
- Surface
/v3/owneron port 3420- Parameters
- 5 named
- Declared in
- api/src/owner_rpc_s.rs:1637
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_config",
"params": {
"chain_type": "Mainnet",
"wallet_config": null,
"logging_config": null,
"tor_config": null,
"epicbox_config": null
}
}N/Acreate_wallet
Changes stateCreate a new wallet, or restore one from a recovery phrase.
Refuses to run if a seed file already exists, so it cannot silently overwrite a wallet. Move the existing wallet aside first if you mean to replace it.
- Surface
/v3/owneron port 3420- Parameters
- 4 named
- Declared in
- api/src/owner_rpc_s.rs:1680
{
"jsonrpc": "2.0",
"id": 1,
"method": "create_wallet",
"params": {
"name": null,
"mnemonic": null,
"mnemonic_length": 24,
"password": "<new password>"
}
}N/Aget_top_level_directory
Read onlyWhere the wallet keeps its data.
- Surface
/v3/owneron port 3420- Parameters
- none
- Declared in
- api/src/owner_rpc_s.rs:1527
This method takes no parameters.
{
"jsonrpc": "2.0",
"id": 1,
"method": "get_top_level_directory",
"params": {}
}N/Aset_top_level_directory
Read onlyPoint the wallet at a different data directory.
Changes which wallet later calls act on. Combined with a relocated directory it also changes which node secret resolves, which is the usual cause of an unexpected 401.
- Surface
/v3/owneron port 3420- Parameters
- 1 named
- Declared in
- api/src/owner_rpc_s.rs:1560
{
"jsonrpc": "2.0",
"id": 1,
"method": "set_top_level_directory",
"params": {
"dir": "/home/you/wallets/bob"
}
}N/A