@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
@@ -1,3837 +0,0 @@
1
- import { BytesLike, AbstractAddress, AddressLike, AbstractScriptRequest, ContractIdLike, B256Address, AbstractAccount } from '@fuel-ts/interfaces';
2
- import { Address } from '@fuel-ts/address';
3
- import { BigNumberish, BN, BNInput } from '@fuel-ts/math';
4
- import { InputType, Input, OutputType, Output, TransactionType, Policy, TransactionCreate, TransactionScript, Transaction, ReceiptCall, ReceiptReturn, ReceiptReturnData, ReceiptPanic, ReceiptRevert, ReceiptLog, ReceiptLogData, ReceiptTransfer, ReceiptTransferOut, ReceiptScriptResult, ReceiptMessageOut, ReceiptMint, ReceiptBurn } from '@fuel-ts/transactions';
5
- import { Network as Network$1 } from 'ethers';
6
- import { DocumentNode } from 'graphql';
7
- import { InputValue, JsonAbi, Interface } from '@fuel-ts/abi-coder';
8
- import { EventEmitter } from 'events';
9
-
10
- type CoinQuantityLike = [amount: BigNumberish, assetId?: BytesLike, max?: BigNumberish] | {
11
- amount: BigNumberish;
12
- assetId?: BytesLike;
13
- max?: BigNumberish;
14
- };
15
- type CoinQuantity = {
16
- amount: BN;
17
- assetId: string;
18
- max?: BN;
19
- };
20
- /** @hidden */
21
- declare const coinQuantityfy: (coinQuantityLike: CoinQuantityLike) => CoinQuantity;
22
- interface IAddAmountToAssetParams {
23
- assetId: string;
24
- amount: BN;
25
- coinQuantities: CoinQuantity[];
26
- }
27
- declare const addAmountToAsset: (params: IAddAmountToAssetParams) => CoinQuantity[];
28
-
29
- /**
30
- * A Fuel coin
31
- */
32
- type Coin = {
33
- id: string;
34
- assetId: string;
35
- amount: BN;
36
- owner: AbstractAddress;
37
- maturity: number;
38
- blockCreated: BN;
39
- txCreatedIdx: BN;
40
- };
41
-
42
- type Maybe<T> = T | null;
43
- type InputMaybe<T> = Maybe<T>;
44
- type Exact<T extends {
45
- [key: string]: unknown;
46
- }> = {
47
- [K in keyof T]: T[K];
48
- };
49
- /** All built-in and custom scalars, mapped to their actual values */
50
- type Scalars = {
51
- ID: string;
52
- String: string;
53
- Boolean: boolean;
54
- Int: number;
55
- Float: number;
56
- Address: string;
57
- AssetId: string;
58
- BlockId: string;
59
- Bytes32: string;
60
- ContractId: string;
61
- HexString: string;
62
- Nonce: string;
63
- Salt: string;
64
- Signature: any;
65
- Tai64Timestamp: string;
66
- TransactionId: string;
67
- TxPointer: any;
68
- U8: any;
69
- U32: any;
70
- U64: string;
71
- UtxoId: string;
72
- };
73
- type GqlBalanceFilterInput = {
74
- /** Filter coins based on the `owner` field */
75
- owner: Scalars['Address'];
76
- };
77
- type GqlCoinFilterInput = {
78
- /** Returns coins only with `asset_id`. */
79
- assetId?: InputMaybe<Scalars['AssetId']>;
80
- /** Returns coins owned by the `owner`. */
81
- owner: Scalars['Address'];
82
- };
83
- type GqlConsensusParameters = {
84
- __typename: 'ConsensusParameters';
85
- baseAssetId: Scalars['AssetId'];
86
- chainId: Scalars['U64'];
87
- contractParams: GqlContractParameters;
88
- feeParams: GqlFeeParameters;
89
- gasCosts: GqlGasCosts;
90
- predicateParams: GqlPredicateParameters;
91
- scriptParams: GqlScriptParameters;
92
- txParams: GqlTxParameters;
93
- };
94
- type GqlContractParameters = {
95
- __typename: 'ContractParameters';
96
- contractMaxSize: Scalars['U64'];
97
- maxStorageSlots: Scalars['U64'];
98
- };
99
- type GqlDependentCost = GqlHeavyOperation | GqlLightOperation;
100
- type GqlExcludeInput = {
101
- /** Messages to exclude from the selection. */
102
- messages: Array<Scalars['Nonce']>;
103
- /** Utxos to exclude from the selection. */
104
- utxos: Array<Scalars['UtxoId']>;
105
- };
106
- type GqlFeeParameters = {
107
- __typename: 'FeeParameters';
108
- gasPerByte: Scalars['U64'];
109
- gasPriceFactor: Scalars['U64'];
110
- };
111
- type GqlGasCosts = {
112
- __typename: 'GasCosts';
113
- add: Scalars['U64'];
114
- addi: Scalars['U64'];
115
- aloc: Scalars['U64'];
116
- and: Scalars['U64'];
117
- andi: Scalars['U64'];
118
- bal: Scalars['U64'];
119
- bhei: Scalars['U64'];
120
- bhsh: Scalars['U64'];
121
- burn: Scalars['U64'];
122
- call: GqlDependentCost;
123
- cb: Scalars['U64'];
124
- ccp: GqlDependentCost;
125
- cfei: Scalars['U64'];
126
- cfsi: Scalars['U64'];
127
- contractRoot: GqlDependentCost;
128
- croo: Scalars['U64'];
129
- csiz: GqlDependentCost;
130
- div: Scalars['U64'];
131
- divi: Scalars['U64'];
132
- eck1: Scalars['U64'];
133
- ecr1: Scalars['U64'];
134
- ed19: Scalars['U64'];
135
- eq: Scalars['U64'];
136
- exp: Scalars['U64'];
137
- expi: Scalars['U64'];
138
- flag: Scalars['U64'];
139
- gm: Scalars['U64'];
140
- gt: Scalars['U64'];
141
- gtf: Scalars['U64'];
142
- ji: Scalars['U64'];
143
- jmp: Scalars['U64'];
144
- jmpb: Scalars['U64'];
145
- jmpf: Scalars['U64'];
146
- jne: Scalars['U64'];
147
- jneb: Scalars['U64'];
148
- jnef: Scalars['U64'];
149
- jnei: Scalars['U64'];
150
- jnzb: Scalars['U64'];
151
- jnzf: Scalars['U64'];
152
- jnzi: Scalars['U64'];
153
- k256: GqlDependentCost;
154
- lb: Scalars['U64'];
155
- ldc: GqlDependentCost;
156
- log: Scalars['U64'];
157
- logd: GqlDependentCost;
158
- lt: Scalars['U64'];
159
- lw: Scalars['U64'];
160
- mcl: GqlDependentCost;
161
- mcli: GqlDependentCost;
162
- mcp: GqlDependentCost;
163
- mcpi: GqlDependentCost;
164
- meq: GqlDependentCost;
165
- mint: Scalars['U64'];
166
- mldv: Scalars['U64'];
167
- mlog: Scalars['U64'];
168
- modOp: Scalars['U64'];
169
- modi: Scalars['U64'];
170
- moveOp: Scalars['U64'];
171
- movi: Scalars['U64'];
172
- mroo: Scalars['U64'];
173
- mul: Scalars['U64'];
174
- muli: Scalars['U64'];
175
- newStoragePerByte: Scalars['U64'];
176
- noop: Scalars['U64'];
177
- not: Scalars['U64'];
178
- or: Scalars['U64'];
179
- ori: Scalars['U64'];
180
- poph: Scalars['U64'];
181
- popl: Scalars['U64'];
182
- pshh: Scalars['U64'];
183
- pshl: Scalars['U64'];
184
- ret: Scalars['U64'];
185
- retd: GqlDependentCost;
186
- rvrt: Scalars['U64'];
187
- s256: GqlDependentCost;
188
- sb: Scalars['U64'];
189
- scwq: GqlDependentCost;
190
- sll: Scalars['U64'];
191
- slli: Scalars['U64'];
192
- smo: GqlDependentCost;
193
- srl: Scalars['U64'];
194
- srli: Scalars['U64'];
195
- srw: Scalars['U64'];
196
- srwq: GqlDependentCost;
197
- stateRoot: GqlDependentCost;
198
- sub: Scalars['U64'];
199
- subi: Scalars['U64'];
200
- sw: Scalars['U64'];
201
- sww: Scalars['U64'];
202
- swwq: GqlDependentCost;
203
- time: Scalars['U64'];
204
- tr: Scalars['U64'];
205
- tro: Scalars['U64'];
206
- vmInitialization: GqlDependentCost;
207
- wdam: Scalars['U64'];
208
- wdcm: Scalars['U64'];
209
- wddv: Scalars['U64'];
210
- wdmd: Scalars['U64'];
211
- wdml: Scalars['U64'];
212
- wdmm: Scalars['U64'];
213
- wdop: Scalars['U64'];
214
- wqam: Scalars['U64'];
215
- wqcm: Scalars['U64'];
216
- wqdv: Scalars['U64'];
217
- wqmd: Scalars['U64'];
218
- wqml: Scalars['U64'];
219
- wqmm: Scalars['U64'];
220
- wqop: Scalars['U64'];
221
- xor: Scalars['U64'];
222
- xori: Scalars['U64'];
223
- };
224
- type GqlHeavyOperation = {
225
- __typename: 'HeavyOperation';
226
- base: Scalars['U64'];
227
- gasPerUnit: Scalars['U64'];
228
- };
229
- type GqlLightOperation = {
230
- __typename: 'LightOperation';
231
- base: Scalars['U64'];
232
- unitsPerGas: Scalars['U64'];
233
- };
234
- declare enum GqlMessageState {
235
- NotFound = "NOT_FOUND",
236
- Spent = "SPENT",
237
- Unspent = "UNSPENT"
238
- }
239
- /** Information about pagination in a connection */
240
- type GqlPageInfo = {
241
- __typename: 'PageInfo';
242
- /** When paginating forwards, the cursor to continue. */
243
- endCursor?: Maybe<Scalars['String']>;
244
- /** When paginating forwards, are there more items? */
245
- hasNextPage: Scalars['Boolean'];
246
- /** When paginating backwards, are there more items? */
247
- hasPreviousPage: Scalars['Boolean'];
248
- /** When paginating backwards, the cursor to continue. */
249
- startCursor?: Maybe<Scalars['String']>;
250
- };
251
- type GqlPeerInfo = {
252
- __typename: 'PeerInfo';
253
- /** The advertised multi-addrs that can be used to connect to this peer */
254
- addresses: Array<Scalars['String']>;
255
- /** The internal fuel p2p reputation of this peer */
256
- appScore: Scalars['Float'];
257
- /** The last reported height of the peer */
258
- blockHeight?: Maybe<Scalars['U32']>;
259
- /** The self-reported version of the client the peer is using */
260
- clientVersion?: Maybe<Scalars['String']>;
261
- /** The libp2p peer id */
262
- id: Scalars['String'];
263
- /** The last heartbeat from this peer in unix epoch time ms */
264
- lastHeartbeatMs: Scalars['U64'];
265
- };
266
- type GqlPredicateParameters = {
267
- __typename: 'PredicateParameters';
268
- maxGasPerPredicate: Scalars['U64'];
269
- maxMessageDataLength: Scalars['U64'];
270
- maxPredicateDataLength: Scalars['U64'];
271
- maxPredicateLength: Scalars['U64'];
272
- };
273
- declare enum GqlReceiptType {
274
- Burn = "BURN",
275
- Call = "CALL",
276
- Log = "LOG",
277
- LogData = "LOG_DATA",
278
- MessageOut = "MESSAGE_OUT",
279
- Mint = "MINT",
280
- Panic = "PANIC",
281
- Return = "RETURN",
282
- ReturnData = "RETURN_DATA",
283
- Revert = "REVERT",
284
- ScriptResult = "SCRIPT_RESULT",
285
- Transfer = "TRANSFER",
286
- TransferOut = "TRANSFER_OUT"
287
- }
288
- declare enum GqlReturnType {
289
- Return = "RETURN",
290
- ReturnData = "RETURN_DATA",
291
- Revert = "REVERT"
292
- }
293
- type GqlScriptParameters = {
294
- __typename: 'ScriptParameters';
295
- maxScriptDataLength: Scalars['U64'];
296
- maxScriptLength: Scalars['U64'];
297
- };
298
- type GqlSpendQueryElementInput = {
299
- /** Target amount for the query. */
300
- amount: Scalars['U64'];
301
- /** Identifier of the asset to spend. */
302
- assetId: Scalars['AssetId'];
303
- /** The maximum number of currencies for selection. */
304
- max?: InputMaybe<Scalars['U32']>;
305
- };
306
- type GqlTxParameters = {
307
- __typename: 'TxParameters';
308
- maxGasPerTx: Scalars['U64'];
309
- maxInputs: Scalars['U8'];
310
- maxOutputs: Scalars['U8'];
311
- maxSize: Scalars['U64'];
312
- maxWitnesses: Scalars['U32'];
313
- };
314
- type GqlReceiptFragmentFragment = {
315
- __typename: 'Receipt';
316
- pc?: string | null;
317
- is?: string | null;
318
- toAddress?: string | null;
319
- amount?: string | null;
320
- assetId?: string | null;
321
- gas?: string | null;
322
- param1?: string | null;
323
- param2?: string | null;
324
- val?: string | null;
325
- ptr?: string | null;
326
- digest?: string | null;
327
- reason?: string | null;
328
- ra?: string | null;
329
- rb?: string | null;
330
- rc?: string | null;
331
- rd?: string | null;
332
- len?: string | null;
333
- receiptType: GqlReceiptType;
334
- result?: string | null;
335
- gasUsed?: string | null;
336
- data?: string | null;
337
- sender?: string | null;
338
- recipient?: string | null;
339
- nonce?: string | null;
340
- contractId?: string | null;
341
- subId?: string | null;
342
- contract?: {
343
- __typename: 'Contract';
344
- id: string;
345
- } | null;
346
- to?: {
347
- __typename: 'Contract';
348
- id: string;
349
- } | null;
350
- };
351
- type GqlGetVersionQueryVariables = Exact<{
352
- [key: string]: never;
353
- }>;
354
- type GqlGetVersionQuery = {
355
- __typename: 'Query';
356
- nodeInfo: {
357
- __typename: 'NodeInfo';
358
- nodeVersion: string;
359
- };
360
- };
361
- type GqlGetNodeInfoQueryVariables = Exact<{
362
- [key: string]: never;
363
- }>;
364
- type GqlGetNodeInfoQuery = {
365
- __typename: 'Query';
366
- nodeInfo: {
367
- __typename: 'NodeInfo';
368
- utxoValidation: boolean;
369
- vmBacktrace: boolean;
370
- minGasPrice: string;
371
- maxTx: string;
372
- maxDepth: string;
373
- nodeVersion: string;
374
- peers: Array<{
375
- __typename: 'PeerInfo';
376
- id: string;
377
- addresses: Array<string>;
378
- clientVersion?: string | null;
379
- blockHeight?: any | null;
380
- lastHeartbeatMs: string;
381
- appScore: number;
382
- }>;
383
- };
384
- };
385
- type GqlGetChainQueryVariables = Exact<{
386
- [key: string]: never;
387
- }>;
388
- type GqlGetChainQuery = {
389
- __typename: 'Query';
390
- chain: {
391
- __typename: 'ChainInfo';
392
- name: string;
393
- daHeight: string;
394
- latestBlock: {
395
- __typename: 'Block';
396
- id: string;
397
- header: {
398
- __typename: 'Header';
399
- height: any;
400
- time: string;
401
- };
402
- transactions: Array<{
403
- __typename: 'Transaction';
404
- id: string;
405
- }>;
406
- };
407
- consensusParameters: {
408
- __typename: 'ConsensusParameters';
409
- baseAssetId: string;
410
- chainId: string;
411
- txParams: {
412
- __typename: 'TxParameters';
413
- maxInputs: any;
414
- maxOutputs: any;
415
- maxWitnesses: any;
416
- maxGasPerTx: string;
417
- maxSize: string;
418
- };
419
- predicateParams: {
420
- __typename: 'PredicateParameters';
421
- maxPredicateLength: string;
422
- maxPredicateDataLength: string;
423
- maxGasPerPredicate: string;
424
- maxMessageDataLength: string;
425
- };
426
- scriptParams: {
427
- __typename: 'ScriptParameters';
428
- maxScriptLength: string;
429
- maxScriptDataLength: string;
430
- };
431
- contractParams: {
432
- __typename: 'ContractParameters';
433
- contractMaxSize: string;
434
- maxStorageSlots: string;
435
- };
436
- feeParams: {
437
- __typename: 'FeeParameters';
438
- gasPriceFactor: string;
439
- gasPerByte: string;
440
- };
441
- gasCosts: {
442
- __typename: 'GasCosts';
443
- add: string;
444
- addi: string;
445
- aloc: string;
446
- and: string;
447
- andi: string;
448
- bal: string;
449
- bhei: string;
450
- bhsh: string;
451
- burn: string;
452
- cb: string;
453
- cfei: string;
454
- cfsi: string;
455
- croo: string;
456
- div: string;
457
- divi: string;
458
- ecr1: string;
459
- eck1: string;
460
- ed19: string;
461
- eq: string;
462
- exp: string;
463
- expi: string;
464
- flag: string;
465
- gm: string;
466
- gt: string;
467
- gtf: string;
468
- ji: string;
469
- jmp: string;
470
- jne: string;
471
- jnei: string;
472
- jnzi: string;
473
- jmpf: string;
474
- jmpb: string;
475
- jnzf: string;
476
- jnzb: string;
477
- jnef: string;
478
- jneb: string;
479
- lb: string;
480
- log: string;
481
- lt: string;
482
- lw: string;
483
- mint: string;
484
- mlog: string;
485
- modOp: string;
486
- modi: string;
487
- moveOp: string;
488
- movi: string;
489
- mroo: string;
490
- mul: string;
491
- muli: string;
492
- mldv: string;
493
- noop: string;
494
- not: string;
495
- or: string;
496
- ori: string;
497
- poph: string;
498
- popl: string;
499
- pshh: string;
500
- pshl: string;
501
- ret: string;
502
- rvrt: string;
503
- sb: string;
504
- sll: string;
505
- slli: string;
506
- srl: string;
507
- srli: string;
508
- srw: string;
509
- sub: string;
510
- subi: string;
511
- sw: string;
512
- sww: string;
513
- time: string;
514
- tr: string;
515
- tro: string;
516
- wdcm: string;
517
- wqcm: string;
518
- wdop: string;
519
- wqop: string;
520
- wdml: string;
521
- wqml: string;
522
- wddv: string;
523
- wqdv: string;
524
- wdmd: string;
525
- wqmd: string;
526
- wdam: string;
527
- wqam: string;
528
- wdmm: string;
529
- wqmm: string;
530
- xor: string;
531
- xori: string;
532
- newStoragePerByte: string;
533
- call: {
534
- __typename: 'HeavyOperation';
535
- base: string;
536
- gasPerUnit: string;
537
- } | {
538
- __typename: 'LightOperation';
539
- base: string;
540
- unitsPerGas: string;
541
- };
542
- ccp: {
543
- __typename: 'HeavyOperation';
544
- base: string;
545
- gasPerUnit: string;
546
- } | {
547
- __typename: 'LightOperation';
548
- base: string;
549
- unitsPerGas: string;
550
- };
551
- csiz: {
552
- __typename: 'HeavyOperation';
553
- base: string;
554
- gasPerUnit: string;
555
- } | {
556
- __typename: 'LightOperation';
557
- base: string;
558
- unitsPerGas: string;
559
- };
560
- k256: {
561
- __typename: 'HeavyOperation';
562
- base: string;
563
- gasPerUnit: string;
564
- } | {
565
- __typename: 'LightOperation';
566
- base: string;
567
- unitsPerGas: string;
568
- };
569
- ldc: {
570
- __typename: 'HeavyOperation';
571
- base: string;
572
- gasPerUnit: string;
573
- } | {
574
- __typename: 'LightOperation';
575
- base: string;
576
- unitsPerGas: string;
577
- };
578
- logd: {
579
- __typename: 'HeavyOperation';
580
- base: string;
581
- gasPerUnit: string;
582
- } | {
583
- __typename: 'LightOperation';
584
- base: string;
585
- unitsPerGas: string;
586
- };
587
- mcl: {
588
- __typename: 'HeavyOperation';
589
- base: string;
590
- gasPerUnit: string;
591
- } | {
592
- __typename: 'LightOperation';
593
- base: string;
594
- unitsPerGas: string;
595
- };
596
- mcli: {
597
- __typename: 'HeavyOperation';
598
- base: string;
599
- gasPerUnit: string;
600
- } | {
601
- __typename: 'LightOperation';
602
- base: string;
603
- unitsPerGas: string;
604
- };
605
- mcp: {
606
- __typename: 'HeavyOperation';
607
- base: string;
608
- gasPerUnit: string;
609
- } | {
610
- __typename: 'LightOperation';
611
- base: string;
612
- unitsPerGas: string;
613
- };
614
- mcpi: {
615
- __typename: 'HeavyOperation';
616
- base: string;
617
- gasPerUnit: string;
618
- } | {
619
- __typename: 'LightOperation';
620
- base: string;
621
- unitsPerGas: string;
622
- };
623
- meq: {
624
- __typename: 'HeavyOperation';
625
- base: string;
626
- gasPerUnit: string;
627
- } | {
628
- __typename: 'LightOperation';
629
- base: string;
630
- unitsPerGas: string;
631
- };
632
- retd: {
633
- __typename: 'HeavyOperation';
634
- base: string;
635
- gasPerUnit: string;
636
- } | {
637
- __typename: 'LightOperation';
638
- base: string;
639
- unitsPerGas: string;
640
- };
641
- s256: {
642
- __typename: 'HeavyOperation';
643
- base: string;
644
- gasPerUnit: string;
645
- } | {
646
- __typename: 'LightOperation';
647
- base: string;
648
- unitsPerGas: string;
649
- };
650
- scwq: {
651
- __typename: 'HeavyOperation';
652
- base: string;
653
- gasPerUnit: string;
654
- } | {
655
- __typename: 'LightOperation';
656
- base: string;
657
- unitsPerGas: string;
658
- };
659
- smo: {
660
- __typename: 'HeavyOperation';
661
- base: string;
662
- gasPerUnit: string;
663
- } | {
664
- __typename: 'LightOperation';
665
- base: string;
666
- unitsPerGas: string;
667
- };
668
- srwq: {
669
- __typename: 'HeavyOperation';
670
- base: string;
671
- gasPerUnit: string;
672
- } | {
673
- __typename: 'LightOperation';
674
- base: string;
675
- unitsPerGas: string;
676
- };
677
- swwq: {
678
- __typename: 'HeavyOperation';
679
- base: string;
680
- gasPerUnit: string;
681
- } | {
682
- __typename: 'LightOperation';
683
- base: string;
684
- unitsPerGas: string;
685
- };
686
- contractRoot: {
687
- __typename: 'HeavyOperation';
688
- base: string;
689
- gasPerUnit: string;
690
- } | {
691
- __typename: 'LightOperation';
692
- base: string;
693
- unitsPerGas: string;
694
- };
695
- stateRoot: {
696
- __typename: 'HeavyOperation';
697
- base: string;
698
- gasPerUnit: string;
699
- } | {
700
- __typename: 'LightOperation';
701
- base: string;
702
- unitsPerGas: string;
703
- };
704
- vmInitialization: {
705
- __typename: 'HeavyOperation';
706
- base: string;
707
- gasPerUnit: string;
708
- } | {
709
- __typename: 'LightOperation';
710
- base: string;
711
- unitsPerGas: string;
712
- };
713
- };
714
- };
715
- };
716
- };
717
- type GqlGetTransactionQueryVariables = Exact<{
718
- transactionId: Scalars['TransactionId'];
719
- }>;
720
- type GqlGetTransactionQuery = {
721
- __typename: 'Query';
722
- transaction?: {
723
- __typename: 'Transaction';
724
- id: string;
725
- rawPayload: string;
726
- gasPrice?: string | null;
727
- receipts?: Array<{
728
- __typename: 'Receipt';
729
- pc?: string | null;
730
- is?: string | null;
731
- toAddress?: string | null;
732
- amount?: string | null;
733
- assetId?: string | null;
734
- gas?: string | null;
735
- param1?: string | null;
736
- param2?: string | null;
737
- val?: string | null;
738
- ptr?: string | null;
739
- digest?: string | null;
740
- reason?: string | null;
741
- ra?: string | null;
742
- rb?: string | null;
743
- rc?: string | null;
744
- rd?: string | null;
745
- len?: string | null;
746
- receiptType: GqlReceiptType;
747
- result?: string | null;
748
- gasUsed?: string | null;
749
- data?: string | null;
750
- sender?: string | null;
751
- recipient?: string | null;
752
- nonce?: string | null;
753
- contractId?: string | null;
754
- subId?: string | null;
755
- contract?: {
756
- __typename: 'Contract';
757
- id: string;
758
- } | null;
759
- to?: {
760
- __typename: 'Contract';
761
- id: string;
762
- } | null;
763
- }> | null;
764
- status?: {
765
- __typename: 'FailureStatus';
766
- time: string;
767
- reason: string;
768
- type: 'FailureStatus';
769
- block: {
770
- __typename: 'Block';
771
- id: string;
772
- };
773
- } | {
774
- __typename: 'SqueezedOutStatus';
775
- reason: string;
776
- type: 'SqueezedOutStatus';
777
- } | {
778
- __typename: 'SubmittedStatus';
779
- time: string;
780
- type: 'SubmittedStatus';
781
- } | {
782
- __typename: 'SuccessStatus';
783
- time: string;
784
- type: 'SuccessStatus';
785
- block: {
786
- __typename: 'Block';
787
- id: string;
788
- };
789
- programState?: {
790
- __typename: 'ProgramState';
791
- returnType: GqlReturnType;
792
- data: string;
793
- } | null;
794
- } | null;
795
- } | null;
796
- };
797
- type GqlGetTransactionWithReceiptsQueryVariables = Exact<{
798
- transactionId: Scalars['TransactionId'];
799
- }>;
800
- type GqlGetTransactionWithReceiptsQuery = {
801
- __typename: 'Query';
802
- transaction?: {
803
- __typename: 'Transaction';
804
- id: string;
805
- rawPayload: string;
806
- gasPrice?: string | null;
807
- receipts?: Array<{
808
- __typename: 'Receipt';
809
- pc?: string | null;
810
- is?: string | null;
811
- toAddress?: string | null;
812
- amount?: string | null;
813
- assetId?: string | null;
814
- gas?: string | null;
815
- param1?: string | null;
816
- param2?: string | null;
817
- val?: string | null;
818
- ptr?: string | null;
819
- digest?: string | null;
820
- reason?: string | null;
821
- ra?: string | null;
822
- rb?: string | null;
823
- rc?: string | null;
824
- rd?: string | null;
825
- len?: string | null;
826
- receiptType: GqlReceiptType;
827
- result?: string | null;
828
- gasUsed?: string | null;
829
- data?: string | null;
830
- sender?: string | null;
831
- recipient?: string | null;
832
- nonce?: string | null;
833
- contractId?: string | null;
834
- subId?: string | null;
835
- contract?: {
836
- __typename: 'Contract';
837
- id: string;
838
- } | null;
839
- to?: {
840
- __typename: 'Contract';
841
- id: string;
842
- } | null;
843
- }> | null;
844
- status?: {
845
- __typename: 'FailureStatus';
846
- time: string;
847
- reason: string;
848
- type: 'FailureStatus';
849
- block: {
850
- __typename: 'Block';
851
- id: string;
852
- };
853
- } | {
854
- __typename: 'SqueezedOutStatus';
855
- reason: string;
856
- type: 'SqueezedOutStatus';
857
- } | {
858
- __typename: 'SubmittedStatus';
859
- time: string;
860
- type: 'SubmittedStatus';
861
- } | {
862
- __typename: 'SuccessStatus';
863
- time: string;
864
- type: 'SuccessStatus';
865
- block: {
866
- __typename: 'Block';
867
- id: string;
868
- };
869
- programState?: {
870
- __typename: 'ProgramState';
871
- returnType: GqlReturnType;
872
- data: string;
873
- } | null;
874
- } | null;
875
- } | null;
876
- };
877
- type GqlGetTransactionsQueryVariables = Exact<{
878
- after?: InputMaybe<Scalars['String']>;
879
- before?: InputMaybe<Scalars['String']>;
880
- first?: InputMaybe<Scalars['Int']>;
881
- last?: InputMaybe<Scalars['Int']>;
882
- }>;
883
- type GqlGetTransactionsQuery = {
884
- __typename: 'Query';
885
- transactions: {
886
- __typename: 'TransactionConnection';
887
- edges: Array<{
888
- __typename: 'TransactionEdge';
889
- node: {
890
- __typename: 'Transaction';
891
- id: string;
892
- rawPayload: string;
893
- gasPrice?: string | null;
894
- receipts?: Array<{
895
- __typename: 'Receipt';
896
- pc?: string | null;
897
- is?: string | null;
898
- toAddress?: string | null;
899
- amount?: string | null;
900
- assetId?: string | null;
901
- gas?: string | null;
902
- param1?: string | null;
903
- param2?: string | null;
904
- val?: string | null;
905
- ptr?: string | null;
906
- digest?: string | null;
907
- reason?: string | null;
908
- ra?: string | null;
909
- rb?: string | null;
910
- rc?: string | null;
911
- rd?: string | null;
912
- len?: string | null;
913
- receiptType: GqlReceiptType;
914
- result?: string | null;
915
- gasUsed?: string | null;
916
- data?: string | null;
917
- sender?: string | null;
918
- recipient?: string | null;
919
- nonce?: string | null;
920
- contractId?: string | null;
921
- subId?: string | null;
922
- contract?: {
923
- __typename: 'Contract';
924
- id: string;
925
- } | null;
926
- to?: {
927
- __typename: 'Contract';
928
- id: string;
929
- } | null;
930
- }> | null;
931
- status?: {
932
- __typename: 'FailureStatus';
933
- time: string;
934
- reason: string;
935
- type: 'FailureStatus';
936
- block: {
937
- __typename: 'Block';
938
- id: string;
939
- };
940
- } | {
941
- __typename: 'SqueezedOutStatus';
942
- reason: string;
943
- type: 'SqueezedOutStatus';
944
- } | {
945
- __typename: 'SubmittedStatus';
946
- time: string;
947
- type: 'SubmittedStatus';
948
- } | {
949
- __typename: 'SuccessStatus';
950
- time: string;
951
- type: 'SuccessStatus';
952
- block: {
953
- __typename: 'Block';
954
- id: string;
955
- };
956
- programState?: {
957
- __typename: 'ProgramState';
958
- returnType: GqlReturnType;
959
- data: string;
960
- } | null;
961
- } | null;
962
- };
963
- }>;
964
- };
965
- };
966
- type GqlGetTransactionsByOwnerQueryVariables = Exact<{
967
- owner: Scalars['Address'];
968
- after?: InputMaybe<Scalars['String']>;
969
- before?: InputMaybe<Scalars['String']>;
970
- first?: InputMaybe<Scalars['Int']>;
971
- last?: InputMaybe<Scalars['Int']>;
972
- }>;
973
- type GqlGetTransactionsByOwnerQuery = {
974
- __typename: 'Query';
975
- transactionsByOwner: {
976
- __typename: 'TransactionConnection';
977
- pageInfo: {
978
- __typename: 'PageInfo';
979
- hasPreviousPage: boolean;
980
- hasNextPage: boolean;
981
- startCursor?: string | null;
982
- endCursor?: string | null;
983
- };
984
- edges: Array<{
985
- __typename: 'TransactionEdge';
986
- node: {
987
- __typename: 'Transaction';
988
- id: string;
989
- rawPayload: string;
990
- gasPrice?: string | null;
991
- receipts?: Array<{
992
- __typename: 'Receipt';
993
- pc?: string | null;
994
- is?: string | null;
995
- toAddress?: string | null;
996
- amount?: string | null;
997
- assetId?: string | null;
998
- gas?: string | null;
999
- param1?: string | null;
1000
- param2?: string | null;
1001
- val?: string | null;
1002
- ptr?: string | null;
1003
- digest?: string | null;
1004
- reason?: string | null;
1005
- ra?: string | null;
1006
- rb?: string | null;
1007
- rc?: string | null;
1008
- rd?: string | null;
1009
- len?: string | null;
1010
- receiptType: GqlReceiptType;
1011
- result?: string | null;
1012
- gasUsed?: string | null;
1013
- data?: string | null;
1014
- sender?: string | null;
1015
- recipient?: string | null;
1016
- nonce?: string | null;
1017
- contractId?: string | null;
1018
- subId?: string | null;
1019
- contract?: {
1020
- __typename: 'Contract';
1021
- id: string;
1022
- } | null;
1023
- to?: {
1024
- __typename: 'Contract';
1025
- id: string;
1026
- } | null;
1027
- }> | null;
1028
- status?: {
1029
- __typename: 'FailureStatus';
1030
- time: string;
1031
- reason: string;
1032
- type: 'FailureStatus';
1033
- block: {
1034
- __typename: 'Block';
1035
- id: string;
1036
- };
1037
- } | {
1038
- __typename: 'SqueezedOutStatus';
1039
- reason: string;
1040
- type: 'SqueezedOutStatus';
1041
- } | {
1042
- __typename: 'SubmittedStatus';
1043
- time: string;
1044
- type: 'SubmittedStatus';
1045
- } | {
1046
- __typename: 'SuccessStatus';
1047
- time: string;
1048
- type: 'SuccessStatus';
1049
- block: {
1050
- __typename: 'Block';
1051
- id: string;
1052
- };
1053
- programState?: {
1054
- __typename: 'ProgramState';
1055
- returnType: GqlReturnType;
1056
- data: string;
1057
- } | null;
1058
- } | null;
1059
- };
1060
- }>;
1061
- };
1062
- };
1063
- type GqlEstimatePredicatesQueryVariables = Exact<{
1064
- encodedTransaction: Scalars['HexString'];
1065
- }>;
1066
- type GqlEstimatePredicatesQuery = {
1067
- __typename: 'Query';
1068
- estimatePredicates: {
1069
- __typename: 'Transaction';
1070
- inputs?: Array<{
1071
- __typename: 'InputCoin';
1072
- predicateGasUsed: string;
1073
- } | {
1074
- __typename: 'InputContract';
1075
- } | {
1076
- __typename: 'InputMessage';
1077
- predicateGasUsed: string;
1078
- }> | null;
1079
- };
1080
- };
1081
- type GqlGetBlockQueryVariables = Exact<{
1082
- blockId?: InputMaybe<Scalars['BlockId']>;
1083
- height?: InputMaybe<Scalars['U32']>;
1084
- }>;
1085
- type GqlGetBlockQuery = {
1086
- __typename: 'Query';
1087
- block?: {
1088
- __typename: 'Block';
1089
- id: string;
1090
- header: {
1091
- __typename: 'Header';
1092
- height: any;
1093
- time: string;
1094
- };
1095
- transactions: Array<{
1096
- __typename: 'Transaction';
1097
- id: string;
1098
- }>;
1099
- } | null;
1100
- };
1101
- type GqlGetBlockWithTransactionsQueryVariables = Exact<{
1102
- blockId?: InputMaybe<Scalars['BlockId']>;
1103
- blockHeight?: InputMaybe<Scalars['U32']>;
1104
- }>;
1105
- type GqlGetBlockWithTransactionsQuery = {
1106
- __typename: 'Query';
1107
- block?: {
1108
- __typename: 'Block';
1109
- id: string;
1110
- transactions: Array<{
1111
- __typename: 'Transaction';
1112
- id: string;
1113
- rawPayload: string;
1114
- gasPrice?: string | null;
1115
- receipts?: Array<{
1116
- __typename: 'Receipt';
1117
- pc?: string | null;
1118
- is?: string | null;
1119
- toAddress?: string | null;
1120
- amount?: string | null;
1121
- assetId?: string | null;
1122
- gas?: string | null;
1123
- param1?: string | null;
1124
- param2?: string | null;
1125
- val?: string | null;
1126
- ptr?: string | null;
1127
- digest?: string | null;
1128
- reason?: string | null;
1129
- ra?: string | null;
1130
- rb?: string | null;
1131
- rc?: string | null;
1132
- rd?: string | null;
1133
- len?: string | null;
1134
- receiptType: GqlReceiptType;
1135
- result?: string | null;
1136
- gasUsed?: string | null;
1137
- data?: string | null;
1138
- sender?: string | null;
1139
- recipient?: string | null;
1140
- nonce?: string | null;
1141
- contractId?: string | null;
1142
- subId?: string | null;
1143
- contract?: {
1144
- __typename: 'Contract';
1145
- id: string;
1146
- } | null;
1147
- to?: {
1148
- __typename: 'Contract';
1149
- id: string;
1150
- } | null;
1151
- }> | null;
1152
- status?: {
1153
- __typename: 'FailureStatus';
1154
- time: string;
1155
- reason: string;
1156
- type: 'FailureStatus';
1157
- block: {
1158
- __typename: 'Block';
1159
- id: string;
1160
- };
1161
- } | {
1162
- __typename: 'SqueezedOutStatus';
1163
- reason: string;
1164
- type: 'SqueezedOutStatus';
1165
- } | {
1166
- __typename: 'SubmittedStatus';
1167
- time: string;
1168
- type: 'SubmittedStatus';
1169
- } | {
1170
- __typename: 'SuccessStatus';
1171
- time: string;
1172
- type: 'SuccessStatus';
1173
- block: {
1174
- __typename: 'Block';
1175
- id: string;
1176
- };
1177
- programState?: {
1178
- __typename: 'ProgramState';
1179
- returnType: GqlReturnType;
1180
- data: string;
1181
- } | null;
1182
- } | null;
1183
- }>;
1184
- header: {
1185
- __typename: 'Header';
1186
- height: any;
1187
- time: string;
1188
- };
1189
- } | null;
1190
- };
1191
- type GqlGetBlocksQueryVariables = Exact<{
1192
- after?: InputMaybe<Scalars['String']>;
1193
- before?: InputMaybe<Scalars['String']>;
1194
- first?: InputMaybe<Scalars['Int']>;
1195
- last?: InputMaybe<Scalars['Int']>;
1196
- }>;
1197
- type GqlGetBlocksQuery = {
1198
- __typename: 'Query';
1199
- blocks: {
1200
- __typename: 'BlockConnection';
1201
- edges: Array<{
1202
- __typename: 'BlockEdge';
1203
- node: {
1204
- __typename: 'Block';
1205
- id: string;
1206
- header: {
1207
- __typename: 'Header';
1208
- height: any;
1209
- time: string;
1210
- };
1211
- transactions: Array<{
1212
- __typename: 'Transaction';
1213
- id: string;
1214
- }>;
1215
- };
1216
- }>;
1217
- };
1218
- };
1219
- type GqlGetCoinQueryVariables = Exact<{
1220
- coinId: Scalars['UtxoId'];
1221
- }>;
1222
- type GqlGetCoinQuery = {
1223
- __typename: 'Query';
1224
- coin?: {
1225
- __typename: 'Coin';
1226
- utxoId: string;
1227
- owner: string;
1228
- amount: string;
1229
- assetId: string;
1230
- maturity: any;
1231
- blockCreated: any;
1232
- txCreatedIdx: string;
1233
- } | null;
1234
- };
1235
- type GqlGetCoinsQueryVariables = Exact<{
1236
- filter: GqlCoinFilterInput;
1237
- after?: InputMaybe<Scalars['String']>;
1238
- before?: InputMaybe<Scalars['String']>;
1239
- first?: InputMaybe<Scalars['Int']>;
1240
- last?: InputMaybe<Scalars['Int']>;
1241
- }>;
1242
- type GqlGetCoinsQuery = {
1243
- __typename: 'Query';
1244
- coins: {
1245
- __typename: 'CoinConnection';
1246
- edges: Array<{
1247
- __typename: 'CoinEdge';
1248
- node: {
1249
- __typename: 'Coin';
1250
- utxoId: string;
1251
- owner: string;
1252
- amount: string;
1253
- assetId: string;
1254
- maturity: any;
1255
- blockCreated: any;
1256
- txCreatedIdx: string;
1257
- };
1258
- }>;
1259
- };
1260
- };
1261
- type GqlGetCoinsToSpendQueryVariables = Exact<{
1262
- owner: Scalars['Address'];
1263
- queryPerAsset: Array<GqlSpendQueryElementInput> | GqlSpendQueryElementInput;
1264
- excludedIds?: InputMaybe<GqlExcludeInput>;
1265
- }>;
1266
- type GqlGetCoinsToSpendQuery = {
1267
- __typename: 'Query';
1268
- coinsToSpend: Array<Array<{
1269
- __typename: 'Coin';
1270
- utxoId: string;
1271
- owner: string;
1272
- amount: string;
1273
- assetId: string;
1274
- maturity: any;
1275
- blockCreated: any;
1276
- txCreatedIdx: string;
1277
- } | {
1278
- __typename: 'MessageCoin';
1279
- sender: string;
1280
- recipient: string;
1281
- nonce: string;
1282
- amount: string;
1283
- assetId: string;
1284
- daHeight: string;
1285
- }>>;
1286
- };
1287
- type GqlGetContractQueryVariables = Exact<{
1288
- contractId: Scalars['ContractId'];
1289
- }>;
1290
- type GqlGetContractQuery = {
1291
- __typename: 'Query';
1292
- contract?: {
1293
- __typename: 'Contract';
1294
- bytecode: string;
1295
- id: string;
1296
- } | null;
1297
- };
1298
- type GqlGetContractBalanceQueryVariables = Exact<{
1299
- contract: Scalars['ContractId'];
1300
- asset: Scalars['AssetId'];
1301
- }>;
1302
- type GqlGetContractBalanceQuery = {
1303
- __typename: 'Query';
1304
- contractBalance: {
1305
- __typename: 'ContractBalance';
1306
- contract: string;
1307
- amount: string;
1308
- assetId: string;
1309
- };
1310
- };
1311
- type GqlGetBalanceQueryVariables = Exact<{
1312
- owner: Scalars['Address'];
1313
- assetId: Scalars['AssetId'];
1314
- }>;
1315
- type GqlGetBalanceQuery = {
1316
- __typename: 'Query';
1317
- balance: {
1318
- __typename: 'Balance';
1319
- owner: string;
1320
- amount: string;
1321
- assetId: string;
1322
- };
1323
- };
1324
- type GqlGetBalancesQueryVariables = Exact<{
1325
- filter: GqlBalanceFilterInput;
1326
- after?: InputMaybe<Scalars['String']>;
1327
- before?: InputMaybe<Scalars['String']>;
1328
- first?: InputMaybe<Scalars['Int']>;
1329
- last?: InputMaybe<Scalars['Int']>;
1330
- }>;
1331
- type GqlGetBalancesQuery = {
1332
- __typename: 'Query';
1333
- balances: {
1334
- __typename: 'BalanceConnection';
1335
- edges: Array<{
1336
- __typename: 'BalanceEdge';
1337
- node: {
1338
- __typename: 'Balance';
1339
- owner: string;
1340
- amount: string;
1341
- assetId: string;
1342
- };
1343
- }>;
1344
- };
1345
- };
1346
- type GqlGetMessagesQueryVariables = Exact<{
1347
- owner: Scalars['Address'];
1348
- after?: InputMaybe<Scalars['String']>;
1349
- before?: InputMaybe<Scalars['String']>;
1350
- first?: InputMaybe<Scalars['Int']>;
1351
- last?: InputMaybe<Scalars['Int']>;
1352
- }>;
1353
- type GqlGetMessagesQuery = {
1354
- __typename: 'Query';
1355
- messages: {
1356
- __typename: 'MessageConnection';
1357
- edges: Array<{
1358
- __typename: 'MessageEdge';
1359
- node: {
1360
- __typename: 'Message';
1361
- amount: string;
1362
- sender: string;
1363
- recipient: string;
1364
- data: string;
1365
- nonce: string;
1366
- daHeight: string;
1367
- };
1368
- }>;
1369
- };
1370
- };
1371
- type GqlGetMessageProofQueryVariables = Exact<{
1372
- transactionId: Scalars['TransactionId'];
1373
- nonce: Scalars['Nonce'];
1374
- commitBlockId?: InputMaybe<Scalars['BlockId']>;
1375
- commitBlockHeight?: InputMaybe<Scalars['U32']>;
1376
- }>;
1377
- type GqlGetMessageProofQuery = {
1378
- __typename: 'Query';
1379
- messageProof?: {
1380
- __typename: 'MessageProof';
1381
- sender: string;
1382
- recipient: string;
1383
- nonce: string;
1384
- amount: string;
1385
- data: string;
1386
- messageProof: {
1387
- __typename: 'MerkleProof';
1388
- proofSet: Array<string>;
1389
- proofIndex: string;
1390
- };
1391
- blockProof: {
1392
- __typename: 'MerkleProof';
1393
- proofSet: Array<string>;
1394
- proofIndex: string;
1395
- };
1396
- messageBlockHeader: {
1397
- __typename: 'Header';
1398
- id: string;
1399
- daHeight: string;
1400
- transactionsCount: string;
1401
- transactionsRoot: string;
1402
- height: any;
1403
- prevRoot: string;
1404
- time: string;
1405
- applicationHash: string;
1406
- messageReceiptRoot: string;
1407
- messageReceiptCount: string;
1408
- };
1409
- commitBlockHeader: {
1410
- __typename: 'Header';
1411
- id: string;
1412
- daHeight: string;
1413
- transactionsCount: string;
1414
- transactionsRoot: string;
1415
- height: any;
1416
- prevRoot: string;
1417
- time: string;
1418
- applicationHash: string;
1419
- messageReceiptRoot: string;
1420
- messageReceiptCount: string;
1421
- };
1422
- } | null;
1423
- };
1424
- type GqlGetMessageStatusQueryVariables = Exact<{
1425
- nonce: Scalars['Nonce'];
1426
- }>;
1427
- type GqlGetMessageStatusQuery = {
1428
- __typename: 'Query';
1429
- messageStatus: {
1430
- __typename: 'MessageStatus';
1431
- state: GqlMessageState;
1432
- };
1433
- };
1434
- type GqlDryRunMutationVariables = Exact<{
1435
- encodedTransaction: Scalars['HexString'];
1436
- utxoValidation?: InputMaybe<Scalars['Boolean']>;
1437
- }>;
1438
- type GqlDryRunMutation = {
1439
- __typename: 'Mutation';
1440
- dryRun: Array<{
1441
- __typename: 'Receipt';
1442
- pc?: string | null;
1443
- is?: string | null;
1444
- toAddress?: string | null;
1445
- amount?: string | null;
1446
- assetId?: string | null;
1447
- gas?: string | null;
1448
- param1?: string | null;
1449
- param2?: string | null;
1450
- val?: string | null;
1451
- ptr?: string | null;
1452
- digest?: string | null;
1453
- reason?: string | null;
1454
- ra?: string | null;
1455
- rb?: string | null;
1456
- rc?: string | null;
1457
- rd?: string | null;
1458
- len?: string | null;
1459
- receiptType: GqlReceiptType;
1460
- result?: string | null;
1461
- gasUsed?: string | null;
1462
- data?: string | null;
1463
- sender?: string | null;
1464
- recipient?: string | null;
1465
- nonce?: string | null;
1466
- contractId?: string | null;
1467
- subId?: string | null;
1468
- contract?: {
1469
- __typename: 'Contract';
1470
- id: string;
1471
- } | null;
1472
- to?: {
1473
- __typename: 'Contract';
1474
- id: string;
1475
- } | null;
1476
- }>;
1477
- };
1478
- type GqlSubmitMutationVariables = Exact<{
1479
- encodedTransaction: Scalars['HexString'];
1480
- }>;
1481
- type GqlSubmitMutation = {
1482
- __typename: 'Mutation';
1483
- submit: {
1484
- __typename: 'Transaction';
1485
- id: string;
1486
- };
1487
- };
1488
- type GqlProduceBlocksMutationVariables = Exact<{
1489
- startTimestamp?: InputMaybe<Scalars['Tai64Timestamp']>;
1490
- blocksToProduce: Scalars['U32'];
1491
- }>;
1492
- type GqlProduceBlocksMutation = {
1493
- __typename: 'Mutation';
1494
- produceBlocks: any;
1495
- };
1496
- type GqlSubmitAndAwaitSubscriptionVariables = Exact<{
1497
- encodedTransaction: Scalars['HexString'];
1498
- }>;
1499
- type GqlSubmitAndAwaitSubscription = {
1500
- __typename: 'Subscription';
1501
- submitAndAwait: {
1502
- __typename: 'FailureStatus';
1503
- time: string;
1504
- reason: string;
1505
- type: 'FailureStatus';
1506
- block: {
1507
- __typename: 'Block';
1508
- id: string;
1509
- };
1510
- } | {
1511
- __typename: 'SqueezedOutStatus';
1512
- reason: string;
1513
- type: 'SqueezedOutStatus';
1514
- } | {
1515
- __typename: 'SubmittedStatus';
1516
- time: string;
1517
- type: 'SubmittedStatus';
1518
- } | {
1519
- __typename: 'SuccessStatus';
1520
- time: string;
1521
- type: 'SuccessStatus';
1522
- block: {
1523
- __typename: 'Block';
1524
- id: string;
1525
- };
1526
- programState?: {
1527
- __typename: 'ProgramState';
1528
- returnType: GqlReturnType;
1529
- data: string;
1530
- } | null;
1531
- };
1532
- };
1533
- type GqlStatusChangeSubscriptionVariables = Exact<{
1534
- transactionId: Scalars['TransactionId'];
1535
- }>;
1536
- type GqlStatusChangeSubscription = {
1537
- __typename: 'Subscription';
1538
- statusChange: {
1539
- __typename: 'FailureStatus';
1540
- time: string;
1541
- reason: string;
1542
- type: 'FailureStatus';
1543
- block: {
1544
- __typename: 'Block';
1545
- id: string;
1546
- };
1547
- } | {
1548
- __typename: 'SqueezedOutStatus';
1549
- reason: string;
1550
- type: 'SqueezedOutStatus';
1551
- } | {
1552
- __typename: 'SubmittedStatus';
1553
- time: string;
1554
- type: 'SubmittedStatus';
1555
- } | {
1556
- __typename: 'SuccessStatus';
1557
- time: string;
1558
- type: 'SuccessStatus';
1559
- block: {
1560
- __typename: 'Block';
1561
- id: string;
1562
- };
1563
- programState?: {
1564
- __typename: 'ProgramState';
1565
- returnType: GqlReturnType;
1566
- data: string;
1567
- } | null;
1568
- };
1569
- };
1570
- type Requester<C = {}, E = unknown> = <R, V>(doc: DocumentNode, vars?: V, options?: C) => Promise<R> | AsyncIterable<R>;
1571
- declare function getSdk<C, E>(requester: Requester<C, E>): {
1572
- getVersion(variables?: GqlGetVersionQueryVariables, options?: C): Promise<GqlGetVersionQuery>;
1573
- getNodeInfo(variables?: GqlGetNodeInfoQueryVariables, options?: C): Promise<GqlGetNodeInfoQuery>;
1574
- getChain(variables?: GqlGetChainQueryVariables, options?: C): Promise<GqlGetChainQuery>;
1575
- getTransaction(variables: GqlGetTransactionQueryVariables, options?: C): Promise<GqlGetTransactionQuery>;
1576
- getTransactionWithReceipts(variables: GqlGetTransactionWithReceiptsQueryVariables, options?: C): Promise<GqlGetTransactionWithReceiptsQuery>;
1577
- getTransactions(variables?: GqlGetTransactionsQueryVariables, options?: C): Promise<GqlGetTransactionsQuery>;
1578
- getTransactionsByOwner(variables: GqlGetTransactionsByOwnerQueryVariables, options?: C): Promise<GqlGetTransactionsByOwnerQuery>;
1579
- estimatePredicates(variables: GqlEstimatePredicatesQueryVariables, options?: C): Promise<GqlEstimatePredicatesQuery>;
1580
- getBlock(variables?: GqlGetBlockQueryVariables, options?: C): Promise<GqlGetBlockQuery>;
1581
- getBlockWithTransactions(variables?: GqlGetBlockWithTransactionsQueryVariables, options?: C): Promise<GqlGetBlockWithTransactionsQuery>;
1582
- getBlocks(variables?: GqlGetBlocksQueryVariables, options?: C): Promise<GqlGetBlocksQuery>;
1583
- getCoin(variables: GqlGetCoinQueryVariables, options?: C): Promise<GqlGetCoinQuery>;
1584
- getCoins(variables: GqlGetCoinsQueryVariables, options?: C): Promise<GqlGetCoinsQuery>;
1585
- getCoinsToSpend(variables: GqlGetCoinsToSpendQueryVariables, options?: C): Promise<GqlGetCoinsToSpendQuery>;
1586
- getContract(variables: GqlGetContractQueryVariables, options?: C): Promise<GqlGetContractQuery>;
1587
- getContractBalance(variables: GqlGetContractBalanceQueryVariables, options?: C): Promise<GqlGetContractBalanceQuery>;
1588
- getBalance(variables: GqlGetBalanceQueryVariables, options?: C): Promise<GqlGetBalanceQuery>;
1589
- getBalances(variables: GqlGetBalancesQueryVariables, options?: C): Promise<GqlGetBalancesQuery>;
1590
- getMessages(variables: GqlGetMessagesQueryVariables, options?: C): Promise<GqlGetMessagesQuery>;
1591
- getMessageProof(variables: GqlGetMessageProofQueryVariables, options?: C): Promise<GqlGetMessageProofQuery>;
1592
- getMessageStatus(variables: GqlGetMessageStatusQueryVariables, options?: C): Promise<GqlGetMessageStatusQuery>;
1593
- dryRun(variables: GqlDryRunMutationVariables, options?: C): Promise<GqlDryRunMutation>;
1594
- submit(variables: GqlSubmitMutationVariables, options?: C): Promise<GqlSubmitMutation>;
1595
- produceBlocks(variables: GqlProduceBlocksMutationVariables, options?: C): Promise<GqlProduceBlocksMutation>;
1596
- submitAndAwait(variables: GqlSubmitAndAwaitSubscriptionVariables, options?: C): AsyncIterable<GqlSubmitAndAwaitSubscription>;
1597
- statusChange(variables: GqlStatusChangeSubscriptionVariables, options?: C): AsyncIterable<GqlStatusChangeSubscription>;
1598
- };
1599
-
1600
- declare class MemoryCache {
1601
- ttl: number;
1602
- constructor(ttlInMs?: number);
1603
- get(value: BytesLike, isAutoExpiring?: boolean): BytesLike | undefined;
1604
- set(value: BytesLike): number;
1605
- getAllData(): BytesLike[];
1606
- getActiveData(): BytesLike[];
1607
- del(value: BytesLike): void;
1608
- }
1609
-
1610
- /**
1611
- * A Fuel message
1612
- */
1613
- type Message = {
1614
- messageId: BytesLike;
1615
- sender: AbstractAddress;
1616
- recipient: AbstractAddress;
1617
- nonce: BytesLike;
1618
- amount: BN;
1619
- data: BytesLike;
1620
- daHeight: BN;
1621
- };
1622
- type MessageCoin = {
1623
- assetId: string;
1624
- sender: AbstractAddress;
1625
- recipient: AbstractAddress;
1626
- nonce: BytesLike;
1627
- amount: BN;
1628
- daHeight: BN;
1629
- };
1630
- type MerkleProof = {
1631
- proofSet: Array<string>;
1632
- proofIndex: BN;
1633
- };
1634
- type BlockHeader = {
1635
- id: string;
1636
- daHeight: BN;
1637
- transactionsCount: BN;
1638
- transactionsRoot: string;
1639
- height: BN;
1640
- prevRoot: string;
1641
- time: string;
1642
- applicationHash: string;
1643
- messageReceiptRoot: string;
1644
- messageReceiptCount: BN;
1645
- };
1646
- /**
1647
- * Message Proof
1648
- */
1649
- type MessageProof = {
1650
- messageProof: MerkleProof;
1651
- blockProof: MerkleProof;
1652
- messageBlockHeader: BlockHeader;
1653
- commitBlockHeader: BlockHeader;
1654
- sender: AbstractAddress;
1655
- recipient: AbstractAddress;
1656
- nonce: string;
1657
- amount: BN;
1658
- data: string;
1659
- };
1660
- /**
1661
- * Message Status
1662
- */
1663
- type MessageStatus = {
1664
- state: GqlMessageState;
1665
- };
1666
-
1667
- type RawCoin = {
1668
- utxoId: string;
1669
- owner: string;
1670
- amount: string;
1671
- assetId: string;
1672
- maturity: string;
1673
- blockCreated: string;
1674
- txCreatedIdx: string;
1675
- };
1676
- type RawMessage = {
1677
- amount: string;
1678
- sender: string;
1679
- assetId: string;
1680
- recipient: string;
1681
- data: string;
1682
- nonce: string;
1683
- daHeight: string;
1684
- };
1685
- type RawResource = RawCoin | RawMessage;
1686
- type Resource = Coin | MessageCoin;
1687
- /** @hidden */
1688
- type ExcludeResourcesOption = {
1689
- utxos?: BytesLike[];
1690
- messages?: BytesLike[];
1691
- };
1692
- /** @hidden */
1693
- declare const isRawCoin: (resource: RawResource) => resource is RawCoin;
1694
- /** @hidden */
1695
- declare const isRawMessage: (resource: RawResource) => resource is RawMessage;
1696
- /** @hidden */
1697
- declare const isCoin: (resource: Resource) => resource is Coin;
1698
- /** @hidden */
1699
- declare const isMessage: (resource: Resource) => resource is MessageCoin;
1700
-
1701
- type CoinTransactionRequestInput = {
1702
- type: InputType.Coin;
1703
- /** UTXO ID */
1704
- id: BytesLike;
1705
- /** Owning address or script hash */
1706
- owner: BytesLike;
1707
- /** Amount of coins */
1708
- amount: BigNumberish;
1709
- /** Asset ID of the coins */
1710
- assetId: BytesLike;
1711
- /** Points to the TX whose output is being spent. (TxPointer) */
1712
- txPointer: BytesLike;
1713
- /** Index of witness that authorizes spending the coin */
1714
- witnessIndex: number;
1715
- /** UTXO being spent must have been created at least this many blocks ago */
1716
- maturity?: number;
1717
- /** Gas used by predicate */
1718
- predicateGasUsed?: BigNumberish;
1719
- /** Predicate bytecode */
1720
- predicate?: BytesLike;
1721
- /** Predicate input data (parameters) */
1722
- predicateData?: BytesLike;
1723
- };
1724
- type MessageTransactionRequestInput = {
1725
- type: InputType.Message;
1726
- /** Address of sender */
1727
- sender: BytesLike;
1728
- /** Address of recipient */
1729
- recipient: BytesLike;
1730
- /** Amount of coins */
1731
- amount: BigNumberish;
1732
- /** Index of witness that authorizes the message */
1733
- witnessIndex: number;
1734
- /** Unique nonce of message */
1735
- nonce: BytesLike;
1736
- /** Gas used by predicate */
1737
- predicateGasUsed?: BigNumberish;
1738
- /** Predicate bytecode */
1739
- predicate?: BytesLike;
1740
- /** Predicate input data (parameters) */
1741
- predicateData?: BytesLike;
1742
- /** data of message */
1743
- data?: BytesLike;
1744
- };
1745
- type ContractTransactionRequestInput = {
1746
- type: InputType.Contract;
1747
- /** Points to the TX whose output is being spent. (TxPointer) */
1748
- txPointer: BytesLike;
1749
- /** Contract ID */
1750
- contractId: BytesLike;
1751
- };
1752
- type TransactionRequestInput = CoinTransactionRequestInput | ContractTransactionRequestInput | MessageTransactionRequestInput;
1753
- /** @hidden */
1754
- declare const inputify: (value: TransactionRequestInput) => Input;
1755
-
1756
- type CoinTransactionRequestOutput = {
1757
- type: OutputType.Coin;
1758
- /** Receiving address or script hash */
1759
- to: BytesLike;
1760
- /** Amount of coins to send */
1761
- amount: BigNumberish;
1762
- /** Asset ID of coins */
1763
- assetId: BytesLike;
1764
- };
1765
- type ContractTransactionRequestOutput = {
1766
- type: OutputType.Contract;
1767
- /** Index of input contract */
1768
- inputIndex: number;
1769
- };
1770
- type ChangeTransactionRequestOutput = {
1771
- type: OutputType.Change;
1772
- /** Receiving address or script hash */
1773
- to: BytesLike;
1774
- /** Asset ID of coins */
1775
- assetId: BytesLike;
1776
- };
1777
- type VariableTransactionRequestOutput = {
1778
- type: OutputType.Variable;
1779
- };
1780
- type ContractCreatedTransactionRequestOutput = {
1781
- type: OutputType.ContractCreated;
1782
- /** Contract ID */
1783
- contractId: BytesLike;
1784
- /** State Root */
1785
- stateRoot: BytesLike;
1786
- };
1787
- type TransactionRequestOutput = CoinTransactionRequestOutput | ContractTransactionRequestOutput | ChangeTransactionRequestOutput | VariableTransactionRequestOutput | ContractCreatedTransactionRequestOutput;
1788
- /** @hidden */
1789
- declare const outputify: (value: TransactionRequestOutput) => Output;
1790
-
1791
- type PredicateParams<T = InputValue[]> = {
1792
- bytecode: BytesLike;
1793
- provider: Provider;
1794
- abi?: JsonAbi;
1795
- inputData?: T;
1796
- configurableConstants?: {
1797
- [name: string]: unknown;
1798
- };
1799
- };
1800
- /**
1801
- * `Predicate` provides methods to populate transaction data with predicate information and sending transactions with them.
1802
- */
1803
- declare class Predicate<TInputData extends InputValue[]> extends Account {
1804
- bytes: Uint8Array;
1805
- predicateDataBytes: Uint8Array;
1806
- predicateData: TInputData;
1807
- interface?: Interface;
1808
- /**
1809
- * Creates an instance of the Predicate class.
1810
- *
1811
- * @param bytecode - The bytecode of the predicate.
1812
- * @param abi - The JSON ABI of the predicate.
1813
- * @param provider - The provider used to interact with the blockchain.
1814
- * @param inputData - The predicate input data (optional).
1815
- * @param configurableConstants - Optional configurable constants for the predicate.
1816
- */
1817
- constructor({ bytecode, abi, provider, inputData, configurableConstants, }: PredicateParams<TInputData>);
1818
- /**
1819
- * Populates the transaction data with predicate data.
1820
- *
1821
- * @param transactionRequestLike - The transaction request-like object.
1822
- * @returns The transaction request with predicate data.
1823
- */
1824
- populateTransactionPredicateData(transactionRequestLike: TransactionRequestLike): TransactionRequest;
1825
- /**
1826
- * A helper that creates a transfer transaction request and returns it.
1827
- *
1828
- * @param destination - The address of the destination.
1829
- * @param amount - The amount of coins to transfer.
1830
- * @param assetId - The asset ID of the coins to transfer.
1831
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
1832
- * @returns A promise that resolves to the prepared transaction request.
1833
- */
1834
- createTransfer(
1835
- /** Address of the destination */
1836
- destination: AbstractAddress,
1837
- /** Amount of coins */
1838
- amount: BigNumberish,
1839
- /** Asset ID of coins */
1840
- assetId?: BytesLike,
1841
- /** Tx Params */
1842
- txParams?: TxParamsType): Promise<TransactionRequest>;
1843
- /**
1844
- * Sends a transaction with the populated predicate data.
1845
- *
1846
- * @param transactionRequestLike - The transaction request-like object.
1847
- * @returns A promise that resolves to the transaction response.
1848
- */
1849
- sendTransaction(transactionRequestLike: TransactionRequestLike, options?: Pick<ProviderSendTxParams, 'awaitExecution'>): Promise<TransactionResponse>;
1850
- /**
1851
- * Simulates a transaction with the populated predicate data.
1852
- *
1853
- * @param transactionRequestLike - The transaction request-like object.
1854
- * @returns A promise that resolves to the call result.
1855
- */
1856
- simulateTransaction(transactionRequestLike: TransactionRequestLike): Promise<CallResult>;
1857
- private getPredicateData;
1858
- /**
1859
- * Processes the predicate data and returns the altered bytecode and interface.
1860
- *
1861
- * @param bytes - The bytes of the predicate.
1862
- * @param jsonAbi - The JSON ABI of the predicate.
1863
- * @param configurableConstants - Optional configurable constants for the predicate.
1864
- * @returns An object containing the new predicate bytes and interface.
1865
- */
1866
- private static processPredicateData;
1867
- /**
1868
- * Sets the configurable constants for the predicate.
1869
- *
1870
- * @param bytes - The bytes of the predicate.
1871
- * @param configurableConstants - Configurable constants to be set.
1872
- * @param abiInterface - The ABI interface of the predicate.
1873
- * @returns The mutated bytes with the configurable constants set.
1874
- */
1875
- private static setConfigurableConstants;
1876
- }
1877
-
1878
- type TransactionRequestWitness = BytesLike;
1879
-
1880
- /**
1881
- * @hidden
1882
- *
1883
- * Interface defining a like structure for a base transaction request.
1884
- */
1885
- interface BaseTransactionRequestLike {
1886
- /** Gas price for transaction */
1887
- gasPrice?: BigNumberish;
1888
- /** Block until which tx cannot be included */
1889
- maturity?: number;
1890
- /** The maximum fee payable by this transaction using BASE_ASSET. */
1891
- maxFee?: BigNumberish;
1892
- /** The maximum amount of witness data allowed for the transaction */
1893
- witnessLimit?: BigNumberish;
1894
- /** List of inputs */
1895
- inputs?: TransactionRequestInput[];
1896
- /** List of outputs */
1897
- outputs?: TransactionRequestOutput[];
1898
- /** List of witnesses */
1899
- witnesses?: TransactionRequestWitness[];
1900
- }
1901
- type ToBaseTransactionResponse = Pick<TransactionScript, 'inputs' | 'inputsCount' | 'outputs' | 'outputsCount' | 'witnesses' | 'witnessesCount' | 'policies' | 'policyTypes'>;
1902
- /**
1903
- * Abstract class to define the functionalities of a transaction request transaction request.
1904
- */
1905
- declare abstract class BaseTransactionRequest implements BaseTransactionRequestLike {
1906
- /** Type of the transaction */
1907
- abstract type: TransactionType;
1908
- /** Gas price for transaction */
1909
- gasPrice: BN;
1910
- /** Block until which tx cannot be included */
1911
- maturity: number;
1912
- /** The maximum fee payable by this transaction using BASE_ASSET. */
1913
- maxFee?: BN;
1914
- /** The maximum amount of witness data allowed for the transaction */
1915
- witnessLimit?: BN | undefined;
1916
- /** List of inputs */
1917
- inputs: TransactionRequestInput[];
1918
- /** List of outputs */
1919
- outputs: TransactionRequestOutput[];
1920
- /** List of witnesses */
1921
- witnesses: TransactionRequestWitness[];
1922
- /**
1923
- * Constructor for initializing a base transaction request.
1924
- *
1925
- * @param baseTransactionRequest - Optional object containing properties to initialize the transaction request.
1926
- */
1927
- constructor({ gasPrice, maturity, maxFee, witnessLimit, inputs, outputs, witnesses, }?: BaseTransactionRequestLike);
1928
- static getPolicyMeta(req: BaseTransactionRequest): {
1929
- policyTypes: number;
1930
- policies: Policy[];
1931
- };
1932
- /**
1933
- * Method to obtain the base transaction details.
1934
- *
1935
- * @returns The base transaction details.
1936
- */
1937
- protected getBaseTransaction(): ToBaseTransactionResponse;
1938
- abstract toTransaction(): TransactionCreate | TransactionScript;
1939
- /**
1940
- * Converts the transaction request to a byte array.
1941
- *
1942
- * @returns The transaction bytes.
1943
- */
1944
- toTransactionBytes(): Uint8Array;
1945
- /**
1946
- * @hidden
1947
- *
1948
- * Pushes an input to the list without any side effects and returns the index
1949
- */
1950
- protected pushInput(input: TransactionRequestInput): number;
1951
- /**
1952
- * @hidden
1953
- *
1954
- * Pushes an output to the list without any side effects and returns the index
1955
- */
1956
- protected pushOutput(output: TransactionRequestOutput): number;
1957
- /**
1958
- * @hidden
1959
- *
1960
- * Creates an empty witness without any side effects and returns the index
1961
- */
1962
- protected createWitness(): number;
1963
- /**
1964
- * Updates the witness for a given owner and signature.
1965
- *
1966
- * @param address - The address to get the coin input witness index for.
1967
- * @param signature - The signature to update the witness with.
1968
- */
1969
- updateWitnessByOwner(address: string | AbstractAddress, signature: BytesLike): void;
1970
- /**
1971
- * Updates an existing witness without any side effects.
1972
- *
1973
- * @param index - The index of the witness to update.
1974
- * @param witness - The new witness.
1975
- * @throws If the witness does not exist.
1976
- */
1977
- updateWitness(index: number, witness: TransactionRequestWitness): void;
1978
- /**
1979
- * Gets the coin inputs for a transaction.
1980
- *
1981
- * @returns The coin inputs.
1982
- */
1983
- getCoinInputs(): CoinTransactionRequestInput[];
1984
- /**
1985
- * Gets the coin outputs for a transaction.
1986
- *
1987
- * @returns The coin outputs.
1988
- */
1989
- getCoinOutputs(): CoinTransactionRequestOutput[];
1990
- /**
1991
- * Gets the change outputs for a transaction.
1992
- *
1993
- * @returns The change outputs.
1994
- */
1995
- getChangeOutputs(): ChangeTransactionRequestOutput[];
1996
- /**
1997
- * @hidden
1998
- *
1999
- * Returns the witnessIndex of the found CoinInput.
2000
- */
2001
- getCoinInputWitnessIndexByOwner(owner: AddressLike): number | undefined;
2002
- /**
2003
- * Adds a single coin input to the transaction and a change output for the related
2004
- * assetId, if one it was not added yet.
2005
- *
2006
- * @param coin - Coin resource.
2007
- * @param predicate - Predicate bytes.
2008
- * @param predicateData - Predicate data bytes.
2009
- */
2010
- addCoinInput(coin: Coin, predicate?: Predicate<InputValue[]>): void;
2011
- /**
2012
- * Adds a single message input to the transaction and a change output for the
2013
- * baseAssetId, if one it was not added yet.
2014
- *
2015
- * @param message - Message resource.
2016
- * @param predicate - Predicate bytes.
2017
- * @param predicateData - Predicate data bytes.
2018
- */
2019
- addMessageInput(message: MessageCoin, predicate?: Predicate<InputValue[]>): void;
2020
- /**
2021
- * Adds a single resource to the transaction by adding a coin/message input and a
2022
- * change output for the related assetId, if one it was not added yet.
2023
- *
2024
- * @param resource - The resource to add.
2025
- * @returns This transaction.
2026
- */
2027
- addResource(resource: Resource): this;
2028
- /**
2029
- * Adds multiple resources to the transaction by adding coin/message inputs and change
2030
- * outputs from the related assetIds.
2031
- *
2032
- * @param resources - The resources to add.
2033
- * @returns This transaction.
2034
- */
2035
- addResources(resources: ReadonlyArray<Resource>): this;
2036
- /**
2037
- * Adds multiple resources to the transaction by adding coin/message inputs and change
2038
- * outputs from the related assetIds.
2039
- *
2040
- * @param resources - The resources to add.
2041
- * @returns This transaction.
2042
- */
2043
- addPredicateResource(resource: Resource, predicate: Predicate<InputValue[]>): this;
2044
- /**
2045
- * Adds multiple predicate coin/message inputs to the transaction and change outputs
2046
- * from the related assetIds.
2047
- *
2048
- * @param resources - The resources to add.
2049
- * @returns This transaction.
2050
- */
2051
- addPredicateResources(resources: Resource[], predicate: Predicate<InputValue[]>): this;
2052
- /**
2053
- * Adds a coin output to the transaction.
2054
- *
2055
- * @param to - Address of the owner.
2056
- * @param amount - Amount of coin.
2057
- * @param assetId - Asset ID of coin.
2058
- */
2059
- addCoinOutput(to: AddressLike, amount: BigNumberish, assetId?: BytesLike): this;
2060
- /**
2061
- * Adds multiple coin outputs to the transaction.
2062
- *
2063
- * @param to - Address of the destination.
2064
- * @param quantities - Quantities of coins.
2065
- */
2066
- addCoinOutputs(to: AddressLike, quantities: CoinQuantityLike[]): this;
2067
- /**
2068
- * Adds a change output to the transaction.
2069
- *
2070
- * @param to - Address of the owner.
2071
- * @param assetId - Asset ID of coin.
2072
- */
2073
- addChangeOutput(to: AddressLike, assetId?: BytesLike): void;
2074
- /**
2075
- * @hidden
2076
- */
2077
- byteSize(): number;
2078
- /**
2079
- * @hidden
2080
- */
2081
- metadataGas(_gasCosts: GqlGasCosts): BN;
2082
- /**
2083
- * @hidden
2084
- */
2085
- calculateMinGas(chainInfo: ChainInfo): BN;
2086
- calculateMaxGas(chainInfo: ChainInfo, minGas: BN): BN;
2087
- /**
2088
- * Funds the transaction with fake UTXOs for each assetId and amount in the
2089
- * quantities array.
2090
- *
2091
- * @param quantities - CoinQuantity Array.
2092
- */
2093
- fundWithFakeUtxos(quantities: CoinQuantity[], resourcesOwner?: AbstractAddress): void;
2094
- /**
2095
- * Retrieves an array of CoinQuantity for each coin output present in the transaction.
2096
- * a transaction.
2097
- *
2098
- * @returns CoinQuantity array.
2099
- */
2100
- getCoinOutputsQuantities(): CoinQuantity[];
2101
- /**
2102
- * Gets the Transaction Request by hashing the transaction.
2103
- *
2104
- * @param chainId - The chain ID.
2105
- *
2106
- * @returns - A hash of the transaction, which is the transaction ID.
2107
- */
2108
- abstract getTransactionId(chainId: number): string;
2109
- /**
2110
- * Return the minimum amount in native coins required to create
2111
- * a transaction.
2112
- *
2113
- * @returns The transaction as a JSON object.
2114
- */
2115
- toJSON(): any;
2116
- updatePredicateInputs(inputs: TransactionRequestInput[]): void;
2117
- }
2118
-
2119
- type TransactionRequestStorageSlot = {
2120
- /** Key */
2121
- key: BytesLike;
2122
- /** Value */
2123
- value: BytesLike;
2124
- } | [key: BytesLike, value: BytesLike];
2125
-
2126
- /**
2127
- * @hidden
2128
- */
2129
- interface CreateTransactionRequestLike extends BaseTransactionRequestLike {
2130
- /** Witness index of contract bytecode to create */
2131
- bytecodeWitnessIndex?: number;
2132
- /** Salt */
2133
- salt?: BytesLike;
2134
- /** List of storage slots to initialize */
2135
- storageSlots?: TransactionRequestStorageSlot[];
2136
- }
2137
- /**
2138
- * `CreateTransactionRequest` provides functionalities for creating a transaction request that creates a contract.
2139
- */
2140
- declare class CreateTransactionRequest extends BaseTransactionRequest {
2141
- static from(obj: CreateTransactionRequestLike): CreateTransactionRequest;
2142
- /** Type of the transaction */
2143
- type: TransactionType.Create;
2144
- /** Witness index of contract bytecode to create */
2145
- bytecodeWitnessIndex: number;
2146
- /** Salt */
2147
- salt: string;
2148
- /** List of storage slots to initialize */
2149
- storageSlots: TransactionRequestStorageSlot[];
2150
- /**
2151
- * Creates an instance `CreateTransactionRequest`.
2152
- *
2153
- * @param createTransactionRequestLike - The initial values for the instance
2154
- */
2155
- constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }?: CreateTransactionRequestLike);
2156
- /**
2157
- * Converts the transaction request to a `TransactionCreate`.
2158
- *
2159
- * @returns The transaction create object.
2160
- */
2161
- toTransaction(): TransactionCreate;
2162
- /**
2163
- * Get contract created outputs for the transaction.
2164
- *
2165
- * @returns An array of contract created transaction request outputs.
2166
- */
2167
- getContractCreatedOutputs(): ContractCreatedTransactionRequestOutput[];
2168
- /**
2169
- * Gets the Transaction Request by hashing the transaction.
2170
- *
2171
- * @param chainId - The chain ID.
2172
- *
2173
- * @returns - A hash of the transaction, which is the transaction ID.
2174
- */
2175
- getTransactionId(chainId: number): string;
2176
- /**
2177
- * Adds a contract created output to the transaction request.
2178
- *
2179
- * @param contractId - The contract ID.
2180
- * @param stateRoot - The state root.
2181
- */
2182
- addContractCreatedOutput(
2183
- /** Contract ID */
2184
- contractId: BytesLike,
2185
- /** State Root */
2186
- stateRoot: BytesLike): void;
2187
- metadataGas(gasCosts: GqlGasCosts): BN;
2188
- }
2189
-
2190
- /**
2191
- * @hidden
2192
- */
2193
- interface ScriptTransactionRequestLike extends BaseTransactionRequestLike {
2194
- /** Gas limit for transaction */
2195
- gasLimit?: BigNumberish;
2196
- /** Script to execute */
2197
- script?: BytesLike;
2198
- /** Script input data (parameters) */
2199
- scriptData?: BytesLike;
2200
- }
2201
- /**
2202
- * `ScriptTransactionRequest` provides functionalities for creating a transaction request that uses a script.
2203
- */
2204
- declare class ScriptTransactionRequest extends BaseTransactionRequest {
2205
- static from(obj: ScriptTransactionRequestLike): ScriptTransactionRequest;
2206
- /** Type of the transaction */
2207
- type: TransactionType.Script;
2208
- /** Gas limit for transaction */
2209
- gasLimit: BN;
2210
- /** Script to execute */
2211
- script: Uint8Array;
2212
- /** Script input data (parameters) */
2213
- scriptData: Uint8Array;
2214
- /**
2215
- * Constructor for `ScriptTransactionRequest`.
2216
- *
2217
- * @param scriptTransactionRequestLike - The initial values for the instance.
2218
- */
2219
- constructor({ script, scriptData, gasLimit, ...rest }?: ScriptTransactionRequestLike);
2220
- /**
2221
- * Converts the transaction request to a `TransactionScript`.
2222
- *
2223
- * @returns The transaction script object.
2224
- */
2225
- toTransaction(): TransactionScript;
2226
- /**
2227
- * Get contract inputs for the transaction.
2228
- *
2229
- * @returns An array of contract transaction request inputs.
2230
- */
2231
- getContractInputs(): ContractTransactionRequestInput[];
2232
- /**
2233
- * Get contract outputs for the transaction.
2234
- *
2235
- * @returns An array of contract transaction request outputs.
2236
- */
2237
- getContractOutputs(): ContractTransactionRequestOutput[];
2238
- /**
2239
- * Get variable outputs for the transaction.
2240
- *
2241
- * @returns An array of variable transaction request outputs.
2242
- */
2243
- getVariableOutputs(): VariableTransactionRequestOutput[];
2244
- /**
2245
- * Set the script and its data.
2246
- *
2247
- * @param script - The abstract script request.
2248
- * @param data - The script data.
2249
- */
2250
- setScript<T>(script: AbstractScriptRequest<T>, data: T): void;
2251
- /**
2252
- * Adds variable outputs to the transaction request.
2253
- *
2254
- * @param numberOfVariables - The number of variables to add.
2255
- * @returns The new length of the outputs array.
2256
- */
2257
- addVariableOutputs(numberOfVariables?: number): number;
2258
- calculateMaxGas(chainInfo: ChainInfo, minGas: BN): BN;
2259
- /**
2260
- * Adds a contract input and output to the transaction request.
2261
- *
2262
- * @param contract - The contract ID.
2263
- * @returns The current instance of the `ScriptTransactionRequest`.
2264
- */
2265
- addContractInputAndOutput(contract: ContractIdLike): ScriptTransactionRequest;
2266
- /**
2267
- * Gets the Transaction Request by hashing the transaction.
2268
- *
2269
- * @param chainId - The chain ID.
2270
- *
2271
- * @returns - A hash of the transaction, which is the transaction ID.
2272
- */
2273
- getTransactionId(chainId: number): string;
2274
- /**
2275
- * Sets the data for the transaction request.
2276
- *
2277
- * @param abi - Script JSON ABI.
2278
- * @param args - The input arguments.
2279
- * @returns The current instance of the `ScriptTransactionRequest`.
2280
- */
2281
- setData(abi: JsonAbi, args: InputValue[]): ScriptTransactionRequest;
2282
- metadataGas(gasCosts: GqlGasCosts): BN;
2283
- }
2284
-
2285
- type TransactionRequest = ScriptTransactionRequest | CreateTransactionRequest;
2286
- type TransactionRequestLike = ({
2287
- type: TransactionType.Script;
2288
- } & ScriptTransactionRequestLike) | ({
2289
- type: TransactionType.Create;
2290
- } & CreateTransactionRequestLike);
2291
-
2292
- type GqlTransaction = NonNullable<GqlGetTransactionQuery['transaction']>;
2293
- type GraphqlTransactionStatus = GqlTransaction['status'];
2294
- type SuccessStatus = Extract<GraphqlTransactionStatus, {
2295
- __typename: 'SuccessStatus';
2296
- }>;
2297
- type FailureStatus = Extract<GraphqlTransactionStatus, {
2298
- __typename: 'FailureStatus';
2299
- }>;
2300
- type SubmittedStatus = Extract<GraphqlTransactionStatus, {
2301
- __typename: 'SubmittedStatus';
2302
- }>;
2303
- type SqueezedOutStatus = Extract<GraphqlTransactionStatus, {
2304
- __typename: 'SqueezedOutStatus';
2305
- }>;
2306
- type Reason = FailureStatus['reason'];
2307
- type ProgramState = SuccessStatus['programState'];
2308
- type Time = SubmittedStatus['time'] | SuccessStatus['time'] | FailureStatus['time'];
2309
- type BlockId = SuccessStatus['block']['id'] | FailureStatus['block']['id'];
2310
- /**
2311
- * @hidden
2312
- */
2313
- declare enum TransactionTypeName {
2314
- Create = "Create",
2315
- Mint = "Mint",
2316
- Script = "Script"
2317
- }
2318
- /**
2319
- * @hidden
2320
- */
2321
- declare enum TransactionStatus {
2322
- submitted = "submitted",
2323
- success = "success",
2324
- squeezedout = "squeezedout",
2325
- failure = "failure"
2326
- }
2327
- /**
2328
- * @hidden
2329
- */
2330
- type GqlTransactionStatusesNames = 'FailureStatus' | 'SubmittedStatus' | 'SuccessStatus' | 'SqueezedOutStatus';
2331
- /**
2332
- * @hidden
2333
- */
2334
- declare enum OperationName {
2335
- payBlockProducer = "Pay network fee to block producer",
2336
- contractCreated = "Contract created",
2337
- transfer = "Transfer asset",
2338
- contractCall = "Contract call",
2339
- receive = "Receive asset",
2340
- mint = "Mint asset",
2341
- predicatecall = "Predicate call",
2342
- script = "Script",
2343
- sent = "Sent asset",
2344
- withdrawFromFuel = "Withdraw from Fuel"
2345
- }
2346
- type OperationCoin = {
2347
- assetId: string;
2348
- amount: BNInput;
2349
- };
2350
- type OperationFunctionCall = {
2351
- functionSignature: string;
2352
- functionName: string;
2353
- argumentsProvided?: Record<string, unknown>;
2354
- } & Partial<OperationCoin>;
2355
- type Operation = {
2356
- name?: OperationName;
2357
- from?: OperationTransactionAddress;
2358
- to?: OperationTransactionAddress;
2359
- assetsSent?: Array<OperationCoin>;
2360
- calls?: Array<OperationFunctionCall>;
2361
- };
2362
- /**
2363
- * @hidden
2364
- */
2365
- declare enum AddressType {
2366
- contract = 0,
2367
- account = 1
2368
- }
2369
- /**
2370
- * @hidden
2371
- */
2372
- declare enum ChainName {
2373
- ethereum = "ethereum",
2374
- fuel = "fuel"
2375
- }
2376
- type OperationTransactionAddress = {
2377
- address: string;
2378
- type: AddressType;
2379
- chain?: ChainName;
2380
- };
2381
- type InputParam = {
2382
- inputs: Input[];
2383
- };
2384
- type OutputParam = {
2385
- outputs: Output[];
2386
- };
2387
- type ReceiptParam = {
2388
- receipts: TransactionResultReceipt[];
2389
- };
2390
- type AbiMap = Record<string, JsonAbi>;
2391
- type RawPayloadParam = {
2392
- rawPayload?: string;
2393
- };
2394
- type InputOutputParam = InputParam & OutputParam;
2395
- interface GetTransferOperationsParams extends InputOutputParam {
2396
- receipts: TransactionResultReceipt[];
2397
- }
2398
- type GetOperationParams = {
2399
- transactionType: TransactionType;
2400
- abiMap?: AbiMap;
2401
- maxInputs: BN;
2402
- } & InputOutputParam & ReceiptParam & RawPayloadParam;
2403
- interface MintedAsset {
2404
- subId: B256Address;
2405
- contractId: B256Address;
2406
- assetId: B256Address;
2407
- amount: BN;
2408
- }
2409
- type BurnedAsset = MintedAsset;
2410
- type TransactionSummary<TTransactionType = void> = {
2411
- id?: string;
2412
- time?: string;
2413
- operations: Operation[];
2414
- gasUsed: BN;
2415
- fee: BN;
2416
- type: TransactionTypeName;
2417
- blockId?: BlockId;
2418
- status?: TransactionStatus;
2419
- isTypeMint: boolean;
2420
- isTypeCreate: boolean;
2421
- isTypeScript: boolean;
2422
- isStatusPending: boolean;
2423
- isStatusSuccess: boolean;
2424
- isStatusFailure: boolean;
2425
- mintedAssets: MintedAsset[];
2426
- burnedAssets: BurnedAsset[];
2427
- date?: Date;
2428
- receipts: TransactionResultReceipt[];
2429
- transaction: Transaction<TTransactionType>;
2430
- };
2431
-
2432
- /** @hidden */
2433
- type TransactionResultCallReceipt = ReceiptCall;
2434
- /** @hidden */
2435
- type TransactionResultReturnReceipt = ReceiptReturn;
2436
- /** @hidden */
2437
- type TransactionResultReturnDataReceipt = ReceiptReturnData & {
2438
- data: string;
2439
- };
2440
- /** @hidden */
2441
- type TransactionResultPanicReceipt = ReceiptPanic;
2442
- /** @hidden */
2443
- type TransactionResultRevertReceipt = ReceiptRevert;
2444
- /** @hidden */
2445
- type TransactionResultLogReceipt = ReceiptLog;
2446
- /** @hidden */
2447
- type TransactionResultLogDataReceipt = ReceiptLogData & {
2448
- data: string;
2449
- };
2450
- /** @hidden */
2451
- type TransactionResultTransferReceipt = ReceiptTransfer;
2452
- /** @hidden */
2453
- type TransactionResultTransferOutReceipt = ReceiptTransferOut;
2454
- /** @hidden */
2455
- type TransactionResultScriptResultReceipt = ReceiptScriptResult;
2456
- /** @hidden */
2457
- type TransactionResultMessageOutReceipt = ReceiptMessageOut;
2458
- type TransactionResultMintReceipt = ReceiptMint;
2459
- type TransactionResultBurnReceipt = ReceiptBurn;
2460
- /** @hidden */
2461
- type TransactionResultReceipt = ReceiptCall | ReceiptReturn | (ReceiptReturnData & {
2462
- data: string;
2463
- }) | ReceiptPanic | ReceiptRevert | ReceiptLog | (ReceiptLogData & {
2464
- data: string;
2465
- }) | ReceiptTransfer | ReceiptTransferOut | ReceiptScriptResult | ReceiptMessageOut | TransactionResultMintReceipt | TransactionResultBurnReceipt;
2466
- /** @hidden */
2467
- type TransactionResult<TTransactionType = void> = TransactionSummary<TTransactionType> & {
2468
- gqlTransaction: GqlTransaction;
2469
- };
2470
- /**
2471
- * Represents a response for a transaction.
2472
- */
2473
- declare class TransactionResponse {
2474
- /** Transaction ID */
2475
- id: string;
2476
- /** Current provider */
2477
- provider: Provider;
2478
- /** Gas used on the transaction */
2479
- gasUsed: BN;
2480
- /** The graphql Transaction with receipts object. */
2481
- gqlTransaction?: GqlTransaction;
2482
- /**
2483
- * Constructor for `TransactionResponse`.
2484
- *
2485
- * @param id - The transaction ID.
2486
- * @param provider - The provider.
2487
- */
2488
- constructor(id: string, provider: Provider);
2489
- /**
2490
- * Async constructor for `TransactionResponse`. This method can be used to create
2491
- * an instance of `TransactionResponse` and wait for the transaction to be fetched
2492
- * from the chain, ensuring that the `gqlTransaction` property is set.
2493
- *
2494
- * @param id - The transaction ID.
2495
- * @param provider - The provider.
2496
- */
2497
- static create(id: string, provider: Provider): Promise<TransactionResponse>;
2498
- /**
2499
- * Fetch the transaction with receipts from the provider.
2500
- *
2501
- * @returns Transaction with receipts query result.
2502
- */
2503
- fetch(): Promise<GqlTransaction>;
2504
- /**
2505
- * Decode the raw payload of the transaction.
2506
- *
2507
- * @param transactionWithReceipts - The transaction with receipts object.
2508
- * @returns The decoded transaction.
2509
- */
2510
- decodeTransaction<TTransactionType = void>(transactionWithReceipts: GqlTransaction): Transaction<TTransactionType>;
2511
- /**
2512
- * Retrieves the TransactionSummary. If the `gqlTransaction` is not set, it will
2513
- * fetch it from the provider
2514
- *
2515
- * @param contractsAbiMap - The contracts ABI map.
2516
- * @returns
2517
- */
2518
- getTransactionSummary<TTransactionType = void>(contractsAbiMap?: AbiMap): Promise<TransactionSummary<TTransactionType>>;
2519
- private waitForStatusChange;
2520
- /**
2521
- * Waits for transaction to complete and returns the result.
2522
- *
2523
- * @returns The completed transaction result
2524
- */
2525
- waitForResult<TTransactionType = void>(contractsAbiMap?: AbiMap): Promise<TransactionResult<TTransactionType>>;
2526
- /**
2527
- * Waits for transaction to complete and returns the result.
2528
- *
2529
- * @param contractsAbiMap - The contracts ABI map.
2530
- */
2531
- wait<TTransactionType = void>(contractsAbiMap?: AbiMap): Promise<TransactionResult<TTransactionType>>;
2532
- }
2533
-
2534
- type Backoff = 'linear' | 'exponential' | 'fixed';
2535
- /**
2536
- * Retry options scheme
2537
- */
2538
- type RetryOptions = {
2539
- /**
2540
- * Amount of attempts to retry before failing the call.
2541
- */
2542
- maxRetries: number;
2543
- /**
2544
- * Backoff strategy to use when retrying. Default is exponential.
2545
- */
2546
- backoff?: Backoff;
2547
- /**
2548
- * Starting delay for backoff strategy. Default is 150ms.
2549
- */
2550
- baseDelay?: number;
2551
- };
2552
-
2553
- type CallResult = {
2554
- receipts: TransactionResultReceipt[];
2555
- };
2556
- type EstimateTxDependenciesReturns = CallResult & {
2557
- outputVariables: number;
2558
- missingContractIds: string[];
2559
- };
2560
- /**
2561
- * A Fuel block
2562
- */
2563
- type Block = {
2564
- id: string;
2565
- height: BN;
2566
- time: string;
2567
- transactionIds: string[];
2568
- };
2569
- /**
2570
- * Deployed Contract bytecode and contract id
2571
- */
2572
- type ContractResult = {
2573
- id: string;
2574
- bytecode: string;
2575
- };
2576
- type ConsensusParameters = {
2577
- contractMaxSize: BN;
2578
- maxInputs: BN;
2579
- maxOutputs: BN;
2580
- maxWitnesses: BN;
2581
- maxGasPerTx: BN;
2582
- maxScriptLength: BN;
2583
- maxScriptDataLength: BN;
2584
- maxStorageSlots: BN;
2585
- maxPredicateLength: BN;
2586
- maxPredicateDataLength: BN;
2587
- maxGasPerPredicate: BN;
2588
- gasPriceFactor: BN;
2589
- gasPerByte: BN;
2590
- maxMessageDataLength: BN;
2591
- chainId: BN;
2592
- gasCosts: GqlGasCosts;
2593
- };
2594
- /**
2595
- * Chain information
2596
- */
2597
- type ChainInfo = {
2598
- name: string;
2599
- baseChainHeight: BN;
2600
- consensusParameters: ConsensusParameters;
2601
- gasCosts: GqlGasCosts;
2602
- latestBlock: {
2603
- id: string;
2604
- height: BN;
2605
- time: string;
2606
- transactions: Array<{
2607
- id: string;
2608
- }>;
2609
- };
2610
- };
2611
- /**
2612
- * Node information
2613
- */
2614
- type NodeInfo = {
2615
- utxoValidation: boolean;
2616
- vmBacktrace: boolean;
2617
- minGasPrice: BN;
2618
- maxTx: BN;
2619
- maxDepth: BN;
2620
- nodeVersion: string;
2621
- peers: GqlPeerInfo[];
2622
- };
2623
- type NodeInfoAndConsensusParameters = {
2624
- minGasPrice: BN;
2625
- nodeVersion: string;
2626
- gasPerByte: BN;
2627
- gasPriceFactor: BN;
2628
- maxGasPerTx: BN;
2629
- };
2630
- type TransactionCost = {
2631
- requiredQuantities: CoinQuantity[];
2632
- receipts: TransactionResultReceipt[];
2633
- minGasPrice: BN;
2634
- gasPrice: BN;
2635
- minGas: BN;
2636
- maxGas: BN;
2637
- gasUsed: BN;
2638
- minFee: BN;
2639
- maxFee: BN;
2640
- usedFee: BN;
2641
- outputVariables: number;
2642
- missingContractIds: string[];
2643
- estimatedInputs: TransactionRequest['inputs'];
2644
- };
2645
- /**
2646
- * @hidden
2647
- *
2648
- * Cursor pagination arguments
2649
- *
2650
- * https://relay.dev/graphql/connections.htm#sec-Arguments
2651
- */
2652
- type CursorPaginationArgs = {
2653
- /** Forward pagination limit */
2654
- first?: number | null;
2655
- /** Forward pagination cursor */
2656
- after?: string | null;
2657
- /** Backward pagination limit */
2658
- last?: number | null;
2659
- /** Backward pagination cursor */
2660
- before?: string | null;
2661
- };
2662
- type ProviderOptions = {
2663
- /**
2664
- * Custom fetch function to use for making requests.
2665
- */
2666
- fetch?: (url: string, requestInit?: RequestInit, providerOptions?: Omit<ProviderOptions, 'fetch'>) => Promise<Response>;
2667
- /**
2668
- * Timeout [ms] after which every request will be aborted.
2669
- */
2670
- timeout?: number;
2671
- /**
2672
- * Cache UTXOs for the given time [ms].
2673
- */
2674
- cacheUtxo?: number;
2675
- /**
2676
- * Retry options to use when fetching data from the node.
2677
- */
2678
- retryOptions?: RetryOptions;
2679
- /**
2680
- * Middleware to modify the request before it is sent.
2681
- * This can be used to add headers, modify the body, etc.
2682
- */
2683
- requestMiddleware?: (request: RequestInit) => RequestInit | Promise<RequestInit>;
2684
- };
2685
- /**
2686
- * UTXO Validation Param
2687
- */
2688
- type UTXOValidationParams = {
2689
- utxoValidation?: boolean;
2690
- };
2691
- /**
2692
- * Transaction estimation Param
2693
- */
2694
- type EstimateTransactionParams = {
2695
- estimateTxDependencies?: boolean;
2696
- };
2697
- type EstimatePredicateParams = {
2698
- estimatePredicates?: boolean;
2699
- };
2700
- type TransactionCostParams = EstimateTransactionParams & EstimatePredicateParams & {
2701
- resourcesOwner?: AbstractAccount;
2702
- };
2703
- /**
2704
- * Provider Call transaction params
2705
- */
2706
- type ProviderCallParams = UTXOValidationParams & EstimateTransactionParams;
2707
- /**
2708
- * Provider Send transaction params
2709
- */
2710
- type ProviderSendTxParams = EstimateTransactionParams & {
2711
- /**
2712
- * By default, the promise will resolve immediately after the transaction is submitted.
2713
- *
2714
- * If set to true, the promise will resolve only when the transaction changes status
2715
- * from `SubmittedStatus` to one of `SuccessStatus`, `FailureStatus` or `SqueezedOutStatus`.
2716
- *
2717
- */
2718
- awaitExecution?: boolean;
2719
- };
2720
- /**
2721
- * A provider for connecting to a node
2722
- */
2723
- declare class Provider {
2724
- #private;
2725
- /** GraphQL endpoint of the Fuel node */
2726
- url: string;
2727
- operations: ReturnType<typeof getSdk>;
2728
- cache?: MemoryCache;
2729
- static clearChainAndNodeCaches(): void;
2730
- private static chainInfoCache;
2731
- private static nodeInfoCache;
2732
- options: ProviderOptions;
2733
- private static getFetchFn;
2734
- /**
2735
- * Constructor to initialize a Provider.
2736
- *
2737
- * @param url - GraphQL endpoint of the Fuel node
2738
- * @param chainInfo - Chain info of the Fuel node
2739
- * @param options - Additional options for the provider
2740
- * @hidden
2741
- */
2742
- protected constructor(
2743
- /** GraphQL endpoint of the Fuel node */
2744
- url: string, options?: ProviderOptions);
2745
- /**
2746
- * Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
2747
- * @param url - GraphQL endpoint of the Fuel node
2748
- * @param options - Additional options for the provider
2749
- */
2750
- static create(url: string, options?: ProviderOptions): Promise<Provider>;
2751
- /**
2752
- * Returns the cached chainInfo for the current URL.
2753
- */
2754
- getChain(): ChainInfo;
2755
- /**
2756
- * Returns the cached nodeInfo for the current URL.
2757
- */
2758
- getNode(): NodeInfo;
2759
- /**
2760
- * Returns some helpful parameters related to gas fees.
2761
- */
2762
- getGasConfig(): {
2763
- minGasPrice: BN;
2764
- maxGasPerTx: BN;
2765
- maxGasPerPredicate: BN;
2766
- gasPriceFactor: BN;
2767
- gasPerByte: BN;
2768
- gasCosts: GqlGasCosts;
2769
- };
2770
- /**
2771
- * Updates the URL for the provider and fetches the consensus parameters for the new URL, if needed.
2772
- */
2773
- connect(url: string, options?: ProviderOptions): Promise<void>;
2774
- /**
2775
- * Fetches both the chain and node information, saves it to the cache, and return it.
2776
- *
2777
- * @returns NodeInfo and Chain
2778
- */
2779
- fetchChainAndNodeInfo(): Promise<{
2780
- chain: ChainInfo;
2781
- nodeInfo: NodeInfo;
2782
- }>;
2783
- private static ensureClientVersionIsSupported;
2784
- /**
2785
- * Create GraphQL client and set operations.
2786
- *
2787
- * @returns The operation SDK object
2788
- */
2789
- private createOperations;
2790
- /**
2791
- * Returns the version of the connected node.
2792
- *
2793
- * @returns A promise that resolves to the version string.
2794
- */
2795
- getVersion(): Promise<string>;
2796
- /**
2797
- * @hidden
2798
- *
2799
- * Returns the network configuration of the connected Fuel node.
2800
- *
2801
- * @returns A promise that resolves to the network configuration object
2802
- */
2803
- getNetwork(): Promise<Network$1>;
2804
- /**
2805
- * Returns the block number.
2806
- *
2807
- * @returns A promise that resolves to the block number
2808
- */
2809
- getBlockNumber(): Promise<BN>;
2810
- /**
2811
- * Returns the chain information.
2812
- * @param url - The URL of the Fuel node
2813
- * @returns NodeInfo object
2814
- */
2815
- fetchNode(): Promise<NodeInfo>;
2816
- /**
2817
- * Fetches the `chainInfo` for the given node URL.
2818
- * @param url - The URL of the Fuel node
2819
- * @returns ChainInfo object
2820
- */
2821
- fetchChain(): Promise<ChainInfo>;
2822
- /**
2823
- * Returns the chain ID
2824
- * @returns A promise that resolves to the chain ID number
2825
- */
2826
- getChainId(): number;
2827
- /**
2828
- * Submits a transaction to the chain to be executed.
2829
- *
2830
- * If the transaction is missing any dependencies,
2831
- * the transaction will be mutated and those dependencies will be added.
2832
- *
2833
- * @param transactionRequestLike - The transaction request object.
2834
- * @returns A promise that resolves to the transaction response object.
2835
- */
2836
- sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
2837
- /**
2838
- * Executes a transaction without actually submitting it to the chain.
2839
- *
2840
- * If the transaction is missing any dependencies,
2841
- * the transaction will be mutated and those dependencies will be added.
2842
- *
2843
- * @param transactionRequestLike - The transaction request object.
2844
- * @param utxoValidation - Additional provider call parameters.
2845
- * @returns A promise that resolves to the call result object.
2846
- */
2847
- call(transactionRequestLike: TransactionRequestLike, { utxoValidation, estimateTxDependencies }?: ProviderCallParams): Promise<CallResult>;
2848
- /**
2849
- * Verifies whether enough gas is available to complete transaction.
2850
- *
2851
- * @param transactionRequest - The transaction request object.
2852
- * @returns A promise that resolves to the estimated transaction request object.
2853
- */
2854
- estimatePredicates(transactionRequest: TransactionRequest): Promise<TransactionRequest>;
2855
- /**
2856
- * Will dryRun a transaction and check for missing dependencies.
2857
- *
2858
- * If there are missing variable outputs,
2859
- * `addVariableOutputs` is called on the transaction.
2860
- *
2861
- * @privateRemarks
2862
- * TODO: Investigate support for missing contract IDs
2863
- * TODO: Add support for missing output messages
2864
- *
2865
- * @param transactionRequest - The transaction request object.
2866
- * @returns A promise.
2867
- */
2868
- estimateTxDependencies(transactionRequest: TransactionRequest): Promise<EstimateTxDependenciesReturns>;
2869
- /**
2870
- * Executes a signed transaction without applying the states changes
2871
- * on the chain.
2872
- *
2873
- * If the transaction is missing any dependencies,
2874
- * the transaction will be mutated and those dependencies will be added
2875
- *
2876
- * @param transactionRequestLike - The transaction request object.
2877
- * @returns A promise that resolves to the call result object.
2878
- */
2879
- simulate(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
2880
- /**
2881
- * Returns a transaction cost to enable user
2882
- * to set gasLimit and also reserve balance amounts
2883
- * on the the transaction.
2884
- *
2885
- * @privateRemarks
2886
- * The tolerance is add on top of the gasUsed calculated
2887
- * from the node, this create a safe margin costs like
2888
- * change states on transfer that don't occur on the dryRun
2889
- * transaction. The default value is 0.2 or 20%
2890
- *
2891
- * @param transactionRequestLike - The transaction request object.
2892
- * @param tolerance - The tolerance to add on top of the gasUsed.
2893
- * @returns A promise that resolves to the transaction cost object.
2894
- */
2895
- getTransactionCost(transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[], { estimateTxDependencies, estimatePredicates, resourcesOwner, }?: TransactionCostParams): Promise<TransactionCost>;
2896
- getResourcesForTransaction(owner: string | AbstractAddress, transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[]): Promise<{
2897
- receipts: TransactionResultReceipt[];
2898
- minGasPrice: BN;
2899
- gasPrice: BN;
2900
- minGas: BN;
2901
- maxGas: BN;
2902
- gasUsed: BN;
2903
- minFee: BN;
2904
- maxFee: BN;
2905
- usedFee: BN;
2906
- outputVariables: number;
2907
- missingContractIds: string[];
2908
- estimatedInputs: TransactionRequestInput[];
2909
- resources: Resource[];
2910
- requiredQuantities: CoinQuantity[];
2911
- }>;
2912
- /**
2913
- * Returns coins for the given owner.
2914
- */
2915
- getCoins(
2916
- /** The address to get coins for */
2917
- owner: string | AbstractAddress,
2918
- /** The asset ID of coins to get */
2919
- assetId?: BytesLike,
2920
- /** Pagination arguments */
2921
- paginationArgs?: CursorPaginationArgs): Promise<Coin[]>;
2922
- /**
2923
- * Returns resources for the given owner satisfying the spend query.
2924
- *
2925
- * @param owner - The address to get resources for.
2926
- * @param quantities - The quantities to get.
2927
- * @param excludedIds - IDs of excluded resources from the selection.
2928
- * @returns A promise that resolves to the resources.
2929
- */
2930
- getResourcesToSpend(
2931
- /** The address to get coins for */
2932
- owner: string | AbstractAddress,
2933
- /** The quantities to get */
2934
- quantities: CoinQuantityLike[],
2935
- /** IDs of excluded resources from the selection. */
2936
- excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
2937
- /**
2938
- * Returns block matching the given ID or height.
2939
- *
2940
- * @param idOrHeight - ID or height of the block.
2941
- * @returns A promise that resolves to the block.
2942
- */
2943
- getBlock(
2944
- /** ID or height of the block */
2945
- idOrHeight: string | number | 'latest'): Promise<Block | null>;
2946
- /**
2947
- * Returns all the blocks matching the given parameters.
2948
- *
2949
- * @param params - The parameters to query blocks.
2950
- * @returns A promise that resolves to the blocks.
2951
- */
2952
- getBlocks(params: GqlGetBlocksQueryVariables): Promise<Block[]>;
2953
- /**
2954
- * Returns block matching the given ID or type, including transaction data.
2955
- *
2956
- * @param idOrHeight - ID or height of the block.
2957
- * @returns A promise that resolves to the block.
2958
- */
2959
- getBlockWithTransactions(
2960
- /** ID or height of the block */
2961
- idOrHeight: string | number | 'latest'): Promise<(Block & {
2962
- transactions: Transaction[];
2963
- }) | null>;
2964
- /**
2965
- * Get transaction with the given ID.
2966
- *
2967
- * @param transactionId - ID of the transaction.
2968
- * @returns A promise that resolves to the transaction.
2969
- */
2970
- getTransaction<TTransactionType = void>(transactionId: string): Promise<Transaction<TTransactionType> | null>;
2971
- /**
2972
- * Get deployed contract with the given ID.
2973
- *
2974
- * @param contractId - ID of the contract.
2975
- * @returns A promise that resolves to the contract.
2976
- */
2977
- getContract(contractId: string): Promise<ContractResult | null>;
2978
- /**
2979
- * Returns the balance for the given contract for the given asset ID.
2980
- *
2981
- * @param contractId - The contract ID to get the balance for.
2982
- * @param assetId - The asset ID of coins to get.
2983
- * @returns A promise that resolves to the balance.
2984
- */
2985
- getContractBalance(
2986
- /** The contract ID to get the balance for */
2987
- contractId: string | AbstractAddress,
2988
- /** The asset ID of coins to get */
2989
- assetId: BytesLike): Promise<BN>;
2990
- /**
2991
- * Returns the balance for the given owner for the given asset ID.
2992
- *
2993
- * @param owner - The address to get coins for.
2994
- * @param assetId - The asset ID of coins to get.
2995
- * @returns A promise that resolves to the balance.
2996
- */
2997
- getBalance(
2998
- /** The address to get coins for */
2999
- owner: string | AbstractAddress,
3000
- /** The asset ID of coins to get */
3001
- assetId: BytesLike): Promise<BN>;
3002
- /**
3003
- * Returns balances for the given owner.
3004
- *
3005
- * @param owner - The address to get coins for.
3006
- * @param paginationArgs - Pagination arguments.
3007
- * @returns A promise that resolves to the balances.
3008
- */
3009
- getBalances(
3010
- /** The address to get coins for */
3011
- owner: string | AbstractAddress,
3012
- /** Pagination arguments */
3013
- paginationArgs?: CursorPaginationArgs): Promise<CoinQuantity[]>;
3014
- /**
3015
- * Returns message for the given address.
3016
- *
3017
- * @param address - The address to get message from.
3018
- * @param paginationArgs - Pagination arguments.
3019
- * @returns A promise that resolves to the messages.
3020
- */
3021
- getMessages(
3022
- /** The address to get message from */
3023
- address: string | AbstractAddress,
3024
- /** Pagination arguments */
3025
- paginationArgs?: CursorPaginationArgs): Promise<Message[]>;
3026
- /**
3027
- * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
3028
- *
3029
- * @param transactionId - The transaction to get message from.
3030
- * @param messageId - The message id from MessageOut receipt.
3031
- * @param commitBlockId - The commit block id.
3032
- * @param commitBlockHeight - The commit block height.
3033
- * @returns A promise that resolves to the message proof.
3034
- */
3035
- getMessageProof(
3036
- /** The transaction to get message from */
3037
- transactionId: string, nonce: string, commitBlockId?: string, commitBlockHeight?: BN): Promise<MessageProof | null>;
3038
- /**
3039
- * Returns Message Proof for given transaction id and the message id from MessageOut receipt.
3040
- *
3041
- * @param nonce - The nonce of the message to get status from.
3042
- * @returns A promise that resolves to the message status
3043
- */
3044
- getMessageStatus(
3045
- /** The nonce of the message to get status from */
3046
- nonce: string): Promise<MessageStatus>;
3047
- /**
3048
- * Lets you produce blocks with custom timestamps and the block number of the last block produced.
3049
- *
3050
- * @param amount - The amount of blocks to produce
3051
- * @param startTime - The UNIX timestamp (milliseconds) to set for the first produced block
3052
- * @returns A promise that resolves to the block number of the last produced block.
3053
- */
3054
- produceBlocks(amount: number, startTime?: number): Promise<BN>;
3055
- getTransactionResponse(transactionId: string): Promise<TransactionResponse>;
3056
- }
3057
-
3058
- type NetworkEthereum = {
3059
- /** type of network */
3060
- type: 'ethereum';
3061
- /** chain id of the network */
3062
- chainId: number;
3063
- /** number of decimals of the asset */
3064
- decimals: number;
3065
- /** address of the asset contract */
3066
- address?: string;
3067
- };
3068
- type NetworkFuel = {
3069
- /** type of network */
3070
- type: 'fuel';
3071
- /** chain id of the network */
3072
- chainId: number;
3073
- /** number of decimals of the asset */
3074
- decimals: number;
3075
- /** assetId on the Fuel Network */
3076
- assetId: string;
3077
- /** the contractId of that generated the Asset on the Fuel Network */
3078
- contractId?: string;
3079
- };
3080
- type Asset = {
3081
- /** name of the asset */
3082
- name: string;
3083
- /** description of the asset */
3084
- symbol: string;
3085
- /** icon of the asset */
3086
- icon: string;
3087
- /** asset id on Fuel Network */
3088
- networks: Array<NetworkEthereum | NetworkFuel>;
3089
- };
3090
- type Assets = Array<Asset>;
3091
- type AssetEth = Omit<Asset, 'networks'> & NetworkEthereum;
3092
- type AssetFuel = Omit<Asset, 'networks'> & NetworkFuel;
3093
-
3094
- declare class Signer {
3095
- readonly address: Address;
3096
- readonly publicKey: string;
3097
- readonly compressedPublicKey: string;
3098
- readonly privateKey: string;
3099
- /**
3100
- * Create a Signer instance from a given private key
3101
- *
3102
- * @param privateKey - The private key to use for signing
3103
- * @returns A new Signer instance
3104
- */
3105
- constructor(privateKey: BytesLike);
3106
- /**
3107
- * Sign data using the Signer instance
3108
- *
3109
- * Signature is a 64 byte array of the concatenated r and s values with the compressed recoveryParam byte.
3110
- * @ignore
3111
- * [Read more](FuelLabs/fuel-specs/specs/protocol/cryptographic_primitives.md#public-key-cryptography)
3112
- *
3113
- * @param data - The data to be sign
3114
- * @returns hashed signature
3115
- */
3116
- sign(data: BytesLike): string;
3117
- /**
3118
- * Add point on the current elliptic curve
3119
- *
3120
- * @param point - Point to add on the curve
3121
- * @returns compressed point on the curve
3122
- */
3123
- addPoint(point: BytesLike): string;
3124
- /**
3125
- * Recover the public key from a signature performed with [`sign`](#sign).
3126
- *
3127
- * @param data - Data
3128
- * @param signature - hashed signature
3129
- * @returns public key from signature from the
3130
- */
3131
- static recoverPublicKey(data: BytesLike, signature: BytesLike): string;
3132
- /**
3133
- * Recover the address from a signature performed with [`sign`](#sign).
3134
- *
3135
- * @param data - Data
3136
- * @param signature - Signature
3137
- * @returns Address from signature
3138
- */
3139
- static recoverAddress(data: BytesLike, signature: BytesLike): Address;
3140
- /**
3141
- * Generate a random privateKey
3142
- *
3143
- * @param entropy - Adds extra entropy to generate the privateKey
3144
- * @returns random 32-byte hashed
3145
- */
3146
- static generatePrivateKey(entropy?: BytesLike): string | Uint8Array;
3147
- /**
3148
- * Extended publicKey from a compact publicKey
3149
- *
3150
- * @param publicKey - Compact publicKey
3151
- * @returns extended publicKey
3152
- */
3153
- static extendPublicKey(publicKey: BytesLike): string;
3154
- }
3155
-
3156
- /**
3157
- * `BaseWalletUnlocked` provides the base functionalities for an unlocked wallet.
3158
- */
3159
- declare class BaseWalletUnlocked extends Account {
3160
- /**
3161
- * Default HDWallet path.
3162
- */
3163
- static defaultPath: string;
3164
- /**
3165
- * A function that returns the wallet's signer.
3166
- */
3167
- signer: () => Signer;
3168
- /**
3169
- * Creates a new BaseWalletUnlocked instance.
3170
- *
3171
- * @param privateKey - The private key of the wallet.
3172
- * @param provider - A Provider instance (optional).
3173
- */
3174
- constructor(privateKey: BytesLike, provider?: Provider);
3175
- /**
3176
- * Gets the private key of the wallet.
3177
- *
3178
- * @returns The private key of the wallet.
3179
- */
3180
- get privateKey(): string;
3181
- /**
3182
- * Gets the public key of the wallet.
3183
- *
3184
- * @returns
3185
- */
3186
- get publicKey(): string;
3187
- /**
3188
- * Signs a message with the wallet's private key.
3189
- *
3190
- * @param message - The message to sign.
3191
- * @returns A promise that resolves to the signature as a ECDSA 64 bytes string.
3192
- */
3193
- signMessage(message: string): Promise<string>;
3194
- /**
3195
- * Signs a transaction with the wallet's private key.
3196
- *
3197
- * @param transactionRequestLike - The transaction request to sign.
3198
- * @returns A promise that resolves to the signature as a ECDSA 64 bytes string.
3199
- */
3200
- signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string>;
3201
- /**
3202
- * Populates a transaction with the witnesses signature.
3203
- *
3204
- * @param transactionRequestLike - The transaction request to populate.
3205
- * @returns The populated transaction request.
3206
- */
3207
- populateTransactionWitnessesSignature(transactionRequestLike: TransactionRequestLike): Promise<TransactionRequest>;
3208
- /**
3209
- * Populates the witness signature for a transaction and sends it to the network using `provider.sendTransaction`.
3210
- *
3211
- * @param transactionRequestLike - The transaction request to send.
3212
- * @returns A promise that resolves to the TransactionResponse object.
3213
- */
3214
- sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
3215
- /**
3216
- * Populates the witness signature for a transaction and sends a call to the network using `provider.call`.
3217
- *
3218
- * @param transactionRequestLike - The transaction request to simulate.
3219
- * @returns A promise that resolves to the CallResult object.
3220
- */
3221
- simulateTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
3222
- encrypt(password: string): Promise<string>;
3223
- }
3224
-
3225
- interface GenerateOptions {
3226
- /** Additional entropy for the random bytes */
3227
- entropy?: BytesLike;
3228
- provider?: Provider;
3229
- }
3230
- /**
3231
- * `WalletLocked` provides the functionalities for a locked wallet.
3232
- */
3233
- declare class WalletLocked extends Account {
3234
- /**
3235
- * Unlocks the wallet using the provided private key and returns an instance of WalletUnlocked.
3236
- *
3237
- * @param privateKey - The private key used to unlock the wallet.
3238
- * @returns An instance of WalletUnlocked.
3239
- */
3240
- unlock(privateKey: BytesLike): WalletUnlocked;
3241
- }
3242
- /**
3243
- * `WalletUnlocked` provides the functionalities for an unlocked wallet.
3244
- */
3245
- declare class WalletUnlocked extends BaseWalletUnlocked {
3246
- /**
3247
- * Locks the wallet and returns an instance of WalletLocked.
3248
- *
3249
- * @returns An instance of WalletLocked.
3250
- */
3251
- lock(): WalletLocked;
3252
- /**
3253
- * Generate a new Wallet Unlocked with a random key pair.
3254
- *
3255
- * @param generateOptions - Options to customize the generation process (optional).
3256
- * @returns An instance of WalletUnlocked.
3257
- */
3258
- static generate(generateOptions?: GenerateOptions): WalletUnlocked;
3259
- /**
3260
- * Create a Wallet Unlocked from a seed.
3261
- *
3262
- * @param seed - The seed phrase.
3263
- * @param provider - A Provider instance (optional).
3264
- * @param path - The derivation path (optional).
3265
- * @returns An instance of WalletUnlocked.
3266
- */
3267
- static fromSeed(seed: string, path?: string, provider?: Provider): WalletUnlocked;
3268
- /**
3269
- * Create a Wallet Unlocked from a mnemonic phrase.
3270
- *
3271
- * @param mnemonic - The mnemonic phrase.
3272
- * @param provider - A Provider instance (optional).
3273
- * @param path - The derivation path (optional).
3274
- * @param passphrase - The passphrase for the mnemonic (optional).
3275
- * @returns An instance of WalletUnlocked.
3276
- */
3277
- static fromMnemonic(mnemonic: string, path?: string, passphrase?: BytesLike, provider?: Provider): WalletUnlocked;
3278
- /**
3279
- * Create a Wallet Unlocked from an extended key.
3280
- *
3281
- * @param extendedKey - The extended key.
3282
- * @param provider - A Provider instance (optional).
3283
- * @returns An instance of WalletUnlocked.
3284
- */
3285
- static fromExtendedKey(extendedKey: string, provider?: Provider): WalletUnlocked;
3286
- /**
3287
- * Create a Wallet Unlocked from an encrypted JSON.
3288
- *
3289
- * @param jsonWallet - The encrypted JSON keystore.
3290
- * @param password - The password to decrypt the JSON.
3291
- * @param provider - A Provider instance (optional).
3292
- * @returns An unlocked wallet instance.
3293
- */
3294
- static fromEncryptedJson(jsonWallet: string, password: string, provider?: Provider): Promise<WalletUnlocked>;
3295
- }
3296
-
3297
- type ConnectorMetadata = {
3298
- image?: string | {
3299
- light: string;
3300
- dark: string;
3301
- };
3302
- install: {
3303
- action: string;
3304
- link: string;
3305
- description: string;
3306
- };
3307
- };
3308
-
3309
- declare enum FuelConnectorMethods {
3310
- ping = "ping",
3311
- version = "version",
3312
- connect = "connect",
3313
- disconnect = "disconnect",
3314
- isConnected = "isConnected",
3315
- accounts = "accounts",
3316
- currentAccount = "currentAccount",
3317
- signMessage = "signMessage",
3318
- sendTransaction = "sendTransaction",
3319
- assets = "assets",
3320
- addAsset = "addAsset",
3321
- addAssets = "addAssets",
3322
- networks = "networks",
3323
- currentNetwork = "currentNetwork",
3324
- addNetwork = "addNetwork",
3325
- selectNetwork = "selectNetwork",
3326
- addABI = "addABI",
3327
- getABI = "getABI",
3328
- hasABI = "hasABI"
3329
- }
3330
- declare enum FuelConnectorEventTypes {
3331
- connectors = "connectors",
3332
- currentConnector = "currentConnector",
3333
- connection = "connection",
3334
- accounts = "accounts",
3335
- currentAccount = "currentAccount",
3336
- networks = "networks",
3337
- currentNetwork = "currentNetwork",
3338
- assets = "assets",
3339
- abis = "abis"
3340
- }
3341
- declare const FuelConnectorEventType = "FuelConnector";
3342
-
3343
- /**
3344
- * @name Version
3345
- */
3346
- type Version = {
3347
- app: string;
3348
- /**
3349
- * Version selection this allow
3350
- * Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4
3351
- * Tilde Ranges ~1.2.3 ~1.2 ~1
3352
- * And Exact Versions 1.0.0
3353
- */
3354
- network: string;
3355
- };
3356
- /**
3357
- * @name Network
3358
- */
3359
- type Network = {
3360
- /**
3361
- * The name of the network.
3362
- */
3363
- url: string;
3364
- /**
3365
- * The chain id of the network.
3366
- */
3367
- chainId: number;
3368
- };
3369
- /**
3370
- * ABI that represents a binary code interface from Sway.
3371
- *
3372
- * Read more at: https://docs.fuel.network/docs/specs/abi/json-abi-format/
3373
- */
3374
- type FuelABI = JsonAbi;
3375
-
3376
- /** **
3377
- * ========================================================================================
3378
- * Helpers
3379
- * ========================================================================================
3380
- */
3381
- /**
3382
- * Extract the event argument type from the event type.
3383
- */
3384
- type FuelEventArg<T extends FuelConnectorEvents['type']> = Extract<FuelConnectorEventTypes, {
3385
- type: T;
3386
- }>['data'];
3387
- /**
3388
- * Event trigger when the accounts available to the
3389
- * connection changes.
3390
- *
3391
- * @property type - The event type.
3392
- * @property accounts - The accounts addresses
3393
- */
3394
- type AccountsEvent = {
3395
- type: FuelConnectorEventTypes.accounts;
3396
- data: Array<string>;
3397
- };
3398
- /**
3399
- * Event trigger when the current account on the connector is changed
3400
- * if the account is not authorized for the connection it should trigger with value null.
3401
- *
3402
- * @property type - The event type.
3403
- * @property data - The current account selected or null.
3404
- */
3405
- type AccountEvent = {
3406
- type: FuelConnectorEventTypes.currentAccount;
3407
- data: string | null;
3408
- };
3409
- /**
3410
- * Event trigger when connection status changes. With the new connection status.
3411
- *
3412
- * @event ConnectionEvent
3413
- * @property type - The event type.
3414
- * @property data - The new connection status.
3415
- */
3416
- type ConnectionEvent = {
3417
- type: FuelConnectorEventTypes.connection;
3418
- data: boolean;
3419
- };
3420
- /**
3421
- * Event trigger when the network selected on the connector is changed.
3422
- * It should trigger even if the network is not available for the connection.
3423
- *
3424
- * @event NetworkEvent
3425
- * @property type - The event type.
3426
- * @property data - The network information
3427
- */
3428
- type NetworkEvent = {
3429
- type: FuelConnectorEventTypes.currentNetwork;
3430
- data: Network;
3431
- };
3432
- /**
3433
- * Event trigger when the network selected on the connector is changed.
3434
- * It should trigger even if the network is not available for the connection.
3435
- *
3436
- * @event NetworksEvent
3437
- * @property type - The event type.
3438
- * @property data - The network information
3439
- */
3440
- type NetworksEvent = {
3441
- type: FuelConnectorEventTypes.networks;
3442
- data: Network;
3443
- };
3444
- /**
3445
- * Event trigger when the list of connectors has changed.
3446
- *
3447
- * @event ConnectorsEvent
3448
- * @property type - The event type.
3449
- * @property data - The list of connectors
3450
- */
3451
- type ConnectorsEvent = {
3452
- type: FuelConnectorEventTypes.connectors;
3453
- data: Array<FuelConnector>;
3454
- };
3455
- /**
3456
- * Event trigger when the current connector has changed.
3457
- *
3458
- * @event ConnectorEvent
3459
- * @property type - The event type.
3460
- * @property data - The list of connectors
3461
- */
3462
- type ConnectorEvent = {
3463
- type: FuelConnectorEventTypes.currentConnector;
3464
- data: FuelConnector;
3465
- };
3466
- /**
3467
- * Event trigger when the assets list of metadata changed.
3468
- *
3469
- * @event AssetsEvent
3470
- * @property type - The event type.
3471
- * @property data - The list of assets
3472
- */
3473
- type AssetsEvent = {
3474
- type: FuelConnectorEventTypes.assets;
3475
- data: Array<Asset>;
3476
- };
3477
- /**
3478
- * All the events available to the connector.
3479
- */
3480
- type FuelConnectorEvents = ConnectionEvent | NetworkEvent | NetworksEvent | AccountEvent | AccountsEvent | ConnectorsEvent | ConnectorEvent | AssetsEvent;
3481
- type FuelConnectorEventsType = FuelConnectorEvents['type'];
3482
-
3483
- /**
3484
- * @name FuelConnector
3485
- *
3486
- * Wallet Connector is a interface that represents a Wallet Connector and all the methods
3487
- * that should be implemented to be compatible with the Fuel SDK.
3488
- */
3489
- declare abstract class FuelConnector extends EventEmitter {
3490
- name: string;
3491
- metadata: ConnectorMetadata;
3492
- connected: boolean;
3493
- installed: boolean;
3494
- events: typeof FuelConnectorEventTypes;
3495
- /**
3496
- * Should return true if the connector is loaded
3497
- * in less then one second.
3498
- *
3499
- * @returns Always true.
3500
- */
3501
- ping(): Promise<boolean>;
3502
- /**
3503
- * Should return the current version of the connector
3504
- * and the network version that is compatible.
3505
- *
3506
- * @returns boolean - connection status.
3507
- */
3508
- version(): Promise<Version>;
3509
- /**
3510
- * Should return true if the connector is connected
3511
- * to any of the accounts available.
3512
- *
3513
- * @returns The connection status.
3514
- */
3515
- isConnected(): Promise<boolean>;
3516
- /**
3517
- * Should return all the accounts authorized for the
3518
- * current connection.
3519
- *
3520
- * @returns The accounts addresses strings
3521
- */
3522
- accounts(): Promise<Array<string>>;
3523
- /**
3524
- * Should start the connection process and return
3525
- * true if the account authorize the connection.
3526
- *
3527
- * and return false if the user reject the connection.
3528
- *
3529
- * @emits accounts
3530
- * @returns boolean - connection status.
3531
- */
3532
- connect(): Promise<boolean>;
3533
- /**
3534
- * Should disconnect the current connection and
3535
- * return false if the disconnection was successful.
3536
- *
3537
- * @emits assets connection
3538
- * @returns The connection status.
3539
- */
3540
- disconnect(): Promise<boolean>;
3541
- /**
3542
- * Should start the sign message process and return
3543
- * the signed message.
3544
- *
3545
- * @param address - The address to sign the message
3546
- * @param message - The message to sign all text will be treated as text utf-8
3547
- *
3548
- * @returns Message signature
3549
- */
3550
- signMessage(_address: string, _message: string): Promise<string>;
3551
- /**
3552
- * Should start the send transaction process and return
3553
- * the transaction id submitted to the network.
3554
- *
3555
- * If the network is not available for the connection
3556
- * it should throw an error to avoid the transaction
3557
- * to be sent to the wrong network and lost.
3558
- *
3559
- * @param address - The address to sign the transaction
3560
- * @param transaction - The transaction to send
3561
- *
3562
- * @returns The transaction id
3563
- */
3564
- sendTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string>;
3565
- /**
3566
- * Should return the current account selected inside the connector, if the account
3567
- * is authorized for the connection.
3568
- *
3569
- * If the account is not authorized it should return null.
3570
- *
3571
- * @returns The current account selected otherwise null.
3572
- */
3573
- currentAccount(): Promise<string | null>;
3574
- /**
3575
- * Should add the the assets metadata to the connector and return true if the asset
3576
- * was added successfully.
3577
- *
3578
- * If the asset already exists it should throw an error.
3579
- *
3580
- * @emits assets
3581
- * @param assets - The assets to add the metadata to the connection.
3582
- * @throws Error if the asset already exists
3583
- * @returns True if the asset was added successfully
3584
- */
3585
- addAssets(_assets: Array<Asset>): Promise<boolean>;
3586
- /**
3587
- * Should add the the asset metadata to the connector and return true if the asset
3588
- * was added successfully.
3589
- *
3590
- * If the asset already exists it should throw an error.
3591
- *
3592
- * @emits assets
3593
- * @param asset - The asset to add the metadata to the connection.
3594
- * @throws Error if the asset already exists
3595
- * @returns True if the asset was added successfully
3596
- */
3597
- addAsset(_asset: Asset): Promise<boolean>;
3598
- /**
3599
- * Should return all the assets added to the connector. If a connection is already established.
3600
- *
3601
- * @returns Array of assets metadata from the connector vinculated to the all accounts from a specific Wallet.
3602
- */
3603
- assets(): Promise<Array<Asset>>;
3604
- /**
3605
- * Should start the add network process and return true if the network was added successfully.
3606
- *
3607
- * @emits networks
3608
- * @throws Error if the network already exists
3609
- * @param networkUrl - The URL of the network to be added.
3610
- * @returns Return true if the network was added successfully
3611
- */
3612
- addNetwork(_networkUrl: string): Promise<boolean>;
3613
- /**
3614
- * Should start the select network process and return true if the network has change successfully.
3615
- *
3616
- * @emits networks
3617
- * @throws Error if the network already exists
3618
- * @param network - The network to be selected.
3619
- * @returns Return true if the network was added successfully
3620
- */
3621
- selectNetwork(_network: Network): Promise<boolean>;
3622
- /**
3623
- * Should return all the networks available from the connector. If the connection is already established.
3624
- *
3625
- * @returns Return all the networks added to the connector.
3626
- */
3627
- networks(): Promise<Array<Network>>;
3628
- /**
3629
- * Should return the current network selected inside the connector. Even if the connection is not established.
3630
- *
3631
- * @returns Return the current network selected inside the connector.
3632
- */
3633
- currentNetwork(): Promise<Network>;
3634
- /**
3635
- * Should add the ABI to the connector and return true if the ABI was added successfully.
3636
- *
3637
- * @param contractId - The contract id to add the ABI.
3638
- * @param abi - The JSON ABI that represents a contract.
3639
- * @returns Return true if the ABI was added successfully.
3640
- */
3641
- addABI(_contractId: string, _abi: FuelABI): Promise<boolean>;
3642
- /**
3643
- * Should return the ABI from the connector vinculated to the all accounts from a specific Wallet.
3644
- *
3645
- * @param id - The contract id to get the ABI.
3646
- * @returns The ABI if it exists, otherwise return null.
3647
- */
3648
- getABI(_id: string): Promise<FuelABI | null>;
3649
- /**
3650
- * Should return true if the abi exists in the connector vinculated to the all accounts from a specific Wallet.
3651
- *
3652
- * @param id - The contract id to get the abi
3653
- * @returns Returns true if the abi exists or false if not.
3654
- */
3655
- hasABI(_id: string): Promise<boolean>;
3656
- /**
3657
- * Event listener for the connector.
3658
- *
3659
- * @param eventName - The event name to listen
3660
- * @param listener - The listener function
3661
- */
3662
- on<E extends FuelConnectorEvents['type'], D extends FuelEventArg<E>>(eventName: E, listener: (data: D) => void): this;
3663
- }
3664
-
3665
- type TxParamsType = Pick<ScriptTransactionRequestLike, 'gasLimit' | 'gasPrice' | 'maturity' | 'maxFee' | 'witnessLimit'>;
3666
- /**
3667
- * `Account` provides an abstraction for interacting with accounts or wallets on the network.
3668
- */
3669
- declare class Account extends AbstractAccount {
3670
- /**
3671
- * The address associated with the account.
3672
- */
3673
- readonly address: AbstractAddress;
3674
- /**
3675
- * The provider used to interact with the network.
3676
- */
3677
- protected _provider?: Provider;
3678
- protected _connector?: FuelConnector;
3679
- /**
3680
- * Creates a new Account instance.
3681
- *
3682
- * @param address - The address of the account.
3683
- * @param provider - A Provider instance (optional).
3684
- */
3685
- constructor(address: string | AbstractAddress, provider?: Provider, connector?: FuelConnector);
3686
- /**
3687
- * The provider used to interact with the network.
3688
- *
3689
- * @returns A Provider instance.
3690
- *
3691
- * @throws `FuelError` if the provider is not set.
3692
- */
3693
- get provider(): Provider;
3694
- /**
3695
- * Sets the provider for the account.
3696
- *
3697
- * @param provider - A Provider instance.
3698
- */
3699
- set provider(provider: Provider);
3700
- /**
3701
- * Changes the provider connection for the account.
3702
- *
3703
- * @param provider - A Provider instance.
3704
- * @returns The updated Provider instance.
3705
- */
3706
- connect(provider: Provider): Provider;
3707
- /**
3708
- * Retrieves resources satisfying the spend query for the account.
3709
- *
3710
- * @param quantities - IDs of coins to exclude.
3711
- * @param excludedIds - IDs of resources to be excluded from the query.
3712
- * @returns A promise that resolves to an array of Resources.
3713
- */
3714
- getResourcesToSpend(quantities: CoinQuantityLike[] /** IDs of coins to exclude */, excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
3715
- /**
3716
- * Retrieves coins owned by the account.
3717
- *
3718
- * @param assetId - The asset ID of the coins to retrieve.
3719
- * @returns A promise that resolves to an array of Coins.
3720
- */
3721
- getCoins(assetId?: BytesLike): Promise<Coin[]>;
3722
- /**
3723
- * Retrieves messages owned by the account.
3724
- *
3725
- * @returns A promise that resolves to an array of Messages.
3726
- */
3727
- getMessages(): Promise<Message[]>;
3728
- /**
3729
- * Retrieves the balance of the account for the given asset.
3730
- *
3731
- * @param assetId - The asset ID to check the balance for.
3732
- * @returns A promise that resolves to the balance amount.
3733
- */
3734
- getBalance(assetId?: BytesLike): Promise<BN>;
3735
- /**
3736
- * Retrieves all the balances for the account.
3737
- *
3738
- * @returns A promise that resolves to an array of Coins and their quantities.
3739
- */
3740
- getBalances(): Promise<CoinQuantity[]>;
3741
- /**
3742
- * Adds resources to the transaction enough to fund it.
3743
- *
3744
- * @param request - The transaction request.
3745
- * @param coinQuantities - The coin quantities required to execute the transaction.
3746
- * @param fee - The estimated transaction fee.
3747
- * @returns A promise that resolves when the resources are added to the transaction.
3748
- */
3749
- fund<T extends TransactionRequest>(request: T, coinQuantities: CoinQuantity[], fee: BN): Promise<void>;
3750
- /**
3751
- * A helper that creates a transfer transaction request and returns it.
3752
- *
3753
- * @param destination - The address of the destination.
3754
- * @param amount - The amount of coins to transfer.
3755
- * @param assetId - The asset ID of the coins to transfer.
3756
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
3757
- * @returns A promise that resolves to the prepared transaction request.
3758
- */
3759
- createTransfer(
3760
- /** Address of the destination */
3761
- destination: string | AbstractAddress,
3762
- /** Amount of coins */
3763
- amount: BigNumberish,
3764
- /** Asset ID of coins */
3765
- assetId?: BytesLike,
3766
- /** Tx Params */
3767
- txParams?: TxParamsType): Promise<TransactionRequest>;
3768
- /**
3769
- * Transfers coins to a destination address.
3770
- *
3771
- * @param destination - The address of the destination.
3772
- * @param amount - The amount of coins to transfer.
3773
- * @param assetId - The asset ID of the coins to transfer.
3774
- * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
3775
- * @returns A promise that resolves to the transaction response.
3776
- */
3777
- transfer(
3778
- /** Address of the destination */
3779
- destination: string | AbstractAddress,
3780
- /** Amount of coins */
3781
- amount: BigNumberish,
3782
- /** Asset ID of coins */
3783
- assetId?: BytesLike,
3784
- /** Tx Params */
3785
- txParams?: TxParamsType): Promise<TransactionResponse>;
3786
- /**
3787
- * Transfers coins to a contract address.
3788
- *
3789
- * @param contractId - The address of the contract.
3790
- * @param amount - The amount of coins to transfer.
3791
- * @param assetId - The asset ID of the coins to transfer.
3792
- * @param txParams - The optional transaction parameters.
3793
- * @returns A promise that resolves to the transaction response.
3794
- */
3795
- transferToContract(
3796
- /** Contract address */
3797
- contractId: string | AbstractAddress,
3798
- /** Amount of coins */
3799
- amount: BigNumberish,
3800
- /** Asset ID of coins */
3801
- assetId?: BytesLike,
3802
- /** Tx Params */
3803
- txParams?: TxParamsType): Promise<TransactionResponse>;
3804
- /**
3805
- * Withdraws an amount of the base asset to the base chain.
3806
- *
3807
- * @param recipient - Address of the recipient on the base chain.
3808
- * @param amount - Amount of base asset.
3809
- * @param txParams - The optional transaction parameters.
3810
- * @returns A promise that resolves to the transaction response.
3811
- */
3812
- withdrawToBaseLayer(
3813
- /** Address of the recipient on the base chain */
3814
- recipient: string | AbstractAddress,
3815
- /** Amount of base asset */
3816
- amount: BigNumberish,
3817
- /** Tx Params */
3818
- txParams?: TxParamsType): Promise<TransactionResponse>;
3819
- signMessage(message: string): Promise<string>;
3820
- /**
3821
- * Sends a transaction to the network.
3822
- *
3823
- * @param transactionRequestLike - The transaction request to be sent.
3824
- * @returns A promise that resolves to the transaction response.
3825
- */
3826
- sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
3827
- /**
3828
- * Simulates a transaction.
3829
- *
3830
- * @param transactionRequestLike - The transaction request to be simulated.
3831
- * @returns A promise that resolves to the call result.
3832
- */
3833
- simulateTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
3834
- private validateGas;
3835
- }
3836
-
3837
- export { type EstimateTxDependenciesReturns as $, type AbiMap as A, type BurnedAsset as B, type Network as C, Account as D, type TxParamsType as E, FuelConnector as F, type GqlTransactionStatusesNames as G, BaseWalletUnlocked as H, type InputParam as I, type GenerateOptions as J, type PredicateParams as K, Predicate as L, type MintedAsset as M, type NetworkEthereum as N, type OperationCoin as O, Provider as P, type CoinQuantityLike as Q, type ReceiptParam as R, Signer as S, type TransactionRequestLike as T, type CoinQuantity as U, coinQuantityfy as V, WalletLocked as W, type IAddAmountToAssetParams as X, addAmountToAsset as Y, type Coin as Z, type CallResult as _, type TransactionRequest as a, type SubmittedStatus as a$, type Block as a0, type ContractResult as a1, type ChainInfo as a2, type NodeInfo as a3, type NodeInfoAndConsensusParameters as a4, type TransactionCost as a5, type CursorPaginationArgs as a6, type ProviderOptions as a7, type UTXOValidationParams as a8, type EstimateTransactionParams as a9, type VariableTransactionRequestOutput as aA, type ContractCreatedTransactionRequestOutput as aB, type TransactionRequestOutput as aC, outputify as aD, type BaseTransactionRequestLike as aE, BaseTransactionRequest as aF, type CreateTransactionRequestLike as aG, CreateTransactionRequest as aH, type ScriptTransactionRequestLike as aI, ScriptTransactionRequest as aJ, type TransactionResultCallReceipt as aK, type TransactionResultReturnReceipt as aL, type TransactionResultReturnDataReceipt as aM, type TransactionResultPanicReceipt as aN, type TransactionResultRevertReceipt as aO, type TransactionResultLogReceipt as aP, type TransactionResultLogDataReceipt as aQ, type TransactionResultTransferReceipt as aR, type TransactionResultTransferOutReceipt as aS, type TransactionResultScriptResultReceipt as aT, type TransactionResultMessageOutReceipt as aU, type TransactionResultMintReceipt as aV, type TransactionResultBurnReceipt as aW, TransactionResponse as aX, type GqlTransaction as aY, type SuccessStatus as aZ, type FailureStatus as a_, type EstimatePredicateParams as aa, type TransactionCostParams as ab, type ProviderCallParams as ac, type ProviderSendTxParams as ad, type Message as ae, type MessageCoin as af, type MerkleProof as ag, type BlockHeader as ah, type MessageProof as ai, type MessageStatus as aj, type RawCoin as ak, type RawMessage as al, type RawResource as am, type Resource as an, type ExcludeResourcesOption as ao, isRawCoin as ap, isRawMessage as aq, isCoin as ar, isMessage as as, type CoinTransactionRequestInput as at, type MessageTransactionRequestInput as au, type ContractTransactionRequestInput as av, inputify as aw, type CoinTransactionRequestOutput as ax, type ContractTransactionRequestOutput as ay, type ChangeTransactionRequestOutput as az, type TransactionResultReceipt as b, type SqueezedOutStatus as b0, type Reason as b1, type ProgramState as b2, type Time as b3, type BlockId as b4, OperationName as b5, type OperationFunctionCall as b6, AddressType as b7, ChainName as b8, type OperationTransactionAddress as b9, type OutputParam as ba, type ConnectorMetadata as bb, FuelConnectorMethods as bc, FuelConnectorEventTypes as bd, FuelConnectorEventType as be, type Version as bf, type FuelABI as bg, type FuelEventArg as bh, type AccountsEvent as bi, type AccountEvent as bj, type ConnectionEvent as bk, type NetworkEvent as bl, type NetworksEvent as bm, type ConnectorsEvent as bn, type ConnectorEvent as bo, type AssetsEvent as bp, type FuelConnectorEvents as bq, type FuelConnectorEventsType as br, TransactionStatus as c, type GraphqlTransactionStatus as d, type TransactionSummary as e, TransactionTypeName as f, type Operation as g, type InputOutputParam as h, type GetOperationParams as i, type RawPayloadParam as j, type GetTransferOperationsParams as k, type TransactionResult as l, type GqlGetTransactionsByOwnerQueryVariables as m, type GqlPageInfo as n, type GqlGasCosts as o, type GqlReceiptFragmentFragment as p, type GqlConsensusParameters as q, type GqlFeeParameters as r, type GqlDependentCost as s, type TransactionRequestInput as t, type NetworkFuel as u, type Asset as v, type AssetEth as w, type AssetFuel as x, type Assets as y, WalletUnlocked as z };