@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.
- package/LICENSE +201 -0
- package/README.md +70 -0
- package/dist/account.d.ts +174 -0
- package/dist/account.d.ts.map +1 -0
- package/dist/base-wallet-unlocked.d.ts +73 -0
- package/dist/base-wallet-unlocked.d.ts.map +1 -0
- package/dist/configs.d.ts +2 -0
- package/dist/configs.d.ts.map +1 -0
- package/dist/configs.global.js +6 -0
- package/dist/configs.global.js.map +1 -0
- package/dist/configs.js +31 -0
- package/dist/configs.js.map +1 -0
- package/dist/configs.mjs +6 -0
- package/dist/configs.mjs.map +1 -0
- package/dist/connectors/default-connector.d.ts +7 -0
- package/dist/connectors/default-connector.d.ts.map +1 -0
- package/dist/connectors/fixtures/generate-accounts.d.ts +2 -0
- package/dist/connectors/fixtures/generate-accounts.d.ts.map +1 -0
- package/dist/connectors/fixtures/mocked-connector.d.ts +45 -0
- package/dist/connectors/fixtures/mocked-connector.d.ts.map +1 -0
- package/dist/connectors/fixtures/promise-callback.d.ts +7 -0
- package/dist/connectors/fixtures/promise-callback.d.ts.map +1 -0
- package/dist/connectors/fuel-connector.d.ts +187 -0
- package/dist/connectors/fuel-connector.d.ts.map +1 -0
- package/dist/connectors/fuel-wallet-connector.d.ts +54 -0
- package/dist/connectors/fuel-wallet-connector.d.ts.map +1 -0
- package/dist/connectors/fuel-wallet-development-connector.d.ts +7 -0
- package/dist/connectors/fuel-wallet-development-connector.d.ts.map +1 -0
- package/dist/connectors/fuel-wallet-locked.d.ts +13 -0
- package/dist/connectors/fuel-wallet-locked.d.ts.map +1 -0
- package/dist/connectors/fuel-wallet-provider.d.ts +14 -0
- package/dist/connectors/fuel-wallet-provider.d.ts.map +1 -0
- package/dist/connectors/fuel.d.ts +129 -0
- package/dist/connectors/fuel.d.ts.map +1 -0
- package/dist/connectors/fuelet-wallet-connector.d.ts +8 -0
- package/dist/connectors/fuelet-wallet-connector.d.ts.map +1 -0
- package/dist/connectors/types/abi.d.ts +9 -0
- package/dist/connectors/types/abi.d.ts.map +1 -0
- package/dist/connectors/types/account.d.ts +23 -0
- package/dist/connectors/types/account.d.ts.map +1 -0
- package/dist/connectors/types/asset.d.ts +16 -0
- package/dist/connectors/types/asset.d.ts.map +1 -0
- package/dist/connectors/types/coin.d.ts +6 -0
- package/dist/connectors/types/coin.d.ts.map +1 -0
- package/dist/connectors/types/connection.d.ts +7 -0
- package/dist/connectors/types/connection.d.ts.map +1 -0
- package/dist/connectors/types/connector-metadata.d.ts +12 -0
- package/dist/connectors/types/connector-metadata.d.ts.map +1 -0
- package/dist/connectors/types/connector-types.d.ts +34 -0
- package/dist/connectors/types/connector-types.d.ts.map +1 -0
- package/dist/connectors/types/constants.d.ts +7 -0
- package/dist/connectors/types/constants.d.ts.map +1 -0
- package/dist/connectors/types/data-type.d.ts +46 -0
- package/dist/connectors/types/data-type.d.ts.map +1 -0
- package/dist/connectors/types/error.d.ts +18 -0
- package/dist/connectors/types/error.d.ts.map +1 -0
- package/dist/connectors/types/events.d.ts +150 -0
- package/dist/connectors/types/events.d.ts.map +1 -0
- package/dist/connectors/types/fuel-storage.d.ts +11 -0
- package/dist/connectors/types/fuel-storage.d.ts.map +1 -0
- package/dist/connectors/types/index.d.ts +15 -0
- package/dist/connectors/types/index.d.ts.map +1 -0
- package/dist/connectors/types/message.d.ts +15 -0
- package/dist/connectors/types/message.d.ts.map +1 -0
- package/dist/connectors/types/nertwork-data.d.ts +7 -0
- package/dist/connectors/types/nertwork-data.d.ts.map +1 -0
- package/dist/connectors/types/target-object.d.ts +14 -0
- package/dist/connectors/types/target-object.d.ts.map +1 -0
- package/dist/connectors/utils/cache.d.ts +14 -0
- package/dist/connectors/utils/cache.d.ts.map +1 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts +7 -0
- package/dist/connectors/utils/dispatch-fuel-connector-event.d.ts.map +1 -0
- package/dist/connectors/utils/get-asset-by-chain.d.ts +3 -0
- package/dist/connectors/utils/get-asset-by-chain.d.ts.map +1 -0
- package/dist/connectors/utils/index.d.ts +5 -0
- package/dist/connectors/utils/index.d.ts.map +1 -0
- package/dist/connectors/utils/promises.d.ts +8 -0
- package/dist/connectors/utils/promises.d.ts.map +1 -0
- package/dist/hdwallet/hdwallet.d.ts +58 -0
- package/dist/hdwallet/hdwallet.d.ts.map +1 -0
- package/dist/hdwallet/index.d.ts +2 -0
- package/dist/hdwallet/index.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +48673 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +8728 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +8642 -0
- package/dist/index.mjs.map +1 -0
- package/dist/keystore-wallet.d.ts +38 -0
- package/dist/keystore-wallet.d.ts.map +1 -0
- package/dist/mnemonic/index.d.ts +3 -0
- package/dist/mnemonic/index.d.ts.map +1 -0
- package/dist/mnemonic/mnemonic.d.ts +85 -0
- package/dist/mnemonic/mnemonic.d.ts.map +1 -0
- package/dist/mnemonic/utils.d.ts +8 -0
- package/dist/mnemonic/utils.d.ts.map +1 -0
- package/dist/predicate/index.d.ts +3 -0
- package/dist/predicate/index.d.ts.map +1 -0
- package/dist/predicate/predicate.d.ts +93 -0
- package/dist/predicate/predicate.d.ts.map +1 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts +12 -0
- package/dist/predicate/utils/getPredicateRoot.d.ts.map +1 -0
- package/dist/predicate/utils/index.d.ts +2 -0
- package/dist/predicate/utils/index.d.ts.map +1 -0
- package/dist/providers/__generated__/operations.d.ts +3539 -0
- package/dist/providers/__generated__/operations.d.ts.map +1 -0
- package/dist/providers/coin-quantity.d.ts +21 -0
- package/dist/providers/coin-quantity.d.ts.map +1 -0
- package/dist/providers/coin.d.ts +15 -0
- package/dist/providers/coin.d.ts.map +1 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts +13 -0
- package/dist/providers/fuel-graphql-subscriber.d.ts.map +1 -0
- package/dist/providers/index.d.ts +11 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/memory-cache.d.ts +11 -0
- package/dist/providers/memory-cache.d.ts.map +1 -0
- package/dist/providers/message.d.ts +61 -0
- package/dist/providers/message.d.ts.map +1 -0
- package/dist/providers/provider.d.ts +500 -0
- package/dist/providers/provider.d.ts.map +1 -0
- package/dist/providers/resource.d.ts +37 -0
- package/dist/providers/resource.d.ts.map +1 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts +73 -0
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/errors.d.ts +25 -0
- package/dist/providers/transaction-request/errors.d.ts.map +1 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts +9 -0
- package/dist/providers/transaction-request/hash-transaction.d.ts.map +1 -0
- package/dist/providers/transaction-request/index.d.ts +10 -0
- package/dist/providers/transaction-request/index.d.ts.map +1 -0
- package/dist/providers/transaction-request/input.d.ts +59 -0
- package/dist/providers/transaction-request/input.d.ts.map +1 -0
- package/dist/providers/transaction-request/output.d.ts +39 -0
- package/dist/providers/transaction-request/output.d.ts.map +1 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts +107 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/scripts.d.ts +6 -0
- package/dist/providers/transaction-request/scripts.d.ts.map +1 -0
- package/dist/providers/transaction-request/storage-slot.d.ts +10 -0
- package/dist/providers/transaction-request/storage-slot.d.ts.map +1 -0
- package/dist/providers/transaction-request/transaction-request.d.ts +267 -0
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -0
- package/dist/providers/transaction-request/types.d.ts +10 -0
- package/dist/providers/transaction-request/types.d.ts.map +1 -0
- package/dist/providers/transaction-request/utils.d.ts +4 -0
- package/dist/providers/transaction-request/utils.d.ts.map +1 -0
- package/dist/providers/transaction-request/witness.d.ts +5 -0
- package/dist/providers/transaction-request/witness.d.ts.map +1 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts +5 -0
- package/dist/providers/transaction-response/getDecodedLogs.d.ts.map +1 -0
- package/dist/providers/transaction-response/index.d.ts +3 -0
- package/dist/providers/transaction-response/index.d.ts.map +1 -0
- package/dist/providers/transaction-response/transaction-response.d.ts +106 -0
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +20 -0
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts +21 -0
- package/dist/providers/transaction-summary/calculate-transaction-fee.d.ts.map +1 -0
- package/dist/providers/transaction-summary/call.d.ts +18 -0
- package/dist/providers/transaction-summary/call.d.ts.map +1 -0
- package/dist/providers/transaction-summary/date.d.ts +3 -0
- package/dist/providers/transaction-summary/date.d.ts.map +1 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts +31 -0
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -0
- package/dist/providers/transaction-summary/index.d.ts +11 -0
- package/dist/providers/transaction-summary/index.d.ts.map +1 -0
- package/dist/providers/transaction-summary/input.d.ts +21 -0
- package/dist/providers/transaction-summary/input.d.ts.map +1 -0
- package/dist/providers/transaction-summary/operations.d.ts +42 -0
- package/dist/providers/transaction-summary/operations.d.ts.map +1 -0
- package/dist/providers/transaction-summary/output.d.ts +15 -0
- package/dist/providers/transaction-summary/output.d.ts.map +1 -0
- package/dist/providers/transaction-summary/receipt.d.ts +7 -0
- package/dist/providers/transaction-summary/receipt.d.ts.map +1 -0
- package/dist/providers/transaction-summary/status.d.ts +9 -0
- package/dist/providers/transaction-summary/status.d.ts.map +1 -0
- package/dist/providers/transaction-summary/types.d.ts +147 -0
- package/dist/providers/transaction-summary/types.d.ts.map +1 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts +36 -0
- package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -0
- package/dist/providers/utils/block-explorer.d.ts +14 -0
- package/dist/providers/utils/block-explorer.d.ts.map +1 -0
- package/dist/providers/utils/gas.d.ts +38 -0
- package/dist/providers/utils/gas.d.ts.map +1 -0
- package/dist/providers/utils/index.d.ts +7 -0
- package/dist/providers/utils/index.d.ts.map +1 -0
- package/dist/providers/utils/json.d.ts +7 -0
- package/dist/providers/utils/json.d.ts.map +1 -0
- package/dist/providers/utils/merge-quantities.d.ts +3 -0
- package/dist/providers/utils/merge-quantities.d.ts.map +1 -0
- package/dist/providers/utils/receipts.d.ts +10 -0
- package/dist/providers/utils/receipts.d.ts.map +1 -0
- package/dist/providers/utils/sleep.d.ts +3 -0
- package/dist/providers/utils/sleep.d.ts.map +1 -0
- package/dist/providers/utils/time.d.ts +40 -0
- package/dist/providers/utils/time.d.ts.map +1 -0
- package/dist/signer/index.d.ts +2 -0
- package/dist/signer/index.d.ts.map +1 -0
- package/dist/signer/signer.d.ts +64 -0
- package/dist/signer/signer.d.ts.map +1 -0
- package/dist/test-utils/generateTestWallet.d.ts +4 -0
- package/dist/test-utils/generateTestWallet.d.ts.map +1 -0
- package/dist/test-utils/launchNode.d.ts +54 -0
- package/dist/test-utils/launchNode.d.ts.map +1 -0
- package/dist/test-utils/seedTestWallet.d.ts +4 -0
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -0
- package/dist/test-utils.d.ts +4 -0
- package/dist/test-utils.d.ts.map +1 -0
- package/dist/test-utils.global.js +51455 -0
- package/dist/test-utils.global.js.map +1 -0
- package/dist/test-utils.js +7885 -0
- package/dist/test-utils.js.map +1 -0
- package/dist/test-utils.mjs +7890 -0
- package/dist/test-utils.mjs.map +1 -0
- package/dist/utils/formatTransferToContractScriptData.d.ts +15 -0
- package/dist/utils/formatTransferToContractScriptData.d.ts.map +1 -0
- package/dist/wallet-manager/index.d.ts +3 -0
- package/dist/wallet-manager/index.d.ts.map +1 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts +10 -0
- package/dist/wallet-manager/storages/memory-storage.d.ts.map +1 -0
- package/dist/wallet-manager/types.d.ts +44 -0
- package/dist/wallet-manager/types.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts +33 -0
- package/dist/wallet-manager/vaults/mnemonic-vault.d.ts.map +1 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts +33 -0
- package/dist/wallet-manager/vaults/privatekey-vault.d.ts.map +1 -0
- package/dist/wallet-manager/wallet-manager.d.ts +104 -0
- package/dist/wallet-manager/wallet-manager.d.ts.map +1 -0
- package/dist/wallet.d.ts +69 -0
- package/dist/wallet.d.ts.map +1 -0
- package/dist/wallets.d.ts +76 -0
- package/dist/wallets.d.ts.map +1 -0
- package/dist/wordlists/index.d.ts +5 -0
- package/dist/wordlists/index.d.ts.map +1 -0
- package/dist/wordlists/words/english.d.ts +2 -0
- package/dist/wordlists/words/english.d.ts.map +1 -0
- package/package.json +91 -0
package/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
# `@fuel-ts/wallet`
|
2
|
+
|
3
|
+
**@fuel-ts/wallet** is a sub-module for interacting with **Fuel**.
|
4
|
+
|
5
|
+
This module contains the class to manage a private key and signing for a standard Externally Owned Account (EOA)
|
6
|
+
|
7
|
+
# Table of contents
|
8
|
+
|
9
|
+
- [Documentation](#documentation)
|
10
|
+
- [Usage](#usage)
|
11
|
+
- [Installation](#installation)
|
12
|
+
- [Full SDK Installation](#full-sdk-installation)
|
13
|
+
- [Contributing](#contributing)
|
14
|
+
- [Changelog](#changelog)
|
15
|
+
- [License](#license)
|
16
|
+
|
17
|
+
## Documentation
|
18
|
+
|
19
|
+
See [Fuels-ts Documentation](https://docs.fuel.network/docs/fuels-ts/wallets/)
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Installation
|
24
|
+
|
25
|
+
```sh
|
26
|
+
pnpm add @fuel-ts/wallet
|
27
|
+
# or
|
28
|
+
npm add @fuel-ts/wallet
|
29
|
+
```
|
30
|
+
|
31
|
+
### Full SDK Installation
|
32
|
+
|
33
|
+
Alternatively, we recommend you install the [complete SDK](https://github.com/FuelLabs/fuels-ts) using the umbrella package:
|
34
|
+
|
35
|
+
```sh
|
36
|
+
pnpm add fuels
|
37
|
+
# or
|
38
|
+
npm add fuels
|
39
|
+
```
|
40
|
+
|
41
|
+
# Test Utilities
|
42
|
+
|
43
|
+
These test utilities are exported to assist in testing apps using Fuels.
|
44
|
+
|
45
|
+
```ts
|
46
|
+
import { bn } from "@fuel-ts/math";
|
47
|
+
import { BaseAssetId } from "fuels";
|
48
|
+
import { seedTestWallet, generateTestWallet } from "@account/test-utils";
|
49
|
+
|
50
|
+
const provider = await Provider.create("http://127.0.0.1:4000/graphql");
|
51
|
+
|
52
|
+
// seeding
|
53
|
+
const wallet = Wallet.fromPrivateKey("0x...", provider);
|
54
|
+
seedTestWallet(wallet, [{ assetId: BaseAssetId, amount: bn(100_000) }]);
|
55
|
+
|
56
|
+
// generating
|
57
|
+
const wallet = await generateTestWallet(provider, [[1_000, BaseAssetId]]);
|
58
|
+
```
|
59
|
+
|
60
|
+
## Contributing
|
61
|
+
|
62
|
+
In order to contribute to `@fuel-ts/wallet`, please see the main [fuels-ts](https://github.com/FuelLabs/fuels-ts) monorepo.
|
63
|
+
|
64
|
+
## Changelog
|
65
|
+
|
66
|
+
The `@fuel-ts/wallet` changelog can be found at [CHANGELOG](./CHANGELOG.md).
|
67
|
+
|
68
|
+
## License
|
69
|
+
|
70
|
+
The primary license for `@fuel-ts/wallet` is `Apache 2.0`, see [LICENSE](./LICENSE).
|
@@ -0,0 +1,174 @@
|
|
1
|
+
import { AbstractAccount } from '@fuel-ts/interfaces';
|
2
|
+
import type { AbstractAddress } from '@fuel-ts/interfaces';
|
3
|
+
import type { BigNumberish, BN } from '@fuel-ts/math';
|
4
|
+
import type { BytesLike } from 'ethers';
|
5
|
+
import type { TransactionRequestLike, CallResult, TransactionRequest, Coin, CoinQuantityLike, CoinQuantity, Message, Resource, ExcludeResourcesOption, TransactionResponse, Provider, ScriptTransactionRequestLike, ProviderSendTxParams } 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
|
+
/**
|
20
|
+
* Creates a new Account instance.
|
21
|
+
*
|
22
|
+
* @param address - The address of the account.
|
23
|
+
* @param provider - A Provider instance (optional).
|
24
|
+
*/
|
25
|
+
constructor(address: string | AbstractAddress, provider?: Provider);
|
26
|
+
/**
|
27
|
+
* The provider used to interact with the network.
|
28
|
+
*
|
29
|
+
* @returns A Provider instance.
|
30
|
+
*
|
31
|
+
* @throws `FuelError` if the provider is not set.
|
32
|
+
*/
|
33
|
+
get provider(): Provider;
|
34
|
+
/**
|
35
|
+
* Sets the provider for the account.
|
36
|
+
*
|
37
|
+
* @param provider - A Provider instance.
|
38
|
+
*/
|
39
|
+
set provider(provider: Provider);
|
40
|
+
/**
|
41
|
+
* Changes the provider connection for the account.
|
42
|
+
*
|
43
|
+
* @param provider - A Provider instance.
|
44
|
+
* @returns The updated Provider instance.
|
45
|
+
*/
|
46
|
+
connect(provider: Provider): Provider;
|
47
|
+
/**
|
48
|
+
* Retrieves resources satisfying the spend query for the account.
|
49
|
+
*
|
50
|
+
* @param quantities - IDs of coins to exclude.
|
51
|
+
* @param excludedIds - IDs of resources to be excluded from the query.
|
52
|
+
* @returns A promise that resolves to an array of Resources.
|
53
|
+
*/
|
54
|
+
getResourcesToSpend(quantities: CoinQuantityLike[] /** IDs of coins to exclude */, excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
|
55
|
+
/**
|
56
|
+
* Retrieves coins owned by the account.
|
57
|
+
*
|
58
|
+
* @param assetId - The asset ID of the coins to retrieve.
|
59
|
+
* @returns A promise that resolves to an array of Coins.
|
60
|
+
*/
|
61
|
+
getCoins(assetId?: BytesLike): Promise<Coin[]>;
|
62
|
+
/**
|
63
|
+
* Retrieves messages owned by the account.
|
64
|
+
*
|
65
|
+
* @returns A promise that resolves to an array of Messages.
|
66
|
+
*/
|
67
|
+
getMessages(): Promise<Message[]>;
|
68
|
+
/**
|
69
|
+
* Retrieves the balance of the account for the given asset.
|
70
|
+
*
|
71
|
+
* @param assetId - The asset ID to check the balance for.
|
72
|
+
* @returns A promise that resolves to the balance amount.
|
73
|
+
*/
|
74
|
+
getBalance(assetId?: BytesLike): Promise<BN>;
|
75
|
+
/**
|
76
|
+
* Retrieves all the balances for the account.
|
77
|
+
*
|
78
|
+
* @returns A promise that resolves to an array of Coins and their quantities.
|
79
|
+
*/
|
80
|
+
getBalances(): Promise<CoinQuantity[]>;
|
81
|
+
/**
|
82
|
+
* Adds resources to the transaction enough to fund it.
|
83
|
+
*
|
84
|
+
* @param request - The transaction request.
|
85
|
+
* @param coinQuantities - The coin quantities required to execute the transaction.
|
86
|
+
* @param fee - The estimated transaction fee.
|
87
|
+
* @returns A promise that resolves when the resources are added to the transaction.
|
88
|
+
*/
|
89
|
+
fund<T extends TransactionRequest>(request: T, coinQuantities: CoinQuantity[], fee: BN): Promise<void>;
|
90
|
+
/**
|
91
|
+
* A helper that creates a transfer transaction request and returns it.
|
92
|
+
*
|
93
|
+
* @param destination - The address of the destination.
|
94
|
+
* @param amount - The amount of coins to transfer.
|
95
|
+
* @param assetId - The asset ID of the coins to transfer.
|
96
|
+
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
97
|
+
* @returns A promise that resolves to the prepared transaction request.
|
98
|
+
*/
|
99
|
+
createTransfer(
|
100
|
+
/** Address of the destination */
|
101
|
+
destination: string | AbstractAddress,
|
102
|
+
/** Amount of coins */
|
103
|
+
amount: BigNumberish,
|
104
|
+
/** Asset ID of coins */
|
105
|
+
assetId?: BytesLike,
|
106
|
+
/** Tx Params */
|
107
|
+
txParams?: TxParamsType): Promise<TransactionRequest>;
|
108
|
+
/**
|
109
|
+
* Transfers coins to a destination address.
|
110
|
+
*
|
111
|
+
* @param destination - The address of the destination.
|
112
|
+
* @param amount - The amount of coins to transfer.
|
113
|
+
* @param assetId - The asset ID of the coins to transfer.
|
114
|
+
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
115
|
+
* @returns A promise that resolves to the transaction response.
|
116
|
+
*/
|
117
|
+
transfer(
|
118
|
+
/** Address of the destination */
|
119
|
+
destination: string | AbstractAddress,
|
120
|
+
/** Amount of coins */
|
121
|
+
amount: BigNumberish,
|
122
|
+
/** Asset ID of coins */
|
123
|
+
assetId?: BytesLike,
|
124
|
+
/** Tx Params */
|
125
|
+
txParams?: TxParamsType): Promise<TransactionResponse>;
|
126
|
+
/**
|
127
|
+
* Transfers coins to a contract address.
|
128
|
+
*
|
129
|
+
* @param contractId - The address of the contract.
|
130
|
+
* @param amount - The amount of coins to transfer.
|
131
|
+
* @param assetId - The asset ID of the coins to transfer.
|
132
|
+
* @param txParams - The optional transaction parameters.
|
133
|
+
* @returns A promise that resolves to the transaction response.
|
134
|
+
*/
|
135
|
+
transferToContract(
|
136
|
+
/** Contract address */
|
137
|
+
contractId: string | AbstractAddress,
|
138
|
+
/** Amount of coins */
|
139
|
+
amount: BigNumberish,
|
140
|
+
/** Asset ID of coins */
|
141
|
+
assetId?: BytesLike,
|
142
|
+
/** Tx Params */
|
143
|
+
txParams?: TxParamsType): Promise<TransactionResponse>;
|
144
|
+
/**
|
145
|
+
* Withdraws an amount of the base asset to the base chain.
|
146
|
+
*
|
147
|
+
* @param recipient - Address of the recipient on the base chain.
|
148
|
+
* @param amount - Amount of base asset.
|
149
|
+
* @param txParams - The optional transaction parameters.
|
150
|
+
* @returns A promise that resolves to the transaction response.
|
151
|
+
*/
|
152
|
+
withdrawToBaseLayer(
|
153
|
+
/** Address of the recipient on the base chain */
|
154
|
+
recipient: string | AbstractAddress,
|
155
|
+
/** Amount of base asset */
|
156
|
+
amount: BigNumberish,
|
157
|
+
/** Tx Params */
|
158
|
+
txParams?: TxParamsType): Promise<TransactionResponse>;
|
159
|
+
/**
|
160
|
+
* Sends a transaction to the network.
|
161
|
+
*
|
162
|
+
* @param transactionRequestLike - The transaction request to be sent.
|
163
|
+
* @returns A promise that resolves to the transaction response.
|
164
|
+
*/
|
165
|
+
sendTransaction(transactionRequestLike: TransactionRequestLike, options?: Pick<ProviderSendTxParams, 'awaitExecution'>): Promise<TransactionResponse>;
|
166
|
+
/**
|
167
|
+
* Simulates a transaction.
|
168
|
+
*
|
169
|
+
* @param transactionRequestLike - The transaction request to be simulated.
|
170
|
+
* @returns A promise that resolves to the call result.
|
171
|
+
*/
|
172
|
+
simulateTransaction(transactionRequestLike: TransactionRequestLike): Promise<CallResult>;
|
173
|
+
}
|
174
|
+
//# sourceMappingURL=account.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,73 @@
|
|
1
|
+
import type { BytesLike } from 'ethers';
|
2
|
+
import { Account } from './account';
|
3
|
+
import type { TransactionResponse, TransactionRequestLike, CallResult, Provider, ProviderSendTxParams } from './providers';
|
4
|
+
import { Signer } from './signer';
|
5
|
+
/**
|
6
|
+
* `BaseWalletUnlocked` provides the base functionalities for an unlocked wallet.
|
7
|
+
*/
|
8
|
+
export declare class BaseWalletUnlocked extends Account {
|
9
|
+
/**
|
10
|
+
* Default HDWallet path.
|
11
|
+
*/
|
12
|
+
static defaultPath: string;
|
13
|
+
/**
|
14
|
+
* A function that returns the wallet's signer.
|
15
|
+
*/
|
16
|
+
signer: () => Signer;
|
17
|
+
/**
|
18
|
+
* Creates a new BaseWalletUnlocked instance.
|
19
|
+
*
|
20
|
+
* @param privateKey - The private key of the wallet.
|
21
|
+
* @param provider - A Provider instance (optional).
|
22
|
+
*/
|
23
|
+
constructor(privateKey: BytesLike, provider?: Provider);
|
24
|
+
/**
|
25
|
+
* Gets the private key of the wallet.
|
26
|
+
*
|
27
|
+
* @returns The private key of the wallet.
|
28
|
+
*/
|
29
|
+
get privateKey(): string;
|
30
|
+
/**
|
31
|
+
* Gets the public key of the wallet.
|
32
|
+
*
|
33
|
+
* @returns
|
34
|
+
*/
|
35
|
+
get publicKey(): string;
|
36
|
+
/**
|
37
|
+
* Signs a message with the wallet's private key.
|
38
|
+
*
|
39
|
+
* @param message - The message to sign.
|
40
|
+
* @returns A promise that resolves to the signature as a ECDSA 64 bytes string.
|
41
|
+
*/
|
42
|
+
signMessage(message: string): Promise<string>;
|
43
|
+
/**
|
44
|
+
* Signs a transaction with the wallet's private key.
|
45
|
+
*
|
46
|
+
* @param transactionRequestLike - The transaction request to sign.
|
47
|
+
* @returns A promise that resolves to the signature as a ECDSA 64 bytes string.
|
48
|
+
*/
|
49
|
+
signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string>;
|
50
|
+
/**
|
51
|
+
* Populates a transaction with the witnesses signature.
|
52
|
+
*
|
53
|
+
* @param transactionRequestLike - The transaction request to populate.
|
54
|
+
* @returns The populated transaction request.
|
55
|
+
*/
|
56
|
+
populateTransactionWitnessesSignature(transactionRequestLike: TransactionRequestLike): Promise<import("./providers").TransactionRequest>;
|
57
|
+
/**
|
58
|
+
* Populates the witness signature for a transaction and sends it to the network using `provider.sendTransaction`.
|
59
|
+
*
|
60
|
+
* @param transactionRequestLike - The transaction request to send.
|
61
|
+
* @returns A promise that resolves to the TransactionResponse object.
|
62
|
+
*/
|
63
|
+
sendTransaction(transactionRequestLike: TransactionRequestLike, options?: Pick<ProviderSendTxParams, 'awaitExecution'>): Promise<TransactionResponse>;
|
64
|
+
/**
|
65
|
+
* Populates the witness signature for a transaction and sends a call to the network using `provider.call`.
|
66
|
+
*
|
67
|
+
* @param transactionRequestLike - The transaction request to simulate.
|
68
|
+
* @returns A promise that resolves to the CallResult object.
|
69
|
+
*/
|
70
|
+
simulateTransaction(transactionRequestLike: TransactionRequestLike): Promise<CallResult>;
|
71
|
+
encrypt(password: string): Promise<string>;
|
72
|
+
}
|
73
|
+
//# sourceMappingURL=base-wallet-unlocked.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base-wallet-unlocked.d.ts","sourceRoot":"","sources":["../src/base-wallet-unlocked.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,QAAQ,EACR,oBAAoB,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO;IAC7C;;OAEG;IACH,MAAM,CAAC,WAAW,SAA8B;IAEhD;;OAEG;IACH,MAAM,EAAE,MAAM,MAAM,CAAC;IAErB;;;;;OAKG;gBACS,UAAU,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,QAAQ;IAMtD;;;;OAIG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD;;;;;OAKG;IACG,eAAe,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC;IAStF;;;;;OAKG;IACG,qCAAqC,CAAC,sBAAsB,EAAE,sBAAsB;IAS1F;;;;;OAKG;IACG,eAAe,CACnB,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,GACrD,OAAO,CAAC,mBAAmB,CAAC;IAS/B;;;;;OAKG;IACG,mBAAmB,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;IAYxF,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGjD"}
|
@@ -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 @@
|
|
1
|
+
{"version":3,"sources":["../src/configs.ts"],"sourcesContent":["export const FUEL_NETWORK_URL =\n typeof process !== 'undefined'\n ? process?.env?.FUEL_NETWORK_URL || 'http://127.0.0.1:4000/graphql'\n : 'http://127.0.0.1:4000/graphql';\n"],"mappings":";;;AAAO,MAAM,mBACX,OAAO,YAAY,cACf,SAAS,KAAK,oBAAoB,kCAClC;","names":[]}
|
package/dist/configs.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __defProp = Object.defineProperty;
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
6
|
+
var __export = (target, all) => {
|
7
|
+
for (var name in all)
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
9
|
+
};
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
12
|
+
for (let key of __getOwnPropNames(from))
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
15
|
+
}
|
16
|
+
return to;
|
17
|
+
};
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
|
+
|
20
|
+
// src/configs.ts
|
21
|
+
var configs_exports = {};
|
22
|
+
__export(configs_exports, {
|
23
|
+
FUEL_NETWORK_URL: () => FUEL_NETWORK_URL
|
24
|
+
});
|
25
|
+
module.exports = __toCommonJS(configs_exports);
|
26
|
+
var FUEL_NETWORK_URL = typeof process !== "undefined" ? process?.env?.FUEL_NETWORK_URL || "http://127.0.0.1:4000/graphql" : "http://127.0.0.1:4000/graphql";
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
28
|
+
0 && (module.exports = {
|
29
|
+
FUEL_NETWORK_URL
|
30
|
+
});
|
31
|
+
//# sourceMappingURL=configs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/configs.ts"],"sourcesContent":["export const FUEL_NETWORK_URL =\n typeof process !== 'undefined'\n ? process?.env?.FUEL_NETWORK_URL || 'http://127.0.0.1:4000/graphql'\n : 'http://127.0.0.1:4000/graphql';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,mBACX,OAAO,YAAY,cACf,SAAS,KAAK,oBAAoB,kCAClC;","names":[]}
|
package/dist/configs.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/configs.ts"],"sourcesContent":["export const FUEL_NETWORK_URL =\n typeof process !== 'undefined'\n ? process?.env?.FUEL_NETWORK_URL || 'http://127.0.0.1:4000/graphql'\n : 'http://127.0.0.1:4000/graphql';\n"],"mappings":";AAAO,IAAM,mBACX,OAAO,YAAY,cACf,SAAS,KAAK,oBAAoB,kCAClC;","names":[]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { FuelWalletConnector } from './fuel-wallet-connector';
|
2
|
+
type DefaultConnectors = {
|
3
|
+
devMode?: boolean;
|
4
|
+
};
|
5
|
+
export declare function defaultConnectors({ devMode }?: DefaultConnectors): FuelWalletConnector[];
|
6
|
+
export {};
|
7
|
+
//# sourceMappingURL=default-connector.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"default-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/default-connector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAI9D,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,GAAE,iBAAsB,yBAMpE"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"generate-accounts.d.ts","sourceRoot":"","sources":["../../../src/connectors/fixtures/generate-accounts.ts"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,YAE7C"}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import type { TransactionRequestLike } from '../../providers';
|
2
|
+
import type { WalletUnlocked } from '../../wallets';
|
3
|
+
import { FuelConnector } from '../fuel-connector';
|
4
|
+
import type { Asset, FuelABI, ConnectorMetadata, Network } from '../types';
|
5
|
+
type MockConnectorOptions = {
|
6
|
+
name?: string;
|
7
|
+
accounts?: Array<string>;
|
8
|
+
networks?: Array<Network>;
|
9
|
+
wallets?: Array<WalletUnlocked>;
|
10
|
+
pingDelay?: number;
|
11
|
+
metadata?: Partial<ConnectorMetadata>;
|
12
|
+
};
|
13
|
+
export declare class MockConnector extends FuelConnector {
|
14
|
+
_accounts: Array<string>;
|
15
|
+
_networks: Array<Network>;
|
16
|
+
_wallets: Array<WalletUnlocked>;
|
17
|
+
_pingDelay: number;
|
18
|
+
name: string;
|
19
|
+
metadata: ConnectorMetadata;
|
20
|
+
constructor(options?: MockConnectorOptions);
|
21
|
+
ping(): Promise<boolean>;
|
22
|
+
version(): Promise<{
|
23
|
+
app: string;
|
24
|
+
network: string;
|
25
|
+
}>;
|
26
|
+
isConnected(): Promise<boolean>;
|
27
|
+
accounts(): Promise<string[]>;
|
28
|
+
connect(): Promise<boolean>;
|
29
|
+
disconnect(): Promise<boolean>;
|
30
|
+
signMessage(_address: string, _message: string): Promise<string>;
|
31
|
+
sendTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string>;
|
32
|
+
currentAccount(): Promise<string>;
|
33
|
+
assets(): Promise<never[]>;
|
34
|
+
addAsset(_asset: Asset): Promise<boolean>;
|
35
|
+
addAssets(_assets: Array<Asset>): Promise<boolean>;
|
36
|
+
addNetwork(_network: string): Promise<boolean>;
|
37
|
+
selectNetwork(_network: Network): Promise<boolean>;
|
38
|
+
networks(): Promise<Network[]>;
|
39
|
+
currentNetwork(): Promise<Network>;
|
40
|
+
addABI(_contractId: string, _abi: FuelABI): Promise<boolean>;
|
41
|
+
getABI(_id: string): Promise<null>;
|
42
|
+
hasABI(_id: string): Promise<boolean>;
|
43
|
+
}
|
44
|
+
export {};
|
45
|
+
//# sourceMappingURL=mocked-connector.d.ts.map
|