Wallet RPC

Wallet RPC helps user manage their wallet, like create, load, recover etc.

RPC list


Create Wallet


rpc create_wallet(RequestCreateWallet) returns (ResponseCreateWallet);

RequestCreateWallet

Name Data Type Default Required
passphrase string
type WalletType
moniker string
message RequestCreateWallet {
  string passphrase = 1;
  WalletType type = 2;
  string moniker = 3;
}
1
2
3
4
5

ResponseCreateWallet

Name Data Type Default Required
code StatusCode
token string
wallet WalletInfo
message ResponseCreateWallet {
  StatusCode code = 1;
  string token = 2;
  WalletInfo wallet = 3;
}
1
2
3
4
5

GRPC example

> {w, t} = ForgeSdk.create_wallet(moniker: "arcblock", passphrase: "abcd1234")
{%ForgeAbi.WalletInfo{
   address: "z11G65tRo2eGFVCjCBj7fdRhVSbzYSUCG6zb",
   pk: <<27, 242, 2, 33, 236, 174, 199, 94, 89, 160, 83, 74, 99, 98, 120, 244,
     175, 191, 238, 13, 40, 166, 132, 18, 33, 247, 25, 236, 166, 101, 115,
     235>>,
   sk: <<231, 135, 155, 9, 108, 84, 181, 233, 21, 193, 84, 69, 212, 138, 24, 89,
     122, 163, 239, 67, 160, 35, 201, 206, 247, 60, 43, 122, 76, 76, 226, 103,
     27, 242, 2, 33, 236, 174, 199, 94, 89, 160, 83, 74, 99, 98, ...>>,
   type: nil
 }, "c8b11353a2b9917d4f32042255b6eb49"}
1
2
3
4
5
6
7
8
9
10
11

GraphQL example

Load Wallet


rpc load_wallet(RequestLoadWallet) returns (ResponseLoadWallet);

RequestLoadWallet

Name Data Type Default Required
address string
passphrase string
message RequestLoadWallet {
  string address = 1;
  string passphrase = 2;
}
1
2
3
4

ResponseLoadWallet

Name Data Type Default Required
code StatusCode
token string
wallet WalletInfo

message ResponseLoadWallet {
  StatusCode code = 1;
  string token = 2;
  WalletInfo wallet = 3;
}
1
2
3
4
5
6

GRPC example

> {w, t} = ForgeSdk.load_wallet(address: "z11G65tRo2eGFVCjCBj7fdRhVSbzYSUCG6zb", passphrase: "abcd1234")
{%ForgeAbi.WalletInfo{
   address: "z11G65tRo2eGFVCjCBj7fdRhVSbzYSUCG6zb",
   pk: <<27, 242, 2, 33, 236, 174, 199, 94, 89, 160, 83, 74, 99, 98, 120, 244,
     175, 191, 238, 13, 40, 166, 132, 18, 33, 247, 25, 236, 166, 101, 115,
     235>>,
   sk: "",
   type: nil
 }, "a804e2c6c4f96fde25c475237f7fbb73"}
1
2
3
4
5
6
7
8
9

GraphQL example

Recover Wallet


rpc recover_wallet(RequestRecoverWallet) returns (ResponseRecoverWallet);

RequestRecoverWallet

Name Data Type Default Required
data bytes
type WalletType
passphrase string
moniker string
message RequestRecoverWallet {
  bytes data = 1;
  WalletType type = 2;
  string passphrase = 3;
  string moniker = 4;
}
1
2
3
4
5
6

ResponseRecoverWallet

Name Data Type Default Required
code StatusCode
token string
wallet WalletInfo
message ResponseRecoverWallet {
  StatusCode code = 1;
  string token = 2;
  WalletInfo wallet = 3;
}
1
2
3
4
5

GRPC example

> ForgeSdk.recover_wallet
1

GraphQL example

List Wallet


rpc list_wallet(RequestListWallet) returns (stream ResponseListWallet);

RequestListWallet

message RequestListWallet {}
1

ResponseListWallet

Name Data Type Default Required
StatusCode code
address string
message ResponseListWallet {
  StatusCode code = 1;
  string address = 2;
}
1
2
3
4

GRPC example

> ForgeSdk.list_wallet()
["z11316Do74hbGsppsVwB4dtguPkaLjuwW7f8", "z114LHvpHPpDe4qnTGpWdPFibXWEMpPokK1R",
 "z114jALcNqbWuxwoFpbWfnu2pe5nBvEuU1W5", "z115LDoHYJsgLrGKauvyF4jaAFqhNDa2Ra76",
 "z11G65tRo2eGFVCjCBj7fdRhVSbzYSUCG6zb", "z11PYpcvZ6JnPnJ9KddmyJ82U1S15LenvWAh"]
1
2
3
4

GraphQL example

Remove Wallet


rpc remove_wallet(RequestRemoveWallet) returns (ResponseRemoveWallet);

RequestRemoveWallet

Name Data Type Default Required
address string
message RequestRemoveWallet { string address = 1; }
1

ResponseRemoveWallet

message ResponseRemoveWallet { StatusCode code = 1; }
1

GRPC example

> ForgeSdk.remove_wallet(ForgeAbi.RequestRemoveWallet.new(address: "z11316Do74hbGsppsVwB4dtguPkaLjuwW7f8"))
:ok
1
2

GraphQL example

Declare Node


rpc declare_node(RequestDeclareNode) returns (ResponseDeclareNode);

RequestDeclareNode

Name Data Type Default Required
validator bool
message RequestDeclareNode { bool validator = 1; }
1

ResponseDeclareNode

Name Data Type Default Required
code StatusCode
wallet WalletInfo
message ResponseDeclareNode {
  StatusCode code = 1;
  WalletInfo wallet = 3;
}
1
2
3
4

GRPC example

GraphQL example

Last Updated: 4/20/2019, 7:55:22 AM