@fuel-ts/account 0.0.0-rc-1889-20240322122653 → 0.0.0-rc-1356-20240322130951

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.

Potentially problematic release.


This version of @fuel-ts/account might be problematic. Click here for more details.

Files changed (218) hide show
  1. package/dist/account.d.ts +177 -0
  2. package/dist/account.d.ts.map +1 -0
  3. package/dist/configs.d.ts +2 -3
  4. package/dist/configs.d.ts.map +1 -0
  5. package/dist/connectors/fuel-connector.d.ts +188 -0
  6. package/dist/connectors/fuel-connector.d.ts.map +1 -0
  7. package/dist/connectors/fuel.d.ts +133 -0
  8. package/dist/connectors/fuel.d.ts.map +1 -0
  9. package/dist/connectors/index.d.ts +5 -0
  10. package/dist/connectors/index.d.ts.map +1 -0
  11. package/dist/connectors/types/connector-metadata.d.ts +12 -0
  12. package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
  13. package/dist/connectors/types/connector-types.d.ts +34 -0
  14. package/dist/connectors/types/connector-types.d.ts.map +1 -0
  15. package/dist/connectors/types/data-type.d.ts +34 -0
  16. package/dist/connectors/types/data-type.d.ts.map +1 -0
  17. package/dist/connectors/types/events.d.ts +111 -0
  18. package/dist/connectors/types/events.d.ts.map +1 -0
  19. package/dist/connectors/types/index.d.ts +7 -0
  20. package/dist/connectors/types/index.d.ts.map +1 -0
  21. package/dist/connectors/types/local-storage.d.ts +11 -0
  22. package/dist/connectors/types/local-storage.d.ts.map +1 -0
  23. package/dist/connectors/types/target-object.d.ts +14 -0
  24. package/dist/connectors/types/target-object.d.ts.map +1 -0
  25. package/dist/connectors/utils/cache.d.ts +14 -0
  26. package/dist/connectors/utils/cache.d.ts.map +1 -0
  27. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
  28. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
  29. package/dist/connectors/utils/index.d.ts +4 -0
  30. package/dist/connectors/utils/index.d.ts.map +1 -0
  31. package/dist/connectors/utils/promises.d.ts +8 -0
  32. package/dist/connectors/utils/promises.d.ts.map +1 -0
  33. package/dist/hdwallet/hdwallet.d.ts +58 -0
  34. package/dist/hdwallet/hdwallet.d.ts.map +1 -0
  35. package/dist/hdwallet/index.d.ts +2 -0
  36. package/dist/hdwallet/index.d.ts.map +1 -0
  37. package/dist/index.d.ts +13 -904
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.global.js +461 -394
  40. package/dist/index.global.js.map +1 -1
  41. package/dist/index.js +350 -314
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +251 -212
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/mnemonic/index.d.ts +3 -0
  46. package/dist/mnemonic/index.d.ts.map +1 -0
  47. package/dist/mnemonic/mnemonic.d.ts +85 -0
  48. package/dist/mnemonic/mnemonic.d.ts.map +1 -0
  49. package/dist/mnemonic/utils.d.ts +8 -0
  50. package/dist/mnemonic/utils.d.ts.map +1 -0
  51. package/dist/predicate/index.d.ts +3 -0
  52. package/dist/predicate/index.d.ts.map +1 -0
  53. package/dist/predicate/predicate.d.ts +94 -0
  54. package/dist/predicate/predicate.d.ts.map +1 -0
  55. package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
  56. package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
  57. package/dist/predicate/utils/index.d.ts +2 -0
  58. package/dist/predicate/utils/index.d.ts.map +1 -0
  59. package/dist/providers/__generated__/operations.d.ts +3477 -0
  60. package/dist/providers/__generated__/operations.d.ts.map +1 -0
  61. package/dist/providers/assets/index.d.ts +5 -0
  62. package/dist/providers/assets/index.d.ts.map +1 -0
  63. package/dist/providers/assets/types.d.ts +36 -0
  64. package/dist/providers/assets/types.d.ts.map +1 -0
  65. package/dist/providers/assets/utils/index.d.ts +4 -0
  66. package/dist/providers/assets/utils/index.d.ts.map +1 -0
  67. package/dist/providers/assets/utils/network.d.ts +33 -0
  68. package/dist/providers/assets/utils/network.d.ts.map +1 -0
  69. package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
  70. package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
  71. package/dist/providers/assets/utils/url.d.ts +2 -0
  72. package/dist/providers/assets/utils/url.d.ts.map +1 -0
  73. package/dist/providers/chains.d.ts +11 -0
  74. package/dist/providers/chains.d.ts.map +1 -0
  75. package/dist/providers/coin-quantity.d.ts +21 -0
  76. package/dist/providers/coin-quantity.d.ts.map +1 -0
  77. package/dist/providers/coin.d.ts +15 -0
  78. package/dist/providers/coin.d.ts.map +1 -0
  79. package/dist/providers/fuel-graphql-subscriber.d.ts +23 -0
  80. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
  81. package/dist/providers/index.d.ts +13 -0
  82. package/dist/providers/index.d.ts.map +1 -0
  83. package/dist/providers/memory-cache.d.ts +11 -0
  84. package/dist/providers/memory-cache.d.ts.map +1 -0
  85. package/dist/providers/message.d.ts +60 -0
  86. package/dist/providers/message.d.ts.map +1 -0
  87. package/dist/providers/provider.d.ts +522 -0
  88. package/dist/providers/provider.d.ts.map +1 -0
  89. package/dist/providers/resource.d.ts +37 -0
  90. package/dist/providers/resource.d.ts.map +1 -0
  91. package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
  92. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
  93. package/dist/providers/transaction-request/errors.d.ts +25 -0
  94. package/dist/providers/transaction-request/errors.d.ts.map +1 -0
  95. package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
  96. package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
  97. package/dist/providers/transaction-request/index.d.ts +10 -0
  98. package/dist/providers/transaction-request/index.d.ts.map +1 -0
  99. package/dist/providers/transaction-request/input.d.ts +59 -0
  100. package/dist/providers/transaction-request/input.d.ts.map +1 -0
  101. package/dist/providers/transaction-request/output.d.ts +39 -0
  102. package/dist/providers/transaction-request/output.d.ts.map +1 -0
  103. package/dist/providers/transaction-request/script-transaction-request.d.ts +106 -0
  104. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
  105. package/dist/providers/transaction-request/scripts.d.ts +6 -0
  106. package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
  107. package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
  108. package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
  109. package/dist/providers/transaction-request/transaction-request.d.ts +259 -0
  110. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
  111. package/dist/providers/transaction-request/types.d.ts +10 -0
  112. package/dist/providers/transaction-request/types.d.ts.map +1 -0
  113. package/dist/providers/transaction-request/utils.d.ts +4 -0
  114. package/dist/providers/transaction-request/utils.d.ts.map +1 -0
  115. package/dist/providers/transaction-request/witness.d.ts +5 -0
  116. package/dist/providers/transaction-request/witness.d.ts.map +1 -0
  117. package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
  118. package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
  119. package/dist/providers/transaction-response/index.d.ts +3 -0
  120. package/dist/providers/transaction-response/index.d.ts.map +1 -0
  121. package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
  122. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
  123. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
  124. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
  125. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
  126. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
  127. package/dist/providers/transaction-summary/call.d.ts +18 -0
  128. package/dist/providers/transaction-summary/call.d.ts.map +1 -0
  129. package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
  130. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
  131. package/dist/providers/transaction-summary/index.d.ts +10 -0
  132. package/dist/providers/transaction-summary/index.d.ts.map +1 -0
  133. package/dist/providers/transaction-summary/input.d.ts +21 -0
  134. package/dist/providers/transaction-summary/input.d.ts.map +1 -0
  135. package/dist/providers/transaction-summary/operations.d.ts +40 -0
  136. package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
  137. package/dist/providers/transaction-summary/output.d.ts +15 -0
  138. package/dist/providers/transaction-summary/output.d.ts.map +1 -0
  139. package/dist/providers/transaction-summary/receipt.d.ts +7 -0
  140. package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
  141. package/dist/providers/transaction-summary/status.d.ts +9 -0
  142. package/dist/providers/transaction-summary/status.d.ts.map +1 -0
  143. package/dist/providers/transaction-summary/types.d.ts +146 -0
  144. package/dist/providers/transaction-summary/types.d.ts.map +1 -0
  145. package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
  146. package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
  147. package/dist/providers/utils/block-explorer.d.ts +14 -0
  148. package/dist/providers/utils/block-explorer.d.ts.map +1 -0
  149. package/dist/providers/utils/gas.d.ts +38 -0
  150. package/dist/providers/utils/gas.d.ts.map +1 -0
  151. package/dist/providers/utils/index.d.ts +5 -0
  152. package/dist/providers/utils/index.d.ts.map +1 -0
  153. package/dist/providers/utils/json.d.ts +7 -0
  154. package/dist/providers/utils/json.d.ts.map +1 -0
  155. package/dist/providers/utils/merge-quantities.d.ts +3 -0
  156. package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
  157. package/dist/providers/utils/receipts.d.ts +10 -0
  158. package/dist/providers/utils/receipts.d.ts.map +1 -0
  159. package/dist/signer/index.d.ts +2 -0
  160. package/dist/signer/index.d.ts.map +1 -0
  161. package/dist/signer/signer.d.ts +64 -0
  162. package/dist/signer/signer.d.ts.map +1 -0
  163. package/dist/test-utils/asset-id.d.ts +9 -0
  164. package/dist/test-utils/asset-id.d.ts.map +1 -0
  165. package/dist/test-utils/generateTestWallet.d.ts +4 -0
  166. package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
  167. package/dist/test-utils/index.d.ts +8 -0
  168. package/dist/test-utils/index.d.ts.map +1 -0
  169. package/dist/{test-utils.d.ts → test-utils/launchNode.d.ts} +19 -24
  170. package/dist/test-utils/launchNode.d.ts.map +1 -0
  171. package/dist/test-utils/seedTestWallet.d.ts +4 -0
  172. package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
  173. package/dist/test-utils/setup-test-provider-and-wallets.d.ts +33 -0
  174. package/dist/test-utils/setup-test-provider-and-wallets.d.ts.map +1 -0
  175. package/dist/test-utils/test-message.d.ts +28 -0
  176. package/dist/test-utils/test-message.d.ts.map +1 -0
  177. package/dist/test-utils/wallet-config.d.ts +49 -0
  178. package/dist/test-utils/wallet-config.d.ts.map +1 -0
  179. package/dist/test-utils.global.js +655 -310
  180. package/dist/test-utils.global.js.map +1 -1
  181. package/dist/test-utils.js +452 -217
  182. package/dist/test-utils.js.map +1 -1
  183. package/dist/test-utils.mjs +357 -124
  184. package/dist/test-utils.mjs.map +1 -1
  185. package/dist/utils/formatTransferToContractScriptData.d.ts +14 -0
  186. package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
  187. package/dist/wallet/base-wallet-unlocked.d.ts +73 -0
  188. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -0
  189. package/dist/wallet/index.d.ts +4 -0
  190. package/dist/wallet/index.d.ts.map +1 -0
  191. package/dist/wallet/keystore-wallet.d.ts +38 -0
  192. package/dist/wallet/keystore-wallet.d.ts.map +1 -0
  193. package/dist/wallet/wallet.d.ts +68 -0
  194. package/dist/wallet/wallet.d.ts.map +1 -0
  195. package/dist/wallet/wallets.d.ts +76 -0
  196. package/dist/wallet/wallets.d.ts.map +1 -0
  197. package/dist/wallet-manager/index.d.ts +6 -0
  198. package/dist/wallet-manager/index.d.ts.map +1 -0
  199. package/dist/wallet-manager/storages/memory-storage.d.ts +9 -0
  200. package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
  201. package/dist/wallet-manager/types.d.ts +42 -0
  202. package/dist/wallet-manager/types.d.ts.map +1 -0
  203. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +29 -0
  204. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
  205. package/dist/wallet-manager/vaults/privatekey-vault.d.ts +29 -0
  206. package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
  207. package/dist/wallet-manager/wallet-manager.d.ts +104 -0
  208. package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
  209. package/dist/wordlists/index.d.ts +5 -0
  210. package/dist/wordlists/index.d.ts.map +1 -0
  211. package/dist/wordlists/words/english.d.ts +2 -0
  212. package/dist/wordlists/words/english.d.ts.map +1 -0
  213. package/package.json +26 -21
  214. package/dist/account-E9nGNf5X.d.mts +0 -3837
  215. package/dist/account-E9nGNf5X.d.ts +0 -3837
  216. package/dist/configs.d.mts +0 -3
  217. package/dist/index.d.mts +0 -904
  218. package/dist/test-utils.d.mts +0 -66
@@ -0,0 +1,522 @@
1
+ /// <reference types="web" />
2
+ import type { AbstractAccount, AbstractAddress, BytesLike } from '@fuel-ts/interfaces';
3
+ import { BN } from '@fuel-ts/math';
4
+ import type { Transaction } from '@fuel-ts/transactions';
5
+ import { Network } from 'ethers';
6
+ import { getSdk as getOperationsSdk } from './__generated__/operations';
7
+ import type { GqlGasCosts, GqlGetBlocksQueryVariables, GqlPeerInfo } from './__generated__/operations';
8
+ import type { Coin } from './coin';
9
+ import type { CoinQuantity, CoinQuantityLike } from './coin-quantity';
10
+ import { MemoryCache } from './memory-cache';
11
+ import type { Message, MessageProof, MessageStatus } from './message';
12
+ import type { ExcludeResourcesOption, Resource } from './resource';
13
+ import type { TransactionRequestLike, TransactionRequest, TransactionRequestInput } from './transaction-request';
14
+ import type { TransactionResultReceipt } from './transaction-response';
15
+ import { TransactionResponse } from './transaction-response';
16
+ import type { RetryOptions } from './utils/auto-retry-fetch';
17
+ export type CallResult = {
18
+ receipts: TransactionResultReceipt[];
19
+ };
20
+ export type EstimateTxDependenciesReturns = CallResult & {
21
+ outputVariables: number;
22
+ missingContractIds: string[];
23
+ };
24
+ /**
25
+ * A Fuel block
26
+ */
27
+ export type Block = {
28
+ id: string;
29
+ height: BN;
30
+ time: string;
31
+ transactionIds: string[];
32
+ };
33
+ /**
34
+ * Deployed Contract bytecode and contract id
35
+ */
36
+ export type ContractResult = {
37
+ id: string;
38
+ bytecode: string;
39
+ };
40
+ type ConsensusParameters = {
41
+ contractMaxSize: BN;
42
+ maxInputs: BN;
43
+ maxOutputs: BN;
44
+ maxWitnesses: BN;
45
+ maxGasPerTx: BN;
46
+ maxScriptLength: BN;
47
+ maxScriptDataLength: BN;
48
+ maxStorageSlots: BN;
49
+ maxPredicateLength: BN;
50
+ maxPredicateDataLength: BN;
51
+ maxGasPerPredicate: BN;
52
+ gasPriceFactor: BN;
53
+ gasPerByte: BN;
54
+ maxMessageDataLength: BN;
55
+ chainId: BN;
56
+ gasCosts: GqlGasCosts;
57
+ };
58
+ /**
59
+ * Chain information
60
+ */
61
+ export type ChainInfo = {
62
+ name: string;
63
+ baseChainHeight: BN;
64
+ consensusParameters: ConsensusParameters;
65
+ gasCosts: GqlGasCosts;
66
+ latestBlock: {
67
+ id: string;
68
+ height: BN;
69
+ time: string;
70
+ transactions: Array<{
71
+ id: string;
72
+ }>;
73
+ };
74
+ };
75
+ /**
76
+ * Node information
77
+ */
78
+ export type NodeInfo = {
79
+ utxoValidation: boolean;
80
+ vmBacktrace: boolean;
81
+ minGasPrice: BN;
82
+ maxTx: BN;
83
+ maxDepth: BN;
84
+ nodeVersion: string;
85
+ peers: GqlPeerInfo[];
86
+ };
87
+ export type NodeInfoAndConsensusParameters = {
88
+ minGasPrice: BN;
89
+ nodeVersion: string;
90
+ gasPerByte: BN;
91
+ gasPriceFactor: BN;
92
+ maxGasPerTx: BN;
93
+ };
94
+ export type TransactionCost = {
95
+ requiredQuantities: CoinQuantity[];
96
+ receipts: TransactionResultReceipt[];
97
+ minGasPrice: BN;
98
+ gasPrice: BN;
99
+ minGas: BN;
100
+ maxGas: BN;
101
+ gasUsed: BN;
102
+ minFee: BN;
103
+ maxFee: BN;
104
+ usedFee: BN;
105
+ outputVariables: number;
106
+ missingContractIds: string[];
107
+ estimatedInputs: TransactionRequest['inputs'];
108
+ };
109
+ /**
110
+ * @hidden
111
+ *
112
+ * Cursor pagination arguments
113
+ *
114
+ * https://relay.dev/graphql/connections.htm#sec-Arguments
115
+ */
116
+ export type CursorPaginationArgs = {
117
+ /** Forward pagination limit */
118
+ first?: number | null;
119
+ /** Forward pagination cursor */
120
+ after?: string | null;
121
+ /** Backward pagination limit */
122
+ last?: number | null;
123
+ /** Backward pagination cursor */
124
+ before?: string | null;
125
+ };
126
+ export type ProviderOptions = {
127
+ /**
128
+ * Custom fetch function to use for making requests.
129
+ */
130
+ fetch?: (url: string, requestInit?: RequestInit, providerOptions?: Omit<ProviderOptions, 'fetch'>) => Promise<Response>;
131
+ /**
132
+ * Timeout [ms] after which every request will be aborted.
133
+ */
134
+ timeout?: number;
135
+ /**
136
+ * Cache UTXOs for the given time [ms].
137
+ */
138
+ cacheUtxo?: number;
139
+ /**
140
+ * Retry options to use when fetching data from the node.
141
+ */
142
+ retryOptions?: RetryOptions;
143
+ /**
144
+ * Middleware to modify the request before it is sent.
145
+ * This can be used to add headers, modify the body, etc.
146
+ */
147
+ requestMiddleware?: (request: RequestInit) => RequestInit | Promise<RequestInit>;
148
+ };
149
+ /**
150
+ * UTXO Validation Param
151
+ */
152
+ export type UTXOValidationParams = {
153
+ utxoValidation?: boolean;
154
+ };
155
+ /**
156
+ * Transaction estimation Param
157
+ */
158
+ export type EstimateTransactionParams = {
159
+ estimateTxDependencies?: boolean;
160
+ };
161
+ export type EstimatePredicateParams = {
162
+ estimatePredicates?: boolean;
163
+ };
164
+ export type TransactionCostParams = EstimateTransactionParams & EstimatePredicateParams & {
165
+ resourcesOwner?: AbstractAccount;
166
+ };
167
+ /**
168
+ * Provider Call transaction params
169
+ */
170
+ export type ProviderCallParams = UTXOValidationParams & EstimateTransactionParams;
171
+ /**
172
+ * Provider Send transaction params
173
+ */
174
+ export type ProviderSendTxParams = EstimateTransactionParams & {
175
+ /**
176
+ * By default, the promise will resolve immediately after the transaction is submitted.
177
+ *
178
+ * If set to true, the promise will resolve only when the transaction changes status
179
+ * from `SubmittedStatus` to one of `SuccessStatus`, `FailureStatus` or `SqueezedOutStatus`.
180
+ *
181
+ */
182
+ awaitExecution?: boolean;
183
+ };
184
+ /**
185
+ * A provider for connecting to a node
186
+ */
187
+ export default class Provider {
188
+ #private;
189
+ /** GraphQL endpoint of the Fuel node */
190
+ url: string;
191
+ operations: ReturnType<typeof getOperationsSdk>;
192
+ cache?: MemoryCache;
193
+ static clearChainAndNodeCaches(): void;
194
+ private static chainInfoCache;
195
+ private static nodeInfoCache;
196
+ options: ProviderOptions;
197
+ private static getFetchFn;
198
+ /**
199
+ * Constructor to initialize a Provider.
200
+ *
201
+ * @param url - GraphQL endpoint of the Fuel node
202
+ * @param chainInfo - Chain info of the Fuel node
203
+ * @param options - Additional options for the provider
204
+ * @hidden
205
+ */
206
+ protected constructor(
207
+ /** GraphQL endpoint of the Fuel node */
208
+ url: string, options?: ProviderOptions);
209
+ /**
210
+ * Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
211
+ * @param url - GraphQL endpoint of the Fuel node
212
+ * @param options - Additional options for the provider
213
+ */
214
+ static create(url: string, options?: ProviderOptions): Promise<Provider>;
215
+ /**
216
+ * Returns the cached chainInfo for the current URL.
217
+ */
218
+ getChain(): ChainInfo;
219
+ /**
220
+ * Returns the cached nodeInfo for the current URL.
221
+ */
222
+ getNode(): NodeInfo;
223
+ /**
224
+ * Returns some helpful parameters related to gas fees.
225
+ */
226
+ getGasConfig(): {
227
+ minGasPrice: BN;
228
+ maxGasPerTx: BN;
229
+ maxGasPerPredicate: BN;
230
+ gasPriceFactor: BN;
231
+ gasPerByte: BN;
232
+ gasCosts: GqlGasCosts;
233
+ };
234
+ /**
235
+ * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.
236
+ */
237
+ connect(url: string, options?: ProviderOptions): Promise<void>;
238
+ /**
239
+ * Fetches both the chain and node information, saves it to the cache, and return it.
240
+ *
241
+ * @returns NodeInfo and Chain
242
+ */
243
+ fetchChainAndNodeInfo(): Promise<{
244
+ chain: ChainInfo;
245
+ nodeInfo: NodeInfo;
246
+ }>;
247
+ private static ensureClientVersionIsSupported;
248
+ /**
249
+ * Create GraphQL client and set operations.
250
+ *
251
+ * @returns The operation SDK object
252
+ */
253
+ private createOperations;
254
+ /**
255
+ * Returns the version of the connected node.
256
+ *
257
+ * @returns A promise that resolves to the version string.
258
+ */
259
+ getVersion(): Promise<string>;
260
+ /**
261
+ * @hidden
262
+ *
263
+ * Returns the network configuration of the connected Fuel node.
264
+ *
265
+ * @returns A promise that resolves to the network configuration object
266
+ */
267
+ getNetwork(): Promise<Network>;
268
+ /**
269
+ * Returns the block number.
270
+ *
271
+ * @returns A promise that resolves to the block number
272
+ */
273
+ getBlockNumber(): Promise<BN>;
274
+ /**
275
+ * Returns the chain information.
276
+ * @param url - The URL of the Fuel node
277
+ * @returns NodeInfo object
278
+ */
279
+ fetchNode(): Promise<NodeInfo>;
280
+ /**
281
+ * Fetches the `chainInfo` for the given node URL.
282
+ * @param url - The URL of the Fuel node
283
+ * @returns ChainInfo object
284
+ */
285
+ fetchChain(): Promise<ChainInfo>;
286
+ /**
287
+ * Returns the chain ID
288
+ * @returns A promise that resolves to the chain ID number
289
+ */
290
+ getChainId(): number;
291
+ /**
292
+ * Submits a transaction to the chain to be executed.
293
+ *
294
+ * If the transaction is missing any dependencies,
295
+ * the transaction will be mutated and those dependencies will be added.
296
+ *
297
+ * @param transactionRequestLike - The transaction request object.
298
+ * @returns A promise that resolves to the transaction response object.
299
+ */
300
+ sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
301
+ /**
302
+ * Executes a transaction without actually submitting it to the chain.
303
+ *
304
+ * If the transaction is missing any dependencies,
305
+ * the transaction will be mutated and those dependencies will be added.
306
+ *
307
+ * @param transactionRequestLike - The transaction request object.
308
+ * @param utxoValidation - Additional provider call parameters.
309
+ * @returns A promise that resolves to the call result object.
310
+ */
311
+ call(transactionRequestLike: TransactionRequestLike, { utxoValidation, estimateTxDependencies }?: ProviderCallParams): Promise<CallResult>;
312
+ /**
313
+ * Verifies whether enough gas is available to complete transaction.
314
+ *
315
+ * @param transactionRequest - The transaction request object.
316
+ * @returns A promise that resolves to the estimated transaction request object.
317
+ */
318
+ estimatePredicates(transactionRequest: TransactionRequest): Promise<TransactionRequest>;
319
+ /**
320
+ * Will dryRun a transaction and check for missing dependencies.
321
+ *
322
+ * If there are missing variable outputs,
323
+ * `addVariableOutputs` is called on the transaction.
324
+ *
325
+ * @privateRemarks
326
+ * TODO: Investigate support for missing contract IDs
327
+ * TODO: Add support for missing output messages
328
+ *
329
+ * @param transactionRequest - The transaction request object.
330
+ * @returns A promise.
331
+ */
332
+ estimateTxDependencies(transactionRequest: TransactionRequest): Promise<EstimateTxDependenciesReturns>;
333
+ /**
334
+ * Executes a signed transaction without applying the states changes
335
+ * on the chain.
336
+ *
337
+ * If the transaction is missing any dependencies,
338
+ * the transaction will be mutated and those dependencies will be added
339
+ *
340
+ * @param transactionRequestLike - The transaction request object.
341
+ * @returns A promise that resolves to the call result object.
342
+ */
343
+ simulate(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
344
+ /**
345
+ * Returns a transaction cost to enable user
346
+ * to set gasLimit and also reserve balance amounts
347
+ * on the the transaction.
348
+ *
349
+ * @privateRemarks
350
+ * The tolerance is add on top of the gasUsed calculated
351
+ * from the node, this create a safe margin costs like
352
+ * change states on transfer that don't occur on the dryRun
353
+ * transaction. The default value is 0.2 or 20%
354
+ *
355
+ * @param transactionRequestLike - The transaction request object.
356
+ * @param tolerance - The tolerance to add on top of the gasUsed.
357
+ * @returns A promise that resolves to the transaction cost object.
358
+ */
359
+ getTransactionCost(transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[], { estimateTxDependencies, estimatePredicates, resourcesOwner, }?: TransactionCostParams): Promise<TransactionCost>;
360
+ getResourcesForTransaction(owner: string | AbstractAddress, transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[]): Promise<{
361
+ receipts: TransactionResultReceipt[];
362
+ minGasPrice: BN;
363
+ gasPrice: BN;
364
+ minGas: BN;
365
+ maxGas: BN;
366
+ gasUsed: BN;
367
+ minFee: BN;
368
+ maxFee: BN;
369
+ usedFee: BN;
370
+ outputVariables: number;
371
+ missingContractIds: string[];
372
+ estimatedInputs: TransactionRequestInput[];
373
+ resources: Resource[];
374
+ requiredQuantities: CoinQuantity[];
375
+ }>;
376
+ /**
377
+ * Returns coins for the given owner.
378
+ */
379
+ getCoins(
380
+ /** The address to get coins for */
381
+ owner: string | AbstractAddress,
382
+ /** The asset ID of coins to get */
383
+ assetId?: BytesLike,
384
+ /** Pagination arguments */
385
+ paginationArgs?: CursorPaginationArgs): Promise<Coin[]>;
386
+ /**
387
+ * Returns resources for the given owner satisfying the spend query.
388
+ *
389
+ * @param owner - The address to get resources for.
390
+ * @param quantities - The quantities to get.
391
+ * @param excludedIds - IDs of excluded resources from the selection.
392
+ * @returns A promise that resolves to the resources.
393
+ */
394
+ getResourcesToSpend(
395
+ /** The address to get coins for */
396
+ owner: string | AbstractAddress,
397
+ /** The quantities to get */
398
+ quantities: CoinQuantityLike[],
399
+ /** IDs of excluded resources from the selection. */
400
+ excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
401
+ /**
402
+ * Returns block matching the given ID or height.
403
+ *
404
+ * @param idOrHeight - ID or height of the block.
405
+ * @returns A promise that resolves to the block.
406
+ */
407
+ getBlock(
408
+ /** ID or height of the block */
409
+ idOrHeight: string | number | 'latest'): Promise<Block | null>;
410
+ /**
411
+ * Returns all the blocks matching the given parameters.
412
+ *
413
+ * @param params - The parameters to query blocks.
414
+ * @returns A promise that resolves to the blocks.
415
+ */
416
+ getBlocks(params: GqlGetBlocksQueryVariables): Promise<Block[]>;
417
+ /**
418
+ * Returns block matching the given ID or type, including transaction data.
419
+ *
420
+ * @param idOrHeight - ID or height of the block.
421
+ * @returns A promise that resolves to the block.
422
+ */
423
+ getBlockWithTransactions(
424
+ /** ID or height of the block */
425
+ idOrHeight: string | number | 'latest'): Promise<(Block & {
426
+ transactions: Transaction[];
427
+ }) | null>;
428
+ /**
429
+ * Get transaction with the given ID.
430
+ *
431
+ * @param transactionId - ID of the transaction.
432
+ * @returns A promise that resolves to the transaction.
433
+ */
434
+ getTransaction<TTransactionType = void>(transactionId: string): Promise<Transaction<TTransactionType> | null>;
435
+ /**
436
+ * Get deployed contract with the given ID.
437
+ *
438
+ * @param contractId - ID of the contract.
439
+ * @returns A promise that resolves to the contract.
440
+ */
441
+ getContract(contractId: string): Promise<ContractResult | null>;
442
+ /**
443
+ * Returns the balance for the given contract for the given asset ID.
444
+ *
445
+ * @param contractId - The contract ID to get the balance for.
446
+ * @param assetId - The asset ID of coins to get.
447
+ * @returns A promise that resolves to the balance.
448
+ */
449
+ getContractBalance(
450
+ /** The contract ID to get the balance for */
451
+ contractId: string | AbstractAddress,
452
+ /** The asset ID of coins to get */
453
+ assetId: BytesLike): Promise<BN>;
454
+ /**
455
+ * Returns the balance for the given owner for the given asset ID.
456
+ *
457
+ * @param owner - The address to get coins for.
458
+ * @param assetId - The asset ID of coins to get.
459
+ * @returns A promise that resolves to the balance.
460
+ */
461
+ getBalance(
462
+ /** The address to get coins for */
463
+ owner: string | AbstractAddress,
464
+ /** The asset ID of coins to get */
465
+ assetId: BytesLike): Promise<BN>;
466
+ /**
467
+ * Returns balances for the given owner.
468
+ *
469
+ * @param owner - The address to get coins for.
470
+ * @param paginationArgs - Pagination arguments.
471
+ * @returns A promise that resolves to the balances.
472
+ */
473
+ getBalances(
474
+ /** The address to get coins for */
475
+ owner: string | AbstractAddress,
476
+ /** Pagination arguments */
477
+ paginationArgs?: CursorPaginationArgs): Promise<CoinQuantity[]>;
478
+ /**
479
+ * Returns message for the given address.
480
+ *
481
+ * @param address - The address to get message from.
482
+ * @param paginationArgs - Pagination arguments.
483
+ * @returns A promise that resolves to the messages.
484
+ */
485
+ getMessages(
486
+ /** The address to get message from */
487
+ address: string | AbstractAddress,
488
+ /** Pagination arguments */
489
+ paginationArgs?: CursorPaginationArgs): Promise<Message[]>;
490
+ /**
491
+ * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
492
+ *
493
+ * @param transactionId - The transaction to get message from.
494
+ * @param messageId - The message id from MessageOut receipt.
495
+ * @param commitBlockId - The commit block id.
496
+ * @param commitBlockHeight - The commit block height.
497
+ * @returns A promise that resolves to the message proof.
498
+ */
499
+ getMessageProof(
500
+ /** The transaction to get message from */
501
+ transactionId: string, nonce: string, commitBlockId?: string, commitBlockHeight?: BN): Promise<MessageProof | null>;
502
+ /**
503
+ * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
504
+ *
505
+ * @param nonce - The nonce of the message to get status from.
506
+ * @returns A promise that resolves to the message status
507
+ */
508
+ getMessageStatus(
509
+ /** The nonce of the message to get status from */
510
+ nonce: string): Promise<MessageStatus>;
511
+ /**
512
+ * Lets you produce blocks with custom timestamps and the block number of the last block produced.
513
+ *
514
+ * @param amount - The amount of blocks to produce
515
+ * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block
516
+ * @returns A promise that resolves to the block number of the last produced block.
517
+ */
518
+ produceBlocks(amount: number, startTime?: number): Promise<BN>;
519
+ getTransactionResponse(transactionId: string): Promise<TransactionResponse>;
520
+ }
521
+ export {};
522
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/providers/provider.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,EAAE,EAAW,MAAM,eAAe,CAAC;A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OAKG;IACG,gBAAgB;IACpB,kDAAkD;IAClD,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC;IAKzB;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAShD,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGlF"}
@@ -0,0 +1,37 @@
1
+ import type { BytesLike } from '@fuel-ts/interfaces';
2
+ import type { Coin } from './coin';
3
+ import type { MessageCoin } from './message';
4
+ export type RawCoin = {
5
+ utxoId: string;
6
+ owner: string;
7
+ amount: string;
8
+ assetId: string;
9
+ maturity: string;
10
+ blockCreated: string;
11
+ txCreatedIdx: string;
12
+ };
13
+ export type RawMessage = {
14
+ amount: string;
15
+ sender: string;
16
+ assetId: string;
17
+ recipient: string;
18
+ data: string;
19
+ nonce: string;
20
+ daHeight: string;
21
+ };
22
+ export type RawResource = RawCoin | RawMessage;
23
+ export type Resource = Coin | MessageCoin;
24
+ /** @hidden */
25
+ export type ExcludeResourcesOption = {
26
+ utxos?: BytesLike[];
27
+ messages?: BytesLike[];
28
+ };
29
+ /** @hidden */
30
+ export declare const isRawCoin: (resource: RawResource) => resource is RawCoin;
31
+ /** @hidden */
32
+ export declare const isRawMessage: (resource: RawResource) => resource is RawMessage;
33
+ /** @hidden */
34
+ export declare const isCoin: (resource: Resource) => resource is Coin;
35
+ /** @hidden */
36
+ export declare const isMessage: (resource: Resource) => resource is MessageCoin;
37
+ //# sourceMappingURL=resource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/providers/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;AAC/C,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,WAAW,CAAC;AAE1C,cAAc;AACd,MAAM,MAAM,sBAAsB,GAAG;IACnC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB,CAAC;AAEF,cAAc;AACd,eAAO,MAAM,SAAS,aAAc,WAAW,wBAA8C,CAAC;AAC9F,cAAc;AACd,eAAO,MAAM,YAAY,aAAc,WAAW,2BACzB,CAAC;AAC1B,cAAc;AACd,eAAO,MAAM,MAAM,aAAc,QAAQ,qBAAuC,CAAC;AACjF,cAAc;AACd,eAAO,MAAM,SAAS,aAAc,QAAQ,4BAAqD,CAAC"}
@@ -0,0 +1,73 @@
1
+ import type { BytesLike } from '@fuel-ts/interfaces';
2
+ import { type BN } from '@fuel-ts/math';
3
+ import type { TransactionCreate } from '@fuel-ts/transactions';
4
+ import { TransactionType } from '@fuel-ts/transactions';
5
+ import type { GqlGasCosts } from '../__generated__/operations';
6
+ import type { ContractCreatedTransactionRequestOutput } from './output';
7
+ import type { TransactionRequestStorageSlot } from './storage-slot';
8
+ import { BaseTransactionRequest } from './transaction-request';
9
+ import type { BaseTransactionRequestLike } from './transaction-request';
10
+ /**
11
+ * @hidden
12
+ */
13
+ export interface CreateTransactionRequestLike extends BaseTransactionRequestLike {
14
+ /** Witness index of contract bytecode to create */
15
+ bytecodeWitnessIndex?: number;
16
+ /** Salt */
17
+ salt?: BytesLike;
18
+ /** List of storage slots to initialize */
19
+ storageSlots?: TransactionRequestStorageSlot[];
20
+ }
21
+ /**
22
+ * `CreateTransactionRequest` provides functionalities for creating a transaction request that creates a contract.
23
+ */
24
+ export declare class CreateTransactionRequest extends BaseTransactionRequest {
25
+ static from(obj: CreateTransactionRequestLike): CreateTransactionRequest;
26
+ /** Type of the transaction */
27
+ type: TransactionType.Create;
28
+ /** Witness index of contract bytecode to create */
29
+ bytecodeWitnessIndex: number;
30
+ /** Salt */
31
+ salt: string;
32
+ /** List of storage slots to initialize */
33
+ storageSlots: TransactionRequestStorageSlot[];
34
+ /**
35
+ * Creates an instance `CreateTransactionRequest`.
36
+ *
37
+ * @param createTransactionRequestLike - The initial values for the instance
38
+ */
39
+ constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }?: CreateTransactionRequestLike);
40
+ /**
41
+ * Converts the transaction request to a `TransactionCreate`.
42
+ *
43
+ * @returns The transaction create object.
44
+ */
45
+ toTransaction(): TransactionCreate;
46
+ /**
47
+ * Get contract created outputs for the transaction.
48
+ *
49
+ * @returns An array of contract created transaction request outputs.
50
+ */
51
+ getContractCreatedOutputs(): ContractCreatedTransactionRequestOutput[];
52
+ /**
53
+ * Gets the Transaction Request by hashing the transaction.
54
+ *
55
+ * @param chainId - The chain ID.
56
+ *
57
+ * @returns - A hash of the transaction, which is the transaction ID.
58
+ */
59
+ getTransactionId(chainId: number): string;
60
+ /**
61
+ * Adds a contract created output to the transaction request.
62
+ *
63
+ * @param contractId - The contract ID.
64
+ * @param stateRoot - The state root.
65
+ */
66
+ addContractCreatedOutput(
67
+ /** Contract ID */
68
+ contractId: BytesLike,
69
+ /** State Root */
70
+ stateRoot: BytesLike): void;
71
+ metadataGas(gasCosts: GqlGasCosts): BN;
72
+ }
73
+ //# sourceMappingURL=create-transaction-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/create-transaction-request.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAM,KAAK,EAAE,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAc,MAAM,uBAAuB,CAAC;AAGpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAI/D,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,4BAA6B,SAAQ,0BAA0B;IAC9E,mDAAmD;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW;IACX,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,6BAA6B,EAAE,CAAC;CAChD;AAED;;GAEG;AACH,qBAAa,wBAAyB,SAAQ,sBAAsB;IAClE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,4BAA4B;IAO7C,8BAA8B;IAC9B,IAAI,yBAAmC;IACvC,mDAAmD;IACnD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,YAAY,EAAE,6BAA6B,EAAE,CAAC;IAE9C;;;;OAIG;gBACS,EACV,oBAAoB,EACpB,IAAI,EACJ,YAAY,EACZ,GAAG,IAAI,EACR,GAAE,4BAAiC;IAOpC;;;;OAIG;IACH,aAAa,IAAI,iBAAiB;IAelC;;;;OAIG;IACH,yBAAyB,IAAI,uCAAuC,EAAE;IAOtE;;;;;;OAMG;IACH,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAIzC;;;;;OAKG;IACH,wBAAwB;IACtB,kBAAkB;IAClB,UAAU,EAAE,SAAS;IACrB,iBAAiB;IACjB,SAAS,EAAE,SAAS;IAStB,WAAW,CAAC,QAAQ,EAAE,WAAW,GAAG,EAAE;CAQvC"}
@@ -0,0 +1,25 @@
1
+ import type { AbstractAddress } from '@fuel-ts/interfaces';
2
+ /**
3
+ * @hidden
4
+ */
5
+ export declare class ChangeOutputCollisionError extends Error {
6
+ name: string;
7
+ message: string;
8
+ }
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare class NoWitnessAtIndexError extends Error {
13
+ readonly index: number;
14
+ name: string;
15
+ constructor(index: number);
16
+ }
17
+ /**
18
+ * @hidden
19
+ */
20
+ export declare class NoWitnessByOwnerError extends Error {
21
+ readonly owner: AbstractAddress;
22
+ name: string;
23
+ constructor(owner: AbstractAddress);
24
+ }
25
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/errors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,KAAK;IACnD,IAAI,SAAgC;IACpC,OAAO,SAAwF;CAChG;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAElB,KAAK,EAAE,MAAM;IADzC,IAAI,SAA2B;gBACH,KAAK,EAAE,MAAM;CAI1C;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;aAElB,KAAK,EAAE,eAAe;IADlD,IAAI,SAA2B;gBACH,KAAK,EAAE,eAAe;CAInD"}