Skip to main content
Version: Next

Function: execution()

execution(staticEx?, ifEqual?, ifNotEqual?): CairoCustomEnum

Defined in: src/utils/starknetId.ts:331

Returns a CairoCustomEnum object.

Functions to build CairoCustomEnum for multiCall contracts

Parameters

staticEx?

An optional object defining the "Static" value of the CairoCustomEnum.

ifEqual?

number[] = undefined

An optional array defining the "IfEqual" value of the CairoCustomEnum.

ifNotEqual?

number[] = undefined

An optional array defining the "IfNotEqual" value of the CairoCustomEnum.

Returns

CairoCustomEnum

  • The created CairoCustomEnum object.

Example

const result: CairoCustomEnum = starknetId.execution(undefined, [1, 2, 3], undefined);
// result = CairoCustomEnum {
// variant: {
// Static: undefined,
// IfEqual: { '0': 1, '1': 2, '2': 3 },
// IfNotEqual: undefined
// }
// }