@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/test-utils.mjs
CHANGED
@@ -83,7 +83,7 @@ import { clone as clone3 } from "ramda";
|
|
83
83
|
|
84
84
|
// src/providers/__generated__/operations.ts
|
85
85
|
import gql from "graphql-tag";
|
86
|
-
var
|
86
|
+
var TransactionStatusSubscriptionFragmentDoc = gql`
|
87
87
|
fragment transactionStatusSubscriptionFragment on TransactionStatus {
|
88
88
|
type: __typename
|
89
89
|
... on SqueezedOutStatus {
|
@@ -91,7 +91,13 @@ var TransactionStatusSubscriptionFragmentFragmentDoc = gql`
|
|
91
91
|
}
|
92
92
|
}
|
93
93
|
`;
|
94
|
-
var
|
94
|
+
var SubmittedStatusFragmentDoc = gql`
|
95
|
+
fragment SubmittedStatusFragment on SubmittedStatus {
|
96
|
+
type: __typename
|
97
|
+
time
|
98
|
+
}
|
99
|
+
`;
|
100
|
+
var ReceiptFragmentDoc = gql`
|
95
101
|
fragment receiptFragment on Receipt {
|
96
102
|
id
|
97
103
|
pc
|
@@ -123,45 +129,65 @@ var ReceiptFragmentFragmentDoc = gql`
|
|
123
129
|
subId
|
124
130
|
}
|
125
131
|
`;
|
126
|
-
var
|
127
|
-
fragment
|
132
|
+
var SuccessStatusFragmentDoc = gql`
|
133
|
+
fragment SuccessStatusFragment on SuccessStatus {
|
134
|
+
type: __typename
|
135
|
+
block {
|
136
|
+
id
|
137
|
+
}
|
138
|
+
time
|
139
|
+
programState {
|
140
|
+
returnType
|
141
|
+
data
|
142
|
+
}
|
143
|
+
receipts {
|
144
|
+
...receiptFragment
|
145
|
+
}
|
146
|
+
totalGas
|
147
|
+
totalFee
|
148
|
+
}
|
149
|
+
${ReceiptFragmentDoc}`;
|
150
|
+
var FailureStatusFragmentDoc = gql`
|
151
|
+
fragment FailureStatusFragment on FailureStatus {
|
152
|
+
type: __typename
|
153
|
+
block {
|
154
|
+
id
|
155
|
+
}
|
156
|
+
totalGas
|
157
|
+
totalFee
|
158
|
+
time
|
159
|
+
reason
|
160
|
+
receipts {
|
161
|
+
...receiptFragment
|
162
|
+
}
|
163
|
+
}
|
164
|
+
${ReceiptFragmentDoc}`;
|
165
|
+
var SqueezedOutStatusFragmentDoc = gql`
|
166
|
+
fragment SqueezedOutStatusFragment on SqueezedOutStatus {
|
128
167
|
type: __typename
|
168
|
+
reason
|
169
|
+
}
|
170
|
+
`;
|
171
|
+
var TransactionStatusFragmentDoc = gql`
|
172
|
+
fragment transactionStatusFragment on TransactionStatus {
|
129
173
|
... on SubmittedStatus {
|
130
|
-
|
174
|
+
...SubmittedStatusFragment
|
131
175
|
}
|
132
176
|
... on SuccessStatus {
|
133
|
-
|
134
|
-
id
|
135
|
-
}
|
136
|
-
time
|
137
|
-
programState {
|
138
|
-
returnType
|
139
|
-
data
|
140
|
-
}
|
141
|
-
receipts {
|
142
|
-
...receiptFragment
|
143
|
-
}
|
144
|
-
totalGas
|
145
|
-
totalFee
|
177
|
+
...SuccessStatusFragment
|
146
178
|
}
|
147
179
|
... on FailureStatus {
|
148
|
-
|
149
|
-
id
|
150
|
-
}
|
151
|
-
totalGas
|
152
|
-
totalFee
|
153
|
-
time
|
154
|
-
reason
|
155
|
-
receipts {
|
156
|
-
...receiptFragment
|
157
|
-
}
|
180
|
+
...FailureStatusFragment
|
158
181
|
}
|
159
182
|
... on SqueezedOutStatus {
|
160
|
-
|
183
|
+
...SqueezedOutStatusFragment
|
161
184
|
}
|
162
185
|
}
|
163
|
-
${
|
164
|
-
|
186
|
+
${SubmittedStatusFragmentDoc}
|
187
|
+
${SuccessStatusFragmentDoc}
|
188
|
+
${FailureStatusFragmentDoc}
|
189
|
+
${SqueezedOutStatusFragmentDoc}`;
|
190
|
+
var TransactionFragmentDoc = gql`
|
165
191
|
fragment transactionFragment on Transaction {
|
166
192
|
id
|
167
193
|
rawPayload
|
@@ -169,8 +195,8 @@ var TransactionFragmentFragmentDoc = gql`
|
|
169
195
|
...transactionStatusFragment
|
170
196
|
}
|
171
197
|
}
|
172
|
-
${
|
173
|
-
var
|
198
|
+
${TransactionStatusFragmentDoc}`;
|
199
|
+
var InputEstimatePredicatesFragmentDoc = gql`
|
174
200
|
fragment inputEstimatePredicatesFragment on Input {
|
175
201
|
... on InputCoin {
|
176
202
|
predicateGasUsed
|
@@ -180,14 +206,14 @@ var InputEstimatePredicatesFragmentFragmentDoc = gql`
|
|
180
206
|
}
|
181
207
|
}
|
182
208
|
`;
|
183
|
-
var
|
209
|
+
var TransactionEstimatePredicatesFragmentDoc = gql`
|
184
210
|
fragment transactionEstimatePredicatesFragment on Transaction {
|
185
211
|
inputs {
|
186
212
|
...inputEstimatePredicatesFragment
|
187
213
|
}
|
188
214
|
}
|
189
|
-
${
|
190
|
-
var
|
215
|
+
${InputEstimatePredicatesFragmentDoc}`;
|
216
|
+
var DryRunFailureStatusFragmentDoc = gql`
|
191
217
|
fragment dryRunFailureStatusFragment on DryRunFailureStatus {
|
192
218
|
totalGas
|
193
219
|
totalFee
|
@@ -198,7 +224,7 @@ var DryRunFailureStatusFragmentFragmentDoc = gql`
|
|
198
224
|
}
|
199
225
|
}
|
200
226
|
`;
|
201
|
-
var
|
227
|
+
var DryRunSuccessStatusFragmentDoc = gql`
|
202
228
|
fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
|
203
229
|
totalGas
|
204
230
|
totalFee
|
@@ -208,7 +234,7 @@ var DryRunSuccessStatusFragmentFragmentDoc = gql`
|
|
208
234
|
}
|
209
235
|
}
|
210
236
|
`;
|
211
|
-
var
|
237
|
+
var DryRunTransactionStatusFragmentDoc = gql`
|
212
238
|
fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
|
213
239
|
... on DryRunFailureStatus {
|
214
240
|
...dryRunFailureStatusFragment
|
@@ -217,9 +243,9 @@ var DryRunTransactionStatusFragmentFragmentDoc = gql`
|
|
217
243
|
...dryRunSuccessStatusFragment
|
218
244
|
}
|
219
245
|
}
|
220
|
-
${
|
221
|
-
${
|
222
|
-
var
|
246
|
+
${DryRunFailureStatusFragmentDoc}
|
247
|
+
${DryRunSuccessStatusFragmentDoc}`;
|
248
|
+
var DryRunTransactionExecutionStatusFragmentDoc = gql`
|
223
249
|
fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
|
224
250
|
id
|
225
251
|
status {
|
@@ -229,11 +255,11 @@ var DryRunTransactionExecutionStatusFragmentFragmentDoc = gql`
|
|
229
255
|
...receiptFragment
|
230
256
|
}
|
231
257
|
}
|
232
|
-
${
|
233
|
-
${
|
234
|
-
var
|
258
|
+
${DryRunTransactionStatusFragmentDoc}
|
259
|
+
${ReceiptFragmentDoc}`;
|
260
|
+
var CoinFragmentDoc = gql`
|
235
261
|
fragment coinFragment on Coin {
|
236
|
-
__typename
|
262
|
+
type: __typename
|
237
263
|
utxoId
|
238
264
|
owner
|
239
265
|
amount
|
@@ -242,9 +268,9 @@ var CoinFragmentFragmentDoc = gql`
|
|
242
268
|
txCreatedIdx
|
243
269
|
}
|
244
270
|
`;
|
245
|
-
var
|
271
|
+
var MessageCoinFragmentDoc = gql`
|
246
272
|
fragment messageCoinFragment on MessageCoin {
|
247
|
-
__typename
|
273
|
+
type: __typename
|
248
274
|
sender
|
249
275
|
recipient
|
250
276
|
nonce
|
@@ -253,7 +279,7 @@ var MessageCoinFragmentFragmentDoc = gql`
|
|
253
279
|
daHeight
|
254
280
|
}
|
255
281
|
`;
|
256
|
-
var
|
282
|
+
var MessageFragmentDoc = gql`
|
257
283
|
fragment messageFragment on Message {
|
258
284
|
amount
|
259
285
|
sender
|
@@ -263,7 +289,7 @@ var MessageFragmentFragmentDoc = gql`
|
|
263
289
|
daHeight
|
264
290
|
}
|
265
291
|
`;
|
266
|
-
var
|
292
|
+
var MessageProofFragmentDoc = gql`
|
267
293
|
fragment messageProofFragment on MessageProof {
|
268
294
|
messageProof {
|
269
295
|
proofSet
|
@@ -310,14 +336,14 @@ var MessageProofFragmentFragmentDoc = gql`
|
|
310
336
|
data
|
311
337
|
}
|
312
338
|
`;
|
313
|
-
var
|
339
|
+
var BalanceFragmentDoc = gql`
|
314
340
|
fragment balanceFragment on Balance {
|
315
341
|
owner
|
316
342
|
amount
|
317
343
|
assetId
|
318
344
|
}
|
319
345
|
`;
|
320
|
-
var
|
346
|
+
var BlockFragmentDoc = gql`
|
321
347
|
fragment blockFragment on Block {
|
322
348
|
id
|
323
349
|
height
|
@@ -329,7 +355,7 @@ var BlockFragmentFragmentDoc = gql`
|
|
329
355
|
}
|
330
356
|
}
|
331
357
|
`;
|
332
|
-
var
|
358
|
+
var TxParametersFragmentDoc = gql`
|
333
359
|
fragment TxParametersFragment on TxParameters {
|
334
360
|
version
|
335
361
|
maxInputs
|
@@ -340,7 +366,7 @@ var TxParametersFragmentFragmentDoc = gql`
|
|
340
366
|
maxBytecodeSubsections
|
341
367
|
}
|
342
368
|
`;
|
343
|
-
var
|
369
|
+
var PredicateParametersFragmentDoc = gql`
|
344
370
|
fragment PredicateParametersFragment on PredicateParameters {
|
345
371
|
version
|
346
372
|
maxPredicateLength
|
@@ -349,41 +375,42 @@ var PredicateParametersFragmentFragmentDoc = gql`
|
|
349
375
|
maxMessageDataLength
|
350
376
|
}
|
351
377
|
`;
|
352
|
-
var
|
378
|
+
var ScriptParametersFragmentDoc = gql`
|
353
379
|
fragment ScriptParametersFragment on ScriptParameters {
|
354
380
|
version
|
355
381
|
maxScriptLength
|
356
382
|
maxScriptDataLength
|
357
383
|
}
|
358
384
|
`;
|
359
|
-
var
|
385
|
+
var ContractParametersFragmentDoc = gql`
|
360
386
|
fragment ContractParametersFragment on ContractParameters {
|
361
387
|
version
|
362
388
|
contractMaxSize
|
363
389
|
maxStorageSlots
|
364
390
|
}
|
365
391
|
`;
|
366
|
-
var
|
392
|
+
var FeeParametersFragmentDoc = gql`
|
367
393
|
fragment FeeParametersFragment on FeeParameters {
|
368
394
|
version
|
369
395
|
gasPriceFactor
|
370
396
|
gasPerByte
|
371
397
|
}
|
372
398
|
`;
|
373
|
-
var
|
399
|
+
var DependentCostFragmentDoc = gql`
|
374
400
|
fragment DependentCostFragment on DependentCost {
|
375
|
-
__typename
|
376
401
|
... on LightOperation {
|
402
|
+
type: __typename
|
377
403
|
base
|
378
404
|
unitsPerGas
|
379
405
|
}
|
380
406
|
... on HeavyOperation {
|
407
|
+
type: __typename
|
381
408
|
base
|
382
409
|
gasPerUnit
|
383
410
|
}
|
384
411
|
}
|
385
412
|
`;
|
386
|
-
var
|
413
|
+
var GasCostsFragmentDoc = gql`
|
387
414
|
fragment GasCostsFragment on GasCosts {
|
388
415
|
version
|
389
416
|
add
|
@@ -539,8 +566,8 @@ var GasCostsFragmentFragmentDoc = gql`
|
|
539
566
|
}
|
540
567
|
newStoragePerByte
|
541
568
|
}
|
542
|
-
${
|
543
|
-
var
|
569
|
+
${DependentCostFragmentDoc}`;
|
570
|
+
var ConsensusParametersFragmentDoc = gql`
|
544
571
|
fragment consensusParametersFragment on ConsensusParameters {
|
545
572
|
version
|
546
573
|
txParams {
|
@@ -564,13 +591,13 @@ var ConsensusParametersFragmentFragmentDoc = gql`
|
|
564
591
|
baseAssetId
|
565
592
|
chainId
|
566
593
|
}
|
567
|
-
${
|
568
|
-
${
|
569
|
-
${
|
570
|
-
${
|
571
|
-
${
|
572
|
-
${
|
573
|
-
var
|
594
|
+
${TxParametersFragmentDoc}
|
595
|
+
${PredicateParametersFragmentDoc}
|
596
|
+
${ScriptParametersFragmentDoc}
|
597
|
+
${ContractParametersFragmentDoc}
|
598
|
+
${FeeParametersFragmentDoc}
|
599
|
+
${GasCostsFragmentDoc}`;
|
600
|
+
var ChainInfoFragmentDoc = gql`
|
574
601
|
fragment chainInfoFragment on ChainInfo {
|
575
602
|
name
|
576
603
|
latestBlock {
|
@@ -581,16 +608,16 @@ var ChainInfoFragmentFragmentDoc = gql`
|
|
581
608
|
...consensusParametersFragment
|
582
609
|
}
|
583
610
|
}
|
584
|
-
${
|
585
|
-
${
|
586
|
-
var
|
611
|
+
${BlockFragmentDoc}
|
612
|
+
${ConsensusParametersFragmentDoc}`;
|
613
|
+
var ContractBalanceFragmentDoc = gql`
|
587
614
|
fragment contractBalanceFragment on ContractBalance {
|
588
615
|
contract
|
589
616
|
amount
|
590
617
|
assetId
|
591
618
|
}
|
592
619
|
`;
|
593
|
-
var
|
620
|
+
var PageInfoFragmentDoc = gql`
|
594
621
|
fragment pageInfoFragment on PageInfo {
|
595
622
|
hasPreviousPage
|
596
623
|
hasNextPage
|
@@ -598,7 +625,7 @@ var PageInfoFragmentFragmentDoc = gql`
|
|
598
625
|
endCursor
|
599
626
|
}
|
600
627
|
`;
|
601
|
-
var
|
628
|
+
var NodeInfoFragmentDoc = gql`
|
602
629
|
fragment nodeInfoFragment on NodeInfo {
|
603
630
|
utxoValidation
|
604
631
|
vmBacktrace
|
@@ -607,7 +634,7 @@ var NodeInfoFragmentFragmentDoc = gql`
|
|
607
634
|
nodeVersion
|
608
635
|
}
|
609
636
|
`;
|
610
|
-
var
|
637
|
+
var RelayedTransactionStatusFragmentDoc = gql`
|
611
638
|
fragment relayedTransactionStatusFragment on RelayedTransactionStatus {
|
612
639
|
... on RelayedTransactionFailed {
|
613
640
|
blockHeight
|
@@ -628,28 +655,28 @@ var GetNodeInfoDocument = gql`
|
|
628
655
|
...nodeInfoFragment
|
629
656
|
}
|
630
657
|
}
|
631
|
-
${
|
658
|
+
${NodeInfoFragmentDoc}`;
|
632
659
|
var GetChainDocument = gql`
|
633
660
|
query getChain {
|
634
661
|
chain {
|
635
662
|
...chainInfoFragment
|
636
663
|
}
|
637
664
|
}
|
638
|
-
${
|
665
|
+
${ChainInfoFragmentDoc}`;
|
639
666
|
var GetTransactionDocument = gql`
|
640
667
|
query getTransaction($transactionId: TransactionId!) {
|
641
668
|
transaction(id: $transactionId) {
|
642
669
|
...transactionFragment
|
643
670
|
}
|
644
671
|
}
|
645
|
-
${
|
672
|
+
${TransactionFragmentDoc}`;
|
646
673
|
var GetTransactionWithReceiptsDocument = gql`
|
647
674
|
query getTransactionWithReceipts($transactionId: TransactionId!) {
|
648
675
|
transaction(id: $transactionId) {
|
649
676
|
...transactionFragment
|
650
677
|
}
|
651
678
|
}
|
652
|
-
${
|
679
|
+
${TransactionFragmentDoc}`;
|
653
680
|
var GetTransactionsDocument = gql`
|
654
681
|
query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
|
655
682
|
transactions(after: $after, before: $before, first: $first, last: $last) {
|
@@ -660,7 +687,7 @@ var GetTransactionsDocument = gql`
|
|
660
687
|
}
|
661
688
|
}
|
662
689
|
}
|
663
|
-
${
|
690
|
+
${TransactionFragmentDoc}`;
|
664
691
|
var GetTransactionsByOwnerDocument = gql`
|
665
692
|
query getTransactionsByOwner($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
|
666
693
|
transactionsByOwner(
|
@@ -680,22 +707,22 @@ var GetTransactionsByOwnerDocument = gql`
|
|
680
707
|
}
|
681
708
|
}
|
682
709
|
}
|
683
|
-
${
|
684
|
-
${
|
710
|
+
${PageInfoFragmentDoc}
|
711
|
+
${TransactionFragmentDoc}`;
|
685
712
|
var EstimatePredicatesDocument = gql`
|
686
713
|
query estimatePredicates($encodedTransaction: HexString!) {
|
687
714
|
estimatePredicates(tx: $encodedTransaction) {
|
688
715
|
...transactionEstimatePredicatesFragment
|
689
716
|
}
|
690
717
|
}
|
691
|
-
${
|
718
|
+
${TransactionEstimatePredicatesFragmentDoc}`;
|
692
719
|
var GetBlockDocument = gql`
|
693
720
|
query getBlock($blockId: BlockId, $height: U32) {
|
694
721
|
block(id: $blockId, height: $height) {
|
695
722
|
...blockFragment
|
696
723
|
}
|
697
724
|
}
|
698
|
-
${
|
725
|
+
${BlockFragmentDoc}`;
|
699
726
|
var GetBlockWithTransactionsDocument = gql`
|
700
727
|
query getBlockWithTransactions($blockId: BlockId, $blockHeight: U32) {
|
701
728
|
block(id: $blockId, height: $blockHeight) {
|
@@ -705,8 +732,8 @@ var GetBlockWithTransactionsDocument = gql`
|
|
705
732
|
}
|
706
733
|
}
|
707
734
|
}
|
708
|
-
${
|
709
|
-
${
|
735
|
+
${BlockFragmentDoc}
|
736
|
+
${TransactionFragmentDoc}`;
|
710
737
|
var GetBlocksDocument = gql`
|
711
738
|
query getBlocks($after: String, $before: String, $first: Int, $last: Int) {
|
712
739
|
blocks(after: $after, before: $before, first: $first, last: $last) {
|
@@ -717,14 +744,14 @@ var GetBlocksDocument = gql`
|
|
717
744
|
}
|
718
745
|
}
|
719
746
|
}
|
720
|
-
${
|
747
|
+
${BlockFragmentDoc}`;
|
721
748
|
var GetCoinDocument = gql`
|
722
749
|
query getCoin($coinId: UtxoId!) {
|
723
750
|
coin(utxoId: $coinId) {
|
724
751
|
...coinFragment
|
725
752
|
}
|
726
753
|
}
|
727
|
-
${
|
754
|
+
${CoinFragmentDoc}`;
|
728
755
|
var GetCoinsDocument = gql`
|
729
756
|
query getCoins($filter: CoinFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
|
730
757
|
coins(
|
@@ -741,7 +768,7 @@ var GetCoinsDocument = gql`
|
|
741
768
|
}
|
742
769
|
}
|
743
770
|
}
|
744
|
-
${
|
771
|
+
${CoinFragmentDoc}`;
|
745
772
|
var GetCoinsToSpendDocument = gql`
|
746
773
|
query getCoinsToSpend($owner: Address!, $queryPerAsset: [SpendQueryElementInput!]!, $excludedIds: ExcludeInput) {
|
747
774
|
coinsToSpend(
|
@@ -753,8 +780,8 @@ var GetCoinsToSpendDocument = gql`
|
|
753
780
|
...messageCoinFragment
|
754
781
|
}
|
755
782
|
}
|
756
|
-
${
|
757
|
-
${
|
783
|
+
${CoinFragmentDoc}
|
784
|
+
${MessageCoinFragmentDoc}`;
|
758
785
|
var GetContractDocument = gql`
|
759
786
|
query getContract($contractId: ContractId!) {
|
760
787
|
contract(id: $contractId) {
|
@@ -769,14 +796,14 @@ var GetContractBalanceDocument = gql`
|
|
769
796
|
...contractBalanceFragment
|
770
797
|
}
|
771
798
|
}
|
772
|
-
${
|
799
|
+
${ContractBalanceFragmentDoc}`;
|
773
800
|
var GetBalanceDocument = gql`
|
774
801
|
query getBalance($owner: Address!, $assetId: AssetId!) {
|
775
802
|
balance(owner: $owner, assetId: $assetId) {
|
776
803
|
...balanceFragment
|
777
804
|
}
|
778
805
|
}
|
779
|
-
${
|
806
|
+
${BalanceFragmentDoc}`;
|
780
807
|
var GetLatestGasPriceDocument = gql`
|
781
808
|
query getLatestGasPrice {
|
782
809
|
latestGasPrice {
|
@@ -807,7 +834,7 @@ var GetBalancesDocument = gql`
|
|
807
834
|
}
|
808
835
|
}
|
809
836
|
}
|
810
|
-
${
|
837
|
+
${BalanceFragmentDoc}`;
|
811
838
|
var GetMessagesDocument = gql`
|
812
839
|
query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
|
813
840
|
messages(
|
@@ -824,7 +851,7 @@ var GetMessagesDocument = gql`
|
|
824
851
|
}
|
825
852
|
}
|
826
853
|
}
|
827
|
-
${
|
854
|
+
${MessageFragmentDoc}`;
|
828
855
|
var GetMessageProofDocument = gql`
|
829
856
|
query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {
|
830
857
|
messageProof(
|
@@ -836,7 +863,7 @@ var GetMessageProofDocument = gql`
|
|
836
863
|
...messageProofFragment
|
837
864
|
}
|
838
865
|
}
|
839
|
-
${
|
866
|
+
${MessageProofFragmentDoc}`;
|
840
867
|
var GetMessageStatusDocument = gql`
|
841
868
|
query getMessageStatus($nonce: Nonce!) {
|
842
869
|
messageStatus(nonce: $nonce) {
|
@@ -850,14 +877,14 @@ var GetRelayedTransactionStatusDocument = gql`
|
|
850
877
|
...relayedTransactionStatusFragment
|
851
878
|
}
|
852
879
|
}
|
853
|
-
${
|
880
|
+
${RelayedTransactionStatusFragmentDoc}`;
|
854
881
|
var DryRunDocument = gql`
|
855
882
|
mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
|
856
883
|
dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
|
857
884
|
...dryRunTransactionExecutionStatusFragment
|
858
885
|
}
|
859
886
|
}
|
860
|
-
${
|
887
|
+
${DryRunTransactionExecutionStatusFragmentDoc}`;
|
861
888
|
var SubmitDocument = gql`
|
862
889
|
mutation submit($encodedTransaction: HexString!) {
|
863
890
|
submit(tx: $encodedTransaction) {
|
@@ -879,21 +906,21 @@ var GetMessageByNonceDocument = gql`
|
|
879
906
|
...messageFragment
|
880
907
|
}
|
881
908
|
}
|
882
|
-
${
|
909
|
+
${MessageFragmentDoc}`;
|
883
910
|
var SubmitAndAwaitDocument = gql`
|
884
911
|
subscription submitAndAwait($encodedTransaction: HexString!) {
|
885
912
|
submitAndAwait(tx: $encodedTransaction) {
|
886
913
|
...transactionStatusSubscriptionFragment
|
887
914
|
}
|
888
915
|
}
|
889
|
-
${
|
916
|
+
${TransactionStatusSubscriptionFragmentDoc}`;
|
890
917
|
var StatusChangeDocument = gql`
|
891
918
|
subscription statusChange($transactionId: TransactionId!) {
|
892
919
|
statusChange(id: $transactionId) {
|
893
920
|
...transactionStatusSubscriptionFragment
|
894
921
|
}
|
895
922
|
}
|
896
|
-
${
|
923
|
+
${TransactionStatusSubscriptionFragmentDoc}`;
|
897
924
|
function getSdk(requester) {
|
898
925
|
return {
|
899
926
|
getVersion(variables, options) {
|
@@ -1505,10 +1532,9 @@ var getGasUsedFromReceipts = (receipts) => {
|
|
1505
1532
|
function resolveGasDependentCosts(byteSize, gasDependentCost) {
|
1506
1533
|
const base = bn5(gasDependentCost.base);
|
1507
1534
|
let dependentValue = bn5(0);
|
1508
|
-
if (
|
1535
|
+
if ("unitsPerGas" in gasDependentCost) {
|
1509
1536
|
dependentValue = bn5(byteSize).div(bn5(gasDependentCost.unitsPerGas));
|
1510
|
-
}
|
1511
|
-
if (gasDependentCost.__typename === "HeavyOperation") {
|
1537
|
+
} else {
|
1512
1538
|
dependentValue = bn5(byteSize).mul(bn5(gasDependentCost.gasPerUnit));
|
1513
1539
|
}
|
1514
1540
|
return base.add(dependentValue);
|
@@ -3811,9 +3837,11 @@ var _Provider = class {
|
|
3811
3837
|
static ensureClientVersionIsSupported(nodeInfo) {
|
3812
3838
|
const { isMajorSupported, isMinorSupported, supportedVersion } = checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);
|
3813
3839
|
if (!isMajorSupported || !isMinorSupported) {
|
3814
|
-
|
3815
|
-
|
3816
|
-
|
3840
|
+
console.warn(
|
3841
|
+
`The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion},
|
3842
|
+
which is not supported by the version of the TS SDK that you are using.
|
3843
|
+
Things may not work as expected.
|
3844
|
+
Supported fuel-core version: ${supportedVersion}.`
|
3817
3845
|
);
|
3818
3846
|
}
|
3819
3847
|
}
|
@@ -4250,10 +4278,10 @@ var _Provider = class {
|
|
4250
4278
|
const txRequestClone = clone3(transactionRequestify(transactionRequestLike));
|
4251
4279
|
const isScriptTransaction = txRequestClone.type === TransactionType8.Script;
|
4252
4280
|
const baseAssetId = this.getBaseAssetId();
|
4281
|
+
const updateMaxFee = txRequestClone.maxFee.eq(0);
|
4253
4282
|
const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
|
4254
4283
|
const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
|
4255
4284
|
txRequestClone.fundWithFakeUtxos(allQuantities, baseAssetId, resourcesOwner?.address);
|
4256
|
-
txRequestClone.maxFee = bn17(0);
|
4257
4285
|
if (isScriptTransaction) {
|
4258
4286
|
txRequestClone.gasLimit = bn17(0);
|
4259
4287
|
}
|
@@ -4268,6 +4296,7 @@ var _Provider = class {
|
|
4268
4296
|
addedSignatures = signedRequest.witnesses.length - lengthBefore;
|
4269
4297
|
}
|
4270
4298
|
await this.estimatePredicates(signedRequest);
|
4299
|
+
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
4271
4300
|
let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
|
4272
4301
|
transactionRequest: signedRequest
|
4273
4302
|
});
|
@@ -4276,7 +4305,6 @@ var _Provider = class {
|
|
4276
4305
|
let missingContractIds = [];
|
4277
4306
|
let outputVariables = 0;
|
4278
4307
|
let gasUsed = bn17(0);
|
4279
|
-
txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
|
4280
4308
|
txRequestClone.maxFee = maxFee;
|
4281
4309
|
if (isScriptTransaction) {
|
4282
4310
|
txRequestClone.gasLimit = gasLimit;
|
@@ -4304,7 +4332,8 @@ var _Provider = class {
|
|
4304
4332
|
missingContractIds,
|
4305
4333
|
addedSignatures,
|
4306
4334
|
estimatedPredicates: txRequestClone.inputs,
|
4307
|
-
dryRunStatus
|
4335
|
+
dryRunStatus,
|
4336
|
+
updateMaxFee
|
4308
4337
|
};
|
4309
4338
|
}
|
4310
4339
|
async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
|
@@ -4377,7 +4406,7 @@ var _Provider = class {
|
|
4377
4406
|
};
|
4378
4407
|
const result = await this.operations.getCoinsToSpend(coinsQuery);
|
4379
4408
|
const coins = result.coinsToSpend.flat().map((coin) => {
|
4380
|
-
switch (coin.
|
4409
|
+
switch (coin.type) {
|
4381
4410
|
case "MessageCoin":
|
4382
4411
|
return {
|
4383
4412
|
amount: bn17(coin.amount),
|
@@ -4769,8 +4798,33 @@ var CHAIN_IDS = {
|
|
4769
4798
|
}
|
4770
4799
|
};
|
4771
4800
|
|
4772
|
-
// src/providers/assets/
|
4773
|
-
var
|
4801
|
+
// src/providers/assets/utils/url.ts
|
4802
|
+
var DELIMITER_PATH = "/";
|
4803
|
+
var trimRegex = /^\/|\/$/g;
|
4804
|
+
var trimPath = (path2 = "") => path2.replace(trimRegex, "");
|
4805
|
+
function urlJoin(baseUrl, ...paths) {
|
4806
|
+
const hasBaseUrl = baseUrl !== null && baseUrl !== void 0;
|
4807
|
+
const rootPath = baseUrl?.[0] === "/" && baseUrl.length > 1;
|
4808
|
+
const allPaths = [baseUrl, ...paths].filter(Boolean).map(trimPath);
|
4809
|
+
if (rootPath && hasBaseUrl) {
|
4810
|
+
allPaths.unshift("");
|
4811
|
+
}
|
4812
|
+
return allPaths.join(DELIMITER_PATH);
|
4813
|
+
}
|
4814
|
+
|
4815
|
+
// src/providers/assets/utils/resolveIconPaths.ts
|
4816
|
+
function resolveIconPaths(assets2, basePath = "./") {
|
4817
|
+
return assets2.map((asset) => ({
|
4818
|
+
...asset,
|
4819
|
+
icon: urlJoin(basePath, asset.icon)
|
4820
|
+
}));
|
4821
|
+
}
|
4822
|
+
|
4823
|
+
// src/providers/assets/utils/fuelAssetsBaseUrl.ts
|
4824
|
+
var fuelAssetsBaseUrl = "https://cdn.fuel.network/assets/";
|
4825
|
+
|
4826
|
+
// src/providers/assets/assets.ts
|
4827
|
+
var rawAssets = [
|
4774
4828
|
{
|
4775
4829
|
name: "Ethereum",
|
4776
4830
|
symbol: "ETH",
|
@@ -4801,6 +4855,7 @@ var assets = [
|
|
4801
4855
|
]
|
4802
4856
|
}
|
4803
4857
|
];
|
4858
|
+
var assets = resolveIconPaths(rawAssets, fuelAssetsBaseUrl);
|
4804
4859
|
|
4805
4860
|
// src/providers/transaction-request/helpers.ts
|
4806
4861
|
import { bn as bn19 } from "@fuel-ts/math";
|
@@ -5010,18 +5065,18 @@ var Account = class extends AbstractAccount {
|
|
5010
5065
|
return balances;
|
5011
5066
|
}
|
5012
5067
|
/**
|
5013
|
-
*
|
5068
|
+
* Funds a transaction request by adding the necessary resources.
|
5014
5069
|
*
|
5015
|
-
* @
|
5016
|
-
* @param
|
5017
|
-
* @param
|
5018
|
-
* @returns
|
5070
|
+
* @typeParam T - The type of the TransactionRequest.
|
5071
|
+
* @param request - The transaction request to fund.
|
5072
|
+
* @param params - The estimated transaction parameters.
|
5073
|
+
* @returns The funded transaction request.
|
5019
5074
|
*/
|
5020
5075
|
async fund(request, params) {
|
5021
|
-
const { addedSignatures, estimatedPredicates,
|
5076
|
+
const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee } = params;
|
5077
|
+
const fee = request.maxFee;
|
5022
5078
|
const baseAssetId = this.provider.getBaseAssetId();
|
5023
5079
|
const requiredInBaseAsset = requiredQuantities.find((quantity) => quantity.assetId === baseAssetId)?.amount || bn20(0);
|
5024
|
-
const txRequest = request;
|
5025
5080
|
const requiredQuantitiesWithFee = addAmountToCoinQuantities({
|
5026
5081
|
amount: bn20(fee),
|
5027
5082
|
assetId: baseAssetId,
|
@@ -5058,14 +5113,17 @@ var Account = class extends AbstractAccount {
|
|
5058
5113
|
cacheTxInputsFromOwner(request.inputs, this.address)
|
5059
5114
|
);
|
5060
5115
|
request.addResources(resources);
|
5061
|
-
|
5062
|
-
|
5063
|
-
const requestToReestimate2 = clone4(
|
5116
|
+
request.shiftPredicateData();
|
5117
|
+
request.updatePredicateGasUsed(estimatedPredicates);
|
5118
|
+
const requestToReestimate2 = clone4(request);
|
5064
5119
|
if (addedSignatures) {
|
5065
5120
|
Array.from({ length: addedSignatures }).forEach(
|
5066
5121
|
() => requestToReestimate2.addEmptyWitness()
|
5067
5122
|
);
|
5068
5123
|
}
|
5124
|
+
if (!updateMaxFee) {
|
5125
|
+
break;
|
5126
|
+
}
|
5069
5127
|
const { maxFee: newFee } = await this.provider.estimateTxGasAndFee({
|
5070
5128
|
transactionRequest: requestToReestimate2
|
5071
5129
|
});
|
@@ -5087,17 +5145,20 @@ var Account = class extends AbstractAccount {
|
|
5087
5145
|
}
|
5088
5146
|
fundingAttempts += 1;
|
5089
5147
|
}
|
5090
|
-
|
5091
|
-
|
5092
|
-
const requestToReestimate = clone4(
|
5148
|
+
request.shiftPredicateData();
|
5149
|
+
request.updatePredicateGasUsed(estimatedPredicates);
|
5150
|
+
const requestToReestimate = clone4(request);
|
5093
5151
|
if (addedSignatures) {
|
5094
5152
|
Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());
|
5095
5153
|
}
|
5154
|
+
if (!updateMaxFee) {
|
5155
|
+
return request;
|
5156
|
+
}
|
5096
5157
|
const { maxFee } = await this.provider.estimateTxGasAndFee({
|
5097
5158
|
transactionRequest: requestToReestimate
|
5098
5159
|
});
|
5099
|
-
|
5100
|
-
return
|
5160
|
+
request.maxFee = maxFee;
|
5161
|
+
return request;
|
5101
5162
|
}
|
5102
5163
|
/**
|
5103
5164
|
* A helper that creates a transfer transaction request and returns it.
|
@@ -5109,20 +5170,19 @@ var Account = class extends AbstractAccount {
|
|
5109
5170
|
* @returns A promise that resolves to the prepared transaction request.
|
5110
5171
|
*/
|
5111
5172
|
async createTransfer(destination, amount, assetId, txParams = {}) {
|
5112
|
-
|
5173
|
+
let request = new ScriptTransactionRequest(txParams);
|
5113
5174
|
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
5114
5175
|
request.addCoinOutput(Address3.fromAddressOrString(destination), amount, assetIdToTransfer);
|
5115
5176
|
const txCost = await this.provider.getTransactionCost(request, {
|
5116
5177
|
estimateTxDependencies: true,
|
5117
5178
|
resourcesOwner: this
|
5118
5179
|
});
|
5119
|
-
this.validateGasLimitAndMaxFee({
|
5180
|
+
request = this.validateGasLimitAndMaxFee({
|
5181
|
+
transactionRequest: request,
|
5120
5182
|
gasUsed: txCost.gasUsed,
|
5121
5183
|
maxFee: txCost.maxFee,
|
5122
5184
|
txParams
|
5123
5185
|
});
|
5124
|
-
request.gasLimit = txCost.gasUsed;
|
5125
|
-
request.maxFee = txCost.maxFee;
|
5126
5186
|
await this.fund(request, txCost);
|
5127
5187
|
return request;
|
5128
5188
|
}
|
@@ -5169,7 +5229,7 @@ var Account = class extends AbstractAccount {
|
|
5169
5229
|
amountToTransfer: bn20(amount),
|
5170
5230
|
assetId: assetIdToTransfer
|
5171
5231
|
});
|
5172
|
-
|
5232
|
+
let request = new ScriptTransactionRequest({
|
5173
5233
|
...txParams,
|
5174
5234
|
script,
|
5175
5235
|
scriptData
|
@@ -5179,13 +5239,12 @@ var Account = class extends AbstractAccount {
|
|
5179
5239
|
resourcesOwner: this,
|
5180
5240
|
quantitiesToContract: [{ amount: bn20(amount), assetId: String(assetIdToTransfer) }]
|
5181
5241
|
});
|
5182
|
-
this.validateGasLimitAndMaxFee({
|
5242
|
+
request = this.validateGasLimitAndMaxFee({
|
5243
|
+
transactionRequest: request,
|
5183
5244
|
gasUsed: txCost.gasUsed,
|
5184
5245
|
maxFee: txCost.maxFee,
|
5185
5246
|
txParams
|
5186
5247
|
});
|
5187
|
-
request.gasLimit = txCost.gasUsed;
|
5188
|
-
request.maxFee = txCost.maxFee;
|
5189
5248
|
await this.fund(request, txCost);
|
5190
5249
|
return this.sendTransaction(request);
|
5191
5250
|
}
|
@@ -5212,16 +5271,15 @@ var Account = class extends AbstractAccount {
|
|
5212
5271
|
]);
|
5213
5272
|
const params = { script, ...txParams };
|
5214
5273
|
const baseAssetId = this.provider.getBaseAssetId();
|
5215
|
-
|
5274
|
+
let request = new ScriptTransactionRequest(params);
|
5216
5275
|
const quantitiesToContract = [{ amount: bn20(amount), assetId: baseAssetId }];
|
5217
5276
|
const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
|
5218
|
-
this.validateGasLimitAndMaxFee({
|
5277
|
+
request = this.validateGasLimitAndMaxFee({
|
5278
|
+
transactionRequest: request,
|
5219
5279
|
gasUsed: txCost.gasUsed,
|
5220
5280
|
maxFee: txCost.maxFee,
|
5221
5281
|
txParams
|
5222
5282
|
});
|
5223
|
-
request.maxFee = txCost.maxFee;
|
5224
|
-
request.gasLimit = txCost.gasUsed;
|
5225
5283
|
await this.fund(request, txCost);
|
5226
5284
|
return this.sendTransaction(request);
|
5227
5285
|
}
|
@@ -5281,22 +5339,29 @@ var Account = class extends AbstractAccount {
|
|
5281
5339
|
return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
|
5282
5340
|
}
|
5283
5341
|
validateGasLimitAndMaxFee({
|
5284
|
-
txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },
|
5285
5342
|
gasUsed,
|
5286
|
-
maxFee
|
5343
|
+
maxFee,
|
5344
|
+
transactionRequest,
|
5345
|
+
txParams: { gasLimit: setGasLimit, maxFee: setMaxFee }
|
5287
5346
|
}) {
|
5288
|
-
|
5347
|
+
const request = transactionRequestify(transactionRequest);
|
5348
|
+
if (!isDefined2(setGasLimit)) {
|
5349
|
+
request.gasLimit = gasUsed;
|
5350
|
+
} else if (gasUsed.gt(setGasLimit)) {
|
5289
5351
|
throw new FuelError15(
|
5290
5352
|
ErrorCode15.GAS_LIMIT_TOO_LOW,
|
5291
5353
|
`Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`
|
5292
5354
|
);
|
5293
5355
|
}
|
5294
|
-
if (isDefined2(setMaxFee)
|
5356
|
+
if (!isDefined2(setMaxFee)) {
|
5357
|
+
request.maxFee = maxFee;
|
5358
|
+
} else if (maxFee.gt(setMaxFee)) {
|
5295
5359
|
throw new FuelError15(
|
5296
5360
|
ErrorCode15.MAX_FEE_TOO_LOW,
|
5297
5361
|
`Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`
|
5298
5362
|
);
|
5299
5363
|
}
|
5364
|
+
return request;
|
5300
5365
|
}
|
5301
5366
|
};
|
5302
5367
|
|