syntax = "proto3";

package soma.rpc;

import "google/protobuf/struct.proto";
import "soma/rpc/owner.proto";

// An object on the Sui blockchain.
message Object {
  // `ObjectId` for this object.
  optional string object_id = 1;

  // Version of the object.
  optional uint64 version = 2;

  // The digest of this Object.
  optional string digest = 3;

  // Owner of the object.
  optional Owner owner = 4;

  // The type of this object.
  optional string object_type = 5;

  // BCS bytes of a struct value.
  optional bytes contents = 6;

  // The digest of the transaction that created or last mutated this object
  optional string previous_transaction = 7;

  // JSON rendering of the object.
  // optional google.protobuf.Value json = 100;

  // Current balance if this object is a `Coin`
  // optional uint64 balance = 101;
}

// Set of Objects
message ObjectSet {
  // Objects are sorted by the key `(object_id, version)`.
  repeated Object objects = 1;
}