@fuel-ts/account 0.84.0 → 0.85.0
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/dist/account.d.ts +6 -6
- package/dist/account.d.ts.map +1 -1
- package/dist/index.global.js +188 -146
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +271 -224
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -143
- package/dist/index.mjs.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +346 -552
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/assets/assets.d.ts +9 -0
- package/dist/providers/assets/assets.d.ts.map +1 -0
- package/dist/providers/assets/index.d.ts +1 -2
- package/dist/providers/assets/index.d.ts.map +1 -1
- package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts +2 -0
- package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts.map +1 -0
- package/dist/providers/assets/utils/index.d.ts +1 -0
- package/dist/providers/assets/utils/index.d.ts.map +1 -1
- package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +5 -9
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-summary/receipt.d.ts +2 -2
- package/dist/providers/transaction-summary/receipt.d.ts.map +1 -1
- package/dist/providers/transaction-summary/types.d.ts +5 -13
- package/dist/providers/transaction-summary/types.d.ts.map +1 -1
- package/dist/providers/utils/extract-tx-error.d.ts +2 -2
- package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
- package/dist/providers/utils/gas.d.ts.map +1 -1
- package/dist/providers/utils/receipts.d.ts +2 -2
- package/dist/providers/utils/receipts.d.ts.map +1 -1
- package/dist/test-utils.global.js +210 -146
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +283 -218
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +208 -143
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +15 -15
package/dist/index.mjs
CHANGED
@@ -88,7 +88,7 @@ import { clone as clone3 } from "ramda";
|
|
88
88
|
|
89
89
|
// src/providers/__generated__/operations.ts
|
90
90
|
import gql from "graphql-tag";
|
91
|
-
var
|
91
|
+
var TransactionStatusSubscriptionFragmentDoc = gql`
|
92
92
|
fragment transactionStatusSubscriptionFragment on TransactionStatus {
|
93
93
|
type: __typename
|
94
94
|
... on SqueezedOutStatus {
|
@@ -96,7 +96,13 @@ var TransactionStatusSubscriptionFragmentFragmentDoc = gql`
|
|
96
96
|
}
|
97
97
|
}
|
98
98
|
`;
|
99
|
-
var
|
99
|
+
var SubmittedStatusFragmentDoc = gql`
|
100
|
+
fragment SubmittedStatusFragment on SubmittedStatus {
|
101
|
+
type: __typename
|
102
|
+
time
|
103
|
+
}
|
104
|
+
`;
|
105
|
+
var ReceiptFragmentDoc = gql`
|
100
106
|
fragment receiptFragment on Receipt {
|
101
107
|
id
|
102
108
|
pc
|
@@ -128,45 +134,65 @@ var ReceiptFragmentFragmentDoc = gql`
|
|
128
134
|
subId
|
129
135
|
}
|
130
136
|
`;
|
131
|
-
var
|
132
|
-
fragment
|
137
|
+
var SuccessStatusFragmentDoc = gql`
|
138
|
+
fragment SuccessStatusFragment on SuccessStatus {
|
139
|
+
type: __typename
|
140
|
+
block {
|
141
|
+
id
|
142
|
+
}
|
143
|
+
time
|
144
|
+
programState {
|
145
|
+
returnType
|
146
|
+
data
|
147
|
+
}
|
148
|
+
receipts {
|
149
|
+
...receiptFragment
|
150
|
+
}
|
151
|
+
totalGas
|
152
|
+
totalFee
|
153
|
+
}
|
154
|
+
${ReceiptFragmentDoc}`;
|
155
|
+
var FailureStatusFragmentDoc = gql`
|
156
|
+
fragment FailureStatusFragment on FailureStatus {
|
157
|
+
type: __typename
|
158
|
+
block {
|
159
|
+
id
|
160
|
+
}
|
161
|
+
totalGas
|
162
|
+
totalFee
|
163
|
+
time
|
164
|
+
reason
|
165
|
+
receipts {
|
166
|
+
...receiptFragment
|
167
|
+
}
|
168
|
+
}
|
169
|
+
${ReceiptFragmentDoc}`;
|
170
|
+
var SqueezedOutStatusFragmentDoc = gql`
|
171
|
+
fragment SqueezedOutStatusFragment on SqueezedOutStatus {
|
133
172
|
type: __typename
|
173
|
+
reason
|
174
|
+
}
|
175
|
+
`;
|
176
|
+
var TransactionStatusFragmentDoc = gql`
|
177
|
+
fragment transactionStatusFragment on TransactionStatus {
|
134
178
|
... on SubmittedStatus {
|
135
|
-
|
179
|
+
...SubmittedStatusFragment
|
136
180
|
}
|
137
181
|
... on SuccessStatus {
|
138
|
-
|
139
|
-
id
|
140
|
-
}
|
141
|
-
time
|
142
|
-
programState {
|
143
|
-
returnType
|
144
|
-
data
|
145
|
-
}
|
146
|
-
receipts {
|
147
|
-
...receiptFragment
|
148
|
-
}
|
149
|
-
totalGas
|
150
|
-
totalFee
|
182
|
+
...SuccessStatusFragment
|
151
183
|
}
|
152
184
|
... on FailureStatus {
|
153
|
-
|
154
|
-
id
|
155
|
-
}
|
156
|
-
totalGas
|
157
|
-
totalFee
|
158
|
-
time
|
159
|
-
reason
|
160
|
-
receipts {
|
161
|
-
...receiptFragment
|
162
|
-
}
|
185
|
+
...FailureStatusFragment
|
163
186
|
}
|
164
187
|
... on SqueezedOutStatus {
|
165
|
-
|
188
|
+
...SqueezedOutStatusFragment
|
166
189
|
}
|
167
190
|
}
|
168
|
-
${
|
169
|
-
|
191
|
+
${SubmittedStatusFragmentDoc}
|
192
|
+
${SuccessStatusFragmentDoc}
|
193
|
+
${FailureStatusFragmentDoc}
|
194
|
+
${SqueezedOutStatusFragmentDoc}`;
|
195
|
+
var TransactionFragmentDoc = gql`
|
170
196
|
fragment transactionFragment on Transaction {
|
171
197
|
id
|
172
198
|
rawPayload
|
@@ -174,8 +200,8 @@ var TransactionFragmentFragmentDoc = gql`
|
|
174
200
|
...transactionStatusFragment
|
175
201
|
}
|
176
202
|
}
|
177
|
-
${
|
178
|
-
var
|
203
|
+
${TransactionStatusFragmentDoc}`;
|
204
|
+
var InputEstimatePredicatesFragmentDoc = gql`
|
179
205
|
fragment inputEstimatePredicatesFragment on Input {
|
180
206
|
... on InputCoin {
|
181
207
|
predicateGasUsed
|
@@ -185,14 +211,14 @@ var InputEstimatePredicatesFragmentFragmentDoc = gql`
|
|
185
211
|
}
|
186
212
|
}
|
187
213
|
`;
|
188
|
-
var
|
214
|
+
var TransactionEstimatePredicatesFragmentDoc = gql`
|
189
215
|
fragment transactionEstimatePredicatesFragment on Transaction {
|
190
216
|
inputs {
|
191
217
|
...inputEstimatePredicatesFragment
|
192
218
|
}
|
193
219
|
}
|
194
|
-
${
|
195
|
-
var
|
220
|
+
${InputEstimatePredicatesFragmentDoc}`;
|
221
|
+
var DryRunFailureStatusFragmentDoc = gql`
|
196
222
|
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
197
223
|
totalGas
|
198
224
|
totalFee
|
@@ -203,7 +229,7 @@ var DryRunFailureStatusFragmentFragmentDoc = gql`
|
|
203
229
|
}
|
204
230
|
}
|
205
231
|
`;
|
206
|
-
var
|
232
|
+
var DryRunSuccessStatusFragmentDoc = gql`
|
207
233
|
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
208
234
|
totalGas
|
209
235
|
totalFee
|
@@ -213,7 +239,7 @@ var DryRunSuccessStatusFragmentFragmentDoc = gql`
|
|
213
239
|
}
|
214
240
|
}
|
215
241
|
`;
|
216
|
-
var
|
242
|
+
var DryRunTransactionStatusFragmentDoc = gql`
|
217
243
|
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
218
244
|
... on DryRunFailureStatus {
|
219
245
|
...dryRunFailureStatusFragment
|
@@ -222,9 +248,9 @@ var DryRunTransactionStatusFragmentFragmentDoc = gql`
|
|
222
248
|
...dryRunSuccessStatusFragment
|
223
249
|
}
|
224
250
|
}
|
225
|
-
${
|
226
|
-
${
|
227
|
-
var
|
251
|
+
${DryRunFailureStatusFragmentDoc}
|
252
|
+
${DryRunSuccessStatusFragmentDoc}`;
|
253
|
+
var DryRunTransactionExecutionStatusFragmentDoc = gql`
|
228
254
|
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
229
255
|
id
|
230
256
|
status {
|
@@ -234,11 +260,11 @@ var DryRunTransactionExecutionStatusFragmentFragmentDoc = gql`
|
|
234
260
|
...receiptFragment
|
235
261
|
}
|
236
262
|
}
|
237
|
-
${
|
238
|
-
${
|
239
|
-
var
|
263
|
+
${DryRunTransactionStatusFragmentDoc}
|
264
|
+
${ReceiptFragmentDoc}`;
|
265
|
+
var CoinFragmentDoc = gql`
|
240
266
|
fragment coinFragment on Coin {
|
241
|
-
__typename
|
267
|
+
type: __typename
|
242
268
|
utxoId
|
243
269
|
owner
|
244
270
|
amount
|
@@ -247,9 +273,9 @@ var CoinFragmentFragmentDoc = gql`
|
|
247
273
|
txCreatedIdx
|
248
274
|
}
|
249
275
|
`;
|
250
|
-
var
|
276
|
+
var MessageCoinFragmentDoc = gql`
|
251
277
|
fragment messageCoinFragment on MessageCoin {
|
252
|
-
__typename
|
278
|
+
type: __typename
|
253
279
|
sender
|
254
280
|
recipient
|
255
281
|
nonce
|
@@ -258,7 +284,7 @@ var MessageCoinFragmentFragmentDoc = gql`
|
|
258
284
|
daHeight
|
259
285
|
}
|
260
286
|
`;
|
261
|
-
var
|
287
|
+
var MessageFragmentDoc = gql`
|
262
288
|
fragment messageFragment on Message {
|
263
289
|
amount
|
264
290
|
sender
|
@@ -268,7 +294,7 @@ var MessageFragmentFragmentDoc = gql`
|
|
268
294
|
daHeight
|
269
295
|
}
|
270
296
|
`;
|
271
|
-
var
|
297
|
+
var MessageProofFragmentDoc = gql`
|
272
298
|
fragment messageProofFragment on MessageProof {
|
273
299
|
messageProof {
|
274
300
|
proofSet
|
@@ -315,14 +341,14 @@ var MessageProofFragmentFragmentDoc = gql`
|
|
315
341
|
data
|
316
342
|
}
|
317
343
|
`;
|
318
|
-
var
|
344
|
+
var BalanceFragmentDoc = gql`
|
319
345
|
fragment balanceFragment on Balance {
|
320
346
|
owner
|
321
347
|
amount
|
322
348
|
assetId
|
323
349
|
}
|
324
350
|
`;
|
325
|
-
var
|
351
|
+
var BlockFragmentDoc = gql`
|
326
352
|
fragment blockFragment on Block {
|
327
353
|
id
|
328
354
|
height
|
@@ -334,7 +360,7 @@ var BlockFragmentFragmentDoc = gql`
|
|
334
360
|
}
|
335
361
|
}
|
336
362
|
`;
|
337
|
-
var
|
363
|
+
var TxParametersFragmentDoc = gql`
|
338
364
|
fragment TxParametersFragment on TxParameters {
|
339
365
|
version
|
340
366
|
maxInputs
|
@@ -345,7 +371,7 @@ var TxParametersFragmentFragmentDoc = gql`
|
|
345
371
|
maxBytecodeSubsections
|
346
372
|
}
|
347
373
|
`;
|
348
|
-
var
|
374
|
+
var PredicateParametersFragmentDoc = gql`
|
349
375
|
fragment PredicateParametersFragment on PredicateParameters {
|
350
376
|
version
|
351
377
|
maxPredicateLength
|
@@ -354,41 +380,42 @@ var PredicateParametersFragmentFragmentDoc = gql`
|
|
354
380
|
maxMessageDataLength
|
355
381
|
}
|
356
382
|
`;
|
357
|
-
var
|
383
|
+
var ScriptParametersFragmentDoc = gql`
|
358
384
|
fragment ScriptParametersFragment on ScriptParameters {
|
359
385
|
version
|
360
386
|
maxScriptLength
|
361
387
|
maxScriptDataLength
|
362
388
|
}
|
363
389
|
`;
|
364
|
-
var
|
390
|
+
var ContractParametersFragmentDoc = gql`
|
365
391
|
fragment ContractParametersFragment on ContractParameters {
|
366
392
|
version
|
367
393
|
contractMaxSize
|
368
394
|
maxStorageSlots
|
369
395
|
}
|
370
396
|
`;
|
371
|
-
var
|
397
|
+
var FeeParametersFragmentDoc = gql`
|
372
398
|
fragment FeeParametersFragment on FeeParameters {
|
373
399
|
version
|
374
400
|
gasPriceFactor
|
375
401
|
gasPerByte
|
376
402
|
}
|
377
403
|
`;
|
378
|
-
var
|
404
|
+
var DependentCostFragmentDoc = gql`
|
379
405
|
fragment DependentCostFragment on DependentCost {
|
380
|
-
__typename
|
381
406
|
... on LightOperation {
|
407
|
+
type: __typename
|
382
408
|
base
|
383
409
|
unitsPerGas
|
384
410
|
}
|
385
411
|
... on HeavyOperation {
|
412
|
+
type: __typename
|
386
413
|
base
|
387
414
|
gasPerUnit
|
388
415
|
}
|
389
416
|
}
|
390
417
|
`;
|
391
|
-
var
|
418
|
+
var GasCostsFragmentDoc = gql`
|
392
419
|
fragment GasCostsFragment on GasCosts {
|
393
420
|
version
|
394
421
|
add
|
@@ -544,8 +571,8 @@ var GasCostsFragmentFragmentDoc = gql`
|
|
544
571
|
}
|
545
572
|
newStoragePerByte
|
546
573
|
}
|
547
|
-
${
|
548
|
-
var
|
574
|
+
${DependentCostFragmentDoc}`;
|
575
|
+
var ConsensusParametersFragmentDoc = gql`
|
549
576
|
fragment consensusParametersFragment on ConsensusParameters {
|
550
577
|
version
|
551
578
|
txParams {
|
@@ -569,13 +596,13 @@ var ConsensusParametersFragmentFragmentDoc = gql`
|
|
569
596
|
baseAssetId
|
570
597
|
chainId
|
571
598
|
}
|
572
|
-
${
|
573
|
-
${
|
574
|
-
${
|
575
|
-
${
|
576
|
-
${
|
577
|
-
${
|
578
|
-
var
|
599
|
+
${TxParametersFragmentDoc}
|
600
|
+
${PredicateParametersFragmentDoc}
|
601
|
+
${ScriptParametersFragmentDoc}
|
602
|
+
${ContractParametersFragmentDoc}
|
603
|
+
${FeeParametersFragmentDoc}
|
604
|
+
${GasCostsFragmentDoc}`;
|
605
|
+
var ChainInfoFragmentDoc = gql`
|
579
606
|
fragment chainInfoFragment on ChainInfo {
|
580
607
|
name
|
581
608
|
latestBlock {
|
@@ -586,16 +613,16 @@ var ChainInfoFragmentFragmentDoc = gql`
|
|
586
613
|
...consensusParametersFragment
|
587
614
|
}
|
588
615
|
}
|
589
|
-
${
|
590
|
-
${
|
591
|
-
var
|
616
|
+
${BlockFragmentDoc}
|
617
|
+
${ConsensusParametersFragmentDoc}`;
|
618
|
+
var ContractBalanceFragmentDoc = gql`
|
592
619
|
fragment contractBalanceFragment on ContractBalance {
|
593
620
|
contract
|
594
621
|
amount
|
595
622
|
assetId
|
596
623
|
}
|
597
624
|
`;
|
598
|
-
var
|
625
|
+
var PageInfoFragmentDoc = gql`
|
599
626
|
fragment pageInfoFragment on PageInfo {
|
600
627
|
hasPreviousPage
|
601
628
|
hasNextPage
|
@@ -603,7 +630,7 @@ var PageInfoFragmentFragmentDoc = gql`
|
|
603
630
|
endCursor
|
604
631
|
}
|
605
632
|
`;
|
606
|
-
var
|
633
|
+
var NodeInfoFragmentDoc = gql`
|
607
634
|
fragment nodeInfoFragment on NodeInfo {
|
608
635
|
utxoValidation
|
609
636
|
vmBacktrace
|
@@ -612,7 +639,7 @@ var NodeInfoFragmentFragmentDoc = gql`
|
|
612
639
|
nodeVersion
|
613
640
|
}
|
614
641
|
`;
|
615
|
-
var
|
642
|
+
var RelayedTransactionStatusFragmentDoc = gql`
|
616
643
|
fragment relayedTransactionStatusFragment on RelayedTransactionStatus {
|
617
644
|
... on RelayedTransactionFailed {
|
618
645
|
blockHeight
|
@@ -633,28 +660,28 @@ var GetNodeInfoDocument = gql`
|
|
633
660
|
...nodeInfoFragment
|
634
661
|
}
|
635
662
|
}
|
636
|
-
${
|
663
|
+
${NodeInfoFragmentDoc}`;
|
637
664
|
var GetChainDocument = gql`
|
638
665
|
query getChain {
|
639
666
|
chain {
|
640
667
|
...chainInfoFragment
|
641
668
|
}
|
642
669
|
}
|
643
|
-
${
|
670
|
+
${ChainInfoFragmentDoc}`;
|
644
671
|
var GetTransactionDocument = gql`
|
645
672
|
query getTransaction($transactionId: TransactionId!) {
|
646
673
|
transaction(id: $transactionId) {
|
647
674
|
...transactionFragment
|
648
675
|
}
|
649
676
|
}
|
650
|
-
${
|
677
|
+
${TransactionFragmentDoc}`;
|
651
678
|
var GetTransactionWithReceiptsDocument = gql`
|
652
679
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
653
680
|
transaction(id: $transactionId) {
|
654
681
|
...transactionFragment
|
655
682
|
}
|
656
683
|
}
|
657
|
-
${
|
684
|
+
${TransactionFragmentDoc}`;
|
658
685
|
var GetTransactionsDocument = gql`
|
659
686
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
660
687
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -665,7 +692,7 @@ var GetTransactionsDocument = gql`
|
|
665
692
|
}
|
666
693
|
}
|
667
694
|
}
|
668
|
-
${
|
695
|
+
${TransactionFragmentDoc}`;
|
669
696
|
var GetTransactionsByOwnerDocument = gql`
|
670
697
|
query getTransactionsByOwner($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
|
671
698
|
transactionsByOwner(
|
@@ -685,22 +712,22 @@ var GetTransactionsByOwnerDocument = gql`
|
|
685
712
|
}
|
686
713
|
}
|
687
714
|
}
|
688
|
-
${
|
689
|
-
${
|
715
|
+
${PageInfoFragmentDoc}
|
716
|
+
${TransactionFragmentDoc}`;
|
690
717
|
var EstimatePredicatesDocument = gql`
|
691
718
|
query estimatePredicates($encodedTransaction: HexString!) {
|
692
719
|
estimatePredicates(tx: $encodedTransaction) {
|
693
720
|
...transactionEstimatePredicatesFragment
|
694
721
|
}
|
695
722
|
}
|
696
|
-
${
|
723
|
+
${TransactionEstimatePredicatesFragmentDoc}`;
|
697
724
|
var GetBlockDocument = gql`
|
698
725
|
query getBlock($blockId: BlockId, $height: U32) {
|
699
726
|
block(id: $blockId, height: $height) {
|
700
727
|
...blockFragment
|
701
728
|
}
|
702
729
|
}
|
703
|
-
${
|
730
|
+
${BlockFragmentDoc}`;
|
704
731
|
var GetBlockWithTransactionsDocument = gql`
|
705
732
|
query getBlockWithTransactions($blockId: BlockId, $blockHeight: U32) {
|
706
733
|
block(id: $blockId, height: $blockHeight) {
|
@@ -710,8 +737,8 @@ var GetBlockWithTransactionsDocument = gql`
|
|
710
737
|
}
|
711
738
|
}
|
712
739
|
}
|
713
|
-
${
|
714
|
-
${
|
740
|
+
${BlockFragmentDoc}
|
741
|
+
${TransactionFragmentDoc}`;
|
715
742
|
var GetBlocksDocument = gql`
|
716
743
|
query getBlocks($after: String, $before: String, $first: Int, $last: Int) {
|
717
744
|
blocks(after: $after, before: $before, first: $first, last: $last) {
|
@@ -722,14 +749,14 @@ var GetBlocksDocument = gql`
|
|
722
749
|
}
|
723
750
|
}
|
724
751
|
}
|
725
|
-
${
|
752
|
+
${BlockFragmentDoc}`;
|
726
753
|
var GetCoinDocument = gql`
|
727
754
|
query getCoin($coinId: UtxoId!) {
|
728
755
|
coin(utxoId: $coinId) {
|
729
756
|
...coinFragment
|
730
757
|
}
|
731
758
|
}
|
732
|
-
${
|
759
|
+
${CoinFragmentDoc}`;
|
733
760
|
var GetCoinsDocument = gql`
|
734
761
|
query getCoins($filter: CoinFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
735
762
|
coins(
|
@@ -746,7 +773,7 @@ var GetCoinsDocument = gql`
|
|
746
773
|
}
|
747
774
|
}
|
748
775
|
}
|
749
|
-
${
|
776
|
+
${CoinFragmentDoc}`;
|
750
777
|
var GetCoinsToSpendDocument = gql`
|
751
778
|
query getCoinsToSpend($owner: Address!, $queryPerAsset: [SpendQueryElementInput!]!, $excludedIds: ExcludeInput) {
|
752
779
|
coinsToSpend(
|
@@ -758,8 +785,8 @@ var GetCoinsToSpendDocument = gql`
|
|
758
785
|
...messageCoinFragment
|
759
786
|
}
|
760
787
|
}
|
761
|
-
${
|
762
|
-
${
|
788
|
+
${CoinFragmentDoc}
|
789
|
+
${MessageCoinFragmentDoc}`;
|
763
790
|
var GetContractDocument = gql`
|
764
791
|
query getContract($contractId: ContractId!) {
|
765
792
|
contract(id: $contractId) {
|
@@ -774,14 +801,14 @@ var GetContractBalanceDocument = gql`
|
|
774
801
|
...contractBalanceFragment
|
775
802
|
}
|
776
803
|
}
|
777
|
-
${
|
804
|
+
${ContractBalanceFragmentDoc}`;
|
778
805
|
var GetBalanceDocument = gql`
|
779
806
|
query getBalance($owner: Address!, $assetId: AssetId!) {
|
780
807
|
balance(owner: $owner, assetId: $assetId) {
|
781
808
|
...balanceFragment
|
782
809
|
}
|
783
810
|
}
|
784
|
-
${
|
811
|
+
${BalanceFragmentDoc}`;
|
785
812
|
var GetLatestGasPriceDocument = gql`
|
786
813
|
query getLatestGasPrice {
|
787
814
|
latestGasPrice {
|
@@ -812,7 +839,7 @@ var GetBalancesDocument = gql`
|
|
812
839
|
}
|
813
840
|
}
|
814
841
|
}
|
815
|
-
${
|
842
|
+
${BalanceFragmentDoc}`;
|
816
843
|
var GetMessagesDocument = gql`
|
817
844
|
query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
|
818
845
|
messages(
|
@@ -829,7 +856,7 @@ var GetMessagesDocument = gql`
|
|
829
856
|
}
|
830
857
|
}
|
831
858
|
}
|
832
|
-
${
|
859
|
+
${MessageFragmentDoc}`;
|
833
860
|
var GetMessageProofDocument = gql`
|
834
861
|
query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {
|
835
862
|
messageProof(
|
@@ -841,7 +868,7 @@ var GetMessageProofDocument = gql`
|
|
841
868
|
...messageProofFragment
|
842
869
|
}
|
843
870
|
}
|
844
|
-
${
|
871
|
+
${MessageProofFragmentDoc}`;
|
845
872
|
var GetMessageStatusDocument = gql`
|
846
873
|
query getMessageStatus($nonce: Nonce!) {
|
847
874
|
messageStatus(nonce: $nonce) {
|
@@ -855,14 +882,14 @@ var GetRelayedTransactionStatusDocument = gql`
|
|
855
882
|
...relayedTransactionStatusFragment
|
856
883
|
}
|
857
884
|
}
|
858
|
-
${
|
885
|
+
${RelayedTransactionStatusFragmentDoc}`;
|
859
886
|
var DryRunDocument = gql`
|
860
887
|
mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
|
861
888
|
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
|
862
889
|
...dryRunTransactionExecutionStatusFragment
|
863
890
|
}
|
864
891
|
}
|
865
|
-
${
|
892
|
+
${DryRunTransactionExecutionStatusFragmentDoc}`;
|
866
893
|
var SubmitDocument = gql`
|
867
894
|
mutation submit($encodedTransaction: HexString!) {
|
868
895
|
submit(tx: $encodedTransaction) {
|
@@ -884,21 +911,21 @@ var GetMessageByNonceDocument = gql`
|
|
884
911
|
...messageFragment
|
885
912
|
}
|
886
913
|
}
|
887
|
-
${
|
914
|
+
${MessageFragmentDoc}`;
|
888
915
|
var SubmitAndAwaitDocument = gql`
|
889
916
|
subscription submitAndAwait($encodedTransaction: HexString!) {
|
890
917
|
submitAndAwait(tx: $encodedTransaction) {
|
891
918
|
...transactionStatusSubscriptionFragment
|
892
919
|
}
|
893
920
|
}
|
894
|
-
${
|
921
|
+
${TransactionStatusSubscriptionFragmentDoc}`;
|
895
922
|
var StatusChangeDocument = gql`
|
896
923
|
subscription statusChange($transactionId: TransactionId!) {
|
897
924
|
statusChange(id: $transactionId) {
|
898
925
|
...transactionStatusSubscriptionFragment
|
899
926
|
}
|
900
927
|
}
|
901
|
-
${
|
928
|
+
${TransactionStatusSubscriptionFragmentDoc}`;
|
902
929
|
function getSdk(requester) {
|
903
930
|
return {
|
904
931
|
getVersion(variables, options) {
|
@@ -1572,10 +1599,9 @@ var getGasUsedFromReceipts = (receipts) => {
|
|
1572
1599
|
function resolveGasDependentCosts(byteSize, gasDependentCost) {
|
1573
1600
|
const base = bn5(gasDependentCost.base);
|
1574
1601
|
let dependentValue = bn5(0);
|
1575
|
-
if (
|
1602
|
+
if ("unitsPerGas" in gasDependentCost) {
|
1576
1603
|
dependentValue = bn5(byteSize).div(bn5(gasDependentCost.unitsPerGas));
|
1577
|
-
}
|
1578
|
-
if (gasDependentCost.__typename === "HeavyOperation") {
|
1604
|
+
} else {
|
1579
1605
|
dependentValue = bn5(byteSize).mul(bn5(gasDependentCost.gasPerUnit));
|
1580
1606
|
}
|
1581
1607
|
return base.add(dependentValue);
|
@@ -3939,9 +3965,11 @@ var _Provider = class {
|
|
3939
3965
|
static ensureClientVersionIsSupported(nodeInfo) {
|
3940
3966
|
const { isMajorSupported, isMinorSupported, supportedVersion } = checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);
|
3941
3967
|
if (!isMajorSupported || !isMinorSupported) {
|
3942
|
-
|
3943
|
-
|
3944
|
-
|
3968
|
+
console.warn(
|
3969
|
+
`The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion},
|
3970
|
+
which is not supported by the version of the TS SDK that you are using.
|
3971
|
+
Things may not work as expected.
|
3972
|
+
Supported fuel-core version: ${supportedVersion}.`
|
3945
3973
|
);
|
3946
3974
|
}
|
3947
3975
|
}
|
@@ -4378,10 +4406,10 @@ var _Provider = class {
|
|
4378
4406
|
const txRequestClone = clone3(transactionRequestify(transactionRequestLike));
|
4379
4407
|
const isScriptTransaction = txRequestClone.type === TransactionType8.Script;
|
4380
4408
|
const baseAssetId = this.getBaseAssetId();
|
4409
|
+
const updateMaxFee = txRequestClone.maxFee.eq(0);
|
4381
4410
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
4382
4411
|
const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
|
4383
4412
|
txRequestClone.fundWithFakeUtxos(allQuantities, baseAssetId, resourcesOwner?.address);
|
4384
|
-
txRequestClone.maxFee = bn17(0);
|
4385
4413
|
if (isScriptTransaction) {
|
4386
4414
|
txRequestClone.gasLimit = bn17(0);
|
4387
4415
|
}
|
@@ -4396,6 +4424,7 @@ var _Provider = class {
|
|
4396
4424
|
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
4397
4425
|
}
|
4398
4426
|
await this.estimatePredicates(signedRequest);
|
4427
|
+
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
4399
4428
|
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
4400
4429
|
transactionRequest: signedRequest
|
4401
4430
|
});
|
@@ -4404,7 +4433,6 @@ var _Provider = class {
|
|
4404
4433
|
let missingContractIds = [];
|
4405
4434
|
let outputVariables = 0;
|
4406
4435
|
let gasUsed = bn17(0);
|
4407
|
-
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
4408
4436
|
txRequestClone.maxFee = maxFee;
|
4409
4437
|
if (isScriptTransaction) {
|
4410
4438
|
txRequestClone.gasLimit = gasLimit;
|
@@ -4432,7 +4460,8 @@ var _Provider = class {
|
|
4432
4460
|
missingContractIds,
|
4433
4461
|
addedSignatures,
|
4434
4462
|
estimatedPredicates: txRequestClone.inputs,
|
4435
|
-
dryRunStatus
|
4463
|
+
dryRunStatus,
|
4464
|
+
updateMaxFee
|
4436
4465
|
};
|
4437
4466
|
}
|
4438
4467
|
async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
|
@@ -4505,7 +4534,7 @@ var _Provider = class {
|
|
4505
4534
|
};
|
4506
4535
|
const result = await this.operations.getCoinsToSpend(coinsQuery);
|
4507
4536
|
const coins = result.coinsToSpend.flat().map((coin) => {
|
4508
|
-
switch (coin.
|
4537
|
+
switch (coin.type) {
|
4509
4538
|
case "MessageCoin":
|
4510
4539
|
return {
|
4511
4540
|
amount: bn17(coin.amount),
|
@@ -5088,8 +5117,11 @@ function resolveIconPaths(assets2, basePath = "./") {
|
|
5088
5117
|
}));
|
5089
5118
|
}
|
5090
5119
|
|
5091
|
-
// src/providers/assets/
|
5092
|
-
var
|
5120
|
+
// src/providers/assets/utils/fuelAssetsBaseUrl.ts
|
5121
|
+
var fuelAssetsBaseUrl = "https://cdn.fuel.network/assets/";
|
5122
|
+
|
5123
|
+
// src/providers/assets/assets.ts
|
5124
|
+
var rawAssets = [
|
5093
5125
|
{
|
5094
5126
|
name: "Ethereum",
|
5095
5127
|
symbol: "ETH",
|
@@ -5120,6 +5152,7 @@ var assets = [
|
|
5120
5152
|
]
|
5121
5153
|
}
|
5122
5154
|
];
|
5155
|
+
var assets = resolveIconPaths(rawAssets, fuelAssetsBaseUrl);
|
5123
5156
|
|
5124
5157
|
// src/providers/transaction-request/helpers.ts
|
5125
5158
|
import { bn as bn19 } from "@fuel-ts/math";
|
@@ -5329,18 +5362,18 @@ var Account = class extends AbstractAccount {
|
|
5329
5362
|
return balances;
|
5330
5363
|
}
|
5331
5364
|
/**
|
5332
|
-
*
|
5365
|
+
* Funds a transaction request by adding the necessary resources.
|
5333
5366
|
*
|
5334
|
-
* @
|
5335
|
-
* @param
|
5336
|
-
* @param
|
5337
|
-
* @returns
|
5367
|
+
* @typeParam T - The type of the TransactionRequest.
|
5368
|
+
* @param request - The transaction request to fund.
|
5369
|
+
* @param params - The estimated transaction parameters.
|
5370
|
+
* @returns The funded transaction request.
|
5338
5371
|
*/
|
5339
5372
|
async fund(request, params) {
|
5340
|
-
const { addedSignatures, estimatedPredicates,
|
5373
|
+
const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee } = params;
|
5374
|
+
const fee = request.maxFee;
|
5341
5375
|
const baseAssetId = this.provider.getBaseAssetId();
|
5342
5376
|
const requiredInBaseAsset = requiredQuantities.find((quantity) => quantity.assetId === baseAssetId)?.amount || bn20(0);
|
5343
|
-
const txRequest = request;
|
5344
5377
|
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
5345
5378
|
amount: bn20(fee),
|
5346
5379
|
assetId: baseAssetId,
|
@@ -5377,14 +5410,17 @@ var Account = class extends AbstractAccount {
|
|
5377
5410
|
cacheTxInputsFromOwner(request.inputs, this.address)
|
5378
5411
|
);
|
5379
5412
|
request.addResources(resources);
|
5380
|
-
|
5381
|
-
|
5382
|
-
const requestToReestimate2 = clone4(
|
5413
|
+
request.shiftPredicateData();
|
5414
|
+
request.updatePredicateGasUsed(estimatedPredicates);
|
5415
|
+
const requestToReestimate2 = clone4(request);
|
5383
5416
|
if (addedSignatures) {
|
5384
5417
|
Array.from({ length: addedSignatures }).forEach(
|
5385
5418
|
() => requestToReestimate2.addEmptyWitness()
|
5386
5419
|
);
|
5387
5420
|
}
|
5421
|
+
if (!updateMaxFee) {
|
5422
|
+
break;
|
5423
|
+
}
|
5388
5424
|
const { maxFee: newFee } = await this.provider.estimateTxGasAndFee({
|
5389
5425
|
transactionRequest: requestToReestimate2
|
5390
5426
|
});
|
@@ -5406,17 +5442,20 @@ var Account = class extends AbstractAccount {
|
|
5406
5442
|
}
|
5407
5443
|
fundingAttempts += 1;
|
5408
5444
|
}
|
5409
|
-
|
5410
|
-
|
5411
|
-
const requestToReestimate = clone4(
|
5445
|
+
request.shiftPredicateData();
|
5446
|
+
request.updatePredicateGasUsed(estimatedPredicates);
|
5447
|
+
const requestToReestimate = clone4(request);
|
5412
5448
|
if (addedSignatures) {
|
5413
5449
|
Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());
|
5414
5450
|
}
|
5451
|
+
if (!updateMaxFee) {
|
5452
|
+
return request;
|
5453
|
+
}
|
5415
5454
|
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
5416
5455
|
transactionRequest: requestToReestimate
|
5417
5456
|
});
|
5418
|
-
|
5419
|
-
return
|
5457
|
+
request.maxFee = maxFee;
|
5458
|
+
return request;
|
5420
5459
|
}
|
5421
5460
|
/**
|
5422
5461
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -5428,20 +5467,19 @@ var Account = class extends AbstractAccount {
|
|
5428
5467
|
* @returns A promise that resolves to the prepared transaction request.
|
5429
5468
|
*/
|
5430
5469
|
async createTransfer(destination, amount, assetId, txParams = {}) {
|
5431
|
-
|
5470
|
+
let request = new ScriptTransactionRequest(txParams);
|
5432
5471
|
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
5433
5472
|
request.addCoinOutput(Address3.fromAddressOrString(destination), amount, assetIdToTransfer);
|
5434
5473
|
const txCost = await this.provider.getTransactionCost(request, {
|
5435
5474
|
estimateTxDependencies: true,
|
5436
5475
|
resourcesOwner: this
|
5437
5476
|
});
|
5438
|
-
this.validateGasLimitAndMaxFee({
|
5477
|
+
request = this.validateGasLimitAndMaxFee({
|
5478
|
+
transactionRequest: request,
|
5439
5479
|
gasUsed: txCost.gasUsed,
|
5440
5480
|
maxFee: txCost.maxFee,
|
5441
5481
|
txParams
|
5442
5482
|
});
|
5443
|
-
request.gasLimit = txCost.gasUsed;
|
5444
|
-
request.maxFee = txCost.maxFee;
|
5445
5483
|
await this.fund(request, txCost);
|
5446
5484
|
return request;
|
5447
5485
|
}
|
@@ -5488,7 +5526,7 @@ var Account = class extends AbstractAccount {
|
|
5488
5526
|
amountToTransfer: bn20(amount),
|
5489
5527
|
assetId: assetIdToTransfer
|
5490
5528
|
});
|
5491
|
-
|
5529
|
+
let request = new ScriptTransactionRequest({
|
5492
5530
|
...txParams,
|
5493
5531
|
script,
|
5494
5532
|
scriptData
|
@@ -5498,13 +5536,12 @@ var Account = class extends AbstractAccount {
|
|
5498
5536
|
resourcesOwner: this,
|
5499
5537
|
quantitiesToContract: [{ amount: bn20(amount), assetId: String(assetIdToTransfer) }]
|
5500
5538
|
});
|
5501
|
-
this.validateGasLimitAndMaxFee({
|
5539
|
+
request = this.validateGasLimitAndMaxFee({
|
5540
|
+
transactionRequest: request,
|
5502
5541
|
gasUsed: txCost.gasUsed,
|
5503
5542
|
maxFee: txCost.maxFee,
|
5504
5543
|
txParams
|
5505
5544
|
});
|
5506
|
-
request.gasLimit = txCost.gasUsed;
|
5507
|
-
request.maxFee = txCost.maxFee;
|
5508
5545
|
await this.fund(request, txCost);
|
5509
5546
|
return this.sendTransaction(request);
|
5510
5547
|
}
|
@@ -5531,16 +5568,15 @@ var Account = class extends AbstractAccount {
|
|
5531
5568
|
]);
|
5532
5569
|
const params = { script, ...txParams };
|
5533
5570
|
const baseAssetId = this.provider.getBaseAssetId();
|
5534
|
-
|
5571
|
+
let request = new ScriptTransactionRequest(params);
|
5535
5572
|
const quantitiesToContract = [{ amount: bn20(amount), assetId: baseAssetId }];
|
5536
5573
|
const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
|
5537
|
-
this.validateGasLimitAndMaxFee({
|
5574
|
+
request = this.validateGasLimitAndMaxFee({
|
5575
|
+
transactionRequest: request,
|
5538
5576
|
gasUsed: txCost.gasUsed,
|
5539
5577
|
maxFee: txCost.maxFee,
|
5540
5578
|
txParams
|
5541
5579
|
});
|
5542
|
-
request.maxFee = txCost.maxFee;
|
5543
|
-
request.gasLimit = txCost.gasUsed;
|
5544
5580
|
await this.fund(request, txCost);
|
5545
5581
|
return this.sendTransaction(request);
|
5546
5582
|
}
|
@@ -5600,22 +5636,29 @@ var Account = class extends AbstractAccount {
|
|
5600
5636
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
5601
5637
|
}
|
5602
5638
|
validateGasLimitAndMaxFee({
|
5603
|
-
txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },
|
5604
5639
|
gasUsed,
|
5605
|
-
maxFee
|
5640
|
+
maxFee,
|
5641
|
+
transactionRequest,
|
5642
|
+
txParams: { gasLimit: setGasLimit, maxFee: setMaxFee }
|
5606
5643
|
}) {
|
5607
|
-
|
5644
|
+
const request = transactionRequestify(transactionRequest);
|
5645
|
+
if (!isDefined2(setGasLimit)) {
|
5646
|
+
request.gasLimit = gasUsed;
|
5647
|
+
} else if (gasUsed.gt(setGasLimit)) {
|
5608
5648
|
throw new FuelError15(
|
5609
5649
|
ErrorCode15.GAS_LIMIT_TOO_LOW,
|
5610
5650
|
`Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`
|
5611
5651
|
);
|
5612
5652
|
}
|
5613
|
-
if (isDefined2(setMaxFee)
|
5653
|
+
if (!isDefined2(setMaxFee)) {
|
5654
|
+
request.maxFee = maxFee;
|
5655
|
+
} else if (maxFee.gt(setMaxFee)) {
|
5614
5656
|
throw new FuelError15(
|
5615
5657
|
ErrorCode15.MAX_FEE_TOO_LOW,
|
5616
5658
|
`Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`
|
5617
5659
|
);
|
5618
5660
|
}
|
5661
|
+
return request;
|
5619
5662
|
}
|
5620
5663
|
};
|
5621
5664
|
|
@@ -10025,6 +10068,7 @@ export {
|
|
10025
10068
|
extractBurnedAssetsFromReceipts,
|
10026
10069
|
extractMintedAssetsFromReceipts,
|
10027
10070
|
extractTxError,
|
10071
|
+
fuelAssetsBaseUrl,
|
10028
10072
|
gasUsedByInputs,
|
10029
10073
|
getAssetEth,
|
10030
10074
|
getAssetFuel,
|
@@ -10083,6 +10127,7 @@ export {
|
|
10083
10127
|
outputify,
|
10084
10128
|
processGqlReceipt,
|
10085
10129
|
processGraphqlStatus,
|
10130
|
+
rawAssets,
|
10086
10131
|
resolveGasDependentCosts,
|
10087
10132
|
resolveIconPaths,
|
10088
10133
|
returnZeroScript,
|