Skip to main content

ObjectCache

@iota/iota-sdk


@iota/iota-sdk / transactions / ObjectCache

Class: ObjectCache

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:158

Constructors

Constructor

new ObjectCache(__namedParameters): ObjectCache

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:162

Parameters

__namedParameters

ObjectCacheOptions

Returns

ObjectCache

Methods

applyEffects()

applyEffects(effects): Promise<void>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:272

Parameters

effects
$kind

"V1"

V1

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

V1.auxDataDigest

string | null = ...

V1.changedObjects

[string, { idOperation: EnumOutputShapeWithKeys<{ Created: true; Deleted: true; None: true; }, "None" | "Created" | "Deleted">; inputState: EnumOutputShapeWithKeys<{ Exist: [[string, string], EnumOutputShapeWithKeys<{ AddressOwner: string; Immutable: true; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; NotExist: true; }, "NotExist" | "Exist">; outputState: EnumOutputShapeWithKeys<{ NotExist: true; ObjectWrite: [string, EnumOutputShapeWithKeys<{ AddressOwner: string; Immutable: true; ObjectOwner: string; Shared: { initialSharedVersion: ...; }; }, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable">]; PackageWrite: [string, string]; }, "NotExist" | "ObjectWrite" | "PackageWrite">; }][] = ...

V1.dependencies

string[] = ...

V1.eventsDigest

string | null = ...

V1.executedEpoch

string = ...

V1.gasObjectIndex

number | null = ...

V1.gasUsed

{ computationCost: string; computationCostBurned: string; nonRefundableStorageFee: string; storageCost: string; storageRebate: string; } = GasCostSummary

V1.gasUsed.computationCost

string = ...

V1.gasUsed.computationCostBurned

string = ...

V1.gasUsed.nonRefundableStorageFee

string = ...

V1.gasUsed.storageCost

string = ...

V1.gasUsed.storageRebate

string = ...

V1.lamportVersion

string = ...

V1.status

EnumOutputShapeWithKeys<{ Failed: { command: string | null; error: EnumOutputShapeWithKeys<{ AddressDeniedForCoin: { address: string; coinType: string; }; ArityMismatch: true; CertificateDenied: true; CircularObjectOwnership: { object: string; }; CoinBalanceOverflow: true; CoinTypeGlobalPause: { coinType: string; }; CommandArgumentError: { argIdx: number; kind: EnumOutputShapeWithKeys<{ IndexOutOfBounds: { idx: ...; }; InvalidArgumentToPrivateEntryFunction: true; InvalidBCSBytes: true; InvalidGasCoinUsage: true; InvalidObjectByMutRef: true; InvalidObjectByValue: true; InvalidResultArity: { resultIdx: ...; }; InvalidUsageOfPureArg: true; InvalidValueUsage: true; SecondaryIndexOutOfBounds: { resultIdx: ...; secondaryIdx: ...; }; SharedObjectOperationNotAllowed: true; TypeMismatch: true; }, "TypeMismatch" | "InvalidBCSBytes" | "InvalidUsageOfPureArg" | "InvalidArgumentToPrivateEntryFunction" | "IndexOutOfBounds" | "SecondaryIndexOutOfBounds" | "InvalidResultArity" | "InvalidGasCoinUsage" | "InvalidValueUsage" | "InvalidObjectByValue" | "InvalidObjectByMutRef" | "SharedObjectOperationNotAllowed">; }; EffectsTooLarge: { currentSize: string; maxSize: string; }; ExecutionCancelledDueToRandomnessUnavailable: true; ExecutionCancelledDueToSharedObjectCongestion: { congestedObjects: string[]; }; FeatureNotYetSupported: true; FunctionNotFound: true; InputObjectDeleted: true; InsufficientCoinBalance: true; InsufficientGas: true; InvalidGasObject: true; InvalidPublicFunctionReturnType: { idx: number; }; InvalidTransferObject: true; InvariantViolation: true; IotaMoveVerificationError: true; IotaMoveVerificationTimedout: true; MoveAbort: [{ function: number; functionName: string | null; instruction: number; module: { address: string; name: string; }; }, string]; MoveObjectTooBig: { maxObjectSize: string; objectSize: string; }; MovePackageTooBig: { maxObjectSize: string; objectSize: string; }; MovePrimitiveRuntimeError: { function: number; functionName: string | null; instruction: number; module: { address: string; name: string; }; } | null; NonEntryFunctionInvoked: true; PackageUpgradeError: { upgradeError: EnumOutputShapeWithKeys<{ DigestDoesNotMatch: { digest: ...; }; IncompatibleUpgrade: true; NotAPackage: { objectId: ...; }; PackageIDDoesNotMatch: { packageId: ...; ticketId: ...; }; UnableToFetchPackage: { packageId: ...; }; UnknownUpgradePolicy: { policy: ...; }; }, "UnableToFetchPackage" | "NotAPackage" | "IncompatibleUpgrade" | "DigestDoesNotMatch" | "UnknownUpgradePolicy" | "PackageIDDoesNotMatch">; }; PublishErrorNonZeroAddress: true; PublishUpgradeDependencyDowngrade: true; PublishUpgradeMissingDependency: true; SharedObjectOperationNotAllowed: true; TypeArgumentError: { argumentIdx: number; kind: EnumOutputShapeWithKeys<{ ConstraintNotSatisfied: true; TypeNotFound: true; }, "TypeNotFound" | "ConstraintNotSatisfied">; }; TypeArityMismatch: true; UnusedValueWithoutDrop: { resultIdx: number; secondaryIdx: number; }; VMInvariantViolation: true; VMVerificationOrDeserializationError: true; WrittenObjectsTooLarge: { currentSize: string; maxSize: string; }; }, "PackageUpgradeError" | "CommandArgumentError" | "SharedObjectOperationNotAllowed" | "TypeArgumentError" | "InsufficientGas" | "InvalidGasObject" | "InvariantViolation" | "FeatureNotYetSupported" | "MoveObjectTooBig" | "MovePackageTooBig" | "CircularObjectOwnership" | "InsufficientCoinBalance" | "CoinBalanceOverflow" | "PublishErrorNonZeroAddress" | "IotaMoveVerificationError" | "MovePrimitiveRuntimeError" | "MoveAbort" | "VMVerificationOrDeserializationError" | "VMInvariantViolation" | "FunctionNotFound" | "ArityMismatch" | "TypeArityMismatch" | "NonEntryFunctionInvoked" | "UnusedValueWithoutDrop" | "InvalidPublicFunctionReturnType" | "InvalidTransferObject" | "EffectsTooLarge" | "PublishUpgradeMissingDependency" | "PublishUpgradeDependencyDowngrade" | "WrittenObjectsTooLarge" | "CertificateDenied" | "IotaMoveVerificationTimedout" | "InputObjectDeleted" | "ExecutionCancelledDueToSharedObjectCongestion" | "AddressDeniedForCoin" | "CoinTypeGlobalPause" | "ExecutionCancelledDueToRandomnessUnavailable">; }; Success: true; }, "Success" | "Failed"> = ExecutionStatus

V1.transactionDigest

string = ObjectDigest

V1.unchangedSharedObjects

[string, EnumOutputShapeWithKeys<{ Cancelled: string; MutateDeleted: string; PerEpochConfig: true; ReadDeleted: string; ReadOnlyRoot: [string, string]; }, "ReadOnlyRoot" | "MutateDeleted" | "ReadDeleted" | "Cancelled" | "PerEpochConfig">][] = ...

Returns

Promise<void>


asPlugin()

asPlugin(): TransactionPlugin

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:167

Returns

TransactionPlugin


clear()

clear(): Promise<void>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:236

Returns

Promise<void>


clearCustom()

clearCustom(): Promise<void>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:256

Returns

Promise<void>


clearOwnedObjects()

clearOwnedObjects(): Promise<void>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:252

Returns

Promise<void>


deleteCustom()

deleteCustom(key): Promise<void>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:268

Parameters

key

string

Returns

Promise<void>


deleteObjects()

deleteObjects(ids): Promise<void>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:248

Parameters

ids

string[]

Returns

Promise<void>


getCustom()

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

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:260

Type Parameters

T

T

Parameters

key

string

Returns

Promise<T | null>


getMoveFunctionDefinition()

getMoveFunctionDefinition(ref): Promise<MoveFunctionCacheEntry | null>

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:240

Parameters

ref
function

string

module

string

package

string

Returns

Promise<MoveFunctionCacheEntry | null>


getObjects()

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

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:244

Parameters

ids

string[]

Returns

Promise<(ObjectCacheEntry | null)[]>


setCustom()

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

Defined in: sdk/typescript/src/transactions/ObjectCache.ts:264

Type Parameters

T

T

Parameters

key

string

value

T

Returns

Promise<void>