@mysten/sui
Version:
Sui TypeScript API
801 lines (799 loc) • 22.1 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/move_package.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';
/**
* A Move Package
*
* @generated from protobuf message sui.rpc.v2.Package
*/
export interface Package {
/**
* The PackageId of this package
*
* A package's `storage_id` is the Sui ObjectId of the package on-chain.
* Outside of system packages the `storage_id` for every package version is
* different.
*
* @generated from protobuf field: optional string storage_id = 1;
*/
storageId?: string;
/**
* The PackageId of the first published version of this package.
*
* A package's `original_id` (sometimes also called its `runtime_id`) is the
* `storage_id` of the first version of this package that has been published.
* The `original_id`/`runtime_id` is stable across all versions of the
* package and does not ever change.
*
* @generated from protobuf field: optional string original_id = 2;
*/
originalId?: string;
/**
* The version of this package
*
* @generated from protobuf field: optional uint64 version = 3;
*/
version?: bigint;
/**
* The modules defined by this package
*
* @generated from protobuf field: repeated sui.rpc.v2.Module modules = 4;
*/
modules: Module[];
/**
* List of datatype origins for mapping datatypes to a package version where
* it was first defined
*
* @generated from protobuf field: repeated sui.rpc.v2.TypeOrigin type_origins = 5;
*/
typeOrigins: TypeOrigin[];
/**
* The package's transitive dependencies as a mapping from the package's
* runtime Id (the Id it is referred to by in other packages) to its
* storage Id (the Id it is loaded from on chain).
*
* @generated from protobuf field: repeated sui.rpc.v2.Linkage linkage = 6;
*/
linkage: Linkage[];
}
/**
* A Move Module.
*
* @generated from protobuf message sui.rpc.v2.Module
*/
export interface Module {
/**
* Name of this module.
*
* @generated from protobuf field: optional string name = 1;
*/
name?: string;
/**
* Serialized bytecode of the module.
*
* @generated from protobuf field: optional bytes contents = 2;
*/
contents?: Uint8Array;
/**
* List of DataTypes defined by this module.
*
* @generated from protobuf field: repeated sui.rpc.v2.DatatypeDescriptor datatypes = 3;
*/
datatypes: DatatypeDescriptor[];
/**
* List of Functions defined by this module.
*
* @generated from protobuf field: repeated sui.rpc.v2.FunctionDescriptor functions = 4;
*/
functions: FunctionDescriptor[];
}
/**
* Describes a Move Datatype.
*
* @generated from protobuf message sui.rpc.v2.DatatypeDescriptor
*/
export interface DatatypeDescriptor {
/**
* Fully qualified name of this Datatype.
*
* This is `<defining_id>::<module>::<name>`
*
* @generated from protobuf field: optional string type_name = 1;
*/
typeName?: string;
/**
* PackageId of the package where this Datatype is defined.
*
* A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
*
* @generated from protobuf field: optional string defining_id = 2;
*/
definingId?: string;
/**
* Name of the module where this Datatype is defined
*
* @generated from protobuf field: optional string module = 3;
*/
module?: string;
/**
* Name of this Datatype
*
* @generated from protobuf field: optional string name = 4;
*/
name?: string;
/**
* This type's abilities
*
* @generated from protobuf field: repeated sui.rpc.v2.Ability abilities = 5;
*/
abilities: Ability[];
/**
* Ability constraints and phantom status for this type's generic type parameters
*
* @generated from protobuf field: repeated sui.rpc.v2.TypeParameter type_parameters = 6;
*/
typeParameters: TypeParameter[];
/**
* Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
*
* @generated from protobuf field: optional sui.rpc.v2.DatatypeDescriptor.DatatypeKind kind = 7;
*/
kind?: DatatypeDescriptor_DatatypeKind;
/**
* Set of fields if this Datatype is a struct.
*
* The order of the entries is the order of how the fields are defined.
*
* @generated from protobuf field: repeated sui.rpc.v2.FieldDescriptor fields = 8;
*/
fields: FieldDescriptor[];
/**
* Set of variants if this Datatype is an enum.
*
* The order of the entries is the order of how the variants are defined.
*
* @generated from protobuf field: repeated sui.rpc.v2.VariantDescriptor variants = 9;
*/
variants: VariantDescriptor[];
}
/**
* @generated from protobuf enum sui.rpc.v2.DatatypeDescriptor.DatatypeKind
*/
export enum DatatypeDescriptor_DatatypeKind {
/**
* @generated from protobuf enum value: DATATYPE_KIND_UNKNOWN = 0;
*/
DATATYPE_KIND_UNKNOWN = 0,
/**
* @generated from protobuf enum value: STRUCT = 1;
*/
STRUCT = 1,
/**
* @generated from protobuf enum value: ENUM = 2;
*/
ENUM = 2,
}
/**
* A generic type parameter used in the declaration of a struct or enum.
*
* @generated from protobuf message sui.rpc.v2.TypeParameter
*/
export interface TypeParameter {
/**
* The type parameter constraints
*
* @generated from protobuf field: repeated sui.rpc.v2.Ability constraints = 1;
*/
constraints: Ability[];
/**
* Whether the parameter is declared as phantom
*
* @generated from protobuf field: optional bool is_phantom = 2;
*/
isPhantom?: boolean;
}
/**
* Descriptor of a field that belongs to a struct or enum variant
*
* @generated from protobuf message sui.rpc.v2.FieldDescriptor
*/
export interface FieldDescriptor {
/**
* Name of the field
*
* @generated from protobuf field: optional string name = 1;
*/
name?: string;
/**
* Order or position of the field in the struct or enum variant definition.
*
* @generated from protobuf field: optional uint32 position = 2;
*/
position?: number;
/**
* The type of the field
*
* @generated from protobuf field: optional sui.rpc.v2.OpenSignatureBody type = 3;
*/
type?: OpenSignatureBody;
}
/**
* Descriptor of an enum variant
*
* @generated from protobuf message sui.rpc.v2.VariantDescriptor
*/
export interface VariantDescriptor {
/**
* Name of the variant
*
* @generated from protobuf field: optional string name = 1;
*/
name?: string;
/**
* Order or position of the variant in the enum definition.
*
* @generated from protobuf field: optional uint32 position = 2;
*/
position?: number;
/**
* Set of fields defined by this variant.
*
* @generated from protobuf field: repeated sui.rpc.v2.FieldDescriptor fields = 3;
*/
fields: FieldDescriptor[];
}
/**
* Representation of a type signature that could appear as a field type for a struct or enum
*
* @generated from protobuf message sui.rpc.v2.OpenSignatureBody
*/
export interface OpenSignatureBody {
/**
* Type of this signature
*
* @generated from protobuf field: optional sui.rpc.v2.OpenSignatureBody.Type type = 1;
*/
type?: OpenSignatureBody_Type;
/**
* Fully qualified name of the datatype when `type` is `DATATYPE`
*
* @generated from protobuf field: optional string type_name = 2;
*/
typeName?: string;
/**
* Set when `type` is `VECTOR` or `DATATYPE`
*
* @generated from protobuf field: repeated sui.rpc.v2.OpenSignatureBody type_parameter_instantiation = 3;
*/
typeParameterInstantiation: OpenSignatureBody[];
/**
* Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
*
* @generated from protobuf field: optional uint32 type_parameter = 4;
*/
typeParameter?: number;
}
/**
* @generated from protobuf enum sui.rpc.v2.OpenSignatureBody.Type
*/
export enum OpenSignatureBody_Type {
/**
* @generated from protobuf enum value: TYPE_UNKNOWN = 0;
*/
TYPE_UNKNOWN = 0,
/**
* @generated from protobuf enum value: ADDRESS = 1;
*/
ADDRESS = 1,
/**
* @generated from protobuf enum value: BOOL = 2;
*/
BOOL = 2,
/**
* @generated from protobuf enum value: U8 = 3;
*/
U8 = 3,
/**
* @generated from protobuf enum value: U16 = 4;
*/
U16 = 4,
/**
* @generated from protobuf enum value: U32 = 5;
*/
U32 = 5,
/**
* @generated from protobuf enum value: U64 = 6;
*/
U64 = 6,
/**
* @generated from protobuf enum value: U128 = 7;
*/
U128 = 7,
/**
* @generated from protobuf enum value: U256 = 8;
*/
U256 = 8,
/**
* @generated from protobuf enum value: VECTOR = 9;
*/
VECTOR = 9,
/**
* @generated from protobuf enum value: DATATYPE = 10;
*/
DATATYPE = 10,
/**
* @generated from protobuf enum value: TYPE_PARAMETER = 11;
*/
TYPE_PARAMETER = 11,
}
/**
* Descriptor of a Move function
*
* @generated from protobuf message sui.rpc.v2.FunctionDescriptor
*/
export interface FunctionDescriptor {
/**
* Name of the function
*
* @generated from protobuf field: optional string name = 1;
*/
name?: string;
/**
* Whether the function is `public`, `private` or `public(friend)`
*
* @generated from protobuf field: optional sui.rpc.v2.FunctionDescriptor.Visibility visibility = 5;
*/
visibility?: FunctionDescriptor_Visibility;
/**
* Whether the function is marked `entry` or not.
*
* @generated from protobuf field: optional bool is_entry = 6;
*/
isEntry?: boolean;
/**
* Ability constraints for type parameters
*
* @generated from protobuf field: repeated sui.rpc.v2.TypeParameter type_parameters = 7;
*/
typeParameters: TypeParameter[];
/**
* Formal parameter types.
*
* @generated from protobuf field: repeated sui.rpc.v2.OpenSignature parameters = 8;
*/
parameters: OpenSignature[];
/**
* Return types.
*
* @generated from protobuf field: repeated sui.rpc.v2.OpenSignature returns = 9;
*/
returns: OpenSignature[];
}
/**
* @generated from protobuf enum sui.rpc.v2.FunctionDescriptor.Visibility
*/
export enum FunctionDescriptor_Visibility {
/**
* @generated from protobuf enum value: VISIBILITY_UNKNOWN = 0;
*/
VISIBILITY_UNKNOWN = 0,
/**
* @generated from protobuf enum value: PRIVATE = 1;
*/
PRIVATE = 1,
/**
* @generated from protobuf enum value: PUBLIC = 2;
*/
PUBLIC = 2,
/**
* @generated from protobuf enum value: FRIEND = 3;
*/
FRIEND = 3,
}
/**
* Representation of a type signature that could appear as a function parameter or return value.
*
* @generated from protobuf message sui.rpc.v2.OpenSignature
*/
export interface OpenSignature {
/**
* @generated from protobuf field: optional sui.rpc.v2.OpenSignature.Reference reference = 1;
*/
reference?: OpenSignature_Reference;
/**
* @generated from protobuf field: optional sui.rpc.v2.OpenSignatureBody body = 2;
*/
body?: OpenSignatureBody;
}
/**
* @generated from protobuf enum sui.rpc.v2.OpenSignature.Reference
*/
export enum OpenSignature_Reference {
/**
* @generated from protobuf enum value: REFERENCE_UNKNOWN = 0;
*/
REFERENCE_UNKNOWN = 0,
/**
* @generated from protobuf enum value: IMMUTABLE = 1;
*/
IMMUTABLE = 1,
/**
* @generated from protobuf enum value: MUTABLE = 2;
*/
MUTABLE = 2,
}
/**
* Identifies a struct and the module it was defined in.
*
* @generated from protobuf message sui.rpc.v2.TypeOrigin
*/
export interface TypeOrigin {
/**
* @generated from protobuf field: optional string module_name = 1;
*/
moduleName?: string;
/**
* @generated from protobuf field: optional string datatype_name = 2;
*/
datatypeName?: string;
/**
* @generated from protobuf field: optional string package_id = 3;
*/
packageId?: string;
}
/**
* Upgraded package info for the linkage table.
*
* @generated from protobuf message sui.rpc.v2.Linkage
*/
export interface Linkage {
/**
* Id of the original package.
*
* @generated from protobuf field: optional string original_id = 1;
*/
originalId?: string;
/**
* Id of the upgraded package.
*
* @generated from protobuf field: optional string upgraded_id = 2;
*/
upgradedId?: string;
/**
* Version of the upgraded package.
*
* @generated from protobuf field: optional uint64 upgraded_version = 3;
*/
upgradedVersion?: bigint;
}
/**
* An `Ability` classifies what operations are permitted for a given type
*
* @generated from protobuf enum sui.rpc.v2.Ability
*/
export enum Ability {
/**
* @generated from protobuf enum value: ABILITY_UNKNOWN = 0;
*/
ABILITY_UNKNOWN = 0,
/**
* Allows values of types with this ability to be copied
*
* @generated from protobuf enum value: COPY = 1;
*/
COPY = 1,
/**
* Allows values of types with this ability to be dropped.
*
* @generated from protobuf enum value: DROP = 2;
*/
DROP = 2,
/**
* Allows values of types with this ability to exist inside a struct in global storage
*
* @generated from protobuf enum value: STORE = 3;
*/
STORE = 3,
/**
* Allows the type to serve as a key for global storage operations
*
* @generated from protobuf enum value: KEY = 4;
*/
KEY = 4,
}
// @generated message type with reflection information, may provide speed optimized methods
class Package$Type extends MessageType<Package> {
constructor() {
super('sui.rpc.v2.Package', [
{ no: 1, name: 'storage_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'original_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: 'modules', kind: 'message', repeat: 1 /*RepeatType.PACKED*/, T: () => Module },
{
no: 5,
name: 'type_origins',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => TypeOrigin,
},
{
no: 6,
name: 'linkage',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => Linkage,
},
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.Package
*/
export const Package = new Package$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Module$Type extends MessageType<Module> {
constructor() {
super('sui.rpc.v2.Module', [
{ no: 1, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'contents', kind: 'scalar', opt: true, T: 12 /*ScalarType.BYTES*/ },
{
no: 3,
name: 'datatypes',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => DatatypeDescriptor,
},
{
no: 4,
name: 'functions',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => FunctionDescriptor,
},
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.Module
*/
export const Module = new Module$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DatatypeDescriptor$Type extends MessageType<DatatypeDescriptor> {
constructor() {
super('sui.rpc.v2.DatatypeDescriptor', [
{ no: 1, name: 'type_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'defining_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: 'module', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{
no: 5,
name: 'abilities',
kind: 'enum',
repeat: 1 /*RepeatType.PACKED*/,
T: () => ['sui.rpc.v2.Ability', Ability],
},
{
no: 6,
name: 'type_parameters',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => TypeParameter,
},
{
no: 7,
name: 'kind',
kind: 'enum',
opt: true,
T: () => ['sui.rpc.v2.DatatypeDescriptor.DatatypeKind', DatatypeDescriptor_DatatypeKind],
},
{
no: 8,
name: 'fields',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => FieldDescriptor,
},
{
no: 9,
name: 'variants',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => VariantDescriptor,
},
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.DatatypeDescriptor
*/
export const DatatypeDescriptor = new DatatypeDescriptor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TypeParameter$Type extends MessageType<TypeParameter> {
constructor() {
super('sui.rpc.v2.TypeParameter', [
{
no: 1,
name: 'constraints',
kind: 'enum',
repeat: 1 /*RepeatType.PACKED*/,
T: () => ['sui.rpc.v2.Ability', Ability],
},
{ no: 2, name: 'is_phantom', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.TypeParameter
*/
export const TypeParameter = new TypeParameter$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FieldDescriptor$Type extends MessageType<FieldDescriptor> {
constructor() {
super('sui.rpc.v2.FieldDescriptor', [
{ no: 1, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'position', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ },
{ no: 3, name: 'type', kind: 'message', T: () => OpenSignatureBody },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.FieldDescriptor
*/
export const FieldDescriptor = new FieldDescriptor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class VariantDescriptor$Type extends MessageType<VariantDescriptor> {
constructor() {
super('sui.rpc.v2.VariantDescriptor', [
{ no: 1, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'position', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ },
{
no: 3,
name: 'fields',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => FieldDescriptor,
},
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.VariantDescriptor
*/
export const VariantDescriptor = new VariantDescriptor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class OpenSignatureBody$Type extends MessageType<OpenSignatureBody> {
constructor() {
super('sui.rpc.v2.OpenSignatureBody', [
{
no: 1,
name: 'type',
kind: 'enum',
opt: true,
T: () => ['sui.rpc.v2.OpenSignatureBody.Type', OpenSignatureBody_Type],
},
{ no: 2, name: 'type_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{
no: 3,
name: 'type_parameter_instantiation',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => OpenSignatureBody,
},
{ no: 4, name: 'type_parameter', kind: 'scalar', opt: true, T: 13 /*ScalarType.UINT32*/ },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.OpenSignatureBody
*/
export const OpenSignatureBody = new OpenSignatureBody$Type();
// @generated message type with reflection information, may provide speed optimized methods
class FunctionDescriptor$Type extends MessageType<FunctionDescriptor> {
constructor() {
super('sui.rpc.v2.FunctionDescriptor', [
{ no: 1, name: 'name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{
no: 5,
name: 'visibility',
kind: 'enum',
opt: true,
T: () => ['sui.rpc.v2.FunctionDescriptor.Visibility', FunctionDescriptor_Visibility],
},
{ no: 6, name: 'is_entry', kind: 'scalar', opt: true, T: 8 /*ScalarType.BOOL*/ },
{
no: 7,
name: 'type_parameters',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => TypeParameter,
},
{
no: 8,
name: 'parameters',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => OpenSignature,
},
{
no: 9,
name: 'returns',
kind: 'message',
repeat: 1 /*RepeatType.PACKED*/,
T: () => OpenSignature,
},
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.FunctionDescriptor
*/
export const FunctionDescriptor = new FunctionDescriptor$Type();
// @generated message type with reflection information, may provide speed optimized methods
class OpenSignature$Type extends MessageType<OpenSignature> {
constructor() {
super('sui.rpc.v2.OpenSignature', [
{
no: 1,
name: 'reference',
kind: 'enum',
opt: true,
T: () => ['sui.rpc.v2.OpenSignature.Reference', OpenSignature_Reference],
},
{ no: 2, name: 'body', kind: 'message', T: () => OpenSignatureBody },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.OpenSignature
*/
export const OpenSignature = new OpenSignature$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TypeOrigin$Type extends MessageType<TypeOrigin> {
constructor() {
super('sui.rpc.v2.TypeOrigin', [
{ no: 1, name: 'module_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'datatype_name', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: 'package_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.TypeOrigin
*/
export const TypeOrigin = new TypeOrigin$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Linkage$Type extends MessageType<Linkage> {
constructor() {
super('sui.rpc.v2.Linkage', [
{ no: 1, name: 'original_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: 'upgraded_id', kind: 'scalar', opt: true, T: 9 /*ScalarType.STRING*/ },
{
no: 3,
name: 'upgraded_version',
kind: 'scalar',
opt: true,
T: 4 /*ScalarType.UINT64*/,
L: 0 /*LongType.BIGINT*/,
},
]);
}
}
/**
* @generated MessageType for protobuf message sui.rpc.v2.Linkage
*/
export const Linkage = new Linkage$Type();