The Full node protocol API is available on all Sui Full nodes.
BalanceChange
BalanceChanges
EffectsFinality
ExecuteTransactionOptions
Field | Type | Label | Description |
---|
effects | bool | optional | Include the sui.types.TransactionEffects message in the response. Defaults to false if not included |
effects_bcs | bool | optional | Include the TransactionEffects formatted as BCS in the response. Defaults to false if not included |
events | bool | optional | Include the sui.types.TransactionEvents message in the response. Defaults to false if not included |
events_bcs | bool | optional | Include the TransactionEvents formatted as BCS in the response. Defaults to false if not included |
balance_changes | bool | optional | Include the BalanceChanges in the response. Defaults to false if not included |
ExecuteTransactionRequest
ExecuteTransactionResponse
FullCheckpointObject
FullCheckpointObjects
FullCheckpointTransaction
GetCheckpointOptions
Field | Type | Label | Description |
---|
summary | bool | optional | Include the sui.types.CheckpointSummary in the response. Defaults to false if not included |
summary_bcs | bool | optional | Include the CheckpointSummary formatted as BCS in the response. Defaults to false if not included |
signature | bool | optional | Include the sui.types.ValidatorAggregatedSignature in the response. Defaults to false if not included |
contents | bool | optional | Include the sui.types.CheckpointContents message in the response. Defaults to false if not included |
contents_bcs | bool | optional | Include the CheckpointContents formatted as BCS in the response. Defaults to false if not included |
GetCheckpointRequest
GetCheckpointResponse
GetCommitteeRequest
Field | Type | Label | Description |
---|
epoch | uint64 | optional | |
GetCommitteeResponse
GetFullCheckpointOptions
Field | Type | Label | Description |
---|
summary | bool | optional | Include the sui.types.CheckpointSummary in the response. Defaults to false if not included |
summary_bcs | bool | optional | Include the CheckpointSummary formatted as BCS in the response. Defaults to false if not included |
signature | bool | optional | Include the sui.types.ValidatorAggregatedSignature in the response. Defaults to false if not included |
contents | bool | optional | Include the sui.types.CheckpointContents message in the response. Defaults to false if not included |
contents_bcs | bool | optional | Include the CheckpointContents formatted as BCS in the response. Defaults to false if not included |
transaction | bool | optional | Include the sui.types.Transaction message in the response. Defaults to false if not included |
transaction_bcs | bool | optional | Include the Transaction formatted as BCS in the response. Defaults to false if not included |
effects | bool | optional | Include the sui.types.TransactionEffects message in the response. Defaults to false if not included |
effects_bcs | bool | optional | Include the TransactionEffects formatted as BCS in the response. Defaults to false if not included |
events | bool | optional | Include the sui.types.TransactionEvents message in the response. Defaults to false if not included |
events_bcs | bool | optional | Include the TransactionEvents formatted as BCS in the response. Defaults to false if not included |
input_objects | bool | optional | Include the input objects for transactions in the response. Defaults to false if not included |
output_objects | bool | optional | Include the output objects for transactions in the response. Defaults to false if not included |
object | bool | optional | Include the sui.types.Object message in the response. Defaults to false if not included |
object_bcs | bool | optional | Include the Object formatted as BCS in the response. Defaults to false if not included |
GetFullCheckpointRequest
GetFullCheckpointResponse
GetNodeInfoRequest
GetNodeInfoResponse
Field | Type | Label | Description |
---|
chain_id | sui.types.Digest | optional | The chain identifier of the chain that this Node is on |
chain | string | optional | Human readable name of the chain that this Node is on |
epoch | uint64 | optional | Current epoch of the Node based on its highest executed checkpoint |
checkpoint_height | uint64 | optional | Checkpoint height of the most recently executed checkpoint |
timestamp | google.protobuf.Timestamp | optional | Unix timestamp of the most recently executed checkpoint |
lowest_available_checkpoint | uint64 | optional | The lowest checkpoint for which checkpoints and transaction data is available |
lowest_available_checkpoint_objects | uint64 | optional | The lowest checkpoint for which object data is available |
software_version | string | optional | |
GetObjectOptions
Field | Type | Label | Description |
---|
object | bool | optional | Include the sui.types.Object message in the response. Defaults to false if not included |
object_bcs | bool | optional | Include the Object formatted as BCS in the response. Defaults to false if not included |
GetObjectRequest
GetObjectResponse
GetTransactionOptions
Field | Type | Label | Description |
---|
transaction | bool | optional | Include the sui.types.Transaction message in the response. Defaults to false if not included |
transaction_bcs | bool | optional | Include the Transaction formatted as BCS in the response. Defaults to false if not included |
signatures | bool | optional | Include the set of sui.types.UserSignature's in the response. Defaults to false if not included |
signatures_bytes | bool | optional | Include the set of UserSignature's encoded as bytes in the response. Defaults to false if not included |
effects | bool | optional | Include the sui.types.TransactionEffects message in the response. Defaults to false if not included |
effects_bcs | bool | optional | Include the TransactionEffects formatted as BCS in the response. Defaults to false if not included |
events | bool | optional | Include the sui.types.TransactionEvents message in the response. Defaults to false if not included |
events_bcs | bool | optional | Include the TransactionEvents formatted as BCS in the response. Defaults to false if not included |
GetTransactionRequest
GetTransactionResponse
UserSignatures
UserSignaturesBytes
Field | Type | Label | Description |
---|
signatures | bytes | repeated | |
NodeService
sui.types.proto
ActiveJwk
Field | Type | Label | Description |
---|
id | JwkId | optional | |
jwk | Jwk | optional | |
epoch | uint64 | optional | |
Address
Field | Type | Label | Description |
---|
address | bytes | optional | |
AddressDeniedForCoinError
Field | Type | Label | Description |
---|
address | Address | optional | |
coin_type | string | optional | |
Argument
AuthenticatorStateExpire
Field | Type | Label | Description |
---|
min_epoch | uint64 | optional | |
authenticator_object_initial_shared_version | uint64 | optional | |
AuthenticatorStateUpdate
Field | Type | Label | Description |
---|
epoch | uint64 | optional | |
round | uint64 | optional | |
new_active_jwks | ActiveJwk | repeated | |
authenticator_object_initial_shared_version | uint64 | optional | |
Bcs
Field | Type | Label | Description |
---|
bcs | bytes | optional | |
Bn254FieldElement
Field | Type | Label | Description |
---|
element | bytes | optional | |
CancelledTransaction
CancelledTransactions
ChangeEpoch
Field | Type | Label | Description |
---|
epoch | uint64 | optional | The next (to become) epoch ID. |
protocol_version | uint64 | optional | The protocol version in effect in the new epoch. |
storage_charge | uint64 | optional | The total amount of gas charged for storage during the epoch. |
computation_charge | uint64 | optional | The total amount of gas charged for computation during the epoch. |
storage_rebate | uint64 | optional | The amount of storage rebate refunded to the txn senders. |
non_refundable_storage_fee | uint64 | optional | The non-refundable storage fee. |
epoch_start_timestamp_ms | uint64 | optional | Unix timestamp when epoch started |
system_packages | SystemPackage | repeated | System packages (specifically framework and move stdlib) that are written before the new epoch starts. This tracks framework upgrades on chain. When executing the ChangeEpoch txn, the validator must write out the modules below. Modules are provided with the version they will be upgraded to, their modules in serialized form (which include their package ID), and a list of their transitive dependencies. |
ChangedObject
CheckpointCommitment
Field | Type | Label | Description |
---|
ecmh_live_object_set | Digest | | |
CheckpointContents
CheckpointContents.V1
CheckpointSummary
CheckpointedTransactionInfo
Field | Type | Label | Description |
---|
transaction | Digest | optional | TransactionDigest |
effects | Digest | optional | EffectsDigest |
signatures | UserSignature | repeated | |
CircomG1
CircomG2
Command
CommandArgumentError
Field | Type | Label | Description |
---|
argument | uint32 | optional | |
type_mismatch | google.protobuf.Empty | | The type of the value does not match the expected type |
invalid_bcs_bytes | google.protobuf.Empty | | The argument cannot be deserialized into a value of the specified type |
invalid_usage_of_pure_argument | google.protobuf.Empty | | The argument cannot be instantiated from raw bytes |
invalid_argument_to_private_entry_function | google.protobuf.Empty | | Invalid argument to private entry function. / Private entry functions cannot take arguments from other Move functions. |
index_out_of_bounds | uint32 | | Out of bounds access to input or results |
secondary_index_out_of_bounds | NestedResult | | Out of bounds access to subresult |
invalid_result_arity | uint32 | | Invalid usage of result. / Expected a single result but found either no return value or multiple. |
invalid_gas_coin_usage | google.protobuf.Empty | | Invalid usage of Gas coin. / The Gas coin can only be used by-value with a TransferObjects command. |
invalid_value_usage | google.protobuf.Empty | | Invalid usage of move value. Mutably borrowed values require unique usage. Immutably borrowed values cannot be taken or borrowed mutably. Taken values cannot be used again. |
invalid_object_by_value | google.protobuf.Empty | | Immutable objects cannot be passed by-value. |
invalid_object_by_mut_ref | google.protobuf.Empty | | Immutable objects cannot be passed by mutable reference, &mut. |
shared_object_operation_not_allowed | google.protobuf.Empty | | Shared object operations such a wrapping, freezing, or converting to owned are not / allowed. |
CongestedObjectsError
Field | Type | Label | Description |
---|
congested_objects | ObjectId | repeated | |
ConsensusCommitPrologue
ConsensusDeterminedVersionAssignments
Digest
Field | Type | Label | Description |
---|
digest | bytes | optional | |
EndOfEpochData
EndOfEpochTransaction
EndOfEpochTransactionKind
Event
ExecutionStatus
FailureStatus
Field | Type | Label | Description |
---|
command | uint64 | optional | |
insufficient_gas | google.protobuf.Empty | | Insufficient Gas |
invalid_gas_object | google.protobuf.Empty | | Invalid Gas Object. |
invariant_violation | google.protobuf.Empty | | Invariant Violation |
feature_not_yet_supported | google.protobuf.Empty | | Attempted to used feature that is not supported yet |
object_too_big | SizeError | | Move object is larger than the maximum allowed size |
package_too_big | SizeError | | Package is larger than the maximum allowed size |
circular_object_ownership | ObjectId | | Circular Object Ownership |
insufficient_coin_balance | google.protobuf.Empty | | Coin errors / Insufficient coin balance for requested operation |
coin_balance_overflow | google.protobuf.Empty | | Coin balance overflowed an u64 |
publish_error_non_zero_address | google.protobuf.Empty | | Publish/Upgrade errors / Publish Error, Non-zero Address. / The modules in the package must have their self-addresses set to zero. |
sui_move_verification_error | google.protobuf.Empty | | Sui Move Bytecode Verification Error. |
move_primitive_runtime_error | MoveError | | MoveVm Errors / Error from a non-abort instruction. / Possible causes: / Arithmetic error, stack overflow, max value depth, etc." |
move_abort | MoveError | | Move runtime abort |
vm_verification_or_deserialization_error | google.protobuf.Empty | | Bytecode verification error. |
vm_invariant_violation | google.protobuf.Empty | | MoveVm invariant violation |
function_not_found | google.protobuf.Empty | | Programmable Transaction Errors / Function not found |
arity_mismatch | google.protobuf.Empty | | Arity mismatch for Move function. / The number of arguments does not match the number of parameters |
type_arity_mismatch | google.protobuf.Empty | | Type arity mismatch for Move function. / Mismatch between the number of actual versus expected type arguments. |
non_entry_function_invoked | google.protobuf.Empty | | Non Entry Function Invoked. Move Call must start with an entry function. |
command_argument_error | CommandArgumentError | | Invalid command argument |
type_argument_error | TypeArgumentError | | Type argument error |
unused_value_without_drop | NestedResult | | Unused result without the drop ability. |
invalid_public_function_return_type | uint32 | | Invalid public Move function signature. / Unsupported return type for return value |
invalid_transfer_object | google.protobuf.Empty | | Invalid Transfer Object, object does not have public transfer. |
effects_too_large | SizeError | | Post-execution errors / Effects from the transaction are too large |
publish_upgrade_missing_dependency | google.protobuf.Empty | | Publish or Upgrade is missing dependency |
publish_upgrade_dependency_downgrade | google.protobuf.Empty | | Publish or Upgrade dependency downgrade. / / Indirect (transitive) dependency of published or upgraded package has been assigned an / on-chain version that is less than the version required by one of the package's / transitive dependencies. |
package_upgrade_error | PackageUpgradeError | | Invalid package upgrade |
written_objects_too_large | SizeError | | Indicates the transaction tried to write objects too large to storage |
certificate_denied | google.protobuf.Empty | | Certificate is on the deny list |
sui_move_verification_timedout | google.protobuf.Empty | | Sui Move Bytecode verification timed out. |
shared_object_operation_not_allowed | google.protobuf.Empty | | The requested shared object operation is not allowed |
input_object_deleted | google.protobuf.Empty | | Requested shared object has been deleted |
execution_cancelled_due_to_shared_object_congestion | CongestedObjectsError | | Certificate is cancelled due to congestion on shared objects |
address_denied_for_coin | AddressDeniedForCoinError | | Address is denied for this coin type |
coin_type_global_pause | string | | Coin type is globally paused for use |
execution_cancelled_due_to_randomness_unavailable | google.protobuf.Empty | | Certificate is cancelled because randomness could not be generated this epoch |
GasCostSummary
Field | Type | Label | Description |
---|
computation_cost | uint64 | optional | |
storage_cost | uint64 | optional | |
storage_rebate | uint64 | optional | |
non_refundable_storage_fee | uint64 | optional | |
GasPayment
GenesisObject
GenesisTransaction
I128
Little-endian encoded i128
Field | Type | Label | Description |
---|
bytes | bytes | optional | |
Identifier
Field | Type | Label | Description |
---|
identifier | string | optional | |
Jwk
JwkId
MakeMoveVector
Field | Type | Label | Description |
---|
element_type | TypeTag | optional | |
elements | Argument | repeated | |
MergeCoins
ModifiedAtVersion
Field | Type | Label | Description |
---|
object_id | ObjectId | optional | |
version | uint64 | optional | |
MoveCall
MoveError
MoveField
MoveLocation
MoveModule
MovePackage
MoveStruct
MoveStructValue
MoveValue
MoveVariant
MoveVector
Field | Type | Label | Description |
---|
values | MoveValue | repeated | |
MultisigAggregatedSignature
MultisigCommittee
MultisigMember
MultisigMemberPublicKey
MultisigMemberSignature
NestedResult
Field | Type | Label | Description |
---|
result | uint32 | optional | |
subresult | uint32 | optional | |
Object
ObjectData
ObjectExist
ObjectId
Field | Type | Label | Description |
---|
object_id | bytes | optional | |
ObjectReference
ObjectReferenceWithOwner
ObjectWrite
Field | Type | Label | Description |
---|
digest | Digest | optional | |
owner | Owner | optional | |
Owner
PackageIdDoesNotMatch
PackageUpgradeError
PackageWrite
Field | Type | Label | Description |
---|
version | uint64 | optional | |
digest | Digest | optional | |
PasskeyAuthenticator
ProgrammableTransaction
Field | Type | Label | Description |
---|
inputs | Input | repeated | |
commands | Command | repeated | |
Publish
Field | Type | Label | Description |
---|
modules | bytes | repeated | |
dependencies | ObjectId | repeated | |
RandomnessStateUpdate
Field | Type | Label | Description |
---|
epoch | uint64 | optional | |
randomness_round | uint64 | optional | |
random_bytes | bytes | optional | |
randomness_object_initial_shared_version | uint64 | optional | |
ReadOnlyRoot
Field | Type | Label | Description |
---|
version | uint64 | optional | |
digest | Digest | optional | |
RoaringBitmap
Field | Type | Label | Description |
---|
bitmap | bytes | optional | |
Field | Type | Label | Description |
---|
object_id | ObjectId | optional | |
initial_shared_version | uint64 | optional | |
mutable | bool | optional | |
SimpleSignature
SizeError
Field | Type | Label | Description |
---|
size | uint64 | optional | |
max_size | uint64 | optional | |
SplitCoins
StructTag
SystemPackage
Transaction
Transaction.TransactionV1
TransactionEffects
TransactionEffectsV1
Field | Type | Label | Description |
---|
status | ExecutionStatus | optional | The status of the execution |
epoch | uint64 | optional | The epoch when this transaction was executed. |
gas_used | GasCostSummary | optional | |
modified_at_versions | ModifiedAtVersion | repeated | The version that every modified (mutated or deleted) object had before it was modified by / this transaction. |
shared_objects | ObjectReference | repeated | The object references of the shared objects used in this transaction. Empty if no shared objects were used. |
transaction_digest | Digest | optional | The transaction digest |
created | ObjectReferenceWithOwner | repeated | ObjectReference and owner of new objects created. |
mutated | ObjectReferenceWithOwner | repeated | ObjectReference and owner of mutated objects, including gas object. |
unwrapped | ObjectReferenceWithOwner | repeated | ObjectReference and owner of objects that are unwrapped in this transaction. / Unwrapped objects are objects that were wrapped into other objects in the past, / and just got extracted out. |
deleted | ObjectReference | repeated | Object Refs of objects now deleted (the new refs). |
unwrapped_then_deleted | ObjectReference | repeated | Object refs of objects previously wrapped in other objects but now deleted. |
wrapped | ObjectReference | repeated | Object refs of objects now wrapped in other objects. |
gas_object | ObjectReferenceWithOwner | optional | The updated gas object reference. Have a dedicated field for convenient access. / It's also included in mutated. |
events_digest | Digest | optional | The digest of the events emitted during execution, / can be None if the transaction does not emit any event. |
dependencies | Digest | repeated | The set of transaction digests this transaction depends on. |
TransactionEffectsV2
Field | Type | Label | Description |
---|
status | ExecutionStatus | optional | The status of the execution |
epoch | uint64 | optional | The epoch when this transaction was executed. |
gas_used | GasCostSummary | optional | |
transaction_digest | Digest | optional | The transaction digest |
gas_object_index | uint32 | optional | The updated gas object reference, as an index into the changed_objects vector. / Having a dedicated field for convenient access. / System transaction that don't require gas will leave this as None. |
events_digest | Digest | optional | The digest of the events emitted during execution, / can be None if the transaction does not emit any event. |
dependencies | Digest | repeated | The set of transaction digests this transaction depends on. |
lamport_version | uint64 | optional | The version number of all the written Move objects by this transaction. |
changed_objects | ChangedObject | repeated | Objects whose state are changed in the object store. |
unchanged_shared_objects | UnchangedSharedObject | repeated | Shared objects that are not mutated in this transaction. Unlike owned objects, / read-only shared objects' version are not committed in the transaction, / and in order for a node to catch up and execute it without consensus sequencing, / the version needs to be committed in the effects. |
auxiliary_data_digest | Digest | optional | Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately. / Storing it separately allows us to avoid bloating the effects with data that are not critical. / It also provides more flexibility on the format and type of the data. |
TransactionEvents
Field | Type | Label | Description |
---|
events | Event | repeated | |
TransactionExpiration
TransactionKind
TransferObjects
TypeArgumentError
TypeOrigin
TypeTag
U128
Little-endian encoded u128
Field | Type | Label | Description |
---|
bytes | bytes | optional | |
U256
Little-endian encoded u256
Field | Type | Label | Description |
---|
bytes | bytes | optional | |
UnchangedSharedObject
Upgrade
UpgradeInfo
UserSignature
ValidatorAggregatedSignature
ValidatorCommittee
ValidatorCommitteeMember
Field | Type | Label | Description |
---|
public_key | bytes | optional | |
stake | uint64 | optional | |
VersionAssignment
Field | Type | Label | Description |
---|
object_id | ObjectId | optional | |
version | uint64 | optional | |
ZkLoginAuthenticator
ZkLoginClaim
Field | Type | Label | Description |
---|
value | string | optional | |
index_mod_4 | uint32 | optional | |
ZkLoginProof
ZkLoginPublicIdentifier
SignatureScheme
note: values do not match their bcs serialized values
Name | Number | Description |
---|
SIGNATURE_SCHEME_UNKNOWN | 0 | |
SIGNATURE_SCHEME_ED25519 | 1 | |
SIGNATURE_SCHEME_SECP256K1 | 2 | |
SIGNATURE_SCHEME_SECP256R1 | 3 | |
SIGNATURE_SCHEME_MULTISIG | 4 | |
SIGNATURE_SCHEME_BLS12381 | 5 | |
SIGNATURE_SCHEME_ZKLOGIN | 6 | |
SIGNATURE_SCHEME_PASSKEY | 7 | |
google/protobuf/empty.proto
Empty
A generic empty message that you can re-use to avoid defining duplicated
empty messages in your APIs. A typical example is to use it as the request
or the response type of an API method. For instance:
service Foo {
rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
}
google/protobuf/timestamp.proto
Timestamp
A Timestamp represents a point in time independent of any time zone
or calendar, represented as seconds and fractions of seconds at
nanosecond resolution in UTC Epoch time. It is encoded using the
Proleptic Gregorian Calendar which extends the Gregorian calendar
backwards to year one. It is encoded assuming all minutes are 60
seconds long, i.e. leap seconds are "smeared" so that no leap second
table is needed for interpretation. Range is from
0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
By restricting to that range, we ensure that we can convert to
and from RFC 3339 date strings.
See https://www.ietf.org/rfc/rfc3339.txt.
Examples
Example 1: Compute Timestamp from POSIX time()
.
Timestamp timestamp;
timestamp.set_seconds(time(NULL));
timestamp.set_nanos(0);
Example 2: Compute Timestamp from POSIX gettimeofday()
.
struct timeval tv;
gettimeofday(&tv, NULL);
Timestamp timestamp;
timestamp.set_seconds(tv.tv_sec);
timestamp.set_nanos(tv.tv_usec * 1000);
Example 3: Compute Timestamp from Win32 GetSystemTimeAsFileTime()
.
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
Timestamp timestamp;
timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
Example 4: Compute Timestamp from Java System.currentTimeMillis()
.
long millis = System.currentTimeMillis();
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
.setNanos((int) ((millis % 1000) * 1000000)).build();
Example 5: Compute Timestamp from current time in Python.
timestamp = Timestamp()
timestamp.GetCurrentTime()
JSON Mapping
In JSON format, the Timestamp type is encoded as a string in the
RFC 3339 format. That is, the
format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
where {year} is always expressed using four digits while {month}, {day},
{hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
is required, though only UTC (as indicated by "Z") is presently supported.
For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
01:30 UTC on January 15, 2017.
In JavaScript, one can convert a Date object to this format using the
standard [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString]
method. In Python, a standard datetime.datetime
object can be converted
to this format using strftime
with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
can use the Joda Time's ISODateTimeFormat.dateTime()
to obtain a formatter capable of generating timestamps in this format.
Field | Type | Label | Description |
---|
seconds | int64 | | Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive. |
nanos | int32 | | Non-negative fractions of a second at nanosecond resolution. Negative second values with fractions must still have non-negative nanos values that count forward in time. Must be from 0 to 999,999,999 inclusive. |
Scalar Value Types
.proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
---|
double | | double | double | float | float64 | double | float | Float |
float | | float | float | float | float32 | float | float | Float |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum |
uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum |
bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) |
bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |