@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.

Files changed (37) hide show
  1. package/dist/account.d.ts +6 -6
  2. package/dist/account.d.ts.map +1 -1
  3. package/dist/index.global.js +188 -146
  4. package/dist/index.global.js.map +1 -1
  5. package/dist/index.js +271 -224
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +188 -143
  8. package/dist/index.mjs.map +1 -1
  9. package/dist/providers/__generated__/operations.d.ts +346 -552
  10. package/dist/providers/__generated__/operations.d.ts.map +1 -1
  11. package/dist/providers/assets/assets.d.ts +9 -0
  12. package/dist/providers/assets/assets.d.ts.map +1 -0
  13. package/dist/providers/assets/index.d.ts +1 -2
  14. package/dist/providers/assets/index.d.ts.map +1 -1
  15. package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts +2 -0
  16. package/dist/providers/assets/utils/fuelAssetsBaseUrl.d.ts.map +1 -0
  17. package/dist/providers/assets/utils/index.d.ts +1 -0
  18. package/dist/providers/assets/utils/index.d.ts.map +1 -1
  19. package/dist/providers/assets/utils/resolveIconPaths.d.ts.map +1 -1
  20. package/dist/providers/provider.d.ts +5 -9
  21. package/dist/providers/provider.d.ts.map +1 -1
  22. package/dist/providers/transaction-summary/receipt.d.ts +2 -2
  23. package/dist/providers/transaction-summary/receipt.d.ts.map +1 -1
  24. package/dist/providers/transaction-summary/types.d.ts +5 -13
  25. package/dist/providers/transaction-summary/types.d.ts.map +1 -1
  26. package/dist/providers/utils/extract-tx-error.d.ts +2 -2
  27. package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
  28. package/dist/providers/utils/gas.d.ts.map +1 -1
  29. package/dist/providers/utils/receipts.d.ts +2 -2
  30. package/dist/providers/utils/receipts.d.ts.map +1 -1
  31. package/dist/test-utils.global.js +210 -146
  32. package/dist/test-utils.global.js.map +1 -1
  33. package/dist/test-utils.js +283 -218
  34. package/dist/test-utils.js.map +1 -1
  35. package/dist/test-utils.mjs +208 -143
  36. package/dist/test-utils.mjs.map +1 -1
  37. package/package.json +15 -15
@@ -32432,9 +32432,9 @@ spurious results.`);
32432
32432
  // ../versions/dist/index.mjs
32433
32433
  function getBuiltinVersions() {
32434
32434
  return {
32435
- FORC: "0.56.0",
32435
+ FORC: "0.56.1",
32436
32436
  FUEL_CORE: "0.26.0",
32437
- FUELS: "0.84.0"
32437
+ FUELS: "0.85.0"
32438
32438
  };
32439
32439
  }
32440
32440
  function parseVersion(version2) {
@@ -32555,7 +32555,6 @@ This unreleased fuel-core build may include features and updates not yet support
32555
32555
  ErrorCode2["ACCOUNT_REQUIRED"] = "account-required";
32556
32556
  ErrorCode2["UNLOCKED_WALLET_REQUIRED"] = "unlocked-wallet-required";
32557
32557
  ErrorCode2["ERROR_BUILDING_BLOCK_EXPLORER_URL"] = "error-building-block-explorer-url";
32558
- ErrorCode2["UNSUPPORTED_FUEL_CLIENT_VERSION"] = "unsupported-fuel-client-version";
32559
32558
  ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error";
32560
32559
  ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall";
32561
32560
  ErrorCode2["SCRIPT_REVERTED"] = "script-reverted";
@@ -41518,7 +41517,7 @@ spurious results.`);
41518
41517
  var lib_default2 = gql;
41519
41518
 
41520
41519
  // src/providers/__generated__/operations.ts
41521
- var TransactionStatusSubscriptionFragmentFragmentDoc = lib_default2`
41520
+ var TransactionStatusSubscriptionFragmentDoc = lib_default2`
41522
41521
  fragment transactionStatusSubscriptionFragment on TransactionStatus {
41523
41522
  type: __typename
41524
41523
  ... on SqueezedOutStatus {
@@ -41526,7 +41525,13 @@ spurious results.`);
41526
41525
  }
41527
41526
  }
41528
41527
  `;
41529
- var ReceiptFragmentFragmentDoc = lib_default2`
41528
+ var SubmittedStatusFragmentDoc = lib_default2`
41529
+ fragment SubmittedStatusFragment on SubmittedStatus {
41530
+ type: __typename
41531
+ time
41532
+ }
41533
+ `;
41534
+ var ReceiptFragmentDoc = lib_default2`
41530
41535
  fragment receiptFragment on Receipt {
41531
41536
  id
41532
41537
  pc
@@ -41558,45 +41563,65 @@ spurious results.`);
41558
41563
  subId
41559
41564
  }
41560
41565
  `;
41561
- var TransactionStatusFragmentFragmentDoc = lib_default2`
41562
- fragment transactionStatusFragment on TransactionStatus {
41566
+ var SuccessStatusFragmentDoc = lib_default2`
41567
+ fragment SuccessStatusFragment on SuccessStatus {
41568
+ type: __typename
41569
+ block {
41570
+ id
41571
+ }
41572
+ time
41573
+ programState {
41574
+ returnType
41575
+ data
41576
+ }
41577
+ receipts {
41578
+ ...receiptFragment
41579
+ }
41580
+ totalGas
41581
+ totalFee
41582
+ }
41583
+ ${ReceiptFragmentDoc}`;
41584
+ var FailureStatusFragmentDoc = lib_default2`
41585
+ fragment FailureStatusFragment on FailureStatus {
41586
+ type: __typename
41587
+ block {
41588
+ id
41589
+ }
41590
+ totalGas
41591
+ totalFee
41592
+ time
41593
+ reason
41594
+ receipts {
41595
+ ...receiptFragment
41596
+ }
41597
+ }
41598
+ ${ReceiptFragmentDoc}`;
41599
+ var SqueezedOutStatusFragmentDoc = lib_default2`
41600
+ fragment SqueezedOutStatusFragment on SqueezedOutStatus {
41563
41601
  type: __typename
41602
+ reason
41603
+ }
41604
+ `;
41605
+ var TransactionStatusFragmentDoc = lib_default2`
41606
+ fragment transactionStatusFragment on TransactionStatus {
41564
41607
  ... on SubmittedStatus {
41565
- time
41608
+ ...SubmittedStatusFragment
41566
41609
  }
41567
41610
  ... on SuccessStatus {
41568
- block {
41569
- id
41570
- }
41571
- time
41572
- programState {
41573
- returnType
41574
- data
41575
- }
41576
- receipts {
41577
- ...receiptFragment
41578
- }
41579
- totalGas
41580
- totalFee
41611
+ ...SuccessStatusFragment
41581
41612
  }
41582
41613
  ... on FailureStatus {
41583
- block {
41584
- id
41585
- }
41586
- totalGas
41587
- totalFee
41588
- time
41589
- reason
41590
- receipts {
41591
- ...receiptFragment
41592
- }
41614
+ ...FailureStatusFragment
41593
41615
  }
41594
41616
  ... on SqueezedOutStatus {
41595
- reason
41617
+ ...SqueezedOutStatusFragment
41596
41618
  }
41597
41619
  }
41598
- ${ReceiptFragmentFragmentDoc}`;
41599
- var TransactionFragmentFragmentDoc = lib_default2`
41620
+ ${SubmittedStatusFragmentDoc}
41621
+ ${SuccessStatusFragmentDoc}
41622
+ ${FailureStatusFragmentDoc}
41623
+ ${SqueezedOutStatusFragmentDoc}`;
41624
+ var TransactionFragmentDoc = lib_default2`
41600
41625
  fragment transactionFragment on Transaction {
41601
41626
  id
41602
41627
  rawPayload
@@ -41604,8 +41629,8 @@ spurious results.`);
41604
41629
  ...transactionStatusFragment
41605
41630
  }
41606
41631
  }
41607
- ${TransactionStatusFragmentFragmentDoc}`;
41608
- var InputEstimatePredicatesFragmentFragmentDoc = lib_default2`
41632
+ ${TransactionStatusFragmentDoc}`;
41633
+ var InputEstimatePredicatesFragmentDoc = lib_default2`
41609
41634
  fragment inputEstimatePredicatesFragment on Input {
41610
41635
  ... on InputCoin {
41611
41636
  predicateGasUsed
@@ -41615,14 +41640,14 @@ spurious results.`);
41615
41640
  }
41616
41641
  }
41617
41642
  `;
41618
- var TransactionEstimatePredicatesFragmentFragmentDoc = lib_default2`
41643
+ var TransactionEstimatePredicatesFragmentDoc = lib_default2`
41619
41644
  fragment transactionEstimatePredicatesFragment on Transaction {
41620
41645
  inputs {
41621
41646
  ...inputEstimatePredicatesFragment
41622
41647
  }
41623
41648
  }
41624
- ${InputEstimatePredicatesFragmentFragmentDoc}`;
41625
- var DryRunFailureStatusFragmentFragmentDoc = lib_default2`
41649
+ ${InputEstimatePredicatesFragmentDoc}`;
41650
+ var DryRunFailureStatusFragmentDoc = lib_default2`
41626
41651
  fragment dryRunFailureStatusFragment on DryRunFailureStatus {
41627
41652
  totalGas
41628
41653
  totalFee
@@ -41633,7 +41658,7 @@ spurious results.`);
41633
41658
  }
41634
41659
  }
41635
41660
  `;
41636
- var DryRunSuccessStatusFragmentFragmentDoc = lib_default2`
41661
+ var DryRunSuccessStatusFragmentDoc = lib_default2`
41637
41662
  fragment dryRunSuccessStatusFragment on DryRunSuccessStatus {
41638
41663
  totalGas
41639
41664
  totalFee
@@ -41643,7 +41668,7 @@ spurious results.`);
41643
41668
  }
41644
41669
  }
41645
41670
  `;
41646
- var DryRunTransactionStatusFragmentFragmentDoc = lib_default2`
41671
+ var DryRunTransactionStatusFragmentDoc = lib_default2`
41647
41672
  fragment dryRunTransactionStatusFragment on DryRunTransactionStatus {
41648
41673
  ... on DryRunFailureStatus {
41649
41674
  ...dryRunFailureStatusFragment
@@ -41652,9 +41677,9 @@ spurious results.`);
41652
41677
  ...dryRunSuccessStatusFragment
41653
41678
  }
41654
41679
  }
41655
- ${DryRunFailureStatusFragmentFragmentDoc}
41656
- ${DryRunSuccessStatusFragmentFragmentDoc}`;
41657
- var DryRunTransactionExecutionStatusFragmentFragmentDoc = lib_default2`
41680
+ ${DryRunFailureStatusFragmentDoc}
41681
+ ${DryRunSuccessStatusFragmentDoc}`;
41682
+ var DryRunTransactionExecutionStatusFragmentDoc = lib_default2`
41658
41683
  fragment dryRunTransactionExecutionStatusFragment on DryRunTransactionExecutionStatus {
41659
41684
  id
41660
41685
  status {
@@ -41664,11 +41689,11 @@ ${DryRunSuccessStatusFragmentFragmentDoc}`;
41664
41689
  ...receiptFragment
41665
41690
  }
41666
41691
  }
41667
- ${DryRunTransactionStatusFragmentFragmentDoc}
41668
- ${ReceiptFragmentFragmentDoc}`;
41669
- var CoinFragmentFragmentDoc = lib_default2`
41692
+ ${DryRunTransactionStatusFragmentDoc}
41693
+ ${ReceiptFragmentDoc}`;
41694
+ var CoinFragmentDoc = lib_default2`
41670
41695
  fragment coinFragment on Coin {
41671
- __typename
41696
+ type: __typename
41672
41697
  utxoId
41673
41698
  owner
41674
41699
  amount
@@ -41677,9 +41702,9 @@ ${ReceiptFragmentFragmentDoc}`;
41677
41702
  txCreatedIdx
41678
41703
  }
41679
41704
  `;
41680
- var MessageCoinFragmentFragmentDoc = lib_default2`
41705
+ var MessageCoinFragmentDoc = lib_default2`
41681
41706
  fragment messageCoinFragment on MessageCoin {
41682
- __typename
41707
+ type: __typename
41683
41708
  sender
41684
41709
  recipient
41685
41710
  nonce
@@ -41688,7 +41713,7 @@ ${ReceiptFragmentFragmentDoc}`;
41688
41713
  daHeight
41689
41714
  }
41690
41715
  `;
41691
- var MessageFragmentFragmentDoc = lib_default2`
41716
+ var MessageFragmentDoc = lib_default2`
41692
41717
  fragment messageFragment on Message {
41693
41718
  amount
41694
41719
  sender
@@ -41698,7 +41723,7 @@ ${ReceiptFragmentFragmentDoc}`;
41698
41723
  daHeight
41699
41724
  }
41700
41725
  `;
41701
- var MessageProofFragmentFragmentDoc = lib_default2`
41726
+ var MessageProofFragmentDoc = lib_default2`
41702
41727
  fragment messageProofFragment on MessageProof {
41703
41728
  messageProof {
41704
41729
  proofSet
@@ -41745,14 +41770,14 @@ ${ReceiptFragmentFragmentDoc}`;
41745
41770
  data
41746
41771
  }
41747
41772
  `;
41748
- var BalanceFragmentFragmentDoc = lib_default2`
41773
+ var BalanceFragmentDoc = lib_default2`
41749
41774
  fragment balanceFragment on Balance {
41750
41775
  owner
41751
41776
  amount
41752
41777
  assetId
41753
41778
  }
41754
41779
  `;
41755
- var BlockFragmentFragmentDoc = lib_default2`
41780
+ var BlockFragmentDoc = lib_default2`
41756
41781
  fragment blockFragment on Block {
41757
41782
  id
41758
41783
  height
@@ -41764,7 +41789,7 @@ ${ReceiptFragmentFragmentDoc}`;
41764
41789
  }
41765
41790
  }
41766
41791
  `;
41767
- var TxParametersFragmentFragmentDoc = lib_default2`
41792
+ var TxParametersFragmentDoc = lib_default2`
41768
41793
  fragment TxParametersFragment on TxParameters {
41769
41794
  version
41770
41795
  maxInputs
@@ -41775,7 +41800,7 @@ ${ReceiptFragmentFragmentDoc}`;
41775
41800
  maxBytecodeSubsections
41776
41801
  }
41777
41802
  `;
41778
- var PredicateParametersFragmentFragmentDoc = lib_default2`
41803
+ var PredicateParametersFragmentDoc = lib_default2`
41779
41804
  fragment PredicateParametersFragment on PredicateParameters {
41780
41805
  version
41781
41806
  maxPredicateLength
@@ -41784,41 +41809,42 @@ ${ReceiptFragmentFragmentDoc}`;
41784
41809
  maxMessageDataLength
41785
41810
  }
41786
41811
  `;
41787
- var ScriptParametersFragmentFragmentDoc = lib_default2`
41812
+ var ScriptParametersFragmentDoc = lib_default2`
41788
41813
  fragment ScriptParametersFragment on ScriptParameters {
41789
41814
  version
41790
41815
  maxScriptLength
41791
41816
  maxScriptDataLength
41792
41817
  }
41793
41818
  `;
41794
- var ContractParametersFragmentFragmentDoc = lib_default2`
41819
+ var ContractParametersFragmentDoc = lib_default2`
41795
41820
  fragment ContractParametersFragment on ContractParameters {
41796
41821
  version
41797
41822
  contractMaxSize
41798
41823
  maxStorageSlots
41799
41824
  }
41800
41825
  `;
41801
- var FeeParametersFragmentFragmentDoc = lib_default2`
41826
+ var FeeParametersFragmentDoc = lib_default2`
41802
41827
  fragment FeeParametersFragment on FeeParameters {
41803
41828
  version
41804
41829
  gasPriceFactor
41805
41830
  gasPerByte
41806
41831
  }
41807
41832
  `;
41808
- var DependentCostFragmentFragmentDoc = lib_default2`
41833
+ var DependentCostFragmentDoc = lib_default2`
41809
41834
  fragment DependentCostFragment on DependentCost {
41810
- __typename
41811
41835
  ... on LightOperation {
41836
+ type: __typename
41812
41837
  base
41813
41838
  unitsPerGas
41814
41839
  }
41815
41840
  ... on HeavyOperation {
41841
+ type: __typename
41816
41842
  base
41817
41843
  gasPerUnit
41818
41844
  }
41819
41845
  }
41820
41846
  `;
41821
- var GasCostsFragmentFragmentDoc = lib_default2`
41847
+ var GasCostsFragmentDoc = lib_default2`
41822
41848
  fragment GasCostsFragment on GasCosts {
41823
41849
  version
41824
41850
  add
@@ -41974,8 +42000,8 @@ ${ReceiptFragmentFragmentDoc}`;
41974
42000
  }
41975
42001
  newStoragePerByte
41976
42002
  }
41977
- ${DependentCostFragmentFragmentDoc}`;
41978
- var ConsensusParametersFragmentFragmentDoc = lib_default2`
42003
+ ${DependentCostFragmentDoc}`;
42004
+ var ConsensusParametersFragmentDoc = lib_default2`
41979
42005
  fragment consensusParametersFragment on ConsensusParameters {
41980
42006
  version
41981
42007
  txParams {
@@ -41999,13 +42025,13 @@ ${ReceiptFragmentFragmentDoc}`;
41999
42025
  baseAssetId
42000
42026
  chainId
42001
42027
  }
42002
- ${TxParametersFragmentFragmentDoc}
42003
- ${PredicateParametersFragmentFragmentDoc}
42004
- ${ScriptParametersFragmentFragmentDoc}
42005
- ${ContractParametersFragmentFragmentDoc}
42006
- ${FeeParametersFragmentFragmentDoc}
42007
- ${GasCostsFragmentFragmentDoc}`;
42008
- var ChainInfoFragmentFragmentDoc = lib_default2`
42028
+ ${TxParametersFragmentDoc}
42029
+ ${PredicateParametersFragmentDoc}
42030
+ ${ScriptParametersFragmentDoc}
42031
+ ${ContractParametersFragmentDoc}
42032
+ ${FeeParametersFragmentDoc}
42033
+ ${GasCostsFragmentDoc}`;
42034
+ var ChainInfoFragmentDoc = lib_default2`
42009
42035
  fragment chainInfoFragment on ChainInfo {
42010
42036
  name
42011
42037
  latestBlock {
@@ -42016,16 +42042,16 @@ ${GasCostsFragmentFragmentDoc}`;
42016
42042
  ...consensusParametersFragment
42017
42043
  }
42018
42044
  }
42019
- ${BlockFragmentFragmentDoc}
42020
- ${ConsensusParametersFragmentFragmentDoc}`;
42021
- var ContractBalanceFragmentFragmentDoc = lib_default2`
42045
+ ${BlockFragmentDoc}
42046
+ ${ConsensusParametersFragmentDoc}`;
42047
+ var ContractBalanceFragmentDoc = lib_default2`
42022
42048
  fragment contractBalanceFragment on ContractBalance {
42023
42049
  contract
42024
42050
  amount
42025
42051
  assetId
42026
42052
  }
42027
42053
  `;
42028
- var PageInfoFragmentFragmentDoc = lib_default2`
42054
+ var PageInfoFragmentDoc = lib_default2`
42029
42055
  fragment pageInfoFragment on PageInfo {
42030
42056
  hasPreviousPage
42031
42057
  hasNextPage
@@ -42033,7 +42059,7 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42033
42059
  endCursor
42034
42060
  }
42035
42061
  `;
42036
- var NodeInfoFragmentFragmentDoc = lib_default2`
42062
+ var NodeInfoFragmentDoc = lib_default2`
42037
42063
  fragment nodeInfoFragment on NodeInfo {
42038
42064
  utxoValidation
42039
42065
  vmBacktrace
@@ -42042,7 +42068,7 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42042
42068
  nodeVersion
42043
42069
  }
42044
42070
  `;
42045
- var RelayedTransactionStatusFragmentFragmentDoc = lib_default2`
42071
+ var RelayedTransactionStatusFragmentDoc = lib_default2`
42046
42072
  fragment relayedTransactionStatusFragment on RelayedTransactionStatus {
42047
42073
  ... on RelayedTransactionFailed {
42048
42074
  blockHeight
@@ -42063,28 +42089,28 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42063
42089
  ...nodeInfoFragment
42064
42090
  }
42065
42091
  }
42066
- ${NodeInfoFragmentFragmentDoc}`;
42092
+ ${NodeInfoFragmentDoc}`;
42067
42093
  var GetChainDocument = lib_default2`
42068
42094
  query getChain {
42069
42095
  chain {
42070
42096
  ...chainInfoFragment
42071
42097
  }
42072
42098
  }
42073
- ${ChainInfoFragmentFragmentDoc}`;
42099
+ ${ChainInfoFragmentDoc}`;
42074
42100
  var GetTransactionDocument = lib_default2`
42075
42101
  query getTransaction($transactionId: TransactionId!) {
42076
42102
  transaction(id: $transactionId) {
42077
42103
  ...transactionFragment
42078
42104
  }
42079
42105
  }
42080
- ${TransactionFragmentFragmentDoc}`;
42106
+ ${TransactionFragmentDoc}`;
42081
42107
  var GetTransactionWithReceiptsDocument = lib_default2`
42082
42108
  query getTransactionWithReceipts($transactionId: TransactionId!) {
42083
42109
  transaction(id: $transactionId) {
42084
42110
  ...transactionFragment
42085
42111
  }
42086
42112
  }
42087
- ${TransactionFragmentFragmentDoc}`;
42113
+ ${TransactionFragmentDoc}`;
42088
42114
  var GetTransactionsDocument = lib_default2`
42089
42115
  query getTransactions($after: String, $before: String, $first: Int, $last: Int) {
42090
42116
  transactions(after: $after, before: $before, first: $first, last: $last) {
@@ -42095,7 +42121,7 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42095
42121
  }
42096
42122
  }
42097
42123
  }
42098
- ${TransactionFragmentFragmentDoc}`;
42124
+ ${TransactionFragmentDoc}`;
42099
42125
  var GetTransactionsByOwnerDocument = lib_default2`
42100
42126
  query getTransactionsByOwner($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
42101
42127
  transactionsByOwner(
@@ -42115,22 +42141,22 @@ ${ConsensusParametersFragmentFragmentDoc}`;
42115
42141
  }
42116
42142
  }
42117
42143
  }
42118
- ${PageInfoFragmentFragmentDoc}
42119
- ${TransactionFragmentFragmentDoc}`;
42144
+ ${PageInfoFragmentDoc}
42145
+ ${TransactionFragmentDoc}`;
42120
42146
  var EstimatePredicatesDocument = lib_default2`
42121
42147
  query estimatePredicates($encodedTransaction: HexString!) {
42122
42148
  estimatePredicates(tx: $encodedTransaction) {
42123
42149
  ...transactionEstimatePredicatesFragment
42124
42150
  }
42125
42151
  }
42126
- ${TransactionEstimatePredicatesFragmentFragmentDoc}`;
42152
+ ${TransactionEstimatePredicatesFragmentDoc}`;
42127
42153
  var GetBlockDocument = lib_default2`
42128
42154
  query getBlock($blockId: BlockId, $height: U32) {
42129
42155
  block(id: $blockId, height: $height) {
42130
42156
  ...blockFragment
42131
42157
  }
42132
42158
  }
42133
- ${BlockFragmentFragmentDoc}`;
42159
+ ${BlockFragmentDoc}`;
42134
42160
  var GetBlockWithTransactionsDocument = lib_default2`
42135
42161
  query getBlockWithTransactions($blockId: BlockId, $blockHeight: U32) {
42136
42162
  block(id: $blockId, height: $blockHeight) {
@@ -42140,8 +42166,8 @@ ${TransactionFragmentFragmentDoc}`;
42140
42166
  }
42141
42167
  }
42142
42168
  }
42143
- ${BlockFragmentFragmentDoc}
42144
- ${TransactionFragmentFragmentDoc}`;
42169
+ ${BlockFragmentDoc}
42170
+ ${TransactionFragmentDoc}`;
42145
42171
  var GetBlocksDocument = lib_default2`
42146
42172
  query getBlocks($after: String, $before: String, $first: Int, $last: Int) {
42147
42173
  blocks(after: $after, before: $before, first: $first, last: $last) {
@@ -42152,14 +42178,14 @@ ${TransactionFragmentFragmentDoc}`;
42152
42178
  }
42153
42179
  }
42154
42180
  }
42155
- ${BlockFragmentFragmentDoc}`;
42181
+ ${BlockFragmentDoc}`;
42156
42182
  var GetCoinDocument = lib_default2`
42157
42183
  query getCoin($coinId: UtxoId!) {
42158
42184
  coin(utxoId: $coinId) {
42159
42185
  ...coinFragment
42160
42186
  }
42161
42187
  }
42162
- ${CoinFragmentFragmentDoc}`;
42188
+ ${CoinFragmentDoc}`;
42163
42189
  var GetCoinsDocument = lib_default2`
42164
42190
  query getCoins($filter: CoinFilterInput!, $after: String, $before: String, $first: Int, $last: Int) {
42165
42191
  coins(
@@ -42176,7 +42202,7 @@ ${TransactionFragmentFragmentDoc}`;
42176
42202
  }
42177
42203
  }
42178
42204
  }
42179
- ${CoinFragmentFragmentDoc}`;
42205
+ ${CoinFragmentDoc}`;
42180
42206
  var GetCoinsToSpendDocument = lib_default2`
42181
42207
  query getCoinsToSpend($owner: Address!, $queryPerAsset: [SpendQueryElementInput!]!, $excludedIds: ExcludeInput) {
42182
42208
  coinsToSpend(
@@ -42188,8 +42214,8 @@ ${TransactionFragmentFragmentDoc}`;
42188
42214
  ...messageCoinFragment
42189
42215
  }
42190
42216
  }
42191
- ${CoinFragmentFragmentDoc}
42192
- ${MessageCoinFragmentFragmentDoc}`;
42217
+ ${CoinFragmentDoc}
42218
+ ${MessageCoinFragmentDoc}`;
42193
42219
  var GetContractDocument = lib_default2`
42194
42220
  query getContract($contractId: ContractId!) {
42195
42221
  contract(id: $contractId) {
@@ -42204,14 +42230,14 @@ ${MessageCoinFragmentFragmentDoc}`;
42204
42230
  ...contractBalanceFragment
42205
42231
  }
42206
42232
  }
42207
- ${ContractBalanceFragmentFragmentDoc}`;
42233
+ ${ContractBalanceFragmentDoc}`;
42208
42234
  var GetBalanceDocument = lib_default2`
42209
42235
  query getBalance($owner: Address!, $assetId: AssetId!) {
42210
42236
  balance(owner: $owner, assetId: $assetId) {
42211
42237
  ...balanceFragment
42212
42238
  }
42213
42239
  }
42214
- ${BalanceFragmentFragmentDoc}`;
42240
+ ${BalanceFragmentDoc}`;
42215
42241
  var GetLatestGasPriceDocument = lib_default2`
42216
42242
  query getLatestGasPrice {
42217
42243
  latestGasPrice {
@@ -42242,7 +42268,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42242
42268
  }
42243
42269
  }
42244
42270
  }
42245
- ${BalanceFragmentFragmentDoc}`;
42271
+ ${BalanceFragmentDoc}`;
42246
42272
  var GetMessagesDocument = lib_default2`
42247
42273
  query getMessages($owner: Address!, $after: String, $before: String, $first: Int, $last: Int) {
42248
42274
  messages(
@@ -42259,7 +42285,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42259
42285
  }
42260
42286
  }
42261
42287
  }
42262
- ${MessageFragmentFragmentDoc}`;
42288
+ ${MessageFragmentDoc}`;
42263
42289
  var GetMessageProofDocument = lib_default2`
42264
42290
  query getMessageProof($transactionId: TransactionId!, $nonce: Nonce!, $commitBlockId: BlockId, $commitBlockHeight: U32) {
42265
42291
  messageProof(
@@ -42271,7 +42297,7 @@ ${MessageCoinFragmentFragmentDoc}`;
42271
42297
  ...messageProofFragment
42272
42298
  }
42273
42299
  }
42274
- ${MessageProofFragmentFragmentDoc}`;
42300
+ ${MessageProofFragmentDoc}`;
42275
42301
  var GetMessageStatusDocument = lib_default2`
42276
42302
  query getMessageStatus($nonce: Nonce!) {
42277
42303
  messageStatus(nonce: $nonce) {
@@ -42285,14 +42311,14 @@ ${MessageCoinFragmentFragmentDoc}`;
42285
42311
  ...relayedTransactionStatusFragment
42286
42312
  }
42287
42313
  }
42288
- ${RelayedTransactionStatusFragmentFragmentDoc}`;
42314
+ ${RelayedTransactionStatusFragmentDoc}`;
42289
42315
  var DryRunDocument = lib_default2`
42290
42316
  mutation dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean) {
42291
42317
  dryRun(txs: $encodedTransactions, utxoValidation: $utxoValidation) {
42292
42318
  ...dryRunTransactionExecutionStatusFragment
42293
42319
  }
42294
42320
  }
42295
- ${DryRunTransactionExecutionStatusFragmentFragmentDoc}`;
42321
+ ${DryRunTransactionExecutionStatusFragmentDoc}`;
42296
42322
  var SubmitDocument = lib_default2`
42297
42323
  mutation submit($encodedTransaction: HexString!) {
42298
42324
  submit(tx: $encodedTransaction) {
@@ -42314,21 +42340,21 @@ ${MessageCoinFragmentFragmentDoc}`;
42314
42340
  ...messageFragment
42315
42341
  }
42316
42342
  }
42317
- ${MessageFragmentFragmentDoc}`;
42343
+ ${MessageFragmentDoc}`;
42318
42344
  var SubmitAndAwaitDocument = lib_default2`
42319
42345
  subscription submitAndAwait($encodedTransaction: HexString!) {
42320
42346
  submitAndAwait(tx: $encodedTransaction) {
42321
42347
  ...transactionStatusSubscriptionFragment
42322
42348
  }
42323
42349
  }
42324
- ${TransactionStatusSubscriptionFragmentFragmentDoc}`;
42350
+ ${TransactionStatusSubscriptionFragmentDoc}`;
42325
42351
  var StatusChangeDocument = lib_default2`
42326
42352
  subscription statusChange($transactionId: TransactionId!) {
42327
42353
  statusChange(id: $transactionId) {
42328
42354
  ...transactionStatusSubscriptionFragment
42329
42355
  }
42330
42356
  }
42331
- ${TransactionStatusSubscriptionFragmentFragmentDoc}`;
42357
+ ${TransactionStatusSubscriptionFragmentDoc}`;
42332
42358
  function getSdk(requester) {
42333
42359
  return {
42334
42360
  getVersion(variables, options) {
@@ -42957,10 +42983,9 @@ ${MessageCoinFragmentFragmentDoc}`;
42957
42983
  function resolveGasDependentCosts(byteSize, gasDependentCost) {
42958
42984
  const base = bn(gasDependentCost.base);
42959
42985
  let dependentValue = bn(0);
42960
- if (gasDependentCost.__typename === "LightOperation") {
42986
+ if ("unitsPerGas" in gasDependentCost) {
42961
42987
  dependentValue = bn(byteSize).div(bn(gasDependentCost.unitsPerGas));
42962
- }
42963
- if (gasDependentCost.__typename === "HeavyOperation") {
42988
+ } else {
42964
42989
  dependentValue = bn(byteSize).mul(bn(gasDependentCost.gasPerUnit));
42965
42990
  }
42966
42991
  return base.add(dependentValue);
@@ -45194,9 +45219,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45194
45219
  static ensureClientVersionIsSupported(nodeInfo) {
45195
45220
  const { isMajorSupported, isMinorSupported, supportedVersion } = checkFuelCoreVersionCompatibility(nodeInfo.nodeVersion);
45196
45221
  if (!isMajorSupported || !isMinorSupported) {
45197
- throw new FuelError(
45198
- FuelError.CODES.UNSUPPORTED_FUEL_CLIENT_VERSION,
45199
- `Fuel client version: ${nodeInfo.nodeVersion}, Supported version: ${supportedVersion}`
45222
+ console.warn(
45223
+ `The Fuel Node that you are trying to connect to is using fuel-core version ${nodeInfo.nodeVersion},
45224
+ which is not supported by the version of the TS SDK that you are using.
45225
+ Things may not work as expected.
45226
+ Supported fuel-core version: ${supportedVersion}.`
45200
45227
  );
45201
45228
  }
45202
45229
  }
@@ -45633,10 +45660,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45633
45660
  const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
45634
45661
  const isScriptTransaction = txRequestClone.type === TransactionType.Script;
45635
45662
  const baseAssetId = this.getBaseAssetId();
45663
+ const updateMaxFee = txRequestClone.maxFee.eq(0);
45636
45664
  const coinOutputsQuantities = txRequestClone.getCoinOutputsQuantities();
45637
45665
  const allQuantities = mergeQuantities(coinOutputsQuantities, quantitiesToContract);
45638
45666
  txRequestClone.fundWithFakeUtxos(allQuantities, baseAssetId, resourcesOwner?.address);
45639
- txRequestClone.maxFee = bn(0);
45640
45667
  if (isScriptTransaction) {
45641
45668
  txRequestClone.gasLimit = bn(0);
45642
45669
  }
@@ -45651,6 +45678,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45651
45678
  addedSignatures = signedRequest.witnesses.length - lengthBefore;
45652
45679
  }
45653
45680
  await this.estimatePredicates(signedRequest);
45681
+ txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
45654
45682
  let { maxFee, maxGas, minFee, minGas, gasPrice, gasLimit } = await this.estimateTxGasAndFee({
45655
45683
  transactionRequest: signedRequest
45656
45684
  });
@@ -45659,7 +45687,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45659
45687
  let missingContractIds = [];
45660
45688
  let outputVariables = 0;
45661
45689
  let gasUsed = bn(0);
45662
- txRequestClone.updatePredicateGasUsed(signedRequest.inputs);
45663
45690
  txRequestClone.maxFee = maxFee;
45664
45691
  if (isScriptTransaction) {
45665
45692
  txRequestClone.gasLimit = gasLimit;
@@ -45687,7 +45714,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45687
45714
  missingContractIds,
45688
45715
  addedSignatures,
45689
45716
  estimatedPredicates: txRequestClone.inputs,
45690
- dryRunStatus
45717
+ dryRunStatus,
45718
+ updateMaxFee
45691
45719
  };
45692
45720
  }
45693
45721
  async getResourcesForTransaction(owner, transactionRequestLike, quantitiesToContract = []) {
@@ -45760,7 +45788,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
45760
45788
  };
45761
45789
  const result = await this.operations.getCoinsToSpend(coinsQuery);
45762
45790
  const coins = result.coinsToSpend.flat().map((coin) => {
45763
- switch (coin.__typename) {
45791
+ switch (coin.type) {
45764
45792
  case "MessageCoin":
45765
45793
  return {
45766
45794
  amount: bn(coin.amount),
@@ -46146,8 +46174,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46146
46174
  }
46147
46175
  };
46148
46176
 
46149
- // src/providers/assets/index.ts
46150
- var assets = [
46177
+ // src/providers/assets/utils/url.ts
46178
+ var DELIMITER_PATH = "/";
46179
+ var trimRegex = /^\/|\/$/g;
46180
+ var trimPath = (path2 = "") => path2.replace(trimRegex, "");
46181
+ function urlJoin(baseUrl, ...paths) {
46182
+ const hasBaseUrl = baseUrl !== null && baseUrl !== void 0;
46183
+ const rootPath = baseUrl?.[0] === "/" && baseUrl.length > 1;
46184
+ const allPaths = [baseUrl, ...paths].filter(Boolean).map(trimPath);
46185
+ if (rootPath && hasBaseUrl) {
46186
+ allPaths.unshift("");
46187
+ }
46188
+ return allPaths.join(DELIMITER_PATH);
46189
+ }
46190
+
46191
+ // src/providers/assets/utils/resolveIconPaths.ts
46192
+ function resolveIconPaths(assets2, basePath = "./") {
46193
+ return assets2.map((asset) => ({
46194
+ ...asset,
46195
+ icon: urlJoin(basePath, asset.icon)
46196
+ }));
46197
+ }
46198
+
46199
+ // src/providers/assets/utils/fuelAssetsBaseUrl.ts
46200
+ var fuelAssetsBaseUrl = "https://cdn.fuel.network/assets/";
46201
+
46202
+ // src/providers/assets/assets.ts
46203
+ var rawAssets = [
46151
46204
  {
46152
46205
  name: "Ethereum",
46153
46206
  symbol: "ETH",
@@ -46178,6 +46231,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46178
46231
  ]
46179
46232
  }
46180
46233
  ];
46234
+ var assets = resolveIconPaths(rawAssets, fuelAssetsBaseUrl);
46181
46235
 
46182
46236
  // src/providers/transaction-request/helpers.ts
46183
46237
  var isRequestInputCoin = (input) => input.type === InputType.Coin;
@@ -46382,18 +46436,18 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46382
46436
  return balances;
46383
46437
  }
46384
46438
  /**
46385
- * Adds resources to the transaction enough to fund it.
46439
+ * Funds a transaction request by adding the necessary resources.
46386
46440
  *
46387
- * @param request - The transaction request.
46388
- * @param requiredQuantities - The coin quantities required to execute the transaction.
46389
- * @param fee - The estimated transaction fee.
46390
- * @returns A promise that resolves when the resources are added to the transaction.
46441
+ * @typeParam T - The type of the TransactionRequest.
46442
+ * @param request - The transaction request to fund.
46443
+ * @param params - The estimated transaction parameters.
46444
+ * @returns The funded transaction request.
46391
46445
  */
46392
46446
  async fund(request, params) {
46393
- const { addedSignatures, estimatedPredicates, maxFee: fee, requiredQuantities } = params;
46447
+ const { addedSignatures, estimatedPredicates, requiredQuantities, updateMaxFee } = params;
46448
+ const fee = request.maxFee;
46394
46449
  const baseAssetId = this.provider.getBaseAssetId();
46395
46450
  const requiredInBaseAsset = requiredQuantities.find((quantity) => quantity.assetId === baseAssetId)?.amount || bn(0);
46396
- const txRequest = request;
46397
46451
  const requiredQuantitiesWithFee = addAmountToCoinQuantities({
46398
46452
  amount: bn(fee),
46399
46453
  assetId: baseAssetId,
@@ -46430,14 +46484,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46430
46484
  cacheTxInputsFromOwner(request.inputs, this.address)
46431
46485
  );
46432
46486
  request.addResources(resources);
46433
- txRequest.shiftPredicateData();
46434
- txRequest.updatePredicateGasUsed(estimatedPredicates);
46435
- const requestToReestimate2 = clone_default(txRequest);
46487
+ request.shiftPredicateData();
46488
+ request.updatePredicateGasUsed(estimatedPredicates);
46489
+ const requestToReestimate2 = clone_default(request);
46436
46490
  if (addedSignatures) {
46437
46491
  Array.from({ length: addedSignatures }).forEach(
46438
46492
  () => requestToReestimate2.addEmptyWitness()
46439
46493
  );
46440
46494
  }
46495
+ if (!updateMaxFee) {
46496
+ break;
46497
+ }
46441
46498
  const { maxFee: newFee } = await this.provider.estimateTxGasAndFee({
46442
46499
  transactionRequest: requestToReestimate2
46443
46500
  });
@@ -46459,17 +46516,20 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46459
46516
  }
46460
46517
  fundingAttempts += 1;
46461
46518
  }
46462
- txRequest.shiftPredicateData();
46463
- txRequest.updatePredicateGasUsed(estimatedPredicates);
46464
- const requestToReestimate = clone_default(txRequest);
46519
+ request.shiftPredicateData();
46520
+ request.updatePredicateGasUsed(estimatedPredicates);
46521
+ const requestToReestimate = clone_default(request);
46465
46522
  if (addedSignatures) {
46466
46523
  Array.from({ length: addedSignatures }).forEach(() => requestToReestimate.addEmptyWitness());
46467
46524
  }
46525
+ if (!updateMaxFee) {
46526
+ return request;
46527
+ }
46468
46528
  const { maxFee } = await this.provider.estimateTxGasAndFee({
46469
46529
  transactionRequest: requestToReestimate
46470
46530
  });
46471
- txRequest.maxFee = maxFee;
46472
- return txRequest;
46531
+ request.maxFee = maxFee;
46532
+ return request;
46473
46533
  }
46474
46534
  /**
46475
46535
  * A helper that creates a transfer transaction request and returns it.
@@ -46481,20 +46541,19 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46481
46541
  * @returns A promise that resolves to the prepared transaction request.
46482
46542
  */
46483
46543
  async createTransfer(destination, amount, assetId, txParams = {}) {
46484
- const request = new ScriptTransactionRequest(txParams);
46544
+ let request = new ScriptTransactionRequest(txParams);
46485
46545
  const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
46486
46546
  request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
46487
46547
  const txCost = await this.provider.getTransactionCost(request, {
46488
46548
  estimateTxDependencies: true,
46489
46549
  resourcesOwner: this
46490
46550
  });
46491
- this.validateGasLimitAndMaxFee({
46551
+ request = this.validateGasLimitAndMaxFee({
46552
+ transactionRequest: request,
46492
46553
  gasUsed: txCost.gasUsed,
46493
46554
  maxFee: txCost.maxFee,
46494
46555
  txParams
46495
46556
  });
46496
- request.gasLimit = txCost.gasUsed;
46497
- request.maxFee = txCost.maxFee;
46498
46557
  await this.fund(request, txCost);
46499
46558
  return request;
46500
46559
  }
@@ -46541,7 +46600,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46541
46600
  amountToTransfer: bn(amount),
46542
46601
  assetId: assetIdToTransfer
46543
46602
  });
46544
- const request = new ScriptTransactionRequest({
46603
+ let request = new ScriptTransactionRequest({
46545
46604
  ...txParams,
46546
46605
  script,
46547
46606
  scriptData
@@ -46551,13 +46610,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46551
46610
  resourcesOwner: this,
46552
46611
  quantitiesToContract: [{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
46553
46612
  });
46554
- this.validateGasLimitAndMaxFee({
46613
+ request = this.validateGasLimitAndMaxFee({
46614
+ transactionRequest: request,
46555
46615
  gasUsed: txCost.gasUsed,
46556
46616
  maxFee: txCost.maxFee,
46557
46617
  txParams
46558
46618
  });
46559
- request.gasLimit = txCost.gasUsed;
46560
- request.maxFee = txCost.maxFee;
46561
46619
  await this.fund(request, txCost);
46562
46620
  return this.sendTransaction(request);
46563
46621
  }
@@ -46584,16 +46642,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46584
46642
  ]);
46585
46643
  const params = { script, ...txParams };
46586
46644
  const baseAssetId = this.provider.getBaseAssetId();
46587
- const request = new ScriptTransactionRequest(params);
46645
+ let request = new ScriptTransactionRequest(params);
46588
46646
  const quantitiesToContract = [{ amount: bn(amount), assetId: baseAssetId }];
46589
46647
  const txCost = await this.provider.getTransactionCost(request, { quantitiesToContract });
46590
- this.validateGasLimitAndMaxFee({
46648
+ request = this.validateGasLimitAndMaxFee({
46649
+ transactionRequest: request,
46591
46650
  gasUsed: txCost.gasUsed,
46592
46651
  maxFee: txCost.maxFee,
46593
46652
  txParams
46594
46653
  });
46595
- request.maxFee = txCost.maxFee;
46596
- request.gasLimit = txCost.gasUsed;
46597
46654
  await this.fund(request, txCost);
46598
46655
  return this.sendTransaction(request);
46599
46656
  }
@@ -46653,22 +46710,29 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
46653
46710
  return this.provider.simulate(transactionRequest, { estimateTxDependencies: false });
46654
46711
  }
46655
46712
  validateGasLimitAndMaxFee({
46656
- txParams: { gasLimit: setGasLimit, maxFee: setMaxFee },
46657
46713
  gasUsed,
46658
- maxFee
46714
+ maxFee,
46715
+ transactionRequest,
46716
+ txParams: { gasLimit: setGasLimit, maxFee: setMaxFee }
46659
46717
  }) {
46660
- if (isDefined(setGasLimit) && gasUsed.gt(setGasLimit)) {
46718
+ const request = transactionRequestify(transactionRequest);
46719
+ if (!isDefined(setGasLimit)) {
46720
+ request.gasLimit = gasUsed;
46721
+ } else if (gasUsed.gt(setGasLimit)) {
46661
46722
  throw new FuelError(
46662
46723
  ErrorCode.GAS_LIMIT_TOO_LOW,
46663
46724
  `Gas limit '${setGasLimit}' is lower than the required: '${gasUsed}'.`
46664
46725
  );
46665
46726
  }
46666
- if (isDefined(setMaxFee) && maxFee.gt(setMaxFee)) {
46727
+ if (!isDefined(setMaxFee)) {
46728
+ request.maxFee = maxFee;
46729
+ } else if (maxFee.gt(setMaxFee)) {
46667
46730
  throw new FuelError(
46668
46731
  ErrorCode.MAX_FEE_TOO_LOW,
46669
46732
  `Max fee '${setMaxFee}' is lower than the required: '${maxFee}'.`
46670
46733
  );
46671
46734
  }
46735
+ return request;
46672
46736
  }
46673
46737
  };
46674
46738