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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (218) hide show
  1. package/dist/account.d.ts +177 -0
  2. package/dist/account.d.ts.map +1 -0
  3. package/dist/configs.d.ts +2 -3
  4. package/dist/configs.d.ts.map +1 -0
  5. package/dist/connectors/fuel-connector.d.ts +188 -0
  6. package/dist/connectors/fuel-connector.d.ts.map +1 -0
  7. package/dist/connectors/fuel.d.ts +133 -0
  8. package/dist/connectors/fuel.d.ts.map +1 -0
  9. package/dist/connectors/index.d.ts +5 -0
  10. package/dist/connectors/index.d.ts.map +1 -0
  11. package/dist/connectors/types/connector-metadata.d.ts +12 -0
  12. package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
  13. package/dist/connectors/types/connector-types.d.ts +34 -0
  14. package/dist/connectors/types/connector-types.d.ts.map +1 -0
  15. package/dist/connectors/types/data-type.d.ts +34 -0
  16. package/dist/connectors/types/data-type.d.ts.map +1 -0
  17. package/dist/connectors/types/events.d.ts +111 -0
  18. package/dist/connectors/types/events.d.ts.map +1 -0
  19. package/dist/connectors/types/index.d.ts +7 -0
  20. package/dist/connectors/types/index.d.ts.map +1 -0
  21. package/dist/connectors/types/local-storage.d.ts +11 -0
  22. package/dist/connectors/types/local-storage.d.ts.map +1 -0
  23. package/dist/connectors/types/target-object.d.ts +14 -0
  24. package/dist/connectors/types/target-object.d.ts.map +1 -0
  25. package/dist/connectors/utils/cache.d.ts +14 -0
  26. package/dist/connectors/utils/cache.d.ts.map +1 -0
  27. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
  28. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
  29. package/dist/connectors/utils/index.d.ts +4 -0
  30. package/dist/connectors/utils/index.d.ts.map +1 -0
  31. package/dist/connectors/utils/promises.d.ts +8 -0
  32. package/dist/connectors/utils/promises.d.ts.map +1 -0
  33. package/dist/hdwallet/hdwallet.d.ts +58 -0
  34. package/dist/hdwallet/hdwallet.d.ts.map +1 -0
  35. package/dist/hdwallet/index.d.ts +2 -0
  36. package/dist/hdwallet/index.d.ts.map +1 -0
  37. package/dist/index.d.ts +13 -904
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.global.js +461 -394
  40. package/dist/index.global.js.map +1 -1
  41. package/dist/index.js +350 -314
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +251 -212
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/mnemonic/index.d.ts +3 -0
  46. package/dist/mnemonic/index.d.ts.map +1 -0
  47. package/dist/mnemonic/mnemonic.d.ts +85 -0
  48. package/dist/mnemonic/mnemonic.d.ts.map +1 -0
  49. package/dist/mnemonic/utils.d.ts +8 -0
  50. package/dist/mnemonic/utils.d.ts.map +1 -0
  51. package/dist/predicate/index.d.ts +3 -0
  52. package/dist/predicate/index.d.ts.map +1 -0
  53. package/dist/predicate/predicate.d.ts +94 -0
  54. package/dist/predicate/predicate.d.ts.map +1 -0
  55. package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
  56. package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
  57. package/dist/predicate/utils/index.d.ts +2 -0
  58. package/dist/predicate/utils/index.d.ts.map +1 -0
  59. package/dist/providers/__generated__/operations.d.ts +3477 -0
  60. package/dist/providers/__generated__/operations.d.ts.map +1 -0
  61. package/dist/providers/assets/index.d.ts +5 -0
  62. package/dist/providers/assets/index.d.ts.map +1 -0
  63. package/dist/providers/assets/types.d.ts +36 -0
  64. package/dist/providers/assets/types.d.ts.map +1 -0
  65. package/dist/providers/assets/utils/index.d.ts +4 -0
  66. package/dist/providers/assets/utils/index.d.ts.map +1 -0
  67. package/dist/providers/assets/utils/network.d.ts +33 -0
  68. package/dist/providers/assets/utils/network.d.ts.map +1 -0
  69. package/dist/providers/assets/utils/resolveIconPaths.d.ts +14 -0
  70. package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -0
  71. package/dist/providers/assets/utils/url.d.ts +2 -0
  72. package/dist/providers/assets/utils/url.d.ts.map +1 -0
  73. package/dist/providers/chains.d.ts +11 -0
  74. package/dist/providers/chains.d.ts.map +1 -0
  75. package/dist/providers/coin-quantity.d.ts +21 -0
  76. package/dist/providers/coin-quantity.d.ts.map +1 -0
  77. package/dist/providers/coin.d.ts +15 -0
  78. package/dist/providers/coin.d.ts.map +1 -0
  79. package/dist/providers/fuel-graphql-subscriber.d.ts +23 -0
  80. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
  81. package/dist/providers/index.d.ts +13 -0
  82. package/dist/providers/index.d.ts.map +1 -0
  83. package/dist/providers/memory-cache.d.ts +11 -0
  84. package/dist/providers/memory-cache.d.ts.map +1 -0
  85. package/dist/providers/message.d.ts +60 -0
  86. package/dist/providers/message.d.ts.map +1 -0
  87. package/dist/providers/provider.d.ts +522 -0
  88. package/dist/providers/provider.d.ts.map +1 -0
  89. package/dist/providers/resource.d.ts +37 -0
  90. package/dist/providers/resource.d.ts.map +1 -0
  91. package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
  92. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
  93. package/dist/providers/transaction-request/errors.d.ts +25 -0
  94. package/dist/providers/transaction-request/errors.d.ts.map +1 -0
  95. package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
  96. package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
  97. package/dist/providers/transaction-request/index.d.ts +10 -0
  98. package/dist/providers/transaction-request/index.d.ts.map +1 -0
  99. package/dist/providers/transaction-request/input.d.ts +59 -0
  100. package/dist/providers/transaction-request/input.d.ts.map +1 -0
  101. package/dist/providers/transaction-request/output.d.ts +39 -0
  102. package/dist/providers/transaction-request/output.d.ts.map +1 -0
  103. package/dist/providers/transaction-request/script-transaction-request.d.ts +106 -0
  104. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
  105. package/dist/providers/transaction-request/scripts.d.ts +6 -0
  106. package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
  107. package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
  108. package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
  109. package/dist/providers/transaction-request/transaction-request.d.ts +259 -0
  110. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
  111. package/dist/providers/transaction-request/types.d.ts +10 -0
  112. package/dist/providers/transaction-request/types.d.ts.map +1 -0
  113. package/dist/providers/transaction-request/utils.d.ts +4 -0
  114. package/dist/providers/transaction-request/utils.d.ts.map +1 -0
  115. package/dist/providers/transaction-request/witness.d.ts +5 -0
  116. package/dist/providers/transaction-request/witness.d.ts.map +1 -0
  117. package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
  118. package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
  119. package/dist/providers/transaction-response/index.d.ts +3 -0
  120. package/dist/providers/transaction-response/index.d.ts.map +1 -0
  121. package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
  122. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
  123. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
  124. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
  125. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
  126. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
  127. package/dist/providers/transaction-summary/call.d.ts +18 -0
  128. package/dist/providers/transaction-summary/call.d.ts.map +1 -0
  129. package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
  130. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
  131. package/dist/providers/transaction-summary/index.d.ts +10 -0
  132. package/dist/providers/transaction-summary/index.d.ts.map +1 -0
  133. package/dist/providers/transaction-summary/input.d.ts +21 -0
  134. package/dist/providers/transaction-summary/input.d.ts.map +1 -0
  135. package/dist/providers/transaction-summary/operations.d.ts +40 -0
  136. package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
  137. package/dist/providers/transaction-summary/output.d.ts +15 -0
  138. package/dist/providers/transaction-summary/output.d.ts.map +1 -0
  139. package/dist/providers/transaction-summary/receipt.d.ts +7 -0
  140. package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
  141. package/dist/providers/transaction-summary/status.d.ts +9 -0
  142. package/dist/providers/transaction-summary/status.d.ts.map +1 -0
  143. package/dist/providers/transaction-summary/types.d.ts +146 -0
  144. package/dist/providers/transaction-summary/types.d.ts.map +1 -0
  145. package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
  146. package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
  147. package/dist/providers/utils/block-explorer.d.ts +14 -0
  148. package/dist/providers/utils/block-explorer.d.ts.map +1 -0
  149. package/dist/providers/utils/gas.d.ts +38 -0
  150. package/dist/providers/utils/gas.d.ts.map +1 -0
  151. package/dist/providers/utils/index.d.ts +5 -0
  152. package/dist/providers/utils/index.d.ts.map +1 -0
  153. package/dist/providers/utils/json.d.ts +7 -0
  154. package/dist/providers/utils/json.d.ts.map +1 -0
  155. package/dist/providers/utils/merge-quantities.d.ts +3 -0
  156. package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
  157. package/dist/providers/utils/receipts.d.ts +10 -0
  158. package/dist/providers/utils/receipts.d.ts.map +1 -0
  159. package/dist/signer/index.d.ts +2 -0
  160. package/dist/signer/index.d.ts.map +1 -0
  161. package/dist/signer/signer.d.ts +64 -0
  162. package/dist/signer/signer.d.ts.map +1 -0
  163. package/dist/test-utils/asset-id.d.ts +9 -0
  164. package/dist/test-utils/asset-id.d.ts.map +1 -0
  165. package/dist/test-utils/generateTestWallet.d.ts +4 -0
  166. package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
  167. package/dist/test-utils/index.d.ts +8 -0
  168. package/dist/test-utils/index.d.ts.map +1 -0
  169. package/dist/{test-utils.d.ts → test-utils/launchNode.d.ts} +19 -24
  170. package/dist/test-utils/launchNode.d.ts.map +1 -0
  171. package/dist/test-utils/seedTestWallet.d.ts +4 -0
  172. package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
  173. package/dist/test-utils/setup-test-provider-and-wallets.d.ts +33 -0
  174. package/dist/test-utils/setup-test-provider-and-wallets.d.ts.map +1 -0
  175. package/dist/test-utils/test-message.d.ts +28 -0
  176. package/dist/test-utils/test-message.d.ts.map +1 -0
  177. package/dist/test-utils/wallet-config.d.ts +49 -0
  178. package/dist/test-utils/wallet-config.d.ts.map +1 -0
  179. package/dist/test-utils.global.js +655 -310
  180. package/dist/test-utils.global.js.map +1 -1
  181. package/dist/test-utils.js +452 -217
  182. package/dist/test-utils.js.map +1 -1
  183. package/dist/test-utils.mjs +357 -124
  184. package/dist/test-utils.mjs.map +1 -1
  185. package/dist/utils/formatTransferToContractScriptData.d.ts +14 -0
  186. package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
  187. package/dist/wallet/base-wallet-unlocked.d.ts +73 -0
  188. package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -0
  189. package/dist/wallet/index.d.ts +4 -0
  190. package/dist/wallet/index.d.ts.map +1 -0
  191. package/dist/wallet/keystore-wallet.d.ts +38 -0
  192. package/dist/wallet/keystore-wallet.d.ts.map +1 -0
  193. package/dist/wallet/wallet.d.ts +68 -0
  194. package/dist/wallet/wallet.d.ts.map +1 -0
  195. package/dist/wallet/wallets.d.ts +76 -0
  196. package/dist/wallet/wallets.d.ts.map +1 -0
  197. package/dist/wallet-manager/index.d.ts +6 -0
  198. package/dist/wallet-manager/index.d.ts.map +1 -0
  199. package/dist/wallet-manager/storages/memory-storage.d.ts +9 -0
  200. package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
  201. package/dist/wallet-manager/types.d.ts +42 -0
  202. package/dist/wallet-manager/types.d.ts.map +1 -0
  203. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +29 -0
  204. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
  205. package/dist/wallet-manager/vaults/privatekey-vault.d.ts +29 -0
  206. package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
  207. package/dist/wallet-manager/wallet-manager.d.ts +104 -0
  208. package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
  209. package/dist/wordlists/index.d.ts +5 -0
  210. package/dist/wordlists/index.d.ts.map +1 -0
  211. package/dist/wordlists/words/english.d.ts +2 -0
  212. package/dist/wordlists/words/english.d.ts.map +1 -0
  213. package/package.json +26 -21
  214. package/dist/account-E9nGNf5X.d.mts +0 -3837
  215. package/dist/account-E9nGNf5X.d.ts +0 -3837
  216. package/dist/configs.d.mts +0 -3
  217. package/dist/index.d.mts +0 -904
  218. package/dist/test-utils.d.mts +0 -66
@@ -0,0 +1,177 @@
1
+ import { AbstractAccount } from '@fuel-ts/interfaces';
2
+ import type { AbstractAddress, BytesLike } from '@fuel-ts/interfaces';
3
+ import type { BigNumberish, BN } from '@fuel-ts/math';
4
+ import type { FuelConnector } from './connectors';
5
+ import type { TransactionRequestLike, CallResult, TransactionRequest, Coin, CoinQuantityLike, CoinQuantity, Message, Resource, ExcludeResourcesOption, Provider, ScriptTransactionRequestLike, ProviderSendTxParams, TransactionResponse, EstimateTransactionParams } from './providers';
6
+ export type TxParamsType = Pick<ScriptTransactionRequestLike, 'gasLimit' | 'gasPrice' | 'maturity' | 'maxFee' | 'witnessLimit'>;
7
+ /**
8
+ * `Account` provides an abstraction for interacting with accounts or wallets on the network.
9
+ */
10
+ export declare class Account extends AbstractAccount {
11
+ /**
12
+ * The address associated with the account.
13
+ */
14
+ readonly address: AbstractAddress;
15
+ /**
16
+ * The provider used to interact with the network.
17
+ */
18
+ protected _provider?: Provider;
19
+ protected _connector?: FuelConnector;
20
+ /**
21
+ * Creates a new Account instance.
22
+ *
23
+ * @param address - The address of the account.
24
+ * @param provider - A Provider instance (optional).
25
+ */
26
+ constructor(address: string | AbstractAddress, provider?: Provider, connector?: FuelConnector);
27
+ /**
28
+ * The provider used to interact with the network.
29
+ *
30
+ * @returns A Provider instance.
31
+ *
32
+ * @throws `FuelError` if the provider is not set.
33
+ */
34
+ get provider(): Provider;
35
+ /**
36
+ * Sets the provider for the account.
37
+ *
38
+ * @param provider - A Provider instance.
39
+ */
40
+ set provider(provider: Provider);
41
+ /**
42
+ * Changes the provider connection for the account.
43
+ *
44
+ * @param provider - A Provider instance.
45
+ * @returns The updated Provider instance.
46
+ */
47
+ connect(provider: Provider): Provider;
48
+ /**
49
+ * Retrieves resources satisfying the spend query for the account.
50
+ *
51
+ * @param quantities - IDs of coins to exclude.
52
+ * @param excludedIds - IDs of resources to be excluded from the query.
53
+ * @returns A promise that resolves to an array of Resources.
54
+ */
55
+ getResourcesToSpend(quantities: CoinQuantityLike[] /** IDs of coins to exclude */, excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
56
+ /**
57
+ * Retrieves coins owned by the account.
58
+ *
59
+ * @param assetId - The asset ID of the coins to retrieve.
60
+ * @returns A promise that resolves to an array of Coins.
61
+ */
62
+ getCoins(assetId?: BytesLike): Promise<Coin[]>;
63
+ /**
64
+ * Retrieves messages owned by the account.
65
+ *
66
+ * @returns A promise that resolves to an array of Messages.
67
+ */
68
+ getMessages(): Promise<Message[]>;
69
+ /**
70
+ * Retrieves the balance of the account for the given asset.
71
+ *
72
+ * @param assetId - The asset ID to check the balance for.
73
+ * @returns A promise that resolves to the balance amount.
74
+ */
75
+ getBalance(assetId?: BytesLike): Promise<BN>;
76
+ /**
77
+ * Retrieves all the balances for the account.
78
+ *
79
+ * @returns A promise that resolves to an array of Coins and their quantities.
80
+ */
81
+ getBalances(): Promise<CoinQuantity[]>;
82
+ /**
83
+ * Adds resources to the transaction enough to fund it.
84
+ *
85
+ * @param request - The transaction request.
86
+ * @param coinQuantities - The coin quantities required to execute the transaction.
87
+ * @param fee - The estimated transaction fee.
88
+ * @returns A promise that resolves when the resources are added to the transaction.
89
+ */
90
+ fund<T extends TransactionRequest>(request: T, coinQuantities: CoinQuantity[], fee: BN): Promise<void>;
91
+ /**
92
+ * A helper that creates a transfer transaction request and returns it.
93
+ *
94
+ * @param destination - The address of the destination.
95
+ * @param amount - The amount of coins to transfer.
96
+ * @param assetId - The asset ID of the coins to transfer.
97
+ * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
98
+ * @returns A promise that resolves to the prepared transaction request.
99
+ */
100
+ createTransfer(
101
+ /** Address of the destination */
102
+ destination: string | AbstractAddress,
103
+ /** Amount of coins */
104
+ amount: BigNumberish,
105
+ /** Asset ID of coins */
106
+ assetId?: BytesLike,
107
+ /** Tx Params */
108
+ txParams?: TxParamsType): Promise<TransactionRequest>;
109
+ /**
110
+ * Transfers coins to a destination address.
111
+ *
112
+ * @param destination - The address of the destination.
113
+ * @param amount - The amount of coins to transfer.
114
+ * @param assetId - The asset ID of the coins to transfer.
115
+ * @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
116
+ * @returns A promise that resolves to the transaction response.
117
+ */
118
+ transfer(
119
+ /** Address of the destination */
120
+ destination: string | AbstractAddress,
121
+ /** Amount of coins */
122
+ amount: BigNumberish,
123
+ /** Asset ID of coins */
124
+ assetId?: BytesLike,
125
+ /** Tx Params */
126
+ txParams?: TxParamsType): Promise<TransactionResponse>;
127
+ /**
128
+ * Transfers coins to a contract address.
129
+ *
130
+ * @param contractId - The address of the contract.
131
+ * @param amount - The amount of coins to transfer.
132
+ * @param assetId - The asset ID of the coins to transfer.
133
+ * @param txParams - The optional transaction parameters.
134
+ * @returns A promise that resolves to the transaction response.
135
+ */
136
+ transferToContract(
137
+ /** Contract address */
138
+ contractId: string | AbstractAddress,
139
+ /** Amount of coins */
140
+ amount: BigNumberish,
141
+ /** Asset ID of coins */
142
+ assetId?: BytesLike,
143
+ /** Tx Params */
144
+ txParams?: TxParamsType): Promise<TransactionResponse>;
145
+ /**
146
+ * Withdraws an amount of the base asset to the base chain.
147
+ *
148
+ * @param recipient - Address of the recipient on the base chain.
149
+ * @param amount - Amount of base asset.
150
+ * @param txParams - The optional transaction parameters.
151
+ * @returns A promise that resolves to the transaction response.
152
+ */
153
+ withdrawToBaseLayer(
154
+ /** Address of the recipient on the base chain */
155
+ recipient: string | AbstractAddress,
156
+ /** Amount of base asset */
157
+ amount: BigNumberish,
158
+ /** Tx Params */
159
+ txParams?: TxParamsType): Promise<TransactionResponse>;
160
+ signMessage(message: string): Promise<string>;
161
+ /**
162
+ * Sends a transaction to the network.
163
+ *
164
+ * @param transactionRequestLike - The transaction request to be sent.
165
+ * @returns A promise that resolves to the transaction response.
166
+ */
167
+ sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
168
+ /**
169
+ * Simulates a transaction.
170
+ *
171
+ * @param transactionRequestLike - The transaction request to be simulated.
172
+ * @returns A promise that resolves to the call result.
173
+ */
174
+ simulateTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
175
+ private validateGas;
176
+ }
177
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAItD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACR,4BAA4B,EAC5B,oBAAoB,EACpB,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;IACG,mBAAmB,CACvB,sBAAsB,EAAE,sBAAsB,EAC9C,EAAE,sBAA6B,EAAE,GAAE,yBAA8B,GAChE,OAAO,CAAC,UAAU,CAAC;IAQtB,OAAO,CAAC,WAAW;CAyBpB"}
package/dist/configs.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- declare const FUEL_NETWORK_URL: string;
2
-
3
- export { FUEL_NETWORK_URL };
1
+ export declare const FUEL_NETWORK_URL: string;
2
+ //# sourceMappingURL=configs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../src/configs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,QAGQ,CAAC"}
@@ -0,0 +1,188 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import type { TransactionRequestLike } from '../providers';
4
+ import type { Asset } from '../providers/assets/types';
5
+ import { FuelConnectorEventTypes } from './types';
6
+ import type { FuelConnectorEvents, ConnectorMetadata, FuelABI, Network, FuelEventArg, Version } from './types';
7
+ /**
8
+ * @name FuelConnector
9
+ *
10
+ * Wallet Connector is a interface that represents a Wallet Connector and all the methods
11
+ * that should be implemented to be compatible with the Fuel SDK.
12
+ */
13
+ export declare abstract class FuelConnector extends EventEmitter {
14
+ name: string;
15
+ metadata: ConnectorMetadata;
16
+ connected: boolean;
17
+ installed: boolean;
18
+ events: typeof FuelConnectorEventTypes;
19
+ /**
20
+ * Should return true if the connector is loaded
21
+ * in less then one second.
22
+ *
23
+ * @returns Always true.
24
+ */
25
+ ping(): Promise<boolean>;
26
+ /**
27
+ * Should return the current version of the connector
28
+ * and the network version that is compatible.
29
+ *
30
+ * @returns boolean - connection status.
31
+ */
32
+ version(): Promise<Version>;
33
+ /**
34
+ * Should return true if the connector is connected
35
+ * to any of the accounts available.
36
+ *
37
+ * @returns The connection status.
38
+ */
39
+ isConnected(): Promise<boolean>;
40
+ /**
41
+ * Should return all the accounts authorized for the
42
+ * current connection.
43
+ *
44
+ * @returns The accounts addresses strings
45
+ */
46
+ accounts(): Promise<Array<string>>;
47
+ /**
48
+ * Should start the connection process and return
49
+ * true if the account authorize the connection.
50
+ *
51
+ * and return false if the user reject the connection.
52
+ *
53
+ * @emits accounts
54
+ * @returns boolean - connection status.
55
+ */
56
+ connect(): Promise<boolean>;
57
+ /**
58
+ * Should disconnect the current connection and
59
+ * return false if the disconnection was successful.
60
+ *
61
+ * @emits assets connection
62
+ * @returns The connection status.
63
+ */
64
+ disconnect(): Promise<boolean>;
65
+ /**
66
+ * Should start the sign message process and return
67
+ * the signed message.
68
+ *
69
+ * @param address - The address to sign the message
70
+ * @param message - The message to sign all text will be treated as text utf-8
71
+ *
72
+ * @returns Message signature
73
+ */
74
+ signMessage(_address: string, _message: string): Promise<string>;
75
+ /**
76
+ * Should start the send transaction process and return
77
+ * the transaction id submitted to the network.
78
+ *
79
+ * If the network is not available for the connection
80
+ * it should throw an error to avoid the transaction
81
+ * to be sent to the wrong network and lost.
82
+ *
83
+ * @param address - The address to sign the transaction
84
+ * @param transaction - The transaction to send
85
+ *
86
+ * @returns The transaction id
87
+ */
88
+ sendTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string>;
89
+ /**
90
+ * Should return the current account selected inside the connector, if the account
91
+ * is authorized for the connection.
92
+ *
93
+ * If the account is not authorized it should return null.
94
+ *
95
+ * @returns The current account selected otherwise null.
96
+ */
97
+ currentAccount(): Promise<string | null>;
98
+ /**
99
+ * Should add the the assets metadata to the connector and return true if the asset
100
+ * was added successfully.
101
+ *
102
+ * If the asset already exists it should throw an error.
103
+ *
104
+ * @emits assets
105
+ * @param assets - The assets to add the metadata to the connection.
106
+ * @throws Error if the asset already exists
107
+ * @returns True if the asset was added successfully
108
+ */
109
+ addAssets(_assets: Array<Asset>): Promise<boolean>;
110
+ /**
111
+ * Should add the the asset metadata to the connector and return true if the asset
112
+ * was added successfully.
113
+ *
114
+ * If the asset already exists it should throw an error.
115
+ *
116
+ * @emits assets
117
+ * @param asset - The asset to add the metadata to the connection.
118
+ * @throws Error if the asset already exists
119
+ * @returns True if the asset was added successfully
120
+ */
121
+ addAsset(_asset: Asset): Promise<boolean>;
122
+ /**
123
+ * Should return all the assets added to the connector. If a connection is already established.
124
+ *
125
+ * @returns Array of assets metadata from the connector vinculated to the all accounts from a specific Wallet.
126
+ */
127
+ assets(): Promise<Array<Asset>>;
128
+ /**
129
+ * Should start the add network process and return true if the network was added successfully.
130
+ *
131
+ * @emits networks
132
+ * @throws Error if the network already exists
133
+ * @param networkUrl - The URL of the network to be added.
134
+ * @returns Return true if the network was added successfully
135
+ */
136
+ addNetwork(_networkUrl: string): Promise<boolean>;
137
+ /**
138
+ * Should start the select network process and return true if the network has change successfully.
139
+ *
140
+ * @emits networks
141
+ * @throws Error if the network already exists
142
+ * @param network - The network to be selected.
143
+ * @returns Return true if the network was added successfully
144
+ */
145
+ selectNetwork(_network: Network): Promise<boolean>;
146
+ /**
147
+ * Should return all the networks available from the connector. If the connection is already established.
148
+ *
149
+ * @returns Return all the networks added to the connector.
150
+ */
151
+ networks(): Promise<Array<Network>>;
152
+ /**
153
+ * Should return the current network selected inside the connector. Even if the connection is not established.
154
+ *
155
+ * @returns Return the current network selected inside the connector.
156
+ */
157
+ currentNetwork(): Promise<Network>;
158
+ /**
159
+ * Should add the ABI to the connector and return true if the ABI was added successfully.
160
+ *
161
+ * @param contractId - The contract id to add the ABI.
162
+ * @param abi - The JSON ABI that represents a contract.
163
+ * @returns Return true if the ABI was added successfully.
164
+ */
165
+ addABI(_contractId: string, _abi: FuelABI): Promise<boolean>;
166
+ /**
167
+ * Should return the ABI from the connector vinculated to the all accounts from a specific Wallet.
168
+ *
169
+ * @param id - The contract id to get the ABI.
170
+ * @returns The ABI if it exists, otherwise return null.
171
+ */
172
+ getABI(_id: string): Promise<FuelABI | null>;
173
+ /**
174
+ * Should return true if the abi exists in the connector vinculated to the all accounts from a specific Wallet.
175
+ *
176
+ * @param id - The contract id to get the abi
177
+ * @returns Returns true if the abi exists or false if not.
178
+ */
179
+ hasABI(_id: string): Promise<boolean>;
180
+ /**
181
+ * Event listener for the connector.
182
+ *
183
+ * @param eventName - The event name to listen
184
+ * @param listener - The listener function
185
+ */
186
+ on<E extends FuelConnectorEvents['type'], D extends FuelEventArg<E>>(eventName: E, listener: (data: D) => void): this;
187
+ }
188
+ //# sourceMappingURL=fuel-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-connector.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACR,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,8BAAsB,aAAc,SAAQ,YAAY;IACtD,IAAI,EAAE,MAAM,CAAM;IAClB,QAAQ,EAAE,iBAAiB,CAA2B;IACtD,SAAS,EAAE,OAAO,CAAS;IAC3B,SAAS,EAAE,OAAO,CAAS;IAC3B,MAAM,iCAA2B;IAEjC;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAIrC;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAIxC;;;;;;;;OAQG;IACG,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;IAIjC;;;;;;OAMG;IACG,UAAU,IAAI,OAAO,CAAC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BAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EACjE,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAC1B,IAAI;CAIR"}
@@ -0,0 +1,133 @@
1
+ import type { AbstractAddress } from '@fuel-ts/interfaces';
2
+ import { Account } from '../account';
3
+ import { Provider } from '../providers';
4
+ import type { StorageAbstract } from '../wallet-manager';
5
+ import { FuelConnector } from './fuel-connector';
6
+ import type { Network, TargetObject } from './types';
7
+ export type FuelConfig = {
8
+ connectors?: Array<FuelConnector>;
9
+ storage?: StorageAbstract | null;
10
+ targetObject?: TargetObject;
11
+ };
12
+ export type FuelConnectorSelectOptions = {
13
+ emitEvents?: boolean;
14
+ };
15
+ export type Status = {
16
+ installed: boolean;
17
+ connected: boolean;
18
+ };
19
+ export declare class Fuel extends FuelConnector {
20
+ static STORAGE_KEY: string;
21
+ static defaultConfig: FuelConfig;
22
+ private _storage?;
23
+ private _connectors;
24
+ private _targetObject;
25
+ private _unsubscribes;
26
+ private _targetUnsubscribe;
27
+ private _pingCache;
28
+ private _currentConnector?;
29
+ constructor(config?: FuelConfig);
30
+ /**
31
+ * Return the target object to listen for global events.
32
+ */
33
+ private getTargetObject;
34
+ /**
35
+ * Return the storage used.
36
+ */
37
+ private getStorage;
38
+ /**
39
+ * Setup the default connector from the storage.
40
+ */
41
+ private setDefaultConnector;
42
+ /**
43
+ * Start listener for all the events of the current
44
+ * connector and emit them to the Fuel instance
45
+ */
46
+ private setupConnectorEvents;
47
+ /**
48
+ * Call method from the current connector.
49
+ */
50
+ private callMethod;
51
+ /**
52
+ * Create a method for each method proxy that is available on the Common interface
53
+ * and call the method from the current connector.
54
+ */
55
+ private setupMethods;
56
+ /**
57
+ * Fetch the status of a connector and set the installed and connected
58
+ * status.
59
+ */
60
+ private fetchConnectorStatus;
61
+ /**
62
+ * Fetch the status of all connectors and set the installed and connected
63
+ * status.
64
+ */
65
+ private fetchConnectorsStatus;
66
+ /**
67
+ * Fetch the status of a connector and set the installed and connected
68
+ * status. If no connector is provided it will ping the current connector.
69
+ */
70
+ private pingConnector;
71
+ /**
72
+ * Setup a listener for the FuelConnector event and add the connector
73
+ * to the list of new connectors.
74
+ */
75
+ private setupConnectorListener;
76
+ /**
77
+ * Add a new connector to the list of connectors.
78
+ */
79
+ private addConnector;
80
+ private triggerConnectorEvents;
81
+ /**
82
+ * Get a connector from the list of connectors.
83
+ */
84
+ getConnector: (connector: FuelConnector | string) => FuelConnector | null;
85
+ /**
86
+ * Return the list of connectors with the status of installed and connected.
87
+ */
88
+ connectors(): Promise<Array<FuelConnector>>;
89
+ /**
90
+ * Set the current connector to be used.
91
+ */
92
+ selectConnector(connectorName: string, options?: FuelConnectorSelectOptions): Promise<boolean>;
93
+ /**
94
+ * Return the current selected connector.
95
+ */
96
+ currentConnector(): FuelConnector | null | undefined;
97
+ /**
98
+ * Return true if any connector is available.
99
+ */
100
+ hasConnector(): Promise<boolean>;
101
+ hasWallet(): Promise<boolean>;
102
+ /**
103
+ * Return a Fuel Provider instance with extends features to work with
104
+ * connectors.
105
+ *
106
+ * @deprecated getProvider is deprecated and is going to be removed in the future, use getWallet instead.
107
+ */
108
+ getProvider(providerOrNetwork?: Provider | Network): Promise<Provider>;
109
+ /**
110
+ * Return a Fuel Provider instance with extends features to work with
111
+ * connectors.
112
+ */
113
+ private _getProvider;
114
+ /**
115
+ * Return a Fuel Wallet Locked instance with extends features to work with
116
+ * connectors.
117
+ */
118
+ getWallet(address: string | AbstractAddress, providerOrNetwork?: Provider | Network): Promise<Account>;
119
+ /**
120
+ * Remove all open listeners this is useful when you want to
121
+ * remove the Fuel instance and avoid memory leaks.
122
+ */
123
+ unsubscribe(): void;
124
+ /**
125
+ * Clean all the data from the storage.
126
+ */
127
+ clean(): Promise<void>;
128
+ /**
129
+ * Removes all listeners and cleans the storage.
130
+ */
131
+ destroy(): Promise<void>;
132
+ }
133
+ //# sour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@
1
+ export * from './fuel';
2
+ export * from './utils';
3
+ export * from './types';
4
+ export * from './fuel-connector';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type ConnectorMetadata = {
2
+ image?: string | {
3
+ light: string;
4
+ dark: string;
5
+ };
6
+ install: {
7
+ action: string;
8
+ link: string;
9
+ description: string;
10
+ };
11
+ };
12
+ //# sourceMappingURL=connector-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-metadata.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/connector-metadata.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EACF,MAAM,GACN;QACE,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACN,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC"}
@@ -0,0 +1,34 @@
1
+ export declare enum FuelConnectorMethods {
2
+ ping = "ping",
3
+ version = "version",
4
+ connect = "connect",
5
+ disconnect = "disconnect",
6
+ isConnected = "isConnected",
7
+ accounts = "accounts",
8
+ currentAccount = "currentAccount",
9
+ signMessage = "signMessage",
10
+ sendTransaction = "sendTransaction",
11
+ assets = "assets",
12
+ addAsset = "addAsset",
13
+ addAssets = "addAssets",
14
+ networks = "networks",
15
+ currentNetwork = "currentNetwork",
16
+ addNetwork = "addNetwork",
17
+ selectNetwork = "selectNetwork",
18
+ addABI = "addABI",
19
+ getABI = "getABI",
20
+ hasABI = "hasABI"
21
+ }
22
+ export declare enum FuelConnectorEventTypes {
23
+ connectors = "connectors",
24
+ currentConnector = "currentConnector",
25
+ connection = "connection",
26
+ accounts = "accounts",
27
+ currentAccount = "currentAccount",
28
+ networks = "networks",
29
+ currentNetwork = "currentNetwork",
30
+ assets = "assets",
31
+ abis = "abis"
32
+ }
33
+ export declare const FuelConnectorEventType = "FuelConnector";
34
+ //# sourceMappingURL=connector-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-types.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/connector-types.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAE9B,IAAI,SAAS;IACb,OAAO,YAAY;IAEnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAE3B,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IAEjC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IAEnC,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IAEvB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAE/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,uBAAuB;IACjC,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,sBAAsB,kBAAkB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import type { JsonAbi } from '@fuel-ts/abi-coder';
2
+ /**
3
+ * @name Version
4
+ */
5
+ export type Version = {
6
+ app: string;
7
+ /**
8
+ * Version selection this allow
9
+ * Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4
10
+ * Tilde Ranges ~1.2.3 ~1.2 ~1
11
+ * And Exact Versions 1.0.0
12
+ */
13
+ network: string;
14
+ };
15
+ /**
16
+ * @name Network
17
+ */
18
+ export type Network = {
19
+ /**
20
+ * The name of the network.
21
+ */
22
+ url: string;
23
+ /**
24
+ * The chain id of the network.
25
+ */
26
+ chainId: number;
27
+ };
28
+ /**
29
+ * ABI that represents a binary code interface from Sway.
30
+ *
31
+ * Read more at: https://docs.fuel.network/docs/specs/abi/json-abi-format/
32
+ */
33
+ export type FuelABI = JsonAbi;
34
+ //# sourceMappingURL=data-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-type.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/data-type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;OAKG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,OAAO,CAAC"}