@fuel-ts/account 0.0.0-pr-1699-20240202183346

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 (239) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +70 -0
  3. package/dist/account.d.ts +174 -0
  4. package/dist/account.d.ts.map +1 -0
  5. package/dist/base-wallet-unlocked.d.ts +73 -0
  6. package/dist/base-wallet-unlocked.d.ts.map +1 -0
  7. package/dist/configs.d.ts +2 -0
  8. package/dist/configs.d.ts.map +1 -0
  9. package/dist/configs.global.js +6 -0
  10. package/dist/configs.global.js.map +1 -0
  11. package/dist/configs.js +31 -0
  12. package/dist/configs.js.map +1 -0
  13. package/dist/configs.mjs +6 -0
  14. package/dist/configs.mjs.map +1 -0
  15. package/dist/connectors/default-connector.d.ts +7 -0
  16. package/dist/connectors/default-connector.d.ts.map +1 -0
  17. package/dist/connectors/fixtures/generate-accounts.d.ts +2 -0
  18. package/dist/connectors/fixtures/generate-accounts.d.ts.map +1 -0
  19. package/dist/connectors/fixtures/mocked-connector.d.ts +45 -0
  20. package/dist/connectors/fixtures/mocked-connector.d.ts.map +1 -0
  21. package/dist/connectors/fixtures/promise-callback.d.ts +7 -0
  22. package/dist/connectors/fixtures/promise-callback.d.ts.map +1 -0
  23. package/dist/connectors/fuel-connector.d.ts +187 -0
  24. package/dist/connectors/fuel-connector.d.ts.map +1 -0
  25. package/dist/connectors/fuel-wallet-connector.d.ts +54 -0
  26. package/dist/connectors/fuel-wallet-connector.d.ts.map +1 -0
  27. package/dist/connectors/fuel-wallet-development-connector.d.ts +7 -0
  28. package/dist/connectors/fuel-wallet-development-connector.d.ts.map +1 -0
  29. package/dist/connectors/fuel-wallet-locked.d.ts +13 -0
  30. package/dist/connectors/fuel-wallet-locked.d.ts.map +1 -0
  31. package/dist/connectors/fuel-wallet-provider.d.ts +14 -0
  32. package/dist/connectors/fuel-wallet-provider.d.ts.map +1 -0
  33. package/dist/connectors/fuel.d.ts +129 -0
  34. package/dist/connectors/fuel.d.ts.map +1 -0
  35. package/dist/connectors/fuelet-wallet-connector.d.ts +8 -0
  36. package/dist/connectors/fuelet-wallet-connector.d.ts.map +1 -0
  37. package/dist/connectors/types/abi.d.ts +9 -0
  38. package/dist/connectors/types/abi.d.ts.map +1 -0
  39. package/dist/connectors/types/account.d.ts +23 -0
  40. package/dist/connectors/types/account.d.ts.map +1 -0
  41. package/dist/connectors/types/asset.d.ts +16 -0
  42. package/dist/connectors/types/asset.d.ts.map +1 -0
  43. package/dist/connectors/types/coin.d.ts +6 -0
  44. package/dist/connectors/types/coin.d.ts.map +1 -0
  45. package/dist/connectors/types/connection.d.ts +7 -0
  46. package/dist/connectors/types/connection.d.ts.map +1 -0
  47. package/dist/connectors/types/connector-metadata.d.ts +12 -0
  48. package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
  49. package/dist/connectors/types/connector-types.d.ts +34 -0
  50. package/dist/connectors/types/connector-types.d.ts.map +1 -0
  51. package/dist/connectors/types/constants.d.ts +7 -0
  52. package/dist/connectors/types/constants.d.ts.map +1 -0
  53. package/dist/connectors/types/data-type.d.ts +46 -0
  54. package/dist/connectors/types/data-type.d.ts.map +1 -0
  55. package/dist/connectors/types/error.d.ts +18 -0
  56. package/dist/connectors/types/error.d.ts.map +1 -0
  57. package/dist/connectors/types/events.d.ts +150 -0
  58. package/dist/connectors/types/events.d.ts.map +1 -0
  59. package/dist/connectors/types/fuel-storage.d.ts +11 -0
  60. package/dist/connectors/types/fuel-storage.d.ts.map +1 -0
  61. package/dist/connectors/types/index.d.ts +15 -0
  62. package/dist/connectors/types/index.d.ts.map +1 -0
  63. package/dist/connectors/types/message.d.ts +15 -0
  64. package/dist/connectors/types/message.d.ts.map +1 -0
  65. package/dist/connectors/types/nertwork-data.d.ts +7 -0
  66. package/dist/connectors/types/nertwork-data.d.ts.map +1 -0
  67. package/dist/connectors/types/target-object.d.ts +14 -0
  68. package/dist/connectors/types/target-object.d.ts.map +1 -0
  69. package/dist/connectors/utils/cache.d.ts +14 -0
  70. package/dist/connectors/utils/cache.d.ts.map +1 -0
  71. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
  72. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
  73. package/dist/connectors/utils/get-asset-by-chain.d.ts +3 -0
  74. package/dist/connectors/utils/get-asset-by-chain.d.ts.map +1 -0
  75. package/dist/connectors/utils/index.d.ts +5 -0
  76. package/dist/connectors/utils/index.d.ts.map +1 -0
  77. package/dist/connectors/utils/promises.d.ts +8 -0
  78. package/dist/connectors/utils/promises.d.ts.map +1 -0
  79. package/dist/hdwallet/hdwallet.d.ts +58 -0
  80. package/dist/hdwallet/hdwallet.d.ts.map +1 -0
  81. package/dist/hdwallet/index.d.ts +2 -0
  82. package/dist/hdwallet/index.d.ts.map +1 -0
  83. package/dist/index.d.ts +14 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.global.js +48673 -0
  86. package/dist/index.global.js.map +1 -0
  87. package/dist/index.js +8728 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/index.mjs +8642 -0
  90. package/dist/index.mjs.map +1 -0
  91. package/dist/keystore-wallet.d.ts +38 -0
  92. package/dist/keystore-wallet.d.ts.map +1 -0
  93. package/dist/mnemonic/index.d.ts +3 -0
  94. package/dist/mnemonic/index.d.ts.map +1 -0
  95. package/dist/mnemonic/mnemonic.d.ts +85 -0
  96. package/dist/mnemonic/mnemonic.d.ts.map +1 -0
  97. package/dist/mnemonic/utils.d.ts +8 -0
  98. package/dist/mnemonic/utils.d.ts.map +1 -0
  99. package/dist/predicate/index.d.ts +3 -0
  100. package/dist/predicate/index.d.ts.map +1 -0
  101. package/dist/predicate/predicate.d.ts +93 -0
  102. package/dist/predicate/predicate.d.ts.map +1 -0
  103. package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
  104. package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
  105. package/dist/predicate/utils/index.d.ts +2 -0
  106. package/dist/predicate/utils/index.d.ts.map +1 -0
  107. package/dist/providers/__generated__/operations.d.ts +3539 -0
  108. package/dist/providers/__generated__/operations.d.ts.map +1 -0
  109. package/dist/providers/coin-quantity.d.ts +21 -0
  110. package/dist/providers/coin-quantity.d.ts.map +1 -0
  111. package/dist/providers/coin.d.ts +15 -0
  112. package/dist/providers/coin.d.ts.map +1 -0
  113. package/dist/providers/fuel-graphql-subscriber.d.ts +13 -0
  114. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
  115. package/dist/providers/index.d.ts +11 -0
  116. package/dist/providers/index.d.ts.map +1 -0
  117. package/dist/providers/memory-cache.d.ts +11 -0
  118. package/dist/providers/memory-cache.d.ts.map +1 -0
  119. package/dist/providers/message.d.ts +61 -0
  120. package/dist/providers/message.d.ts.map +1 -0
  121. package/dist/providers/provider.d.ts +500 -0
  122. package/dist/providers/provider.d.ts.map +1 -0
  123. package/dist/providers/resource.d.ts +37 -0
  124. package/dist/providers/resource.d.ts.map +1 -0
  125. package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
  126. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
  127. package/dist/providers/transaction-request/errors.d.ts +25 -0
  128. package/dist/providers/transaction-request/errors.d.ts.map +1 -0
  129. package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
  130. package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
  131. package/dist/providers/transaction-request/index.d.ts +10 -0
  132. package/dist/providers/transaction-request/index.d.ts.map +1 -0
  133. package/dist/providers/transaction-request/input.d.ts +59 -0
  134. package/dist/providers/transaction-request/input.d.ts.map +1 -0
  135. package/dist/providers/transaction-request/output.d.ts +39 -0
  136. package/dist/providers/transaction-request/output.d.ts.map +1 -0
  137. package/dist/providers/transaction-request/script-transaction-request.d.ts +107 -0
  138. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
  139. package/dist/providers/transaction-request/scripts.d.ts +6 -0
  140. package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
  141. package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
  142. package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
  143. package/dist/providers/transaction-request/transaction-request.d.ts +267 -0
  144. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
  145. package/dist/providers/transaction-request/types.d.ts +10 -0
  146. package/dist/providers/transaction-request/types.d.ts.map +1 -0
  147. package/dist/providers/transaction-request/utils.d.ts +4 -0
  148. package/dist/providers/transaction-request/utils.d.ts.map +1 -0
  149. package/dist/providers/transaction-request/witness.d.ts +5 -0
  150. package/dist/providers/transaction-request/witness.d.ts.map +1 -0
  151. package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
  152. package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
  153. package/dist/providers/transaction-response/index.d.ts +3 -0
  154. package/dist/providers/transaction-response/index.d.ts.map +1 -0
  155. package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
  156. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
  157. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
  158. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
  159. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
  160. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
  161. package/dist/providers/transaction-summary/call.d.ts +18 -0
  162. package/dist/providers/transaction-summary/call.d.ts.map +1 -0
  163. package/dist/providers/transaction-summary/date.d.ts +3 -0
  164. package/dist/providers/transaction-summary/date.d.ts.map +1 -0
  165. package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
  166. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
  167. package/dist/providers/transaction-summary/index.d.ts +11 -0
  168. package/dist/providers/transaction-summary/index.d.ts.map +1 -0
  169. package/dist/providers/transaction-summary/input.d.ts +21 -0
  170. package/dist/providers/transaction-summary/input.d.ts.map +1 -0
  171. package/dist/providers/transaction-summary/operations.d.ts +42 -0
  172. package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
  173. package/dist/providers/transaction-summary/output.d.ts +15 -0
  174. package/dist/providers/transaction-summary/output.d.ts.map +1 -0
  175. package/dist/providers/transaction-summary/receipt.d.ts +7 -0
  176. package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
  177. package/dist/providers/transaction-summary/status.d.ts +9 -0
  178. package/dist/providers/transaction-summary/status.d.ts.map +1 -0
  179. package/dist/providers/transaction-summary/types.d.ts +147 -0
  180. package/dist/providers/transaction-summary/types.d.ts.map +1 -0
  181. package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
  182. package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
  183. package/dist/providers/utils/block-explorer.d.ts +14 -0
  184. package/dist/providers/utils/block-explorer.d.ts.map +1 -0
  185. package/dist/providers/utils/gas.d.ts +38 -0
  186. package/dist/providers/utils/gas.d.ts.map +1 -0
  187. package/dist/providers/utils/index.d.ts +7 -0
  188. package/dist/providers/utils/index.d.ts.map +1 -0
  189. package/dist/providers/utils/json.d.ts +7 -0
  190. package/dist/providers/utils/json.d.ts.map +1 -0
  191. package/dist/providers/utils/merge-quantities.d.ts +3 -0
  192. package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
  193. package/dist/providers/utils/receipts.d.ts +10 -0
  194. package/dist/providers/utils/receipts.d.ts.map +1 -0
  195. package/dist/providers/utils/sleep.d.ts +3 -0
  196. package/dist/providers/utils/sleep.d.ts.map +1 -0
  197. package/dist/providers/utils/time.d.ts +40 -0
  198. package/dist/providers/utils/time.d.ts.map +1 -0
  199. package/dist/signer/index.d.ts +2 -0
  200. package/dist/signer/index.d.ts.map +1 -0
  201. package/dist/signer/signer.d.ts +64 -0
  202. package/dist/signer/signer.d.ts.map +1 -0
  203. package/dist/test-utils/generateTestWallet.d.ts +4 -0
  204. package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
  205. package/dist/test-utils/launchNode.d.ts +54 -0
  206. package/dist/test-utils/launchNode.d.ts.map +1 -0
  207. package/dist/test-utils/seedTestWallet.d.ts +4 -0
  208. package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
  209. package/dist/test-utils.d.ts +4 -0
  210. package/dist/test-utils.d.ts.map +1 -0
  211. package/dist/test-utils.global.js +51455 -0
  212. package/dist/test-utils.global.js.map +1 -0
  213. package/dist/test-utils.js +7885 -0
  214. package/dist/test-utils.js.map +1 -0
  215. package/dist/test-utils.mjs +7890 -0
  216. package/dist/test-utils.mjs.map +1 -0
  217. package/dist/utils/formatTransferToContractScriptData.d.ts +15 -0
  218. package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
  219. package/dist/wallet-manager/index.d.ts +3 -0
  220. package/dist/wallet-manager/index.d.ts.map +1 -0
  221. package/dist/wallet-manager/storages/memory-storage.d.ts +10 -0
  222. package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
  223. package/dist/wallet-manager/types.d.ts +44 -0
  224. package/dist/wallet-manager/types.d.ts.map +1 -0
  225. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +33 -0
  226. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
  227. package/dist/wallet-manager/vaults/privatekey-vault.d.ts +33 -0
  228. package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
  229. package/dist/wallet-manager/wallet-manager.d.ts +104 -0
  230. package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
  231. package/dist/wallet.d.ts +69 -0
  232. package/dist/wallet.d.ts.map +1 -0
  233. package/dist/wallets.d.ts +76 -0
  234. package/dist/wallets.d.ts.map +1 -0
  235. package/dist/wordlists/index.d.ts +5 -0
  236. package/dist/wordlists/index.d.ts.map +1 -0
  237. package/dist/wordlists/words/english.d.ts +2 -0
  238. package/dist/wordlists/words/english.d.ts.map +1 -0
  239. package/package.json +91 -0
@@ -0,0 +1,500 @@
1
+ /// <reference types="web" />
2
+ import type { AbstractAddress } from '@fuel-ts/interfaces';
3
+ import type { BN } from '@fuel-ts/math';
4
+ import type { Transaction } from '@fuel-ts/transactions';
5
+ import type { BytesLike } from 'ethers';
6
+ import { Network } from 'ethers';
7
+ import { getSdk as getOperationsSdk } from './__generated__/operations';
8
+ import type { GqlGasCosts, GqlGetBlocksQueryVariables, GqlPeerInfo } from './__generated__/operations';
9
+ import type { Coin } from './coin';
10
+ import type { CoinQuantity, CoinQuantityLike } from './coin-quantity';
11
+ import { MemoryCache } from './memory-cache';
12
+ import type { Message, MessageProof, MessageStatus } from './message';
13
+ import type { ExcludeResourcesOption, Resource } from './resource';
14
+ import type { TransactionRequestLike, TransactionRequest } from './transaction-request';
15
+ import type { TransactionResultReceipt } from './transaction-response';
16
+ import { TransactionResponse } from './transaction-response';
17
+ import type { RetryOptions } from './utils/auto-retry-fetch';
18
+ export type CallResult = {
19
+ receipts: TransactionResultReceipt[];
20
+ };
21
+ /**
22
+ * A Fuel block
23
+ */
24
+ export type Block = {
25
+ id: string;
26
+ height: BN;
27
+ time: string;
28
+ transactionIds: string[];
29
+ };
30
+ /**
31
+ * Deployed Contract bytecode and contract id
32
+ */
33
+ export type ContractResult = {
34
+ id: string;
35
+ bytecode: string;
36
+ };
37
+ type ConsensusParameters = {
38
+ contractMaxSize: BN;
39
+ maxInputs: BN;
40
+ maxOutputs: BN;
41
+ maxWitnesses: BN;
42
+ maxGasPerTx: BN;
43
+ maxScriptLength: BN;
44
+ maxScriptDataLength: BN;
45
+ maxStorageSlots: BN;
46
+ maxPredicateLength: BN;
47
+ maxPredicateDataLength: BN;
48
+ maxGasPerPredicate: BN;
49
+ gasPriceFactor: BN;
50
+ gasPerByte: BN;
51
+ maxMessageDataLength: BN;
52
+ chainId: BN;
53
+ gasCosts: GqlGasCosts;
54
+ };
55
+ /**
56
+ * Chain information
57
+ */
58
+ export type ChainInfo = {
59
+ name: string;
60
+ baseChainHeight: BN;
61
+ consensusParameters: ConsensusParameters;
62
+ gasCosts: GqlGasCosts;
63
+ latestBlock: {
64
+ id: string;
65
+ height: BN;
66
+ time: string;
67
+ transactions: Array<{
68
+ id: string;
69
+ }>;
70
+ };
71
+ };
72
+ /**
73
+ * Node information
74
+ */
75
+ export type NodeInfo = {
76
+ utxoValidation: boolean;
77
+ vmBacktrace: boolean;
78
+ minGasPrice: BN;
79
+ maxTx: BN;
80
+ maxDepth: BN;
81
+ nodeVersion: string;
82
+ peers: GqlPeerInfo[];
83
+ };
84
+ export type NodeInfoAndConsensusParameters = {
85
+ minGasPrice: BN;
86
+ nodeVersion: string;
87
+ gasPerByte: BN;
88
+ gasPriceFactor: BN;
89
+ maxGasPerTx: BN;
90
+ };
91
+ export type TransactionCost = {
92
+ requiredQuantities: CoinQuantity[];
93
+ receipts: TransactionResultReceipt[];
94
+ minGasPrice: BN;
95
+ gasPrice: BN;
96
+ minGas: BN;
97
+ maxGas: BN;
98
+ gasUsed: BN;
99
+ minFee: BN;
100
+ maxFee: BN;
101
+ usedFee: BN;
102
+ };
103
+ /**
104
+ * @hidden
105
+ *
106
+ * Cursor pagination arguments
107
+ *
108
+ * https://relay.dev/graphql/connections.htm#sec-Arguments
109
+ */
110
+ export type CursorPaginationArgs = {
111
+ /** Forward pagination limit */
112
+ first?: number | null;
113
+ /** Forward pagination cursor */
114
+ after?: string | null;
115
+ /** Backward pagination limit */
116
+ last?: number | null;
117
+ /** Backward pagination cursor */
118
+ before?: string | null;
119
+ };
120
+ export type FetchRequestOptions = {
121
+ method: 'POST';
122
+ headers: {
123
+ [key: string]: string;
124
+ };
125
+ body: string;
126
+ };
127
+ export type ProviderOptions = {
128
+ fetch?: (url: string, options: FetchRequestOptions, providerOptions: Omit<ProviderOptions, 'fetch'>) => Promise<Response>;
129
+ timeout?: number;
130
+ cacheUtxo?: number;
131
+ retryOptions?: RetryOptions;
132
+ };
133
+ /**
134
+ * UTXO Validation Param
135
+ */
136
+ export type UTXOValidationParams = {
137
+ utxoValidation?: boolean;
138
+ };
139
+ /**
140
+ * Transaction estimation Param
141
+ */
142
+ export type EstimateTransactionParams = {
143
+ estimateTxDependencies?: boolean;
144
+ };
145
+ export type EstimatePredicateParams = {
146
+ estimatePredicates?: boolean;
147
+ };
148
+ export type TransactionCostParams = EstimateTransactionParams & EstimatePredicateParams;
149
+ /**
150
+ * Provider Call transaction params
151
+ */
152
+ export type ProviderCallParams = UTXOValidationParams & EstimateTransactionParams;
153
+ /**
154
+ * Provider Send transaction params
155
+ */
156
+ export type ProviderSendTxParams = EstimateTransactionParams & {
157
+ /**
158
+ * By default, the promise will resolve immediately after the transaction is submitted.
159
+ *
160
+ * If set to true, the promise will resolve only when the transaction changes status
161
+ * from `SubmittedStatus` to one of `SuccessStatus`, `FailureStatus` or `SqueezedOutStatus`.
162
+ *
163
+ */
164
+ awaitExecution?: boolean;
165
+ };
166
+ /**
167
+ * A provider for connecting to a node
168
+ */
169
+ export default class Provider {
170
+ #private;
171
+ /** GraphQL endpoint of the Fuel node */
172
+ url: string;
173
+ operations: ReturnType<typeof getOperationsSdk>;
174
+ cache?: MemoryCache;
175
+ static clearChainAndNodeCaches(): void;
176
+ private static chainInfoCache;
177
+ private static nodeInfoCache;
178
+ options: ProviderOptions;
179
+ private static getFetchFn;
180
+ /**
181
+ * Constructor to initialize a Provider.
182
+ *
183
+ * @param url - GraphQL endpoint of the Fuel node
184
+ * @param chainInfo - Chain info of the Fuel node
185
+ * @param options - Additional options for the provider
186
+ * @hidden
187
+ */
188
+ protected constructor(
189
+ /** GraphQL endpoint of the Fuel node */
190
+ url: string, options?: ProviderOptions);
191
+ /**
192
+ * Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
193
+ * @param url - GraphQL endpoint of the Fuel node
194
+ * @param options - Additional options for the provider
195
+ */
196
+ static create(url: string, options?: ProviderOptions): Promise<Provider>;
197
+ /**
198
+ * Returns the cached chainInfo for the current URL.
199
+ */
200
+ getChain(): ChainInfo;
201
+ /**
202
+ * Returns the cached nodeInfo for the current URL.
203
+ */
204
+ getNode(): NodeInfo;
205
+ /**
206
+ * Returns some helpful parameters related to gas fees.
207
+ */
208
+ getGasConfig(): {
209
+ minGasPrice: BN;
210
+ maxGasPerTx: BN;
211
+ maxGasPerPredicate: BN;
212
+ gasPriceFactor: BN;
213
+ gasPerByte: BN;
214
+ gasCosts: GqlGasCosts;
215
+ };
216
+ /**
217
+ * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.
218
+ */
219
+ connect(url: string, options?: ProviderOptions): Promise<void>;
220
+ /**
221
+ * Fetches both the chain and node information, saves it to the cache, and return it.
222
+ *
223
+ * @returns NodeInfo and Chain
224
+ */
225
+ fetchChainAndNodeInfo(): Promise<{
226
+ chain: ChainInfo;
227
+ nodeInfo: NodeInfo;
228
+ }>;
229
+ private static ensureClientVersionIsSupported;
230
+ /**
231
+ * Create GraphQL client and set operations.
232
+ *
233
+ * @returns The operation SDK object
234
+ */
235
+ private createOperations;
236
+ /**
237
+ * Returns the version of the connected node.
238
+ *
239
+ * @returns A promise that resolves to the version string.
240
+ */
241
+ getVersion(): Promise<string>;
242
+ /**
243
+ * @hidden
244
+ *
245
+ * Returns the network configuration of the connected Fuel node.
246
+ *
247
+ * @returns A promise that resolves to the network configuration object
248
+ */
249
+ getNetwork(): Promise<Network>;
250
+ /**
251
+ * Returns the block number.
252
+ *
253
+ * @returns A promise that resolves to the block number
254
+ */
255
+ getBlockNumber(): Promise<BN>;
256
+ /**
257
+ * Returns the chain information.
258
+ * @param url - The URL of the Fuel node
259
+ * @returns NodeInfo object
260
+ */
261
+ fetchNode(): Promise<NodeInfo>;
262
+ /**
263
+ * Fetches the `chainInfo` for the given node URL.
264
+ * @param url - The URL of the Fuel node
265
+ * @returns ChainInfo object
266
+ */
267
+ fetchChain(): Promise<ChainInfo>;
268
+ /**
269
+ * Returns the chain ID
270
+ * @returns A promise that resolves to the chain ID number
271
+ */
272
+ getChainId(): number;
273
+ /**
274
+ * Submits a transaction to the chain to be executed.
275
+ *
276
+ * If the transaction is missing any dependencies,
277
+ * the transaction will be mutated and those dependencies will be added.
278
+ *
279
+ * @param transactionRequestLike - The transaction request object.
280
+ * @returns A promise that resolves to the transaction response object.
281
+ */
282
+ sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
283
+ /**
284
+ * Executes a transaction without actually submitting it to the chain.
285
+ *
286
+ * If the transaction is missing any dependencies,
287
+ * the transaction will be mutated and those dependencies will be added.
288
+ *
289
+ * @param transactionRequestLike - The transaction request object.
290
+ * @param utxoValidation - Additional provider call parameters.
291
+ * @returns A promise that resolves to the call result object.
292
+ */
293
+ call(transactionRequestLike: TransactionRequestLike, { utxoValidation, estimateTxDependencies }?: ProviderCallParams): Promise<CallResult>;
294
+ /**
295
+ * Verifies whether enough gas is available to complete transaction.
296
+ *
297
+ * @param transactionRequest - The transaction request object.
298
+ * @returns A promise that resolves to the estimated transaction request object.
299
+ */
300
+ estimatePredicates(transactionRequest: TransactionRequest): Promise<TransactionRequest>;
301
+ /**
302
+ * Will dryRun a transaction and check for missing dependencies.
303
+ *
304
+ * If there are missing variable outputs,
305
+ * `addVariableOutputs` is called on the transaction.
306
+ *
307
+ * @privateRemarks
308
+ * TODO: Investigate support for missing contract IDs
309
+ * TODO: Add support for missing output messages
310
+ *
311
+ * @param transactionRequest - The transaction request object.
312
+ * @returns A promise.
313
+ */
314
+ estimateTxDependencies(transactionRequest: TransactionRequest): Promise<void>;
315
+ /**
316
+ * Executes a signed transaction without applying the states changes
317
+ * on the chain.
318
+ *
319
+ * If the transaction is missing any dependencies,
320
+ * the transaction will be mutated and those dependencies will be added
321
+ *
322
+ * @param transactionRequestLike - The transaction request object.
323
+ * @returns A promise that resolves to the call result object.
324
+ */
325
+ simulate(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
326
+ /**
327
+ * Returns a transaction cost to enable user
328
+ * to set gasLimit and also reserve balance amounts
329
+ * on the the transaction.
330
+ *
331
+ * @privateRemarks
332
+ * The tolerance is add on top of the gasUsed calculated
333
+ * from the node, this create a safe margin costs like
334
+ * change states on transfer that don't occur on the dryRun
335
+ * transaction. The default value is 0.2 or 20%
336
+ *
337
+ * @param transactionRequestLike - The transaction request object.
338
+ * @param tolerance - The tolerance to add on top of the gasUsed.
339
+ * @returns A promise that resolves to the transaction cost object.
340
+ */
341
+ getTransactionCost(transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[], { estimateTxDependencies, estimatePredicates }?: TransactionCostParams): Promise<TransactionCost>;
342
+ getResourcesForTransaction(owner: string | AbstractAddress, transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[]): Promise<{
343
+ receipts: TransactionResultReceipt[];
344
+ minGasPrice: BN;
345
+ gasPrice: BN;
346
+ minGas: BN;
347
+ maxGas: BN;
348
+ gasUsed: BN;
349
+ minFee: BN;
350
+ maxFee: BN;
351
+ usedFee: BN;
352
+ resources: Resource[];
353
+ requiredQuantities: CoinQuantity[];
354
+ }>;
355
+ /**
356
+ * Returns coins for the given owner.
357
+ */
358
+ getCoins(
359
+ /** The address to get coins for */
360
+ owner: string | AbstractAddress,
361
+ /** The asset ID of coins to get */
362
+ assetId?: BytesLike,
363
+ /** Pagination arguments */
364
+ paginationArgs?: CursorPaginationArgs): Promise<Coin[]>;
365
+ /**
366
+ * Returns resources for the given owner satisfying the spend query.
367
+ *
368
+ * @param owner - The address to get resources for.
369
+ * @param quantities - The quantities to get.
370
+ * @param excludedIds - IDs of excluded resources from the selection.
371
+ * @returns A promise that resolves to the resources.
372
+ */
373
+ getResourcesToSpend(
374
+ /** The address to get coins for */
375
+ owner: string | AbstractAddress,
376
+ /** The quantities to get */
377
+ quantities: CoinQuantityLike[],
378
+ /** IDs of excluded resources from the selection. */
379
+ excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
380
+ /**
381
+ * Returns block matching the given ID or height.
382
+ *
383
+ * @param idOrHeight - ID or height of the block.
384
+ * @returns A promise that resolves to the block.
385
+ */
386
+ getBlock(
387
+ /** ID or height of the block */
388
+ idOrHeight: string | number | 'latest'): Promise<Block | null>;
389
+ /**
390
+ * Returns all the blocks matching the given parameters.
391
+ *
392
+ * @param params - The parameters to query blocks.
393
+ * @returns A promise that resolves to the blocks.
394
+ */
395
+ getBlocks(params: GqlGetBlocksQueryVariables): Promise<Block[]>;
396
+ /**
397
+ * Returns block matching the given ID or type, including transaction data.
398
+ *
399
+ * @param idOrHeight - ID or height of the block.
400
+ * @returns A promise that resolves to the block.
401
+ */
402
+ getBlockWithTransactions(
403
+ /** ID or height of the block */
404
+ idOrHeight: string | number | 'latest'): Promise<(Block & {
405
+ transactions: Transaction[];
406
+ }) | null>;
407
+ /**
408
+ * Get transaction with the given ID.
409
+ *
410
+ * @param transactionId - ID of the transaction.
411
+ * @returns A promise that resolves to the transaction.
412
+ */
413
+ getTransaction<TTransactionType = void>(transactionId: string): Promise<Transaction<TTransactionType> | null>;
414
+ /**
415
+ * Get deployed contract with the given ID.
416
+ *
417
+ * @param contractId - ID of the contract.
418
+ * @returns A promise that resolves to the contract.
419
+ */
420
+ getContract(contractId: string): Promise<ContractResult | null>;
421
+ /**
422
+ * Returns the balance for the given contract for the given asset ID.
423
+ *
424
+ * @param contractId - The contract ID to get the balance for.
425
+ * @param assetId - The asset ID of coins to get.
426
+ * @returns A promise that resolves to the balance.
427
+ */
428
+ getContractBalance(
429
+ /** The contract ID to get the balance for */
430
+ contractId: string | AbstractAddress,
431
+ /** The asset ID of coins to get */
432
+ assetId: BytesLike): Promise<BN>;
433
+ /**
434
+ * Returns the balance for the given owner for the given asset ID.
435
+ *
436
+ * @param owner - The address to get coins for.
437
+ * @param assetId - The asset ID of coins to get.
438
+ * @returns A promise that resolves to the balance.
439
+ */
440
+ getBalance(
441
+ /** The address to get coins for */
442
+ owner: string | AbstractAddress,
443
+ /** The asset ID of coins to get */
444
+ assetId: BytesLike): Promise<BN>;
445
+ /**
446
+ * Returns balances for the given owner.
447
+ *
448
+ * @param owner - The address to get coins for.
449
+ * @param paginationArgs - Pagination arguments.
450
+ * @returns A promise that resolves to the balances.
451
+ */
452
+ getBalances(
453
+ /** The address to get coins for */
454
+ owner: string | AbstractAddress,
455
+ /** Pagination arguments */
456
+ paginationArgs?: CursorPaginationArgs): Promise<CoinQuantity[]>;
457
+ /**
458
+ * Returns message for the given address.
459
+ *
460
+ * @param address - The address to get message from.
461
+ * @param paginationArgs - Pagination arguments.
462
+ * @returns A promise that resolves to the messages.
463
+ */
464
+ getMessages(
465
+ /** The address to get message from */
466
+ address: string | AbstractAddress,
467
+ /** Pagination arguments */
468
+ paginationArgs?: CursorPaginationArgs): Promise<Message[]>;
469
+ /**
470
+ * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
471
+ *
472
+ * @param transactionId - The transaction to get message from.
473
+ * @param messageId - The message id from MessageOut receipt.
474
+ * @param commitBlockId - The commit block id.
475
+ * @param commitBlockHeight - The commit block height.
476
+ * @returns A promise that resolves to the message proof.
477
+ */
478
+ getMessageProof(
479
+ /** The transaction to get message from */
480
+ transactionId: string, nonce: string, commitBlockId?: string, commitBlockHeight?: BN): Promise<MessageProof | null>;
481
+ /**
482
+ * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
483
+ *
484
+ * @param nonce - The nonce of the message to get status from.
485
+ * @returns A promise that resolves to the message status
486
+ */
487
+ getMessageStatus(
488
+ /** The nonce of the message to get status from */
489
+ nonce: string): Promise<MessageStatus>;
490
+ /**
491
+ * Lets you produce blocks with custom timestamps and the block number of the last block produced.
492
+ *
493
+ * @param amount - The amount of blocks to produce
494
+ * @param startTime - The UNIX timestamp to set for the first produced block
495
+ * @returns A promise that resolves to the block number of the last produced block.
496
+ */
497
+ produceBlocks(amount: number, startTime?: number): Promise<BN>;
498
+ }
499
+ export {};
500
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","source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,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;CAOvD"}
@@ -0,0 +1,37 @@
1
+ import type { BytesLike } from 'ethers';
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,QAAQ,CAAC;AAExC,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 BN } from '@fuel-ts/math';
2
+ import type { TransactionCreate } from '@fuel-ts/transactions';
3
+ import { TransactionType } from '@fuel-ts/transactions';
4
+ import type { BytesLike } from 'ethers';
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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AAI,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"}
@@ -0,0 +1,9 @@
1
+ import type { TransactionRequest } from './types';
2
+ /**
3
+ * Hash transaction request with sha256. [Read more](https://github.com/FuelLabs/fuel-specs/blob/master/specs/protocol/identifiers.md#transaction-id)
4
+ *
5
+ * @param transactionRequest - Transaction request to be hashed
6
+ * @returns sha256 hash of the transaction
7
+ */
8
+ export declare function hashTransaction(transactionRequest: TransactionRequest, chainId: number): string;
9
+ //# sourceMappingURL=hash-transaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hash-transaction.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/hash-transaction.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,UA2EtF"}