starknet 6.9.0 → 6.10.1

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.
Files changed (315) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +1 -1
  3. package/README.md +5 -9
  4. package/dist/account/default.cjs +655 -0
  5. package/dist/account/default.d.ts +67 -0
  6. package/dist/account/default.mjs +652 -0
  7. package/dist/account/index.cjs +27 -0
  8. package/dist/account/index.d.ts +2 -0
  9. package/dist/account/index.mjs +2 -0
  10. package/dist/account/interface.cjs +9 -0
  11. package/dist/account/interface.d.ts +301 -0
  12. package/dist/account/interface.mjs +3 -0
  13. package/dist/channel/index.cjs +27 -0
  14. package/dist/channel/index.d.ts +3 -0
  15. package/dist/channel/index.mjs +3 -0
  16. package/dist/channel/rpc_0_6.cjs +607 -0
  17. package/dist/channel/rpc_0_6.d.ts +78 -0
  18. package/dist/channel/rpc_0_6.mjs +543 -0
  19. package/dist/channel/rpc_0_7.cjs +619 -0
  20. package/dist/channel/rpc_0_7.d.ts +81 -0
  21. package/dist/channel/rpc_0_7.mjs +561 -0
  22. package/dist/constants.cjs +76 -0
  23. package/dist/constants.d.ts +70 -0
  24. package/dist/constants.mjs +60 -0
  25. package/dist/contract/contractFactory.cjs +93 -0
  26. package/dist/contract/contractFactory.d.ts +46 -0
  27. package/dist/contract/contractFactory.mjs +83 -0
  28. package/dist/contract/default.cjs +269 -0
  29. package/dist/contract/default.d.ts +58 -0
  30. package/dist/contract/default.mjs +254 -0
  31. package/dist/contract/index.cjs +38 -0
  32. package/dist/contract/index.d.ts +3 -0
  33. package/dist/contract/index.mjs +3 -0
  34. package/dist/contract/interface.cjs +13 -0
  35. package/dist/contract/interface.d.ts +128 -0
  36. package/dist/contract/interface.mjs +6 -0
  37. package/dist/index.cjs +267 -0
  38. package/dist/index.d.ts +45 -5991
  39. package/dist/index.global.js +728 -609
  40. package/dist/index.global.js.map +1 -1
  41. package/dist/index.mjs +39 -7320
  42. package/dist/provider/errors.cjs +50 -0
  43. package/dist/provider/errors.d.ts +16 -0
  44. package/dist/provider/errors.mjs +35 -0
  45. package/dist/provider/extensions/default.cjs +11 -0
  46. package/dist/provider/extensions/default.d.ts +6 -0
  47. package/dist/provider/extensions/default.mjs +5 -0
  48. package/dist/provider/extensions/starknetId.cjs +174 -0
  49. package/dist/provider/extensions/starknetId.d.ts +10 -0
  50. package/dist/provider/extensions/starknetId.mjs +230 -0
  51. package/dist/provider/index.cjs +56 -0
  52. package/dist/provider/index.d.ts +6 -0
  53. package/dist/provider/index.mjs +6 -0
  54. package/dist/provider/interface.cjs +8 -0
  55. package/dist/provider/interface.d.ts +261 -0
  56. package/dist/provider/interface.mjs +2 -0
  57. package/dist/provider/rpc.cjs +301 -0
  58. package/dist/provider/rpc.d.ts +115 -0
  59. package/dist/provider/rpc.mjs +302 -0
  60. package/dist/service/types.cjs +1 -0
  61. package/dist/service/types.d.ts +5 -0
  62. package/dist/service/types.mjs +0 -0
  63. package/dist/signer/default.cjs +105 -0
  64. package/dist/signer/default.d.ts +12 -0
  65. package/dist/signer/default.mjs +102 -0
  66. package/dist/signer/ethSigner.cjs +123 -0
  67. package/dist/signer/ethSigner.d.ts +25 -0
  68. package/dist/signer/ethSigner.mjs +140 -0
  69. package/dist/signer/index.cjs +38 -0
  70. package/dist/signer/index.d.ts +3 -0
  71. package/dist/signer/index.mjs +3 -0
  72. package/dist/signer/interface.cjs +8 -0
  73. package/dist/signer/interface.d.ts +115 -0
  74. package/dist/signer/interface.mjs +2 -0
  75. package/dist/types/account.cjs +1 -0
  76. package/dist/types/account.d.ts +79 -0
  77. package/dist/types/account.mjs +0 -0
  78. package/dist/types/api/index.cjs +30 -0
  79. package/dist/types/api/index.d.ts +4 -0
  80. package/dist/types/api/index.mjs +4 -0
  81. package/dist/types/api/jsonrpc/index.cjs +1 -0
  82. package/dist/types/api/jsonrpc/index.d.ts +21 -0
  83. package/dist/types/api/jsonrpc/index.mjs +0 -0
  84. package/dist/types/api/rpcspec_0_6/components.cjs +1 -0
  85. package/dist/types/api/rpcspec_0_6/components.d.ts +541 -0
  86. package/dist/types/api/rpcspec_0_6/components.mjs +0 -0
  87. package/dist/types/api/rpcspec_0_6/contract.cjs +1 -0
  88. package/dist/types/api/rpcspec_0_6/contract.d.ts +85 -0
  89. package/dist/types/api/rpcspec_0_6/contract.mjs +0 -0
  90. package/dist/types/api/rpcspec_0_6/errors.cjs +1 -0
  91. package/dist/types/api/rpcspec_0_6/errors.d.ts +128 -0
  92. package/dist/types/api/rpcspec_0_6/errors.mjs +0 -0
  93. package/dist/types/api/rpcspec_0_6/index.cjs +45 -0
  94. package/dist/types/api/rpcspec_0_6/index.d.ts +8 -0
  95. package/dist/types/api/rpcspec_0_6/index.mjs +5 -0
  96. package/dist/types/api/rpcspec_0_6/methods.cjs +1 -0
  97. package/dist/types/api/rpcspec_0_6/methods.d.ts +207 -0
  98. package/dist/types/api/rpcspec_0_6/methods.mjs +0 -0
  99. package/dist/types/api/rpcspec_0_6/nonspec.cjs +65 -0
  100. package/dist/types/api/rpcspec_0_6/nonspec.d.ts +147 -0
  101. package/dist/types/api/rpcspec_0_6/nonspec.mjs +59 -0
  102. package/dist/types/cairoEnum.cjs +1 -0
  103. package/dist/types/cairoEnum.d.ts +2 -0
  104. package/dist/types/cairoEnum.mjs +0 -0
  105. package/dist/types/calldata.cjs +27 -0
  106. package/dist/types/calldata.d.ts +23 -0
  107. package/dist/types/calldata.mjs +21 -0
  108. package/dist/types/contract.cjs +1 -0
  109. package/dist/types/contract.d.ts +27 -0
  110. package/dist/types/contract.mjs +0 -0
  111. package/dist/types/helpers/valuesType.cjs +1 -0
  112. package/dist/types/helpers/valuesType.d.ts +1 -0
  113. package/dist/types/helpers/valuesType.mjs +0 -0
  114. package/dist/types/index.cjs +121 -0
  115. package/dist/types/index.d.ts +10 -0
  116. package/dist/types/index.mjs +10 -0
  117. package/dist/types/lib/contract/abi.cjs +1 -0
  118. package/dist/types/lib/contract/abi.d.ts +71 -0
  119. package/dist/types/lib/contract/abi.mjs +0 -0
  120. package/dist/types/lib/contract/index.cjs +50 -0
  121. package/dist/types/lib/contract/index.d.ts +26 -0
  122. package/dist/types/lib/contract/index.mjs +8 -0
  123. package/dist/types/lib/contract/legacy.cjs +1 -0
  124. package/dist/types/lib/contract/legacy.d.ts +33 -0
  125. package/dist/types/lib/contract/legacy.mjs +0 -0
  126. package/dist/types/lib/contract/sierra.cjs +1 -0
  127. package/dist/types/lib/contract/sierra.d.ts +52 -0
  128. package/dist/types/lib/contract/sierra.mjs +0 -0
  129. package/dist/types/lib/index.cjs +61 -0
  130. package/dist/types/lib/index.d.ts +259 -0
  131. package/dist/types/lib/index.mjs +36 -0
  132. package/dist/types/provider/configuration.cjs +1 -0
  133. package/dist/types/provider/configuration.d.ts +20 -0
  134. package/dist/types/provider/configuration.mjs +0 -0
  135. package/dist/types/provider/index.cjs +27 -0
  136. package/dist/types/provider/index.d.ts +2 -0
  137. package/dist/types/provider/index.mjs +2 -0
  138. package/dist/types/provider/response.cjs +30 -0
  139. package/dist/types/provider/response.d.ts +98 -0
  140. package/dist/types/provider/response.mjs +1 -0
  141. package/dist/types/provider/spec.cjs +1 -0
  142. package/dist/types/provider/spec.d.ts +49 -0
  143. package/dist/types/provider/spec.mjs +0 -0
  144. package/dist/types/signer.cjs +1 -0
  145. package/dist/types/signer.d.ts +49 -0
  146. package/dist/types/signer.mjs +0 -0
  147. package/dist/types/transactionReceipt.cjs +1 -0
  148. package/dist/types/transactionReceipt.d.ts +23 -0
  149. package/dist/types/transactionReceipt.mjs +0 -0
  150. package/dist/types/typedData.cjs +12 -0
  151. package/dist/types/typedData.d.ts +1 -0
  152. package/dist/types/typedData.mjs +3 -0
  153. package/dist/utils/address.cjs +44 -0
  154. package/dist/utils/address.d.ts +55 -0
  155. package/dist/utils/address.mjs +35 -0
  156. package/dist/utils/assert.cjs +11 -0
  157. package/dist/utils/assert.d.ts +12 -0
  158. package/dist/utils/assert.mjs +5 -0
  159. package/dist/utils/cairoDataTypes/felt.cjs +31 -0
  160. package/dist/utils/cairoDataTypes/felt.d.ts +6 -0
  161. package/dist/utils/cairoDataTypes/felt.mjs +27 -0
  162. package/dist/utils/cairoDataTypes/uint256.cjs +113 -0
  163. package/dist/utils/cairoDataTypes/uint256.d.ts +72 -0
  164. package/dist/utils/cairoDataTypes/uint256.mjs +103 -0
  165. package/dist/utils/cairoDataTypes/uint512.cjs +125 -0
  166. package/dist/utils/cairoDataTypes/uint512.d.ts +76 -0
  167. package/dist/utils/cairoDataTypes/uint512.mjs +123 -0
  168. package/dist/utils/calldata/byteArray.cjs +27 -0
  169. package/dist/utils/calldata/byteArray.d.ts +32 -0
  170. package/dist/utils/calldata/byteArray.mjs +20 -0
  171. package/dist/utils/calldata/cairo.cjs +114 -0
  172. package/dist/utils/calldata/cairo.d.ts +196 -0
  173. package/dist/utils/calldata/cairo.mjs +68 -0
  174. package/dist/utils/calldata/enum/CairoCustomEnum.cjs +55 -0
  175. package/dist/utils/calldata/enum/CairoCustomEnum.d.ts +38 -0
  176. package/dist/utils/calldata/enum/CairoCustomEnum.mjs +50 -0
  177. package/dist/utils/calldata/enum/CairoOption.cjs +55 -0
  178. package/dist/utils/calldata/enum/CairoOption.d.ts +37 -0
  179. package/dist/utils/calldata/enum/CairoOption.mjs +50 -0
  180. package/dist/utils/calldata/enum/CairoResult.cjs +54 -0
  181. package/dist/utils/calldata/enum/CairoResult.d.ts +36 -0
  182. package/dist/utils/calldata/enum/CairoResult.mjs +47 -0
  183. package/dist/utils/calldata/enum/index.cjs +38 -0
  184. package/dist/utils/calldata/enum/index.d.ts +3 -0
  185. package/dist/utils/calldata/enum/index.mjs +3 -0
  186. package/dist/utils/calldata/formatter.cjs +55 -0
  187. package/dist/utils/calldata/formatter.d.ts +9 -0
  188. package/dist/utils/calldata/formatter.mjs +58 -0
  189. package/dist/utils/calldata/index.cjs +272 -0
  190. package/dist/utils/calldata/index.d.ts +90 -0
  191. package/dist/utils/calldata/index.mjs +276 -0
  192. package/dist/utils/calldata/parser/index.cjs +29 -0
  193. package/dist/utils/calldata/parser/index.d.ts +5 -0
  194. package/dist/utils/calldata/parser/index.mjs +21 -0
  195. package/dist/utils/calldata/parser/interface.cjs +8 -0
  196. package/dist/utils/calldata/parser/interface.d.ts +20 -0
  197. package/dist/utils/calldata/parser/interface.mjs +2 -0
  198. package/dist/utils/calldata/parser/parser-0-1.1.0.cjs +38 -0
  199. package/dist/utils/calldata/parser/parser-0-1.1.0.d.ts +24 -0
  200. package/dist/utils/calldata/parser/parser-0-1.1.0.mjs +31 -0
  201. package/dist/utils/calldata/parser/parser-2.0.0.cjs +42 -0
  202. package/dist/utils/calldata/parser/parser-2.0.0.d.ts +23 -0
  203. package/dist/utils/calldata/parser/parser-2.0.0.mjs +37 -0
  204. package/dist/utils/calldata/propertyOrder.cjs +159 -0
  205. package/dist/utils/calldata/propertyOrder.d.ts +2 -0
  206. package/dist/utils/calldata/propertyOrder.mjs +189 -0
  207. package/dist/utils/calldata/requestParser.cjs +204 -0
  208. package/dist/utils/calldata/requestParser.d.ts +11 -0
  209. package/dist/utils/calldata/requestParser.mjs +231 -0
  210. package/dist/utils/calldata/responseParser.cjs +200 -0
  211. package/dist/utils/calldata/responseParser.d.ts +11 -0
  212. package/dist/utils/calldata/responseParser.mjs +201 -0
  213. package/dist/utils/calldata/tuple.cjs +106 -0
  214. package/dist/utils/calldata/tuple.d.ts +6 -0
  215. package/dist/utils/calldata/tuple.mjs +88 -0
  216. package/dist/utils/calldata/validate.cjs +241 -0
  217. package/dist/utils/calldata/validate.d.ts +6 -0
  218. package/dist/utils/calldata/validate.mjs +315 -0
  219. package/dist/utils/contract.cjs +40 -0
  220. package/dist/utils/contract.d.ts +37 -0
  221. package/dist/utils/contract.mjs +31 -0
  222. package/dist/utils/ec.cjs +12 -0
  223. package/dist/utils/ec.d.ts +2 -0
  224. package/dist/utils/ec.mjs +2 -0
  225. package/dist/utils/encode.cjs +78 -0
  226. package/dist/utils/encode.d.ts +207 -0
  227. package/dist/utils/encode.mjs +56 -0
  228. package/dist/utils/eth.cjs +22 -0
  229. package/dist/utils/eth.d.ts +22 -0
  230. package/dist/utils/eth.mjs +14 -0
  231. package/dist/utils/events/index.cjs +144 -0
  232. package/dist/utils/events/index.d.ts +84 -0
  233. package/dist/utils/events/index.mjs +136 -0
  234. package/dist/utils/fetchPonyfill.cjs +14 -0
  235. package/dist/utils/fetchPonyfill.d.ts +2 -0
  236. package/dist/utils/fetchPonyfill.mjs +5 -0
  237. package/dist/utils/hash/classHash.cjs +151 -0
  238. package/dist/utils/hash/classHash.d.ts +120 -0
  239. package/dist/utils/hash/classHash.mjs +168 -0
  240. package/dist/utils/hash/index.cjs +49 -0
  241. package/dist/utils/hash/index.d.ts +7 -0
  242. package/dist/utils/hash/index.mjs +4 -0
  243. package/dist/utils/hash/selector.cjs +37 -0
  244. package/dist/utils/hash/selector.d.ts +57 -0
  245. package/dist/utils/hash/selector.mjs +28 -0
  246. package/dist/utils/hash/transactionHash/index.cjs +38 -0
  247. package/dist/utils/hash/transactionHash/index.d.ts +81 -0
  248. package/dist/utils/hash/transactionHash/index.mjs +102 -0
  249. package/dist/utils/hash/transactionHash/v2.cjs +31 -0
  250. package/dist/utils/hash/transactionHash/v2.d.ts +34 -0
  251. package/dist/utils/hash/transactionHash/v2.mjs +57 -0
  252. package/dist/utils/hash/transactionHash/v3.cjs +45 -0
  253. package/dist/utils/hash/transactionHash/v3.d.ts +24 -0
  254. package/dist/utils/hash/transactionHash/v3.mjs +80 -0
  255. package/dist/utils/json.cjs +21 -0
  256. package/dist/utils/json.d.ts +50 -0
  257. package/dist/utils/json.mjs +10 -0
  258. package/dist/utils/merkle.cjs +118 -0
  259. package/dist/utils/merkle.d.ts +87 -0
  260. package/dist/utils/merkle.mjs +114 -0
  261. package/dist/utils/num.cjs +109 -0
  262. package/dist/utils/num.d.ts +283 -0
  263. package/dist/utils/num.mjs +86 -0
  264. package/dist/utils/provider.cjs +182 -0
  265. package/dist/utils/provider.d.ts +217 -0
  266. package/dist/utils/provider.mjs +158 -0
  267. package/dist/utils/responseParser/index.cjs +27 -0
  268. package/dist/utils/responseParser/index.d.ts +2 -0
  269. package/dist/utils/responseParser/index.mjs +2 -0
  270. package/dist/utils/responseParser/interface.cjs +8 -0
  271. package/dist/utils/responseParser/interface.d.ts +13 -0
  272. package/dist/utils/responseParser/interface.mjs +2 -0
  273. package/dist/utils/responseParser/rpc.cjs +83 -0
  274. package/dist/utils/responseParser/rpc.d.ts +19 -0
  275. package/dist/utils/responseParser/rpc.mjs +77 -0
  276. package/dist/utils/shortString.cjs +56 -0
  277. package/dist/utils/shortString.d.ts +116 -0
  278. package/dist/utils/shortString.mjs +39 -0
  279. package/dist/utils/stark.cjs +137 -0
  280. package/dist/utils/stark.d.ts +224 -0
  281. package/dist/utils/stark.mjs +109 -0
  282. package/dist/utils/starknetId.cjs +196 -0
  283. package/dist/utils/starknetId.d.ts +182 -0
  284. package/dist/utils/starknetId.mjs +185 -0
  285. package/dist/utils/transaction.cjs +115 -0
  286. package/dist/utils/transaction.d.ts +185 -0
  287. package/dist/utils/transaction.mjs +98 -0
  288. package/dist/utils/transactionReceipt.cjs +54 -0
  289. package/dist/utils/transactionReceipt.d.ts +33 -0
  290. package/dist/utils/transactionReceipt.mjs +49 -0
  291. package/dist/utils/typedData.cjs +285 -0
  292. package/dist/utils/typedData.d.ts +54 -0
  293. package/dist/utils/typedData.mjs +286 -0
  294. package/dist/utils/uint256.cjs +30 -0
  295. package/dist/utils/uint256.d.ts +45 -0
  296. package/dist/utils/uint256.mjs +11 -0
  297. package/dist/utils/url.cjs +35 -0
  298. package/dist/utils/url.d.ts +29 -0
  299. package/dist/utils/url.mjs +27 -0
  300. package/dist/wallet/account.cjs +115 -0
  301. package/dist/wallet/account.d.ts +31 -0
  302. package/dist/wallet/account.mjs +112 -0
  303. package/dist/wallet/connect.cjs +90 -0
  304. package/dist/wallet/connect.d.ts +82 -0
  305. package/dist/wallet/connect.mjs +64 -0
  306. package/dist/wallet/index.cjs +16 -0
  307. package/dist/wallet/index.d.ts +1 -0
  308. package/dist/wallet/index.mjs +1 -0
  309. package/dist/wallet/types.cjs +1 -0
  310. package/dist/wallet/types.d.ts +4 -0
  311. package/dist/wallet/types.mjs +0 -0
  312. package/package.json +13 -13
  313. package/dist/index.js +0 -7426
  314. package/dist/index.js.map +0 -1
  315. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,541 @@
1
+ /**
2
+ * PRIMITIVES
3
+ */
4
+ /**
5
+ * A field element. represented by at most 63 hex digits
6
+ * @pattern ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,62})$
7
+ */
8
+ export type FELT = string;
9
+ /**
10
+ * an ethereum address represented as 40 hex digits
11
+ * @pattern ^0x[a-fA-F0-9]{40}$
12
+ */
13
+ export type ETH_ADDRESS = string;
14
+ /**
15
+ * A storage key. Represented as up to 62 hex digits, 3 bits, and 5 leading zeroes.
16
+ * @pattern ^0x0[0-7]{1}[a-fA-F0-9]{0,62}$
17
+ */
18
+ export type STORAGE_KEY = string;
19
+ export type ADDRESS = FELT;
20
+ export type NUM_AS_HEX = string;
21
+ /**
22
+ * 64 bit integers, represented by hex string of length at most 16
23
+ * "pattern": "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,15})$"
24
+ */
25
+ export type u64 = string;
26
+ /**
27
+ * 64 bit integers, represented by hex string of length at most 32
28
+ * "pattern": "^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,31})$"
29
+ */
30
+ export type u128 = string;
31
+ export type SIGNATURE = Array<FELT>;
32
+ export type BLOCK_NUMBER = number;
33
+ export type BLOCK_HASH = FELT;
34
+ export type TXN_HASH = FELT;
35
+ export type CHAIN_ID = NUM_AS_HEX;
36
+ export type STRUCT_ABI_TYPE = 'struct';
37
+ export type EVENT_ABI_TYPE = 'event';
38
+ export type FUNCTION_ABI_TYPE = 'function' | 'l1_handler' | 'constructor';
39
+ export type ENTRY_POINT_TYPE = 'EXTERNAL' | 'L1_HANDLER' | 'CONSTRUCTOR';
40
+ export type CALL_TYPE = 'DELEGATE' | 'LIBRARY_CALL' | 'CALL';
41
+ export type TXN_STATUS = 'RECEIVED' | 'REJECTED' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1';
42
+ export type SIMULATION_FLAG = 'SKIP_VALIDATE' | 'SKIP_FEE_CHARGE';
43
+ export type DA_MODE = 'L1' | 'L2';
44
+ export type TXN_TYPE = 'DECLARE' | 'DEPLOY' | 'DEPLOY_ACCOUNT' | 'INVOKE' | 'L1_HANDLER';
45
+ export type TXN_FINALITY_STATUS = 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1';
46
+ export type TXN_EXECUTION_STATUS = 'SUCCEEDED' | 'REVERTED';
47
+ export type BLOCK_STATUS = 'PENDING' | 'ACCEPTED_ON_L2' | 'ACCEPTED_ON_L1' | 'REJECTED';
48
+ export type BLOCK_TAG = 'latest' | 'pending';
49
+ /**
50
+ * READ API
51
+ */
52
+ export type EVENTS_CHUNK = {
53
+ events: EMITTED_EVENT[];
54
+ continuation_token?: string;
55
+ };
56
+ export type RESULT_PAGE_REQUEST = {
57
+ continuation_token?: string;
58
+ chunk_size: number;
59
+ };
60
+ export type EMITTED_EVENT = EVENT & {
61
+ block_hash: BLOCK_HASH;
62
+ block_number: BLOCK_NUMBER;
63
+ transaction_hash: TXN_HASH;
64
+ };
65
+ export type EVENT = {
66
+ from_address: ADDRESS;
67
+ } & EVENT_CONTENT;
68
+ export type EVENT_CONTENT = {
69
+ keys: FELT[];
70
+ data: FELT[];
71
+ };
72
+ export type EVENT_FILTER = {
73
+ from_block?: BLOCK_ID;
74
+ to_block?: BLOCK_ID;
75
+ address?: ADDRESS;
76
+ keys?: FELT[][];
77
+ };
78
+ export type BLOCK_ID = {
79
+ block_hash?: BLOCK_HASH;
80
+ block_number?: BLOCK_NUMBER;
81
+ } | BLOCK_TAG;
82
+ export type SYNC_STATUS = {
83
+ starting_block_hash: BLOCK_HASH;
84
+ starting_block_num: BLOCK_NUMBER;
85
+ current_block_hash: BLOCK_HASH;
86
+ current_block_num: BLOCK_NUMBER;
87
+ highest_block_hash: BLOCK_HASH;
88
+ highest_block_num: BLOCK_NUMBER;
89
+ };
90
+ export type NEW_CLASSES = {
91
+ class_hash: FELT;
92
+ compiled_class_hash: FELT;
93
+ };
94
+ export type REPLACED_CLASS = {
95
+ class_hash: FELT;
96
+ contract_address: FELT;
97
+ };
98
+ export type NONCE_UPDATE = {
99
+ contract_address: ADDRESS;
100
+ nonce: FELT;
101
+ };
102
+ export type STATE_DIFF = {
103
+ storage_diffs: CONTRACT_STORAGE_DIFF_ITEM[];
104
+ deprecated_declared_classes: FELT[];
105
+ declared_classes: NEW_CLASSES[];
106
+ deployed_contracts: DEPLOYED_CONTRACT_ITEM[];
107
+ replaced_classes: REPLACED_CLASS[];
108
+ nonces: NONCE_UPDATE[];
109
+ };
110
+ export type PENDING_STATE_UPDATE = {
111
+ old_root: FELT;
112
+ state_diff: STATE_DIFF;
113
+ block_hash: never;
114
+ };
115
+ export type STATE_UPDATE = {
116
+ block_hash: BLOCK_HASH;
117
+ old_root: FELT;
118
+ new_root: FELT;
119
+ state_diff: STATE_DIFF;
120
+ };
121
+ export type BLOCK_BODY_WITH_TX_HASHES = {
122
+ transactions: TXN_HASH[];
123
+ };
124
+ export type BLOCK_BODY_WITH_TXS = {
125
+ transactions: (TXN & {
126
+ transaction_hash: TXN_HASH;
127
+ })[];
128
+ };
129
+ export type BLOCK_HEADER = {
130
+ block_hash: BLOCK_HASH;
131
+ parent_hash: BLOCK_HASH;
132
+ block_number: BLOCK_NUMBER;
133
+ new_root: FELT;
134
+ timestamp: number;
135
+ sequencer_address: FELT;
136
+ l1_gas_price: RESOURCE_PRICE;
137
+ starknet_version: string;
138
+ };
139
+ export type PENDING_BLOCK_HEADER = {
140
+ parent_hash: BLOCK_HASH;
141
+ timestamp: number;
142
+ sequencer_address: FELT;
143
+ l1_gas_price: RESOURCE_PRICE;
144
+ starknet_version: string;
145
+ };
146
+ export type BLOCK_WITH_TX_HASHES = {
147
+ status: BLOCK_STATUS;
148
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TX_HASHES;
149
+ export type BLOCK_WITH_TXS = {
150
+ status: BLOCK_STATUS;
151
+ } & BLOCK_HEADER & BLOCK_BODY_WITH_TXS;
152
+ export type PENDING_BLOCK_WITH_TX_HASHES = BLOCK_BODY_WITH_TX_HASHES & PENDING_BLOCK_HEADER;
153
+ export type PENDING_BLOCK_WITH_TXS = BLOCK_BODY_WITH_TXS & PENDING_BLOCK_HEADER;
154
+ export type DEPLOYED_CONTRACT_ITEM = {
155
+ address: FELT;
156
+ class_hash: FELT;
157
+ };
158
+ export type CONTRACT_STORAGE_DIFF_ITEM = {
159
+ address: string;
160
+ storage_entries: StorageDiffItem[];
161
+ };
162
+ export type StorageDiffItem = {
163
+ key: string;
164
+ value: string;
165
+ };
166
+ export type TXN = INVOKE_TXN | L1_HANDLER_TXN | DECLARE_TXN | DEPLOY_TXN | DEPLOY_ACCOUNT_TXN;
167
+ export type DECLARE_TXN = DECLARE_TXN_V0 | DECLARE_TXN_V1 | DECLARE_TXN_V2 | DECLARE_TXN_V3;
168
+ export type DECLARE_TXN_V0 = {
169
+ type: 'DECLARE';
170
+ sender_address: ADDRESS;
171
+ max_fee: FELT;
172
+ version: '0x0' | '0x100000000000000000000000000000000';
173
+ signature: SIGNATURE;
174
+ class_hash: FELT;
175
+ };
176
+ export type DECLARE_TXN_V1 = {
177
+ type: 'DECLARE';
178
+ sender_address: ADDRESS;
179
+ max_fee: FELT;
180
+ version: '0x1' | '0x100000000000000000000000000000001';
181
+ signature: SIGNATURE;
182
+ nonce: FELT;
183
+ class_hash: FELT;
184
+ };
185
+ export type DECLARE_TXN_V2 = {
186
+ type: 'DECLARE';
187
+ sender_address: ADDRESS;
188
+ compiled_class_hash: FELT;
189
+ max_fee: FELT;
190
+ version: '0x2' | '0x100000000000000000000000000000002';
191
+ signature: SIGNATURE;
192
+ nonce: FELT;
193
+ class_hash: FELT;
194
+ };
195
+ export type DECLARE_TXN_V3 = {
196
+ type: 'DECLARE';
197
+ sender_address: ADDRESS;
198
+ compiled_class_hash: FELT;
199
+ version: '0x3' | '0x100000000000000000000000000000003';
200
+ signature: SIGNATURE;
201
+ nonce: FELT;
202
+ class_hash: FELT;
203
+ resource_bounds: RESOURCE_BOUNDS_MAPPING;
204
+ tip: u64;
205
+ paymaster_data: FELT[];
206
+ account_deployment_data: FELT[];
207
+ nonce_data_availability_mode: DA_MODE;
208
+ fee_data_availability_mode: DA_MODE;
209
+ };
210
+ export type BROADCASTED_TXN = BROADCASTED_INVOKE_TXN | BROADCASTED_DECLARE_TXN | BROADCASTED_DEPLOY_ACCOUNT_TXN;
211
+ export type BROADCASTED_INVOKE_TXN = INVOKE_TXN;
212
+ export type BROADCASTED_DEPLOY_ACCOUNT_TXN = DEPLOY_ACCOUNT_TXN;
213
+ export type BROADCASTED_DECLARE_TXN = BROADCASTED_DECLARE_TXN_V1 | BROADCASTED_DECLARE_TXN_V2 | BROADCASTED_DECLARE_TXN_V3;
214
+ export type BROADCASTED_DECLARE_TXN_V1 = {
215
+ type: 'DECLARE';
216
+ sender_address: ADDRESS;
217
+ max_fee: FELT;
218
+ version: '0x1' | '0x100000000000000000000000000000001';
219
+ signature: SIGNATURE;
220
+ nonce: FELT;
221
+ contract_class: DEPRECATED_CONTRACT_CLASS;
222
+ };
223
+ export type BROADCASTED_DECLARE_TXN_V2 = {
224
+ type: 'DECLARE';
225
+ sender_address: ADDRESS;
226
+ compiled_class_hash: FELT;
227
+ max_fee: FELT;
228
+ version: '0x2' | '0x100000000000000000000000000000002';
229
+ signature: SIGNATURE;
230
+ nonce: FELT;
231
+ contract_class: CONTRACT_CLASS;
232
+ };
233
+ export type BROADCASTED_DECLARE_TXN_V3 = {
234
+ type: 'DECLARE';
235
+ sender_address: ADDRESS;
236
+ compiled_class_hash: FELT;
237
+ version: '0x3' | '0x100000000000000000000000000000003';
238
+ signature: SIGNATURE;
239
+ nonce: FELT;
240
+ contract_class: CONTRACT_CLASS;
241
+ resource_bounds: RESOURCE_BOUNDS_MAPPING;
242
+ tip: u64;
243
+ paymaster_data: FELT[];
244
+ account_deployment_data: FELT[];
245
+ nonce_data_availability_mode: DA_MODE;
246
+ fee_data_availability_mode: DA_MODE;
247
+ };
248
+ export type DEPLOY_ACCOUNT_TXN = DEPLOY_ACCOUNT_TXN_V1 | DEPLOY_ACCOUNT_TXN_V3;
249
+ export type DEPLOY_ACCOUNT_TXN_V1 = {
250
+ type: 'DEPLOY_ACCOUNT';
251
+ max_fee: FELT;
252
+ version: '0x1' | '0x100000000000000000000000000000001';
253
+ signature: SIGNATURE;
254
+ nonce: FELT;
255
+ contract_address_salt: FELT;
256
+ constructor_calldata: FELT[];
257
+ class_hash: FELT;
258
+ };
259
+ export type DEPLOY_ACCOUNT_TXN_V3 = {
260
+ type: 'DEPLOY_ACCOUNT';
261
+ version: '0x3' | '0x100000000000000000000000000000003';
262
+ signature: SIGNATURE;
263
+ nonce: FELT;
264
+ contract_address_salt: FELT;
265
+ constructor_calldata: FELT[];
266
+ class_hash: FELT;
267
+ resource_bounds: RESOURCE_BOUNDS_MAPPING;
268
+ tip: u64;
269
+ paymaster_data: FELT[];
270
+ nonce_data_availability_mode: DA_MODE;
271
+ fee_data_availability_mode: DA_MODE;
272
+ };
273
+ export type DEPLOY_TXN = {
274
+ type: 'DEPLOY';
275
+ version: FELT;
276
+ contract_address_salt: FELT;
277
+ constructor_calldata: FELT[];
278
+ class_hash: FELT;
279
+ };
280
+ export type INVOKE_TXN = INVOKE_TXN_V0 | INVOKE_TXN_V1 | INVOKE_TXN_V3;
281
+ export type INVOKE_TXN_V0 = {
282
+ type: 'INVOKE';
283
+ max_fee: FELT;
284
+ version: '0x0' | '0x100000000000000000000000000000000';
285
+ signature: SIGNATURE;
286
+ contract_address: ADDRESS;
287
+ entry_point_selector: FELT;
288
+ calldata: FELT[];
289
+ };
290
+ export type INVOKE_TXN_V1 = {
291
+ type: 'INVOKE';
292
+ sender_address: ADDRESS;
293
+ calldata: FELT[];
294
+ max_fee: FELT;
295
+ version: '0x1' | '0x100000000000000000000000000000001';
296
+ signature: SIGNATURE;
297
+ nonce: FELT;
298
+ };
299
+ export type INVOKE_TXN_V3 = {
300
+ type: 'INVOKE';
301
+ sender_address: ADDRESS;
302
+ calldata: FELT[];
303
+ version: '0x3' | '0x100000000000000000000000000000003';
304
+ signature: SIGNATURE;
305
+ nonce: FELT;
306
+ resource_bounds: RESOURCE_BOUNDS_MAPPING;
307
+ tip: u64;
308
+ paymaster_data: FELT[];
309
+ account_deployment_data: FELT[];
310
+ nonce_data_availability_mode: DA_MODE;
311
+ fee_data_availability_mode: DA_MODE;
312
+ };
313
+ export type L1_HANDLER_TXN = {
314
+ version: FELT;
315
+ type: 'L1_HANDLER';
316
+ nonce: NUM_AS_HEX;
317
+ } & FUNCTION_CALL;
318
+ export type COMMON_RECEIPT_PROPERTIES = {
319
+ transaction_hash: TXN_HASH;
320
+ actual_fee: FEE_PAYMENT;
321
+ execution_status: TXN_EXECUTION_STATUS;
322
+ finality_status: TXN_FINALITY_STATUS;
323
+ block_hash: BLOCK_HASH;
324
+ block_number: BLOCK_NUMBER;
325
+ messages_sent: MSG_TO_L1[];
326
+ revert_reason?: string;
327
+ events: EVENT[];
328
+ execution_resources: EXECUTION_RESOURCES;
329
+ };
330
+ export type PENDING_COMMON_RECEIPT_PROPERTIES = {
331
+ transaction_hash: TXN_HASH;
332
+ actual_fee: FEE_PAYMENT;
333
+ messages_sent: MSG_TO_L1[];
334
+ events: EVENT[];
335
+ revert_reason?: string;
336
+ finality_status: 'ACCEPTED_ON_L2';
337
+ execution_status: TXN_EXECUTION_STATUS;
338
+ execution_resources: EXECUTION_RESOURCES;
339
+ };
340
+ export type INVOKE_TXN_RECEIPT = {
341
+ type: 'INVOKE';
342
+ } & COMMON_RECEIPT_PROPERTIES;
343
+ export type PENDING_INVOKE_TXN_RECEIPT = {
344
+ type: 'INVOKE';
345
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
346
+ export type DECLARE_TXN_RECEIPT = {
347
+ type: 'DECLARE';
348
+ } & COMMON_RECEIPT_PROPERTIES;
349
+ export type PENDING_DECLARE_TXN_RECEIPT = {
350
+ type: 'DECLARE';
351
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
352
+ export type DEPLOY_ACCOUNT_TXN_RECEIPT = {
353
+ type: 'DEPLOY_ACCOUNT';
354
+ contract_address: FELT;
355
+ } & COMMON_RECEIPT_PROPERTIES;
356
+ export type PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT = {
357
+ type: 'DEPLOY_ACCOUNT';
358
+ contract_address: FELT;
359
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
360
+ export type DEPLOY_TXN_RECEIPT = {
361
+ type: 'DEPLOY';
362
+ contract_address: FELT;
363
+ } & COMMON_RECEIPT_PROPERTIES;
364
+ export type L1_HANDLER_TXN_RECEIPT = {
365
+ type: 'L1_HANDLER';
366
+ message_hash: NUM_AS_HEX;
367
+ } & COMMON_RECEIPT_PROPERTIES;
368
+ export type PENDING_L1_HANDLER_TXN_RECEIPT = {
369
+ type: 'L1_HANDLER';
370
+ message_hash: NUM_AS_HEX;
371
+ } & PENDING_COMMON_RECEIPT_PROPERTIES;
372
+ export type TXN_RECEIPT = INVOKE_TXN_RECEIPT | L1_HANDLER_TXN_RECEIPT | DECLARE_TXN_RECEIPT | DEPLOY_TXN_RECEIPT | DEPLOY_ACCOUNT_TXN_RECEIPT;
373
+ export type PENDING_TXN_RECEIPT = PENDING_INVOKE_TXN_RECEIPT | PENDING_L1_HANDLER_TXN_RECEIPT | PENDING_DECLARE_TXN_RECEIPT | PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT;
374
+ export type MSG_TO_L1 = {
375
+ from_address: FELT;
376
+ to_address: FELT;
377
+ payload: FELT[];
378
+ };
379
+ export type MSG_FROM_L1 = {
380
+ from_address: ETH_ADDRESS;
381
+ to_address: ADDRESS;
382
+ entry_point_selector: FELT;
383
+ payload: FELT[];
384
+ };
385
+ export type FUNCTION_CALL = {
386
+ contract_address: ADDRESS;
387
+ entry_point_selector: FELT;
388
+ calldata: FELT[];
389
+ };
390
+ export type CONTRACT_CLASS = {
391
+ sierra_program: FELT[];
392
+ contract_class_version: string;
393
+ entry_points_by_type: {
394
+ CONSTRUCTOR: SIERRA_ENTRY_POINT[];
395
+ EXTERNAL: SIERRA_ENTRY_POINT[];
396
+ L1_HANDLER: SIERRA_ENTRY_POINT[];
397
+ };
398
+ abi: string;
399
+ };
400
+ export type DEPRECATED_CONTRACT_CLASS = {
401
+ program: string;
402
+ entry_points_by_type: {
403
+ CONSTRUCTOR: DEPRECATED_CAIRO_ENTRY_POINT[];
404
+ EXTERNAL: DEPRECATED_CAIRO_ENTRY_POINT[];
405
+ L1_HANDLER: DEPRECATED_CAIRO_ENTRY_POINT[];
406
+ };
407
+ abi: CONTRACT_ABI;
408
+ };
409
+ export type DEPRECATED_CAIRO_ENTRY_POINT = {
410
+ offset: NUM_AS_HEX | number;
411
+ selector: FELT;
412
+ };
413
+ export type SIERRA_ENTRY_POINT = {
414
+ selector: FELT;
415
+ function_idx: number;
416
+ };
417
+ export type CONTRACT_ABI = readonly CONTRACT_ABI_ENTRY[];
418
+ export type CONTRACT_ABI_ENTRY = {
419
+ selector: FELT;
420
+ input: string;
421
+ output: string;
422
+ };
423
+ export type STRUCT_ABI_ENTRY = {
424
+ type: STRUCT_ABI_TYPE;
425
+ name: string;
426
+ size: number;
427
+ members: STRUCT_MEMBER[];
428
+ };
429
+ export type STRUCT_MEMBER = TYPED_PARAMETER & {
430
+ offset: number;
431
+ };
432
+ export type EVENT_ABI_ENTRY = {
433
+ type: EVENT_ABI_TYPE;
434
+ name: string;
435
+ keys: TYPED_PARAMETER[];
436
+ data: TYPED_PARAMETER[];
437
+ };
438
+ export type FUNCTION_STATE_MUTABILITY = 'view';
439
+ export type FUNCTION_ABI_ENTRY = {
440
+ type: FUNCTION_ABI_TYPE;
441
+ name: string;
442
+ inputs: TYPED_PARAMETER[];
443
+ outputs: TYPED_PARAMETER[];
444
+ stateMutability: FUNCTION_STATE_MUTABILITY;
445
+ };
446
+ export type TYPED_PARAMETER = {
447
+ name: string;
448
+ type: string;
449
+ };
450
+ export type SIMULATION_FLAG_FOR_ESTIMATE_FEE = 'SKIP_VALIDATE';
451
+ export type PRICE_UNIT = 'WEI' | 'FRI';
452
+ export type FEE_ESTIMATE = {
453
+ gas_consumed: FELT;
454
+ gas_price: FELT;
455
+ overall_fee: FELT;
456
+ unit: PRICE_UNIT;
457
+ };
458
+ export type FEE_PAYMENT = {
459
+ amount: FELT;
460
+ unit: PRICE_UNIT;
461
+ };
462
+ export type RESOURCE_BOUNDS_MAPPING = {
463
+ l1_gas: RESOURCE_BOUNDS;
464
+ l2_gas: RESOURCE_BOUNDS;
465
+ };
466
+ export type RESOURCE_BOUNDS = {
467
+ max_amount: u64;
468
+ max_price_per_unit: u128;
469
+ };
470
+ export type RESOURCE_PRICE = {
471
+ price_in_fri: FELT;
472
+ price_in_wei: FELT;
473
+ };
474
+ export type EXECUTION_RESOURCES = {
475
+ steps: number;
476
+ memory_holes?: number;
477
+ range_check_builtin_applications?: number;
478
+ pedersen_builtin_applications?: number;
479
+ poseidon_builtin_applications?: number;
480
+ ec_op_builtin_applications?: number;
481
+ ecdsa_builtin_applications?: number;
482
+ bitwise_builtin_applications?: number;
483
+ keccak_builtin_applications?: number;
484
+ segment_arena_builtin?: number;
485
+ };
486
+ /**
487
+ * TRACE API
488
+ */
489
+ export type TRANSACTION_TRACE = {
490
+ invoke_tx_trace?: INVOKE_TXN_TRACE;
491
+ declare_tx_trace?: DECLARE_TXN_TRACE;
492
+ deploy_account_tx_trace?: DEPLOY_ACCOUNT_TXN_TRACE;
493
+ l1_handler_tx_trace?: L1_HANDLER_TXN_TRACE;
494
+ };
495
+ export type INVOKE_TXN_TRACE = {
496
+ type: 'INVOKE';
497
+ execute_invocation: FUNCTION_INVOCATION | {
498
+ revert_reason: string;
499
+ };
500
+ validate_invocation?: FUNCTION_INVOCATION;
501
+ fee_transfer_invocation?: FUNCTION_INVOCATION;
502
+ state_diff?: STATE_DIFF;
503
+ };
504
+ export type DECLARE_TXN_TRACE = {
505
+ type: 'DECLARE';
506
+ validate_invocation?: FUNCTION_INVOCATION;
507
+ fee_transfer_invocation?: FUNCTION_INVOCATION;
508
+ state_diff?: STATE_DIFF;
509
+ };
510
+ export type DEPLOY_ACCOUNT_TXN_TRACE = {
511
+ type: 'DEPLOY_ACCOUNT';
512
+ constructor_invocation: FUNCTION_INVOCATION;
513
+ validate_invocation?: FUNCTION_INVOCATION;
514
+ fee_transfer_invocation?: FUNCTION_INVOCATION;
515
+ state_diff?: STATE_DIFF;
516
+ };
517
+ export type L1_HANDLER_TXN_TRACE = {
518
+ type: 'L1_HANDLER';
519
+ function_invocation: FUNCTION_INVOCATION;
520
+ state_diff?: STATE_DIFF;
521
+ };
522
+ export type NESTED_CALL = FUNCTION_INVOCATION;
523
+ export type FUNCTION_INVOCATION = FUNCTION_CALL & {
524
+ caller_address: string;
525
+ class_hash: string;
526
+ entry_point_type: ENTRY_POINT_TYPE;
527
+ call_type: CALL_TYPE;
528
+ result: string[];
529
+ calls: NESTED_CALL[];
530
+ events: ORDERED_EVENT[];
531
+ messages: ORDERED_MESSAGE[];
532
+ execution_resources: EXECUTION_RESOURCES;
533
+ };
534
+ export type ORDERED_EVENT = {
535
+ order: number;
536
+ event: EVENT;
537
+ };
538
+ export type ORDERED_MESSAGE = {
539
+ order: number;
540
+ message: MSG_TO_L1;
541
+ };
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,85 @@
1
+ /**
2
+ * TypeScript Representation of Cairo1 v2+ Starknet Contract ABI
3
+ *
4
+ * starknet_metadata.json - tags/v0.5.0
5
+ *
6
+ * 'starknet-specs' (OpenRpc protocol types)
7
+ * https://github.com/starkware-libs/starknet-specs
8
+ */
9
+ export type ABI = Array<FUNCTION | CONSTRUCTOR | L1_HANDLER | EVENT | STRUCT | ENUM | INTERFACE | IMPL>;
10
+ export type FUNCTION = {
11
+ type: 'function';
12
+ name: string;
13
+ inputs: Array<{
14
+ name: string;
15
+ type: string;
16
+ }>;
17
+ outputs?: Array<{
18
+ type: string;
19
+ }>;
20
+ state_mutability: 'view' | 'external';
21
+ };
22
+ export type CONSTRUCTOR = {
23
+ type: 'constructor';
24
+ name: 'constructor';
25
+ inputs: Array<{
26
+ name: string;
27
+ type: string;
28
+ }>;
29
+ };
30
+ export type L1_HANDLER = {
31
+ type: 'l1_handler';
32
+ name: string;
33
+ inputs: Array<{
34
+ name: string;
35
+ type: string;
36
+ }>;
37
+ outputs?: Array<{
38
+ type: string;
39
+ }>;
40
+ state_mutability: 'view' | 'external';
41
+ };
42
+ export type EVENT = {
43
+ type: 'event';
44
+ name: string;
45
+ } & (ENUM_EVENT | STRUCT_EVENT);
46
+ export type STRUCT_EVENT = {
47
+ kind: 'struct';
48
+ members: Array<EVENT_FIELD>;
49
+ };
50
+ export type ENUM_EVENT = {
51
+ kind: 'enum';
52
+ variants: Array<EVENT_FIELD>;
53
+ };
54
+ export type STRUCT = {
55
+ type: 'struct';
56
+ name: string;
57
+ members: Array<{
58
+ name: string;
59
+ type: string;
60
+ }>;
61
+ };
62
+ export type ENUM = {
63
+ type: 'enum';
64
+ name: string;
65
+ variants: Array<{
66
+ name: string;
67
+ type: string;
68
+ }>;
69
+ };
70
+ export type INTERFACE = {
71
+ type: 'interface';
72
+ name: string;
73
+ items: Array<FUNCTION>;
74
+ };
75
+ export type IMPL = {
76
+ type: 'impl';
77
+ name: string;
78
+ interface_name: string;
79
+ };
80
+ export type EVENT_KIND = 'struct' | 'enum';
81
+ export type EVENT_FIELD = {
82
+ name: string;
83
+ type: string;
84
+ kind: 'key' | 'data' | 'nested';
85
+ };
File without changes
@@ -0,0 +1 @@
1
+ "use strict";