starknet 5.10.1 → 5.11.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 +12 -0
- package/dist/index.d.ts +324 -370
- package/dist/index.global.js +693 -63
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +352 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +348 -37
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as weierstrass from '@noble/curves/abstract/weierstrass';
|
|
2
2
|
import * as poseidon from '@noble/curves/abstract/poseidon';
|
|
3
3
|
import * as microStarknet from 'micro-starknet';
|
|
4
4
|
|
|
@@ -19,26 +19,26 @@ declare function sanitizeHex(hex: string): string;
|
|
|
19
19
|
declare function utf8ToArray(str: string): Uint8Array;
|
|
20
20
|
|
|
21
21
|
declare const encode_IS_BROWSER: typeof IS_BROWSER;
|
|
22
|
+
declare const encode_addHexPrefix: typeof addHexPrefix;
|
|
22
23
|
declare const encode_arrayBufferToString: typeof arrayBufferToString;
|
|
23
24
|
declare const encode_btoaUniversal: typeof btoaUniversal;
|
|
24
25
|
declare const encode_buf2hex: typeof buf2hex;
|
|
25
|
-
declare const encode_removeHexPrefix: typeof removeHexPrefix;
|
|
26
|
-
declare const encode_addHexPrefix: typeof addHexPrefix;
|
|
27
|
-
declare const encode_padLeft: typeof padLeft;
|
|
28
26
|
declare const encode_calcByteLength: typeof calcByteLength;
|
|
27
|
+
declare const encode_padLeft: typeof padLeft;
|
|
28
|
+
declare const encode_removeHexPrefix: typeof removeHexPrefix;
|
|
29
29
|
declare const encode_sanitizeBytes: typeof sanitizeBytes;
|
|
30
30
|
declare const encode_sanitizeHex: typeof sanitizeHex;
|
|
31
31
|
declare const encode_utf8ToArray: typeof utf8ToArray;
|
|
32
32
|
declare namespace encode {
|
|
33
33
|
export {
|
|
34
34
|
encode_IS_BROWSER as IS_BROWSER,
|
|
35
|
+
encode_addHexPrefix as addHexPrefix,
|
|
35
36
|
encode_arrayBufferToString as arrayBufferToString,
|
|
36
37
|
encode_btoaUniversal as btoaUniversal,
|
|
37
38
|
encode_buf2hex as buf2hex,
|
|
38
|
-
encode_removeHexPrefix as removeHexPrefix,
|
|
39
|
-
encode_addHexPrefix as addHexPrefix,
|
|
40
|
-
encode_padLeft as padLeft,
|
|
41
39
|
encode_calcByteLength as calcByteLength,
|
|
40
|
+
encode_padLeft as padLeft,
|
|
41
|
+
encode_removeHexPrefix as removeHexPrefix,
|
|
42
42
|
encode_sanitizeBytes as sanitizeBytes,
|
|
43
43
|
encode_sanitizeHex as sanitizeHex,
|
|
44
44
|
encode_utf8ToArray as utf8ToArray,
|
|
@@ -88,12 +88,20 @@ declare const BETA = "6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CE
|
|
|
88
88
|
declare const MAX_ECDSA_VAL = "800000000000000000000000000000000000000000000000000000000000000";
|
|
89
89
|
declare const CONSTANT_POINTS: string[][];
|
|
90
90
|
|
|
91
|
-
declare const
|
|
92
|
-
declare const constants_MASK_250: typeof MASK_250;
|
|
93
|
-
declare const constants_MASK_251: typeof MASK_251;
|
|
91
|
+
declare const constants_ALPHA: typeof ALPHA;
|
|
94
92
|
declare const constants_API_VERSION: typeof API_VERSION;
|
|
93
|
+
declare const constants_BETA: typeof BETA;
|
|
95
94
|
type constants_BaseUrl = BaseUrl;
|
|
96
95
|
declare const constants_BaseUrl: typeof BaseUrl;
|
|
96
|
+
declare const constants_CONSTANT_POINTS: typeof CONSTANT_POINTS;
|
|
97
|
+
declare const constants_EC_ORDER: typeof EC_ORDER;
|
|
98
|
+
declare const constants_FIELD_GEN: typeof FIELD_GEN;
|
|
99
|
+
declare const constants_FIELD_PRIME: typeof FIELD_PRIME;
|
|
100
|
+
declare const constants_FIELD_SIZE: typeof FIELD_SIZE;
|
|
101
|
+
declare const constants_IS_BROWSER: typeof IS_BROWSER;
|
|
102
|
+
declare const constants_MASK_250: typeof MASK_250;
|
|
103
|
+
declare const constants_MASK_251: typeof MASK_251;
|
|
104
|
+
declare const constants_MAX_ECDSA_VAL: typeof MAX_ECDSA_VAL;
|
|
97
105
|
type constants_NetworkName = NetworkName;
|
|
98
106
|
declare const constants_NetworkName: typeof NetworkName;
|
|
99
107
|
type constants_StarknetChainId = StarknetChainId;
|
|
@@ -101,46 +109,39 @@ declare const constants_StarknetChainId: typeof StarknetChainId;
|
|
|
101
109
|
type constants_TransactionHashPrefix = TransactionHashPrefix;
|
|
102
110
|
declare const constants_TransactionHashPrefix: typeof TransactionHashPrefix;
|
|
103
111
|
declare const constants_UDC: typeof UDC;
|
|
104
|
-
declare const
|
|
105
|
-
declare const constants_FIELD_GEN: typeof FIELD_GEN;
|
|
106
|
-
declare const constants_FIELD_SIZE: typeof FIELD_SIZE;
|
|
107
|
-
declare const constants_EC_ORDER: typeof EC_ORDER;
|
|
108
|
-
declare const constants_ALPHA: typeof ALPHA;
|
|
109
|
-
declare const constants_BETA: typeof BETA;
|
|
110
|
-
declare const constants_MAX_ECDSA_VAL: typeof MAX_ECDSA_VAL;
|
|
111
|
-
declare const constants_CONSTANT_POINTS: typeof CONSTANT_POINTS;
|
|
112
|
-
declare const constants_IS_BROWSER: typeof IS_BROWSER;
|
|
112
|
+
declare const constants_ZERO: typeof ZERO;
|
|
113
113
|
declare namespace constants {
|
|
114
114
|
export {
|
|
115
|
-
|
|
116
|
-
constants_MASK_250 as MASK_250,
|
|
117
|
-
constants_MASK_251 as MASK_251,
|
|
115
|
+
constants_ALPHA as ALPHA,
|
|
118
116
|
constants_API_VERSION as API_VERSION,
|
|
117
|
+
constants_BETA as BETA,
|
|
119
118
|
constants_BaseUrl as BaseUrl,
|
|
119
|
+
constants_CONSTANT_POINTS as CONSTANT_POINTS,
|
|
120
|
+
constants_EC_ORDER as EC_ORDER,
|
|
121
|
+
constants_FIELD_GEN as FIELD_GEN,
|
|
122
|
+
constants_FIELD_PRIME as FIELD_PRIME,
|
|
123
|
+
constants_FIELD_SIZE as FIELD_SIZE,
|
|
124
|
+
constants_IS_BROWSER as IS_BROWSER,
|
|
125
|
+
constants_MASK_250 as MASK_250,
|
|
126
|
+
constants_MASK_251 as MASK_251,
|
|
127
|
+
constants_MAX_ECDSA_VAL as MAX_ECDSA_VAL,
|
|
120
128
|
constants_NetworkName as NetworkName,
|
|
121
129
|
constants_StarknetChainId as StarknetChainId,
|
|
122
130
|
constants_TransactionHashPrefix as TransactionHashPrefix,
|
|
123
131
|
constants_UDC as UDC,
|
|
124
|
-
|
|
125
|
-
constants_FIELD_GEN as FIELD_GEN,
|
|
126
|
-
constants_FIELD_SIZE as FIELD_SIZE,
|
|
127
|
-
constants_EC_ORDER as EC_ORDER,
|
|
128
|
-
constants_ALPHA as ALPHA,
|
|
129
|
-
constants_BETA as BETA,
|
|
130
|
-
constants_MAX_ECDSA_VAL as MAX_ECDSA_VAL,
|
|
131
|
-
constants_CONSTANT_POINTS as CONSTANT_POINTS,
|
|
132
|
-
constants_IS_BROWSER as IS_BROWSER,
|
|
132
|
+
constants_ZERO as ZERO,
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
declare const ec_weierstrass: typeof weierstrass;
|
|
136
137
|
declare namespace ec {
|
|
137
138
|
export {
|
|
138
139
|
microStarknet as starkCurve,
|
|
139
|
-
|
|
140
|
+
ec_weierstrass as weierstrass,
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
143
|
|
|
143
|
-
|
|
144
|
+
type BigNumberish = string | number | bigint;
|
|
144
145
|
declare function isHex(hex: string): boolean;
|
|
145
146
|
declare function toBigInt(value: BigNumberish): bigint;
|
|
146
147
|
declare function isBigInt(value: any): value is bigint;
|
|
@@ -168,41 +169,41 @@ declare const toCairoBool: (value: boolean) => string;
|
|
|
168
169
|
declare function hexToBytes(value: string): Uint8Array;
|
|
169
170
|
|
|
170
171
|
type num_BigNumberish = BigNumberish;
|
|
171
|
-
declare const num_isHex: typeof isHex;
|
|
172
|
-
declare const num_toBigInt: typeof toBigInt;
|
|
173
|
-
declare const num_isBigInt: typeof isBigInt;
|
|
174
|
-
declare const num_toHex: typeof toHex;
|
|
175
|
-
declare const num_hexToDecimalString: typeof hexToDecimalString;
|
|
176
|
-
declare const num_cleanHex: typeof cleanHex;
|
|
177
172
|
declare const num_assertInRange: typeof assertInRange;
|
|
178
173
|
declare const num_bigNumberishArrayToDecimalStringArray: typeof bigNumberishArrayToDecimalStringArray;
|
|
179
174
|
declare const num_bigNumberishArrayToHexadecimalStringArray: typeof bigNumberishArrayToHexadecimalStringArray;
|
|
180
|
-
declare const
|
|
181
|
-
declare const num_toHexString: typeof toHexString;
|
|
175
|
+
declare const num_cleanHex: typeof cleanHex;
|
|
182
176
|
declare const num_getDecimalString: typeof getDecimalString;
|
|
183
177
|
declare const num_getHexString: typeof getHexString;
|
|
184
178
|
declare const num_getHexStringArray: typeof getHexStringArray;
|
|
185
|
-
declare const num_toCairoBool: typeof toCairoBool;
|
|
186
179
|
declare const num_hexToBytes: typeof hexToBytes;
|
|
180
|
+
declare const num_hexToDecimalString: typeof hexToDecimalString;
|
|
181
|
+
declare const num_isBigInt: typeof isBigInt;
|
|
182
|
+
declare const num_isHex: typeof isHex;
|
|
183
|
+
declare const num_isStringWholeNumber: typeof isStringWholeNumber;
|
|
184
|
+
declare const num_toBigInt: typeof toBigInt;
|
|
185
|
+
declare const num_toCairoBool: typeof toCairoBool;
|
|
186
|
+
declare const num_toHex: typeof toHex;
|
|
187
|
+
declare const num_toHexString: typeof toHexString;
|
|
187
188
|
declare namespace num {
|
|
188
189
|
export {
|
|
189
190
|
num_BigNumberish as BigNumberish,
|
|
190
|
-
num_isHex as isHex,
|
|
191
|
-
num_toBigInt as toBigInt,
|
|
192
|
-
num_isBigInt as isBigInt,
|
|
193
|
-
num_toHex as toHex,
|
|
194
|
-
num_hexToDecimalString as hexToDecimalString,
|
|
195
|
-
num_cleanHex as cleanHex,
|
|
196
191
|
num_assertInRange as assertInRange,
|
|
197
192
|
num_bigNumberishArrayToDecimalStringArray as bigNumberishArrayToDecimalStringArray,
|
|
198
193
|
num_bigNumberishArrayToHexadecimalStringArray as bigNumberishArrayToHexadecimalStringArray,
|
|
199
|
-
|
|
200
|
-
num_toHexString as toHexString,
|
|
194
|
+
num_cleanHex as cleanHex,
|
|
201
195
|
num_getDecimalString as getDecimalString,
|
|
202
196
|
num_getHexString as getHexString,
|
|
203
197
|
num_getHexStringArray as getHexStringArray,
|
|
204
|
-
num_toCairoBool as toCairoBool,
|
|
205
198
|
num_hexToBytes as hexToBytes,
|
|
199
|
+
num_hexToDecimalString as hexToDecimalString,
|
|
200
|
+
num_isBigInt as isBigInt,
|
|
201
|
+
num_isHex as isHex,
|
|
202
|
+
num_isStringWholeNumber as isStringWholeNumber,
|
|
203
|
+
num_toBigInt as toBigInt,
|
|
204
|
+
num_toCairoBool as toCairoBool,
|
|
205
|
+
num_toHex as toHex,
|
|
206
|
+
num_toHexString as toHexString,
|
|
206
207
|
};
|
|
207
208
|
}
|
|
208
209
|
|
|
@@ -216,26 +217,26 @@ declare const UINT_256_MAX: bigint;
|
|
|
216
217
|
declare function isUint256(bn: BigNumberish): boolean;
|
|
217
218
|
declare function bnToUint256(bignumber: BigNumberish): Uint256;
|
|
218
219
|
|
|
219
|
-
type uint256$1_Uint256 = Uint256;
|
|
220
|
-
declare const uint256$1_uint256ToBN: typeof uint256ToBN;
|
|
221
220
|
declare const uint256$1_UINT_128_MAX: typeof UINT_128_MAX;
|
|
222
221
|
declare const uint256$1_UINT_256_MAX: typeof UINT_256_MAX;
|
|
223
|
-
|
|
222
|
+
type uint256$1_Uint256 = Uint256;
|
|
224
223
|
declare const uint256$1_bnToUint256: typeof bnToUint256;
|
|
224
|
+
declare const uint256$1_isUint256: typeof isUint256;
|
|
225
|
+
declare const uint256$1_uint256ToBN: typeof uint256ToBN;
|
|
225
226
|
declare namespace uint256$1 {
|
|
226
227
|
export {
|
|
227
|
-
uint256$1_Uint256 as Uint256,
|
|
228
|
-
uint256$1_uint256ToBN as uint256ToBN,
|
|
229
228
|
uint256$1_UINT_128_MAX as UINT_128_MAX,
|
|
230
229
|
uint256$1_UINT_256_MAX as UINT_256_MAX,
|
|
231
|
-
uint256$
|
|
230
|
+
uint256$1_Uint256 as Uint256,
|
|
232
231
|
uint256$1_bnToUint256 as bnToUint256,
|
|
232
|
+
uint256$1_isUint256 as isUint256,
|
|
233
|
+
uint256$1_uint256ToBN as uint256ToBN,
|
|
233
234
|
};
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
/** ABI */
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
type Abi = Array<FunctionAbi | EventAbi | StructAbi>;
|
|
239
|
+
type AbiEntry = {
|
|
239
240
|
name: string;
|
|
240
241
|
type: 'felt' | 'felt*' | string;
|
|
241
242
|
};
|
|
@@ -244,7 +245,7 @@ declare enum FunctionAbiType {
|
|
|
244
245
|
'l1_handler' = 1,
|
|
245
246
|
'constructor' = 2
|
|
246
247
|
}
|
|
247
|
-
|
|
248
|
+
type FunctionAbi = {
|
|
248
249
|
inputs: AbiEntry[];
|
|
249
250
|
name: string;
|
|
250
251
|
outputs: AbiEntry[];
|
|
@@ -252,10 +253,10 @@ declare type FunctionAbi = {
|
|
|
252
253
|
state_mutability?: string;
|
|
253
254
|
type: FunctionAbiType;
|
|
254
255
|
};
|
|
255
|
-
|
|
256
|
+
type AbiStructs = {
|
|
256
257
|
[name: string]: StructAbi;
|
|
257
258
|
};
|
|
258
|
-
|
|
259
|
+
type StructAbi = {
|
|
259
260
|
members: (AbiEntry & {
|
|
260
261
|
offset: number;
|
|
261
262
|
})[];
|
|
@@ -263,26 +264,26 @@ declare type StructAbi = {
|
|
|
263
264
|
size: number;
|
|
264
265
|
type: 'struct';
|
|
265
266
|
};
|
|
266
|
-
|
|
267
|
+
type EventAbi = any;
|
|
267
268
|
|
|
268
269
|
/** LEGACY CONTRACT */
|
|
269
|
-
|
|
270
|
+
type LegacyContractClass = {
|
|
270
271
|
program: CompressedProgram;
|
|
271
272
|
entry_points_by_type: EntryPointsByType;
|
|
272
273
|
abi: Abi;
|
|
273
274
|
};
|
|
274
|
-
|
|
275
|
+
type LegacyCompiledContract = Omit<LegacyContractClass, 'program'> & {
|
|
275
276
|
program: Program;
|
|
276
277
|
};
|
|
277
278
|
/** SUBTYPES */
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
279
|
+
type Builtins = string[];
|
|
280
|
+
type CompressedProgram = string;
|
|
281
|
+
type EntryPointsByType = {
|
|
281
282
|
CONSTRUCTOR: ContractEntryPointFields[];
|
|
282
283
|
EXTERNAL: ContractEntryPointFields[];
|
|
283
284
|
L1_HANDLER: ContractEntryPointFields[];
|
|
284
285
|
};
|
|
285
|
-
|
|
286
|
+
type ContractEntryPointFields = {
|
|
286
287
|
selector: string;
|
|
287
288
|
offset: string;
|
|
288
289
|
builtins?: Builtins;
|
|
@@ -293,7 +294,7 @@ interface Program extends Record<string, any> {
|
|
|
293
294
|
}
|
|
294
295
|
|
|
295
296
|
/** SYSTEM TYPES */
|
|
296
|
-
|
|
297
|
+
type CairoAssembly = {
|
|
297
298
|
prime: string;
|
|
298
299
|
compiler_version: string;
|
|
299
300
|
bytecode: ByteCode;
|
|
@@ -301,7 +302,7 @@ declare type CairoAssembly = {
|
|
|
301
302
|
pythonic_hints: PythonicHints;
|
|
302
303
|
entry_points_by_type: EntryPointsByType;
|
|
303
304
|
};
|
|
304
|
-
|
|
305
|
+
type SierraContractClass = {
|
|
305
306
|
sierra_program: ByteCode;
|
|
306
307
|
sierra_program_debug_info: SierraProgramDebugInfo;
|
|
307
308
|
contract_class_version: string;
|
|
@@ -309,55 +310,55 @@ declare type SierraContractClass = {
|
|
|
309
310
|
abi: Abi;
|
|
310
311
|
};
|
|
311
312
|
/** COMPILED CONTRACT */
|
|
312
|
-
|
|
313
|
-
|
|
313
|
+
type CompiledSierra = SierraContractClass;
|
|
314
|
+
type CompiledSierraCasm = CairoAssembly;
|
|
314
315
|
/** SUBTYPES */
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
type ByteCode = string[];
|
|
317
|
+
type PythonicHints = [number, string[]][];
|
|
318
|
+
type SierraProgramDebugInfo = {
|
|
318
319
|
type_names: [number, string][];
|
|
319
320
|
libfunc_names: [number, string][];
|
|
320
321
|
user_func_names: [number, string][];
|
|
321
322
|
};
|
|
322
|
-
|
|
323
|
+
type SierraEntryPointsByType = {
|
|
323
324
|
CONSTRUCTOR: SierraContractEntryPointFields[];
|
|
324
325
|
EXTERNAL: SierraContractEntryPointFields[];
|
|
325
326
|
L1_HANDLER: SierraContractEntryPointFields[];
|
|
326
327
|
};
|
|
327
|
-
|
|
328
|
+
type SierraContractEntryPointFields = {
|
|
328
329
|
selector: string;
|
|
329
330
|
function_idx: number;
|
|
330
331
|
};
|
|
331
332
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
type ContractClass = LegacyContractClass | SierraContractClass;
|
|
334
|
+
type CompiledContract = LegacyCompiledContract | CompiledSierra;
|
|
335
|
+
type CairoContract = ContractClass | CompiledContract;
|
|
335
336
|
declare enum EntryPointType {
|
|
336
337
|
EXTERNAL = "EXTERNAL",
|
|
337
338
|
L1_HANDLER = "L1_HANDLER",
|
|
338
339
|
CONSTRUCTOR = "CONSTRUCTOR"
|
|
339
340
|
}
|
|
340
341
|
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
type WeierstrassSignatureType = weierstrass.SignatureType;
|
|
343
|
+
type ArraySignatureType = string[];
|
|
344
|
+
type Signature = ArraySignatureType | WeierstrassSignatureType;
|
|
344
345
|
/**
|
|
345
346
|
* BigNumberish array
|
|
346
347
|
* use CallData.compile() to convert to Calldata
|
|
347
348
|
*/
|
|
348
|
-
|
|
349
|
+
type RawCalldata = BigNumberish[];
|
|
349
350
|
/**
|
|
350
351
|
* Hexadecimal-string array
|
|
351
352
|
*/
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
353
|
+
type HexCalldata = string[];
|
|
354
|
+
type AllowArray<T> = T | T[];
|
|
355
|
+
type RawArgs = RawArgsObject | RawArgsArray;
|
|
356
|
+
type RawArgsObject = {
|
|
356
357
|
[inputName: string]: MultiType | MultiType[] | RawArgs;
|
|
357
358
|
};
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
type RawArgsArray = Array<MultiType | MultiType[] | RawArgs>;
|
|
360
|
+
type MultiType = BigNumberish | Uint256 | object | boolean;
|
|
361
|
+
type UniversalDeployerContractPayload = {
|
|
361
362
|
classHash: BigNumberish;
|
|
362
363
|
salt?: string;
|
|
363
364
|
unique?: boolean;
|
|
@@ -366,51 +367,51 @@ declare type UniversalDeployerContractPayload = {
|
|
|
366
367
|
/**
|
|
367
368
|
* @deprecated deprecated due to no direct deploy, unused - can be removed
|
|
368
369
|
*/
|
|
369
|
-
|
|
370
|
+
type DeployContractPayload = {
|
|
370
371
|
contract: CompiledContract | string;
|
|
371
372
|
constructorCalldata?: RawCalldata;
|
|
372
373
|
addressSalt?: string;
|
|
373
374
|
};
|
|
374
|
-
|
|
375
|
+
type DeployAccountContractPayload = {
|
|
375
376
|
classHash: string;
|
|
376
377
|
constructorCalldata?: RawArgs;
|
|
377
378
|
addressSalt?: BigNumberish;
|
|
378
379
|
contractAddress?: string;
|
|
379
380
|
};
|
|
380
|
-
|
|
381
|
+
type DeployAccountContractTransaction = Omit<DeployAccountContractPayload, 'contractAddress'> & {
|
|
381
382
|
signature?: Signature;
|
|
382
383
|
};
|
|
383
|
-
|
|
384
|
+
type DeclareContractPayload = {
|
|
384
385
|
contract: CompiledContract | string;
|
|
385
386
|
classHash?: string;
|
|
386
387
|
casm?: CompiledSierraCasm;
|
|
387
388
|
compiledClassHash?: string;
|
|
388
389
|
};
|
|
389
|
-
|
|
390
|
+
type CompleteDeclareContractPayload = {
|
|
390
391
|
contract: CompiledContract | string;
|
|
391
392
|
classHash: string;
|
|
392
393
|
casm?: CompiledSierraCasm;
|
|
393
394
|
compiledClassHash?: string;
|
|
394
395
|
};
|
|
395
|
-
|
|
396
|
-
|
|
396
|
+
type DeclareAndDeployContractPayload = Omit<UniversalDeployerContractPayload, 'classHash'> & DeclareContractPayload;
|
|
397
|
+
type DeclareContractTransaction = {
|
|
397
398
|
contractDefinition: ContractClass;
|
|
398
399
|
senderAddress: string;
|
|
399
400
|
signature?: Signature;
|
|
400
401
|
compiledClassHash?: string;
|
|
401
402
|
};
|
|
402
|
-
|
|
403
|
+
type CallDetails = {
|
|
403
404
|
contractAddress: string;
|
|
404
405
|
calldata?: RawArgs;
|
|
405
406
|
};
|
|
406
|
-
|
|
407
|
+
type Invocation = CallDetails & {
|
|
407
408
|
signature?: Signature;
|
|
408
409
|
};
|
|
409
|
-
|
|
410
|
+
type Call = CallDetails & {
|
|
410
411
|
entrypoint: string;
|
|
411
412
|
};
|
|
412
|
-
|
|
413
|
-
|
|
413
|
+
type CairoVersion = '0' | '1';
|
|
414
|
+
type InvocationsDetails = {
|
|
414
415
|
nonce?: BigNumberish;
|
|
415
416
|
maxFee?: BigNumberish;
|
|
416
417
|
version?: BigNumberish;
|
|
@@ -418,13 +419,13 @@ declare type InvocationsDetails = {
|
|
|
418
419
|
/**
|
|
419
420
|
* Contain all additional details params
|
|
420
421
|
*/
|
|
421
|
-
|
|
422
|
+
type Details = {
|
|
422
423
|
nonce: BigNumberish;
|
|
423
424
|
maxFee: BigNumberish;
|
|
424
425
|
version: BigNumberish;
|
|
425
426
|
chainId: StarknetChainId;
|
|
426
427
|
};
|
|
427
|
-
|
|
428
|
+
type InvocationsDetailsWithNonce = InvocationsDetails & {
|
|
428
429
|
nonce: BigNumberish;
|
|
429
430
|
};
|
|
430
431
|
declare enum TransactionStatus {
|
|
@@ -435,7 +436,7 @@ declare enum TransactionStatus {
|
|
|
435
436
|
ACCEPTED_ON_L1 = "ACCEPTED_ON_L1",
|
|
436
437
|
REJECTED = "REJECTED"
|
|
437
438
|
}
|
|
438
|
-
|
|
439
|
+
type TransactionBulk = Array<({
|
|
439
440
|
type: 'DECLARE';
|
|
440
441
|
} & {
|
|
441
442
|
payload: DeclareContractPayload;
|
|
@@ -452,7 +453,7 @@ declare type TransactionBulk = Array<({
|
|
|
452
453
|
} & {
|
|
453
454
|
payload: AllowArray<Call>;
|
|
454
455
|
})>;
|
|
455
|
-
|
|
456
|
+
type InvocationBulk = Array<(({
|
|
456
457
|
type: 'DECLARE';
|
|
457
458
|
} & DeclareContractTransaction) | ({
|
|
458
459
|
type: 'DEPLOY_ACCOUNT';
|
|
@@ -461,30 +462,30 @@ declare type InvocationBulk = Array<(({
|
|
|
461
462
|
} & Invocation)) & InvocationsDetailsWithNonce & {
|
|
462
463
|
blockIdentifier: BlockNumber | BigNumberish;
|
|
463
464
|
}>;
|
|
464
|
-
|
|
465
|
+
type Status = 'NOT_RECEIVED' | 'RECEIVED' | 'PENDING' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED';
|
|
465
466
|
declare enum TransactionType {
|
|
466
467
|
INVOKE = "INVOKE_FUNCTION",
|
|
467
468
|
DECLARE = "DECLARE",
|
|
468
469
|
DEPLOY = "DEPLOY",
|
|
469
470
|
DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT"
|
|
470
471
|
}
|
|
471
|
-
|
|
472
|
+
type Tupled = {
|
|
472
473
|
element: any;
|
|
473
474
|
type: string;
|
|
474
475
|
};
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
type BlockTag = 'pending' | 'latest';
|
|
477
|
+
type BlockNumber = BlockTag | null | number;
|
|
478
|
+
type Struct = {
|
|
478
479
|
type: 'struct';
|
|
479
480
|
[k: string]: BigNumberish;
|
|
480
481
|
};
|
|
481
|
-
|
|
482
|
+
type Args = {
|
|
482
483
|
[inputName: string]: BigNumberish | BigNumberish[] | ParsedStruct | ParsedStruct[];
|
|
483
484
|
};
|
|
484
|
-
|
|
485
|
+
type ParsedStruct = {
|
|
485
486
|
[key: string]: BigNumberish | ParsedStruct;
|
|
486
487
|
};
|
|
487
|
-
|
|
488
|
+
type waitForTransactionOptions = {
|
|
488
489
|
retryInterval?: number;
|
|
489
490
|
successStates?: Array<TransactionStatus>;
|
|
490
491
|
};
|
|
@@ -508,28 +509,28 @@ interface DeclareSignerDetails {
|
|
|
508
509
|
nonce: BigNumberish;
|
|
509
510
|
compiledClassHash?: string;
|
|
510
511
|
}
|
|
511
|
-
|
|
512
|
+
type DeployAccountSignerDetails = Required<DeployAccountContractPayload> & Required<InvocationsDetails> & {
|
|
512
513
|
contractAddress: BigNumberish;
|
|
513
514
|
chainId: StarknetChainId;
|
|
514
515
|
};
|
|
515
516
|
|
|
516
|
-
|
|
517
|
+
type BlockIdentifier = BlockNumber | BigNumberish;
|
|
517
518
|
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
519
|
+
type AsyncContractFunction<T = any> = (...args: ArgsOrCalldataWithOptions) => Promise<T>;
|
|
520
|
+
type ContractFunction = (...args: ArgsOrCalldataWithOptions) => any;
|
|
521
|
+
type Result = {
|
|
521
522
|
[key: string]: any;
|
|
522
523
|
} | Result[] | bigint | string | boolean;
|
|
523
524
|
/**
|
|
524
525
|
* Compiled calldata ready to be sent
|
|
525
526
|
* decimal-string array
|
|
526
527
|
*/
|
|
527
|
-
|
|
528
|
+
type Calldata = string[] & {
|
|
528
529
|
readonly __compiled__?: boolean;
|
|
529
530
|
};
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
531
|
+
type ArgsOrCalldata = RawArgsArray | [Calldata] | Calldata;
|
|
532
|
+
type ArgsOrCalldataWithOptions = ArgsOrCalldata & ContractOptions;
|
|
533
|
+
type ContractOptions = {
|
|
533
534
|
blockIdentifier?: BlockIdentifier;
|
|
534
535
|
parseRequest?: boolean;
|
|
535
536
|
parseResponse?: boolean;
|
|
@@ -541,8 +542,8 @@ declare type ContractOptions = {
|
|
|
541
542
|
signature?: Signature;
|
|
542
543
|
addressSalt?: string;
|
|
543
544
|
};
|
|
544
|
-
|
|
545
|
-
|
|
545
|
+
type CallOptions = Pick<ContractOptions, 'blockIdentifier' | 'parseRequest' | 'parseResponse' | 'formatResponse'>;
|
|
546
|
+
type InvokeOptions = Pick<ContractOptions, 'maxFee' | 'nonce' | 'signature' | 'parseRequest'>;
|
|
546
547
|
|
|
547
548
|
/**
|
|
548
549
|
* Starknet RPC version 0.2.1
|
|
@@ -553,35 +554,35 @@ declare type InvokeOptions = Pick<ContractOptions, 'maxFee' | 'nonce' | 'signatu
|
|
|
553
554
|
*
|
|
554
555
|
* TypeScript Representation of OpenRpc protocol types
|
|
555
556
|
*/
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
557
|
+
type FELT = string;
|
|
558
|
+
type ADDRESS = FELT;
|
|
559
|
+
type NUM_AS_HEX = string;
|
|
560
|
+
type SIGNATURE = Array<FELT>;
|
|
561
|
+
type BLOCK_NUMBER = number;
|
|
562
|
+
type BLOCK_HASH = FELT;
|
|
563
|
+
type TXN_HASH = FELT;
|
|
564
|
+
type TXN_STATUS = 'PENDING' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED';
|
|
565
|
+
type TXN_TYPE = 'DECLARE' | 'DEPLOY' | 'DEPLOY_ACCOUNT' | 'INVOKE' | 'L1_HANDLER';
|
|
566
|
+
type BLOCK_STATUS = 'PENDING' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED';
|
|
566
567
|
declare enum BLOCK_TAG {
|
|
567
568
|
latest = "latest",
|
|
568
569
|
pending = "pending"
|
|
569
570
|
}
|
|
570
|
-
|
|
571
|
+
type BLOCK_ID = {
|
|
571
572
|
block_hash: BLOCK_HASH;
|
|
572
573
|
} | {
|
|
573
574
|
block_number: BLOCK_NUMBER;
|
|
574
575
|
} | BLOCK_TAG;
|
|
575
|
-
|
|
576
|
+
type MSG_TO_L1 = {
|
|
576
577
|
to_address: FELT;
|
|
577
578
|
payload: Array<FELT>;
|
|
578
579
|
};
|
|
579
|
-
|
|
580
|
+
type EVENT = {
|
|
580
581
|
from_address: FELT;
|
|
581
582
|
keys: Array<FELT>;
|
|
582
583
|
data: Array<FELT>;
|
|
583
584
|
};
|
|
584
|
-
|
|
585
|
+
type COMMON_RECEIPT_PROPERTIES = {
|
|
585
586
|
transaction_hash: TXN_HASH;
|
|
586
587
|
actual_fee: FELT;
|
|
587
588
|
status: TXN_STATUS;
|
|
@@ -591,25 +592,25 @@ declare type COMMON_RECEIPT_PROPERTIES = {
|
|
|
591
592
|
messages_sent: Array<MSG_TO_L1>;
|
|
592
593
|
events: Array<EVENT>;
|
|
593
594
|
};
|
|
594
|
-
|
|
595
|
+
type PENDING_COMMON_RECEIPT_PROPERTIES = {
|
|
595
596
|
transaction_hash: TXN_HASH;
|
|
596
597
|
actual_fee: FELT;
|
|
597
598
|
type?: TXN_TYPE;
|
|
598
599
|
messages_sent: Array<MSG_TO_L1>;
|
|
599
600
|
events: Array<EVENT>;
|
|
600
601
|
};
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
602
|
+
type INVOKE_TXN_RECEIPT = COMMON_RECEIPT_PROPERTIES;
|
|
603
|
+
type DECLARE_TXN_RECEIPT = COMMON_RECEIPT_PROPERTIES;
|
|
604
|
+
type DEPLOY_TXN_RECEIPT = {
|
|
604
605
|
contract_address: FELT;
|
|
605
606
|
} & COMMON_RECEIPT_PROPERTIES;
|
|
606
|
-
|
|
607
|
-
|
|
607
|
+
type L1_HANDLER_TXN_RECEIPT = COMMON_RECEIPT_PROPERTIES;
|
|
608
|
+
type PENDING_DEPLOY_TXN_RECEIPT = {
|
|
608
609
|
contract_address: FELT;
|
|
609
610
|
} & PENDING_COMMON_RECEIPT_PROPERTIES;
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
611
|
+
type PENDING_TXN_RECEIPT = PENDING_DEPLOY_TXN_RECEIPT | PENDING_COMMON_RECEIPT_PROPERTIES;
|
|
612
|
+
type TXN_RECEIPT = INVOKE_TXN_RECEIPT | L1_HANDLER_TXN_RECEIPT | DECLARE_TXN_RECEIPT | DEPLOY_TXN_RECEIPT | DEPLOY_ACCOUNT_TXN_RECEIPT | PENDING_TXN_RECEIPT;
|
|
613
|
+
type BLOCK_HEADER = {
|
|
613
614
|
block_hash: BLOCK_HASH;
|
|
614
615
|
parent_hash: BLOCK_HASH;
|
|
615
616
|
block_number: BLOCK_NUMBER;
|
|
@@ -617,91 +618,91 @@ declare type BLOCK_HEADER = {
|
|
|
617
618
|
timestamp: number;
|
|
618
619
|
sequencer_address: FELT;
|
|
619
620
|
};
|
|
620
|
-
|
|
621
|
+
type BLOCK_BODY_WITH_TX_HASHES = {
|
|
621
622
|
transactions: Array<TXN_HASH>;
|
|
622
623
|
};
|
|
623
|
-
|
|
624
|
+
type BLOCK_WITH_TX_HASHES = {
|
|
624
625
|
status: BLOCK_STATUS;
|
|
625
626
|
} & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES;
|
|
626
|
-
|
|
627
|
+
type PENDING_BLOCK_WITH_TX_HASHES = BLOCK_BODY_WITH_TX_HASHES & {
|
|
627
628
|
timestamp: number;
|
|
628
629
|
sequencer_address: FELT;
|
|
629
630
|
parent_hash: BLOCK_HASH;
|
|
630
631
|
};
|
|
631
|
-
|
|
632
|
+
type COMMON_TXN_PROPERTIES = {
|
|
632
633
|
transaction_hash?: TXN_HASH;
|
|
633
634
|
} & BROADCASTED_TXN_COMMON_PROPERTIES;
|
|
634
|
-
|
|
635
|
+
type FUNCTION_CALL = {
|
|
635
636
|
contract_address?: ADDRESS;
|
|
636
637
|
entry_point_selector?: FELT;
|
|
637
638
|
calldata?: Array<FELT>;
|
|
638
639
|
};
|
|
639
|
-
|
|
640
|
-
|
|
640
|
+
type INVOKE_TXN = COMMON_TXN_PROPERTIES & (INVOKE_TXN_V0 | INVOKE_TXN_V1);
|
|
641
|
+
type DECLARE_TXN = COMMON_TXN_PROPERTIES & {
|
|
641
642
|
class_hash: FELT;
|
|
642
643
|
sender_address: ADDRESS;
|
|
643
644
|
};
|
|
644
|
-
|
|
645
|
+
type DEPLOY_TXN = {
|
|
645
646
|
transaction_hash: TXN_HASH;
|
|
646
647
|
class_hash: FELT;
|
|
647
648
|
} & DEPLOY_TXN_PROPERTIES;
|
|
648
|
-
|
|
649
|
-
|
|
649
|
+
type DEPLOY_ACCOUNT_TXN = COMMON_TXN_PROPERTIES & DEPLOY_ACCOUNT_TXN_PROPERTIES;
|
|
650
|
+
type DEPLOY_ACCOUNT_TXN_PROPERTIES = {
|
|
650
651
|
contract_address_salt: FELT;
|
|
651
652
|
constructor_calldata: Array<FELT>;
|
|
652
653
|
class_hash: FELT;
|
|
653
654
|
};
|
|
654
|
-
|
|
655
|
-
|
|
655
|
+
type DEPLOY_ACCOUNT_TXN_RECEIPT = DEPLOY_TXN_RECEIPT;
|
|
656
|
+
type TXN = INVOKE_TXN | L1_HANDLER_TXN | DECLARE_TXN | DEPLOY_TXN | DEPLOY_ACCOUNT_TXN;
|
|
656
657
|
declare enum L1_HANDLER {
|
|
657
658
|
'L1_HANDLER' = 0
|
|
658
659
|
}
|
|
659
|
-
|
|
660
|
+
type L1_HANDLER_TXN = {
|
|
660
661
|
transaction_hash: TXN_HASH;
|
|
661
662
|
version: NUM_AS_HEX;
|
|
662
663
|
type: L1_HANDLER;
|
|
663
664
|
nonce: NUM_AS_HEX;
|
|
664
665
|
} & FUNCTION_CALL;
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
666
|
+
type BROADCASTED_DEPLOY_ACCOUNT_TXN = BROADCASTED_TXN_COMMON_PROPERTIES & DEPLOY_ACCOUNT_TXN_PROPERTIES;
|
|
667
|
+
type BROADCASTED_TXN = BROADCASTED_INVOKE_TXN | BROADCASTED_DECLARE_TXN | BROADCASTED_DEPLOY_TXN | BROADCASTED_DEPLOY_ACCOUNT_TXN;
|
|
668
|
+
type BROADCASTED_INVOKE_TXN = BROADCASTED_TXN_COMMON_PROPERTIES & (INVOKE_TXN_V0 | INVOKE_TXN_V1);
|
|
669
|
+
type BROADCASTED_TXN_COMMON_PROPERTIES = {
|
|
669
670
|
type: TXN_TYPE;
|
|
670
671
|
max_fee: FELT;
|
|
671
672
|
version: NUM_AS_HEX;
|
|
672
673
|
signature: SIGNATURE;
|
|
673
674
|
nonce: FELT;
|
|
674
675
|
};
|
|
675
|
-
|
|
676
|
+
type BROADCASTED_DECLARE_TXN = {
|
|
676
677
|
contract_class: CONTRACT_CLASS;
|
|
677
678
|
sender_address: ADDRESS;
|
|
678
679
|
} & BROADCASTED_TXN_COMMON_PROPERTIES;
|
|
679
|
-
|
|
680
|
+
type BROADCASTED_DEPLOY_TXN = {
|
|
680
681
|
contract_class: CONTRACT_CLASS;
|
|
681
682
|
} & DEPLOY_TXN_PROPERTIES;
|
|
682
|
-
|
|
683
|
+
type DEPLOY_TXN_PROPERTIES = {
|
|
683
684
|
version: NUM_AS_HEX;
|
|
684
685
|
type: TXN_TYPE;
|
|
685
686
|
contract_address_salt: FELT;
|
|
686
687
|
constructor_calldata: Array<FELT>;
|
|
687
688
|
};
|
|
688
|
-
|
|
689
|
-
|
|
689
|
+
type INVOKE_TXN_V0 = FUNCTION_CALL;
|
|
690
|
+
type INVOKE_TXN_V1 = {
|
|
690
691
|
sender_address: ADDRESS;
|
|
691
692
|
calldata: Array<FELT>;
|
|
692
693
|
};
|
|
693
|
-
|
|
694
|
+
type BLOCK_BODY_WITH_TXS = {
|
|
694
695
|
transactions: Array<TXN>;
|
|
695
696
|
};
|
|
696
|
-
|
|
697
|
+
type BLOCK_WITH_TXS = {
|
|
697
698
|
status: BLOCK_STATUS;
|
|
698
699
|
} & BLOCK_HEADER & BLOCK_BODY_WITH_TXS;
|
|
699
|
-
|
|
700
|
+
type PENDING_BLOCK_WITH_TXS = BLOCK_BODY_WITH_TXS & {
|
|
700
701
|
timestamp: number;
|
|
701
702
|
sequencer_address: FELT;
|
|
702
703
|
parent_hash: BLOCK_HASH;
|
|
703
704
|
};
|
|
704
|
-
|
|
705
|
+
type CONTRACT_CLASS = {
|
|
705
706
|
program: string;
|
|
706
707
|
entry_points_by_type: {
|
|
707
708
|
CONSTRUCTOR: CONTRACT_ENTRY_POINT_LIST;
|
|
@@ -710,8 +711,8 @@ declare type CONTRACT_CLASS = {
|
|
|
710
711
|
};
|
|
711
712
|
abi?: CONTRACT_ABI;
|
|
712
713
|
};
|
|
713
|
-
|
|
714
|
-
|
|
714
|
+
type CONTRACT_ABI = Array<CONTRACT_ABI_ENTRY>;
|
|
715
|
+
type CONTRACT_ABI_ENTRY = FUNCTION_ABI_ENTRY | EVENT_ABI_ENTRY | STRUCT_ABI_ENTRY;
|
|
715
716
|
declare enum STRUCT_ABI_TYPE {
|
|
716
717
|
'struct' = 0
|
|
717
718
|
}
|
|
@@ -723,46 +724,46 @@ declare enum FUNCTION_ABI_TYPE {
|
|
|
723
724
|
'l1_handler' = 1,
|
|
724
725
|
'constructor' = 2
|
|
725
726
|
}
|
|
726
|
-
|
|
727
|
+
type STRUCT_ABI_ENTRY = STRUCT_ABI_TYPE & {
|
|
727
728
|
name: string;
|
|
728
729
|
size: number;
|
|
729
730
|
members: Array<STRUCT_MEMBER>;
|
|
730
731
|
};
|
|
731
|
-
|
|
732
|
+
type STRUCT_MEMBER = {
|
|
732
733
|
offset: number;
|
|
733
734
|
} & TYPED_PARAMETER;
|
|
734
|
-
|
|
735
|
+
type EVENT_ABI_ENTRY = {
|
|
735
736
|
name: string;
|
|
736
737
|
keys: Array<TYPED_PARAMETER>;
|
|
737
738
|
data: Array<TYPED_PARAMETER>;
|
|
738
739
|
} & EVENT_ABI_TYPE;
|
|
739
|
-
|
|
740
|
+
type FUNCTION_ABI_ENTRY = {
|
|
740
741
|
type: FUNCTION_ABI_TYPE;
|
|
741
742
|
name: string;
|
|
742
743
|
inputs: Array<TYPED_PARAMETER>;
|
|
743
744
|
outputs: Array<TYPED_PARAMETER>;
|
|
744
745
|
};
|
|
745
|
-
|
|
746
|
+
type TYPED_PARAMETER = {
|
|
746
747
|
name: string;
|
|
747
748
|
type: string;
|
|
748
749
|
};
|
|
749
|
-
|
|
750
|
-
|
|
750
|
+
type CONTRACT_ENTRY_POINT_LIST = Array<CONTRACT_ENTRY_POINT>;
|
|
751
|
+
type CONTRACT_ENTRY_POINT = {
|
|
751
752
|
offset: NUM_AS_HEX;
|
|
752
753
|
selector: FELT;
|
|
753
754
|
};
|
|
754
|
-
|
|
755
|
+
type CONTRACT_STORAGE_DIFF_ITEM = {
|
|
755
756
|
address: FELT;
|
|
756
757
|
storage_entries: {
|
|
757
758
|
key: FELT;
|
|
758
759
|
value: FELT;
|
|
759
760
|
}[];
|
|
760
761
|
};
|
|
761
|
-
|
|
762
|
+
type DEPLOYED_CONTRACT_ITEM = {
|
|
762
763
|
address: FELT;
|
|
763
764
|
class_hash: FELT;
|
|
764
765
|
};
|
|
765
|
-
|
|
766
|
+
type STATE_UPDATE = {
|
|
766
767
|
block_hash: BLOCK_HASH;
|
|
767
768
|
new_root: FELT;
|
|
768
769
|
old_root: FELT;
|
|
@@ -776,23 +777,23 @@ declare type STATE_UPDATE = {
|
|
|
776
777
|
}>;
|
|
777
778
|
};
|
|
778
779
|
};
|
|
779
|
-
|
|
780
|
-
|
|
780
|
+
type STORAGE_KEY = string;
|
|
781
|
+
type EVENT_FILTER = {
|
|
781
782
|
from_block: BLOCK_ID;
|
|
782
783
|
to_block: BLOCK_ID;
|
|
783
784
|
address: ADDRESS;
|
|
784
785
|
keys: Array<FELT>;
|
|
785
786
|
};
|
|
786
|
-
|
|
787
|
+
type RESULT_PAGE_REQUEST = {
|
|
787
788
|
continuation_token?: string;
|
|
788
789
|
chunk_size: number;
|
|
789
790
|
};
|
|
790
|
-
|
|
791
|
+
type EMITTED_EVENT = EVENT & {
|
|
791
792
|
block_hash: BLOCK_HASH;
|
|
792
793
|
block_number: BLOCK_NUMBER;
|
|
793
794
|
transaction_hash: TXN_HASH;
|
|
794
795
|
};
|
|
795
|
-
|
|
796
|
+
type SYNC_STATUS = {
|
|
796
797
|
starting_block_hash: BLOCK_HASH;
|
|
797
798
|
starting_block_num: NUM_AS_HEX;
|
|
798
799
|
current_block_hash: BLOCK_HASH;
|
|
@@ -800,7 +801,7 @@ declare type SYNC_STATUS = {
|
|
|
800
801
|
highest_block_hash: BLOCK_HASH;
|
|
801
802
|
highest_block_num: NUM_AS_HEX;
|
|
802
803
|
};
|
|
803
|
-
|
|
804
|
+
type FEE_ESTIMATE = {
|
|
804
805
|
gas_consumed: NUM_AS_HEX;
|
|
805
806
|
gas_price: NUM_AS_HEX;
|
|
806
807
|
overall_fee: NUM_AS_HEX;
|
|
@@ -814,7 +815,7 @@ declare enum ENTRY_POINT_TYPE {
|
|
|
814
815
|
'L1_HANDLER' = 1,
|
|
815
816
|
'CONSTRUCTOR' = 2
|
|
816
817
|
}
|
|
817
|
-
|
|
818
|
+
type FUNCTION_INVOCATION = FUNCTION_CALL & {
|
|
818
819
|
caller_address: FELT;
|
|
819
820
|
code_address: FELT;
|
|
820
821
|
entry_point_type: ENTRY_POINT_TYPE;
|
|
@@ -824,8 +825,8 @@ declare type FUNCTION_INVOCATION = FUNCTION_CALL & {
|
|
|
824
825
|
events: Array<EVENT>;
|
|
825
826
|
messages: MSG_TO_L1;
|
|
826
827
|
};
|
|
827
|
-
|
|
828
|
-
|
|
828
|
+
type NESTED_CALL = FUNCTION_INVOCATION;
|
|
829
|
+
type TRACE_ROOT = {
|
|
829
830
|
nonce: FELT;
|
|
830
831
|
signature: FELT;
|
|
831
832
|
function_invocation: FUNCTION_INVOCATION;
|
|
@@ -1163,7 +1164,7 @@ declare namespace RPC {
|
|
|
1163
1164
|
type DeployedTransaction = OPENRPC.DeployedTransaction;
|
|
1164
1165
|
type Methods = OPENRPC.Methods;
|
|
1165
1166
|
type Storage = OPENRPC.Storage;
|
|
1166
|
-
enum TransactionType {
|
|
1167
|
+
declare enum TransactionType {
|
|
1167
1168
|
DECLARE = "DECLARE",
|
|
1168
1169
|
DEPLOY = "DEPLOY",
|
|
1169
1170
|
DEPLOY_ACCOUNT = "DEPLOY_ACCOUNT",
|
|
@@ -1178,7 +1179,7 @@ declare namespace RPC {
|
|
|
1178
1179
|
}>;
|
|
1179
1180
|
}
|
|
1180
1181
|
|
|
1181
|
-
|
|
1182
|
+
type GetTransactionStatusResponse = {
|
|
1182
1183
|
tx_status: TransactionStatus;
|
|
1183
1184
|
block_hash?: string;
|
|
1184
1185
|
tx_failure_reason?: {
|
|
@@ -1186,11 +1187,11 @@ declare type GetTransactionStatusResponse = {
|
|
|
1186
1187
|
error_message: string;
|
|
1187
1188
|
};
|
|
1188
1189
|
};
|
|
1189
|
-
|
|
1190
|
+
type GetContractAddressesResponse = {
|
|
1190
1191
|
Starknet: string;
|
|
1191
1192
|
GpsStatementVerifier: string;
|
|
1192
1193
|
};
|
|
1193
|
-
|
|
1194
|
+
type FunctionInvocation = {
|
|
1194
1195
|
caller_address: string;
|
|
1195
1196
|
contract_address: string;
|
|
1196
1197
|
calldata: RawCalldata;
|
|
@@ -1204,7 +1205,7 @@ declare type FunctionInvocation = {
|
|
|
1204
1205
|
events: Array<any>;
|
|
1205
1206
|
messages: Array<any>;
|
|
1206
1207
|
};
|
|
1207
|
-
|
|
1208
|
+
type ExecutionResources = {
|
|
1208
1209
|
n_steps: number;
|
|
1209
1210
|
builtin_instance_counter: {
|
|
1210
1211
|
pedersen_builtin: number;
|
|
@@ -1216,23 +1217,23 @@ declare type ExecutionResources = {
|
|
|
1216
1217
|
};
|
|
1217
1218
|
n_memory_holes: number;
|
|
1218
1219
|
};
|
|
1219
|
-
|
|
1220
|
+
type TransactionTraceResponse = {
|
|
1220
1221
|
validate_invocation?: FunctionInvocation;
|
|
1221
1222
|
function_invocation?: FunctionInvocation;
|
|
1222
1223
|
fee_transfer_invocation?: FunctionInvocation;
|
|
1223
1224
|
signature: string[];
|
|
1224
1225
|
};
|
|
1225
|
-
|
|
1226
|
+
type CallL1Handler = {
|
|
1226
1227
|
from_address: string;
|
|
1227
1228
|
to_address: string;
|
|
1228
1229
|
entry_point_selector: string;
|
|
1229
1230
|
payload: Array<string>;
|
|
1230
1231
|
};
|
|
1231
|
-
|
|
1232
|
+
type DeployedContractItem = {
|
|
1232
1233
|
address: string;
|
|
1233
1234
|
class_hash: string;
|
|
1234
1235
|
};
|
|
1235
|
-
|
|
1236
|
+
type SequencerIdentifier = {
|
|
1236
1237
|
blockHash: string;
|
|
1237
1238
|
} | {
|
|
1238
1239
|
blockNumber: BlockNumber;
|
|
@@ -1609,7 +1610,7 @@ interface GetBlockResponse {
|
|
|
1609
1610
|
interface GetCodeResponse {
|
|
1610
1611
|
bytecode: ByteCode;
|
|
1611
1612
|
}
|
|
1612
|
-
|
|
1613
|
+
type GetTransactionResponse = InvokeTransactionResponse & DeclareTransactionResponse;
|
|
1613
1614
|
interface CommonTransactionResponse {
|
|
1614
1615
|
transaction_hash?: string;
|
|
1615
1616
|
version?: string;
|
|
@@ -1631,7 +1632,7 @@ interface DeclareTransactionResponse extends CommonTransactionResponse {
|
|
|
1631
1632
|
contract_class?: any;
|
|
1632
1633
|
sender_address?: string;
|
|
1633
1634
|
}
|
|
1634
|
-
|
|
1635
|
+
type GetTransactionReceiptResponse = InvokeTransactionReceiptResponse | DeclareTransactionReceiptResponse;
|
|
1635
1636
|
interface CommonTransactionReceiptResponse {
|
|
1636
1637
|
transaction_hash: string;
|
|
1637
1638
|
status?: Status;
|
|
@@ -1657,7 +1658,7 @@ interface InvokeTransactionReceiptResponse extends CommonTransactionReceiptRespo
|
|
|
1657
1658
|
events?: Array<Event>;
|
|
1658
1659
|
l1_origin_message?: MessageToL2;
|
|
1659
1660
|
}
|
|
1660
|
-
|
|
1661
|
+
type DeclareTransactionReceiptResponse = CommonTransactionReceiptResponse;
|
|
1661
1662
|
interface EstimateFeeResponse {
|
|
1662
1663
|
overall_fee: bigint;
|
|
1663
1664
|
gas_consumed?: bigint;
|
|
@@ -1671,10 +1672,10 @@ interface DeclareContractResponse {
|
|
|
1671
1672
|
transaction_hash: string;
|
|
1672
1673
|
class_hash: string;
|
|
1673
1674
|
}
|
|
1674
|
-
|
|
1675
|
+
type CallContractResponse = {
|
|
1675
1676
|
result: Array<string>;
|
|
1676
1677
|
};
|
|
1677
|
-
|
|
1678
|
+
type EstimateFeeAction = {
|
|
1678
1679
|
type: TransactionType.INVOKE;
|
|
1679
1680
|
payload: AllowArray<Call>;
|
|
1680
1681
|
} | {
|
|
@@ -1687,9 +1688,9 @@ declare type EstimateFeeAction = {
|
|
|
1687
1688
|
type: TransactionType.DEPLOY;
|
|
1688
1689
|
payload: UniversalDeployerContractPayload;
|
|
1689
1690
|
};
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1691
|
+
type EstimateFeeResponseBulk = Array<EstimateFeeResponse>;
|
|
1692
|
+
type Storage = Sequencer.Storage;
|
|
1693
|
+
type Nonce = Sequencer.Nonce;
|
|
1693
1694
|
interface TransactionSimulationResponse {
|
|
1694
1695
|
trace: TransactionTraceResponse;
|
|
1695
1696
|
fee_estimation: EstimateFeeResponse;
|
|
@@ -1712,7 +1713,7 @@ interface StateUpdateResponse {
|
|
|
1712
1713
|
interface EstimateFee extends EstimateFeeResponse {
|
|
1713
1714
|
suggestedMaxFee: bigint;
|
|
1714
1715
|
}
|
|
1715
|
-
|
|
1716
|
+
type EstimateFeeBulk = Array<EstimateFee>;
|
|
1716
1717
|
interface EstimateFeeDetails {
|
|
1717
1718
|
nonce?: BigNumberish;
|
|
1718
1719
|
blockIdentifier?: BlockIdentifier;
|
|
@@ -1722,11 +1723,11 @@ interface DeployContractResponse {
|
|
|
1722
1723
|
contract_address: string;
|
|
1723
1724
|
transaction_hash: string;
|
|
1724
1725
|
}
|
|
1725
|
-
|
|
1726
|
+
type MultiDeployContractResponse = {
|
|
1726
1727
|
contract_address: Array<string>;
|
|
1727
1728
|
transaction_hash: string;
|
|
1728
1729
|
};
|
|
1729
|
-
|
|
1730
|
+
type DeployContractUDCResponse = {
|
|
1730
1731
|
contract_address: string;
|
|
1731
1732
|
transaction_hash: string;
|
|
1732
1733
|
address: string;
|
|
@@ -1737,7 +1738,7 @@ declare type DeployContractUDCResponse = {
|
|
|
1737
1738
|
calldata: Array<string>;
|
|
1738
1739
|
salt: string;
|
|
1739
1740
|
};
|
|
1740
|
-
|
|
1741
|
+
type DeclareDeployUDCResponse = {
|
|
1741
1742
|
declare: {
|
|
1742
1743
|
class_hash: BigNumberish;
|
|
1743
1744
|
} & Partial<DeclareTransactionReceiptResponse>;
|
|
@@ -1978,7 +1979,7 @@ declare abstract class ProviderInterface {
|
|
|
1978
1979
|
abstract getStateUpdate(blockIdentifier?: BlockIdentifier): Promise<StateUpdateResponse>;
|
|
1979
1980
|
}
|
|
1980
1981
|
|
|
1981
|
-
|
|
1982
|
+
type RpcProviderOptions = {
|
|
1982
1983
|
nodeUrl: string;
|
|
1983
1984
|
retries?: number;
|
|
1984
1985
|
headers?: object;
|
|
@@ -2060,8 +2061,8 @@ declare class RpcProvider implements ProviderInterface {
|
|
|
2060
2061
|
getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string>;
|
|
2061
2062
|
}
|
|
2062
2063
|
|
|
2063
|
-
|
|
2064
|
-
|
|
2064
|
+
type SequencerHttpMethod = 'POST' | 'GET';
|
|
2065
|
+
type SequencerProviderOptions = {
|
|
2065
2066
|
headers?: Record<string, string>;
|
|
2066
2067
|
blockIdentifier?: BlockIdentifier;
|
|
2067
2068
|
} & ({
|
|
@@ -2198,7 +2199,7 @@ declare class HttpError extends LibraryError {
|
|
|
2198
2199
|
|
|
2199
2200
|
declare const defaultProvider: Provider;
|
|
2200
2201
|
|
|
2201
|
-
|
|
2202
|
+
type StarkNetMerkleType = {
|
|
2202
2203
|
name: string;
|
|
2203
2204
|
type: 'merkletree';
|
|
2204
2205
|
contains: string;
|
|
@@ -2209,7 +2210,7 @@ declare type StarkNetMerkleType = {
|
|
|
2209
2210
|
* Note that the `uint` and `int` aliases like in Solidity, and fixed point numbers are not supported by the EIP-712
|
|
2210
2211
|
* standard.
|
|
2211
2212
|
*/
|
|
2212
|
-
|
|
2213
|
+
type StarkNetType = {
|
|
2213
2214
|
name: string;
|
|
2214
2215
|
type: string;
|
|
2215
2216
|
} | StarkNetMerkleType;
|
|
@@ -2301,34 +2302,34 @@ declare const getStructHash: <T extends TypedData>(types: T["types"], type: stri
|
|
|
2301
2302
|
*/
|
|
2302
2303
|
declare const getMessageHash: (typedData: TypedData, account: BigNumberish) => string;
|
|
2303
2304
|
|
|
2304
|
-
|
|
2305
|
-
declare const index_isMerkleTreeType: typeof isMerkleTreeType;
|
|
2306
|
-
declare const index_getDependencies: typeof getDependencies;
|
|
2307
|
-
declare const index_encodeType: typeof encodeType;
|
|
2308
|
-
declare const index_getTypeHash: typeof getTypeHash;
|
|
2309
|
-
declare const index_encodeValue: typeof encodeValue;
|
|
2310
|
-
declare const index_encodeData: typeof encodeData;
|
|
2311
|
-
declare const index_getStructHash: typeof getStructHash;
|
|
2312
|
-
declare const index_getMessageHash: typeof getMessageHash;
|
|
2305
|
+
type index_StarkNetDomain = StarkNetDomain;
|
|
2313
2306
|
type index_StarkNetMerkleType = StarkNetMerkleType;
|
|
2314
2307
|
type index_StarkNetType = StarkNetType;
|
|
2315
|
-
type index_StarkNetDomain = StarkNetDomain;
|
|
2316
2308
|
type index_TypedData = TypedData;
|
|
2309
|
+
declare const index_encodeData: typeof encodeData;
|
|
2310
|
+
declare const index_encodeType: typeof encodeType;
|
|
2311
|
+
declare const index_encodeValue: typeof encodeValue;
|
|
2312
|
+
declare const index_getDependencies: typeof getDependencies;
|
|
2313
|
+
declare const index_getMessageHash: typeof getMessageHash;
|
|
2314
|
+
declare const index_getStructHash: typeof getStructHash;
|
|
2315
|
+
declare const index_getTypeHash: typeof getTypeHash;
|
|
2316
|
+
declare const index_isMerkleTreeType: typeof isMerkleTreeType;
|
|
2317
|
+
declare const index_prepareSelector: typeof prepareSelector;
|
|
2317
2318
|
declare namespace index {
|
|
2318
2319
|
export {
|
|
2319
|
-
|
|
2320
|
-
index_isMerkleTreeType as isMerkleTreeType,
|
|
2321
|
-
index_getDependencies as getDependencies,
|
|
2322
|
-
index_encodeType as encodeType,
|
|
2323
|
-
index_getTypeHash as getTypeHash,
|
|
2324
|
-
index_encodeValue as encodeValue,
|
|
2325
|
-
index_encodeData as encodeData,
|
|
2326
|
-
index_getStructHash as getStructHash,
|
|
2327
|
-
index_getMessageHash as getMessageHash,
|
|
2320
|
+
index_StarkNetDomain as StarkNetDomain,
|
|
2328
2321
|
index_StarkNetMerkleType as StarkNetMerkleType,
|
|
2329
2322
|
index_StarkNetType as StarkNetType,
|
|
2330
|
-
index_StarkNetDomain as StarkNetDomain,
|
|
2331
2323
|
index_TypedData as TypedData,
|
|
2324
|
+
index_encodeData as encodeData,
|
|
2325
|
+
index_encodeType as encodeType,
|
|
2326
|
+
index_encodeValue as encodeValue,
|
|
2327
|
+
index_getDependencies as getDependencies,
|
|
2328
|
+
index_getMessageHash as getMessageHash,
|
|
2329
|
+
index_getStructHash as getStructHash,
|
|
2330
|
+
index_getTypeHash as getTypeHash,
|
|
2331
|
+
index_isMerkleTreeType as isMerkleTreeType,
|
|
2332
|
+
index_prepareSelector as prepareSelector,
|
|
2332
2333
|
};
|
|
2333
2334
|
}
|
|
2334
2335
|
|
|
@@ -2396,8 +2397,8 @@ declare class Signer implements SignerInterface {
|
|
|
2396
2397
|
getPubKey(): Promise<string>;
|
|
2397
2398
|
signMessage(typedData: TypedData, accountAddress: string): Promise<Signature>;
|
|
2398
2399
|
signTransaction(transactions: Call[], transactionsDetail: InvocationsSignerDetails, abis?: Abi[]): Promise<Signature>;
|
|
2399
|
-
signDeployAccountTransaction({ classHash, contractAddress, constructorCalldata, addressSalt, maxFee, version, chainId, nonce, }: DeployAccountSignerDetails): Promise<
|
|
2400
|
-
signDeclareTransaction({ classHash, senderAddress, chainId, maxFee, version, nonce, compiledClassHash, }: DeclareSignerDetails): Promise<
|
|
2400
|
+
signDeployAccountTransaction({ classHash, contractAddress, constructorCalldata, addressSalt, maxFee, version, chainId, nonce, }: DeployAccountSignerDetails): Promise<Signature>;
|
|
2401
|
+
signDeclareTransaction({ classHash, senderAddress, chainId, maxFee, version, nonce, compiledClassHash, }: DeclareSignerDetails): Promise<Signature>;
|
|
2401
2402
|
}
|
|
2402
2403
|
|
|
2403
2404
|
declare abstract class AccountInterface extends ProviderInterface {
|
|
@@ -2897,49 +2898,49 @@ declare function computeSierraContractClassHash(sierra: CompiledSierra): string;
|
|
|
2897
2898
|
*/
|
|
2898
2899
|
declare function computeContractClassHash(contract: CompiledContract | string): string;
|
|
2899
2900
|
|
|
2900
|
-
declare const
|
|
2901
|
-
declare const hash_transactionVersion_2: typeof transactionVersion_2;
|
|
2902
|
-
declare const hash_feeTransactionVersion: typeof feeTransactionVersion;
|
|
2903
|
-
declare const hash_computeHashOnElements: typeof computeHashOnElements;
|
|
2904
|
-
declare const hash_calculateTransactionHashCommon: typeof calculateTransactionHashCommon;
|
|
2905
|
-
declare const hash_calculateDeployTransactionHash: typeof calculateDeployTransactionHash;
|
|
2901
|
+
declare const hash_calculateContractAddressFromHash: typeof calculateContractAddressFromHash;
|
|
2906
2902
|
declare const hash_calculateDeclareTransactionHash: typeof calculateDeclareTransactionHash;
|
|
2907
2903
|
declare const hash_calculateDeployAccountTransactionHash: typeof calculateDeployAccountTransactionHash;
|
|
2904
|
+
declare const hash_calculateDeployTransactionHash: typeof calculateDeployTransactionHash;
|
|
2908
2905
|
declare const hash_calculateTransactionHash: typeof calculateTransactionHash;
|
|
2909
|
-
declare const
|
|
2910
|
-
declare const hash_formatSpaces: typeof formatSpaces;
|
|
2911
|
-
declare const hash_computeLegacyContractClassHash: typeof computeLegacyContractClassHash;
|
|
2906
|
+
declare const hash_calculateTransactionHashCommon: typeof calculateTransactionHashCommon;
|
|
2912
2907
|
declare const hash_computeCompiledClassHash: typeof computeCompiledClassHash;
|
|
2913
|
-
declare const hash_computeSierraContractClassHash: typeof computeSierraContractClassHash;
|
|
2914
2908
|
declare const hash_computeContractClassHash: typeof computeContractClassHash;
|
|
2915
|
-
declare const
|
|
2909
|
+
declare const hash_computeHashOnElements: typeof computeHashOnElements;
|
|
2910
|
+
declare const hash_computeLegacyContractClassHash: typeof computeLegacyContractClassHash;
|
|
2911
|
+
declare const hash_computeSierraContractClassHash: typeof computeSierraContractClassHash;
|
|
2912
|
+
declare const hash_feeTransactionVersion: typeof feeTransactionVersion;
|
|
2913
|
+
declare const hash_formatSpaces: typeof formatSpaces;
|
|
2914
|
+
declare const hash_getSelector: typeof getSelector;
|
|
2915
|
+
declare const hash_getSelectorFromName: typeof getSelectorFromName;
|
|
2916
2916
|
declare const hash_keccakBn: typeof keccakBn;
|
|
2917
|
+
declare const hash_poseidon: typeof poseidon;
|
|
2917
2918
|
declare const hash_starknetKeccak: typeof starknetKeccak;
|
|
2918
|
-
declare const
|
|
2919
|
-
declare const
|
|
2919
|
+
declare const hash_transactionVersion: typeof transactionVersion;
|
|
2920
|
+
declare const hash_transactionVersion_2: typeof transactionVersion_2;
|
|
2920
2921
|
declare namespace hash {
|
|
2921
2922
|
export {
|
|
2922
|
-
|
|
2923
|
-
hash_transactionVersion as transactionVersion,
|
|
2924
|
-
hash_transactionVersion_2 as transactionVersion_2,
|
|
2925
|
-
hash_feeTransactionVersion as feeTransactionVersion,
|
|
2926
|
-
hash_computeHashOnElements as computeHashOnElements,
|
|
2927
|
-
hash_calculateTransactionHashCommon as calculateTransactionHashCommon,
|
|
2928
|
-
hash_calculateDeployTransactionHash as calculateDeployTransactionHash,
|
|
2923
|
+
hash_calculateContractAddressFromHash as calculateContractAddressFromHash,
|
|
2929
2924
|
hash_calculateDeclareTransactionHash as calculateDeclareTransactionHash,
|
|
2930
2925
|
hash_calculateDeployAccountTransactionHash as calculateDeployAccountTransactionHash,
|
|
2926
|
+
hash_calculateDeployTransactionHash as calculateDeployTransactionHash,
|
|
2931
2927
|
hash_calculateTransactionHash as calculateTransactionHash,
|
|
2932
|
-
|
|
2933
|
-
hash_formatSpaces as formatSpaces,
|
|
2934
|
-
hash_computeLegacyContractClassHash as computeLegacyContractClassHash,
|
|
2928
|
+
hash_calculateTransactionHashCommon as calculateTransactionHashCommon,
|
|
2935
2929
|
hash_computeCompiledClassHash as computeCompiledClassHash,
|
|
2936
|
-
hash_computeSierraContractClassHash as computeSierraContractClassHash,
|
|
2937
2930
|
hash_computeContractClassHash as computeContractClassHash,
|
|
2938
|
-
|
|
2931
|
+
hash_computeHashOnElements as computeHashOnElements,
|
|
2932
|
+
hash_computeLegacyContractClassHash as computeLegacyContractClassHash,
|
|
2933
|
+
hash_computeSierraContractClassHash as computeSierraContractClassHash,
|
|
2934
|
+
computeHintedClassHash as default,
|
|
2935
|
+
hash_feeTransactionVersion as feeTransactionVersion,
|
|
2936
|
+
hash_formatSpaces as formatSpaces,
|
|
2937
|
+
hash_getSelector as getSelector,
|
|
2938
|
+
hash_getSelectorFromName as getSelectorFromName,
|
|
2939
2939
|
hash_keccakBn as keccakBn,
|
|
2940
|
+
hash_poseidon as poseidon,
|
|
2940
2941
|
hash_starknetKeccak as starknetKeccak,
|
|
2941
|
-
|
|
2942
|
-
|
|
2942
|
+
hash_transactionVersion as transactionVersion,
|
|
2943
|
+
hash_transactionVersion_2 as transactionVersion_2,
|
|
2943
2944
|
};
|
|
2944
2945
|
}
|
|
2945
2946
|
|
|
@@ -3001,20 +3002,20 @@ declare const fromCallsToExecuteCalldata_cairo1: (calls: Call[]) => Calldata;
|
|
|
3001
3002
|
*/
|
|
3002
3003
|
declare const getExecuteCalldata: (calls: Call[], cairoVersion?: CairoVersion) => Calldata;
|
|
3003
3004
|
|
|
3004
|
-
declare const transaction_transformCallsToMulticallArrays: typeof transformCallsToMulticallArrays;
|
|
3005
3005
|
declare const transaction_fromCallsToExecuteCalldata: typeof fromCallsToExecuteCalldata;
|
|
3006
3006
|
declare const transaction_fromCallsToExecuteCalldataWithNonce: typeof fromCallsToExecuteCalldataWithNonce;
|
|
3007
|
-
declare const transaction_transformCallsToMulticallArrays_cairo1: typeof transformCallsToMulticallArrays_cairo1;
|
|
3008
3007
|
declare const transaction_fromCallsToExecuteCalldata_cairo1: typeof fromCallsToExecuteCalldata_cairo1;
|
|
3009
3008
|
declare const transaction_getExecuteCalldata: typeof getExecuteCalldata;
|
|
3009
|
+
declare const transaction_transformCallsToMulticallArrays: typeof transformCallsToMulticallArrays;
|
|
3010
|
+
declare const transaction_transformCallsToMulticallArrays_cairo1: typeof transformCallsToMulticallArrays_cairo1;
|
|
3010
3011
|
declare namespace transaction {
|
|
3011
3012
|
export {
|
|
3012
|
-
transaction_transformCallsToMulticallArrays as transformCallsToMulticallArrays,
|
|
3013
3013
|
transaction_fromCallsToExecuteCalldata as fromCallsToExecuteCalldata,
|
|
3014
3014
|
transaction_fromCallsToExecuteCalldataWithNonce as fromCallsToExecuteCalldataWithNonce,
|
|
3015
|
-
transaction_transformCallsToMulticallArrays_cairo1 as transformCallsToMulticallArrays_cairo1,
|
|
3016
3015
|
transaction_fromCallsToExecuteCalldata_cairo1 as fromCallsToExecuteCalldata_cairo1,
|
|
3017
3016
|
transaction_getExecuteCalldata as getExecuteCalldata,
|
|
3017
|
+
transaction_transformCallsToMulticallArrays as transformCallsToMulticallArrays,
|
|
3018
|
+
transaction_transformCallsToMulticallArrays_cairo1 as transformCallsToMulticallArrays_cairo1,
|
|
3018
3019
|
};
|
|
3019
3020
|
}
|
|
3020
3021
|
|
|
@@ -3034,21 +3035,21 @@ declare function signatureToHexArray(sig?: Signature): ArraySignatureType;
|
|
|
3034
3035
|
declare function estimatedFeeToMaxFee(estimatedFee: BigNumberish, overhead?: number): bigint;
|
|
3035
3036
|
|
|
3036
3037
|
declare const stark_compressProgram: typeof compressProgram;
|
|
3037
|
-
declare const
|
|
3038
|
-
declare const stark_makeAddress: typeof makeAddress;
|
|
3038
|
+
declare const stark_estimatedFeeToMaxFee: typeof estimatedFeeToMaxFee;
|
|
3039
3039
|
declare const stark_formatSignature: typeof formatSignature;
|
|
3040
|
+
declare const stark_makeAddress: typeof makeAddress;
|
|
3041
|
+
declare const stark_randomAddress: typeof randomAddress;
|
|
3040
3042
|
declare const stark_signatureToDecimalArray: typeof signatureToDecimalArray;
|
|
3041
3043
|
declare const stark_signatureToHexArray: typeof signatureToHexArray;
|
|
3042
|
-
declare const stark_estimatedFeeToMaxFee: typeof estimatedFeeToMaxFee;
|
|
3043
3044
|
declare namespace stark {
|
|
3044
3045
|
export {
|
|
3045
3046
|
stark_compressProgram as compressProgram,
|
|
3046
|
-
|
|
3047
|
-
stark_makeAddress as makeAddress,
|
|
3047
|
+
stark_estimatedFeeToMaxFee as estimatedFeeToMaxFee,
|
|
3048
3048
|
stark_formatSignature as formatSignature,
|
|
3049
|
+
stark_makeAddress as makeAddress,
|
|
3050
|
+
stark_randomAddress as randomAddress,
|
|
3049
3051
|
stark_signatureToDecimalArray as signatureToDecimalArray,
|
|
3050
3052
|
stark_signatureToHexArray as signatureToHexArray,
|
|
3051
|
-
stark_estimatedFeeToMaxFee as estimatedFeeToMaxFee,
|
|
3052
3053
|
};
|
|
3053
3054
|
}
|
|
3054
3055
|
|
|
@@ -3111,26 +3112,26 @@ declare function encodeShortString(str: string): string;
|
|
|
3111
3112
|
*/
|
|
3112
3113
|
declare function decodeShortString(str: string): string;
|
|
3113
3114
|
|
|
3115
|
+
declare const shortString_decodeShortString: typeof decodeShortString;
|
|
3116
|
+
declare const shortString_encodeShortString: typeof encodeShortString;
|
|
3114
3117
|
declare const shortString_isASCII: typeof isASCII;
|
|
3115
|
-
declare const shortString_isShortString: typeof isShortString;
|
|
3116
3118
|
declare const shortString_isDecimalString: typeof isDecimalString;
|
|
3117
|
-
declare const shortString_isText: typeof isText;
|
|
3118
|
-
declare const shortString_isShortText: typeof isShortText;
|
|
3119
3119
|
declare const shortString_isLongText: typeof isLongText;
|
|
3120
|
+
declare const shortString_isShortString: typeof isShortString;
|
|
3121
|
+
declare const shortString_isShortText: typeof isShortText;
|
|
3122
|
+
declare const shortString_isText: typeof isText;
|
|
3120
3123
|
declare const shortString_splitLongString: typeof splitLongString;
|
|
3121
|
-
declare const shortString_encodeShortString: typeof encodeShortString;
|
|
3122
|
-
declare const shortString_decodeShortString: typeof decodeShortString;
|
|
3123
3124
|
declare namespace shortString {
|
|
3124
3125
|
export {
|
|
3126
|
+
shortString_decodeShortString as decodeShortString,
|
|
3127
|
+
shortString_encodeShortString as encodeShortString,
|
|
3125
3128
|
shortString_isASCII as isASCII,
|
|
3126
|
-
shortString_isShortString as isShortString,
|
|
3127
3129
|
shortString_isDecimalString as isDecimalString,
|
|
3128
|
-
shortString_isText as isText,
|
|
3129
|
-
shortString_isShortText as isShortText,
|
|
3130
3130
|
shortString_isLongText as isLongText,
|
|
3131
|
+
shortString_isShortString as isShortString,
|
|
3132
|
+
shortString_isShortText as isShortText,
|
|
3133
|
+
shortString_isText as isText,
|
|
3131
3134
|
shortString_splitLongString as splitLongString,
|
|
3132
|
-
shortString_encodeShortString as encodeShortString,
|
|
3133
|
-
shortString_decodeShortString as decodeShortString,
|
|
3134
3135
|
};
|
|
3135
3136
|
}
|
|
3136
3137
|
|
|
@@ -3142,17 +3143,17 @@ declare const enum StarknetIdContract {
|
|
|
3142
3143
|
}
|
|
3143
3144
|
declare function getStarknetIdContract(chainId: StarknetChainId): string;
|
|
3144
3145
|
|
|
3145
|
-
declare const starknetId_useDecoded: typeof useDecoded;
|
|
3146
|
-
declare const starknetId_useEncoded: typeof useEncoded;
|
|
3147
3146
|
type starknetId_StarknetIdContract = StarknetIdContract;
|
|
3148
3147
|
declare const starknetId_StarknetIdContract: typeof StarknetIdContract;
|
|
3149
3148
|
declare const starknetId_getStarknetIdContract: typeof getStarknetIdContract;
|
|
3149
|
+
declare const starknetId_useDecoded: typeof useDecoded;
|
|
3150
|
+
declare const starknetId_useEncoded: typeof useEncoded;
|
|
3150
3151
|
declare namespace starknetId {
|
|
3151
3152
|
export {
|
|
3152
|
-
starknetId_useDecoded as useDecoded,
|
|
3153
|
-
starknetId_useEncoded as useEncoded,
|
|
3154
3153
|
starknetId_StarknetIdContract as StarknetIdContract,
|
|
3155
3154
|
starknetId_getStarknetIdContract as getStarknetIdContract,
|
|
3155
|
+
starknetId_useDecoded as useDecoded,
|
|
3156
|
+
starknetId_useEncoded as useEncoded,
|
|
3156
3157
|
};
|
|
3157
3158
|
}
|
|
3158
3159
|
|
|
@@ -3201,61 +3202,7 @@ declare const uint256: (it: BigNumberish) => Uint256;
|
|
|
3201
3202
|
/**
|
|
3202
3203
|
* unnamed tuple cairo type (helper same as common struct type)
|
|
3203
3204
|
*/
|
|
3204
|
-
declare const tuple: (...args: (BigNumberish | object | boolean)[]) =>
|
|
3205
|
-
[x: number]: boolean | object | BigNumberish;
|
|
3206
|
-
length: number;
|
|
3207
|
-
toString(): string;
|
|
3208
|
-
toLocaleString(): string;
|
|
3209
|
-
pop(): boolean | object | BigNumberish | undefined;
|
|
3210
|
-
push(...items: (boolean | object | BigNumberish)[]): number;
|
|
3211
|
-
concat(...items: ConcatArray<boolean | object | BigNumberish>[]): (boolean | object | BigNumberish)[];
|
|
3212
|
-
concat(...items: (boolean | object | BigNumberish | ConcatArray<boolean | object | BigNumberish>)[]): (boolean | object | BigNumberish)[];
|
|
3213
|
-
join(separator?: string | undefined): string;
|
|
3214
|
-
reverse(): (boolean | object | BigNumberish)[];
|
|
3215
|
-
shift(): boolean | object | BigNumberish | undefined;
|
|
3216
|
-
slice(start?: number | undefined, end?: number | undefined): (boolean | object | BigNumberish)[];
|
|
3217
|
-
sort(compareFn?: ((a: boolean | object | BigNumberish, b: boolean | object | BigNumberish) => number) | undefined): (boolean | object | BigNumberish)[];
|
|
3218
|
-
splice(start: number, deleteCount?: number | undefined): (boolean | object | BigNumberish)[];
|
|
3219
|
-
splice(start: number, deleteCount: number, ...items: (boolean | object | BigNumberish)[]): (boolean | object | BigNumberish)[];
|
|
3220
|
-
unshift(...items: (boolean | object | BigNumberish)[]): number;
|
|
3221
|
-
indexOf(searchElement: boolean | object | BigNumberish, fromIndex?: number | undefined): number;
|
|
3222
|
-
lastIndexOf(searchElement: boolean | object | BigNumberish, fromIndex?: number | undefined): number;
|
|
3223
|
-
every<S extends boolean | object | BigNumberish>(predicate: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => value is S, thisArg?: any): this is S[];
|
|
3224
|
-
every(predicate: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => unknown, thisArg?: any): boolean;
|
|
3225
|
-
some(predicate: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => unknown, thisArg?: any): boolean;
|
|
3226
|
-
forEach(callbackfn: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => void, thisArg?: any): void;
|
|
3227
|
-
map<U>(callbackfn: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => U, thisArg?: any): U[];
|
|
3228
|
-
filter<S_1 extends boolean | object | BigNumberish>(predicate: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => value is S_1, thisArg?: any): S_1[];
|
|
3229
|
-
filter(predicate: (value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => unknown, thisArg?: any): (boolean | object | BigNumberish)[];
|
|
3230
|
-
reduce(callbackfn: (previousValue: boolean | object | BigNumberish, currentValue: boolean | object | BigNumberish, currentIndex: number, array: (boolean | object | BigNumberish)[]) => boolean | object | BigNumberish): boolean | object | BigNumberish;
|
|
3231
|
-
reduce(callbackfn: (previousValue: boolean | object | BigNumberish, currentValue: boolean | object | BigNumberish, currentIndex: number, array: (boolean | object | BigNumberish)[]) => boolean | object | BigNumberish, initialValue: boolean | object | BigNumberish): boolean | object | BigNumberish;
|
|
3232
|
-
reduce<U_1>(callbackfn: (previousValue: U_1, currentValue: boolean | object | BigNumberish, currentIndex: number, array: (boolean | object | BigNumberish)[]) => U_1, initialValue: U_1): U_1;
|
|
3233
|
-
reduceRight(callbackfn: (previousValue: boolean | object | BigNumberish, currentValue: boolean | object | BigNumberish, currentIndex: number, array: (boolean | object | BigNumberish)[]) => boolean | object | BigNumberish): boolean | object | BigNumberish;
|
|
3234
|
-
reduceRight(callbackfn: (previousValue: boolean | object | BigNumberish, currentValue: boolean | object | BigNumberish, currentIndex: number, array: (boolean | object | BigNumberish)[]) => boolean | object | BigNumberish, initialValue: boolean | object | BigNumberish): boolean | object | BigNumberish;
|
|
3235
|
-
reduceRight<U_2>(callbackfn: (previousValue: U_2, currentValue: boolean | object | BigNumberish, currentIndex: number, array: (boolean | object | BigNumberish)[]) => U_2, initialValue: U_2): U_2;
|
|
3236
|
-
find<S_2 extends boolean | object | BigNumberish>(predicate: (this: void, value: boolean | object | BigNumberish, index: number, obj: (boolean | object | BigNumberish)[]) => value is S_2, thisArg?: any): S_2 | undefined;
|
|
3237
|
-
find(predicate: (value: boolean | object | BigNumberish, index: number, obj: (boolean | object | BigNumberish)[]) => unknown, thisArg?: any): boolean | object | BigNumberish | undefined;
|
|
3238
|
-
findIndex(predicate: (value: boolean | object | BigNumberish, index: number, obj: (boolean | object | BigNumberish)[]) => unknown, thisArg?: any): number;
|
|
3239
|
-
fill(value: boolean | object | BigNumberish, start?: number | undefined, end?: number | undefined): (boolean | object | BigNumberish)[];
|
|
3240
|
-
copyWithin(target: number, start: number, end?: number | undefined): (boolean | object | BigNumberish)[];
|
|
3241
|
-
entries(): IterableIterator<[number, boolean | object | BigNumberish]>;
|
|
3242
|
-
keys(): IterableIterator<number>;
|
|
3243
|
-
values(): IterableIterator<boolean | object | BigNumberish>;
|
|
3244
|
-
includes(searchElement: boolean | object | BigNumberish, fromIndex?: number | undefined): boolean;
|
|
3245
|
-
flatMap<U_3, This = undefined>(callback: (this: This, value: boolean | object | BigNumberish, index: number, array: (boolean | object | BigNumberish)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[];
|
|
3246
|
-
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
3247
|
-
[Symbol.iterator](): IterableIterator<boolean | object | BigNumberish>;
|
|
3248
|
-
[Symbol.unscopables](): {
|
|
3249
|
-
copyWithin: boolean;
|
|
3250
|
-
entries: boolean;
|
|
3251
|
-
fill: boolean;
|
|
3252
|
-
find: boolean;
|
|
3253
|
-
findIndex: boolean;
|
|
3254
|
-
keys: boolean;
|
|
3255
|
-
values: boolean;
|
|
3256
|
-
};
|
|
3257
|
-
at(index: number): boolean | object | BigNumberish | undefined;
|
|
3258
|
-
};
|
|
3205
|
+
declare const tuple: (...args: (BigNumberish | object | boolean)[]) => Record<number, BigNumberish | object | boolean>;
|
|
3259
3206
|
/**
|
|
3260
3207
|
* felt cairo type
|
|
3261
3208
|
*/
|
|
@@ -3263,39 +3210,39 @@ declare function felt(it: BigNumberish): string;
|
|
|
3263
3210
|
|
|
3264
3211
|
type cairo_Uint = Uint;
|
|
3265
3212
|
declare const cairo_Uint: typeof Uint;
|
|
3213
|
+
declare const cairo_felt: typeof felt;
|
|
3214
|
+
declare const cairo_getArrayType: typeof getArrayType;
|
|
3215
|
+
declare const cairo_isCairo1Type: typeof isCairo1Type;
|
|
3266
3216
|
declare const cairo_isLen: typeof isLen;
|
|
3267
|
-
declare const cairo_isTypeFelt: typeof isTypeFelt;
|
|
3268
3217
|
declare const cairo_isTypeArray: typeof isTypeArray;
|
|
3269
|
-
declare const
|
|
3218
|
+
declare const cairo_isTypeBool: typeof isTypeBool;
|
|
3219
|
+
declare const cairo_isTypeContractAddress: typeof isTypeContractAddress;
|
|
3220
|
+
declare const cairo_isTypeFelt: typeof isTypeFelt;
|
|
3270
3221
|
declare const cairo_isTypeNamedTuple: typeof isTypeNamedTuple;
|
|
3271
3222
|
declare const cairo_isTypeStruct: typeof isTypeStruct;
|
|
3223
|
+
declare const cairo_isTypeTuple: typeof isTypeTuple;
|
|
3272
3224
|
declare const cairo_isTypeUint: typeof isTypeUint;
|
|
3273
3225
|
declare const cairo_isTypeUint256: typeof isTypeUint256;
|
|
3274
|
-
declare const cairo_isTypeBool: typeof isTypeBool;
|
|
3275
|
-
declare const cairo_isTypeContractAddress: typeof isTypeContractAddress;
|
|
3276
|
-
declare const cairo_isCairo1Type: typeof isCairo1Type;
|
|
3277
|
-
declare const cairo_getArrayType: typeof getArrayType;
|
|
3278
|
-
declare const cairo_uint256: typeof uint256;
|
|
3279
3226
|
declare const cairo_tuple: typeof tuple;
|
|
3280
|
-
declare const
|
|
3227
|
+
declare const cairo_uint256: typeof uint256;
|
|
3281
3228
|
declare namespace cairo {
|
|
3282
3229
|
export {
|
|
3283
3230
|
cairo_Uint as Uint,
|
|
3231
|
+
cairo_felt as felt,
|
|
3232
|
+
cairo_getArrayType as getArrayType,
|
|
3233
|
+
cairo_isCairo1Type as isCairo1Type,
|
|
3284
3234
|
cairo_isLen as isLen,
|
|
3285
|
-
cairo_isTypeFelt as isTypeFelt,
|
|
3286
3235
|
cairo_isTypeArray as isTypeArray,
|
|
3287
|
-
|
|
3236
|
+
cairo_isTypeBool as isTypeBool,
|
|
3237
|
+
cairo_isTypeContractAddress as isTypeContractAddress,
|
|
3238
|
+
cairo_isTypeFelt as isTypeFelt,
|
|
3288
3239
|
cairo_isTypeNamedTuple as isTypeNamedTuple,
|
|
3289
3240
|
cairo_isTypeStruct as isTypeStruct,
|
|
3241
|
+
cairo_isTypeTuple as isTypeTuple,
|
|
3290
3242
|
cairo_isTypeUint as isTypeUint,
|
|
3291
3243
|
cairo_isTypeUint256 as isTypeUint256,
|
|
3292
|
-
cairo_isTypeBool as isTypeBool,
|
|
3293
|
-
cairo_isTypeContractAddress as isTypeContractAddress,
|
|
3294
|
-
cairo_isCairo1Type as isCairo1Type,
|
|
3295
|
-
cairo_getArrayType as getArrayType,
|
|
3296
|
-
cairo_uint256 as uint256,
|
|
3297
3244
|
cairo_tuple as tuple,
|
|
3298
|
-
|
|
3245
|
+
cairo_uint256 as uint256,
|
|
3299
3246
|
};
|
|
3300
3247
|
}
|
|
3301
3248
|
|
|
@@ -3314,10 +3261,17 @@ declare class CallData {
|
|
|
3314
3261
|
* Compile contract callData with abi
|
|
3315
3262
|
* Parse the calldata by using input fields from the abi for that method
|
|
3316
3263
|
* @param method string - method name
|
|
3317
|
-
* @param args
|
|
3264
|
+
* @param args RawArgs - arguments passed to the method. Can be an array of arguments (in the order of abi definition), or an object constructed in conformity with abi (in this case, the parameter can be in a wrong order).
|
|
3318
3265
|
* @return Calldata - parsed arguments in format that contract is expecting
|
|
3319
|
-
|
|
3320
|
-
|
|
3266
|
+
* @example
|
|
3267
|
+
* ```typescript
|
|
3268
|
+
* const calldata = myCallData.compile("constructor",["0x34a",[1,3n]]);
|
|
3269
|
+
* ```
|
|
3270
|
+
* ```typescript
|
|
3271
|
+
* const calldata2 = myCallData.compile("constructor",{list:[1,3n],balance:"0x34"}); // wrong order is valid
|
|
3272
|
+
* ```
|
|
3273
|
+
*/
|
|
3274
|
+
compile(method: string, argsCalldata: RawArgs): Calldata;
|
|
3321
3275
|
/**
|
|
3322
3276
|
* Compile contract callData without abi
|
|
3323
3277
|
* @param rawArgs RawArgs representing cairo method arguments or string array of compiled data
|