starknet 5.26.1 → 5.28.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/README.md +1 -1
- package/dist/index.d.ts +86 -46
- package/dist/index.global.js +325 -125
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +326 -125
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +324 -124
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# [5.28.0](https://github.com/starknet-io/starknet.js/compare/v5.27.0...v5.28.0) (2024-02-01)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- expand structured data hashing in line with SNIP-12 ([#920](https://github.com/starknet-io/starknet.js/issues/920)) ([cb20590](https://github.com/starknet-io/starknet.js/commit/cb2059039e3b42501cdfefec7802da83eb73645b))
|
|
6
|
+
|
|
7
|
+
# [5.27.0](https://github.com/starknet-io/starknet.js/compare/v5.26.1...v5.27.0) (2024-01-23)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
- trigger release ([fbf983f](https://github.com/starknet-io/starknet.js/commit/fbf983f7820768f919cddb2c5806178a20e38bdd))
|
|
12
|
+
|
|
1
13
|
## [5.26.1](https://github.com/starknet-io/starknet.js/compare/v5.26.0...v5.26.1) (2024-01-18)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ If you consider to contribute to this project please read [CONTRIBUTING.md](http
|
|
|
64
64
|
|
|
65
65
|
Special thanks to all the [contributors](https://github.com/starknet-io/starknet.js/graphs/contributors), especially to:
|
|
66
66
|
|
|
67
|
-
- Sean ([@0xs34n](https://github.com/0xs34n)), the original creator of
|
|
67
|
+
- Sean ([@0xs34n](https://github.com/0xs34n)), the original creator of Starknet.js!
|
|
68
68
|
|
|
69
69
|
- Janek ([@janek26](https://github.com/janek26)) and Dhruv ([@dhruvkelawala](https://github.com/dhruvkelawala)) from [Argent](https://github.com/argentlabs)
|
|
70
70
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as weierstrass from '@noble/curves/abstract/weierstrass';
|
|
2
|
-
import { Abi as Abi$1, TypedContract
|
|
3
|
-
import { Abi as Abi$2, TypedContract as TypedContract$
|
|
2
|
+
import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi-v1';
|
|
3
|
+
import { Abi as Abi$2, TypedContract as TypedContract$1 } from 'abi-wan-kanabi-v2';
|
|
4
4
|
import * as poseidon from '@noble/curves/abstract/poseidon';
|
|
5
5
|
import * as json$1 from 'lossless-json';
|
|
6
6
|
import * as starknet from '@scure/starknet';
|
|
@@ -231,7 +231,8 @@ type CairoEnumRaw = {
|
|
|
231
231
|
* {Success: 234, Warning: undefined, Error: undefined}.
|
|
232
232
|
* Only one variant with a value, object, array.
|
|
233
233
|
* @returns an instance representing a Cairo custom Enum.
|
|
234
|
-
* @example
|
|
234
|
+
* @example
|
|
235
|
+
* ```typescript
|
|
235
236
|
* const myCairoEnum = new CairoCustomEnum( {Success: undefined, Warning: "0x7f32ea", Error: undefined})
|
|
236
237
|
* ```
|
|
237
238
|
*/
|
|
@@ -239,7 +240,8 @@ declare class CairoCustomEnum {
|
|
|
239
240
|
/**
|
|
240
241
|
* direct readonly access to variants of the Cairo Custom Enum.
|
|
241
242
|
* @returns a value of type any
|
|
242
|
-
* @example
|
|
243
|
+
* @example
|
|
244
|
+
* ```typescript
|
|
243
245
|
* const successValue = myCairoEnum.variant.Success;
|
|
244
246
|
*/
|
|
245
247
|
readonly variant: CairoEnumRaw;
|
|
@@ -268,7 +270,8 @@ declare enum CairoOptionVariant {
|
|
|
268
270
|
* @param variant CairoOptionVariant.Some or CairoOptionVariant.None
|
|
269
271
|
* @param someContent value of type T.
|
|
270
272
|
* @returns an instance representing a Cairo Option.
|
|
271
|
-
* @example
|
|
273
|
+
* @example
|
|
274
|
+
* ```typescript
|
|
272
275
|
* const myOption = new CairoOption<BigNumberish>(CairoOptionVariant.Some, "0x54dda8");
|
|
273
276
|
* ```
|
|
274
277
|
*/
|
|
@@ -303,7 +306,8 @@ declare enum CairoResultVariant {
|
|
|
303
306
|
* @param variant CairoResultVariant.Ok or CairoResultVariant.Err
|
|
304
307
|
* @param resultContent value of type T or U.
|
|
305
308
|
* @returns an instance representing a Cairo Result.
|
|
306
|
-
* @example
|
|
309
|
+
* @example
|
|
310
|
+
* ```typescript
|
|
307
311
|
* const myOption = new CairoResult<BigNumberish, CustomError>(CairoResultVariant.Ok, "0x54dda8");
|
|
308
312
|
* ```
|
|
309
313
|
*/
|
|
@@ -403,7 +407,7 @@ type LegacyContractClass = {
|
|
|
403
407
|
abi: Abi;
|
|
404
408
|
};
|
|
405
409
|
/**
|
|
406
|
-
* format produced after
|
|
410
|
+
* format produced after compiling .cairo to .json
|
|
407
411
|
*/
|
|
408
412
|
type LegacyCompiledContract = Omit<LegacyContractClass, 'program'> & {
|
|
409
413
|
program: Program;
|
|
@@ -2884,7 +2888,7 @@ declare enum Uint {
|
|
|
2884
2888
|
u128 = "core::integer::u128",
|
|
2885
2889
|
u256 = "core::integer::u256"
|
|
2886
2890
|
}
|
|
2887
|
-
declare enum
|
|
2891
|
+
declare enum Literal {
|
|
2888
2892
|
ClassHash = "core::starknet::class_hash::ClassHash",
|
|
2889
2893
|
ContractAddress = "core::starknet::contract_address::ContractAddress"
|
|
2890
2894
|
}
|
|
@@ -2934,6 +2938,15 @@ type DeployAccountSignerDetails = Required<DeployAccountContractPayload> & Requi
|
|
|
2934
2938
|
chainId: StarknetChainId;
|
|
2935
2939
|
};
|
|
2936
2940
|
|
|
2941
|
+
declare enum TypedDataRevision {
|
|
2942
|
+
Active = "1",
|
|
2943
|
+
Legacy = "0"
|
|
2944
|
+
}
|
|
2945
|
+
type StarkNetEnumType = {
|
|
2946
|
+
name: string;
|
|
2947
|
+
type: 'enum';
|
|
2948
|
+
contains: string;
|
|
2949
|
+
};
|
|
2937
2950
|
type StarkNetMerkleType = {
|
|
2938
2951
|
name: string;
|
|
2939
2952
|
type: 'merkletree';
|
|
@@ -2948,7 +2961,7 @@ type StarkNetMerkleType = {
|
|
|
2948
2961
|
type StarkNetType = {
|
|
2949
2962
|
name: string;
|
|
2950
2963
|
type: string;
|
|
2951
|
-
} | StarkNetMerkleType;
|
|
2964
|
+
} | StarkNetEnumType | StarkNetMerkleType;
|
|
2952
2965
|
/**
|
|
2953
2966
|
* The EIP712 domain struct. Any of these fields are optional, but it must contain at least one field.
|
|
2954
2967
|
*/
|
|
@@ -2956,6 +2969,7 @@ interface StarkNetDomain extends Record<string, unknown> {
|
|
|
2956
2969
|
name?: string;
|
|
2957
2970
|
version?: string;
|
|
2958
2971
|
chainId?: string | number;
|
|
2972
|
+
revision?: string;
|
|
2959
2973
|
}
|
|
2960
2974
|
/**
|
|
2961
2975
|
* The complete typed data, with all the structs, domain data, primary type of the message, and the message itself.
|
|
@@ -3066,8 +3080,8 @@ type index$1_InvokeTransactionResponse = InvokeTransactionResponse;
|
|
|
3066
3080
|
type index$1_LegacyCompiledContract = LegacyCompiledContract;
|
|
3067
3081
|
type index$1_LegacyContractClass = LegacyContractClass;
|
|
3068
3082
|
type index$1_LegacyEvent = LegacyEvent;
|
|
3069
|
-
type index$
|
|
3070
|
-
declare const index$
|
|
3083
|
+
type index$1_Literal = Literal;
|
|
3084
|
+
declare const index$1_Literal: typeof Literal;
|
|
3071
3085
|
type index$1_MessageToL1 = MessageToL1;
|
|
3072
3086
|
type index$1_MessageToL2 = MessageToL2;
|
|
3073
3087
|
type index$1_MultiDeployContractResponse = MultiDeployContractResponse;
|
|
@@ -3104,6 +3118,7 @@ type index$1_SimulateTransactionResponse = SimulateTransactionResponse;
|
|
|
3104
3118
|
type index$1_SimulatedTransaction = SimulatedTransaction;
|
|
3105
3119
|
type index$1_SimulationFlags = SimulationFlags;
|
|
3106
3120
|
type index$1_StarkNetDomain = StarkNetDomain;
|
|
3121
|
+
type index$1_StarkNetEnumType = StarkNetEnumType;
|
|
3107
3122
|
type index$1_StarkNetMerkleType = StarkNetMerkleType;
|
|
3108
3123
|
type index$1_StarkNetType = StarkNetType;
|
|
3109
3124
|
type index$1_StateUpdateResponse = StateUpdateResponse;
|
|
@@ -3118,6 +3133,8 @@ type index$1_TransactionType = TransactionType;
|
|
|
3118
3133
|
declare const index$1_TransactionType: typeof TransactionType;
|
|
3119
3134
|
type index$1_Tupled = Tupled;
|
|
3120
3135
|
type index$1_TypedData = TypedData;
|
|
3136
|
+
type index$1_TypedDataRevision = TypedDataRevision;
|
|
3137
|
+
declare const index$1_TypedDataRevision: typeof TypedDataRevision;
|
|
3121
3138
|
type index$1_Uint = Uint;
|
|
3122
3139
|
declare const index$1_Uint: typeof Uint;
|
|
3123
3140
|
type index$1_Uint256 = Uint256;
|
|
@@ -3228,7 +3245,7 @@ declare namespace index$1 {
|
|
|
3228
3245
|
index$1_LegacyCompiledContract as LegacyCompiledContract,
|
|
3229
3246
|
index$1_LegacyContractClass as LegacyContractClass,
|
|
3230
3247
|
index$1_LegacyEvent as LegacyEvent,
|
|
3231
|
-
index$
|
|
3248
|
+
index$1_Literal as Literal,
|
|
3232
3249
|
index$1_MessageToL1 as MessageToL1,
|
|
3233
3250
|
index$1_MessageToL2 as MessageToL2,
|
|
3234
3251
|
index$1_MultiDeployContractResponse as MultiDeployContractResponse,
|
|
@@ -3266,6 +3283,7 @@ declare namespace index$1 {
|
|
|
3266
3283
|
index$1_SimulatedTransaction as SimulatedTransaction,
|
|
3267
3284
|
index$1_SimulationFlags as SimulationFlags,
|
|
3268
3285
|
index$1_StarkNetDomain as StarkNetDomain,
|
|
3286
|
+
index$1_StarkNetEnumType as StarkNetEnumType,
|
|
3269
3287
|
index$1_StarkNetMerkleType as StarkNetMerkleType,
|
|
3270
3288
|
index$1_StarkNetType as StarkNetType,
|
|
3271
3289
|
index$1_StateUpdateResponse as StateUpdateResponse,
|
|
@@ -3278,6 +3296,7 @@ declare namespace index$1 {
|
|
|
3278
3296
|
index$1_TransactionType as TransactionType,
|
|
3279
3297
|
index$1_Tupled as Tupled,
|
|
3280
3298
|
index$1_TypedData as TypedData,
|
|
3299
|
+
index$1_TypedDataRevision as TypedDataRevision,
|
|
3281
3300
|
index$1_Uint as Uint,
|
|
3282
3301
|
index$1_Uint256 as Uint256,
|
|
3283
3302
|
index$1_UniversalDeployerContractPayload as UniversalDeployerContractPayload,
|
|
@@ -3381,7 +3400,7 @@ declare abstract class ProviderInterface {
|
|
|
3381
3400
|
abstract deployAccountContract(payload: DeployAccountContractPayload, details: InvocationsDetailsWithNonce): Promise<DeployContractResponse>;
|
|
3382
3401
|
/**
|
|
3383
3402
|
* Invokes a function on starknet
|
|
3384
|
-
* @deprecated This method
|
|
3403
|
+
* @deprecated This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class
|
|
3385
3404
|
*
|
|
3386
3405
|
* @param invocation the invocation object containing:
|
|
3387
3406
|
* - contractAddress - the address of the contract
|
|
@@ -4070,8 +4089,8 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
4070
4089
|
*/
|
|
4071
4090
|
abstract deployAccount(contractPayload: DeployAccountContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeployContractResponse>;
|
|
4072
4091
|
/**
|
|
4073
|
-
*
|
|
4074
|
-
* This adds a message prefix so it
|
|
4092
|
+
* Signs a JSON object for off-chain usage with the Starknet private key and returns the signature
|
|
4093
|
+
* This adds a message prefix so it can't be interchanged with transactions
|
|
4075
4094
|
*
|
|
4076
4095
|
* @param json - JSON object to be signed
|
|
4077
4096
|
* @returns the signature of the JSON object
|
|
@@ -4079,8 +4098,8 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
4079
4098
|
*/
|
|
4080
4099
|
abstract signMessage(typedData: TypedData): Promise<Signature>;
|
|
4081
4100
|
/**
|
|
4082
|
-
* Hash a JSON object with
|
|
4083
|
-
* This adds a message prefix so it
|
|
4101
|
+
* Hash a JSON object with Pedersen hash and return the hash
|
|
4102
|
+
* This adds a message prefix so it can't be interchanged with transactions
|
|
4084
4103
|
*
|
|
4085
4104
|
* @param json - JSON object to be hashed
|
|
4086
4105
|
* @returns the hash of the JSON object
|
|
@@ -4122,7 +4141,7 @@ declare abstract class AccountInterface extends ProviderInterface {
|
|
|
4122
4141
|
*/
|
|
4123
4142
|
abstract getSuggestedMaxFee(estimateFeeAction: EstimateFeeAction, details: EstimateFeeDetails): Promise<bigint>;
|
|
4124
4143
|
/**
|
|
4125
|
-
* Simulates an array of
|
|
4144
|
+
* Simulates an array of transactions and returns an array of transaction trace and estimated fee.
|
|
4126
4145
|
*
|
|
4127
4146
|
* @param invocations Invocations containing:
|
|
4128
4147
|
* - type - transaction type: DECLARE, (multi)DEPLOY, DEPLOY_ACCOUNT, (multi)INVOKE_FUNCTION
|
|
@@ -4197,8 +4216,8 @@ declare module 'abi-wan-kanabi-v2' {
|
|
|
4197
4216
|
InvokeFunctionResponse: InvokeFunctionResponse;
|
|
4198
4217
|
}
|
|
4199
4218
|
}
|
|
4200
|
-
type
|
|
4201
|
-
type TypedContractV2$1<TAbi extends Abi$2> = TypedContract$
|
|
4219
|
+
type TypedContractV1<TAbi extends Abi$1> = TypedContract<TAbi> & ContractInterface;
|
|
4220
|
+
type TypedContractV2$1<TAbi extends Abi$2> = TypedContract$1<TAbi> & ContractInterface;
|
|
4202
4221
|
declare abstract class ContractInterface {
|
|
4203
4222
|
abstract abi: Abi;
|
|
4204
4223
|
abstract address: string;
|
|
@@ -4293,11 +4312,11 @@ declare abstract class ContractInterface {
|
|
|
4293
4312
|
* Retrieves the version of the contract (cairo version & compiler version)
|
|
4294
4313
|
*/
|
|
4295
4314
|
abstract getVersion(): Promise<ContractVersion>;
|
|
4296
|
-
abstract
|
|
4315
|
+
abstract typedv1<TAbi extends Abi$1>(tAbi: TAbi): TypedContractV1<TAbi>;
|
|
4297
4316
|
abstract typedv2<TAbi extends Abi$2>(tAbi: TAbi): TypedContractV2$1<TAbi>;
|
|
4298
4317
|
}
|
|
4299
4318
|
|
|
4300
|
-
type TypedContractV2<TAbi extends Abi$2> = TypedContract$
|
|
4319
|
+
type TypedContractV2<TAbi extends Abi$2> = TypedContract$1<TAbi> & Contract;
|
|
4301
4320
|
declare const splitArgsAndOptions: (args: ArgsOrCalldataWithOptions) => {
|
|
4302
4321
|
args: ArgsOrCalldata;
|
|
4303
4322
|
options: ContractOptions;
|
|
@@ -4347,7 +4366,7 @@ declare class Contract implements ContractInterface {
|
|
|
4347
4366
|
parseEvents(receipt: GetTransactionReceiptResponse): ParsedEvents;
|
|
4348
4367
|
isCairo1(): boolean;
|
|
4349
4368
|
getVersion(): Promise<ContractVersion>;
|
|
4350
|
-
|
|
4369
|
+
typedv1<TAbi extends Abi$1>(tAbi: TAbi): TypedContractV1<TAbi>;
|
|
4351
4370
|
typedv2<TAbi extends Abi$2>(tAbi: TAbi): TypedContractV2<TAbi>;
|
|
4352
4371
|
}
|
|
4353
4372
|
|
|
@@ -4456,11 +4475,15 @@ declare function getVersionsByType(versionType?: 'fee' | 'transaction'): {
|
|
|
4456
4475
|
v1: bigint;
|
|
4457
4476
|
v2: bigint;
|
|
4458
4477
|
};
|
|
4478
|
+
declare function computePedersenHash(a: BigNumberish, b: BigNumberish): string;
|
|
4479
|
+
declare function computePoseidonHash(a: BigNumberish, b: BigNumberish): string;
|
|
4459
4480
|
/**
|
|
4460
4481
|
* Compute pedersen hash from data
|
|
4461
4482
|
* @returns format: hex-string - pedersen hash
|
|
4462
4483
|
*/
|
|
4463
4484
|
declare function computeHashOnElements(data: BigNumberish[]): string;
|
|
4485
|
+
declare const computePedersenHashOnElements: typeof computeHashOnElements;
|
|
4486
|
+
declare function computePoseidonHashOnElements(data: BigNumberish[]): string;
|
|
4464
4487
|
/**
|
|
4465
4488
|
* Calculate transaction pedersen hash for common properties
|
|
4466
4489
|
*
|
|
@@ -4537,6 +4560,10 @@ declare const hash_computeCompiledClassHash: typeof computeCompiledClassHash;
|
|
|
4537
4560
|
declare const hash_computeContractClassHash: typeof computeContractClassHash;
|
|
4538
4561
|
declare const hash_computeHashOnElements: typeof computeHashOnElements;
|
|
4539
4562
|
declare const hash_computeLegacyContractClassHash: typeof computeLegacyContractClassHash;
|
|
4563
|
+
declare const hash_computePedersenHash: typeof computePedersenHash;
|
|
4564
|
+
declare const hash_computePedersenHashOnElements: typeof computePedersenHashOnElements;
|
|
4565
|
+
declare const hash_computePoseidonHash: typeof computePoseidonHash;
|
|
4566
|
+
declare const hash_computePoseidonHashOnElements: typeof computePoseidonHashOnElements;
|
|
4540
4567
|
declare const hash_computeSierraContractClassHash: typeof computeSierraContractClassHash;
|
|
4541
4568
|
declare const hash_feeTransactionVersion: typeof feeTransactionVersion;
|
|
4542
4569
|
declare const hash_feeTransactionVersion_2: typeof feeTransactionVersion_2;
|
|
@@ -4561,6 +4588,10 @@ declare namespace hash {
|
|
|
4561
4588
|
hash_computeContractClassHash as computeContractClassHash,
|
|
4562
4589
|
hash_computeHashOnElements as computeHashOnElements,
|
|
4563
4590
|
hash_computeLegacyContractClassHash as computeLegacyContractClassHash,
|
|
4591
|
+
hash_computePedersenHash as computePedersenHash,
|
|
4592
|
+
hash_computePedersenHashOnElements as computePedersenHashOnElements,
|
|
4593
|
+
hash_computePoseidonHash as computePoseidonHash,
|
|
4594
|
+
hash_computePoseidonHashOnElements as computePoseidonHashOnElements,
|
|
4564
4595
|
hash_computeSierraContractClassHash as computeSierraContractClassHash,
|
|
4565
4596
|
computeHintedClassHash as default,
|
|
4566
4597
|
hash_feeTransactionVersion as feeTransactionVersion,
|
|
@@ -4861,7 +4892,8 @@ declare class MerkleTree {
|
|
|
4861
4892
|
leaves: string[];
|
|
4862
4893
|
branches: string[][];
|
|
4863
4894
|
root: string;
|
|
4864
|
-
|
|
4895
|
+
hashMethod: (a: BigNumberish, b: BigNumberish) => string;
|
|
4896
|
+
constructor(leafHashes: string[], hashMethod?: (a: BigNumberish, b: BigNumberish) => string);
|
|
4865
4897
|
/**
|
|
4866
4898
|
* Create Merkle tree
|
|
4867
4899
|
* @param leaves hex-string array
|
|
@@ -4869,10 +4901,10 @@ declare class MerkleTree {
|
|
|
4869
4901
|
*/
|
|
4870
4902
|
private build;
|
|
4871
4903
|
/**
|
|
4872
|
-
* Create
|
|
4904
|
+
* Create hash from ordered a and b, Pedersen hash default
|
|
4873
4905
|
* @returns format: hex-string
|
|
4874
4906
|
*/
|
|
4875
|
-
static hash(a:
|
|
4907
|
+
static hash(a: BigNumberish, b: BigNumberish, hashMethod?: (a: BigNumberish, b: BigNumberish) => string): string;
|
|
4876
4908
|
/**
|
|
4877
4909
|
* Return path to leaf
|
|
4878
4910
|
* @param leaf hex-string
|
|
@@ -4887,8 +4919,9 @@ declare class MerkleTree {
|
|
|
4887
4919
|
* @param root hex-string
|
|
4888
4920
|
* @param leaf hex-string
|
|
4889
4921
|
* @param path hex-string array
|
|
4922
|
+
* @param hashMethod hash method override, Pedersen default
|
|
4890
4923
|
*/
|
|
4891
|
-
declare function proofMerklePath(root: string, leaf: string, path: string[]): boolean;
|
|
4924
|
+
declare function proofMerklePath(root: string, leaf: string, path: string[], hashMethod?: (a: BigNumberish, b: BigNumberish) => string): boolean;
|
|
4892
4925
|
|
|
4893
4926
|
type merkle_MerkleTree = MerkleTree;
|
|
4894
4927
|
declare const merkle_MerkleTree: typeof MerkleTree;
|
|
@@ -5006,54 +5039,58 @@ declare namespace shortString {
|
|
|
5006
5039
|
};
|
|
5007
5040
|
}
|
|
5008
5041
|
|
|
5009
|
-
declare function prepareSelector(selector: string): string;
|
|
5010
|
-
declare function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType;
|
|
5011
5042
|
interface Context {
|
|
5012
5043
|
parent?: string;
|
|
5013
5044
|
key?: string;
|
|
5014
5045
|
}
|
|
5046
|
+
declare function byteArrayFromString(targetString: string): {
|
|
5047
|
+
data: BigNumberish[];
|
|
5048
|
+
pending_word: BigNumberish;
|
|
5049
|
+
pending_word_len: number;
|
|
5050
|
+
};
|
|
5051
|
+
declare function prepareSelector(selector: string): string;
|
|
5052
|
+
declare function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType;
|
|
5015
5053
|
/**
|
|
5016
5054
|
* Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once
|
|
5017
5055
|
* in the resulting array.
|
|
5018
|
-
*
|
|
5019
|
-
* @param {TypedData} typedData
|
|
5020
|
-
* @param {string} type
|
|
5021
|
-
* @param {string[]} [dependencies]
|
|
5022
|
-
* @return {string[]}
|
|
5023
5056
|
*/
|
|
5024
|
-
declare
|
|
5057
|
+
declare function getDependencies(types: TypedData['types'], type: string, dependencies?: string[], contains?: string, revision?: TypedDataRevision): string[];
|
|
5025
5058
|
/**
|
|
5026
5059
|
* Encode a type to a string. All dependent types are alphabetically sorted.
|
|
5027
5060
|
*/
|
|
5028
|
-
declare
|
|
5061
|
+
declare function encodeType(types: TypedData['types'], type: string, revision?: TypedDataRevision): string;
|
|
5029
5062
|
/**
|
|
5030
5063
|
* Get a type string as hash.
|
|
5031
5064
|
*/
|
|
5032
|
-
declare
|
|
5065
|
+
declare function getTypeHash(types: TypedData['types'], type: string, revision?: TypedDataRevision): string;
|
|
5033
5066
|
/**
|
|
5034
5067
|
* Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of
|
|
5035
5068
|
* an array of ABI compatible types, and an array of corresponding values.
|
|
5036
5069
|
*/
|
|
5037
|
-
declare
|
|
5070
|
+
declare function encodeValue(types: TypedData['types'], type: string, data: unknown, ctx?: Context, revision?: TypedDataRevision): [string, string];
|
|
5038
5071
|
/**
|
|
5039
5072
|
* Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values.
|
|
5040
5073
|
* All dependent types are automatically encoded.
|
|
5041
5074
|
*/
|
|
5042
|
-
declare
|
|
5075
|
+
declare function encodeData<T extends TypedData>(types: T['types'], type: string, data: T['message'], revision?: TypedDataRevision): string[][];
|
|
5043
5076
|
/**
|
|
5044
5077
|
* Get encoded data as a hash. The data should be a key -> value object with all the required values.
|
|
5045
5078
|
* All dependent types are automatically encoded.
|
|
5046
5079
|
*/
|
|
5047
|
-
declare
|
|
5080
|
+
declare function getStructHash<T extends TypedData>(types: T['types'], type: string, data: T['message'], revision?: TypedDataRevision): string;
|
|
5048
5081
|
/**
|
|
5049
|
-
* Get the
|
|
5082
|
+
* Get the SNIP-12 encoded message to sign, from the typedData object.
|
|
5050
5083
|
*/
|
|
5051
|
-
declare
|
|
5084
|
+
declare function getMessageHash(typedData: TypedData, account: BigNumberish): string;
|
|
5052
5085
|
|
|
5053
5086
|
type typedData_StarkNetDomain = StarkNetDomain;
|
|
5087
|
+
type typedData_StarkNetEnumType = StarkNetEnumType;
|
|
5054
5088
|
type typedData_StarkNetMerkleType = StarkNetMerkleType;
|
|
5055
5089
|
type typedData_StarkNetType = StarkNetType;
|
|
5056
5090
|
type typedData_TypedData = TypedData;
|
|
5091
|
+
type typedData_TypedDataRevision = TypedDataRevision;
|
|
5092
|
+
declare const typedData_TypedDataRevision: typeof TypedDataRevision;
|
|
5093
|
+
declare const typedData_byteArrayFromString: typeof byteArrayFromString;
|
|
5057
5094
|
declare const typedData_encodeData: typeof encodeData;
|
|
5058
5095
|
declare const typedData_encodeType: typeof encodeType;
|
|
5059
5096
|
declare const typedData_encodeValue: typeof encodeValue;
|
|
@@ -5066,9 +5103,12 @@ declare const typedData_prepareSelector: typeof prepareSelector;
|
|
|
5066
5103
|
declare namespace typedData {
|
|
5067
5104
|
export {
|
|
5068
5105
|
typedData_StarkNetDomain as StarkNetDomain,
|
|
5106
|
+
typedData_StarkNetEnumType as StarkNetEnumType,
|
|
5069
5107
|
typedData_StarkNetMerkleType as StarkNetMerkleType,
|
|
5070
5108
|
typedData_StarkNetType as StarkNetType,
|
|
5071
5109
|
typedData_TypedData as TypedData,
|
|
5110
|
+
typedData_TypedDataRevision as TypedDataRevision,
|
|
5111
|
+
typedData_byteArrayFromString as byteArrayFromString,
|
|
5072
5112
|
typedData_encodeData as encodeData,
|
|
5073
5113
|
typedData_encodeType as encodeType,
|
|
5074
5114
|
typedData_encodeValue as encodeValue,
|
|
@@ -5191,7 +5231,7 @@ declare const isTypeEnum: (type: string, enums: AbiEnums) => boolean;
|
|
|
5191
5231
|
declare const isTypeOption: (type: string) => boolean;
|
|
5192
5232
|
declare const isTypeResult: (type: string) => boolean;
|
|
5193
5233
|
declare const isTypeUint: (type: string) => boolean;
|
|
5194
|
-
declare const
|
|
5234
|
+
declare const isTypeLiteral: (type: string) => boolean;
|
|
5195
5235
|
declare const isTypeUint256: (type: string) => boolean;
|
|
5196
5236
|
declare const isTypeBool: (type: string) => boolean;
|
|
5197
5237
|
declare const isTypeContractAddress: (type: string) => boolean;
|
|
@@ -5254,7 +5294,7 @@ declare const cairo_isTypeContractAddress: typeof isTypeContractAddress;
|
|
|
5254
5294
|
declare const cairo_isTypeEnum: typeof isTypeEnum;
|
|
5255
5295
|
declare const cairo_isTypeEthAddress: typeof isTypeEthAddress;
|
|
5256
5296
|
declare const cairo_isTypeFelt: typeof isTypeFelt;
|
|
5257
|
-
declare const
|
|
5297
|
+
declare const cairo_isTypeLiteral: typeof isTypeLiteral;
|
|
5258
5298
|
declare const cairo_isTypeNamedTuple: typeof isTypeNamedTuple;
|
|
5259
5299
|
declare const cairo_isTypeOption: typeof isTypeOption;
|
|
5260
5300
|
declare const cairo_isTypeResult: typeof isTypeResult;
|
|
@@ -5278,7 +5318,7 @@ declare namespace cairo {
|
|
|
5278
5318
|
cairo_isTypeEnum as isTypeEnum,
|
|
5279
5319
|
cairo_isTypeEthAddress as isTypeEthAddress,
|
|
5280
5320
|
cairo_isTypeFelt as isTypeFelt,
|
|
5281
|
-
|
|
5321
|
+
cairo_isTypeLiteral as isTypeLiteral,
|
|
5282
5322
|
cairo_isTypeNamedTuple as isTypeNamedTuple,
|
|
5283
5323
|
cairo_isTypeOption as isTypeOption,
|
|
5284
5324
|
cairo_isTypeResult as isTypeResult,
|
|
@@ -5398,4 +5438,4 @@ declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): {
|
|
|
5398
5438
|
/** @deprecated prefer the 'num' naming */
|
|
5399
5439
|
declare const number: typeof num;
|
|
5400
5440
|
|
|
5401
|
-
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, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, 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,
|
|
5441
|
+
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, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass$1 as ContractClass, ContractClassResponse, ContractEntryPoint, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, 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, Literal, 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, StarkNetEnumType, StarkNetMerkleType, StarkNetType, StateUpdateResponse, Storage, StructAbi, SuccessfulTransactionReceiptResponse, TransactionExecutionStatus, TransactionFinalityStatus, TransactionStatus$1 as TransactionStatus, TransactionType, Tupled, TypedContractV1, TypedContractV2, TypedData, TypedDataRevision, Uint, Uint256, UniversalDeployerContractPayload, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getDefaultNodeUrl, getEstimateFeeBulkOptions, getSimulateTransactionOptions, hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$1 as types, uint256$1 as uint256, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
|