Service Methods
- Table of Methods
- Protobuf
The Wallet Account Service has the following methods:
syntax = "proto3";
package meshtrade.wallet.account.v1;
import "meshtrade/iam/role/v1/role.proto";
import "meshtrade/option/v1/method_type.proto";
import "meshtrade/type/v1/ledger.proto";
import "meshtrade/wallet/account/v1/account.proto";
option go_package = "github.com/meshtrade/api/go/wallet/account/v1;accountv1";
option java_package = "co.meshtrade.api.wallet.account.v1";
/*
AccountService provides access to and management of wallet accounts.
*/
service AccountService {
/*
Creates a new wallet account.
This is a write operation restricted to administrative roles.
*/
rpc CreateAccount(CreateAccountRequest) returns (meshtrade.wallet.account.v1.Account) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_WRITE;
option (meshtrade.iam.role.v1.roles) = {
roles: [ROLE_WALLET_ADMIN]
};
}
/*
Retrieves a single wallet account by its unique number.
*/
rpc GetAccount(GetAccountRequest) returns (meshtrade.wallet.account.v1.Account) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_READ;
option (meshtrade.iam.role.v1.roles) = {
roles: [
ROLE_WALLET_ADMIN,
ROLE_WALLET_VIEWER
]
};
}
/*
Retrieves a list of all accounts for the authenticated principal.
*/
rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_READ;
option (meshtrade.iam.role.v1.roles) = {
roles: [
ROLE_WALLET_ADMIN,
ROLE_WALLET_VIEWER
]
};
}
/*
Searches for accounts based on a partial label match.
*/
rpc SearchAccounts(SearchAccountsRequest) returns (SearchAccountsResponse) {
option (meshtrade.option.v1.method_type) = METHOD_TYPE_READ;
option (meshtrade.iam.role.v1.roles) = {
roles: [
ROLE_WALLET_ADMIN,
ROLE_WALLET_VIEWER
]
};
}
}
/* CreateAccountRequest contains the parameters for creating a new account. */
message CreateAccountRequest {
/*
A user-defined label for the new account, e.g., "Primary Savings".
*/
string label = 1;
/*
The ledger upon which the account should be created.
*/
meshtrade.type.v1.Ledger ledger = 2;
/*
If true, the account will be opened immediately after creation, which
may result in a transaction.
*/
bool open = 3;
}
/* GetAccountRequest specifies which account to retrieve. */
message GetAccountRequest {
/*
The unique account number to retrieve.
*/
string number = 1;
}
/* ListAccountsRequest requires no parameters to list accounts for the caller. */
message ListAccountsRequest {}
/* ListAccountsResponse contains a list of accounts. */
message ListAccountsResponse {
/*
A list of accounts owned by the authenticated principal.
*/
repeated meshtrade.wallet.account.v1.Account accounts = 1;
}
/* SearchAccountsRequest specifies the query for finding accounts. */
message SearchAccountsRequest {
/*
A substring to search for within account labels.
*/
string label = 1;
}
/* SearchAccountsResponse contains the accounts that matched the search query. */
message SearchAccountsResponse {
/*
A list of accounts that matched the label search query.
*/
repeated meshtrade.wallet.account.v1.Account accounts = 1;
}