MoveCoder

Class in @typemove/iota

Defined in @typemove/iota

Extends

Constructors

Constructor

new MoveCoder(client: IotaClient): MoveCoder;

Parameters

ParameterType
clientIotaClient

Returns

MoveCoder

Overrides

AbstractMoveCoder<
  // IotaNetwork,
  IotaMoveNormalizedModule,
  IotaEvent | IotaMoveObject
>.constructor

Properties

PropertyTypeInherited from
adapterChainAdapter<IotaMoveNormalizedModule, | IotaEvent | { }>AbstractMoveCoder.adapter

Methods

contains()

contains(account: string, name: string): boolean;

Parameters

ParameterType
accountstring
namestring

Returns

boolean

Inherited from

AbstractMoveCoder.contains


decodeArray()

decodeArray(
   entries: any[], 
   types: TypeDescriptor<any>[], 
   strict?: boolean
): Promise<any[]>;

Parameters

ParameterTypeDefault value
entriesany[]undefined
typesTypeDescriptor<any>[]undefined
strictbooleantrue

Returns

Promise<any[]>

Inherited from

AbstractMoveCoder.decodeArray


decodeBCS()

decodeBCS(
   type: TypeDescriptor, 
   data: string | Uint8Array<ArrayBufferLike>, 
   encoding?: Encoding
): Promise<any>;

Parameters

ParameterType
typeTypeDescriptor
datastring | Uint8Array<ArrayBufferLike>
encoding?Encoding

Returns

Promise<any>


decodeCallResult()

decodeCallResult(res: any[], func: string): Promise<any[]>;

Parameters

ParameterType
resany[]
funcstring

Returns

Promise<any[]>

Inherited from

AbstractMoveCoder.decodeCallResult


decodeDevInspectResult()

decodeDevInspectResult<T extends any[]>(inspectRes: DevInspectResults): Promise<TypedDevInspectResults<T>>;

Type Parameters

Type Parameter
T extends any[]

Parameters

ParameterType
inspectResDevInspectResults

Returns

Promise<TypedDevInspectResults<T>>


decodeEvent()

decodeEvent<T>(event: IotaEvent): Promise<
  | TypedEventInstance<T>
| undefined>;

Type Parameters

Type Parameter
T

Parameters

ParameterType
eventIotaEvent

Returns

Promise< | TypedEventInstance<T> | undefined>


decodeFunctionPayload()

decodeFunctionPayload(payload: MoveCallIotaTransaction, inputs: IotaCallArg[]): Promise<MoveCallIotaTransaction>;

Parameters

ParameterType
payloadMoveCallIotaTransaction
inputsIotaCallArg[]

Returns

Promise<MoveCallIotaTransaction>


decodeType()

decodeType<T, ST>(typeStruct: ST, type: TypeDescriptor<T>): Promise<T | undefined>;

Type Parameters

Type Parameter
T
ST

Parameters

ParameterType
typeStructST
typeTypeDescriptor<T>

Returns

Promise<T | undefined>

Inherited from

AbstractMoveCoder.decodeType


encode()

encode(data: any): any;

Parameters

ParameterType
dataany

Returns

any

Inherited from

AbstractMoveCoder.encode


encodeArray()

encodeArray(entriesDecoded: any[]): any[];

Parameters

ParameterType
entriesDecodedany[]

Returns

any[]

Inherited from

AbstractMoveCoder.encodeArray


filterAndDecodeEvents()

filterAndDecodeEvents<T>(type: 
  | string
| TypeDescriptor<T>, resources: IotaEvent[]): Promise<TypedEventInstance<T>[]>;

Type Parameters

Type Parameter
T

Parameters

ParameterType
type| string | TypeDescriptor<T>
resourcesIotaEvent[]

Returns

Promise<TypedEventInstance<T>[]>


filterAndDecodeObjects()

filterAndDecodeObjects<T>(type: TypeDescriptor<T>, objects: object[]): Promise<DecodedStruct<{
}, T>[]>;

Type Parameters

Type Parameter
T

Parameters

ParameterType
typeTypeDescriptor<T>
objectsobject[]

Returns

Promise<DecodedStruct<{ }, T>[]>


filterAndDecodeStruct()

filterAndDecodeStruct<T, ST extends 
  | IotaEvent
  | {
}>(typeMatcher: TypeDescriptor<T>, structsWithTags: ST[]): Promise<DecodedStruct<ST, T>[]>;

Type Parameters

Type Parameter
T
ST extends | IotaEvent | { }

Parameters

ParameterType
typeMatcherTypeDescriptor<T>
structsWithTagsST[]

Returns

Promise<DecodedStruct<ST, T>[]>

Inherited from

AbstractMoveCoder.filterAndDecodeStruct


getBCSType()

getBCSType(type: TypeDescriptor): Promise<BcsType<any, any, string>>;

Parameters

ParameterType
typeTypeDescriptor

Returns

Promise<BcsType<any, any, string>>


getDynamicFields()

getDynamicFields<T1, T2>(
   objects: object[], 
   keyType?: TypeDescriptor<T1>, 
   valueType?: TypeDescriptor<T2>
): Promise<Field<T1, T2>[]>;

Type Parameters

Type Parameter
T1
T2

Parameters

ParameterTypeDefault value
objectsobject[]undefined
keyTypeTypeDescriptor<T1>ANY_TYPE
valueTypeTypeDescriptor<T2>ANY_TYPE

Returns

Promise<Field<T1, T2>[]>


getMoveFunction()

getMoveFunction(type: string): Promise<InternalMoveFunction>;

Parameters

ParameterType
typestring

Returns

Promise<InternalMoveFunction>

Inherited from

AbstractMoveCoder.getMoveFunction


getMoveStruct()

getMoveStruct(type: string): Promise<InternalMoveStruct>;

Parameters

ParameterType
typestring

Returns

Promise<InternalMoveStruct>

Inherited from

AbstractMoveCoder.getMoveStruct


load()

load(module: IotaMoveNormalizedModule, address: string): InternalMoveModule;

Parameters

ParameterType
moduleIotaMoveNormalizedModule
addressstring

Returns

InternalMoveModule

Overrides

AbstractMoveCoder.load


maybeGetMoveEnum()

maybeGetMoveEnum(type: string): Promise<InternalMoveEnum | undefined>;

Parameters

ParameterType
typestring

Returns

Promise<InternalMoveEnum | undefined>

Inherited from

AbstractMoveCoder.maybeGetMoveEnum


registerBCSTypes()

registerBCSTypes(type: TypeDescriptor): Promise<void>;

Parameters

ParameterType
typeTypeDescriptor

Returns

Promise<void>

On this page