starknet 5.18.0 → 5.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -12
- package/dist/index.d.ts +207 -6
- package/dist/index.global.js +628 -138
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +634 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +628 -138
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
# [5.
|
|
1
|
+
# [5.19.0](https://github.com/0xs34n/starknet.js/compare/v5.18.0...v5.19.0) (2023-08-11)
|
|
2
2
|
|
|
3
3
|
### Bug Fixes
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
5
|
+
- add function definition to the contract interface + doc ([06498d5](https://github.com/0xs34n/starknet.js/commit/06498d539bc2b816982e0245ae3b6508665f03f7))
|
|
6
|
+
- contract test status ([53cfaf9](https://github.com/0xs34n/starknet.js/commit/53cfaf935d1b053f5bcd17ffcb1ae48d9e8a4eef))
|
|
7
|
+
- fix multiple same events + add cairo code + seperate tests, legacy and Cairo1 ([7c93157](https://github.com/0xs34n/starknet.js/commit/7c93157d60864989efec37a05521979a2548e4d8))
|
|
8
|
+
- modify parseEvents structure + add testcase for multiple different event in same tx ([b63b0d6](https://github.com/0xs34n/starknet.js/commit/b63b0d631d163e181c8a42a634f107d2761e35ca))
|
|
9
|
+
- optional struct and enum in responseParser ([14d3cca](https://github.com/0xs34n/starknet.js/commit/14d3cca97a3cebedf07466f98dd46639999421c2))
|
|
10
|
+
- patch merge, and add enums to event parser ([00f8073](https://github.com/0xs34n/starknet.js/commit/00f8073418eef1e2eebf105884357561b959fb7c))
|
|
11
|
+
- remove exports from responseParser functions ([3d86446](https://github.com/0xs34n/starknet.js/commit/3d864463579fc68c4538bbbc7820420ec64b15eb))
|
|
12
|
+
- repair SequencerProvider network resolution ([e42dfc1](https://github.com/0xs34n/starknet.js/commit/e42dfc1e722d4a77bc52102a94295ee7ab6a460d))
|
|
13
|
+
- restore package-lock to previous state ([2fe0564](https://github.com/0xs34n/starknet.js/commit/2fe0564ed042537e480ea8481c787fe7359ba4a8))
|
|
13
14
|
|
|
14
15
|
### Features
|
|
15
16
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
17
|
+
- add ethAddress handling ([2a93f90](https://github.com/0xs34n/starknet.js/commit/2a93f90cc9e7e697a153e42b9ebd19dec6f1880f))
|
|
18
|
+
- cairo enum in request parser ([ad44481](https://github.com/0xs34n/starknet.js/commit/ad4448129058b76fede61675d46a37a6c74f0d16))
|
|
19
|
+
- cairo enum in response parser ([a936a11](https://github.com/0xs34n/starknet.js/commit/a936a11ca34af628ec187740616b8c5a804e9d65)), closes [#670](https://github.com/0xs34n/starknet.js/issues/670) [#665](https://github.com/0xs34n/starknet.js/issues/665) [#664](https://github.com/0xs34n/starknet.js/issues/664) [#1](https://github.com/0xs34n/starknet.js/issues/1) [#675](https://github.com/0xs34n/starknet.js/issues/675) [#1](https://github.com/0xs34n/starknet.js/issues/1) [#675](https://github.com/0xs34n/starknet.js/issues/675) [#1](https://github.com/0xs34n/starknet.js/issues/1) [#670](https://github.com/0xs34n/starknet.js/issues/670) [#665](https://github.com/0xs34n/starknet.js/issues/665) [#664](https://github.com/0xs34n/starknet.js/issues/664) [#1](https://github.com/0xs34n/starknet.js/issues/1) [#675](https://github.com/0xs34n/starknet.js/issues/675) [#1](https://github.com/0xs34n/starknet.js/issues/1)
|
|
20
|
+
- implement event parsing ([86cc430](https://github.com/0xs34n/starknet.js/commit/86cc430cff2b6f338edecce29819260b475a3907))
|
|
21
|
+
- new Cairo types ([f9db09e](https://github.com/0xs34n/starknet.js/commit/f9db09eeab05fd0c1692229fcdbbc020b4954f3e))
|
|
19
22
|
|
|
20
23
|
# [5.17.0](https://github.com/0xs34n/starknet.js/compare/v5.16.0...v5.17.0) (2023-07-18)
|
|
21
24
|
|
package/dist/index.d.ts
CHANGED
|
@@ -163,12 +163,125 @@ declare namespace ec {
|
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
type CairoEnumRaw = {
|
|
167
|
+
[key: string]: any;
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Class to handle Cairo custom Enum
|
|
171
|
+
* @param enumContent object containing the variants and its content. Example :
|
|
172
|
+
* {Success: 234, Warning: undefined, Error: undefined}.
|
|
173
|
+
* Only one variant with a value, object, array.
|
|
174
|
+
* @returns an instance representing a Cairo custom Enum.
|
|
175
|
+
* @example ```typescript
|
|
176
|
+
* const myCairoEnum = new CairoCustomEnum( {Success: undefined, Warning: "0x7f32ea", Error: undefined})
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
declare class CairoCustomEnum {
|
|
180
|
+
/**
|
|
181
|
+
* direct readonly access to variants of the Cairo Custom Enum.
|
|
182
|
+
* @returns a value of type any
|
|
183
|
+
* @example ```typescript
|
|
184
|
+
* const successValue = myCairoEnum.variant.Success;
|
|
185
|
+
*/
|
|
186
|
+
readonly variant: CairoEnumRaw;
|
|
187
|
+
/**
|
|
188
|
+
* @param enumContent an object with the variants as keys and the content as value. Only one content shall be defined.
|
|
189
|
+
*/
|
|
190
|
+
constructor(enumContent: CairoEnumRaw);
|
|
191
|
+
/**
|
|
192
|
+
*
|
|
193
|
+
* @returns the content of the valid variant of a Cairo custom Enum.
|
|
194
|
+
*/
|
|
195
|
+
unwrap(): any;
|
|
196
|
+
/**
|
|
197
|
+
*
|
|
198
|
+
* @returns the name of the valid variant of a Cairo custom Enum.
|
|
199
|
+
*/
|
|
200
|
+
activeVariant(): string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
declare enum CairoOptionVariant {
|
|
204
|
+
Some = 0,
|
|
205
|
+
None = 1
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Class to handle Cairo Option
|
|
209
|
+
* @param variant CairoOptionVariant.Some or CairoOptionVariant.None
|
|
210
|
+
* @param someContent value of type T.
|
|
211
|
+
* @returns an instance representing a Cairo Option.
|
|
212
|
+
* @example ```typescript
|
|
213
|
+
* const myOption = new CairoOption<BigNumberish>(CairoOptionVariant.Some, "0x54dda8");
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
declare class CairoOption<T> {
|
|
217
|
+
readonly Some?: T;
|
|
218
|
+
readonly None?: boolean;
|
|
219
|
+
constructor(variant: CairoOptionVariant, someContent?: T);
|
|
220
|
+
/**
|
|
221
|
+
*
|
|
222
|
+
* @returns the content of the valid variant of a Cairo custom Enum.
|
|
223
|
+
* If None, returns 'undefined'.
|
|
224
|
+
*/
|
|
225
|
+
unwrap(): T | undefined;
|
|
226
|
+
/**
|
|
227
|
+
*
|
|
228
|
+
* @returns true if the valid variant is 'isSome'.
|
|
229
|
+
*/
|
|
230
|
+
isSome(): boolean;
|
|
231
|
+
/**
|
|
232
|
+
*
|
|
233
|
+
* @returns true if the valid variant is 'isNone'.
|
|
234
|
+
*/
|
|
235
|
+
isNone(): boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
declare enum CairoResultVariant {
|
|
239
|
+
Ok = 0,
|
|
240
|
+
Err = 1
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Class to handle Cairo Result
|
|
244
|
+
* @param variant CairoResultVariant.Ok or CairoResultVariant.Err
|
|
245
|
+
* @param resultContent value of type T or U.
|
|
246
|
+
* @returns an instance representing a Cairo Result.
|
|
247
|
+
* @example ```typescript
|
|
248
|
+
* const myOption = new CairoResult<BigNumberish,CustomError>(CairoResultVariant.Ok, "0x54dda8");
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
declare class CairoResult<T, U> {
|
|
252
|
+
readonly Ok?: T;
|
|
253
|
+
readonly Err?: U;
|
|
254
|
+
constructor(variant: CairoResultVariant, resultContent: T | U);
|
|
255
|
+
/**
|
|
256
|
+
*
|
|
257
|
+
* @returns the content of the valid variant of a Cairo Result.
|
|
258
|
+
*/
|
|
259
|
+
unwrap(): T | U;
|
|
260
|
+
/**
|
|
261
|
+
*
|
|
262
|
+
* @returns true if the valid variant is 'Ok'.
|
|
263
|
+
*/
|
|
264
|
+
isOk(): boolean;
|
|
265
|
+
/**
|
|
266
|
+
*
|
|
267
|
+
* @returns true if the valid variant is 'isErr'.
|
|
268
|
+
*/
|
|
269
|
+
isErr(): boolean;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
type CairoEnum = CairoCustomEnum | CairoOption<any> | CairoResult<any, any>;
|
|
273
|
+
|
|
166
274
|
/** ABI */
|
|
167
|
-
type Abi = Array<FunctionAbi | EventAbi | StructAbi>;
|
|
275
|
+
type Abi = Array<FunctionAbi | EventAbi | StructAbi | any>;
|
|
168
276
|
type AbiEntry = {
|
|
169
277
|
name: string;
|
|
170
278
|
type: 'felt' | 'felt*' | string;
|
|
171
279
|
};
|
|
280
|
+
type EventEntry = {
|
|
281
|
+
name: string;
|
|
282
|
+
type: 'felt' | 'felt*' | string;
|
|
283
|
+
kind: 'key' | 'data';
|
|
284
|
+
};
|
|
172
285
|
declare enum FunctionAbiType {
|
|
173
286
|
'function' = 0,
|
|
174
287
|
'l1_handler' = 1,
|
|
@@ -193,7 +306,33 @@ type StructAbi = {
|
|
|
193
306
|
size: number;
|
|
194
307
|
type: 'struct';
|
|
195
308
|
};
|
|
196
|
-
type
|
|
309
|
+
type AbiEnums = {
|
|
310
|
+
[name: string]: EnumAbi;
|
|
311
|
+
};
|
|
312
|
+
type EnumAbi = {
|
|
313
|
+
variants: (AbiEntry & {
|
|
314
|
+
offset: number;
|
|
315
|
+
})[];
|
|
316
|
+
name: string;
|
|
317
|
+
size: number;
|
|
318
|
+
type: 'enum';
|
|
319
|
+
};
|
|
320
|
+
type AbiEvents = {
|
|
321
|
+
[hash: string]: EventAbi;
|
|
322
|
+
};
|
|
323
|
+
type EventAbi = Cairo1Event | LegacyEvent;
|
|
324
|
+
type Cairo1Event = {
|
|
325
|
+
name: string;
|
|
326
|
+
members: EventEntry[];
|
|
327
|
+
kind: 'struct';
|
|
328
|
+
type: 'event';
|
|
329
|
+
};
|
|
330
|
+
type LegacyEvent = {
|
|
331
|
+
name: string;
|
|
332
|
+
type: 'event';
|
|
333
|
+
data: EventEntry[];
|
|
334
|
+
keys: EventEntry[];
|
|
335
|
+
};
|
|
197
336
|
|
|
198
337
|
/** LEGACY CONTRACT */
|
|
199
338
|
/**
|
|
@@ -331,7 +470,7 @@ type RawArgsObject = {
|
|
|
331
470
|
[inputName: string]: MultiType | MultiType[] | RawArgs;
|
|
332
471
|
};
|
|
333
472
|
type RawArgsArray = Array<MultiType | MultiType[] | RawArgs>;
|
|
334
|
-
type MultiType = BigNumberish | Uint256 | object | boolean;
|
|
473
|
+
type MultiType = BigNumberish | Uint256 | object | boolean | CairoEnum;
|
|
335
474
|
type UniversalDeployerContractPayload = {
|
|
336
475
|
classHash: BigNumberish;
|
|
337
476
|
salt?: string;
|
|
@@ -475,7 +614,7 @@ type Args = {
|
|
|
475
614
|
[inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[];
|
|
476
615
|
};
|
|
477
616
|
type ParsedStruct = {
|
|
478
|
-
[key: string]: BigNumberish | ParsedStruct;
|
|
617
|
+
[key: string]: BigNumberish | BigNumberish[] | ParsedStruct | Uint256;
|
|
479
618
|
};
|
|
480
619
|
type waitForTransactionOptions = {
|
|
481
620
|
retryInterval?: number;
|
|
@@ -2209,12 +2348,16 @@ declare enum Uint {
|
|
|
2209
2348
|
u128 = "core::integer::u128",
|
|
2210
2349
|
u256 = "core::integer::u256"
|
|
2211
2350
|
}
|
|
2351
|
+
declare enum Litteral {
|
|
2352
|
+
ClassHash = "core::starknet::class_hash::ClassHash",
|
|
2353
|
+
ContractAddress = "core::starknet::contract_address::ContractAddress"
|
|
2354
|
+
}
|
|
2212
2355
|
|
|
2213
2356
|
type AsyncContractFunction<T = any> = (...args: ArgsOrCalldataWithOptions) => Promise<T>;
|
|
2214
2357
|
type ContractFunction = (...args: ArgsOrCalldataWithOptions) => any;
|
|
2215
2358
|
type Result = {
|
|
2216
2359
|
[key: string]: any;
|
|
2217
|
-
} | Result[] | bigint | string | boolean;
|
|
2360
|
+
} | Result[] | bigint | string | boolean | CairoEnum;
|
|
2218
2361
|
type ArgsOrCalldata = RawArgsArray | [Calldata] | Calldata;
|
|
2219
2362
|
type ArgsOrCalldataWithOptions = ArgsOrCalldata & ContractOptions;
|
|
2220
2363
|
type ContractOptions = {
|
|
@@ -2231,6 +2374,10 @@ type ContractOptions = {
|
|
|
2231
2374
|
};
|
|
2232
2375
|
type CallOptions = Pick<ContractOptions, 'blockIdentifier' | 'parseRequest' | 'parseResponse' | 'formatResponse'>;
|
|
2233
2376
|
type InvokeOptions = Pick<ContractOptions, 'maxFee' | 'nonce' | 'signature' | 'parseRequest'>;
|
|
2377
|
+
type ParsedEvent = {
|
|
2378
|
+
[name: string]: ParsedStruct;
|
|
2379
|
+
};
|
|
2380
|
+
type ParsedEvents = Array<ParsedEvent>;
|
|
2234
2381
|
|
|
2235
2382
|
interface InvocationsSignerDetails extends Required<InvocationsDetails> {
|
|
2236
2383
|
walletAddress: string;
|
|
@@ -2286,6 +2433,8 @@ interface TypedData {
|
|
|
2286
2433
|
|
|
2287
2434
|
type index_Abi = Abi;
|
|
2288
2435
|
type index_AbiEntry = AbiEntry;
|
|
2436
|
+
type index_AbiEnums = AbiEnums;
|
|
2437
|
+
type index_AbiEvents = AbiEvents;
|
|
2289
2438
|
type index_AbiStructs = AbiStructs;
|
|
2290
2439
|
type index_AccountInvocationItem = AccountInvocationItem;
|
|
2291
2440
|
type index_AccountInvocations = AccountInvocations;
|
|
@@ -2305,8 +2454,10 @@ type index_BlockTag = BlockTag;
|
|
|
2305
2454
|
declare const index_BlockTag: typeof BlockTag;
|
|
2306
2455
|
type index_Builtins = Builtins;
|
|
2307
2456
|
type index_ByteCode = ByteCode;
|
|
2457
|
+
type index_Cairo1Event = Cairo1Event;
|
|
2308
2458
|
type index_CairoAssembly = CairoAssembly;
|
|
2309
2459
|
type index_CairoContract = CairoContract;
|
|
2460
|
+
type index_CairoEnum = CairoEnum;
|
|
2310
2461
|
type index_CairoVersion = CairoVersion;
|
|
2311
2462
|
type index_Call = Call;
|
|
2312
2463
|
type index_CallContractResponse = CallContractResponse;
|
|
@@ -2345,6 +2496,7 @@ type index_Details = Details;
|
|
|
2345
2496
|
type index_EntryPointType = EntryPointType;
|
|
2346
2497
|
declare const index_EntryPointType: typeof EntryPointType;
|
|
2347
2498
|
type index_EntryPointsByType = EntryPointsByType;
|
|
2499
|
+
type index_EnumAbi = EnumAbi;
|
|
2348
2500
|
type index_EstimateFee = EstimateFee;
|
|
2349
2501
|
type index_EstimateFeeAction = EstimateFeeAction;
|
|
2350
2502
|
type index_EstimateFeeBulk = EstimateFeeBulk;
|
|
@@ -2352,6 +2504,8 @@ type index_EstimateFeeDetails = EstimateFeeDetails;
|
|
|
2352
2504
|
type index_EstimateFeeResponse = EstimateFeeResponse;
|
|
2353
2505
|
type index_EstimateFeeResponseBulk = EstimateFeeResponseBulk;
|
|
2354
2506
|
type index_Event = Event;
|
|
2507
|
+
type index_EventAbi = EventAbi;
|
|
2508
|
+
type index_EventEntry = EventEntry;
|
|
2355
2509
|
type index_ExecutionResources = ExecutionResources;
|
|
2356
2510
|
type index_FunctionAbi = FunctionAbi;
|
|
2357
2511
|
type index_FunctionInvocation = FunctionInvocation;
|
|
@@ -2373,12 +2527,17 @@ type index_InvokeTransactionReceiptResponse = InvokeTransactionReceiptResponse;
|
|
|
2373
2527
|
type index_InvokeTransactionResponse = InvokeTransactionResponse;
|
|
2374
2528
|
type index_LegacyCompiledContract = LegacyCompiledContract;
|
|
2375
2529
|
type index_LegacyContractClass = LegacyContractClass;
|
|
2530
|
+
type index_LegacyEvent = LegacyEvent;
|
|
2531
|
+
type index_Litteral = Litteral;
|
|
2532
|
+
declare const index_Litteral: typeof Litteral;
|
|
2376
2533
|
type index_MessageToL1 = MessageToL1;
|
|
2377
2534
|
type index_MessageToL2 = MessageToL2;
|
|
2378
2535
|
type index_MultiDeployContractResponse = MultiDeployContractResponse;
|
|
2379
2536
|
type index_MultiType = MultiType;
|
|
2380
2537
|
type index_Nonce = Nonce;
|
|
2381
2538
|
type index_OptionalPayload<T> = OptionalPayload<T>;
|
|
2539
|
+
type index_ParsedEvent = ParsedEvent;
|
|
2540
|
+
type index_ParsedEvents = ParsedEvents;
|
|
2382
2541
|
type index_ParsedStruct = ParsedStruct;
|
|
2383
2542
|
type index_Program = Program;
|
|
2384
2543
|
type index_ProviderOptions = ProviderOptions;
|
|
@@ -2431,6 +2590,8 @@ declare namespace index {
|
|
|
2431
2590
|
export {
|
|
2432
2591
|
index_Abi as Abi,
|
|
2433
2592
|
index_AbiEntry as AbiEntry,
|
|
2593
|
+
index_AbiEnums as AbiEnums,
|
|
2594
|
+
index_AbiEvents as AbiEvents,
|
|
2434
2595
|
index_AbiStructs as AbiStructs,
|
|
2435
2596
|
index_AccountInvocationItem as AccountInvocationItem,
|
|
2436
2597
|
index_AccountInvocations as AccountInvocations,
|
|
@@ -2448,8 +2609,10 @@ declare namespace index {
|
|
|
2448
2609
|
index_BlockTag as BlockTag,
|
|
2449
2610
|
index_Builtins as Builtins,
|
|
2450
2611
|
index_ByteCode as ByteCode,
|
|
2612
|
+
index_Cairo1Event as Cairo1Event,
|
|
2451
2613
|
index_CairoAssembly as CairoAssembly,
|
|
2452
2614
|
index_CairoContract as CairoContract,
|
|
2615
|
+
index_CairoEnum as CairoEnum,
|
|
2453
2616
|
index_CairoVersion as CairoVersion,
|
|
2454
2617
|
index_Call as Call,
|
|
2455
2618
|
index_CallContractResponse as CallContractResponse,
|
|
@@ -2488,6 +2651,7 @@ declare namespace index {
|
|
|
2488
2651
|
index_Details as Details,
|
|
2489
2652
|
index_EntryPointType as EntryPointType,
|
|
2490
2653
|
index_EntryPointsByType as EntryPointsByType,
|
|
2654
|
+
index_EnumAbi as EnumAbi,
|
|
2491
2655
|
index_EstimateFee as EstimateFee,
|
|
2492
2656
|
index_EstimateFeeAction as EstimateFeeAction,
|
|
2493
2657
|
index_EstimateFeeBulk as EstimateFeeBulk,
|
|
@@ -2495,6 +2659,8 @@ declare namespace index {
|
|
|
2495
2659
|
index_EstimateFeeResponse as EstimateFeeResponse,
|
|
2496
2660
|
index_EstimateFeeResponseBulk as EstimateFeeResponseBulk,
|
|
2497
2661
|
index_Event as Event,
|
|
2662
|
+
index_EventAbi as EventAbi,
|
|
2663
|
+
index_EventEntry as EventEntry,
|
|
2498
2664
|
index_ExecutionResources as ExecutionResources,
|
|
2499
2665
|
index_FunctionAbi as FunctionAbi,
|
|
2500
2666
|
index_FunctionInvocation as FunctionInvocation,
|
|
@@ -2516,12 +2682,16 @@ declare namespace index {
|
|
|
2516
2682
|
index_InvokeTransactionResponse as InvokeTransactionResponse,
|
|
2517
2683
|
index_LegacyCompiledContract as LegacyCompiledContract,
|
|
2518
2684
|
index_LegacyContractClass as LegacyContractClass,
|
|
2685
|
+
index_LegacyEvent as LegacyEvent,
|
|
2686
|
+
index_Litteral as Litteral,
|
|
2519
2687
|
index_MessageToL1 as MessageToL1,
|
|
2520
2688
|
index_MessageToL2 as MessageToL2,
|
|
2521
2689
|
index_MultiDeployContractResponse as MultiDeployContractResponse,
|
|
2522
2690
|
index_MultiType as MultiType,
|
|
2523
2691
|
index_Nonce as Nonce,
|
|
2524
2692
|
index_OptionalPayload as OptionalPayload,
|
|
2693
|
+
index_ParsedEvent as ParsedEvent,
|
|
2694
|
+
index_ParsedEvents as ParsedEvents,
|
|
2525
2695
|
index_ParsedStruct as ParsedStruct,
|
|
2526
2696
|
index_Program as Program,
|
|
2527
2697
|
index_ProviderOptions as ProviderOptions,
|
|
@@ -3440,6 +3610,13 @@ declare abstract class ContractInterface {
|
|
|
3440
3610
|
* @returns Invocation object
|
|
3441
3611
|
*/
|
|
3442
3612
|
abstract populate(method: string, args?: ArgsOrCalldata): Invocation;
|
|
3613
|
+
/**
|
|
3614
|
+
* Parse contract events of a GetTransactionReceiptResponse received from waitForTransaction. Based on contract's abi
|
|
3615
|
+
*
|
|
3616
|
+
* @param receipt transaction receipt
|
|
3617
|
+
* @returns Events parsed
|
|
3618
|
+
*/
|
|
3619
|
+
abstract parseEvents(receipt: GetTransactionReceiptResponse): ParsedEvents;
|
|
3443
3620
|
/**
|
|
3444
3621
|
* tells if the contract comes from a Cairo 1 contract
|
|
3445
3622
|
*
|
|
@@ -3471,6 +3648,7 @@ declare class Contract implements ContractInterface {
|
|
|
3471
3648
|
protected readonly structs: {
|
|
3472
3649
|
[name: string]: StructAbi;
|
|
3473
3650
|
};
|
|
3651
|
+
protected readonly events: AbiEvents;
|
|
3474
3652
|
readonly functions: {
|
|
3475
3653
|
[name: string]: AsyncContractFunction;
|
|
3476
3654
|
};
|
|
@@ -3500,6 +3678,7 @@ declare class Contract implements ContractInterface {
|
|
|
3500
3678
|
invoke(method: string, args?: ArgsOrCalldata, { parseRequest, maxFee, nonce, signature }?: InvokeOptions): Promise<InvokeFunctionResponse>;
|
|
3501
3679
|
estimate(method: string, args?: ArgsOrCalldata): Promise<EstimateFeeResponse>;
|
|
3502
3680
|
populate(method: string, args?: RawArgs): Call;
|
|
3681
|
+
parseEvents(receipt: GetTransactionReceiptResponse): ParsedEvents;
|
|
3503
3682
|
isCairo1(): boolean;
|
|
3504
3683
|
}
|
|
3505
3684
|
|
|
@@ -4153,10 +4332,15 @@ declare const isTypeArray: (type: string) => boolean;
|
|
|
4153
4332
|
declare const isTypeTuple: (type: string) => boolean;
|
|
4154
4333
|
declare const isTypeNamedTuple: (type: string) => boolean;
|
|
4155
4334
|
declare const isTypeStruct: (type: string, structs: AbiStructs) => boolean;
|
|
4335
|
+
declare const isTypeEnum: (type: string, enums: AbiEnums) => boolean;
|
|
4336
|
+
declare const isTypeOption: (type: string) => boolean;
|
|
4337
|
+
declare const isTypeResult: (type: string) => boolean;
|
|
4156
4338
|
declare const isTypeUint: (type: string) => boolean;
|
|
4339
|
+
declare const isTypeLitteral: (type: string) => boolean;
|
|
4157
4340
|
declare const isTypeUint256: (type: string) => boolean;
|
|
4158
4341
|
declare const isTypeBool: (type: string) => boolean;
|
|
4159
4342
|
declare const isTypeContractAddress: (type: string) => boolean;
|
|
4343
|
+
declare const isTypeEthAddress: (type: string) => boolean;
|
|
4160
4344
|
declare const isCairo1Type: (type: string) => boolean;
|
|
4161
4345
|
declare const getArrayType: (type: string) => string;
|
|
4162
4346
|
/**
|
|
@@ -4196,8 +4380,13 @@ declare const cairo_isLen: typeof isLen;
|
|
|
4196
4380
|
declare const cairo_isTypeArray: typeof isTypeArray;
|
|
4197
4381
|
declare const cairo_isTypeBool: typeof isTypeBool;
|
|
4198
4382
|
declare const cairo_isTypeContractAddress: typeof isTypeContractAddress;
|
|
4383
|
+
declare const cairo_isTypeEnum: typeof isTypeEnum;
|
|
4384
|
+
declare const cairo_isTypeEthAddress: typeof isTypeEthAddress;
|
|
4199
4385
|
declare const cairo_isTypeFelt: typeof isTypeFelt;
|
|
4386
|
+
declare const cairo_isTypeLitteral: typeof isTypeLitteral;
|
|
4200
4387
|
declare const cairo_isTypeNamedTuple: typeof isTypeNamedTuple;
|
|
4388
|
+
declare const cairo_isTypeOption: typeof isTypeOption;
|
|
4389
|
+
declare const cairo_isTypeResult: typeof isTypeResult;
|
|
4201
4390
|
declare const cairo_isTypeStruct: typeof isTypeStruct;
|
|
4202
4391
|
declare const cairo_isTypeTuple: typeof isTypeTuple;
|
|
4203
4392
|
declare const cairo_isTypeUint: typeof isTypeUint;
|
|
@@ -4214,8 +4403,13 @@ declare namespace cairo {
|
|
|
4214
4403
|
cairo_isTypeArray as isTypeArray,
|
|
4215
4404
|
cairo_isTypeBool as isTypeBool,
|
|
4216
4405
|
cairo_isTypeContractAddress as isTypeContractAddress,
|
|
4406
|
+
cairo_isTypeEnum as isTypeEnum,
|
|
4407
|
+
cairo_isTypeEthAddress as isTypeEthAddress,
|
|
4217
4408
|
cairo_isTypeFelt as isTypeFelt,
|
|
4409
|
+
cairo_isTypeLitteral as isTypeLitteral,
|
|
4218
4410
|
cairo_isTypeNamedTuple as isTypeNamedTuple,
|
|
4411
|
+
cairo_isTypeOption as isTypeOption,
|
|
4412
|
+
cairo_isTypeResult as isTypeResult,
|
|
4219
4413
|
cairo_isTypeStruct as isTypeStruct,
|
|
4220
4414
|
cairo_isTypeTuple as isTypeTuple,
|
|
4221
4415
|
cairo_isTypeUint as isTypeUint,
|
|
@@ -4229,6 +4423,7 @@ declare class CallData {
|
|
|
4229
4423
|
abi: Abi;
|
|
4230
4424
|
parser: AbiParserInterface;
|
|
4231
4425
|
protected readonly structs: AbiStructs;
|
|
4426
|
+
protected readonly enums: AbiEnums;
|
|
4232
4427
|
constructor(abi: Abi);
|
|
4233
4428
|
/**
|
|
4234
4429
|
* Validate arguments passed to the method as corresponding to the ones in the abi
|
|
@@ -4279,6 +4474,12 @@ declare class CallData {
|
|
|
4279
4474
|
* @returns AbiStructs - structs from abi
|
|
4280
4475
|
*/
|
|
4281
4476
|
static getAbiStruct(abi: Abi): AbiStructs;
|
|
4477
|
+
/**
|
|
4478
|
+
* Helper to extract enums from abi
|
|
4479
|
+
* @param abi Abi
|
|
4480
|
+
* @returns AbiEnums - enums from abi
|
|
4481
|
+
*/
|
|
4482
|
+
static getAbiEnum(abi: Abi): AbiEnums;
|
|
4282
4483
|
/**
|
|
4283
4484
|
* Helper: Compile HexCalldata | RawCalldata | RawArgs
|
|
4284
4485
|
* @param rawCalldata HexCalldata | RawCalldata | RawArgs
|
|
@@ -4328,4 +4529,4 @@ declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): {
|
|
|
4328
4529
|
/** @deprecated prefer the 'num' naming */
|
|
4329
4530
|
declare const number: typeof num;
|
|
4330
4531
|
|
|
4331
|
-
export { Abi, AbiEntry, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, CairoAssembly, CairoContract, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LibraryError, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RevertedTransactionReceiptResponse, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus$1 as TransactionExecutionStatus, TransactionFinalityStatus$1 as TransactionFinalityStatus, TransactionStatus, TransactionType$1 as TransactionType, Tupled, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
|
|
4532
|
+
export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallL1Handler, CallOptions, CallStruct, Calldata, CommonTransactionResponse, CompiledContract, CompiledSierra, CompiledSierraCasm, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeclareTransactionResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, DeployedContractItem, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, Event, EventAbi, EventEntry, ExecutionResources, FunctionAbi, FunctionInvocation, GatewayError, GetBlockResponse, GetCodeResponse, GetContractAddressesResponse, GetTransactionReceiptResponse, GetTransactionResponse, GetTransactionStatusResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, InvokeTransactionResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Litteral, MessageToL1, MessageToL2, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, Program, Provider, ProviderInterface, ProviderOptions, PythonicHints, rpc as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, RejectedTransactionReceiptResponse, RejectedTransactionResponse, Result, RevertedTransactionReceiptResponse, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, sequencer as Sequencer, SequencerHttpMethod, SequencerIdentifier, SequencerProvider, SequencerProviderOptions, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus$1 as TransactionExecutionStatus, TransactionFinalityStatus$1 as TransactionFinalityStatus, TransactionStatus, TransactionType$1 as TransactionType, Tupled, TypedData, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
|