@mysten/sui
Version:
Sui TypeScript API
231 lines (229 loc) • 6.8 kB
text/typescript
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
// @generated by protobuf-ts 2.9.6 with parameter force_server_none,optimize_code_size,ts_nocheck
// @generated from protobuf file "sui/rpc/v2/object.proto" (package "sui.rpc.v2", syntax proto3)
// tslint:disable
// @ts-nocheck
//
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
//
import { MessageType } from '@protobuf-ts/runtime';
import { Value } from '../../../google/protobuf/struct.js';
import { Package } from './move_package.js';
import { Owner } from './owner.js';
import { Bcs } from './bcs.js';
/**
* An object on the Sui blockchain.
*
* @generated from protobuf message sui.rpc.v2.Object
*/
export interface Object {
/**
* This Object serialized as BCS.
*
* @generated from protobuf field: optional sui.rpc.v2.Bcs bcs = 1;
*/
bcs?: Bcs;
/**
* `ObjectId` for this object.
*
* @generated from protobuf field: optional string object_id = 2;
*/
objectId?: string;
/**
* Version of the object.
*
* @generated from protobuf field: optional uint64 version = 3;
*/
version?: bigint;
/**
* The digest of this Object.
*
* @generated from protobuf field: optional string digest = 4;
*/
digest?: string;
/**
* Owner of the object.
*
* @generated from protobuf field: optional sui.rpc.v2.Owner owner = 5;
*/
owner?: Owner;
/**
* The type of this object.
*
* This will be 'package' for packages and a StructTag for move structs.
*
* @generated from protobuf field: optional string object_type = 6;
*/
objectType?: string;
/**
* DEPRECATED this field is no longer used to determine whether a tx can transfer this
* object. Instead, it is always calculated from the objects type when loaded in execution.
*
* Only set for Move structs
*
* @generated from protobuf field: optional bool has_public_transfer = 7;
*/
hasPublicTransfer?: boolean;
/**
* BCS bytes of a Move struct value.
*
* Only set for Move structs
*
* @generated from protobuf field: optional sui.rpc.v2.Bcs contents = 8;
*/
contents?: Bcs;
/**
* Package information for Move Packages
*
* @generated from protobuf field: optional sui.rpc.v2.Package package = 9;
*/
package?: Package;
/**
* The digest of the transaction that created or last mutated this object
*
* @generated from protobuf field: optional string previous_transaction = 10;
*/
previousTransaction?: string;
/**
* The amount of SUI to rebate if this object gets deleted.
* This number is re-calculated each time the object is mutated based on
* the present storage gas price.
*
* @generated from protobuf field: optional uint64 storage_rebate = 11;
*/
storageRebate?: bigint;
/**
* JSON rendering of the object.
*
* @generated from protobuf field: optional google.protobuf.Value json = 100;
*/
json?: Value;
/**
* Current balance if this object is a `0x2::coin::Coin<T>`
*
* @generated from protobuf field: optional uint64 balance = 101;
*/
balance?: bigint;
/**
* JSON rendering of the object based on an on-chain template.
* This will not be set if the value's type does not have an associated `Display` template.
*
* @generated from protobuf field: optional sui.rpc.v2.Display display = 102;
*/
display?: Display;
}
/**
* Set of Objects
*
* @generated from protobuf message sui.rpc.v2.ObjectSet
*/
export interface ObjectSet {
/**
* Objects are sorted by the key `(object_id, version)`.
*
* @generated from protobuf field: repeated sui.rpc.v2.Object objects = 1;
*/
objects: Object[];
}
/**
* A rendered JSON blob based on an on-chain template.
*
* @generated from protobuf message sui.rpc.v2.Display
*/
export interface Display {
/**
* Output for all successfully substituted display fields. Unsuccessful
* fields will be `null`, and will be accompanied by a field in `errors`,
* explaining the error.
*
* @generated from protobuf field: optional google.protobuf.Value output = 1;
*/
output?: Value;
/**
* If any fields failed to render, this will contain a mapping from failed
* field names to error messages. If all fields succeed, this will either be
* `null` or not set.
*
* @generated from protobuf field: optional google.protobuf.Value errors = 2;
*/
errors?: Value;
}
// @generated message type with reflection information, may provide speed optimized methods
class Object$Type extends MessageType<Object> {
constructor() {
super('sui.rpc.v2.Object', [
{ no: 1, name: 'bcs', kind: 'message', T: () => Bcs },
{ no: 2, name: 'object_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{
no: 3,
name: 'version',
kind: 'scalar',
opt: true,
T: 4 /*ScalarType.UINT64*/,
L: 0 /*LongType.BIGINT*/,
},
{ no: 4, name: 'digest', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: 'owner', kind: 'message', T: () => Owner },
{ no: 6, name: 'object_type', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: 'has_public_transfer', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ },
{ no: 8, name: 'contents', kind: 'message', T: () => Bcs },
{ no: 9, name: 'package', kind: 'message', T: () => Package },
{
no: 10,
name: 'previous_transaction',
kind: 'scalar',
opt: true,
T: 9 /*ScalarType.STRING*/,
},
{
no: 11,
name: 'storage_rebate',
kind: 'scalar',
opt: true,
T: 4 /*ScalarType.UINT64*/,
L: 0 /*LongType.BIGINT*/,
},
{ no: 100, name: 'json', kind: 'message', T: () => Value },
{
no: 101,
name: 'balance',
kind: 'scalar',
opt: true,
T: 4 /*ScalarType.UINT64*/,
L: 0 /*LongType.BIGINT*/,
},
{ no: 102, name: 'display', kind: 'message', T: () => Display },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.Object
*/
export const Object = new Object$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ObjectSet$Type extends MessageType<ObjectSet> {
constructor() {
super('sui.rpc.v2.ObjectSet', [
{ no: 1, name: 'objects', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Object },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.ObjectSet
*/
export const ObjectSet = new ObjectSet$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Display$Type extends MessageType<Display> {
constructor() {
super('sui.rpc.v2.Display', [
{ no: 1, name: 'output', kind: 'message', T: () => Value },
{ no: 2, name: 'errors', kind: 'message', T: () => Value },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.Display
*/
export const Display = new Display$Type();