syntax = "proto3"; import "arcadius2/api.proto"; import "google/protobuf/any.proto"; package m10.sdk.transaction; // Decoded `LedgerRequest.payload` message data for requests related to // transactions and ledger state. message TransactionRequestPayload { // block window + nonce used for replay protection uint64 nonce = 1; uint64 after_height = 2; uint64 before_height = 3; // [optional] unique Context ID, allowing linking of multiple requests bytes context_id = 5; // Request payload data. oneof data { CreateTransfer transfer = 10; CreateLedgerAccount create_ledger_account = 11; SetFreezeState set_freeze_state = 12; m10.arcadius2.DocumentOperations document_operations = 16; InvokeAction invoke_action = 20; CreateTransfer initiate_transfer = 21; CommitTransfer commit_transfer = 22; } } message TransactionResponse { uint64 tx_id = 1; TransactionError error = 2; fixed64 timestamp = 4; // Responses bytes account_created = 3; CreateTransfer transfer_committed = 5; } message TransactionError { Code code = 1; string message = 2; enum Code { // Generic status codes UNKNOWN = 0; UNIMPLEMENTED = 1; NOT_FOUND = 2; ALREADY_EXISTS = 3; UNAUTHORIZED = 4; // User request is malformed BAD_REQUEST = 5; // Invalid/unsupported transaction request type INVALID_REQUEST_TYPE = 6; // Invalid account ID bytes in request INVALID_ACCOUNT_ID = 7; // Invalid transfer parameters (amount, accounts, etc) INVALID_TRANSFER = 8; // The request message was too large to be processed. MESSAGE_TOO_LARGE = 10; // The request signature does not match the request payload INVALID_SIGNATURE = 11; // Verification-specific status codes VERIFICATION_FAILED = 12; // Replay protection was triggered, e.g. nonce reuse, bad block window REPLAY_PROTECTION = 20; // Arcadius/RBAC-specific status codes INVALID_EXPRESSION = 21; INCORRECT_TYPE = 22; // Ledger-specific status codes ACCOUNT_FROZEN = 23; UNMODIFIED_STATE = 24; INSUFFICIENT_BALANCE = 25; BALANCE_OVERFLOW = 26; ACCOUNT_DEPTH_EXCEEDED = 27; // Action specific status codes INVALID_TARGET = 30; } } message CreateLedgerTransfer { string ledger_id = 1; uint64 nonce = 2; CreateTransfer transfer = 3; } message CreateLedgerTransfers { // List of ledger targeted transfers that are part of the contract repeated CreateLedgerTransfer transfers = 1; // UTC timestamp defining the end date of the contract // Interpret as microseconds since the UNIX_EPOCH uint64 valid_until = 2; } message GetTransferRequest { uint64 tx_id = 1; } // Transfers are returned in descending order from max_tx_id to min_tx_id message ListTransferRequest { oneof filter { bytes account_id = 1; bytes context_id = 2; } uint64 limit = 4; bool include_child_accounts = 5; uint64 min_tx_id = 6; // default = maximum possible tx id uint64 max_tx_id = 7; } message CreateTransfer { repeated TransferStep transfer_steps = 1; } message TransferStep { bytes from_account_id = 1; bytes to_account_id = 2; uint64 amount = 4; repeated google.protobuf.Any metadata = 7; } message FinalizedTransfer { uint64 tx_id = 1; bytes context_id = 2; repeated TransferStep transfer_steps = 3; TransactionError error = 4; fixed64 timestamp = 5; TransferState state = 7; enum TransferState { ACCEPTED = 0; REJECTED = 1; PENDING = 2; EXPIRED = 3; } } message FinalizedTransfers { repeated FinalizedTransfer transfers = 1; } message CreateLedgerAccount { bytes parent_id = 1; bool issuance = 2; bool frozen = 3; } message SetFreezeState { bytes account_id = 1; bool frozen = 2; } message GetAccountRequest { bytes id = 1; } message IndexedAccount { bytes id = 1; Issuance issuance = 3; uint64 balance = 4; bool frozen = 5; message Issuance { uint64 issued_balance = 1; uint64 non_leaf_children = 2; uint64 leaf_children = 3; } } // Invokes a registered action by sending an opaque payload to a Target message InvokeAction { // Unique name of the action to invoke string name = 1; // Invoking account ID bytes from_account = 3; // Specifies the identity/identities who have permission to see & be notified of the invoked action Target target = 4; // Opaque payload bytes payload = 5; } message Target { oneof target { // Account ID bytes account_id = 1; // Any Account // google.protobuf.Empty any_account = 2; } } message Action { uint64 tx_id = 1; // Unique name of the action to invoke string name = 2; // [optional] unique Context ID, allowing linking of multiple requests bytes context_id = 3; // Invoking account ID bytes from_account = 4; // Specifies the identity/identities who have permission to see & be notified of the invoked action Target target = 5; // Opaque payload bytes payload = 6; } message Actions { repeated Action actions = 1; } message GetActionRequest { uint64 tx_id = 1; } message ListActionsRequest { // Name of the action string name = 1; oneof filter { bytes account_id = 2; bytes context_id = 3; } uint64 limit = 4; uint64 min_tx_id = 5; // default = maximum possible tx id uint64 max_tx_id = 6; } message CommitTransfer { uint64 pending_tx_id = 1; // The transaction that contains a pending transfer / transaction enum TransferState { ACCEPTED = 0; REJECTED = 1; } TransferState new_state = 2; }