starknet 5.0.0-beta.5 → 5.0.0-beta.6

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,131 +1,85 @@
1
- # [5.0.0-beta.5](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.4...v5.0.0-beta.5) (2023-02-21)
1
+ # [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)
2
2
 
3
3
  ### Bug Fixes
4
4
 
5
- - add utility getter in Block class ([3a52292](https://github.com/0xs34n/starknet.js/commit/3a5229277978c3235eaf1f7003b39eeabecac53e))
6
- - compile response ts type ([4b71970](https://github.com/0xs34n/starknet.js/commit/4b719702d3317af0fa753609e7205bb26416cda0))
7
- - contract related test ([6dfc010](https://github.com/0xs34n/starknet.js/commit/6dfc0102d15c5b4b339aebe25dba8767e63f0187))
8
- - fix merge conflicts from develop ([a8b01e3](https://github.com/0xs34n/starknet.js/commit/a8b01e351bb2d62f98d874d836a3f4046d5e046f))
9
- - invoke contract ([18b6337](https://github.com/0xs34n/starknet.js/commit/18b6337e9e87a9b35d585a68f76896dfe01983c6))
10
- - options split for edge case ([acfab34](https://github.com/0xs34n/starknet.js/commit/acfab34f3cdca670ecd1793954a9bf53104ae4f1))
11
- - post beta merge fixes ([aa6046f](https://github.com/0xs34n/starknet.js/commit/aa6046f2080e5f8c46e4cee7930d851b97312c3f))
12
- - repair decodeShortString for integer strings ([1d6adf0](https://github.com/0xs34n/starknet.js/commit/1d6adf01a64f93b7016d083b81dba4e409371e74))
13
- - strict tuple rule, type bugfix, basic tuple validator ([1c97279](https://github.com/0xs34n/starknet.js/commit/1c9727963d00dc3143af08d7479c040c0d171e5f))
14
- - tests ([85535e5](https://github.com/0xs34n/starknet.js/commit/85535e507cdc8307b4268ce7cef9c9fa4eb3c270))
15
- - transaction status fix ([2cfcb69](https://github.com/0xs34n/starknet.js/commit/2cfcb690f25f0025cd08734e31167c1c969056f9))
16
- - update responseParser & query parameters for sequencer ([a72db02](https://github.com/0xs34n/starknet.js/commit/a72db020aa1ac6924b2c047d067d553ac1b87248))
5
+ - remove hex prefix should work insensitive, for both 0x and 0X ([53323d4](https://github.com/0xs34n/starknet.js/commit/53323d434d5edbeee03c4262935676c950a761d3))
17
6
 
18
7
  ### Features
19
8
 
20
- - add get_block_traces support in sequencer ([b8dec62](https://github.com/0xs34n/starknet.js/commit/b8dec62c06dabcd3b917d6b53f318df2a0a8dfe4))
21
- - add support for get_state_update in provider ([76035a1](https://github.com/0xs34n/starknet.js/commit/76035a148e7863fa1dbe440920eca34498480aa9))
22
- - format arbitrary length array, test edge case tuple arrays ([42357b6](https://github.com/0xs34n/starknet.js/commit/42357b6128e6cc8ebe1067f5a85b0c8704316288))
23
- - implement longText aka. long string into calldata, remove toFelt and resolve circular ref ([da58b5a](https://github.com/0xs34n/starknet.js/commit/da58b5a5a089a7ec82cf37c78f11bd1bf44144ff))
24
- - make compile work with already compiled data, complete test ([7e80837](https://github.com/0xs34n/starknet.js/commit/7e8083728c96efceb7b7163f2fe59293ebd63f04))
25
- - response formatter, refactored call method resturn object ([77ee9f4](https://github.com/0xs34n/starknet.js/commit/77ee9f434fb2ed66703976c97e348663f672fadb))
26
- - response parse tuple, moved to calldata class, test ([dbe04de](https://github.com/0xs34n/starknet.js/commit/dbe04de5ff2d026afeb20c09d1898caae3d6b708))
27
- - update types get_block_traces in sequencer ([2a8d97a](https://github.com/0xs34n/starknet.js/commit/2a8d97a532bb2c9f84436daa2b88abc81a4efa41))
9
+ - move starkname to provider ([8e88ed0](https://github.com/0xs34n/starknet.js/commit/8e88ed0dd9f651dd9decea75dfdae2357e6bfa4a))
28
10
 
29
- # [4.21.0](https://github.com/0xs34n/starknet.js/compare/v4.20.0...v4.21.0) (2023-01-18)
11
+ # [4.22.0](https://github.com/0xs34n/starknet.js/compare/v4.21.1...v4.22.0) (2023-02-22)
30
12
 
31
- ### Bug Fixes
13
+ ### Features
14
+
15
+ - move starkname to provider ([8e88ed0](https://github.com/0xs34n/starknet.js/commit/8e88ed0dd9f651dd9decea75dfdae2357e6bfa4a))
32
16
 
33
- - fix merge conflicts from develop ([a8b01e3](https://github.com/0xs34n/starknet.js/commit/a8b01e351bb2d62f98d874d836a3f4046d5e046f))
17
+ # [5.0.0-beta.5](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.4...v5.0.0-beta.5) (2023-02-21)
34
18
 
35
19
  ### Features
36
20
 
37
- - add get_block_traces support in sequencer ([b8dec62](https://github.com/0xs34n/starknet.js/commit/b8dec62c06dabcd3b917d6b53f318df2a0a8dfe4))
38
- - update types get_block_traces in sequencer ([2a8d97a](https://github.com/0xs34n/starknet.js/commit/2a8d97a532bb2c9f84436daa2b88abc81a4efa41))
21
+ - rework contract interaction API ([2ee199e](https://github.com/0xs34n/starknet.js/commit/2ee199e16c4fa2aa4432816482930a418e41b327))
22
+ - rework waitForTransaction API ([e17ff17](https://github.com/0xs34n/starknet.js/commit/e17ff1744d0ff9f93d7228e48168dc2bbaf63652))
39
23
 
40
- # [4.20.0](https://github.com/0xs34n/starknet.js/compare/v4.19.3...v4.20.0) (2023-01-17)
24
+ ## [4.21.1](https://github.com/0xs34n/starknet.js/compare/v4.21.0...v4.21.1) (2023-02-20)
41
25
 
42
26
  ### Bug Fixes
43
27
 
44
- - add utility getter in Block class ([3a52292](https://github.com/0xs34n/starknet.js/commit/3a5229277978c3235eaf1f7003b39eeabecac53e))
45
- - update responseParser & query parameters for sequencer ([a72db02](https://github.com/0xs34n/starknet.js/commit/a72db020aa1ac6924b2c047d067d553ac1b87248))
28
+ - repair hex prefix removal to be case insensitive ([53323d4](https://github.com/0xs34n/starknet.js/commit/53323d434d5edbeee03c4262935676c950a761d3))
29
+ - repair decodeShortString for integer strings ([1d6adf0](https://github.com/0xs34n/starknet.js/commit/1d6adf01a64f93b7016d083b81dba4e409371e74))
30
+
31
+ # [4.21.0](https://github.com/0xs34n/starknet.js/compare/v4.20.0...v4.21.0) (2023-01-18)
46
32
 
47
33
  ### Features
48
34
 
49
- - add support for get_state_update in provider ([76035a1](https://github.com/0xs34n/starknet.js/commit/76035a148e7863fa1dbe440920eca34498480aa9))
35
+ - add get_block_traces support in sequencer ([b8dec62](https://github.com/0xs34n/starknet.js/commit/b8dec62c06dabcd3b917d6b53f318df2a0a8dfe4))
50
36
 
51
- # [5.0.0-beta.4](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.3...v5.0.0-beta.4) (2023-01-24)
37
+ # [4.20.0](https://github.com/0xs34n/starknet.js/compare/v4.19.3...v4.20.0) (2023-01-17)
52
38
 
53
- ### Bug Fixes
39
+ ### Features
40
+
41
+ - add support for get_state_update in provider ([76035a1](https://github.com/0xs34n/starknet.js/commit/76035a148e7863fa1dbe440920eca34498480aa9))
54
42
 
55
- - tests ([3b34c0c](https://github.com/0xs34n/starknet.js/commit/3b34c0c37c0cca3da087e5ff2a881fba8959bf4e))
56
- - weierstrass import ([c963f90](https://github.com/0xs34n/starknet.js/commit/c963f900cc0f3ffcadce16a704f7b9e592a014e1))
43
+ # [5.0.0-beta.4](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.3...v5.0.0-beta.4) (2023-01-24)
57
44
 
58
45
  ### Features
59
46
 
60
- - add back ec for proper support ([649e0aa](https://github.com/0xs34n/starknet.js/commit/649e0aa032d77ba714fe5cb8d31252590e9eb7f4))
47
+ - expose elliptic curve utility methods ([649e0aa](https://github.com/0xs34n/starknet.js/commit/649e0aa032d77ba714fe5cb8d31252590e9eb7f4))
61
48
  - add public sequencer fetch method ([1dab230](https://github.com/0xs34n/starknet.js/commit/1dab2302d64f5f3f1df84c225a93e6007592090d))
62
- - add tests and make RawArgs more flexible ([db9f274](https://github.com/0xs34n/starknet.js/commit/db9f2745d2f55767acd0b3ded4a028d103a0d249))
63
49
  - allow BigNumberish in RawCallData ([9b897c7](https://github.com/0xs34n/starknet.js/commit/9b897c7fb653ae1830b3795b29bd35c8be8e2d22))
64
- - use ec internally ([3392d03](https://github.com/0xs34n/starknet.js/commit/3392d0362af48f283ff414bc7387586ba44ad9a2))
65
50
 
66
51
  # [5.0.0-beta.3](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.2...v5.0.0-beta.3) (2023-01-13)
67
52
 
68
53
  ### Bug Fixes
69
54
 
70
- - describeIfDevnetSequencer ([4a088ad](https://github.com/0xs34n/starknet.js/commit/4a088ada404ef912976141d8fba1c66d791c273c))
71
- - es6 ([e85ad45](https://github.com/0xs34n/starknet.js/commit/e85ad45c5565d93417b1a18e3663bd6c5e8861c1))
72
- - estimate fee response bulk type ([78a1444](https://github.com/0xs34n/starknet.js/commit/78a14445c75b7ec259d6cfecd1cc17869b507dd8))
73
- - merge develop into feat/add_estimate_fee_bulk ([88e76af](https://github.com/0xs34n/starknet.js/commit/88e76af68dd711b3f277c0a6d4f1935710aba4d7))
74
- - remove any type in simulateTransaction ([a94db18](https://github.com/0xs34n/starknet.js/commit/a94db1887c9fee676ac9b313190453abd5ea2554))
75
55
  - repair and unify transaction retrieval error ([ea5e646](https://github.com/0xs34n/starknet.js/commit/ea5e64651bf47824b254ae73ed8aa88998a5be44))
76
- - tests ([5ab047f](https://github.com/0xs34n/starknet.js/commit/5ab047ff0b272057e70a29e909084d083db36a96))
77
- - update account.simulateTransaction return type ([3c3d397](https://github.com/0xs34n/starknet.js/commit/3c3d397a4fb1042c7358f70f50df0a4ce2893220))
78
- - update getEstimateFeeBulk function ([4b22c82](https://github.com/0xs34n/starknet.js/commit/4b22c8212f4586b37dc7c8ddfad77955e44b1b12))
79
- - update types & add separate responseParser for estimateFeeBulk ([52110b2](https://github.com/0xs34n/starknet.js/commit/52110b289e3dfbbe449cf195709b2714f295a70d))
80
-
81
- ### Features
82
-
83
- - add function estimateInvokeFeeBulk ([e716a18](https://github.com/0xs34n/starknet.js/commit/e716a1882f3ac37d17eae72a51cd3c4fc4649bcb))
84
- - update estimateFeeBulk ([5ee94f7](https://github.com/0xs34n/starknet.js/commit/5ee94f78af681690905e1ead1de711e3a43c0774))
85
- - update estimateFeeBulk function & doc ([ce20139](https://github.com/0xs34n/starknet.js/commit/ce201394142a19c4810a1e44cb3f601b815a11fe))
86
- - update sequencer api ([a12f99e](https://github.com/0xs34n/starknet.js/commit/a12f99ea6e93fb5d44d4d07f7fa8cc2d997db91a))
87
56
 
88
57
  # [5.0.0-beta.2](https://github.com/0xs34n/starknet.js/compare/v5.0.0-beta.1...v5.0.0-beta.2) (2023-01-11)
89
58
 
90
59
  ### Bug Fixes
91
60
 
92
- - bnToUint256 and add more tests ([baa9d61](https://github.com/0xs34n/starknet.js/commit/baa9d611b18725ba269818631f668183212988df))
61
+ - remove the chain id property from the provider interface ([425b223](https://github.com/0xs34n/starknet.js/commit/425b22339118a7c3743ee1de8cc1683d2998bbdc))
62
+ - repair bnToUint256 ([baa9d61](https://github.com/0xs34n/starknet.js/commit/baa9d611b18725ba269818631f668183212988df))
93
63
 
94
- # [5.0.0-beta.1](https://github.com/0xs34n/starknet.js/compare/v4.18.0...v5.0.0-beta.1) (2023-01-07)
95
-
96
- ### Bug Fixes
64
+ ### BREAKING CHANGES
97
65
 
98
- - better ([cda4931](https://github.com/0xs34n/starknet.js/commit/cda49313b17d715463f915f9ec8f1bf7c4de93f2))
99
- - imports ([a151afc](https://github.com/0xs34n/starknet.js/commit/a151afce77eb175e39982fbf8bfcbe25001ee6db))
100
- - imports ([43f0e25](https://github.com/0xs34n/starknet.js/commit/43f0e25f22106da510a0152c65084b1ee677cc6f))
101
- - sequencer fetchEndpoint ([7206d77](https://github.com/0xs34n/starknet.js/commit/7206d776a497cab833f5bf2e00b9f2eb695e3c71))
102
- - **tests:** signature in account tests ([c8bc860](https://github.com/0xs34n/starknet.js/commit/c8bc8604d74d0e0556468afa3475150fe3579e7a))
103
- - trying fixing tests for sequencer ([480e20d](https://github.com/0xs34n/starknet.js/commit/480e20de6b8d3f8eb3048a84430380d73fe46dcc))
104
- - update lockfile ([ecf9ead](https://github.com/0xs34n/starknet.js/commit/ecf9ead06d137bd2b43816a75f66dca0626e9ecd))
105
- - use hex array for RPC signatures ([aa73351](https://github.com/0xs34n/starknet.js/commit/aa73351b024daf75af2bc997b78cbde56de567e9))
66
+ - provider interface chain id property removed
106
67
 
107
- - chore!: account and signer updates ([be0cbe8](https://github.com/0xs34n/starknet.js/commit/be0cbe88b409fa9db20de8125319e10d1e29677e))
68
+ # [5.0.0-beta.1](https://github.com/0xs34n/starknet.js/compare/v4.18.0...v5.0.0-beta.1) (2023-01-07)
108
69
 
109
70
  ### Features
110
71
 
111
- - add computeClassHash functionality ([3f6d88e](https://github.com/0xs34n/starknet.js/commit/3f6d88e00d9620bf2044ecccea6369067f2192d0))
112
- - compute class hash tests ([31a52a2](https://github.com/0xs34n/starknet.js/commit/31a52a28994abb0081fb27a0a7801cf160bcd2ad))
113
- - initial commit to ue faster hashing ([722717d](https://github.com/0xs34n/starknet.js/commit/722717dcf23f6b62a528e58e9483f868f658ebf3))
114
- - initial poc ([eb26fbd](https://github.com/0xs34n/starknet.js/commit/eb26fbddc02d54bb1f9ecf12192f484122ab5df4))
115
- - make class hash optional for Declare Txn ([624ca8b](https://github.com/0xs34n/starknet.js/commit/624ca8b8d1885d9b9a405a31f05d869fdfc03c9c))
116
- - update declareAndDeploy method ([a47fbd5](https://github.com/0xs34n/starknet.js/commit/a47fbd5f523a375b988f912a5631c181e3a7159b))
117
- - use yarn ([ec1101e](https://github.com/0xs34n/starknet.js/commit/ec1101e6edaf53446e76181fa0cf4530befb9463))
72
+ - switch to native BigInt support ([ec56c29](https://github.com/0xs34n/starknet.js/commit/ec56c29672c2e09e00d6ce5d500e4b10b6598269))
118
73
 
119
74
  ### BREAKING CHANGES
120
75
 
121
- - uses BigInt and Faster Hashing
76
+ - multiple BN values replaced by BigInt
122
77
 
123
78
  ## [4.19.3](https://github.com/0xs34n/starknet.js/compare/v4.19.2...v4.19.3) (2023-01-12)
124
79
 
125
- ### Bug Fixes
80
+ ### Features
126
81
 
127
- - remove any type in simulateTransaction ([a94db18](https://github.com/0xs34n/starknet.js/commit/a94db1887c9fee676ac9b313190453abd5ea2554))
128
- - update account.simulateTransaction return type ([3c3d397](https://github.com/0xs34n/starknet.js/commit/3c3d397a4fb1042c7358f70f50df0a4ce2893220))
82
+ - move the simulateTransaction method to the Account class ([be7b792](https://github.com/0xs34n/starknet.js/commit/be7b79272a13a9ec9986485d51526846c6954092))
129
83
 
130
84
  ## [4.19.2](https://github.com/0xs34n/starknet.js/compare/v4.19.1...v4.19.2) (2023-01-11)
131
85
 
@@ -137,32 +91,16 @@
137
91
 
138
92
  ### Bug Fixes
139
93
 
140
- - describeIfDevnetSequencer ([4a088ad](https://github.com/0xs34n/starknet.js/commit/4a088ada404ef912976141d8fba1c66d791c273c))
141
- - es6 ([e85ad45](https://github.com/0xs34n/starknet.js/commit/e85ad45c5565d93417b1a18e3663bd6c5e8861c1))
142
- - estimate fee response bulk type ([78a1444](https://github.com/0xs34n/starknet.js/commit/78a14445c75b7ec259d6cfecd1cc17869b507dd8))
143
- - tests ([5ab047f](https://github.com/0xs34n/starknet.js/commit/5ab047ff0b272057e70a29e909084d083db36a96))
94
+ - rework estimateFeeBulk return type ([084d89e](https://github.com/0xs34n/starknet.js/commit/084d89e120108d0e63625b4e33729713df6d9632))
144
95
 
145
96
  # [4.19.0](https://github.com/0xs34n/starknet.js/compare/v4.18.0...v4.19.0) (2023-01-09)
146
97
 
147
- ### Bug Fixes
148
-
149
- - merge develop into feat/add_estimate_fee_bulk ([88e76af](https://github.com/0xs34n/starknet.js/commit/88e76af68dd711b3f277c0a6d4f1935710aba4d7))
150
- - update getEstimateFeeBulk function ([4b22c82](https://github.com/0xs34n/starknet.js/commit/4b22c8212f4586b37dc7c8ddfad77955e44b1b12))
151
- - update types & add separate responseParser for estimateFeeBulk ([52110b2](https://github.com/0xs34n/starknet.js/commit/52110b289e3dfbbe449cf195709b2714f295a70d))
152
-
153
98
  ### Features
154
99
 
155
- - add function estimateInvokeFeeBulk ([e716a18](https://github.com/0xs34n/starknet.js/commit/e716a1882f3ac37d17eae72a51cd3c4fc4649bcb))
156
- - update estimateFeeBulk ([5ee94f7](https://github.com/0xs34n/starknet.js/commit/5ee94f78af681690905e1ead1de711e3a43c0774))
157
- - update estimateFeeBulk function & doc ([ce20139](https://github.com/0xs34n/starknet.js/commit/ce201394142a19c4810a1e44cb3f601b815a11fe))
158
- - update sequencer api ([a12f99e](https://github.com/0xs34n/starknet.js/commit/a12f99ea6e93fb5d44d4d07f7fa8cc2d997db91a))
100
+ - add estimate_fee_bulk support ([1352e78](https://github.com/0xs34n/starknet.js/commit/1352e78523941a8b8c9e878be96134e8bb99c4eb))
159
101
 
160
102
  # [4.18.0](https://github.com/0xs34n/starknet.js/compare/v4.17.1...v4.18.0) (2022-12-23)
161
103
 
162
- ### Bug Fixes
163
-
164
- - merge develop into branch ([21efcb1](https://github.com/0xs34n/starknet.js/commit/21efcb1cefd6ea70a9d49e060ff620e88002e3b6))
165
-
166
104
  ### Features
167
105
 
168
106
  - simulate_transaction support on sequencer ([304c3cc](https://github.com/0xs34n/starknet.js/commit/304c3cc1af81bc8810581546f043caca01db173b))
@@ -179,14 +117,9 @@
179
117
 
180
118
  # [4.17.0](https://github.com/0xs34n/starknet.js/compare/v4.16.0...v4.17.0) (2022-12-13)
181
119
 
182
- ### Bug Fixes
183
-
184
- - merge conflicts ([92a3be8](https://github.com/0xs34n/starknet.js/commit/92a3be8500153d4b87b888f454bb4140edb88411))
185
-
186
120
  ### Features
187
121
 
188
122
  - contract factory deploy arguments ([9eff7f4](https://github.com/0xs34n/starknet.js/commit/9eff7f4ccc74cb5f0c0594e88c0292600f20ec09))
189
- - update contractFactory docs ([76f8440](https://github.com/0xs34n/starknet.js/commit/76f8440233c4a1e24e3dfff25fe02525e86a8258))
190
123
 
191
124
  # [4.16.0](https://github.com/0xs34n/starknet.js/compare/v4.15.1...v4.16.0) (2022-12-12)
192
125
 
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  </p>
5
5
 
6
6
  <!-- tag line -->
7
- <h4 align='center'> JavaScript library for StarkNet.</h4>
7
+ <h4 align='center'> JavaScript library for Starknet.</h4>
8
8
 
9
9
  <!-- primary badges -->
10
10
  <p align="center">
@@ -50,7 +50,7 @@ Import `starknet` and use the [API](https://www.starknetjs.com/docs/API/)
50
50
 
51
51
  Please refer to the following code example [here](https://github.com/0xs34n/starknet.js-workshop)
52
52
 
53
- Guides can be found [here](https://www.starknetjs.com/guides/intro)
53
+ Guides can be found [here](https://www.starknetjs.com/docs/guides/intro)
54
54
 
55
55
  ## 🌐 API
56
56
 
package/dist/index.d.ts CHANGED
@@ -70,9 +70,9 @@ declare namespace number {
70
70
  /**
71
71
  * Starknet RPC version 0.2.0
72
72
  *
73
- * StarkNet Node API 0.45.0 - rpc 0.2.1
74
- * StarkNet Node Write API 0.3.0 - rpc 0.2.1
75
- * StarkNet Trace API 0.4.0 - rpc 0.2.1
73
+ * Starknet Node API 0.45.0 - rpc 0.2.1
74
+ * Starknet Node Write API 0.3.0 - rpc 0.2.1
75
+ * Starknet Trace API 0.4.0 - rpc 0.2.1
76
76
  *
77
77
  * TypeScript Representation of OpenRpc protocol types
78
78
  */
@@ -1568,7 +1568,7 @@ declare abstract class ProviderInterface {
1568
1568
  */
1569
1569
  abstract getChainId(): Promise<StarknetChainId>;
1570
1570
  /**
1571
- * Calls a function on the StarkNet contract.
1571
+ * Calls a function on the Starknet contract.
1572
1572
  *
1573
1573
  * @param call transaction to be called
1574
1574
  * @param blockIdentifier block identifier
@@ -1862,6 +1862,8 @@ declare class RpcProvider implements ProviderInterface {
1862
1862
  */
1863
1863
  getEvents(eventFilter: RPC.EventFilter): Promise<RPC.GetEventsResponse>;
1864
1864
  getSimulateTransaction(_invocation: Invocation, _invocationDetails: InvocationsDetailsWithNonce, _blockIdentifier?: BlockIdentifier): Promise<TransactionSimulationResponse>;
1865
+ getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise<string>;
1866
+ getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string>;
1865
1867
  }
1866
1868
 
1867
1869
  declare type SequencerHttpMethod = 'POST' | 'GET';
@@ -1945,6 +1947,8 @@ declare class SequencerProvider implements ProviderInterface {
1945
1947
  getSimulateTransaction(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<TransactionSimulationResponse>;
1946
1948
  getStateUpdate(blockIdentifier?: BlockIdentifier): Promise<StateUpdateResponse>;
1947
1949
  getBlockTraces(blockIdentifier?: BlockIdentifier): Promise<Sequencer.BlockTransactionTracesResponse>;
1950
+ getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise<string>;
1951
+ getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string>;
1948
1952
  }
1949
1953
 
1950
1954
  interface ProviderOptions {
@@ -1976,6 +1980,8 @@ declare class Provider implements ProviderInterface {
1976
1980
  waitForTransaction(txHash: BigNumberish, options: waitForTransactionOptions): Promise<GetTransactionReceiptResponse>;
1977
1981
  getSimulateTransaction(invocation: Invocation, invocationDetails: InvocationsDetailsWithNonce, blockIdentifier?: BlockIdentifier): Promise<TransactionSimulationResponse>;
1978
1982
  getStateUpdate(blockIdentifier?: BlockIdentifier): Promise<StateUpdateResponse>;
1983
+ getStarkName(address: BigNumberish, StarknetIdContract?: string): Promise<string>;
1984
+ getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string>;
1979
1985
  }
1980
1986
 
1981
1987
  declare class LibraryError extends CustomError {
@@ -2439,8 +2445,7 @@ declare class Account extends Provider implements AccountInterface {
2439
2445
  address: string;
2440
2446
  constructor(providerOrOptions: ProviderOptions | ProviderInterface, address: string, pkOrSigner: Uint8Array | string | SignerInterface);
2441
2447
  getNonce(blockIdentifier?: BlockIdentifier): Promise<BigNumberish>;
2442
- getStarkName(StarknetIdContract?: string): Promise<string | Error>;
2443
- getAddressFromStarkName(name: string, StarknetIdContract?: string): Promise<string | Error>;
2448
+ estimateFee(calls: AllowArray<Call>, estimateFeeDetails?: EstimateFeeDetails | undefined): Promise<EstimateFee>;
2444
2449
  estimateInvokeFee(calls: AllowArray<Call>, { nonce: providedNonce, blockIdentifier }?: EstimateFeeDetails): Promise<EstimateFee>;
2445
2450
  estimateDeclareFee({ contract, classHash: providedClassHash }: DeclareContractPayload, { blockIdentifier, nonce: providedNonce }?: EstimateFeeDetails): Promise<EstimateFee>;
2446
2451
  estimateAccountDeployFee({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { blockIdentifier }?: EstimateFeeDetails): Promise<EstimateFee>;
@@ -2462,6 +2467,8 @@ declare class Account extends Provider implements AccountInterface {
2462
2467
  buildAccountDeployPayload({ classHash, addressSalt, constructorCalldata, contractAddress: providedContractAddress, }: DeployAccountContractPayload, { nonce, chainId, version, maxFee }: InvocationsSignerDetails): Promise<DeployAccountContractTransaction>;
2463
2468
  buildUDCContractPayload(payload: UniversalDeployerContractPayload | UniversalDeployerContractPayload[]): Call[];
2464
2469
  simulateTransaction(calls: AllowArray<Call>, { nonce: providedNonce, blockIdentifier }?: EstimateFeeDetails): Promise<TransactionSimulation>;
2470
+ getStarkName(address?: BigNumberish, // default to the wallet address
2471
+ StarknetIdContract?: string): Promise<string>;
2465
2472
  }
2466
2473
 
2467
2474
  declare type CallOptions = {
@@ -12327,6 +12327,143 @@ var starknet = (() => {
12327
12327
  }
12328
12328
  };
12329
12329
 
12330
+ // src/utils/starknetId.ts
12331
+ var basicAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-";
12332
+ var basicSizePlusOne = BigInt(basicAlphabet.length + 1);
12333
+ var bigAlphabet = "\u8FD9\u6765";
12334
+ var basicAlphabetSize = BigInt(basicAlphabet.length);
12335
+ var bigAlphabetSize = BigInt(bigAlphabet.length);
12336
+ var bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1);
12337
+ function extractStars(str) {
12338
+ let k = 0;
12339
+ while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) {
12340
+ str = str.substring(0, str.length - 1);
12341
+ k += 1;
12342
+ }
12343
+ return [str, k];
12344
+ }
12345
+ function useDecoded(encoded) {
12346
+ let decoded = "";
12347
+ encoded.forEach((subdomain) => {
12348
+ while (subdomain !== ZERO) {
12349
+ const code = subdomain % basicSizePlusOne;
12350
+ subdomain /= basicSizePlusOne;
12351
+ if (code === BigInt(basicAlphabet.length)) {
12352
+ const nextSubdomain = subdomain / bigAlphabetSizePlusOne;
12353
+ if (nextSubdomain === ZERO) {
12354
+ const code2 = subdomain % bigAlphabetSizePlusOne;
12355
+ subdomain = nextSubdomain;
12356
+ if (code2 === ZERO)
12357
+ decoded += basicAlphabet[0];
12358
+ else
12359
+ decoded += bigAlphabet[Number(code2) - 1];
12360
+ } else {
12361
+ const code2 = subdomain % bigAlphabetSize;
12362
+ decoded += bigAlphabet[Number(code2)];
12363
+ subdomain /= bigAlphabetSize;
12364
+ }
12365
+ } else
12366
+ decoded += basicAlphabet[Number(code)];
12367
+ }
12368
+ const [str, k] = extractStars(decoded);
12369
+ if (k)
12370
+ decoded = str + (k % 2 === 0 ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) + bigAlphabet[0] + basicAlphabet[1] : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1));
12371
+ decoded += ".";
12372
+ });
12373
+ if (!decoded) {
12374
+ return decoded;
12375
+ }
12376
+ return decoded.concat("stark");
12377
+ }
12378
+ function useEncoded(decoded) {
12379
+ let encoded = BigInt(0);
12380
+ let multiplier = BigInt(1);
12381
+ if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) {
12382
+ const [str, k] = extractStars(decoded.substring(0, decoded.length - 2));
12383
+ decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1));
12384
+ } else {
12385
+ const [str, k] = extractStars(decoded);
12386
+ if (k)
12387
+ decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1));
12388
+ }
12389
+ for (let i = 0; i < decoded.length; i += 1) {
12390
+ const char = decoded[i];
12391
+ const index = basicAlphabet.indexOf(char);
12392
+ const bnIndex = BigInt(basicAlphabet.indexOf(char));
12393
+ if (index !== -1) {
12394
+ if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) {
12395
+ encoded += multiplier * basicAlphabetSize;
12396
+ multiplier *= basicSizePlusOne;
12397
+ multiplier *= basicSizePlusOne;
12398
+ } else {
12399
+ encoded += multiplier * bnIndex;
12400
+ multiplier *= basicSizePlusOne;
12401
+ }
12402
+ } else if (bigAlphabet.indexOf(char) !== -1) {
12403
+ encoded += multiplier * basicAlphabetSize;
12404
+ multiplier *= basicSizePlusOne;
12405
+ const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char);
12406
+ encoded += multiplier * BigInt(newid);
12407
+ multiplier *= bigAlphabetSize;
12408
+ }
12409
+ }
12410
+ return encoded;
12411
+ }
12412
+ function getStarknetIdContract(chainId) {
12413
+ const starknetIdMainnetContract = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678";
12414
+ const starknetIdTestnetContract = "0x05cf267a0af6101667013fc6bd3f6c11116a14cda9b8c4b1198520d59f900b17";
12415
+ switch (chainId) {
12416
+ case "0x534e5f4d41494e" /* SN_MAIN */:
12417
+ return starknetIdMainnetContract;
12418
+ case "0x534e5f474f45524c49" /* SN_GOERLI */:
12419
+ return starknetIdTestnetContract;
12420
+ default:
12421
+ throw new Error("Starknet.id is not yet deployed on this network");
12422
+ }
12423
+ }
12424
+
12425
+ // src/provider/starknetId.ts
12426
+ async function getStarkName(provider, address, StarknetIdContract) {
12427
+ const chainId = await provider.getChainId();
12428
+ const contract = StarknetIdContract ?? getStarknetIdContract(chainId);
12429
+ try {
12430
+ const hexDomain = await provider.callContract({
12431
+ contractAddress: contract,
12432
+ entrypoint: "address_to_domain",
12433
+ calldata: compileCalldata({
12434
+ address
12435
+ })
12436
+ });
12437
+ const decimalDomain = hexDomain.result.map((element) => BigInt(element)).slice(1);
12438
+ const stringDomain = useDecoded(decimalDomain);
12439
+ if (!stringDomain) {
12440
+ throw Error("Starkname not found");
12441
+ }
12442
+ return stringDomain;
12443
+ } catch (e) {
12444
+ if (e instanceof Error && e.message === "Starkname not found") {
12445
+ throw e;
12446
+ }
12447
+ throw Error("Could not get stark name");
12448
+ }
12449
+ }
12450
+ async function getAddressFromStarkName(provider, name, StarknetIdContract) {
12451
+ const chainId = await provider.getChainId();
12452
+ const contract = StarknetIdContract ?? getStarknetIdContract(chainId);
12453
+ try {
12454
+ const addressData = await provider.callContract({
12455
+ contractAddress: contract,
12456
+ entrypoint: "domain_to_address",
12457
+ calldata: compileCalldata({
12458
+ domain: [useEncoded(name.replace(".stark", "")).toString(10)]
12459
+ })
12460
+ });
12461
+ return addressData.result[0];
12462
+ } catch {
12463
+ throw Error("Could not get address from stark name");
12464
+ }
12465
+ }
12466
+
12330
12467
  // src/provider/utils.ts
12331
12468
  var validBlockTags = ["latest", "pending"];
12332
12469
  var Block = class {
@@ -12675,6 +12812,12 @@ var starknet = (() => {
12675
12812
  async getSimulateTransaction(_invocation, _invocationDetails, _blockIdentifier) {
12676
12813
  throw new Error("RPC does not implement simulateTransaction function");
12677
12814
  }
12815
+ async getStarkName(address, StarknetIdContract) {
12816
+ return getStarkName(this, address, StarknetIdContract);
12817
+ }
12818
+ async getAddressFromStarkName(name, StarknetIdContract) {
12819
+ return getAddressFromStarkName(this, name, StarknetIdContract);
12820
+ }
12678
12821
  };
12679
12822
 
12680
12823
  // src/provider/sequencer.ts
@@ -13244,6 +13387,12 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
13244
13387
  const args = new Block(blockIdentifier).sequencerIdentifier;
13245
13388
  return this.fetchEndpoint("get_block_traces", { ...args });
13246
13389
  }
13390
+ async getStarkName(address, StarknetIdContract) {
13391
+ return getStarkName(this, address, StarknetIdContract);
13392
+ }
13393
+ async getAddressFromStarkName(name, StarknetIdContract) {
13394
+ return getAddressFromStarkName(this, name, StarknetIdContract);
13395
+ }
13247
13396
  };
13248
13397
 
13249
13398
  // src/provider/default.ts
@@ -13331,6 +13480,12 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
13331
13480
  async getStateUpdate(blockIdentifier) {
13332
13481
  return this.provider.getStateUpdate(blockIdentifier);
13333
13482
  }
13483
+ async getStarkName(address, StarknetIdContract) {
13484
+ return getStarkName(this, address, StarknetIdContract);
13485
+ }
13486
+ async getAddressFromStarkName(name, StarknetIdContract) {
13487
+ return getAddressFromStarkName(this, name, StarknetIdContract);
13488
+ }
13334
13489
  };
13335
13490
 
13336
13491
  // src/provider/interface.ts
@@ -14339,98 +14494,6 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
14339
14494
  };
14340
14495
  }
14341
14496
 
14342
- // src/utils/starknetId.ts
14343
- var basicAlphabet = "abcdefghijklmnopqrstuvwxyz0123456789-";
14344
- var basicSizePlusOne = BigInt(basicAlphabet.length + 1);
14345
- var bigAlphabet = "\u8FD9\u6765";
14346
- var basicAlphabetSize = BigInt(basicAlphabet.length);
14347
- var bigAlphabetSize = BigInt(bigAlphabet.length);
14348
- var bigAlphabetSizePlusOne = BigInt(bigAlphabet.length + 1);
14349
- function extractStars(str) {
14350
- let k = 0;
14351
- while (str.endsWith(bigAlphabet[bigAlphabet.length - 1])) {
14352
- str = str.substring(0, str.length - 1);
14353
- k += 1;
14354
- }
14355
- return [str, k];
14356
- }
14357
- function useDecoded(encoded) {
14358
- let decoded = "";
14359
- encoded.forEach((subdomain) => {
14360
- while (subdomain !== ZERO) {
14361
- const code = subdomain % basicSizePlusOne;
14362
- subdomain /= basicSizePlusOne;
14363
- if (code === BigInt(basicAlphabet.length)) {
14364
- const nextSubdomain = subdomain / bigAlphabetSizePlusOne;
14365
- if (nextSubdomain === ZERO) {
14366
- const code2 = subdomain % bigAlphabetSizePlusOne;
14367
- subdomain = nextSubdomain;
14368
- if (code2 === ZERO)
14369
- decoded += basicAlphabet[0];
14370
- else
14371
- decoded += bigAlphabet[Number(code2) - 1];
14372
- } else {
14373
- const code2 = subdomain % bigAlphabetSize;
14374
- decoded += bigAlphabet[Number(code2)];
14375
- subdomain /= bigAlphabetSize;
14376
- }
14377
- } else
14378
- decoded += basicAlphabet[Number(code)];
14379
- }
14380
- const [str, k] = extractStars(decoded);
14381
- if (k)
14382
- decoded = str + (k % 2 === 0 ? bigAlphabet[bigAlphabet.length - 1].repeat(k / 2 - 1) + bigAlphabet[0] + basicAlphabet[1] : bigAlphabet[bigAlphabet.length - 1].repeat((k - 1) / 2 + 1));
14383
- decoded += ".";
14384
- });
14385
- return decoded.concat("stark");
14386
- }
14387
- function useEncoded(decoded) {
14388
- let encoded = BigInt(0);
14389
- let multiplier = BigInt(1);
14390
- if (decoded.endsWith(bigAlphabet[0] + basicAlphabet[1])) {
14391
- const [str, k] = extractStars(decoded.substring(0, decoded.length - 2));
14392
- decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(2 * (k + 1));
14393
- } else {
14394
- const [str, k] = extractStars(decoded);
14395
- if (k)
14396
- decoded = str + bigAlphabet[bigAlphabet.length - 1].repeat(1 + 2 * (k - 1));
14397
- }
14398
- for (let i = 0; i < decoded.length; i += 1) {
14399
- const char = decoded[i];
14400
- const index = basicAlphabet.indexOf(char);
14401
- const bnIndex = BigInt(basicAlphabet.indexOf(char));
14402
- if (index !== -1) {
14403
- if (i === decoded.length - 1 && decoded[i] === basicAlphabet[0]) {
14404
- encoded += multiplier * basicAlphabetSize;
14405
- multiplier *= basicSizePlusOne;
14406
- multiplier *= basicSizePlusOne;
14407
- } else {
14408
- encoded += multiplier * bnIndex;
14409
- multiplier *= basicSizePlusOne;
14410
- }
14411
- } else if (bigAlphabet.indexOf(char) !== -1) {
14412
- encoded += multiplier * basicAlphabetSize;
14413
- multiplier *= basicSizePlusOne;
14414
- const newid = (i === decoded.length - 1 ? 1 : 0) + bigAlphabet.indexOf(char);
14415
- encoded += multiplier * BigInt(newid);
14416
- multiplier *= bigAlphabetSize;
14417
- }
14418
- }
14419
- return encoded;
14420
- }
14421
- function getStarknetIdContract(chainId) {
14422
- const starknetIdMainnetContract = "0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678";
14423
- const starknetIdTestnetContract = "0x05cf267a0af6101667013fc6bd3f6c11116a14cda9b8c4b1198520d59f900b17";
14424
- switch (chainId) {
14425
- case "0x534e5f4d41494e" /* SN_MAIN */:
14426
- return starknetIdMainnetContract;
14427
- case "0x534e5f474f45524c49" /* SN_GOERLI */:
14428
- return starknetIdTestnetContract;
14429
- default:
14430
- throw new Error("Starknet.id is not yet deployed on this network");
14431
- }
14432
- }
14433
-
14434
14497
  // src/account/default.ts
14435
14498
  var Account = class extends Provider {
14436
14499
  constructor(providerOrOptions, address, pkOrSigner) {
@@ -14441,39 +14504,8 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
14441
14504
  async getNonce(blockIdentifier) {
14442
14505
  return super.getNonceForAddress(this.address, blockIdentifier);
14443
14506
  }
14444
- async getStarkName(StarknetIdContract) {
14445
- const chainId = await this.getChainId();
14446
- const contract = StarknetIdContract ?? getStarknetIdContract(chainId);
14447
- try {
14448
- const hexDomain = await this.callContract({
14449
- contractAddress: contract,
14450
- entrypoint: "address_to_domain",
14451
- calldata: compileCalldata({
14452
- address: this.address
14453
- })
14454
- });
14455
- const decimalDomain = hexDomain.result.map((element) => toBigInt(element)).slice(1);
14456
- const stringDomain = useDecoded(decimalDomain);
14457
- return stringDomain;
14458
- } catch {
14459
- return Error("Could not get stark name");
14460
- }
14461
- }
14462
- async getAddressFromStarkName(name, StarknetIdContract) {
14463
- const chainId = await this.getChainId();
14464
- const contract = StarknetIdContract ?? getStarknetIdContract(chainId);
14465
- try {
14466
- const addressData = await this.callContract({
14467
- contractAddress: contract,
14468
- entrypoint: "domain_to_address",
14469
- calldata: compileCalldata({
14470
- domain: [useEncoded(name.replace(".stark", "")).toString(10)]
14471
- })
14472
- });
14473
- return addressData.result[0];
14474
- } catch {
14475
- return Error("Could not get address from stark name");
14476
- }
14507
+ async estimateFee(calls, estimateFeeDetails) {
14508
+ return this.estimateInvokeFee(calls, estimateFeeDetails);
14477
14509
  }
14478
14510
  async estimateInvokeFee(calls, { nonce: providedNonce, blockIdentifier } = {}) {
14479
14511
  const transactions = Array.isArray(calls) ? calls : [calls];
@@ -14907,6 +14939,9 @@ ${res.tx_failure_reason.error_message}` : res.tx_status;
14907
14939
  }
14908
14940
  };
14909
14941
  }
14942
+ async getStarkName(address = this.address, StarknetIdContract) {
14943
+ return super.getStarkName(address, StarknetIdContract);
14944
+ }
14910
14945
  };
14911
14946
 
14912
14947
  // src/account/interface.ts