starknet 6.0.0-beta.13 → 6.0.0-beta.15

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 CHANGED
@@ -1,3 +1,56 @@
1
+ # [6.0.0-beta.15](https://github.com/starknet-io/starknet.js/compare/v6.0.0-beta.14...v6.0.0-beta.15) (2024-02-05)
2
+
3
+ ### Bug Fixes
4
+
5
+ - throw on negative param cairo.uint256 and bnToUint256 ([e1ead14](https://github.com/starknet-io/starknet.js/commit/e1ead1466984f26ff91d7fe6174fc87be8c3aede))
6
+
7
+ ### Features
8
+
9
+ - new CairoUint256 cairo datatype model ([b64abcc](https://github.com/starknet-io/starknet.js/commit/b64abccf3888eba49460124a4d7aabbdca1592d1))
10
+
11
+ # [6.0.0-beta.14](https://github.com/starknet-io/starknet.js/compare/v6.0.0-beta.13...v6.0.0-beta.14) (2024-02-02)
12
+
13
+ ### Bug Fixes
14
+
15
+ - move abiwan from dev dependencies to regular dependencies ([#925](https://github.com/starknet-io/starknet.js/issues/925)) ([6b7ee49](https://github.com/starknet-io/starknet.js/commit/6b7ee49918d704f8143f51ab7a0360446ea4cf5e))
16
+
17
+ ### Features
18
+
19
+ - abi-wan trigger ([c10150a](https://github.com/starknet-io/starknet.js/commit/c10150a328051054a7bba1260296c0c92fdd2051))
20
+ - add provider.decodeParameters ([39595f3](https://github.com/starknet-io/starknet.js/commit/39595f3303204b273fadd53764c59767ce6c5b36))
21
+ - 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))
22
+ - trigger release ([fbf983f](https://github.com/starknet-io/starknet.js/commit/fbf983f7820768f919cddb2c5806178a20e38bdd))
23
+
24
+ # [5.29.0](https://github.com/starknet-io/starknet.js/compare/v5.28.0...v5.29.0) (2024-02-02)
25
+
26
+ ### Features
27
+
28
+ - add provider.decodeParameters ([39595f3](https://github.com/starknet-io/starknet.js/commit/39595f3303204b273fadd53764c59767ce6c5b36))
29
+
30
+ # [5.28.0](https://github.com/starknet-io/starknet.js/compare/v5.27.0...v5.28.0) (2024-02-01)
31
+
32
+ ### Features
33
+
34
+ - 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))
35
+
36
+ # [5.27.0](https://github.com/starknet-io/starknet.js/compare/v5.26.1...v5.27.0) (2024-01-23)
37
+
38
+ ### Features
39
+
40
+ - trigger release ([fbf983f](https://github.com/starknet-io/starknet.js/commit/fbf983f7820768f919cddb2c5806178a20e38bdd))
41
+
42
+ ## [5.26.1](https://github.com/starknet-io/starknet.js/compare/v5.26.0...v5.26.1) (2024-01-18)
43
+
44
+ ### Bug Fixes
45
+
46
+ - move abiwan from dev dependencies to regular dependencies ([#925](https://github.com/starknet-io/starknet.js/issues/925)) ([6b7ee49](https://github.com/starknet-io/starknet.js/commit/6b7ee49918d704f8143f51ab7a0360446ea4cf5e))
47
+
48
+ # [5.26.0](https://github.com/starknet-io/starknet.js/compare/v5.25.0...v5.26.0) (2024-01-15)
49
+
50
+ ### Features
51
+
52
+ - abi-wan trigger ([c10150a](https://github.com/starknet-io/starknet.js/commit/c10150a328051054a7bba1260296c0c92fdd2051))
53
+
1
54
  # [6.0.0-beta.13](https://github.com/starknet-io/starknet.js/compare/v6.0.0-beta.12...v6.0.0-beta.13) (2024-01-23)
2
55
 
3
56
  ### 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 Straknet.js!
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,7 +1,7 @@
1
1
  import * as weierstrass from '@noble/curves/abstract/weierstrass';
2
2
  import * as ts_mixer_dist_types_types from 'ts-mixer/dist/types/types';
3
- import { Abi as Abi$1, TypedContract as TypedContract$1 } from 'abi-wan-kanabi';
4
- import { Abi as Abi$2, TypedContract as TypedContract$2 } from 'abi-wan-kanabi-v2';
3
+ import { Abi as Abi$1, TypedContract } from 'abi-wan-kanabi-v1';
4
+ import { Abi as Abi$2, TypedContract as TypedContract$1 } from 'abi-wan-kanabi-v2';
5
5
  import * as poseidon from '@noble/curves/abstract/poseidon';
6
6
  import * as json$1 from 'lossless-json';
7
7
  import * as starknet from '@scure/starknet';
@@ -1690,15 +1690,15 @@ declare enum NetworkName {
1690
1690
  SN_SEPOLIA = "SN_SEPOLIA"
1691
1691
  }
1692
1692
  declare enum StarknetChainId {
1693
- SN_MAIN = "0x534e5f4d41494e",
1694
- SN_GOERLI = "0x534e5f474f45524c49",
1693
+ SN_MAIN = "0x534e5f4d41494e",// encodeShortString('SN_MAIN'),
1694
+ SN_GOERLI = "0x534e5f474f45524c49",// encodeShortString('SN_GOERLI')
1695
1695
  SN_SEPOLIA = "0x534e5f5345504f4c4941"
1696
1696
  }
1697
1697
  declare enum TransactionHashPrefix {
1698
- DECLARE = "0x6465636c617265",
1699
- DEPLOY = "0x6465706c6f79",
1700
- DEPLOY_ACCOUNT = "0x6465706c6f795f6163636f756e74",
1701
- INVOKE = "0x696e766f6b65",
1698
+ DECLARE = "0x6465636c617265",// encodeShortString('declare'),
1699
+ DEPLOY = "0x6465706c6f79",// encodeShortString('deploy'),
1700
+ DEPLOY_ACCOUNT = "0x6465706c6f795f6163636f756e74",// encodeShortString('deploy_account'),
1701
+ INVOKE = "0x696e766f6b65",// encodeShortString('invoke'),
1702
1702
  L1_HANDLER = "0x6c315f68616e646c6572"
1703
1703
  }
1704
1704
  declare const UDC: {
@@ -1943,7 +1943,7 @@ type LegacyContractClass = {
1943
1943
  abi: Abi;
1944
1944
  };
1945
1945
  /**
1946
- * format produced after compile .cairo to .json
1946
+ * format produced after compiling .cairo to .json
1947
1947
  */
1948
1948
  type LegacyCompiledContract = Omit<LegacyContractClass, 'program'> & {
1949
1949
  program: Program;
@@ -2427,7 +2427,7 @@ declare enum Uint {
2427
2427
  u128 = "core::integer::u128",
2428
2428
  u256 = "core::integer::u256"
2429
2429
  }
2430
- declare enum Litteral {
2430
+ declare enum Literal {
2431
2431
  ClassHash = "core::starknet::class_hash::ClassHash",
2432
2432
  ContractAddress = "core::starknet::contract_address::ContractAddress"
2433
2433
  }
@@ -2504,6 +2504,15 @@ type V3DeployAccountSignerDetails = Required<DeployAccountContractPayload> & V3T
2504
2504
  version: `${ETransactionVersion3}`;
2505
2505
  };
2506
2506
 
2507
+ declare enum TypedDataRevision {
2508
+ Active = "1",
2509
+ Legacy = "0"
2510
+ }
2511
+ type StarkNetEnumType = {
2512
+ name: string;
2513
+ type: 'enum';
2514
+ contains: string;
2515
+ };
2507
2516
  type StarkNetMerkleType = {
2508
2517
  name: string;
2509
2518
  type: 'merkletree';
@@ -2518,7 +2527,7 @@ type StarkNetMerkleType = {
2518
2527
  type StarkNetType = {
2519
2528
  name: string;
2520
2529
  type: string;
2521
- } | StarkNetMerkleType;
2530
+ } | StarkNetEnumType | StarkNetMerkleType;
2522
2531
  /**
2523
2532
  * The EIP712 domain struct. Any of these fields are optional, but it must contain at least one field.
2524
2533
  */
@@ -2526,6 +2535,7 @@ interface StarkNetDomain extends Record<string, unknown> {
2526
2535
  name?: string;
2527
2536
  version?: string;
2528
2537
  chainId?: string | number;
2538
+ revision?: string;
2529
2539
  }
2530
2540
  /**
2531
2541
  * The complete typed data, with all the structs, domain data, primary type of the message, and the message itself.
@@ -2628,8 +2638,8 @@ type index$2_L1HandlerTransactionReceiptResponse = L1HandlerTransactionReceiptRe
2628
2638
  type index$2_LegacyCompiledContract = LegacyCompiledContract;
2629
2639
  type index$2_LegacyContractClass = LegacyContractClass;
2630
2640
  type index$2_LegacyEvent = LegacyEvent;
2631
- type index$2_Litteral = Litteral;
2632
- declare const index$2_Litteral: typeof Litteral;
2641
+ type index$2_Literal = Literal;
2642
+ declare const index$2_Literal: typeof Literal;
2633
2643
  type index$2_MultiDeployContractResponse = MultiDeployContractResponse;
2634
2644
  type index$2_MultiType = MultiType;
2635
2645
  type index$2_Nonce = Nonce;
@@ -2660,6 +2670,7 @@ type index$2_SimulateTransactionResponse = SimulateTransactionResponse;
2660
2670
  type index$2_SimulatedTransaction = SimulatedTransaction;
2661
2671
  type index$2_SimulationFlags = SimulationFlags;
2662
2672
  type index$2_StarkNetDomain = StarkNetDomain;
2673
+ type index$2_StarkNetEnumType = StarkNetEnumType;
2663
2674
  type index$2_StarkNetMerkleType = StarkNetMerkleType;
2664
2675
  type index$2_StarkNetType = StarkNetType;
2665
2676
  type index$2_StateUpdate = StateUpdate;
@@ -2676,6 +2687,8 @@ type index$2_TransactionType = TransactionType;
2676
2687
  declare const index$2_TransactionType: typeof TransactionType;
2677
2688
  type index$2_Tupled = Tupled;
2678
2689
  type index$2_TypedData = TypedData;
2690
+ type index$2_TypedDataRevision = TypedDataRevision;
2691
+ declare const index$2_TypedDataRevision: typeof TypedDataRevision;
2679
2692
  type index$2_Uint = Uint;
2680
2693
  declare const index$2_Uint: typeof Uint;
2681
2694
  type index$2_Uint256 = Uint256;
@@ -2786,7 +2799,7 @@ declare namespace index$2 {
2786
2799
  index$2_LegacyCompiledContract as LegacyCompiledContract,
2787
2800
  index$2_LegacyContractClass as LegacyContractClass,
2788
2801
  index$2_LegacyEvent as LegacyEvent,
2789
- index$2_Litteral as Litteral,
2802
+ index$2_Literal as Literal,
2790
2803
  index$2_MultiDeployContractResponse as MultiDeployContractResponse,
2791
2804
  index$2_MultiType as MultiType,
2792
2805
  index$2_Nonce as Nonce,
@@ -2817,6 +2830,7 @@ declare namespace index$2 {
2817
2830
  index$2_SimulatedTransaction as SimulatedTransaction,
2818
2831
  index$2_SimulationFlags as SimulationFlags,
2819
2832
  index$2_StarkNetDomain as StarkNetDomain,
2833
+ index$2_StarkNetEnumType as StarkNetEnumType,
2820
2834
  index$2_StarkNetMerkleType as StarkNetMerkleType,
2821
2835
  index$2_StarkNetType as StarkNetType,
2822
2836
  index$2_StateUpdate as StateUpdate,
@@ -2829,6 +2843,7 @@ declare namespace index$2 {
2829
2843
  index$2_TransactionType as TransactionType,
2830
2844
  index$2_Tupled as Tupled,
2831
2845
  index$2_TypedData as TypedData,
2846
+ index$2_TypedDataRevision as TypedDataRevision,
2832
2847
  index$2_Uint as Uint,
2833
2848
  index$2_Uint256 as Uint256,
2834
2849
  index$2_UniversalDeployerContractPayload as UniversalDeployerContractPayload,
@@ -3015,7 +3030,7 @@ declare abstract class ProviderInterface {
3015
3030
  abstract deployAccountContract(payload: DeployAccountContractPayload, details: InvocationsDetailsWithNonce): Promise<DeployContractResponse>;
3016
3031
  /**
3017
3032
  * Invokes a function on starknet
3018
- * @deprecated This method wont be supported as soon as fees are mandatory. Should not be used outside of Account class
3033
+ * @deprecated This method won't be supported as soon as fees are mandatory. Should not be used outside of Account class
3019
3034
  *
3020
3035
  * @param invocation the invocation object containing:
3021
3036
  * - contractAddress - the address of the contract
@@ -3359,6 +3374,7 @@ declare class Signer implements SignerInterface {
3359
3374
  signTransaction(transactions: Call[], details: InvocationsSignerDetails): Promise<Signature>;
3360
3375
  signDeployAccountTransaction(details: DeployAccountSignerDetails): Promise<Signature>;
3361
3376
  signDeclareTransaction(details: DeclareSignerDetails): Promise<Signature>;
3377
+ protected signRaw(msgHash: string): Promise<Signature>;
3362
3378
  }
3363
3379
 
3364
3380
  /**
@@ -3616,8 +3632,8 @@ declare abstract class AccountInterface extends ProviderInterface {
3616
3632
  */
3617
3633
  abstract deployAccount(contractPayload: DeployAccountContractPayload, transactionsDetail?: InvocationsDetails): Promise<DeployContractResponse>;
3618
3634
  /**
3619
- * Sign an JSON object for off-chain usage with the starknet private key and return the signature
3620
- * This adds a message prefix so it cant be interchanged with transactions
3635
+ * Signs a JSON object for off-chain usage with the Starknet private key and returns the signature
3636
+ * This adds a message prefix so it can't be interchanged with transactions
3621
3637
  *
3622
3638
  * @param json - JSON object to be signed
3623
3639
  * @returns the signature of the JSON object
@@ -3625,8 +3641,8 @@ declare abstract class AccountInterface extends ProviderInterface {
3625
3641
  */
3626
3642
  abstract signMessage(typedData: TypedData): Promise<Signature>;
3627
3643
  /**
3628
- * Hash a JSON object with pederson hash and return the hash
3629
- * This adds a message prefix so it cant be interchanged with transactions
3644
+ * Hash a JSON object with Pedersen hash and return the hash
3645
+ * This adds a message prefix so it can't be interchanged with transactions
3630
3646
  *
3631
3647
  * @param json - JSON object to be hashed
3632
3648
  * @returns the hash of the JSON object
@@ -3725,8 +3741,8 @@ declare module 'abi-wan-kanabi-v2' {
3725
3741
  InvokeFunctionResponse: InvokeFunctionResponse;
3726
3742
  }
3727
3743
  }
3728
- type TypedContract<TAbi extends Abi$1> = TypedContract$1<TAbi> & ContractInterface;
3729
- type TypedContractV2$1<TAbi extends Abi$2> = TypedContract$2<TAbi> & ContractInterface;
3744
+ type TypedContractV1<TAbi extends Abi$1> = TypedContract<TAbi> & ContractInterface;
3745
+ type TypedContractV2$1<TAbi extends Abi$2> = TypedContract$1<TAbi> & ContractInterface;
3730
3746
  declare abstract class ContractInterface {
3731
3747
  abstract abi: Abi;
3732
3748
  abstract address: string;
@@ -3821,11 +3837,11 @@ declare abstract class ContractInterface {
3821
3837
  * Retrieves the version of the contract (cairo version & compiler version)
3822
3838
  */
3823
3839
  abstract getVersion(): Promise<ContractVersion>;
3824
- abstract typed<TAbi extends Abi$1>(tAbi: TAbi): TypedContract<TAbi>;
3840
+ abstract typedv1<TAbi extends Abi$1>(tAbi: TAbi): TypedContractV1<TAbi>;
3825
3841
  abstract typedv2<TAbi extends Abi$2>(tAbi: TAbi): TypedContractV2$1<TAbi>;
3826
3842
  }
3827
3843
 
3828
- type TypedContractV2<TAbi extends Abi$2> = TypedContract$2<TAbi> & Contract;
3844
+ type TypedContractV2<TAbi extends Abi$2> = TypedContract$1<TAbi> & Contract;
3829
3845
  declare const splitArgsAndOptions: (args: ArgsOrCalldataWithOptions) => {
3830
3846
  args: ArgsOrCalldata;
3831
3847
  options: ContractOptions;
@@ -3875,7 +3891,7 @@ declare class Contract implements ContractInterface {
3875
3891
  parseEvents(receipt: GetTransactionReceiptResponse): ParsedEvents;
3876
3892
  isCairo1(): boolean;
3877
3893
  getVersion(): Promise<ContractVersion>;
3878
- typed<TAbi extends Abi$1>(tAbi: TAbi): TypedContract<TAbi>;
3894
+ typedv1<TAbi extends Abi$1>(tAbi: TAbi): TypedContractV1<TAbi>;
3879
3895
  typedv2<TAbi extends Abi$2>(tAbi: TAbi): TypedContractV2<TAbi>;
3880
3896
  }
3881
3897
 
@@ -4056,11 +4072,15 @@ declare function calculateDeployAccountTransactionHash$2(args: CalcDeployAccount
4056
4072
  * Class Hash
4057
4073
  */
4058
4074
 
4075
+ declare function computePedersenHash(a: BigNumberish, b: BigNumberish): string;
4076
+ declare function computePoseidonHash(a: BigNumberish, b: BigNumberish): string;
4059
4077
  /**
4060
4078
  * Compute pedersen hash from data
4061
4079
  * @returns format: hex-string - pedersen hash
4062
4080
  */
4063
4081
  declare function computeHashOnElements$1(data: BigNumberish[]): string;
4082
+ declare const computePedersenHashOnElements: typeof computeHashOnElements$1;
4083
+ declare function computePoseidonHashOnElements(data: BigNumberish[]): string;
4064
4084
  /**
4065
4085
  * Calculate contract address from class hash
4066
4086
  * @returns format: hex-string
@@ -4101,6 +4121,10 @@ declare const index$1_calculateContractAddressFromHash: typeof calculateContract
4101
4121
  declare const index$1_computeCompiledClassHash: typeof computeCompiledClassHash;
4102
4122
  declare const index$1_computeContractClassHash: typeof computeContractClassHash;
4103
4123
  declare const index$1_computeLegacyContractClassHash: typeof computeLegacyContractClassHash;
4124
+ declare const index$1_computePedersenHash: typeof computePedersenHash;
4125
+ declare const index$1_computePedersenHashOnElements: typeof computePedersenHashOnElements;
4126
+ declare const index$1_computePoseidonHash: typeof computePoseidonHash;
4127
+ declare const index$1_computePoseidonHashOnElements: typeof computePoseidonHashOnElements;
4104
4128
  declare const index$1_computeSierraContractClassHash: typeof computeSierraContractClassHash;
4105
4129
  declare const index$1_formatSpaces: typeof formatSpaces;
4106
4130
  declare const index$1_getSelector: typeof getSelector;
@@ -4118,6 +4142,10 @@ declare namespace index$1 {
4118
4142
  index$1_computeContractClassHash as computeContractClassHash,
4119
4143
  computeHashOnElements$1 as computeHashOnElements,
4120
4144
  index$1_computeLegacyContractClassHash as computeLegacyContractClassHash,
4145
+ index$1_computePedersenHash as computePedersenHash,
4146
+ index$1_computePedersenHashOnElements as computePedersenHashOnElements,
4147
+ index$1_computePoseidonHash as computePoseidonHash,
4148
+ index$1_computePoseidonHashOnElements as computePoseidonHashOnElements,
4121
4149
  index$1_computeSierraContractClassHash as computeSierraContractClassHash,
4122
4150
  index$1_formatSpaces as formatSpaces,
4123
4151
  index$1_getSelector as getSelector,
@@ -4579,7 +4607,8 @@ declare class MerkleTree {
4579
4607
  leaves: string[];
4580
4608
  branches: string[][];
4581
4609
  root: string;
4582
- constructor(leafHashes: string[]);
4610
+ hashMethod: (a: BigNumberish, b: BigNumberish) => string;
4611
+ constructor(leafHashes: string[], hashMethod?: (a: BigNumberish, b: BigNumberish) => string);
4583
4612
  /**
4584
4613
  * Create Merkle tree
4585
4614
  * @param leaves hex-string array
@@ -4587,10 +4616,10 @@ declare class MerkleTree {
4587
4616
  */
4588
4617
  private build;
4589
4618
  /**
4590
- * Create pedersen hash from a and b
4619
+ * Create hash from ordered a and b, Pedersen hash default
4591
4620
  * @returns format: hex-string
4592
4621
  */
4593
- static hash(a: string, b: string): string;
4622
+ static hash(a: BigNumberish, b: BigNumberish, hashMethod?: (a: BigNumberish, b: BigNumberish) => string): string;
4594
4623
  /**
4595
4624
  * Return path to leaf
4596
4625
  * @param leaf hex-string
@@ -4605,8 +4634,9 @@ declare class MerkleTree {
4605
4634
  * @param root hex-string
4606
4635
  * @param leaf hex-string
4607
4636
  * @param path hex-string array
4637
+ * @param hashMethod hash method override, Pedersen default
4608
4638
  */
4609
- declare function proofMerklePath(root: string, leaf: string, path: string[]): boolean;
4639
+ declare function proofMerklePath(root: string, leaf: string, path: string[], hashMethod?: (a: BigNumberish, b: BigNumberish) => string): boolean;
4610
4640
 
4611
4641
  type merkle_MerkleTree = MerkleTree;
4612
4642
  declare const merkle_MerkleTree: typeof MerkleTree;
@@ -4618,24 +4648,31 @@ declare namespace merkle {
4618
4648
  };
4619
4649
  }
4620
4650
 
4651
+ /**
4652
+ * Singular class handling cairo u256 data type
4653
+ */
4654
+
4621
4655
  declare const UINT_128_MAX: bigint;
4622
4656
  declare const UINT_256_MAX: bigint;
4657
+
4623
4658
  /**
4624
4659
  * Convert Uint256 to bigint
4660
+ * Legacy support Export
4625
4661
  */
4626
4662
  declare function uint256ToBN(uint256: Uint256): bigint;
4627
4663
  /**
4628
4664
  * Test BigNumberish is smaller or equal 2**256-1
4665
+ * Legacy support Export
4629
4666
  */
4630
4667
  declare function isUint256(bn: BigNumberish): boolean;
4631
4668
  /**
4632
4669
  * Convert BigNumberish (string | number | bigint) to Uint256 (hex)
4670
+ * Legacy support Export
4633
4671
  */
4634
4672
  declare function bnToUint256(bn: BigNumberish): Uint256;
4635
4673
 
4636
4674
  declare const uint256$1_UINT_128_MAX: typeof UINT_128_MAX;
4637
4675
  declare const uint256$1_UINT_256_MAX: typeof UINT_256_MAX;
4638
- type uint256$1_Uint256 = Uint256;
4639
4676
  declare const uint256$1_bnToUint256: typeof bnToUint256;
4640
4677
  declare const uint256$1_isUint256: typeof isUint256;
4641
4678
  declare const uint256$1_uint256ToBN: typeof uint256ToBN;
@@ -4643,7 +4680,6 @@ declare namespace uint256$1 {
4643
4680
  export {
4644
4681
  uint256$1_UINT_128_MAX as UINT_128_MAX,
4645
4682
  uint256$1_UINT_256_MAX as UINT_256_MAX,
4646
- uint256$1_Uint256 as Uint256,
4647
4683
  uint256$1_bnToUint256 as bnToUint256,
4648
4684
  uint256$1_isUint256 as isUint256,
4649
4685
  uint256$1_uint256ToBN as uint256ToBN,
@@ -4724,54 +4760,57 @@ declare namespace shortString {
4724
4760
  };
4725
4761
  }
4726
4762
 
4727
- declare function prepareSelector(selector: string): string;
4728
- declare function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType;
4729
4763
  interface Context {
4730
4764
  parent?: string;
4731
4765
  key?: string;
4732
4766
  }
4767
+ declare function byteArrayFromString$1(targetString: string): {
4768
+ data: BigNumberish[];
4769
+ pending_word: BigNumberish;
4770
+ pending_word_len: number;
4771
+ };
4772
+ declare function prepareSelector(selector: string): string;
4773
+ declare function isMerkleTreeType(type: StarkNetType): type is StarkNetMerkleType;
4733
4774
  /**
4734
4775
  * Get the dependencies of a struct type. If a struct has the same dependency multiple times, it's only included once
4735
4776
  * in the resulting array.
4736
- *
4737
- * @param {TypedData} typedData
4738
- * @param {string} type
4739
- * @param {string[]} [dependencies]
4740
- * @return {string[]}
4741
4777
  */
4742
- declare const getDependencies: (types: TypedData['types'], type: string, dependencies?: string[]) => string[];
4778
+ declare function getDependencies(types: TypedData['types'], type: string, dependencies?: string[], contains?: string, revision?: TypedDataRevision): string[];
4743
4779
  /**
4744
4780
  * Encode a type to a string. All dependent types are alphabetically sorted.
4745
4781
  */
4746
- declare const encodeType: (types: TypedData['types'], type: string) => string;
4782
+ declare function encodeType(types: TypedData['types'], type: string, revision?: TypedDataRevision): string;
4747
4783
  /**
4748
4784
  * Get a type string as hash.
4749
4785
  */
4750
- declare const getTypeHash: (types: TypedData['types'], type: string) => string;
4786
+ declare function getTypeHash(types: TypedData['types'], type: string, revision?: TypedDataRevision): string;
4751
4787
  /**
4752
4788
  * Encodes a single value to an ABI serialisable string, number or Buffer. Returns the data as tuple, which consists of
4753
4789
  * an array of ABI compatible types, and an array of corresponding values.
4754
4790
  */
4755
- declare const encodeValue: (types: TypedData['types'], type: string, data: unknown, ctx?: Context) => [string, string];
4791
+ declare function encodeValue(types: TypedData['types'], type: string, data: unknown, ctx?: Context, revision?: TypedDataRevision): [string, string];
4756
4792
  /**
4757
4793
  * Encode the data to an ABI encoded Buffer. The data should be a key -> value object with all the required values.
4758
4794
  * All dependent types are automatically encoded.
4759
4795
  */
4760
- declare const encodeData: <T extends TypedData>(types: T["types"], type: string, data: T["message"]) => string[][];
4796
+ declare function encodeData<T extends TypedData>(types: T['types'], type: string, data: T['message'], revision?: TypedDataRevision): string[][];
4761
4797
  /**
4762
4798
  * Get encoded data as a hash. The data should be a key -> value object with all the required values.
4763
4799
  * All dependent types are automatically encoded.
4764
4800
  */
4765
- declare const getStructHash: <T extends TypedData>(types: T["types"], type: string, data: T["message"]) => string;
4801
+ declare function getStructHash<T extends TypedData>(types: T['types'], type: string, data: T['message'], revision?: TypedDataRevision): string;
4766
4802
  /**
4767
- * Get the EIP-191 encoded message to sign, from the typedData object.
4803
+ * Get the SNIP-12 encoded message to sign, from the typedData object.
4768
4804
  */
4769
- declare const getMessageHash: (typedData: TypedData, account: BigNumberish) => string;
4805
+ declare function getMessageHash(typedData: TypedData, account: BigNumberish): string;
4770
4806
 
4771
4807
  type typedData_StarkNetDomain = StarkNetDomain;
4808
+ type typedData_StarkNetEnumType = StarkNetEnumType;
4772
4809
  type typedData_StarkNetMerkleType = StarkNetMerkleType;
4773
4810
  type typedData_StarkNetType = StarkNetType;
4774
4811
  type typedData_TypedData = TypedData;
4812
+ type typedData_TypedDataRevision = TypedDataRevision;
4813
+ declare const typedData_TypedDataRevision: typeof TypedDataRevision;
4775
4814
  declare const typedData_encodeData: typeof encodeData;
4776
4815
  declare const typedData_encodeType: typeof encodeType;
4777
4816
  declare const typedData_encodeValue: typeof encodeValue;
@@ -4784,9 +4823,12 @@ declare const typedData_prepareSelector: typeof prepareSelector;
4784
4823
  declare namespace typedData {
4785
4824
  export {
4786
4825
  typedData_StarkNetDomain as StarkNetDomain,
4826
+ typedData_StarkNetEnumType as StarkNetEnumType,
4787
4827
  typedData_StarkNetMerkleType as StarkNetMerkleType,
4788
4828
  typedData_StarkNetType as StarkNetType,
4789
4829
  typedData_TypedData as TypedData,
4830
+ typedData_TypedDataRevision as TypedDataRevision,
4831
+ byteArrayFromString$1 as byteArrayFromString,
4790
4832
  typedData_encodeData as encodeData,
4791
4833
  typedData_encodeType as encodeType,
4792
4834
  typedData_encodeValue as encodeValue,
@@ -4973,8 +5015,8 @@ declare const isTypeEnum: (type: string, enums: AbiEnums) => boolean;
4973
5015
  declare const isTypeOption: (type: string) => boolean;
4974
5016
  declare const isTypeResult: (type: string) => boolean;
4975
5017
  declare const isTypeUint: (type: string) => boolean;
4976
- declare const isTypeLitteral: (type: string) => boolean;
4977
5018
  declare const isTypeUint256: (type: string) => boolean;
5019
+ declare const isTypeLiteral: (type: string) => boolean;
4978
5020
  declare const isTypeBool: (type: string) => boolean;
4979
5021
  declare const isTypeContractAddress: (type: string) => boolean;
4980
5022
  declare const isTypeEthAddress: (type: string) => boolean;
@@ -5040,7 +5082,7 @@ declare const cairo_isTypeContractAddress: typeof isTypeContractAddress;
5040
5082
  declare const cairo_isTypeEnum: typeof isTypeEnum;
5041
5083
  declare const cairo_isTypeEthAddress: typeof isTypeEthAddress;
5042
5084
  declare const cairo_isTypeFelt: typeof isTypeFelt;
5043
- declare const cairo_isTypeLitteral: typeof isTypeLitteral;
5085
+ declare const cairo_isTypeLiteral: typeof isTypeLiteral;
5044
5086
  declare const cairo_isTypeNamedTuple: typeof isTypeNamedTuple;
5045
5087
  declare const cairo_isTypeOption: typeof isTypeOption;
5046
5088
  declare const cairo_isTypeResult: typeof isTypeResult;
@@ -5066,7 +5108,7 @@ declare namespace cairo {
5066
5108
  cairo_isTypeEnum as isTypeEnum,
5067
5109
  cairo_isTypeEthAddress as isTypeEthAddress,
5068
5110
  cairo_isTypeFelt as isTypeFelt,
5069
- cairo_isTypeLitteral as isTypeLitteral,
5111
+ cairo_isTypeLiteral as isTypeLiteral,
5070
5112
  cairo_isTypeNamedTuple as isTypeNamedTuple,
5071
5113
  cairo_isTypeOption as isTypeOption,
5072
5114
  cairo_isTypeResult as isTypeResult,
@@ -5238,4 +5280,4 @@ declare function parseUDCEvent(txReceipt: InvokeTransactionReceiptResponse): {
5238
5280
  /** @deprecated prefer the 'num' naming */
5239
5281
  declare const number: typeof num;
5240
5282
 
5241
- export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, Block$1 as Block, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteArray, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallOptions, CallStruct, Calldata, CompiledContract, CompiledSierra, CompiledSierraCasm, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass, ContractClassResponse, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployAccountTransactionReceiptResponse, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, EthSigner, EventAbi, EventEntry, FunctionAbi, GatewayError, GetBlockResponse, GetTransactionReceiptResponse, GetTransactionResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, L1HandlerTransactionReceiptResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Litteral, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, PendingBlock, PendingStateUpdate, Program, RpcProvider as Provider, ProviderInterface, ProviderOptions, PythonicHints, index$3 as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, Result, RpcChannel, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetMerkleType, StarkNetType, StateUpdate, StateUpdateResponse, Storage, StructAbi, TransactionExecutionStatus, TransactionFinalityStatus, TransactionStatus, TransactionType, Tupled, TypedContract, TypedContractV2, TypedData, Uint, Uint256, UniversalDeployerContractPayload, UniversalDetails, V2DeclareSignerDetails, V2DeployAccountSignerDetails, V2InvocationsSignerDetails, V3DeclareSignerDetails, V3DeployAccountSignerDetails, V3InvocationsSignerDetails, V3TransactionDetails, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, byteArray, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getEstimateFeeBulkOptions, getSimulateTransactionOptions, index$1 as hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$2 as types, uint256$1 as uint256, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };
5283
+ export { Abi, AbiEntry, AbiEnums, AbiEvents, AbiStructs, Account, AccountInterface, AccountInvocationItem, AccountInvocations, AccountInvocationsFactoryDetails, AllowArray, Args, ArgsOrCalldata, ArgsOrCalldataWithOptions, ArraySignatureType, AsyncContractFunction, BigNumberish, Block$1 as Block, BlockIdentifier, BlockNumber, BlockStatus, BlockTag, Builtins, ByteArray, ByteCode, Cairo1Event, CairoAssembly, CairoContract, CairoCustomEnum, CairoEnum, CairoEnumRaw, CairoOption, CairoOptionVariant, CairoResult, CairoResultVariant, CairoVersion, Call, CallContractResponse, CallData, CallDetails, CallOptions, CallStruct, Calldata, CompiledContract, CompiledSierra, CompiledSierraCasm, CompilerVersion, CompleteDeclareContractPayload, CompressedProgram, Contract, ContractClass, ContractClassResponse, ContractEntryPointFields, ContractFactory, ContractFactoryParams, ContractFunction, ContractInterface, ContractOptions, ContractVersion, CustomError, DeclareAndDeployContractPayload, DeclareContractPayload, DeclareContractResponse, DeclareContractTransaction, DeclareDeployUDCResponse, DeclareSignerDetails, DeclareTransactionReceiptResponse, DeployAccountContractPayload, DeployAccountContractTransaction, DeployAccountSignerDetails, DeployAccountTransactionReceiptResponse, DeployContractResponse, DeployContractUDCResponse, DeployTransactionReceiptResponse, Details, EntryPointType, EntryPointsByType, EnumAbi, EstimateFee, EstimateFeeAction, EstimateFeeBulk, EstimateFeeDetails, EstimateFeeResponse, EstimateFeeResponseBulk, EthSigner, EventAbi, EventEntry, FunctionAbi, GatewayError, GetBlockResponse, GetTransactionReceiptResponse, GetTransactionResponse, HexCalldata, HttpError, Invocation, Invocations, InvocationsDetails, InvocationsDetailsWithNonce, InvocationsSignerDetails, InvokeFunctionResponse, InvokeOptions, InvokeTransactionReceiptResponse, L1HandlerTransactionReceiptResponse, LegacyCompiledContract, LegacyContractClass, LegacyEvent, LibraryError, Literal, MultiDeployContractResponse, MultiType, Nonce, OptionalPayload, ParsedEvent, ParsedEvents, ParsedStruct, PendingBlock, PendingStateUpdate, Program, RpcProvider as Provider, ProviderInterface, ProviderOptions, PythonicHints, index$3 as RPC, RawArgs, RawArgsArray, RawArgsObject, RawCalldata, Result, RpcChannel, RpcProvider, RpcProviderOptions, SIMULATION_FLAG, SierraContractClass, SierraContractEntryPointFields, SierraEntryPointsByType, SierraProgramDebugInfo, Signature, Signer, SignerInterface, SimulateTransactionDetails, SimulateTransactionResponse, SimulatedTransaction, SimulationFlags, StarkNetDomain, StarkNetEnumType, StarkNetMerkleType, StarkNetType, StateUpdate, StateUpdateResponse, Storage, StructAbi, TransactionExecutionStatus, TransactionFinalityStatus, TransactionStatus, TransactionType, Tupled, TypedContractV1, TypedContractV2, TypedData, TypedDataRevision, Uint, Uint256, UniversalDeployerContractPayload, UniversalDetails, V2DeclareSignerDetails, V2DeployAccountSignerDetails, V2InvocationsSignerDetails, V3DeclareSignerDetails, V3DeployAccountSignerDetails, V3InvocationsSignerDetails, V3TransactionDetails, ValidateType, WeierstrassSignatureType, addAddressPadding, buildUrl, byteArray, cairo, constants, contractClassResponseToLegacyCompiledContract, defaultProvider, ec, encode, eth, index as events, extractContractHashes, fixProto, fixStack, getCalldata, getChecksumAddress, getContractVersionOptions, getEstimateFeeBulkOptions, getSimulateTransactionOptions, index$1 as hash, isSierra, isUrl, json, merkle, num, number, parseUDCEvent, provider, selector, shortString, splitArgsAndOptions, stark, starknetId, transaction, typedData, index$2 as types, uint256$1 as uint256, v2 as v2hash, v3 as v3hash, validateAndParseAddress, validateChecksumAddress, waitForTransactionOptions };