syntax = "proto3"; package code.common.v1; option go_package = "github.com/code-payments/code-protobuf-api/generated/go/common/v1;common"; option java_package = "com.codeinc.gen.common.v1"; option objc_class_prefix = "CPBCommonV1"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "validate/validate.proto"; // AccountType associates a type to an account, which infers how an account is used // within the Code ecosystem. enum AccountType { UNKNOWN = 0; PRIMARY = 1; REMOTE_SEND_GIFT_CARD = 12; SWAP = 14; ASSOCIATED_TOKEN_ACCOUNT = 15; POOL = 16; reserved 2; // Deprecated TEMPORARY_INCOMING reserved 3; // Deprecated TEMPORARY_OUTGOING reserved 4; // Deprecated BUCKET_1_KIN reserved 5; // Deprecated BUCKET_10_KIN reserved 6; // Deprecated BUCKET_100_KIN reserved 7; // Deprecated BUCKET_1_000_KIN reserved 8; // Deprecated BUCKET_10_000_KIN reserved 9; // Deprecated BUCKET_100_000_KIN reserved 10; // Deprecated BUCKET_1_000_000_KIN reserved 11; // Deprecated LEGACY_PRIMARY_2022 reserved 13; // Deprecated RELATIONSHIP } // SolanaAccountId is a raw binary Ed25519 public key for a Solana account message SolanaAccountId { bytes value = 1 [(validate.rules).bytes = { min_len: 32 max_len: 32 }]; } // A Solana address lookup table used in versioned transactions message SolanaAddressLookupTable { common.v1.SolanaAccountId address = 1 [(validate.rules).message.required = true]; repeated common.v1.SolanaAccountId entries = 2 [(validate.rules).repeated = { min_items: 1, max_items: 256, }]; } // Transaction is a raw binary Solana transaction message Transaction { // Maximum size taken from: https://github.com/solana-labs/solana/blob/39b3ac6a8d29e14faa1de73d8b46d390ad41797b/sdk/src/packet.rs#L9-L13 bytes value = 1 [(validate.rules).bytes = { min_len: 1 max_len: 1232 }]; } // Blockhash is a raw binary Solana blockchash message Blockhash { bytes value = 1 [(validate.rules).bytes = { min_len: 32 max_len: 32 }]; } // Signature is a raw binary Ed25519 signature message Signature { bytes value = 1 [(validate.rules).bytes = { min_len: 64 max_len: 64 }]; } // IntentId is a client-side generated ID that maps to an intent to perform actions // on the blockchain fulfilled by the Code sequencer. message IntentId { bytes value = 1 [(validate.rules).bytes = { min_len: 32 max_len: 32 }]; } // SwapId is a client-side generated ID that maps to a swap. message SwapId { bytes value = 1 [(validate.rules).bytes = { min_len: 32 max_len: 32 }]; } // Hash is a raw binary 32 byte hash value message Hash { bytes value = 1 [(validate.rules).bytes = { min_len: 32 max_len: 32 }]; } // UUID is a 16 byte UUID value message UUID { bytes value = 1 [(validate.rules).bytes = { min_len: 16 max_len: 16 }]; } // Request is a generic wrapper for gRPC requests message Request { string version = 1; string service = 2; string method = 3; bytes body = 4; } // Response is a generic wrapper for gRPC responses message Response { Result result = 1; bytes body = 2; string message = 3; enum Result { OK = 0; ERROR = 1; } } message ServerPing { // Timestamp the ping was sent on the stream, for client to get a sense // of potential network latency google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; // The delay server will apply before sending the next ping google.protobuf.Duration ping_delay = 2 [(validate.rules).duration.required = true]; } message ClientPong { // Timestamp the Pong was sent on the stream, for server to get a sense // of potential network latency google.protobuf.Timestamp timestamp = 1 [(validate.rules).timestamp.required = true]; }