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

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

Potentially problematic release.


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

Files changed (239) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +70 -0
  3. package/dist/account.d.ts +174 -0
  4. package/dist/account.d.ts.map +1 -0
  5. package/dist/base-wallet-unlocked.d.ts +73 -0
  6. package/dist/base-wallet-unlocked.d.ts.map +1 -0
  7. package/dist/configs.d.ts +2 -0
  8. package/dist/configs.d.ts.map +1 -0
  9. package/dist/configs.global.js +6 -0
  10. package/dist/configs.global.js.map +1 -0
  11. package/dist/configs.js +31 -0
  12. package/dist/configs.js.map +1 -0
  13. package/dist/configs.mjs +6 -0
  14. package/dist/configs.mjs.map +1 -0
  15. package/dist/connectors/default-connector.d.ts +7 -0
  16. package/dist/connectors/default-connector.d.ts.map +1 -0
  17. package/dist/connectors/fixtures/generate-accounts.d.ts +2 -0
  18. package/dist/connectors/fixtures/generate-accounts.d.ts.map +1 -0
  19. package/dist/connectors/fixtures/mocked-connector.d.ts +45 -0
  20. package/dist/connectors/fixtures/mocked-connector.d.ts.map +1 -0
  21. package/dist/connectors/fixtures/promise-callback.d.ts +7 -0
  22. package/dist/connectors/fixtures/promise-callback.d.ts.map +1 -0
  23. package/dist/connectors/fuel-connector.d.ts +187 -0
  24. package/dist/connectors/fuel-connector.d.ts.map +1 -0
  25. package/dist/connectors/fuel-wallet-connector.d.ts +54 -0
  26. package/dist/connectors/fuel-wallet-connector.d.ts.map +1 -0
  27. package/dist/connectors/fuel-wallet-development-connector.d.ts +7 -0
  28. package/dist/connectors/fuel-wallet-development-connector.d.ts.map +1 -0
  29. package/dist/connectors/fuel-wallet-locked.d.ts +13 -0
  30. package/dist/connectors/fuel-wallet-locked.d.ts.map +1 -0
  31. package/dist/connectors/fuel-wallet-provider.d.ts +14 -0
  32. package/dist/connectors/fuel-wallet-provider.d.ts.map +1 -0
  33. package/dist/connectors/fuel.d.ts +129 -0
  34. package/dist/connectors/fuel.d.ts.map +1 -0
  35. package/dist/connectors/fuelet-wallet-connector.d.ts +8 -0
  36. package/dist/connectors/fuelet-wallet-connector.d.ts.map +1 -0
  37. package/dist/connectors/types/abi.d.ts +9 -0
  38. package/dist/connectors/types/abi.d.ts.map +1 -0
  39. package/dist/connectors/types/account.d.ts +23 -0
  40. package/dist/connectors/types/account.d.ts.map +1 -0
  41. package/dist/connectors/types/asset.d.ts +16 -0
  42. package/dist/connectors/types/asset.d.ts.map +1 -0
  43. package/dist/connectors/types/coin.d.ts +6 -0
  44. package/dist/connectors/types/coin.d.ts.map +1 -0
  45. package/dist/connectors/types/connection.d.ts +7 -0
  46. package/dist/connectors/types/connection.d.ts.map +1 -0
  47. package/dist/connectors/types/connector-metadata.d.ts +12 -0
  48. package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
  49. package/dist/connectors/types/connector-types.d.ts +34 -0
  50. package/dist/connectors/types/connector-types.d.ts.map +1 -0
  51. package/dist/connectors/types/constants.d.ts +7 -0
  52. package/dist/connectors/types/constants.d.ts.map +1 -0
  53. package/dist/connectors/types/data-type.d.ts +46 -0
  54. package/dist/connectors/types/data-type.d.ts.map +1 -0
  55. package/dist/connectors/types/error.d.ts +18 -0
  56. package/dist/connectors/types/error.d.ts.map +1 -0
  57. package/dist/connectors/types/events.d.ts +150 -0
  58. package/dist/connectors/types/events.d.ts.map +1 -0
  59. package/dist/connectors/types/fuel-storage.d.ts +11 -0
  60. package/dist/connectors/types/fuel-storage.d.ts.map +1 -0
  61. package/dist/connectors/types/index.d.ts +15 -0
  62. package/dist/connectors/types/index.d.ts.map +1 -0
  63. package/dist/connectors/types/message.d.ts +15 -0
  64. package/dist/connectors/types/message.d.ts.map +1 -0
  65. package/dist/connectors/types/nertwork-data.d.ts +7 -0
  66. package/dist/connectors/types/nertwork-data.d.ts.map +1 -0
  67. package/dist/connectors/types/target-object.d.ts +14 -0
  68. package/dist/connectors/types/target-object.d.ts.map +1 -0
  69. package/dist/connectors/utils/cache.d.ts +14 -0
  70. package/dist/connectors/utils/cache.d.ts.map +1 -0
  71. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
  72. package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
  73. package/dist/connectors/utils/get-asset-by-chain.d.ts +3 -0
  74. package/dist/connectors/utils/get-asset-by-chain.d.ts.map +1 -0
  75. package/dist/connectors/utils/index.d.ts +5 -0
  76. package/dist/connectors/utils/index.d.ts.map +1 -0
  77. package/dist/connectors/utils/promises.d.ts +8 -0
  78. package/dist/connectors/utils/promises.d.ts.map +1 -0
  79. package/dist/hdwallet/hdwallet.d.ts +58 -0
  80. package/dist/hdwallet/hdwallet.d.ts.map +1 -0
  81. package/dist/hdwallet/index.d.ts +2 -0
  82. package/dist/hdwallet/index.d.ts.map +1 -0
  83. package/dist/index.d.ts +14 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.global.js +48673 -0
  86. package/dist/index.global.js.map +1 -0
  87. package/dist/index.js +8728 -0
  88. package/dist/index.js.map +1 -0
  89. package/dist/index.mjs +8642 -0
  90. package/dist/index.mjs.map +1 -0
  91. package/dist/keystore-wallet.d.ts +38 -0
  92. package/dist/keystore-wallet.d.ts.map +1 -0
  93. package/dist/mnemonic/index.d.ts +3 -0
  94. package/dist/mnemonic/index.d.ts.map +1 -0
  95. package/dist/mnemonic/mnemonic.d.ts +85 -0
  96. package/dist/mnemonic/mnemonic.d.ts.map +1 -0
  97. package/dist/mnemonic/utils.d.ts +8 -0
  98. package/dist/mnemonic/utils.d.ts.map +1 -0
  99. package/dist/predicate/index.d.ts +3 -0
  100. package/dist/predicate/index.d.ts.map +1 -0
  101. package/dist/predicate/predicate.d.ts +93 -0
  102. package/dist/predicate/predicate.d.ts.map +1 -0
  103. package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
  104. package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
  105. package/dist/predicate/utils/index.d.ts +2 -0
  106. package/dist/predicate/utils/index.d.ts.map +1 -0
  107. package/dist/providers/__generated__/operations.d.ts +3539 -0
  108. package/dist/providers/__generated__/operations.d.ts.map +1 -0
  109. package/dist/providers/coin-quantity.d.ts +21 -0
  110. package/dist/providers/coin-quantity.d.ts.map +1 -0
  111. package/dist/providers/coin.d.ts +15 -0
  112. package/dist/providers/coin.d.ts.map +1 -0
  113. package/dist/providers/fuel-graphql-subscriber.d.ts +13 -0
  114. package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
  115. package/dist/providers/index.d.ts +11 -0
  116. package/dist/providers/index.d.ts.map +1 -0
  117. package/dist/providers/memory-cache.d.ts +11 -0
  118. package/dist/providers/memory-cache.d.ts.map +1 -0
  119. package/dist/providers/message.d.ts +61 -0
  120. package/dist/providers/message.d.ts.map +1 -0
  121. package/dist/providers/provider.d.ts +500 -0
  122. package/dist/providers/provider.d.ts.map +1 -0
  123. package/dist/providers/resource.d.ts +37 -0
  124. package/dist/providers/resource.d.ts.map +1 -0
  125. package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
  126. package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
  127. package/dist/providers/transaction-request/errors.d.ts +25 -0
  128. package/dist/providers/transaction-request/errors.d.ts.map +1 -0
  129. package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
  130. package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
  131. package/dist/providers/transaction-request/index.d.ts +10 -0
  132. package/dist/providers/transaction-request/index.d.ts.map +1 -0
  133. package/dist/providers/transaction-request/input.d.ts +59 -0
  134. package/dist/providers/transaction-request/input.d.ts.map +1 -0
  135. package/dist/providers/transaction-request/output.d.ts +39 -0
  136. package/dist/providers/transaction-request/output.d.ts.map +1 -0
  137. package/dist/providers/transaction-request/script-transaction-request.d.ts +107 -0
  138. package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
  139. package/dist/providers/transaction-request/scripts.d.ts +6 -0
  140. package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
  141. package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
  142. package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
  143. package/dist/providers/transaction-request/transaction-request.d.ts +267 -0
  144. package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
  145. package/dist/providers/transaction-request/types.d.ts +10 -0
  146. package/dist/providers/transaction-request/types.d.ts.map +1 -0
  147. package/dist/providers/transaction-request/utils.d.ts +4 -0
  148. package/dist/providers/transaction-request/utils.d.ts.map +1 -0
  149. package/dist/providers/transaction-request/witness.d.ts +5 -0
  150. package/dist/providers/transaction-request/witness.d.ts.map +1 -0
  151. package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
  152. package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
  153. package/dist/providers/transaction-response/index.d.ts +3 -0
  154. package/dist/providers/transaction-response/index.d.ts.map +1 -0
  155. package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
  156. package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
  157. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
  158. package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
  159. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
  160. package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
  161. package/dist/providers/transaction-summary/call.d.ts +18 -0
  162. package/dist/providers/transaction-summary/call.d.ts.map +1 -0
  163. package/dist/providers/transaction-summary/date.d.ts +3 -0
  164. package/dist/providers/transaction-summary/date.d.ts.map +1 -0
  165. package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
  166. package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
  167. package/dist/providers/transaction-summary/index.d.ts +11 -0
  168. package/dist/providers/transaction-summary/index.d.ts.map +1 -0
  169. package/dist/providers/transaction-summary/input.d.ts +21 -0
  170. package/dist/providers/transaction-summary/input.d.ts.map +1 -0
  171. package/dist/providers/transaction-summary/operations.d.ts +42 -0
  172. package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
  173. package/dist/providers/transaction-summary/output.d.ts +15 -0
  174. package/dist/providers/transaction-summary/output.d.ts.map +1 -0
  175. package/dist/providers/transaction-summary/receipt.d.ts +7 -0
  176. package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
  177. package/dist/providers/transaction-summary/status.d.ts +9 -0
  178. package/dist/providers/transaction-summary/status.d.ts.map +1 -0
  179. package/dist/providers/transaction-summary/types.d.ts +147 -0
  180. package/dist/providers/transaction-summary/types.d.ts.map +1 -0
  181. package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
  182. package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
  183. package/dist/providers/utils/block-explorer.d.ts +14 -0
  184. package/dist/providers/utils/block-explorer.d.ts.map +1 -0
  185. package/dist/providers/utils/gas.d.ts +38 -0
  186. package/dist/providers/utils/gas.d.ts.map +1 -0
  187. package/dist/providers/utils/index.d.ts +7 -0
  188. package/dist/providers/utils/index.d.ts.map +1 -0
  189. package/dist/providers/utils/json.d.ts +7 -0
  190. package/dist/providers/utils/json.d.ts.map +1 -0
  191. package/dist/providers/utils/merge-quantities.d.ts +3 -0
  192. package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
  193. package/dist/providers/utils/receipts.d.ts +10 -0
  194. package/dist/providers/utils/receipts.d.ts.map +1 -0
  195. package/dist/providers/utils/sleep.d.ts +3 -0
  196. package/dist/providers/utils/sleep.d.ts.map +1 -0
  197. package/dist/providers/utils/time.d.ts +40 -0
  198. package/dist/providers/utils/time.d.ts.map +1 -0
  199. package/dist/signer/index.d.ts +2 -0
  200. package/dist/signer/index.d.ts.map +1 -0
  201. package/dist/signer/signer.d.ts +64 -0
  202. package/dist/signer/signer.d.ts.map +1 -0
  203. package/dist/test-utils/generateTestWallet.d.ts +4 -0
  204. package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
  205. package/dist/test-utils/launchNode.d.ts +54 -0
  206. package/dist/test-utils/launchNode.d.ts.map +1 -0
  207. package/dist/test-utils/seedTestWallet.d.ts +4 -0
  208. package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
  209. package/dist/test-utils.d.ts +4 -0
  210. package/dist/test-utils.d.ts.map +1 -0
  211. package/dist/test-utils.global.js +51455 -0
  212. package/dist/test-utils.global.js.map +1 -0
  213. package/dist/test-utils.js +7885 -0
  214. package/dist/test-utils.js.map +1 -0
  215. package/dist/test-utils.mjs +7890 -0
  216. package/dist/test-utils.mjs.map +1 -0
  217. package/dist/utils/formatTransferToContractScriptData.d.ts +15 -0
  218. package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
  219. package/dist/wallet-manager/index.d.ts +3 -0
  220. package/dist/wallet-manager/index.d.ts.map +1 -0
  221. package/dist/wallet-manager/storages/memory-storage.d.ts +10 -0
  222. package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
  223. package/dist/wallet-manager/types.d.ts +44 -0
  224. package/dist/wallet-manager/types.d.ts.map +1 -0
  225. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +33 -0
  226. package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
  227. package/dist/wallet-manager/vaults/privatekey-vault.d.ts +33 -0
  228. package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
  229. package/dist/wallet-manager/wallet-manager.d.ts +104 -0
  230. package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
  231. package/dist/wallet.d.ts +69 -0
  232. package/dist/wallet.d.ts.map +1 -0
  233. package/dist/wallets.d.ts +76 -0
  234. package/dist/wallets.d.ts.map +1 -0
  235. package/dist/wordlists/index.d.ts +5 -0
  236. package/dist/wordlists/index.d.ts.map +1 -0
  237. package/dist/wordlists/words/english.d.ts +2 -0
  238. package/dist/wordlists/words/english.d.ts.map +1 -0
  239. package/package.json +91 -0
@@ -0,0 +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,MAAM,EAAE,KAAK;IAItB,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC;IAI/B,UAAU,CAAC,QAAQ,EAAE,MAAM;IAW3B,aAAa,CAAC,QAAQ,EAAE,OAAO;IAK/B,QAAQ;IAIR,cAAc;IAId,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO;IAIzC,MAAM,CAAC,GAAG,EAAE,MAAM;IAIlB,MAAM,CAAC,GAAG,EAAE,MAAM;CAGzB"}
@@ -0,0 +1,7 @@
1
+ import type { Mock } from 'vitest';
2
+ import { type DeferPromise } from '../utils';
3
+ export type PromiseCallback = Mock & {
4
+ promise: DeferPromise;
5
+ };
6
+ export declare function promiseCallback(): PromiseCallback;
7
+ //# sourceMappingURL=promise-callback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"promise-callback.d.ts","sourceRoot":"","sources":["../../../src/connectors/fixtures/promise-callback.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG;IACnC,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,eAAe,oBAW9B"}
@@ -0,0 +1,187 @@
1
+ /// <reference types="node" />
2
+ import { EventEmitter } from 'events';
3
+ import type { TransactionRequestLike } from '../providers';
4
+ import { FuelConnectorEventTypes } from './types';
5
+ import type { FuelConnectorEvents, ConnectorMetadata, FuelABI, Network, FuelEventArg, Version, Asset } from './types';
6
+ /**
7
+ * @name FuelConnector
8
+ *
9
+ * Wallet Connector is a interface that represents a Wallet Connector and all the methods
10
+ * that should be implemented to be compatible with the Fuel SDK.
11
+ */
12
+ export declare abstract class FuelConnector extends EventEmitter {
13
+ name: string;
14
+ metadata: ConnectorMetadata;
15
+ connected: boolean;
16
+ installed: boolean;
17
+ events: typeof FuelConnectorEventTypes;
18
+ /**
19
+ * Should return true if the connector is loaded
20
+ * in less then one second.
21
+ *
22
+ * @returns Always true.
23
+ */
24
+ ping(): Promise<boolean>;
25
+ /**
26
+ * Should return the current version of the connector
27
+ * and the network version that is compatible.
28
+ *
29
+ * @returns boolean - connection status.
30
+ */
31
+ version(): Promise<Version>;
32
+ /**
33
+ * Should return true if the connector is connected
34
+ * to any of the accounts available.
35
+ *
36
+ * @returns The connection status.
37
+ */
38
+ isConnected(): Promise<boolean>;
39
+ /**
40
+ * Should return all the accounts authorized for the
41
+ * current connection.
42
+ *
43
+ * @returns The accounts addresses strings
44
+ */
45
+ accounts(): Promise<Array<string>>;
46
+ /**
47
+ * Should start the connection process and return
48
+ * true if the account authorize the connection.
49
+ *
50
+ * and return false if the user reject the connection.
51
+ *
52
+ * @emits accounts
53
+ * @returns boolean - connection status.
54
+ */
55
+ connect(): Promise<boolean>;
56
+ /**
57
+ * Should disconnect the current connection and
58
+ * return false if the disconnection was successful.
59
+ *
60
+ * @emits assets connection
61
+ * @returns The connection status.
62
+ */
63
+ disconnect(): Promise<boolean>;
64
+ /**
65
+ * Should start the sign message process and return
66
+ * the signed message.
67
+ *
68
+ * @param address - The address to sign the message
69
+ * @param message - The message to sign all text will be treated as text utf-8
70
+ *
71
+ * @returns Message signature
72
+ */
73
+ signMessage(_address: string, _message: string): Promise<string>;
74
+ /**
75
+ * Should start the send transaction process and return
76
+ * the transaction id submitted to the network.
77
+ *
78
+ * If the network is not available for the connection
79
+ * it should throw an error to avoid the transaction
80
+ * to be sent to the wrong network and lost.
81
+ *
82
+ * @param address - The address to sign the transaction
83
+ * @param transaction - The transaction to send
84
+ *
85
+ * @returns The transaction id
86
+ */
87
+ sendTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string>;
88
+ /**
89
+ * Should return the current account selected inside the connector, if the account
90
+ * is authorized for the connection.
91
+ *
92
+ * If the account is not authorized it should return null.
93
+ *
94
+ * @returns The current account selected otherwise null.
95
+ */
96
+ currentAccount(): Promise<string | null>;
97
+ /**
98
+ * Should add the the assets metadata to the connector and return true if the asset
99
+ * was added successfully.
100
+ *
101
+ * If the asset already exists it should throw an error.
102
+ *
103
+ * @emits assets
104
+ * @param assets - The assets to add the metadata to the connection.
105
+ * @throws Error if the asset already exists
106
+ * @returns True if the asset was added successfully
107
+ */
108
+ addAssets(_assets: Array<Asset>): Promise<boolean>;
109
+ /**
110
+ * Should add the the asset metadata to the connector and return true if the asset
111
+ * was added successfully.
112
+ *
113
+ * If the asset already exists it should throw an error.
114
+ *
115
+ * @emits assets
116
+ * @param asset - The asset to add the metadata to the connection.
117
+ * @throws Error if the asset already exists
118
+ * @returns True if the asset was added successfully
119
+ */
120
+ addAsset(_asset: Asset): Promise<boolean>;
121
+ /**
122
+ * Should return all the assets added to the connector. If a connection is already established.
123
+ *
124
+ * @returns Array of assets metadata from the connector vinculated to the all accounts from a specific Wallet.
125
+ */
126
+ assets(): Promise<Array<Asset>>;
127
+ /**
128
+ * Should start the add network process and return true if the network was added successfully.
129
+ *
130
+ * @emits networks
131
+ * @throws Error if the network already exists
132
+ * @param networkUrl - The URL of the network to be added.
133
+ * @returns Return true if the network was added successfully
134
+ */
135
+ addNetwork(_networkUrl: string): Promise<boolean>;
136
+ /**
137
+ * Should start the select network process and return true if the network has change successfully.
138
+ *
139
+ * @emits networks
140
+ * @throws Error if the network already exists
141
+ * @param network - The network to be selected.
142
+ * @returns Return true if the network was added successfully
143
+ */
144
+ selectNetwork(_network: Network): Promise<boolean>;
145
+ /**
146
+ * Should return all the networks available from the connector. If the connection is already established.
147
+ *
148
+ * @returns Return all the networks added to the connector.
149
+ */
150
+ networks(): Promise<Array<Network>>;
151
+ /**
152
+ * Should return the current network selected inside the connector. Even if the connection is not established.
153
+ *
154
+ * @returns Return the current network selected inside the connector.
155
+ */
156
+ currentNetwork(): Promise<Network>;
157
+ /**
158
+ * Should add the ABI to the connector and return true if the ABI was added successfully.
159
+ *
160
+ * @param contractId - The contract id to add the ABI.
161
+ * @param abi - The JSON ABI that represents a contract.
162
+ * @returns Return true if the ABI was added successfully.
163
+ */
164
+ addABI(_contractId: string, _abi: FuelABI): Promise<boolean>;
165
+ /**
166
+ * Should return the ABI from the connector vinculated to the all accounts from a specific Wallet.
167
+ *
168
+ * @param id - The contract id to get the ABI.
169
+ * @returns The ABI if it exists, otherwise return null.
170
+ */
171
+ getABI(_id: string): Promise<FuelABI | null>;
172
+ /**
173
+ * Should return true if the abi exists in the connector vinculated to the all accounts from a specific Wallet.
174
+ *
175
+ * @param id - The contract id to get the abi
176
+ * @returns Returns true if the abi exists or false if not.
177
+ */
178
+ hasABI(_id: string): Promise<boolean>;
179
+ /**
180
+ * Event listener for the connector.
181
+ *
182
+ * @param eventName - The event name to listen
183
+ * @param listener - The listener function
184
+ */
185
+ on<E extends FuelConnectorEvents['type'], D extends FuelEventArg<E>>(eventName: E, listener: (data: D) => void): this;
186
+ }
187
+ //# 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;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACP,KAAK,EACN,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,O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;;;;;;OAMG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlE;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAIlD;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3C;;;;;OAKG;IACH,EAAE,CAAC,CAAC,SAAS,mBAAmB,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,54 @@
1
+ import { JSONRPCClient } from 'json-rpc-2.0';
2
+ import { type TransactionRequestLike } from '../providers';
3
+ import { FuelConnector } from './fuel-connector';
4
+ import type { Asset, ConnectorMetadata, FuelABI, Network, Version } from './types';
5
+ import { FuelConnectorEventTypes } from './types';
6
+ export declare class FuelWalletConnector extends FuelConnector {
7
+ name: string;
8
+ connected: boolean;
9
+ installed: boolean;
10
+ events: typeof FuelConnectorEventTypes;
11
+ metadata: ConnectorMetadata;
12
+ readonly client: JSONRPCClient;
13
+ constructor(name?: string);
14
+ /**
15
+ * ============================================================
16
+ * Application communication methods
17
+ * ============================================================
18
+ */
19
+ private setupConnector;
20
+ private acceptMessage;
21
+ private setupListener;
22
+ private createRequestId;
23
+ private postMessage;
24
+ private sendRequest;
25
+ private onResponse;
26
+ private onEvent;
27
+ private onMessage;
28
+ private onCommunicationMessage;
29
+ /**
30
+ * ============================================================
31
+ * Connector methods
32
+ * ============================================================
33
+ */
34
+ ping(): Promise<boolean>;
35
+ isConnected(): Promise<boolean>;
36
+ connect(): Promise<boolean>;
37
+ disconnect(): Promise<boolean>;
38
+ accounts(): Promise<Array<string>>;
39
+ currentAccount(): Promise<string | null>;
40
+ signMessage(address: string, message: string): Promise<string>;
41
+ sendTransaction(address: string, transaction: TransactionRequestLike): Promise<string>;
42
+ assets(): Promise<Array<Asset>>;
43
+ addAsset(asset: Asset): Promise<boolean>;
44
+ addAssets(assets: Asset[]): Promise<boolean>;
45
+ addABI(contractId: string, abi: FuelABI): Promise<boolean>;
46
+ getABI(contractId: string): Promise<FuelABI>;
47
+ hasABI(contractId: string): Promise<boolean>;
48
+ currentNetwork(): Promise<Network>;
49
+ selectNetwork(_network: Network): Promise<boolean>;
50
+ networks(): Promise<Network[]>;
51
+ addNetwork(networkUrl: string): Promise<boolean>;
52
+ version(): Promise<Version>;
53
+ }
54
+ //# sourceMappingURL=fuel-wallet-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel-wallet-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-wallet-connector.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAmC,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE5F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EACV,KAAK,EAIL,iBAAiB,EAEjB,OAAO,EACP,OAAO,EAEP,OAAO,EACR,MAAM,SAAS,CAAC;AACjB,OAAO,EAIL,uBAAuB,EAExB,MAAM,SAAS,CAAC;AAIjB,qBAAa,mBAAoB,SAAQ,aAAa;IACpD,IAAI,EAAE,MAAM,CAAM;IAClB,SAAS,EAAE,OAAO,CAAS;IAC3B,SAAS,EAAE,OAAO,CAAS;IAC3B,MAAM,iCAA2B;IACjC,QAAQ,EAAE,iBAAiB,CAOzB;IAEF,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;gBAEnB,IAAI,GAAE,MAAsB;IAUxC;;;;OAIG;YACW,cAAc;IAY5B,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,e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AE,CAAC;IAI9B,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAchD,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;CAMlC"}
@@ -0,0 +1,7 @@
1
+ import { FuelWalletConnector } from './fuel-wallet-connector';
2
+ import type { ConnectorMetadata } from './types';
3
+ export declare class FuelWalletDevelopmentConnector extends FuelWalletConnector {
4
+ metadata: ConnectorMetadata;
5
+ constructor();
6
+ }
7
+ //# sourceMappingURL=fuel-wallet-development-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel-wallet-development-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-wallet-development-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,qBAAa,8BAA+B,SAAQ,mBAAmB;IACrE,QAAQ,EAAE,iBAAiB,CAOzB;;CAKH"}
@@ -0,0 +1,13 @@
1
+ import type { AbstractAddress } from '@fuel-ts/interfaces';
2
+ import type { TransactionRequestLike, TransactionResponse } from '../providers';
3
+ import { WalletLocked } from '../wallets';
4
+ import type { FuelConnector } from './fuel-connector';
5
+ import type { FuelWalletProvider } from './fuel-wallet-provider';
6
+ export declare class FuelWalletLocked extends WalletLocked {
7
+ connector: FuelConnector;
8
+ _provider: FuelWalletProvider;
9
+ constructor(address: string | AbstractAddress, connector: FuelConnector, provider: FuelWalletProvider);
10
+ signMessage(message: string): Promise<string>;
11
+ sendTransaction(transaction: TransactionRequestLike): Promise<TransactionResponse>;
12
+ }
13
+ //# sourceMappingURL=fuel-wallet-locked.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel-wallet-locked.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-wallet-locked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,qBAAa,gBAAiB,SAAQ,YAAY;IAChD,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,kBAAkB,CAAC;gBAG5B,OAAO,EAAE,MAAM,GAAG,eAAe,EACjC,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,kBAAkB;IAOxB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7C,eAAe,CAAC,WAAW,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAOzF"}
@@ -0,0 +1,14 @@
1
+ import type { ProviderOptions } from '../providers';
2
+ import { Provider, TransactionResponse } from '../providers';
3
+ /**
4
+ * TODO: We should add getTransactionResponse to TS-SDK in this way
5
+ * a provider becomes self contained enabling connectors to implement
6
+ * their on providers for customized responses.
7
+ *
8
+ * With the change we can remove the entire FuelWalletProvider.
9
+ */
10
+ export declare class FuelWalletProvider extends Provider {
11
+ static create(url: string, options?: ProviderOptions | undefined): Promise<FuelWalletProvider>;
12
+ getTransactionResponse(transactionId: string): Promise<TransactionResponse>;
13
+ }
14
+ //# sourceMappingURL=fuel-wallet-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuel-wallet-provider.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-wallet-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7D;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,QAAQ;WACjC,MAAM,CACjB,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,GACpC,OAAO,CAAC,kBAAkB,CAAC;IAOxB,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGlF"}
@@ -0,0 +1,129 @@
1
+ import type { AbstractAddress } from '@fuel-ts/interfaces';
2
+ import { FuelConnector } from './fuel-connector';
3
+ import { FuelWalletLocked } from './fuel-wallet-locked';
4
+ import { FuelWalletProvider } from './fuel-wallet-provider';
5
+ import type { Network, FuelStorage, TargetObject } from './types';
6
+ export type FuelConfig = {
7
+ connectors?: Array<FuelConnector>;
8
+ storage?: FuelStorage | null;
9
+ targetObject?: TargetObject;
10
+ devMode?: boolean;
11
+ };
12
+ export type FuelConnectorSelectOptions = {
13
+ emitEvents?: boolean;
14
+ };
15
+ export declare class Fuel extends FuelConnector {
16
+ static STORAGE_KEY: string;
17
+ static defaultConfig: FuelConfig;
18
+ private _storage?;
19
+ private _connectors;
20
+ private _targetObject;
21
+ private _unsubscribes;
22
+ private _targetUnsubscribe;
23
+ private _pingCache;
24
+ private _currentConnector?;
25
+ constructor(config?: FuelConfig);
26
+ /**
27
+ * Return the target object to listen for global events.
28
+ */
29
+ private getTargetObject;
30
+ /**
31
+ * Return the storage used.
32
+ */
33
+ private getStorage;
34
+ /**
35
+ * Setup the default connector from the storage.
36
+ */
37
+ private setDefaultConnector;
38
+ /**
39
+ * Start listener for all the events of the current
40
+ * connector and emit them to the Fuel instance
41
+ */
42
+ private setupConnectorEvents;
43
+ /**
44
+ * Call method from the current connector.
45
+ */
46
+ private callMethod;
47
+ /**
48
+ * Create a method for each method proxy that is available on the Common interface
49
+ * and call the method from the current connector.
50
+ */
51
+ private setupMethods;
52
+ /**
53
+ * Fetch the status of a connector and set the installed and connected
54
+ * status.
55
+ */
56
+ private fetchConnectorStatus;
57
+ /**
58
+ * Fetch the status of all connectors and set the installed and connected
59
+ * status.
60
+ */
61
+ private fetchConnectorsStatus;
62
+ /**
63
+ * Fetch the status of a connector and set the installed and connected
64
+ * status. If no connector is provided it will ping the current connector.
65
+ */
66
+ private pingConnector;
67
+ /**
68
+ * Setup a listener for the FuelConnector event and add the connector
69
+ * to the list of new connectors.
70
+ */
71
+ private setupConnectorListener;
72
+ /**
73
+ * Add a new connector to the list of connectors.
74
+ */
75
+ private addConnector;
76
+ private triggerConnectorEvents;
77
+ /**
78
+ * Get a connector from the list of connectors.
79
+ */
80
+ getConnector: (connector: FuelConnector | string) => FuelConnector | null;
81
+ /**
82
+ * Return the list of connectors with the status of installed and connected.
83
+ */
84
+ connectors(): Promise<Array<FuelConnector>>;
85
+ /**
86
+ * Set the current connector to be used.
87
+ */
88
+ selectConnector(connectorName: string, options?: FuelConnectorSelectOptions): Promise<boolean>;
89
+ /**
90
+ * Return the current selected connector.
91
+ */
92
+ currentConnector(): FuelConnector | null | undefined;
93
+ /**
94
+ * Return true if any connector is available.
95
+ */
96
+ hasConnector(): Promise<boolean>;
97
+ hasWallet(): Promise<boolean>;
98
+ /**
99
+ * Return a Fuel Provider instance with extends features to work with
100
+ * connectors.
101
+ *
102
+ * @deprecated Provider is going to be deprecated in the future.
103
+ */
104
+ getProvider(providerOrNetwork?: FuelWalletProvider | Network): Promise<FuelWalletProvider>;
105
+ /**
106
+ * Return a Fuel Provider instance with extends features to work with
107
+ * connectors.
108
+ */
109
+ private _getProvider;
110
+ /**
111
+ * Return a Fuel Wallet Locked instance with extends features to work with
112
+ * connectors.
113
+ */
114
+ getWallet(address: string | AbstractAddress, providerOrNetwork?: FuelWalletProvider | Network): Promise<FuelWalletLocked>;
115
+ /**
116
+ * Remove all open listeners this is useful when you want to
117
+ * remove the Fuel instance and avoid memory leaks.
118
+ */
119
+ unsubscribe(): void;
120
+ /**
121
+ * Clean all the data from the storage.
122
+ */
123
+ clean(): void;
124
+ /**
125
+ * Removes all listeners and cleans the storage.
126
+ */
127
+ destroy():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;IACH,OAAO,CAAC,oBAAoB;IAa5B;;OAEG;YACW,UAAU;IAexB;;;OAGG;IACH,OAAO,CAAC,YAAY;IAMpB;;;OAGG;YACW,oBAAoB;IAuBlC;;;OAGG;YACW,qBAAqB;IAMnC;;;OAGG;YACW,aAAa;IAkB3B;;;OAGG;IACH,OAAO,CAAC,sBAAsB,CAoB5B;IAEF;;OAEG;IACH,OAAO,CAAC,YAAY,CAelB;IAEF,OAAO,CAAC,sBAAsB,CAiB5B;IAEF;;OAEG;IACH,YAAY,cAAe,aAAa,GAAG,MAAM,KAAG,aAAa,GAAG,IAAI,CAI3D;IAEb;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAKjD;;OAEG;IACG,eAAe,CACnB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,0BAER,GACA,OAAO,CAAC,OAAO,CAAC;IA0BnB;;OAEG;IACH,gBAAgB;IAIhB;;OAEG;IACG,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;IAoBhC,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC;IAInC;;;;;OAKG;IACG,WAAW,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,GAAG,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAUhG;;;OAGG;YACW,YAAY;IAuB1B;;;OAGG;IACG,SAAS,CACb,OAAO,EAAE,MAAM,GAAG,eAAe,EACjC,iBAAiB,CAAC,EAAE,kBAAkB,GAAG,OAAO,GAC/C,OAAO,CAAC,gBAAgB,CAAC;IAK5B;;;OAGG;IACH,WAAW;IAQX;;OAEG;IACH,KAAK;IAIL;;OAEG;IACH,OAAO;CAIR"}
@@ -0,0 +1,8 @@
1
+ import { FuelWalletConnector } from './fuel-wallet-connector';
2
+ import type { ConnectorMetadata } from './types';
3
+ export declare class FueletWalletConnector extends FuelWalletConnector {
4
+ name: string;
5
+ metadata: ConnectorMetadata;
6
+ constructor();
7
+ }
8
+ //# sourceMappingURL=fuelet-wallet-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fuelet-wallet-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/fuelet-wallet-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,qBAAa,qBAAsB,SAAQ,mBAAmB;IAC5D,IAAI,SAAmB;IACvB,QAAQ,EAAE,iBAAiB,CAUzB;;CAKH"}
@@ -0,0 +1,9 @@
1
+ import type { JsonAbi } from '@fuel-ts/abi-coder';
2
+ export type AbiMap = {
3
+ [key: string]: JsonAbi;
4
+ };
5
+ export type AbiTable = {
6
+ contractId: string;
7
+ abi: JsonAbi;
8
+ };
9
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/abi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,OAAO,CAAC;CACd,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { BN } from '@fuel-ts/math';
2
+ import type { BigNumberish } from 'ethers';
3
+ import type { Coin } from '../../providers';
4
+ export type Vault = {
5
+ key: string;
6
+ data: string;
7
+ };
8
+ export type Account = {
9
+ name: string;
10
+ address: string;
11
+ vaultId?: number;
12
+ publicKey: string;
13
+ isHidden?: boolean;
14
+ balance?: BigNumberish | BN;
15
+ balanceSymbol?: string;
16
+ balances?: Coin[];
17
+ isCurrent?: boolean;
18
+ };
19
+ export declare enum AddressType {
20
+ contract = 0,
21
+ account = 1
22
+ }
23
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,MAAM,KAAK,GAAG;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,GAAG,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,WAAW;IACrB,QAAQ,IAAA;IACR,OAAO,IAAA;CACR"}
@@ -0,0 +1,16 @@
1
+ import type { BNInput } from '@fuel-ts/math';
2
+ export type { Asset, Fuel as AssetFuel, Ethereum as AssetEthereum } from '@fuels/assets';
3
+ export type AssetData = {
4
+ name?: string;
5
+ assetId: string;
6
+ imageUrl?: string;
7
+ symbol?: string;
8
+ decimals?: number;
9
+ isCustom?: boolean;
10
+ chainId?: number;
11
+ network?: string;
12
+ };
13
+ export type AssetAmount = AssetData & {
14
+ amount?: BNInput;
15
+ };
16
+ //# sourceMappingURL=asset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/asset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,YAAY,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAEzF,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { BNInput } from '@fuel-ts/math';
2
+ export type Coin = {
3
+ assetId: string;
4
+ amount?: BNInput;
5
+ };
6
+ //# sourceMappingURL=coin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coin.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/coin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,MAAM,IAAI,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export type Connection = {
2
+ origin: string;
3
+ title?: string;
4
+ favIconUrl?: string;
5
+ accounts: Array<string>;
6
+ };
7
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/connection.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,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,7 @@
1
+ export declare const CONNECTOR_SCRIPT = "FuelConnectorScript";
2
+ export declare const CONTENT_SCRIPT_NAME = "FuelContentScript";
3
+ export declare const BACKGROUND_SCRIPT_NAME = "FuelBackgroundScript";
4
+ export declare const POPUP_SCRIPT_NAME = "FuelPopUpScript";
5
+ export declare const VAULT_SCRIPT_NAME = "FuelVaultScript";
6
+ export declare const EVENT_MESSAGE = "message";
7
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AACtD,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AACvD,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAC7D,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AACnD,eAAO,MAAM,iBAAiB,oBAAoB,CAAC;AACnD,eAAO,MAAM,aAAa,YAAY,CAAC"}