@fuel-ts/account 0.0.0-rc-1976-20240410141707 → 0.0.0-rc-1976-20240410142521

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.

@@ -1624,7 +1624,7 @@ var BaseTransactionRequest = class {
1624
1624
  /** List of witnesses */
1625
1625
  witnesses = [];
1626
1626
  /** Base asset ID - should be fetched from the chain */
1627
- baseAssetId = import_configs6.ZeroBytes32;
1627
+ baseAssetId;
1628
1628
  /**
1629
1629
  * Constructor for initializing a base transaction request.
1630
1630
  *
@@ -1639,7 +1639,7 @@ var BaseTransactionRequest = class {
1639
1639
  outputs,
1640
1640
  witnesses,
1641
1641
  baseAssetId
1642
- } = {}) {
1642
+ }) {
1643
1643
  this.gasPrice = (0, import_math7.bn)(gasPrice);
1644
1644
  this.maturity = maturity ?? 0;
1645
1645
  this.witnessLimit = witnessLimit ? (0, import_math7.bn)(witnessLimit) : void 0;
@@ -1647,7 +1647,7 @@ var BaseTransactionRequest = class {
1647
1647
  this.inputs = inputs ?? [];
1648
1648
  this.outputs = outputs ?? [];
1649
1649
  this.witnesses = witnesses ?? [];
1650
- this.baseAssetId = baseAssetId ?? import_configs6.ZeroBytes32;
1650
+ this.baseAssetId = baseAssetId;
1651
1651
  }
1652
1652
  static getPolicyMeta(req) {
1653
1653
  let policyTypes = 0;
@@ -2246,12 +2246,7 @@ var CreateTransactionRequest = class extends BaseTransactionRequest {
2246
2246
  *
2247
2247
  * @param createTransactionRequestLike - The initial values for the instance
2248
2248
  */
2249
- constructor({
2250
- bytecodeWitnessIndex,
2251
- salt,
2252
- storageSlots,
2253
- ...rest
2254
- } = {}) {
2249
+ constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
2255
2250
  super(rest);
2256
2251
  this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
2257
2252
  this.salt = (0, import_utils13.hexlify)(salt ?? import_configs8.ZeroBytes32);
@@ -2375,7 +2370,7 @@ var ScriptTransactionRequest = class extends BaseTransactionRequest {
2375
2370
  *
2376
2371
  * @param scriptTransactionRequestLike - The initial values for the instance.
2377
2372
  */
2378
- constructor({ script, scriptData, gasLimit, ...rest } = {}) {
2373
+ constructor({ script, scriptData, gasLimit, ...rest }) {
2379
2374
  super(rest);
2380
2375
  this.gasLimit = (0, import_math10.bn)(gasLimit);
2381
2376
  this.script = (0, import_utils15.arrayify)(script ?? returnZeroScript.bytes);
@@ -4729,8 +4724,9 @@ var Account = class extends import_interfaces.AbstractAccount {
4729
4724
  */
4730
4725
  async createTransfer(destination, amount, assetId, txParams = {}) {
4731
4726
  const { minGasPrice } = this.provider.getGasConfig();
4727
+ const baseAssetId = this.provider.getBaseAssetId();
4732
4728
  const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
4733
- const params = { gasPrice: minGasPrice, ...txParams };
4729
+ const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
4734
4730
  const request = new ScriptTransactionRequest(params);
4735
4731
  request.addCoinOutput(import_address4.Address.fromAddressOrString(destination), amount, assetIdToTransfer);
4736
4732
  const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
@@ -4787,8 +4783,9 @@ var Account = class extends import_interfaces.AbstractAccount {
4787
4783
  }
4788
4784
  const contractAddress = import_address4.Address.fromAddressOrString(contractId);
4789
4785
  const { minGasPrice } = this.provider.getGasConfig();
4786
+ const baseAssetId = this.provider.getBaseAssetId();
4790
4787
  const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
4791
- const params = { gasPrice: minGasPrice, ...txParams };
4788
+ const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
4792
4789
  const { script, scriptData } = await assembleTransferToContractScript({
4793
4790
  hexlifiedContractId: contractAddress.toB256(),
4794
4791
  amountToTransfer: (0, import_math18.bn)(amount),
@@ -4837,7 +4834,12 @@ var Account = class extends import_interfaces.AbstractAccount {
4837
4834
  ...recipientDataArray,
4838
4835
  ...amountDataArray
4839
4836
  ]);
4840
- const params = { script, gasPrice: minGasPrice, ...txParams };
4837
+ const params = {
4838
+ script,
4839
+ gasPrice: minGasPrice,
4840
+ baseAssetId,
4841
+ ...txParams
4842
+ };
4841
4843
  const request = new ScriptTransactionRequest(params);
4842
4844
  const forwardingQuantities = [{ amount: (0, import_math18.bn)(amount), assetId: baseAssetId }];
4843
4845
  const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
@@ -7984,7 +7986,9 @@ var seedTestWallet = async (wallet, quantities) => {
7984
7986
  );
7985
7987
  const resources = await genesisWallet.getResourcesToSpend(quantities);
7986
7988
  const { minGasPrice } = genesisWallet.provider.getGasConfig();
7989
+ const baseAssetId = genesisWallet.provider.getBaseAssetId();
7987
7990
  const request = new ScriptTransactionRequest({
7991
+ baseAssetId,
7988
7992
  gasLimit: 1e4,
7989
7993
  gasPrice: minGasPrice
7990
7994
  });