starknet 3.18.2 → 4.0.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 (165) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +1 -2
  3. package/__tests__/account.test.ts +11 -56
  4. package/__tests__/contract.test.ts +11 -49
  5. package/__tests__/defaultProvider.test.ts +321 -0
  6. package/__tests__/fixtures.ts +32 -11
  7. package/__tests__/jest.setup.ts +2 -3
  8. package/__tests__/rpcProvider.test.ts +17 -0
  9. package/__tests__/sequencerProvider.test.ts +45 -0
  10. package/account/default.d.ts +54 -77
  11. package/account/default.js +271 -596
  12. package/account/index.js +18 -31
  13. package/account/interface.d.ts +66 -95
  14. package/account/interface.js +20 -30
  15. package/constants.d.ts +17 -19
  16. package/constants.js +2038 -2059
  17. package/contract/contractFactory.d.ts +25 -29
  18. package/contract/contractFactory.js +94 -210
  19. package/contract/default.d.ts +117 -146
  20. package/contract/default.js +582 -776
  21. package/contract/index.js +19 -32
  22. package/contract/interface.d.ts +72 -92
  23. package/contract/interface.js +6 -5
  24. package/dist/account/default.d.ts +5 -9
  25. package/dist/account/default.js +35 -169
  26. package/dist/account/interface.d.ts +3 -15
  27. package/dist/contract/contractFactory.js +4 -4
  28. package/dist/contract/default.d.ts +3 -3
  29. package/dist/contract/default.js +3 -2
  30. package/dist/contract/interface.d.ts +2 -2
  31. package/dist/provider/default.d.ts +18 -134
  32. package/dist/provider/default.js +47 -411
  33. package/dist/provider/index.d.ts +2 -0
  34. package/dist/provider/index.js +2 -0
  35. package/dist/provider/interface.d.ts +45 -50
  36. package/dist/provider/rpc.d.ts +57 -0
  37. package/dist/provider/rpc.js +364 -0
  38. package/dist/provider/sequencer.d.ts +66 -0
  39. package/dist/provider/sequencer.js +444 -0
  40. package/dist/types/account.d.ts +2 -3
  41. package/dist/types/api/index.d.ts +16 -0
  42. package/dist/types/api/index.js +18 -0
  43. package/dist/types/api/rpc.d.ts +221 -0
  44. package/dist/types/{api.js → api/rpc.js} +0 -0
  45. package/dist/types/api/sequencer.d.ts +289 -0
  46. package/dist/types/api/sequencer.js +2 -0
  47. package/dist/types/index.d.ts +3 -1
  48. package/dist/types/index.js +15 -1
  49. package/dist/types/lib.d.ts +3 -1
  50. package/dist/types/provider.d.ts +86 -0
  51. package/dist/types/provider.js +2 -0
  52. package/dist/utils/fetchPonyfill.d.ts +2 -0
  53. package/dist/utils/fetchPonyfill.js +6 -0
  54. package/dist/utils/provider.d.ts +4 -0
  55. package/dist/utils/provider.js +38 -0
  56. package/dist/utils/responseParser/index.d.ts +11 -0
  57. package/dist/utils/responseParser/index.js +9 -0
  58. package/dist/utils/responseParser/rpc.d.ts +13 -0
  59. package/dist/utils/responseParser/rpc.js +96 -0
  60. package/dist/utils/responseParser/sequencer.d.ts +13 -0
  61. package/dist/utils/responseParser/sequencer.js +124 -0
  62. package/index.js +42 -75
  63. package/package.json +2 -3
  64. package/provider/default.d.ts +21 -175
  65. package/provider/default.js +139 -704
  66. package/provider/errors.d.ts +4 -4
  67. package/provider/errors.js +30 -40
  68. package/provider/index.d.ts +2 -0
  69. package/provider/index.js +22 -33
  70. package/provider/interface.d.ts +104 -131
  71. package/provider/interface.js +6 -5
  72. package/provider/rpc.d.ts +57 -0
  73. package/provider/rpc.js +364 -0
  74. package/provider/sequencer.d.ts +66 -0
  75. package/provider/sequencer.js +444 -0
  76. package/provider/utils.d.ts +7 -9
  77. package/provider/utils.js +39 -44
  78. package/signer/default.d.ts +5 -9
  79. package/signer/default.js +72 -177
  80. package/signer/index.js +18 -31
  81. package/signer/interface.d.ts +29 -33
  82. package/signer/interface.js +6 -5
  83. package/src/account/default.ts +26 -146
  84. package/src/account/interface.ts +5 -20
  85. package/src/contract/contractFactory.ts +3 -6
  86. package/src/contract/default.ts +6 -4
  87. package/src/contract/interface.ts +2 -2
  88. package/src/provider/default.ts +63 -395
  89. package/src/provider/index.ts +2 -0
  90. package/src/provider/interface.ts +68 -63
  91. package/src/provider/rpc.ts +299 -0
  92. package/src/provider/sequencer.ts +385 -0
  93. package/src/types/account.ts +2 -3
  94. package/src/types/api/index.ts +17 -0
  95. package/src/types/api/rpc.ts +247 -0
  96. package/src/types/api/sequencer.ts +331 -0
  97. package/src/types/index.ts +3 -1
  98. package/src/types/lib.ts +3 -1
  99. package/src/types/provider.ts +108 -0
  100. package/src/utils/fetchPonyfill.ts +4 -0
  101. package/src/utils/provider.ts +28 -0
  102. package/src/utils/responseParser/index.ts +28 -0
  103. package/src/utils/responseParser/rpc.ts +93 -0
  104. package/src/utils/responseParser/sequencer.ts +127 -0
  105. package/types/account.d.ts +5 -7
  106. package/types/account.js +2 -2
  107. package/types/api/index.d.ts +16 -0
  108. package/types/api/index.js +18 -0
  109. package/types/api/rpc.d.ts +221 -0
  110. package/types/api/rpc.js +2 -0
  111. package/types/api/sequencer.d.ts +289 -0
  112. package/types/api/sequencer.js +2 -0
  113. package/types/contract.d.ts +1 -1
  114. package/types/contract.js +2 -2
  115. package/types/index.d.ts +3 -1
  116. package/types/index.js +35 -34
  117. package/types/lib.d.ts +36 -41
  118. package/types/lib.js +2 -2
  119. package/types/provider.d.ts +86 -0
  120. package/types/provider.js +2 -0
  121. package/types/signer.d.ts +2 -2
  122. package/types/signer.js +2 -2
  123. package/utils/address.js +26 -37
  124. package/utils/ellipticCurve.d.ts +1 -6
  125. package/utils/ellipticCurve.js +73 -137
  126. package/utils/encode.js +49 -85
  127. package/utils/fetchPonyfill.d.ts +2 -0
  128. package/utils/fetchPonyfill.js +6 -0
  129. package/utils/hash.d.ts +4 -31
  130. package/utils/hash.js +76 -141
  131. package/utils/json.d.ts +13 -45
  132. package/utils/json.js +15 -22
  133. package/utils/number.d.ts +2 -9
  134. package/utils/number.js +47 -81
  135. package/utils/provider.d.ts +4 -0
  136. package/utils/provider.js +38 -0
  137. package/utils/responseParser/index.d.ts +11 -0
  138. package/utils/responseParser/index.js +9 -0
  139. package/utils/responseParser/rpc.d.ts +13 -0
  140. package/utils/responseParser/rpc.js +96 -0
  141. package/utils/responseParser/sequencer.d.ts +13 -0
  142. package/utils/responseParser/sequencer.js +124 -0
  143. package/utils/shortString.js +13 -21
  144. package/utils/stark.d.ts +0 -1
  145. package/utils/stark.js +59 -93
  146. package/utils/transaction.d.ts +3 -6
  147. package/utils/transaction.js +50 -81
  148. package/utils/typedData/index.d.ts +3 -15
  149. package/utils/typedData/index.js +109 -175
  150. package/utils/typedData/types.d.ts +9 -9
  151. package/utils/typedData/types.js +2 -2
  152. package/utils/typedData/utils.js +6 -6
  153. package/utils/uint256.d.ts +5 -5
  154. package/utils/uint256.js +16 -26
  155. package/www/docs/API/account.md +3 -4
  156. package/www/docs/API/contract.md +2 -2
  157. package/www/docs/API/contractFactory.md +2 -2
  158. package/www/docs/API/provider.md +185 -74
  159. package/www/guides/account.md +1 -8
  160. package/www/guides/erc20.md +3 -0
  161. package/__tests__/provider.test.ts +0 -168
  162. package/dist/types/api.d.ts +0 -261
  163. package/src/types/api.ts +0 -303
  164. package/types/api.d.ts +0 -287
  165. package/types/api.js +0 -2
@@ -1,261 +0,0 @@
1
- import BN from 'bn.js';
2
- import { BlockIdentifier } from '../provider/utils';
3
- import { BigNumberish } from '../utils/number';
4
- import { Abi, BlockNumber, CompressedCompiledContract, EntryPointType, RawCalldata, Signature, Status, TransactionStatus } from './lib';
5
- export declare type Endpoints = {
6
- get_contract_addresses: {
7
- QUERY: never;
8
- REQUEST: never;
9
- RESPONSE: GetContractAddressesResponse;
10
- };
11
- add_transaction: {
12
- QUERY: never;
13
- REQUEST: Transaction;
14
- RESPONSE: AddTransactionResponse;
15
- };
16
- get_transaction: {
17
- QUERY: {
18
- transactionHash: string;
19
- };
20
- REQUEST: never;
21
- RESPONSE: GetTransactionResponse;
22
- };
23
- get_transaction_status: {
24
- QUERY: {
25
- transactionHash: string;
26
- };
27
- REQUEST: never;
28
- RESPONSE: GetTransactionStatusResponse;
29
- };
30
- get_transaction_trace: {
31
- QUERY: {
32
- transactionHash: string;
33
- };
34
- REQUEST: never;
35
- RESPONSE: GetTransactionTraceResponse;
36
- };
37
- get_transaction_receipt: {
38
- QUERY: {
39
- transactionHash: string;
40
- };
41
- REQUEST: never;
42
- RESPONSE: TransactionReceiptResponse;
43
- };
44
- get_storage_at: {
45
- QUERY: {
46
- contractAddress: string;
47
- key: BigNumberish;
48
- blockIdentifier: BlockIdentifier;
49
- };
50
- REQUEST: never;
51
- RESPONSE: object;
52
- };
53
- get_code: {
54
- QUERY: {
55
- contractAddress: string;
56
- blockIdentifier: BlockIdentifier;
57
- };
58
- REQUEST: never;
59
- RESPONSE: GetCodeResponse;
60
- };
61
- get_block: {
62
- QUERY: {
63
- blockIdentifier: BlockIdentifier;
64
- };
65
- REQUEST: never;
66
- RESPONSE: GetBlockResponse;
67
- };
68
- call_contract: {
69
- QUERY: {
70
- blockIdentifier: BlockIdentifier;
71
- };
72
- REQUEST: CallContractTransaction;
73
- RESPONSE: CallContractResponse;
74
- };
75
- estimate_fee: {
76
- QUERY: {
77
- blockIdentifier: BlockIdentifier;
78
- };
79
- REQUEST: CallContractTransaction;
80
- RESPONSE: EstimateFeeResponse;
81
- };
82
- };
83
- export declare type GetContractAddressesResponse = {
84
- Starknet: string;
85
- GpsStatementVerifier: string;
86
- };
87
- export declare type DeclareTransaction = {
88
- type: 'DECLARE';
89
- contract_class: CompressedCompiledContract;
90
- nonce: BigNumberish;
91
- sender_address: BigNumberish;
92
- signature: Signature;
93
- };
94
- export declare type DeployTransaction = {
95
- type: 'DEPLOY';
96
- contract_definition: CompressedCompiledContract;
97
- contract_address_salt: BigNumberish;
98
- constructor_calldata: string[];
99
- nonce?: BigNumberish;
100
- };
101
- export declare type InvokeFunctionTransaction = {
102
- type: 'INVOKE_FUNCTION';
103
- contract_address: string;
104
- signature?: Signature;
105
- entry_point_type?: EntryPointType;
106
- entry_point_selector: string;
107
- calldata?: RawCalldata;
108
- nonce?: BigNumberish;
109
- max_fee?: BigNumberish;
110
- version?: BigNumberish;
111
- };
112
- export interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction {
113
- transaction_hash: string;
114
- }
115
- export declare type InvokeFunctionTrace = {
116
- caller_address: string;
117
- contract_address: string;
118
- code_address: string;
119
- selector: string;
120
- calldata: RawCalldata;
121
- result: Array<any>;
122
- execution_resources: ExecutionResources;
123
- internal_call: Array<InvokeFunctionTrace>;
124
- events: Array<any>;
125
- messages: Array<any>;
126
- };
127
- export declare type ExecutionResources = {
128
- n_steps: number;
129
- builtin_instance_counter: {
130
- pedersen_builtin: number;
131
- range_check_builtin: number;
132
- bitwise_builtin: number;
133
- output_builtin: number;
134
- ecdsa_builtin: number;
135
- ec_op_builtin?: number;
136
- };
137
- n_memory_holes: number;
138
- };
139
- export declare type CallContractTransaction = Omit<InvokeFunctionTransaction, 'type' | 'entry_point_type' | 'nonce'>;
140
- export declare type Transaction = DeclareTransaction | DeployTransaction | InvokeFunctionTransaction;
141
- export declare type TransactionResponse = DeclareTransaction | DeployTransaction | InvokeFunctionTransactionResponse;
142
- export declare type CallContractResponse = {
143
- result: string[];
144
- };
145
- export declare type GetBlockResponse = {
146
- block_number: number;
147
- state_root: string;
148
- block_hash: string;
149
- transactions: {
150
- [txHash: string]: TransactionResponse;
151
- };
152
- timestamp: number;
153
- transaction_receipts: {
154
- [txHash: string]: {
155
- block_hash: string;
156
- transaction_hash: string;
157
- l2_to_l1_messages: {
158
- to_address: string;
159
- payload: string[];
160
- from_address: string;
161
- }[];
162
- block_number: BlockNumber;
163
- status: Status;
164
- transaction_index: number;
165
- };
166
- };
167
- parent_block_hash: string;
168
- status: Status;
169
- gas_price: string;
170
- starknet_version?: string;
171
- };
172
- export declare type GetCodeResponse = {
173
- bytecode: string[];
174
- abi: Abi;
175
- };
176
- export declare type GetTransactionStatusResponse = {
177
- tx_status: Status;
178
- block_hash?: string;
179
- tx_failure_reason?: {
180
- code: string;
181
- error_message: string;
182
- };
183
- };
184
- export declare type GetTransactionTraceResponse = {
185
- function_invocation: {
186
- caller_address: string;
187
- contract_address: string;
188
- code_address: string;
189
- selector: string;
190
- calldata: RawArgs;
191
- result: Array<any>;
192
- execution_resources: ExecutionResources;
193
- internal_call: Array<any>;
194
- events: Array<any>;
195
- messages: Array<any>;
196
- };
197
- signature: Signature;
198
- };
199
- export declare type SuccessfulTransactionResponse = {
200
- status: Status;
201
- transaction: TransactionResponse;
202
- block_hash: string;
203
- block_number: BlockNumber;
204
- transaction_index: number;
205
- };
206
- export declare type FailedTransactionResponse = {
207
- status: 'REJECTED';
208
- transaction_failure_reason: {
209
- code: string;
210
- error_message: string;
211
- };
212
- transaction: TransactionResponse;
213
- };
214
- export declare type GetTransactionResponse = SuccessfulTransactionResponse | FailedTransactionResponse;
215
- export declare type AddTransactionResponse = {
216
- code: TransactionStatus;
217
- transaction_hash: string;
218
- address?: string;
219
- class_hash?: string;
220
- };
221
- export declare type SuccessfulTransactionReceiptResponse = {
222
- status: Status;
223
- transaction_hash: string;
224
- transaction_index: number;
225
- block_hash: string;
226
- block_number: BlockNumber;
227
- l2_to_l1_messages: string[];
228
- events: string[];
229
- actual_fee: string;
230
- execution_resources: ExecutionResources;
231
- };
232
- export declare type FailedTransactionReceiptResponse = {
233
- status: 'REJECTED';
234
- transaction_failure_reason: {
235
- code: string;
236
- error_message: string;
237
- };
238
- transaction_hash: string;
239
- l2_to_l1_messages: string[];
240
- events: string[];
241
- };
242
- export declare type TransactionReceiptResponse = SuccessfulTransactionReceiptResponse | FailedTransactionReceiptResponse;
243
- export declare type EstimateFeeResponse = {
244
- overall_fee?: BN;
245
- amount?: BN;
246
- unit: string;
247
- gas_price?: BN;
248
- gas_usage?: BigNumberish;
249
- };
250
- export declare type RawArgs = {
251
- [inputName: string]: string | string[] | {
252
- type: 'struct';
253
- [k: string]: BigNumberish;
254
- };
255
- };
256
- export declare type Calldata = string[];
257
- export declare type Overrides = {
258
- maxFee?: BigNumberish;
259
- nonce?: BigNumberish;
260
- signature?: Signature;
261
- };
package/src/types/api.ts DELETED
@@ -1,303 +0,0 @@
1
- import BN from 'bn.js';
2
-
3
- import { BlockIdentifier } from '../provider/utils';
4
- import { BigNumberish } from '../utils/number';
5
- import {
6
- Abi,
7
- BlockNumber,
8
- CompressedCompiledContract,
9
- EntryPointType,
10
- RawCalldata,
11
- Signature,
12
- Status,
13
- TransactionStatus,
14
- } from './lib';
15
-
16
- export type Endpoints = {
17
- get_contract_addresses: {
18
- QUERY: never;
19
- REQUEST: never;
20
- RESPONSE: GetContractAddressesResponse;
21
- };
22
- add_transaction: {
23
- QUERY: never;
24
- REQUEST: Transaction;
25
- RESPONSE: AddTransactionResponse;
26
- };
27
- get_transaction: {
28
- QUERY: {
29
- transactionHash: string;
30
- };
31
- REQUEST: never;
32
- RESPONSE: GetTransactionResponse;
33
- };
34
- get_transaction_status: {
35
- QUERY: {
36
- transactionHash: string;
37
- };
38
- REQUEST: never;
39
- RESPONSE: GetTransactionStatusResponse;
40
- };
41
- get_transaction_trace: {
42
- QUERY: {
43
- transactionHash: string;
44
- };
45
- REQUEST: never;
46
- RESPONSE: GetTransactionTraceResponse;
47
- };
48
- get_transaction_receipt: {
49
- QUERY: {
50
- transactionHash: string;
51
- };
52
- REQUEST: never;
53
- RESPONSE: TransactionReceiptResponse;
54
- };
55
- get_storage_at: {
56
- QUERY: {
57
- contractAddress: string;
58
- key: BigNumberish;
59
- blockIdentifier: BlockIdentifier;
60
- };
61
- REQUEST: never;
62
- RESPONSE: object;
63
- };
64
- get_code: {
65
- QUERY: {
66
- contractAddress: string;
67
- blockIdentifier: BlockIdentifier;
68
- };
69
- REQUEST: never;
70
- RESPONSE: GetCodeResponse;
71
- };
72
- get_block: {
73
- QUERY: {
74
- blockIdentifier: BlockIdentifier;
75
- };
76
- REQUEST: never;
77
- RESPONSE: GetBlockResponse;
78
- };
79
- call_contract: {
80
- QUERY: {
81
- blockIdentifier: BlockIdentifier;
82
- };
83
- REQUEST: CallContractTransaction;
84
- RESPONSE: CallContractResponse;
85
- };
86
- estimate_fee: {
87
- QUERY: {
88
- blockIdentifier: BlockIdentifier;
89
- };
90
- REQUEST: CallContractTransaction;
91
- RESPONSE: EstimateFeeResponse;
92
- };
93
- };
94
-
95
- export type GetContractAddressesResponse = {
96
- Starknet: string;
97
- GpsStatementVerifier: string;
98
- };
99
-
100
- export type DeclareTransaction = {
101
- type: 'DECLARE';
102
- contract_class: CompressedCompiledContract;
103
- nonce: BigNumberish;
104
- sender_address: BigNumberish;
105
- signature: Signature;
106
- };
107
-
108
- export type DeployTransaction = {
109
- type: 'DEPLOY';
110
- contract_definition: CompressedCompiledContract;
111
- contract_address_salt: BigNumberish;
112
- constructor_calldata: string[];
113
- nonce?: BigNumberish;
114
- };
115
-
116
- export type InvokeFunctionTransaction = {
117
- type: 'INVOKE_FUNCTION';
118
- contract_address: string;
119
- signature?: Signature;
120
- entry_point_type?: EntryPointType;
121
- entry_point_selector: string;
122
- calldata?: RawCalldata;
123
- nonce?: BigNumberish;
124
- max_fee?: BigNumberish;
125
- version?: BigNumberish;
126
- };
127
-
128
- export interface InvokeFunctionTransactionResponse extends InvokeFunctionTransaction {
129
- transaction_hash: string;
130
- }
131
-
132
- export type InvokeFunctionTrace = {
133
- caller_address: string;
134
- contract_address: string;
135
- code_address: string;
136
- selector: string;
137
- calldata: RawCalldata;
138
- result: Array<any>;
139
- execution_resources: ExecutionResources;
140
- internal_call: Array<InvokeFunctionTrace>;
141
- events: Array<any>;
142
- messages: Array<any>;
143
- };
144
-
145
- export type ExecutionResources = {
146
- n_steps: number;
147
- builtin_instance_counter: {
148
- pedersen_builtin: number;
149
- range_check_builtin: number;
150
- bitwise_builtin: number;
151
- output_builtin: number;
152
- ecdsa_builtin: number;
153
- ec_op_builtin?: number;
154
- };
155
- n_memory_holes: number;
156
- };
157
-
158
- export type CallContractTransaction = Omit<
159
- InvokeFunctionTransaction,
160
- 'type' | 'entry_point_type' | 'nonce'
161
- >;
162
-
163
- export type Transaction = DeclareTransaction | DeployTransaction | InvokeFunctionTransaction;
164
- export type TransactionResponse =
165
- | DeclareTransaction
166
- | DeployTransaction
167
- | InvokeFunctionTransactionResponse;
168
-
169
- export type CallContractResponse = {
170
- result: string[];
171
- };
172
-
173
- export type GetBlockResponse = {
174
- block_number: number;
175
- state_root: string;
176
- block_hash: string;
177
- transactions: {
178
- [txHash: string]: TransactionResponse;
179
- };
180
- timestamp: number;
181
- transaction_receipts: {
182
- [txHash: string]: {
183
- block_hash: string;
184
- transaction_hash: string;
185
- l2_to_l1_messages: {
186
- to_address: string;
187
- payload: string[];
188
- from_address: string;
189
- }[];
190
- block_number: BlockNumber;
191
- status: Status;
192
- transaction_index: number;
193
- };
194
- };
195
- parent_block_hash: string;
196
- status: Status;
197
- gas_price: string;
198
- starknet_version?: string;
199
- };
200
-
201
- export type GetCodeResponse = {
202
- bytecode: string[];
203
- abi: Abi;
204
- };
205
-
206
- export type GetTransactionStatusResponse = {
207
- tx_status: Status;
208
- block_hash?: string;
209
- tx_failure_reason?: {
210
- code: string;
211
- error_message: string;
212
- };
213
- };
214
-
215
- export type GetTransactionTraceResponse = {
216
- function_invocation: {
217
- caller_address: string;
218
- contract_address: string;
219
- code_address: string;
220
- selector: string;
221
- calldata: RawArgs;
222
- result: Array<any>;
223
- execution_resources: ExecutionResources;
224
- internal_call: Array<any>;
225
- events: Array<any>;
226
- messages: Array<any>;
227
- };
228
- signature: Signature;
229
- };
230
-
231
- export type SuccessfulTransactionResponse = {
232
- status: Status;
233
- transaction: TransactionResponse;
234
- block_hash: string;
235
- block_number: BlockNumber;
236
- transaction_index: number;
237
- };
238
-
239
- export type FailedTransactionResponse = {
240
- status: 'REJECTED';
241
- transaction_failure_reason: {
242
- code: string;
243
- error_message: string;
244
- };
245
- transaction: TransactionResponse;
246
- };
247
-
248
- export type GetTransactionResponse = SuccessfulTransactionResponse | FailedTransactionResponse;
249
-
250
- export type AddTransactionResponse = {
251
- code: TransactionStatus;
252
- transaction_hash: string;
253
- address?: string;
254
- class_hash?: string;
255
- };
256
-
257
- export type SuccessfulTransactionReceiptResponse = {
258
- status: Status;
259
- transaction_hash: string;
260
- transaction_index: number;
261
- block_hash: string;
262
- block_number: BlockNumber;
263
- l2_to_l1_messages: string[];
264
- events: string[];
265
- actual_fee: string;
266
- execution_resources: ExecutionResources;
267
- };
268
-
269
- export type FailedTransactionReceiptResponse = {
270
- status: 'REJECTED';
271
- transaction_failure_reason: {
272
- code: string;
273
- error_message: string;
274
- };
275
- transaction_hash: string;
276
- l2_to_l1_messages: string[];
277
- events: string[];
278
- };
279
-
280
- export type TransactionReceiptResponse =
281
- | SuccessfulTransactionReceiptResponse
282
- | FailedTransactionReceiptResponse;
283
-
284
- // Support 0.9.1 changes in a backward-compatible way
285
- export type EstimateFeeResponse = {
286
- overall_fee?: BN;
287
- amount?: BN;
288
- unit: string;
289
- gas_price?: BN;
290
- gas_usage?: BigNumberish;
291
- };
292
-
293
- export type RawArgs = {
294
- [inputName: string]: string | string[] | { type: 'struct'; [k: string]: BigNumberish };
295
- };
296
-
297
- export type Calldata = string[];
298
-
299
- export type Overrides = {
300
- maxFee?: BigNumberish;
301
- nonce?: BigNumberish;
302
- signature?: Signature;
303
- };