syntax = "proto3"; import "google/protobuf/empty.proto"; import "sdk/model/model.proto"; import "sdk/transaction/transaction.proto"; import "arcadius2/rbac.proto"; import "arcadius2/api.proto"; package m10.sdk; service M10TxService { rpc CreateTransaction(RequestEnvelope) returns (m10.sdk.transaction.TransactionResponse) {} } service M10QueryService { // Transfers rpc GetTransfer(RequestEnvelope) returns (m10.sdk.transaction.FinalizedTransfer) {} rpc ListTransfers(RequestEnvelope) returns (m10.sdk.transaction.FinalizedTransfers) {} // Request to observe all transfers processed by the M10 ledger // Param: [`RequestEnvelope`] should contain [`ObserveAccountsRequest`] rpc ObserveTransfers(RequestEnvelope) returns (stream FinalizedTransactions); // Accounts rpc GetIndexedAccount(RequestEnvelope) returns (m10.sdk.transaction.IndexedAccount) {} rpc GetAccount(RequestEnvelope) returns (m10.sdk.model.Account); rpc GetAccountInfo(RequestEnvelope) returns (m10.sdk.model.AccountInfo); rpc ListAccounts(RequestEnvelope) returns (m10.sdk.ListAccountsResponse); // Request to observe all account changes processed by the M10 ledger // Param: [`RequestEnvelope`] should contain [`ObserveAccountsRequest`] rpc ObserveAccounts(RequestEnvelope) returns (stream FinalizedTransactions); // Actions rpc GetAction(RequestEnvelope) returns (m10.sdk.transaction.Action) {} rpc ListActions(RequestEnvelope) returns (m10.sdk.transaction.Actions) {} // Request to observe all actions processed by the M10 ledger // Param: [`RequestEnvelope`] should contain [`ObserveActionsRequest`] rpc ObserveActions(RequestEnvelope) returns (stream FinalizedTransactions) {} // ChainInfo rpc GetChainInfo(google.protobuf.Empty) returns (ChainInfo) {} // Transactions // Request a specific transaction by ID // Param: [`RequestEnvelope`] should contain [`GetTransactionsRequest`] rpc GetTransaction(RequestEnvelope) returns (FinalizedTransaction) {} // Request to list all transactions by context ID // Param: [`RequestEnvelope`] should contain [`ListTransactionsRequest`] rpc ListTransactions(RequestEnvelope) returns (FinalizedTransactions) {} // Request to group all transactions related to a specific account by context // ID Param: [`RequestEnvelope`] should contain [`GroupTransactionsRequest`] rpc GroupTransactions(RequestEnvelope) returns (GroupedFinalizedTransactions) {} // AccountSet rpc GetAccountSet(RequestEnvelope) returns (m10.sdk.model.AccountSet); rpc ListAccountSets(RequestEnvelope) returns (m10.sdk.ListAccountSetsResponse); // RoleBinding rpc GetRoleBinding(RequestEnvelope) returns (m10.arcadius2.RoleBinding); rpc ListRoleBindings(RequestEnvelope) returns (m10.sdk.ListRoleBindingsResponse); // RoleBinding rpc GetRole(RequestEnvelope) returns (m10.arcadius2.Role); rpc ListRoles(RequestEnvelope) returns (m10.sdk.ListRolesResponse); // Resources // Request to observe all resources processed by the M10 ledger // Param: [`RequestEnvelope`] should contain [`ObserveResourcesRequest`] rpc ObserveResources(RequestEnvelope) returns (stream FinalizedTransactions); } message RequestEnvelope { bytes payload = 2; Signature signature = 3; } message Signature { bytes public_key = 2; bytes signature = 3; Algorithm algorithm = 4; enum Algorithm { P256_SHA256_ASN1 = 0; ED25519 = 1; } } message Page { uint32 limit = 1; bytes last_id = 2; } message GetAccountSetRequest { bytes id = 1; } message ListAccountSetsRequest { oneof filter { bytes owner = 1; string name = 2; } Page page = 4; } message ListAccountSetsResponse { repeated m10.sdk.model.AccountSet account_sets = 1; ListAccountSetsRequest next_request = 2; } message ListAccountsRequest { oneof filter { bytes owner = 1; } Page page = 4; } message ListAccountsResponse { repeated m10.sdk.model.Account accounts = 1; ListAccountsRequest next_request = 2; } message GetRoleBindingRequest { bytes id = 1; } message ListRoleBindingsRequest { oneof filter { string name = 1; } Page page = 4; } message ListRoleBindingsResponse { repeated m10.arcadius2.RoleBinding role_bindings = 1; ListRoleBindingsRequest next_request = 2; } message GetRoleRequest { bytes id = 1; } message ListRolesRequest { oneof filter { string name = 1; } Page page = 4; } message ListRolesResponse { repeated m10.arcadius2.Role roles = 1; ListRolesRequest next_request = 2; } message GetTransactionRequest { uint64 tx_id = 1; } message ListTransactionsRequest { // Filters transactions by context ID bytes context_id = 1; uint64 limit = 3; uint64 min_tx_id = 4; // default = maximum possible tx id uint64 max_tx_id = 5; } message GroupTransactionsRequest { // Filter by account ID bytes account_id = 1; uint64 limit_groups = 2; uint64 min_tx_id = 3; // default = maximum possible tx id uint64 max_tx_id = 4; } message ObserveAccountsRequest { // Start observing from this transaction ID // If empty, only live transfers will be observed TxId starting_from = 1; // Yields transfers which involve these account IDs repeated bytes involved_accounts = 2; } message ObserveResourcesRequest { // Request resources matching the provided filter m10.arcadius2.Exp expression = 1; // The resource collection to observe string collection = 2; // Request transfers starting from the following transaction ID // Note: If empty, only stream live resource changes TxId starting_from = 3; } message TxId { uint64 tx_id = 1; } message ObserveActionsRequest { // Request actions starting from the following transaction ID // Note: If empty, only stream live transfers TxId starting_from = 1; // Name of the action to observe string name = 2; // Request actions invoked involving these account IDs repeated bytes involves_accounts = 3; } message FinalizedTransaction { m10.sdk.transaction.TransactionRequestPayload request = 1; m10.sdk.transaction.TransactionResponse response = 2; } message FinalizedTransactions { repeated FinalizedTransaction transactions = 1; } message GroupedFinalizedTransactions { repeated FinalizedTransactions groups = 1; } message ChainInfo { uint64 block_height = 1; }