starknet 5.13.1 → 5.14.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 CHANGED
@@ -1,50 +1,37 @@
1
+ # [5.14.0](https://github.com/0xs34n/starknet.js/compare/v5.13.2...v5.14.0) (2023-06-21)
2
+
3
+ ### Features
4
+
5
+ - add isCairo1 utility methods ([78e9f87](https://github.com/0xs34n/starknet.js/commit/78e9f874e0d812a9d1c896846e5ec6c95a6cffca))
6
+
7
+ ## [5.13.2](https://github.com/0xs34n/starknet.js/compare/v5.13.1...v5.13.2) (2023-06-16)
8
+
9
+ ### Bug Fixes
10
+
11
+ - conform storage key to RPC specification ([6c66202](https://github.com/0xs34n/starknet.js/commit/6c66202a966003509460dedf91e98177f7f4af27))
12
+
1
13
  ## [5.13.1](https://github.com/0xs34n/starknet.js/compare/v5.13.0...v5.13.1) (2023-06-14)
2
14
 
3
15
  ### Bug Fixes
4
16
 
5
- - common abi type for ContractClassResponse ([55a8d98](https://github.com/0xs34n/starknet.js/commit/55a8d981be4ee4d861c7a3f988c012801af3d905))
17
+ - introduce common ABI type for contract class response ([55a8d98](https://github.com/0xs34n/starknet.js/commit/55a8d981be4ee4d861c7a3f988c012801af3d905))
6
18
 
7
19
  # [5.13.0](https://github.com/0xs34n/starknet.js/compare/v5.12.0...v5.13.0) (2023-06-12)
8
20
 
9
- ### Bug Fixes
21
+ ### Info: Skipped tests during the release pipeline
22
+
23
+ - Devnet partial support RPC v0.3.0 (simulate)
24
+ - Infura (Pathfinder) default node on RPC v0.2.x
25
+
26
+ ### Features
10
27
 
11
- - class / simulate types ([823e144](https://github.com/0xs34n/starknet.js/commit/823e144257cf3afdf8ca64f3e6e1afd1c2525161))
12
- - getClass return type ([5251337](https://github.com/0xs34n/starknet.js/commit/52513373fc90af4764f3d8bf7f24a6a65db8dc52))
13
- - removed doc modification ([f45b532](https://github.com/0xs34n/starknet.js/commit/f45b53204fbd4fe8a8ccc46fdf401cd32b732883))
14
- - suggestedMaxFees to suggestedMaxFee ([80cfbb9](https://github.com/0xs34n/starknet.js/commit/80cfbb9c3eca55ddb0eae6a152523b72f3ba9699))
15
- - test error ([2117e75](https://github.com/0xs34n/starknet.js/commit/2117e75b92c4b025e3d69a2719454fca3af76aa2))
16
- - type ([67bf6d8](https://github.com/0xs34n/starknet.js/commit/67bf6d8c31c62107eb1ea4b21923b43e0ca7c921))
17
- - type not requested anymore ([4446acb](https://github.com/0xs34n/starknet.js/commit/4446acbe8ab06fa981a8ccecb7fad67b2df73899))
18
- - typescript wrong types for getStateUpdate ([0c309d5](https://github.com/0xs34n/starknet.js/commit/0c309d5c1e3450fa274e8fb798c510984b6467b5))
19
- - uncomment sequencer simulate transaction test ([9a60b9f](https://github.com/0xs34n/starknet.js/commit/9a60b9ffae9a67a17b307aa5bbbffe897416ccab))
20
- - update rpc versions, small fixes ([4f8b24f](https://github.com/0xs34n/starknet.js/commit/4f8b24fcd402b033415af9902f5e0137e03c5db9))
21
- - wip simulate type cleanup, version bugfix ([045bb25](https://github.com/0xs34n/starknet.js/commit/045bb251a095ff1f7ec8eaa141547c247f3fabb2))
22
-
23
- ### Features
24
-
25
- - accountInvocationsFactory ([acdaab4](https://github.com/0xs34n/starknet.js/commit/acdaab4458406b8bb55238cb9400c16724486da0))
26
- - add EVENTS_CHUNK (PR 70 from starknet-specs) ([2f15593](https://github.com/0xs34n/starknet.js/commit/2f155932a748400d37926b45e4abe6fa894ae9b3))
27
- - add replaced classes and rename properties (PR 76 from starknet-specs), rpc.ts fix coming next ([eb095c5](https://github.com/0xs34n/starknet.js/commit/eb095c583fe93a9e8157c5157885cbb19de8a00d))
28
- - add simulate_transaction and sierra support (untested) ([47bca37](https://github.com/0xs34n/starknet.js/commit/47bca377f2f4cde658a467143cc54f80c385bc93))
29
- - added missing TOO_MANY_KEYS_IN_FILTER error (PR 55 from starknet-specs) ([32e2bf5](https://github.com/0xs34n/starknet.js/commit/32e2bf5521461402b5d524311e1a53a7f434f314))
30
- - consolidation of invokes in provider, except basic transactions ([92c2a98](https://github.com/0xs34n/starknet.js/commit/92c2a985538486065328b3243d22fc578b726ea6))
31
- - fix remaining issues ([23d0a96](https://github.com/0xs34n/starknet.js/commit/23d0a96a525f7e2317021db5cfb9a2cf5a5ff9cf))
32
- - implemented estimateFeeOriginal ([aba6707](https://github.com/0xs34n/starknet.js/commit/aba67074cadab64389908f0102bdfc904064ae5e))
33
- - make transaction type explicit (PR 68 from starknet-specs) ([8857e08](https://github.com/0xs34n/starknet.js/commit/8857e08696df1e4ed8ca16ed922326350f74dc67))
34
- - multiple updates and fixes for simulate and estimate, interface, wip ([12ed49b](https://github.com/0xs34n/starknet.js/commit/12ed49bf182da6ecfdb6560fd10d0659ad2acae9))
35
- - simulate transaction implementation wip ([b604de0](https://github.com/0xs34n/starknet.js/commit/b604de005148a53d6ee6ac5f67e2e004e5222be5))
36
- - simulate transaction rpc & sequencer ([8a47562](https://github.com/0xs34n/starknet.js/commit/8a475623799778a97f385b935d7f951f388cff13))
37
- - starknet 0.11.0 adjustments (PR 65 from starknet-specs), rpc.ts fix coming next ([cffdaca](https://github.com/0xs34n/starknet.js/commit/cffdacaa66fe944dcbf050d8572d1e053d59480c))
38
- - state update response split to pending/none pending (PR 74 from starknet-specs) ([2c6945f](https://github.com/0xs34n/starknet.js/commit/2c6945f03c9bd8ab5787cc2505a0fd803d0bbe72))
39
- - supported multiple values in event filters (PR 55 from starknet-specs) ([4492704](https://github.com/0xs34n/starknet.js/commit/4492704224632f51990b1ba3b3138f4e4c902e65))
40
- - supported new required properties (PR 67 from starknet-specs) ([1759ac4](https://github.com/0xs34n/starknet.js/commit/1759ac4c84d8bcea8460745f4e48518511976835))
41
- - supported the new api bulk for estimateFee on existing rpc methods ([b8dd210](https://github.com/0xs34n/starknet.js/commit/b8dd2107ab614e0d5c99545d0fe61cbd727db5ab))
28
+ - adapt RPC methods to v0.3.0 specification ([32188fb](https://github.com/0xs34n/starknet.js/commit/32188fba03506f45c82b61e24574e6a8fb0a5c1f))
42
29
 
43
30
  # [5.12.0](https://github.com/0xs34n/starknet.js/compare/v5.11.1...v5.12.0) (2023-06-12)
44
31
 
45
32
  ### Features
46
33
 
47
- - add RawArgs in Account.populate ([6b539a3](https://github.com/0xs34n/starknet.js/commit/6b539a37815ecafb6c8b738b8585dd75d534b3cf))
34
+ - update Account.populate() to accept RawArgs type ([6b539a3](https://github.com/0xs34n/starknet.js/commit/6b539a37815ecafb6c8b738b8585dd75d534b3cf))
48
35
 
49
36
  ## [5.11.1](https://github.com/0xs34n/starknet.js/compare/v5.11.0...v5.11.1) (2023-05-30)
50
37
 
@@ -62,62 +49,58 @@
62
49
 
63
50
  ### Bug Fixes
64
51
 
65
- - use of uint256 in array in calls ([969b3c1](https://github.com/0xs34n/starknet.js/commit/969b3c1670902d7cc55156d5b3f6a8e7d45c731b))
52
+ - repair Uint256 array handling for calldata compilation ([969b3c1](https://github.com/0xs34n/starknet.js/commit/969b3c1670902d7cc55156d5b3f6a8e7d45c731b))
66
53
 
67
54
  ## [5.10.1](https://github.com/0xs34n/starknet.js/compare/v5.10.0...v5.10.1) (2023-05-16)
68
55
 
69
56
  ### Bug Fixes
70
57
 
71
- - c1 acc execute props order, c1 test flag, local testing fix ([d86057c](https://github.com/0xs34n/starknet.js/commit/d86057cefe9e4053dac6d45d043401605246d3ed))
58
+ - ensure valid Cairo1 property order for call execution ([d86057c](https://github.com/0xs34n/starknet.js/commit/d86057cefe9e4053dac6d45d043401605246d3ed))
72
59
 
73
60
  # [5.10.0](https://github.com/0xs34n/starknet.js/compare/v5.9.2...v5.10.0) (2023-05-10)
74
61
 
75
62
  ### Bug Fixes
76
63
 
77
- - merge next and cleanup ([067673f](https://github.com/0xs34n/starknet.js/commit/067673ffbc9f414c33018d5cd83c29a001c5e9ab))
78
- - nested 2d arrays request and response ([cccf518](https://github.com/0xs34n/starknet.js/commit/cccf518acc950bfed7579513c812df33cebb774d))
79
- - ts getClassHashAt oprional blockid ([f54bfd0](https://github.com/0xs34n/starknet.js/commit/f54bfd0e9591d1ec1dccf20668de68272834fa46))
64
+ - repair nested 2d array handling ([cccf518](https://github.com/0xs34n/starknet.js/commit/cccf518acc950bfed7579513c812df33cebb774d))
65
+ - mark getClassHashAt blockIdentifier parameter as optional ([f54bfd0](https://github.com/0xs34n/starknet.js/commit/f54bfd0e9591d1ec1dccf20668de68272834fa46))
80
66
 
81
67
  ### Features
82
68
 
83
- - declareIfNot, update declareAndDeploy with it, cleanup cairo1 test ([494dbb8](https://github.com/0xs34n/starknet.js/commit/494dbb8a84608415a279b2bfa84103667321a84e))
69
+ - introduce declareIfNot utility Account method ([494dbb8](https://github.com/0xs34n/starknet.js/commit/494dbb8a84608415a279b2bfa84103667321a84e))
84
70
  - improve usage by extending RawCalldata to RawArgs in all major flows ([0ef1ec8](https://github.com/0xs34n/starknet.js/commit/0ef1ec8624e294a526f8e97d856e70b6426a9ae3))
85
71
  - make cairoVersion a property of Account ([b6a7d38](https://github.com/0xs34n/starknet.js/commit/b6a7d38e98c65e24cffac5485819797560b5571c))
86
72
 
87
73
  ## [5.9.2](https://github.com/0xs34n/starknet.js/compare/v5.9.1...v5.9.2) (2023-05-03)
88
74
 
89
- ### Bug Fixes
75
+ ### Info
90
76
 
91
- - revert doc changes ([356b04d](https://github.com/0xs34n/starknet.js/commit/356b04d94a398ba7642cae6bffa8961213dda33c))
77
+ - _no changes_
92
78
 
93
79
  ## [5.9.1](https://github.com/0xs34n/starknet.js/compare/v5.9.0...v5.9.1) (2023-05-02)
94
80
 
95
81
  ### Bug Fixes
96
82
 
97
- - add tests for uint256 ([5914170](https://github.com/0xs34n/starknet.js/commit/5914170770fd75909779a6b7e7b3cb2c6b1b2a9f))
98
- - correct test ([a35548e](https://github.com/0xs34n/starknet.js/commit/a35548e4d9892630645645bb43737ea2e2ae79a5))
99
- - uint256 in contract call ([0cc05e0](https://github.com/0xs34n/starknet.js/commit/0cc05e073bc025c2afdc5105b5b87e5d23c1d487))
83
+ - repair Uint256 contract call handling ([0cc05e0](https://github.com/0xs34n/starknet.js/commit/0cc05e073bc025c2afdc5105b5b87e5d23c1d487))
100
84
 
101
85
  # [5.9.0](https://github.com/0xs34n/starknet.js/compare/v5.8.0...v5.9.0) (2023-04-28)
102
86
 
103
87
  ### Features
104
88
 
105
- - complex c1 Struct with forced abi, complex ci arrays, refactor parser ([8f28462](https://github.com/0xs34n/starknet.js/commit/8f2846290a88c7b3b2985f32c61446a378566679))
106
- - helpers toHex, Calldata, executeCallData, compile entrypoint, type improvements ([a452d64](https://github.com/0xs34n/starknet.js/commit/a452d64f1aa4e1005378bbba4d7748a054cae2be))
89
+ - support complex Cairo1 Struct with forced ABI and complex Cairo1 arrays, refactor parser ([8f28462](https://github.com/0xs34n/starknet.js/commit/8f2846290a88c7b3b2985f32c61446a378566679))
90
+ - add toHex and expand Calldata and executeCallData helpers, allow entrypoint compilation ([a452d64](https://github.com/0xs34n/starknet.js/commit/a452d64f1aa4e1005378bbba4d7748a054cae2be))
107
91
 
108
92
  # [5.8.0](https://github.com/0xs34n/starknet.js/compare/v5.7.0...v5.8.0) (2023-04-26)
109
93
 
110
94
  ### Bug Fixes
111
95
 
112
- - contract types, interface, cleanup, extend tests ([02c6b72](https://github.com/0xs34n/starknet.js/commit/02c6b72ec41016fdd75537044889e7cffd624b27))
113
- - contractfactory, contract, interface cleanup cleanup & ts ([b25047e](https://github.com/0xs34n/starknet.js/commit/b25047ece2eed313eaa776b2a132b9a04c3fbc2f))
114
- - lapsus lingua, dangling, cleanup 🚀 ([a79d55c](https://github.com/0xs34n/starknet.js/commit/a79d55c2990e81bc6b0e58583142d3eb7bbddfa2))
96
+ - clean up Contract interfaces ([02c6b72](https://github.com/0xs34n/starknet.js/commit/02c6b72ec41016fdd75537044889e7cffd624b27))
97
+ - clean up ContractFactory and Contract interfaces ([b25047e](https://github.com/0xs34n/starknet.js/commit/b25047ece2eed313eaa776b2a132b9a04c3fbc2f))
115
98
  - prevent missusage of cairoVersion on deploy ([d920dbe](https://github.com/0xs34n/starknet.js/commit/d920dbe6144006438c917727b153a043fec2531b))
116
99
  - remove unused cairoVersion from Contract ([e4fcf24](https://github.com/0xs34n/starknet.js/commit/e4fcf244fa1dfd01301addfa7492bf90dac5a854))
117
100
 
118
101
  ### Features
119
102
 
120
- - boolean to felt - cairo 1, compile() ([ef34e0a](https://github.com/0xs34n/starknet.js/commit/ef34e0a25a52be7a6ac76714bda43233a2f1a6f1))
103
+ - add boolean to felt support for Cairo1 ([ef34e0a](https://github.com/0xs34n/starknet.js/commit/ef34e0a25a52be7a6ac76714bda43233a2f1a6f1))
121
104
  - remove deprecated compileCalldata ([e5adca4](https://github.com/0xs34n/starknet.js/commit/e5adca449a9d1142339d5e63adb857698c5913d6))
122
105
 
123
106
  # [5.7.0](https://github.com/0xs34n/starknet.js/compare/v5.6.1...v5.7.0) (2023-04-25)
@@ -130,44 +113,42 @@
130
113
 
131
114
  ### Bug Fixes
132
115
 
133
- - uint256 struct ([4ce2d02](https://github.com/0xs34n/starknet.js/commit/4ce2d0255594831e7ad816368e3cfa14449feaa5))
134
- - uint256, view bool, compiled in contract.call ([346cd51](https://github.com/0xs34n/starknet.js/commit/346cd5197d377966d148a8b218e6ee03af7170f2))
116
+ - fix support for Cairo1 Uint256 types ([e2b03b2](https://github.com/0xs34n/starknet.js/commit/e2b03b2c587cc774bba9c6961d710aac782f829f))
135
117
 
136
118
  # [5.6.0](https://github.com/0xs34n/starknet.js/compare/v5.5.0...v5.6.0) (2023-04-19)
137
119
 
138
120
  ### Bug Fixes
139
121
 
140
- - optional param in contract invoke ([da094e4](https://github.com/0xs34n/starknet.js/commit/da094e4172ed43ce93604e92adbba2a5ecb1498e))
122
+ - mark optional param in contract invoke ([da094e4](https://github.com/0xs34n/starknet.js/commit/da094e4172ed43ce93604e92adbba2a5ecb1498e))
141
123
 
142
124
  ### Features
143
125
 
144
- - cairo 1 bool ([52fed30](https://github.com/0xs34n/starknet.js/commit/52fed30f04b70bcce80f829dba6975101f6f3644))
145
- - cairo1 array, fix invoke response, hash separate test ([4637cd7](https://github.com/0xs34n/starknet.js/commit/4637cd74481ba85b3164ddb93c258b9ca8b9b949))
146
- - felt252 implementation ([3d20ea4](https://github.com/0xs34n/starknet.js/commit/3d20ea44b49d1c7ba90d8a46a307f54e737c3285))
147
- - uint validate and parsing supprot ([c1acd29](https://github.com/0xs34n/starknet.js/commit/c1acd298d63758ba27fc20bcb4b0c00cca82078f))
126
+ - add Cairo1 bool implementation ([52fed30](https://github.com/0xs34n/starknet.js/commit/52fed30f04b70bcce80f829dba6975101f6f3644))
127
+ - support Cairo1 array, fix invoke response ([4637cd7](https://github.com/0xs34n/starknet.js/commit/4637cd74481ba85b3164ddb93c258b9ca8b9b949))
128
+ - add felt252 implementation ([3d20ea4](https://github.com/0xs34n/starknet.js/commit/3d20ea44b49d1c7ba90d8a46a307f54e737c3285))
129
+ - support uint parsing and validation ([c1acd29](https://github.com/0xs34n/starknet.js/commit/c1acd298d63758ba27fc20bcb4b0c00cca82078f))
148
130
 
149
131
  # [5.5.0](https://github.com/0xs34n/starknet.js/compare/v5.4.2...v5.5.0) (2023-04-10)
150
132
 
151
133
  ### Bug Fixes
152
134
 
153
- - update DeclareAndDeploy with cairo 1 declare ([71072cf](https://github.com/0xs34n/starknet.js/commit/71072cffadb8ac118780cec21cb8c4f83e74d7ae))
135
+ - update DeclareAndDeploy with Cairo1 declare ([71072cf](https://github.com/0xs34n/starknet.js/commit/71072cffadb8ac118780cec21cb8c4f83e74d7ae))
154
136
 
155
137
  ### Features
156
138
 
157
- - response parsing and types ([09a46af](https://github.com/0xs34n/starknet.js/commit/09a46af02e88376dc49e0aa39468fded99b94ee2))
139
+ - expand Cairo1 response parsing and types ([09a46af](https://github.com/0xs34n/starknet.js/commit/09a46af02e88376dc49e0aa39468fded99b94ee2))
158
140
 
159
141
  ## [5.4.2](https://github.com/0xs34n/starknet.js/compare/v5.4.1...v5.4.2) (2023-04-04)
160
142
 
161
143
  ### Bug Fixes
162
144
 
163
- - implement custom ts error localy ([fa90a3e](https://github.com/0xs34n/starknet.js/commit/fa90a3e7dcbe8c0952b0681be903dffb4b4c74c6))
145
+ - implement custom ts error locally ([fa90a3e](https://github.com/0xs34n/starknet.js/commit/fa90a3e7dcbe8c0952b0681be903dffb4b4c74c6))
164
146
 
165
147
  ## [5.4.1](https://github.com/0xs34n/starknet.js/compare/v5.4.0...v5.4.1) (2023-04-03)
166
148
 
167
149
  ### Bug Fixes
168
150
 
169
- - remove AnySignatureType and parseSignature method ([358bfad](https://github.com/0xs34n/starknet.js/commit/358bfad8e70ab3d4b2c784e0444780c4d7c5f71a))
170
- - signature tight flexible resolution ([4990cd8](https://github.com/0xs34n/starknet.js/commit/4990cd8a4d6fd8b87c3016fd27c7eb1b2d5a4a8a))
151
+ - fix call response type and signature type ([c6c42e0](https://github.com/0xs34n/starknet.js/commit/c6c42e06ab7dd464e472b319cc16f52c75bef7cb))
171
152
 
172
153
  # [5.4.0](https://github.com/0xs34n/starknet.js/compare/v5.3.0...v5.4.0) (2023-04-03)
173
154
 
@@ -177,28 +158,28 @@
177
158
 
178
159
  ### Features
179
160
 
180
- - support cairo1 execute calldata ([1f7f001](https://github.com/0xs34n/starknet.js/commit/1f7f00155ae89ff871cdf987cd3b5238377d5450))
161
+ - support Cairo1 execute calldata ([1f7f001](https://github.com/0xs34n/starknet.js/commit/1f7f00155ae89ff871cdf987cd3b5238377d5450))
181
162
 
182
163
  # [5.3.0](https://github.com/0xs34n/starknet.js/compare/v5.2.0...v5.3.0) (2023-03-29)
183
164
 
184
165
  ### Features
185
166
 
186
167
  - declare v2 from account ([bc861b7](https://github.com/0xs34n/starknet.js/commit/bc861b753b443b4f75f9af7d1d9eb1a350273376))
187
- - declare v2 intermidiate ([a8fdfe3](https://github.com/0xs34n/starknet.js/commit/a8fdfe3e6f00ee08f7aec55a8babda46043f1783))
168
+ - declare v2 intermediate ([a8fdfe3](https://github.com/0xs34n/starknet.js/commit/a8fdfe3e6f00ee08f7aec55a8babda46043f1783))
188
169
  - get_compiled_class_by_class_hash, get_class_by_hash, ContractClass, rpc hotfix ([fc33d19](https://github.com/0xs34n/starknet.js/commit/fc33d196adadbf899e450aec88ef9d8d7365f726))
189
170
  - get_state_update, fix types, fix responseParser, fix BigNumberish api response, fix OPENRPC ([50a2c29](https://github.com/0xs34n/starknet.js/commit/50a2c29b53feb960a6b2a0eea7651c55cff5fc0b))
190
- - minimal changes api ([7cec344](https://github.com/0xs34n/starknet.js/commit/7cec344c5b9a70bac9597354b20773388e5a4145))
171
+ - update contract address to sender address parameters ([7cec344](https://github.com/0xs34n/starknet.js/commit/7cec344c5b9a70bac9597354b20773388e5a4145))
191
172
  - remove version 0 invoke and declare ([08bd65c](https://github.com/0xs34n/starknet.js/commit/08bd65cf20d6db0fecb1fb014b2464f19dc64a6c))
192
- - skipValidate full impl ([8b20e2e](https://github.com/0xs34n/starknet.js/commit/8b20e2e461ae73b9b6840972ea6c17a00b3efddc))
173
+ - implement skipValidate ([8b20e2e](https://github.com/0xs34n/starknet.js/commit/8b20e2e461ae73b9b6840972ea6c17a00b3efddc))
193
174
  - update hashing to cairo-lang 0.11.0, cairo 1.0.0.alpha-6 ([b6669b5](https://github.com/0xs34n/starknet.js/commit/b6669b577b159bd98369a16e295ba847eea55688))
194
175
 
195
176
  # [5.2.0](https://github.com/0xs34n/starknet.js/compare/v5.1.1...v5.2.0) (2023-03-14)
196
177
 
197
178
  ### Features
198
179
 
199
- - compiledClassHash implementation working without cleanup ([485793c](https://github.com/0xs34n/starknet.js/commit/485793ce6fd0763e3da56d0d11a50bffc9bab984))
200
- - comput chassHash for cairo 1 contract - computeSieraContractClassHash ([e20c1c5](https://github.com/0xs34n/starknet.js/commit/e20c1c5d01ce1d8abe2de527233a8396f7b9316d))
201
- - unify classHash for siera and legacy ([fac2bfe](https://github.com/0xs34n/starknet.js/commit/fac2bfe92e074207132296a0d3f73dae2ddaf735))
180
+ - implement compiledClassHash ([485793c](https://github.com/0xs34n/starknet.js/commit/485793ce6fd0763e3da56d0d11a50bffc9bab984))
181
+ - compute chassHash for Cairo1 contract - computeSieraContractClassHash ([e20c1c5](https://github.com/0xs34n/starknet.js/commit/e20c1c5d01ce1d8abe2de527233a8396f7b9316d))
182
+ - unify classHash for Sierra and legacy ([fac2bfe](https://github.com/0xs34n/starknet.js/commit/fac2bfe92e074207132296a0d3f73dae2ddaf735))
202
183
 
203
184
  ## [5.1.1](https://github.com/0xs34n/starknet.js/compare/v5.1.0...v5.1.1) (2023-03-07)
204
185
 
@@ -224,57 +205,29 @@
224
205
  ### Bug Fixes
225
206
 
226
207
  - add new starknet id contracts (testnet) ([343cf78](https://github.com/0xs34n/starknet.js/commit/343cf78a678b088ab4915407fe86f28fa91db6ea))
227
- - devnet tests ([8a5866e](https://github.com/0xs34n/starknet.js/commit/8a5866ee24b1a88ae3914fd7700d8a6e785979f1))
228
208
 
229
209
  # [5.0.0](https://github.com/0xs34n/starknet.js/compare/v4.22.0...v5.0.0) (2023-02-22)
230
210
 
231
211
  ### Bug Fixes
232
212
 
233
- - better ([cda4931](https://github.com/0xs34n/starknet.js/commit/cda49313b17d715463f915f9ec8f1bf7c4de93f2))
234
- - bnToUint256 and add more tests ([baa9d61](https://github.com/0xs34n/starknet.js/commit/baa9d611b18725ba269818631f668183212988df))
235
- - compile response ts type ([4b71970](https://github.com/0xs34n/starknet.js/commit/4b719702d3317af0fa753609e7205bb26416cda0))
236
- - contract related test ([6dfc010](https://github.com/0xs34n/starknet.js/commit/6dfc0102d15c5b4b339aebe25dba8767e63f0187))
237
- - imports ([a151afc](https://github.com/0xs34n/starknet.js/commit/a151afce77eb175e39982fbf8bfcbe25001ee6db))
238
- - imports ([43f0e25](https://github.com/0xs34n/starknet.js/commit/43f0e25f22106da510a0152c65084b1ee677cc6f))
239
- - invoke contract ([18b6337](https://github.com/0xs34n/starknet.js/commit/18b6337e9e87a9b35d585a68f76896dfe01983c6))
240
- - options split for edge case ([acfab34](https://github.com/0xs34n/starknet.js/commit/acfab34f3cdca670ecd1793954a9bf53104ae4f1))
241
- - post beta merge fixes ([aa6046f](https://github.com/0xs34n/starknet.js/commit/aa6046f2080e5f8c46e4cee7930d851b97312c3f))
242
- - sequencer fetchEndpoint ([7206d77](https://github.com/0xs34n/starknet.js/commit/7206d776a497cab833f5bf2e00b9f2eb695e3c71))
243
- - strict tuple rule, type bugfix, basic tuple validator ([1c97279](https://github.com/0xs34n/starknet.js/commit/1c9727963d00dc3143af08d7479c040c0d171e5f))
244
- - tests ([3b34c0c](https://github.com/0xs34n/starknet.js/commit/3b34c0c37c0cca3da087e5ff2a881fba8959bf4e))
245
- - tests ([85535e5](https://github.com/0xs34n/starknet.js/commit/85535e507cdc8307b4268ce7cef9c9fa4eb3c270))
246
- - **tests:** signature in account tests ([c8bc860](https://github.com/0xs34n/starknet.js/commit/c8bc8604d74d0e0556468afa3475150fe3579e7a))
247
- - transaction status fix ([2cfcb69](https://github.com/0xs34n/starknet.js/commit/2cfcb690f25f0025cd08734e31167c1c969056f9))
248
- - trying fixing tests for sequencer ([480e20d](https://github.com/0xs34n/starknet.js/commit/480e20de6b8d3f8eb3048a84430380d73fe46dcc))
249
- - update lockfile ([ecf9ead](https://github.com/0xs34n/starknet.js/commit/ecf9ead06d137bd2b43816a75f66dca0626e9ecd))
250
- - use hex array for RPC signatures ([aa73351](https://github.com/0xs34n/starknet.js/commit/aa73351b024daf75af2bc997b78cbde56de567e9))
251
- - weierstrass import ([c963f90](https://github.com/0xs34n/starknet.js/commit/c963f900cc0f3ffcadce16a704f7b9e592a014e1))
252
-
253
- - chore!: account and signer updates ([be0cbe8](https://github.com/0xs34n/starknet.js/commit/be0cbe88b409fa9db20de8125319e10d1e29677e))
213
+ - remove the chain id property from the provider interface ([425b223](https://github.com/0xs34n/starknet.js/commit/425b22339118a7c3743ee1de8cc1683d2998bbdc))
214
+ - repair bnToUint256 ([baa9d61](https://github.com/0xs34n/starknet.js/commit/baa9d611b18725ba269818631f668183212988df))
215
+ - repair and unify transaction retrieval error ([ea5e646](https://github.com/0xs34n/starknet.js/commit/ea5e64651bf47824b254ae73ed8aa88998a5be44))
216
+ - remove hex prefix should work insensitive, for both 0x and 0X ([53323d4](https://github.com/0xs34n/starknet.js/commit/53323d434d5edbeee03c4262935676c950a761d3))
254
217
 
255
218
  ### Features
256
219
 
257
- - add back ec for proper support ([649e0aa](https://github.com/0xs34n/starknet.js/commit/649e0aa032d77ba714fe5cb8d31252590e9eb7f4))
258
- - add computeClassHash functionality ([3f6d88e](https://github.com/0xs34n/starknet.js/commit/3f6d88e00d9620bf2044ecccea6369067f2192d0))
220
+ - switch to native BigInt support ([ec56c29](https://github.com/0xs34n/starknet.js/commit/ec56c29672c2e09e00d6ce5d500e4b10b6598269))
221
+ - expose elliptic curve utility methods ([649e0aa](https://github.com/0xs34n/starknet.js/commit/649e0aa032d77ba714fe5cb8d31252590e9eb7f4))
259
222
  - add public sequencer fetch method ([1dab230](https://github.com/0xs34n/starknet.js/commit/1dab2302d64f5f3f1df84c225a93e6007592090d))
260
- - add tests and make RawArgs more flexible ([db9f274](https://github.com/0xs34n/starknet.js/commit/db9f2745d2f55767acd0b3ded4a028d103a0d249))
261
223
  - allow BigNumberish in RawCallData ([9b897c7](https://github.com/0xs34n/starknet.js/commit/9b897c7fb653ae1830b3795b29bd35c8be8e2d22))
262
- - compute class hash tests ([31a52a2](https://github.com/0xs34n/starknet.js/commit/31a52a28994abb0081fb27a0a7801cf160bcd2ad))
263
- - format arbitrary length array, test edge case tuple arrays ([42357b6](https://github.com/0xs34n/starknet.js/commit/42357b6128e6cc8ebe1067f5a85b0c8704316288))
264
- - implement longText aka. long string into calldata, remove toFelt and resolve circular ref ([da58b5a](https://github.com/0xs34n/starknet.js/commit/da58b5a5a089a7ec82cf37c78f11bd1bf44144ff))
265
- - initial commit to ue faster hashing ([722717d](https://github.com/0xs34n/starknet.js/commit/722717dcf23f6b62a528e58e9483f868f658ebf3))
266
- - initial poc ([eb26fbd](https://github.com/0xs34n/starknet.js/commit/eb26fbddc02d54bb1f9ecf12192f484122ab5df4))
267
- - make class hash optional for Declare Txn ([624ca8b](https://github.com/0xs34n/starknet.js/commit/624ca8b8d1885d9b9a405a31f05d869fdfc03c9c))
268
- - make compile work with already compiled data, complete test ([7e80837](https://github.com/0xs34n/starknet.js/commit/7e8083728c96efceb7b7163f2fe59293ebd63f04))
269
- - response formatter, refactored call method resturn object ([77ee9f4](https://github.com/0xs34n/starknet.js/commit/77ee9f434fb2ed66703976c97e348663f672fadb))
270
- - response parse tuple, moved to calldata class, test ([dbe04de](https://github.com/0xs34n/starknet.js/commit/dbe04de5ff2d026afeb20c09d1898caae3d6b708))
271
- - update declareAndDeploy method ([a47fbd5](https://github.com/0xs34n/starknet.js/commit/a47fbd5f523a375b988f912a5631c181e3a7159b))
272
- - use ec internally ([3392d03](https://github.com/0xs34n/starknet.js/commit/3392d0362af48f283ff414bc7387586ba44ad9a2))
273
- - use yarn ([ec1101e](https://github.com/0xs34n/starknet.js/commit/ec1101e6edaf53446e76181fa0cf4530befb9463))
224
+ - rework contract interaction API ([2ee199e](https://github.com/0xs34n/starknet.js/commit/2ee199e16c4fa2aa4432816482930a418e41b327))
225
+ - rework waitForTransaction API ([e17ff17](https://github.com/0xs34n/starknet.js/commit/e17ff1744d0ff9f93d7228e48168dc2bbaf63652))
274
226
 
275
227
  ### BREAKING CHANGES
276
228
 
277
- - uses BigInt and Faster Hashing
229
+ - multiple BN values replaced by BigInt
230
+ - major API refactoring
278
231
 
279
232
  # [5.0.0-beta.6](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.5...v5.0.0-beta.6) (2023-02-22)
280
233
 
package/dist/index.d.ts CHANGED
@@ -3017,6 +3017,16 @@ declare abstract class ContractInterface {
3017
3017
  * @returns Invocation object
3018
3018
  */
3019
3019
  abstract populate(method: string, args?: ArgsOrCalldata): Invocation;
3020
+ /**
3021
+ * tells if the contract comes from a Cairo 1 contract
3022
+ *
3023
+ * @returns TRUE if the contract comes from a Cairo1 contract
3024
+ * @example
3025
+ * ```typescript
3026
+ * const isCairo1: boolean = myContract.isCairo1();
3027
+ * ```
3028
+ */
3029
+ abstract isCairo1(): boolean;
3020
3030
  }
3021
3031
 
3022
3032
  declare const splitArgsAndOptions: (args: ArgsOrCalldataWithOptions) => {
@@ -3067,6 +3077,7 @@ declare class Contract implements ContractInterface {
3067
3077
  invoke(method: string, args?: ArgsOrCalldata, { parseRequest, maxFee, nonce, signature }?: InvokeOptions): Promise<InvokeFunctionResponse>;
3068
3078
  estimate(method: string, args?: ArgsOrCalldata): Promise<EstimateFeeResponse>;
3069
3079
  populate(method: string, args?: RawArgs): Call;
3080
+ isCairo1(): boolean;
3070
3081
  }
3071
3082
 
3072
3083
  declare class ContractFactory {
@@ -3234,6 +3245,14 @@ declare function isHex(hex: string): boolean;
3234
3245
  declare function toBigInt(value: BigNumberish): bigint;
3235
3246
  declare function isBigInt(value: any): value is bigint;
3236
3247
  declare function toHex(number: BigNumberish): string;
3248
+ /**
3249
+ * Convert BigNumberish to STORAGE_KEY
3250
+ * Same as toHex but conforming pattern STORAGE_KEY pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$
3251
+ * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.
3252
+ * 0x0 + [0-7] + 62 hex = 0x + 64 hex
3253
+ * @param number BigNumberish
3254
+ */
3255
+ declare function toStorageKey(number: BigNumberish): string;
3237
3256
  declare function hexToDecimalString(hex: string): string;
3238
3257
  /**
3239
3258
  * Remove hex string leading zero and lower case '0x01A'.. -> '0x1a..'
@@ -3273,6 +3292,7 @@ declare const num_toBigInt: typeof toBigInt;
3273
3292
  declare const num_toCairoBool: typeof toCairoBool;
3274
3293
  declare const num_toHex: typeof toHex;
3275
3294
  declare const num_toHexString: typeof toHexString;
3295
+ declare const num_toStorageKey: typeof toStorageKey;
3276
3296
  declare namespace num {
3277
3297
  export {
3278
3298
  num_BigNumberish as BigNumberish,
@@ -3292,6 +3312,7 @@ declare namespace num {
3292
3312
  num_toCairoBool as toCairoBool,
3293
3313
  num_toHex as toHex,
3294
3314
  num_toHexString as toHexString,
3315
+ num_toStorageKey as toStorageKey,
3295
3316
  };
3296
3317
  }
3297
3318
 
@@ -3655,6 +3676,17 @@ declare const isTypeBool: (type: string) => boolean;
3655
3676
  declare const isTypeContractAddress: (type: string) => boolean;
3656
3677
  declare const isCairo1Type: (type: string) => boolean;
3657
3678
  declare const getArrayType: (type: string) => string;
3679
+ /**
3680
+ * tells if an ABI comes from a Cairo 1 contract
3681
+ *
3682
+ * @param abi representing the interface of a Cairo contract
3683
+ * @returns TRUE if it is an ABI from a Cairo1 contract
3684
+ * @example
3685
+ * ```typescript
3686
+ * const isCairo1: boolean = isCairo1Abi(myAbi: Abi);
3687
+ * ```
3688
+ */
3689
+ declare function isCairo1Abi(abi: Abi): boolean;
3658
3690
  /**
3659
3691
  * named tuple are described as js object {}
3660
3692
  * struct types are described as js object {}
@@ -3677,6 +3709,7 @@ type cairo_Uint = Uint;
3677
3709
  declare const cairo_Uint: typeof Uint;
3678
3710
  declare const cairo_felt: typeof felt;
3679
3711
  declare const cairo_getArrayType: typeof getArrayType;
3712
+ declare const cairo_isCairo1Abi: typeof isCairo1Abi;
3680
3713
  declare const cairo_isCairo1Type: typeof isCairo1Type;
3681
3714
  declare const cairo_isLen: typeof isLen;
3682
3715
  declare const cairo_isTypeArray: typeof isTypeArray;
@@ -3695,6 +3728,7 @@ declare namespace cairo {
3695
3728
  cairo_Uint as Uint,
3696
3729
  cairo_felt as felt,
3697
3730
  cairo_getArrayType as getArrayType,
3731
+ cairo_isCairo1Abi as isCairo1Abi,
3698
3732
  cairo_isCairo1Type as isCairo1Type,
3699
3733
  cairo_isLen as isLen,
3700
3734
  cairo_isTypeArray as isTypeArray,
@@ -2906,7 +2906,8 @@ var starknet = (() => {
2906
2906
  toBigInt: () => toBigInt,
2907
2907
  toCairoBool: () => toCairoBool,
2908
2908
  toHex: () => toHex,
2909
- toHexString: () => toHexString
2909
+ toHexString: () => toHexString,
2910
+ toStorageKey: () => toStorageKey
2910
2911
  });
2911
2912
 
2912
2913
  // node_modules/@noble/curves/esm/abstract/utils.js
@@ -3126,6 +3127,10 @@ var starknet = (() => {
3126
3127
  function toHex(number3) {
3127
3128
  return addHexPrefix(toBigInt(number3).toString(16));
3128
3129
  }
3130
+ function toStorageKey(number3) {
3131
+ const res = addHexPrefix(toBigInt(number3).toString(16).padStart(64, "0"));
3132
+ return res;
3133
+ }
3129
3134
  function hexToDecimalString(hex) {
3130
3135
  return BigInt(addHexPrefix(hex)).toString(10);
3131
3136
  }
@@ -5608,6 +5613,7 @@ var starknet = (() => {
5608
5613
  Uint: () => Uint,
5609
5614
  felt: () => felt,
5610
5615
  getArrayType: () => getArrayType,
5616
+ isCairo1Abi: () => isCairo1Abi,
5611
5617
  isCairo1Type: () => isCairo1Type,
5612
5618
  isLen: () => isLen,
5613
5619
  isTypeArray: () => isTypeArray,
@@ -5677,6 +5683,19 @@ var starknet = (() => {
5677
5683
  }
5678
5684
  return type.replace("*", "");
5679
5685
  };
5686
+ function isCairo1Abi(abi) {
5687
+ const firstFunction = abi.find((entry) => entry.type === "function");
5688
+ if (!firstFunction) {
5689
+ throw new Error(`Error in ABI. No function in ABI.`);
5690
+ }
5691
+ if (firstFunction.inputs.length) {
5692
+ return isCairo1Type(firstFunction.inputs[0].type);
5693
+ }
5694
+ if (firstFunction.outputs.length) {
5695
+ return isCairo1Type(firstFunction.outputs[0].type);
5696
+ }
5697
+ throw new Error(`Error in ABI. No input/output in function ${firstFunction.name}`);
5698
+ }
5680
5699
  var uint256 = (it) => {
5681
5700
  const bn = BigInt(it);
5682
5701
  if (!isUint256(bn))
@@ -12038,7 +12057,7 @@ var starknet = (() => {
12038
12057
  return this.fetchEndpoint("starknet_getStateUpdate", { block_id });
12039
12058
  }
12040
12059
  async getStorageAt(contractAddress, key, blockIdentifier = this.blockIdentifier) {
12041
- const parsedKey = toHex(key);
12060
+ const parsedKey = toStorageKey(key);
12042
12061
  const block_id = new Block(blockIdentifier).identifier;
12043
12062
  return this.fetchEndpoint("starknet_getStorageAt", {
12044
12063
  contract_address: contractAddress,
@@ -14206,6 +14225,9 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
14206
14225
  calldata
14207
14226
  };
14208
14227
  }
14228
+ isCairo1() {
14229
+ return cairo_exports.isCairo1Abi(this.abi);
14230
+ }
14209
14231
  };
14210
14232
 
14211
14233
  // src/contract/interface.ts