Skip to main content
Version: 11.x

Variable: cairoTypeStrategy

const cairoTypeStrategy: CairoTypeStrategy

Defined in: src/utils/calldata/parser/cairoTypeStrategy.ts:160

The strategy the composite classes drive.

It carries the leaf types, and the composites whose abi type is a family rather than one string — tuple, array, Option, Result, NonZero, fixed array — each found through dynamicSelectors. A contract's own structs and enums are added by the parser. This is the default strategy of the Cairo 1 parsers, AbiParser1 and AbiParser2.

Example​

const felts = cairoTypeStrategy.constructors['core::integer::u8'](44, cairoTypeStrategy)
.toApiRequest();
// felts = ["44"]