Skip to main content

Class: ObjectCache

Constructors

Constructor

new ObjectCache(__namedParameters): ObjectCache;

Parameters

ParameterType
__namedParametersObjectCacheOptions

Returns

ObjectCache

Methods

asPlugin()

asPlugin(): TransactionPlugin;

Returns

TransactionPlugin


clear()

clear(): Promise<void>;

Returns

Promise<void>


getMoveFunctionDefinition()

getMoveFunctionDefinition(ref): Promise<MoveFunctionCacheEntry | null>;

Parameters

ParameterType
ref{ package: string; module: string; function: string; }
ref.packagestring
ref.modulestring
ref.functionstring

Returns

Promise<MoveFunctionCacheEntry | null>


getObjects()

getObjects(ids): Promise<(ObjectCacheEntry | null)[]>;

Parameters

ParameterType
idsstring[]

Returns

Promise<(ObjectCacheEntry | null)[]>


deleteObjects()

deleteObjects(ids): Promise<void>;

Parameters

ParameterType
idsstring[]

Returns

Promise<void>


clearOwnedObjects()

clearOwnedObjects(): Promise<void>;

Returns

Promise<void>


clearCustom()

clearCustom(): Promise<void>;

Returns

Promise<void>


getCustom()

getCustom<T>(key): Promise<T | null>;

Type Parameters

Type Parameter
T

Parameters

ParameterType
keystring

Returns

Promise<T | null>


setCustom()

setCustom<T>(key, value): Promise<void>;

Type Parameters

Type Parameter
T

Parameters

ParameterType
keystring
valueT

Returns

Promise<void>


deleteCustom()

deleteCustom(key): Promise<void>;

Parameters

ParameterType
keystring

Returns

Promise<void>


applyEffects()

applyEffects(effects): Promise<void>;

Parameters

ParameterType
effects{ $kind: "V1"; V1: { status: EnumOutputShapeWithKeys<{ Success: true; Failed: { error: EnumOutputShapeWithKeys<{ InsufficientGas: true; InvalidGasObject: true; InvariantViolation: true; FeatureNotYetSupported: true; MoveObjectTooBig: { objectSize: string; maxObjectSize: string; }; MovePackageTooBig: { objectSize: string; maxObjectSize: string; }; CircularObjectOwnership: { object: string; }; InsufficientCoinBalance: true; CoinBalanceOverflow: true; PublishErrorNonZeroAddress: true; IotaMoveVerificationError: true; MovePrimitiveRuntimeError: | { module: { address: string; name: string; }; function: number; instruction: number; functionName: string | null; } | null; MoveAbort: [{ module: { address: string; name: string; }; function: number; instruction: number; functionName: string | null; }, string]; VMVerificationOrDeserializationError: true; VMInvariantViolation: true; FunctionNotFound: true; ArityMismatch: true; TypeArityMismatch: true; NonEntryFunctionInvoked: true; CommandArgumentError: { argIdx: number; kind: EnumOutputShapeWithKeys<{ TypeMismatch: true; InvalidBCSBytes: true; InvalidUsageOfPureArg: true; InvalidArgumentToPrivateEntryFunction: true; IndexOutOfBounds: { idx: ...; }; SecondaryIndexOutOfBounds: { resultIdx: ...; secondaryIdx: ...; }; InvalidResultArity: { resultIdx: ...; }; InvalidGasCoinUsage: true; InvalidValueUsage: true; InvalidObjectByValue: true; InvalidObjectByMutRef: true; SharedObjectOperationNotAllowed: true; }, | "TypeMismatch" | "InvalidBCSBytes" | "InvalidUsageOfPureArg" | "InvalidArgumentToPrivateEntryFunction" | "IndexOutOfBounds" | "SecondaryIndexOutOfBounds" | "InvalidResultArity" | "InvalidGasCoinUsage" | "InvalidValueUsage" | "InvalidObjectByValue" | "InvalidObjectByMutRef" | "SharedObjectOperationNotAllowed">; }; TypeArgumentError: { argumentIdx: number; kind: EnumOutputShapeWithKeys<{ TypeNotFound: true; ConstraintNotSatisfied: true; }, "TypeNotFound" | "ConstraintNotSatisfied">; }; UnusedValueWithoutDrop: { resultIdx: number; secondaryIdx: number; }; InvalidPublicFunctionReturnType: { idx: number; }; InvalidTransferObject: true; EffectsTooLarge: { currentSize: string; maxSize: string; }; PublishUpgradeMissingDependency: true; PublishUpgradeDependencyDowngrade: true; PackageUpgradeError: { upgradeError: EnumOutputShapeWithKeys<{ UnableToFetchPackage: { packageId: ...; }; NotAPackage: { objectId: ...; }; IncompatibleUpgrade: true; DigestDoesNotMatch: { digest: ...; }; UnknownUpgradePolicy: { policy: ...; }; PackageIDDoesNotMatch: { packageId: ...; ticketId: ...; }; }, | "UnableToFetchPackage" | "NotAPackage" | "IncompatibleUpgrade" | "DigestDoesNotMatch" | "UnknownUpgradePolicy" | "PackageIDDoesNotMatch">; }; WrittenObjectsTooLarge: { currentSize: string; maxSize: string; }; CertificateDenied: true; IotaMoveVerificationTimedout: true; SharedObjectOperationNotAllowed: true; InputObjectDeleted: true; ExecutionCancelledDueToSharedObjectCongestion: { congestedObjects: string[]; }; AddressDeniedForCoin: { address: string; coinType: string; }; CoinTypeGlobalPause: { coinType: string; }; ExecutionCancelledDueToRandomnessUnavailable: true; }, | "InsufficientGas" | "InvalidGasObject" | "InvariantViolation" | "FeatureNotYetSupported" | "MoveObjectTooBig" | "MovePackageTooBig" | "CircularObjectOwnership" | "InsufficientCoinBalance" | "CoinBalanceOverflow" | "PublishErrorNonZeroAddress" | "IotaMoveVerificationError" | "MovePrimitiveRuntimeError" | "MoveAbort" | "VMVerificationOrDeserializationError" | "VMInvariantViolation" | "FunctionNotFound" | "ArityMismatch" | "TypeArityMismatch" | "NonEntryFunctionInvoked" | "CommandArgumentError" | "SharedObjectOperationNotAllowed" | "TypeArgumentError" | "UnusedValueWithoutDrop" | "InvalidPublicFunctionReturnType" | "InvalidTransferObject" | "EffectsTooLarge" | "PublishUpgradeMissingDependency" | "PublishUpgradeDependencyDowngrade" | "PackageUpgradeError" | "WrittenObjectsTooLarge" | "CertificateDenied" | "IotaMoveVerificationTimedout" | "InputObjectDeleted" | "ExecutionCancelledDueToSharedObjectCongestion" | "AddressDeniedForCoin" | "CoinTypeGlobalPause" | "ExecutionCancelledDueToRandomnessUnavailable">; command: string | null; }; }, "Success" | "Failed">; executedEpoch: string; gasUsed: { computationCost: string; computationCostBurned: string; storageCost: string; storageRebate: string; nonRefundableStorageFee: string; }; transactionDigest: string; gasObjectIndex: number | null; eventsDigest: string | null; dependencies: string[]; lamportVersion: string; changedObjects: [string, { inputState: EnumOutputShapeWithKeys<{ NotExist: true; Exist: [[string, string], EnumOutputShapeWithKeys<{ AddressOwner: string; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; Immutable: true; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; }, "NotExist" | "Exist">; outputState: EnumOutputShapeWithKeys<{ NotExist: true; ObjectWrite: [string, EnumOutputShapeWithKeys<{ AddressOwner: string; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; Immutable: true; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; PackageWrite: [string, string]; }, "NotExist" | "ObjectWrite" | "PackageWrite">; idOperation: EnumOutputShapeWithKeys<{ None: true; Created: true; Deleted: true; }, "None" | "Created" | "Deleted">; }][]; unchangedSharedObjects: [string, EnumOutputShapeWithKeys<{ ReadOnlyRoot: [string, string]; MutateDeleted: string; ReadDeleted: string; Cancelled: string; PerEpochConfig: true; }, | "ReadOnlyRoot" | "MutateDeleted" | "ReadDeleted" | "Cancelled" | "PerEpochConfig">][]; auxDataDigest: string | null; }; }
effects.$kind"V1"
effects.V1{ status: EnumOutputShapeWithKeys<{ Success: true; Failed: { error: EnumOutputShapeWithKeys<{ InsufficientGas: true; InvalidGasObject: true; InvariantViolation: true; FeatureNotYetSupported: true; MoveObjectTooBig: { objectSize: string; maxObjectSize: string; }; MovePackageTooBig: { objectSize: string; maxObjectSize: string; }; CircularObjectOwnership: { object: string; }; InsufficientCoinBalance: true; CoinBalanceOverflow: true; PublishErrorNonZeroAddress: true; IotaMoveVerificationError: true; MovePrimitiveRuntimeError: | { module: { address: string; name: string; }; function: number; instruction: number; functionName: string | null; } | null; MoveAbort: [{ module: { address: string; name: string; }; function: number; instruction: number; functionName: string | null; }, string]; VMVerificationOrDeserializationError: true; VMInvariantViolation: true; FunctionNotFound: true; ArityMismatch: true; TypeArityMismatch: true; NonEntryFunctionInvoked: true; CommandArgumentError: { argIdx: number; kind: EnumOutputShapeWithKeys<{ TypeMismatch: true; InvalidBCSBytes: true; InvalidUsageOfPureArg: true; InvalidArgumentToPrivateEntryFunction: true; IndexOutOfBounds: { idx: ...; }; SecondaryIndexOutOfBounds: { resultIdx: ...; secondaryIdx: ...; }; InvalidResultArity: { resultIdx: ...; }; InvalidGasCoinUsage: true; InvalidValueUsage: true; InvalidObjectByValue: true; InvalidObjectByMutRef: true; SharedObjectOperationNotAllowed: true; }, | "TypeMismatch" | "InvalidBCSBytes" | "InvalidUsageOfPureArg" | "InvalidArgumentToPrivateEntryFunction" | "IndexOutOfBounds" | "SecondaryIndexOutOfBounds" | "InvalidResultArity" | "InvalidGasCoinUsage" | "InvalidValueUsage" | "InvalidObjectByValue" | "InvalidObjectByMutRef" | "SharedObjectOperationNotAllowed">; }; TypeArgumentError: { argumentIdx: number; kind: EnumOutputShapeWithKeys<{ TypeNotFound: true; ConstraintNotSatisfied: true; }, "TypeNotFound" | "ConstraintNotSatisfied">; }; UnusedValueWithoutDrop: { resultIdx: number; secondaryIdx: number; }; InvalidPublicFunctionReturnType: { idx: number; }; InvalidTransferObject: true; EffectsTooLarge: { currentSize: string; maxSize: string; }; PublishUpgradeMissingDependency: true; PublishUpgradeDependencyDowngrade: true; PackageUpgradeError: { upgradeError: EnumOutputShapeWithKeys<{ UnableToFetchPackage: { packageId: ...; }; NotAPackage: { objectId: ...; }; IncompatibleUpgrade: true; DigestDoesNotMatch: { digest: ...; }; UnknownUpgradePolicy: { policy: ...; }; PackageIDDoesNotMatch: { packageId: ...; ticketId: ...; }; }, | "UnableToFetchPackage" | "NotAPackage" | "IncompatibleUpgrade" | "DigestDoesNotMatch" | "UnknownUpgradePolicy" | "PackageIDDoesNotMatch">; }; WrittenObjectsTooLarge: { currentSize: string; maxSize: string; }; CertificateDenied: true; IotaMoveVerificationTimedout: true; SharedObjectOperationNotAllowed: true; InputObjectDeleted: true; ExecutionCancelledDueToSharedObjectCongestion: { congestedObjects: string[]; }; AddressDeniedForCoin: { address: string; coinType: string; }; CoinTypeGlobalPause: { coinType: string; }; ExecutionCancelledDueToRandomnessUnavailable: true; }, | "InsufficientGas" | "InvalidGasObject" | "InvariantViolation" | "FeatureNotYetSupported" | "MoveObjectTooBig" | "MovePackageTooBig" | "CircularObjectOwnership" | "InsufficientCoinBalance" | "CoinBalanceOverflow" | "PublishErrorNonZeroAddress" | "IotaMoveVerificationError" | "MovePrimitiveRuntimeError" | "MoveAbort" | "VMVerificationOrDeserializationError" | "VMInvariantViolation" | "FunctionNotFound" | "ArityMismatch" | "TypeArityMismatch" | "NonEntryFunctionInvoked" | "CommandArgumentError" | "SharedObjectOperationNotAllowed" | "TypeArgumentError" | "UnusedValueWithoutDrop" | "InvalidPublicFunctionReturnType" | "InvalidTransferObject" | "EffectsTooLarge" | "PublishUpgradeMissingDependency" | "PublishUpgradeDependencyDowngrade" | "PackageUpgradeError" | "WrittenObjectsTooLarge" | "CertificateDenied" | "IotaMoveVerificationTimedout" | "InputObjectDeleted" | "ExecutionCancelledDueToSharedObjectCongestion" | "AddressDeniedForCoin" | "CoinTypeGlobalPause" | "ExecutionCancelledDueToRandomnessUnavailable">; command: string | null; }; }, "Success" | "Failed">; executedEpoch: string; gasUsed: { computationCost: string; computationCostBurned: string; storageCost: string; storageRebate: string; nonRefundableStorageFee: string; }; transactionDigest: string; gasObjectIndex: number | null; eventsDigest: string | null; dependencies: string[]; lamportVersion: string; changedObjects: [string, { inputState: EnumOutputShapeWithKeys<{ NotExist: true; Exist: [[string, string], EnumOutputShapeWithKeys<{ AddressOwner: string; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; Immutable: true; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; }, "NotExist" | "Exist">; outputState: EnumOutputShapeWithKeys<{ NotExist: true; ObjectWrite: [string, EnumOutputShapeWithKeys<{ AddressOwner: string; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; Immutable: true; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; PackageWrite: [string, string]; }, "NotExist" | "ObjectWrite" | "PackageWrite">; idOperation: EnumOutputShapeWithKeys<{ None: true; Created: true; Deleted: true; }, "None" | "Created" | "Deleted">; }][]; unchangedSharedObjects: [string, EnumOutputShapeWithKeys<{ ReadOnlyRoot: [string, string]; MutateDeleted: string; ReadDeleted: string; Cancelled: string; PerEpochConfig: true; }, | "ReadOnlyRoot" | "MutateDeleted" | "ReadDeleted" | "Cancelled" | "PerEpochConfig">][]; auxDataDigest: string | null; }
effects.V1.statusEnumOutputShapeWithKeys<{ Success: true; Failed: { error: EnumOutputShapeWithKeys<{ InsufficientGas: true; InvalidGasObject: true; InvariantViolation: true; FeatureNotYetSupported: true; MoveObjectTooBig: { objectSize: string; maxObjectSize: string; }; MovePackageTooBig: { objectSize: string; maxObjectSize: string; }; CircularObjectOwnership: { object: string; }; InsufficientCoinBalance: true; CoinBalanceOverflow: true; PublishErrorNonZeroAddress: true; IotaMoveVerificationError: true; MovePrimitiveRuntimeError: | { module: { address: string; name: string; }; function: number; instruction: number; functionName: string | null; } | null; MoveAbort: [{ module: { address: string; name: string; }; function: number; instruction: number; functionName: string | null; }, string]; VMVerificationOrDeserializationError: true; VMInvariantViolation: true; FunctionNotFound: true; ArityMismatch: true; TypeArityMismatch: true; NonEntryFunctionInvoked: true; CommandArgumentError: { argIdx: number; kind: EnumOutputShapeWithKeys<{ TypeMismatch: true; InvalidBCSBytes: true; InvalidUsageOfPureArg: true; InvalidArgumentToPrivateEntryFunction: true; IndexOutOfBounds: { idx: ...; }; SecondaryIndexOutOfBounds: { resultIdx: ...; secondaryIdx: ...; }; InvalidResultArity: { resultIdx: ...; }; InvalidGasCoinUsage: true; InvalidValueUsage: true; InvalidObjectByValue: true; InvalidObjectByMutRef: true; SharedObjectOperationNotAllowed: true; }, | "TypeMismatch" | "InvalidBCSBytes" | "InvalidUsageOfPureArg" | "InvalidArgumentToPrivateEntryFunction" | "IndexOutOfBounds" | "SecondaryIndexOutOfBounds" | "InvalidResultArity" | "InvalidGasCoinUsage" | "InvalidValueUsage" | "InvalidObjectByValue" | "InvalidObjectByMutRef" | "SharedObjectOperationNotAllowed">; }; TypeArgumentError: { argumentIdx: number; kind: EnumOutputShapeWithKeys<{ TypeNotFound: true; ConstraintNotSatisfied: true; }, "TypeNotFound" | "ConstraintNotSatisfied">; }; UnusedValueWithoutDrop: { resultIdx: number; secondaryIdx: number; }; InvalidPublicFunctionReturnType: { idx: number; }; InvalidTransferObject: true; EffectsTooLarge: { currentSize: string; maxSize: string; }; PublishUpgradeMissingDependency: true; PublishUpgradeDependencyDowngrade: true; PackageUpgradeError: { upgradeError: EnumOutputShapeWithKeys<{ UnableToFetchPackage: { packageId: ...; }; NotAPackage: { objectId: ...; }; IncompatibleUpgrade: true; DigestDoesNotMatch: { digest: ...; }; UnknownUpgradePolicy: { policy: ...; }; PackageIDDoesNotMatch: { packageId: ...; ticketId: ...; }; }, | "UnableToFetchPackage" | "NotAPackage" | "IncompatibleUpgrade" | "DigestDoesNotMatch" | "UnknownUpgradePolicy" | "PackageIDDoesNotMatch">; }; WrittenObjectsTooLarge: { currentSize: string; maxSize: string; }; CertificateDenied: true; IotaMoveVerificationTimedout: true; SharedObjectOperationNotAllowed: true; InputObjectDeleted: true; ExecutionCancelledDueToSharedObjectCongestion: { congestedObjects: string[]; }; AddressDeniedForCoin: { address: string; coinType: string; }; CoinTypeGlobalPause: { coinType: string; }; ExecutionCancelledDueToRandomnessUnavailable: true; }, | "InsufficientGas" | "InvalidGasObject" | "InvariantViolation" | "FeatureNotYetSupported" | "MoveObjectTooBig" | "MovePackageTooBig" | "CircularObjectOwnership" | "InsufficientCoinBalance" | "CoinBalanceOverflow" | "PublishErrorNonZeroAddress" | "IotaMoveVerificationError" | "MovePrimitiveRuntimeError" | "MoveAbort" | "VMVerificationOrDeserializationError" | "VMInvariantViolation" | "FunctionNotFound" | "ArityMismatch" | "TypeArityMismatch" | "NonEntryFunctionInvoked" | "CommandArgumentError" | "SharedObjectOperationNotAllowed" | "TypeArgumentError" | "UnusedValueWithoutDrop" | "InvalidPublicFunctionReturnType" | "InvalidTransferObject" | "EffectsTooLarge" | "PublishUpgradeMissingDependency" | "PublishUpgradeDependencyDowngrade" | "PackageUpgradeError" | "WrittenObjectsTooLarge" | "CertificateDenied" | "IotaMoveVerificationTimedout" | "InputObjectDeleted" | "ExecutionCancelledDueToSharedObjectCongestion" | "AddressDeniedForCoin" | "CoinTypeGlobalPause" | "ExecutionCancelledDueToRandomnessUnavailable">; command: string | null; }; }, "Success" | "Failed">
effects.V1.executedEpochstring
effects.V1.gasUsed{ computationCost: string; computationCostBurned: string; storageCost: string; storageRebate: string; nonRefundableStorageFee: string; }
effects.V1.gasUsed.computationCoststring
effects.V1.gasUsed.computationCostBurnedstring
effects.V1.gasUsed.storageCoststring
effects.V1.gasUsed.storageRebatestring
effects.V1.gasUsed.nonRefundableStorageFeestring
effects.V1.transactionDigeststring
effects.V1.gasObjectIndexnumber | null
effects.V1.eventsDigeststring | null
effects.V1.dependenciesstring[]
effects.V1.lamportVersionstring
effects.V1.changedObjects[string, { inputState: EnumOutputShapeWithKeys<{ NotExist: true; Exist: [[string, string], EnumOutputShapeWithKeys<{ AddressOwner: string; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; Immutable: true; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; }, "NotExist" | "Exist">; outputState: EnumOutputShapeWithKeys<{ NotExist: true; ObjectWrite: [string, EnumOutputShapeWithKeys<{ AddressOwner: string; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; Immutable: true; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; PackageWrite: [string, string]; }, "NotExist" | "ObjectWrite" | "PackageWrite">; idOperation: EnumOutputShapeWithKeys<{ None: true; Created: true; Deleted: true; }, "None" | "Created" | "Deleted">; }][]
effects.V1.unchangedSharedObjects[string, EnumOutputShapeWithKeys<{ ReadOnlyRoot: [string, string]; MutateDeleted: string; ReadDeleted: string; Cancelled: string; PerEpochConfig: true; }, | "ReadOnlyRoot" | "MutateDeleted" | "ReadDeleted" | "Cancelled" | "PerEpochConfig">][]
effects.V1.auxDataDigeststring | null

Returns

Promise<void>