@fuel-ts/account 0.0.0-rc-2037-20240412171107 → 0.0.0-rc-1976-20240415100843
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.map +1 -1
- package/dist/index.global.js +98 -65
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +134 -103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -65
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +1 -9
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/coin-quantity.d.ts +2 -2
- package/dist/providers/coin-quantity.d.ts.map +1 -1
- package/dist/providers/coin.d.ts +1 -2
- package/dist/providers/coin.d.ts.map +1 -1
- package/dist/providers/message.d.ts +0 -1
- package/dist/providers/message.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +7 -0
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts +1 -1
- package/dist/providers/transaction-request/create-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +25 -4
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils.global.js +102 -51
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +137 -88
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +99 -50
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -16
@@ -32486,7 +32486,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
32486
32486
|
fee_params: {
|
32487
32487
|
gas_price_factor: 92,
|
32488
32488
|
gas_per_byte: 4
|
32489
|
-
}
|
32489
|
+
},
|
32490
|
+
base_asset_id: "0x0000000000000000000000000000000000000000000000000000000000000000"
|
32490
32491
|
},
|
32491
32492
|
gas_costs: {
|
32492
32493
|
add: 1,
|
@@ -34755,10 +34756,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34755
34756
|
}
|
34756
34757
|
};
|
34757
34758
|
|
34758
|
-
// ../address/dist/configs.mjs
|
34759
|
-
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
34760
|
-
var BaseAssetId = ZeroBytes32;
|
34761
|
-
|
34762
34759
|
// ../math/dist/index.mjs
|
34763
34760
|
var import_bn = __toESM(require_bn(), 1);
|
34764
34761
|
var DEFAULT_PRECISION = 9;
|
@@ -34989,11 +34986,11 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34989
34986
|
let max2;
|
34990
34987
|
if (Array.isArray(coinQuantityLike)) {
|
34991
34988
|
amount = coinQuantityLike[0];
|
34992
|
-
assetId = coinQuantityLike[1]
|
34993
|
-
max2 = coinQuantityLike[2]
|
34989
|
+
assetId = coinQuantityLike[1];
|
34990
|
+
max2 = coinQuantityLike[2];
|
34994
34991
|
} else {
|
34995
34992
|
amount = coinQuantityLike.amount;
|
34996
|
-
assetId = coinQuantityLike.assetId
|
34993
|
+
assetId = coinQuantityLike.assetId;
|
34997
34994
|
max2 = coinQuantityLike.max ?? void 0;
|
34998
34995
|
}
|
34999
34996
|
const bnAmount = bn(amount);
|
@@ -42330,6 +42327,9 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42330
42327
|
}
|
42331
42328
|
};
|
42332
42329
|
|
42330
|
+
// ../address/dist/configs.mjs
|
42331
|
+
var ZeroBytes32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
42332
|
+
|
42333
42333
|
// src/providers/transaction-request/input.ts
|
42334
42334
|
var inputify = (value) => {
|
42335
42335
|
const { type: type3 } = value;
|
@@ -42930,6 +42930,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42930
42930
|
outputs = [];
|
42931
42931
|
/** List of witnesses */
|
42932
42932
|
witnesses = [];
|
42933
|
+
/** Base asset ID - should be fetched from the chain */
|
42934
|
+
baseAssetId;
|
42933
42935
|
/**
|
42934
42936
|
* Constructor for initializing a base transaction request.
|
42935
42937
|
*
|
@@ -42942,8 +42944,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42942
42944
|
witnessLimit,
|
42943
42945
|
inputs,
|
42944
42946
|
outputs,
|
42945
|
-
witnesses
|
42946
|
-
|
42947
|
+
witnesses,
|
42948
|
+
baseAssetId
|
42949
|
+
}) {
|
42947
42950
|
this.gasPrice = bn(gasPrice);
|
42948
42951
|
this.maturity = maturity ?? 0;
|
42949
42952
|
this.witnessLimit = witnessLimit ? bn(witnessLimit) : void 0;
|
@@ -42951,6 +42954,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42951
42954
|
this.inputs = inputs ?? [];
|
42952
42955
|
this.outputs = outputs ?? [];
|
42953
42956
|
this.witnesses = witnesses ?? [];
|
42957
|
+
this.baseAssetId = baseAssetId;
|
42954
42958
|
}
|
42955
42959
|
static getPolicyMeta(req) {
|
42956
42960
|
let policyTypes = 0;
|
@@ -43144,8 +43148,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43144
43148
|
* @param predicate - Predicate bytes.
|
43145
43149
|
* @param predicateData - Predicate data bytes.
|
43146
43150
|
*/
|
43147
|
-
addCoinInput(coin) {
|
43148
|
-
const { assetId, owner, amount
|
43151
|
+
addCoinInput(coin, predicate) {
|
43152
|
+
const { assetId, owner, amount } = coin;
|
43149
43153
|
let witnessIndex;
|
43150
43154
|
if (predicate) {
|
43151
43155
|
witnessIndex = 0;
|
@@ -43156,14 +43160,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43156
43160
|
}
|
43157
43161
|
}
|
43158
43162
|
const input = {
|
43159
|
-
|
43163
|
+
...coin,
|
43160
43164
|
type: InputType.Coin,
|
43161
43165
|
owner: owner.toB256(),
|
43162
43166
|
amount,
|
43163
43167
|
assetId,
|
43164
43168
|
txPointer: "0x00000000000000000000000000000000",
|
43165
43169
|
witnessIndex,
|
43166
|
-
predicate
|
43170
|
+
predicate: predicate?.bytes
|
43167
43171
|
};
|
43168
43172
|
this.pushInput(input);
|
43169
43173
|
this.addChangeOutput(owner, assetId);
|
@@ -43174,11 +43178,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43174
43178
|
*
|
43175
43179
|
* @param message - Message resource.
|
43176
43180
|
* @param predicate - Predicate bytes.
|
43177
|
-
* @param predicateData - Predicate data bytes.
|
43178
43181
|
*/
|
43179
|
-
addMessageInput(message) {
|
43180
|
-
const { recipient, sender, amount
|
43181
|
-
const assetId = BaseAssetId;
|
43182
|
+
addMessageInput(message, predicate) {
|
43183
|
+
const { recipient, sender, amount } = message;
|
43182
43184
|
let witnessIndex;
|
43183
43185
|
if (predicate) {
|
43184
43186
|
witnessIndex = 0;
|
@@ -43189,16 +43191,16 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43189
43191
|
}
|
43190
43192
|
}
|
43191
43193
|
const input = {
|
43192
|
-
|
43194
|
+
...message,
|
43193
43195
|
type: InputType.Message,
|
43194
43196
|
sender: sender.toB256(),
|
43195
43197
|
recipient: recipient.toB256(),
|
43196
43198
|
amount,
|
43197
43199
|
witnessIndex,
|
43198
|
-
predicate
|
43200
|
+
predicate: predicate?.bytes
|
43199
43201
|
};
|
43200
43202
|
this.pushInput(input);
|
43201
|
-
this.addChangeOutput(recipient,
|
43203
|
+
this.addChangeOutput(recipient, this.baseAssetId);
|
43202
43204
|
}
|
43203
43205
|
/**
|
43204
43206
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
@@ -43226,6 +43228,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43226
43228
|
resources.forEach((resource) => this.addResource(resource));
|
43227
43229
|
return this;
|
43228
43230
|
}
|
43231
|
+
/**
|
43232
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43233
|
+
* outputs from the related assetIds.
|
43234
|
+
*
|
43235
|
+
* @param resources - The resources to add.
|
43236
|
+
* @returns This transaction.
|
43237
|
+
*/
|
43238
|
+
addPredicateResource(resource, predicate) {
|
43239
|
+
if (isCoin(resource)) {
|
43240
|
+
this.addCoinInput(resource, predicate);
|
43241
|
+
} else {
|
43242
|
+
this.addMessageInput(resource, predicate);
|
43243
|
+
}
|
43244
|
+
return this;
|
43245
|
+
}
|
43246
|
+
/**
|
43247
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43248
|
+
* from the related assetIds.
|
43249
|
+
*
|
43250
|
+
* @param resources - The resources to add.
|
43251
|
+
* @returns This transaction.
|
43252
|
+
*/
|
43253
|
+
addPredicateResources(resources, predicate) {
|
43254
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43255
|
+
return this;
|
43256
|
+
}
|
43229
43257
|
/**
|
43230
43258
|
* Adds a coin output to the transaction.
|
43231
43259
|
*
|
@@ -43233,12 +43261,12 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43233
43261
|
* @param amount - Amount of coin.
|
43234
43262
|
* @param assetId - Asset ID of coin.
|
43235
43263
|
*/
|
43236
|
-
addCoinOutput(to, amount, assetId
|
43264
|
+
addCoinOutput(to, amount, assetId) {
|
43237
43265
|
this.pushOutput({
|
43238
43266
|
type: OutputType.Coin,
|
43239
43267
|
to: addressify(to).toB256(),
|
43240
43268
|
amount,
|
43241
|
-
assetId
|
43269
|
+
assetId: assetId ?? this.baseAssetId
|
43242
43270
|
});
|
43243
43271
|
return this;
|
43244
43272
|
}
|
@@ -43265,7 +43293,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43265
43293
|
* @param to - Address of the owner.
|
43266
43294
|
* @param assetId - Asset ID of coin.
|
43267
43295
|
*/
|
43268
|
-
addChangeOutput(to, assetId
|
43296
|
+
addChangeOutput(to, assetId) {
|
43269
43297
|
const changeOutput = this.getChangeOutputs().find(
|
43270
43298
|
(output3) => hexlify(output3.assetId) === assetId
|
43271
43299
|
);
|
@@ -43273,7 +43301,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43273
43301
|
this.pushOutput({
|
43274
43302
|
type: OutputType.Change,
|
43275
43303
|
to: addressify(to).toB256(),
|
43276
|
-
assetId
|
43304
|
+
assetId: assetId ?? this.baseAssetId
|
43277
43305
|
});
|
43278
43306
|
}
|
43279
43307
|
}
|
@@ -43349,7 +43377,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43349
43377
|
]);
|
43350
43378
|
}
|
43351
43379
|
};
|
43352
|
-
updateAssetInput(
|
43380
|
+
updateAssetInput(this.baseAssetId, bn(1e11));
|
43353
43381
|
quantities.forEach((q) => updateAssetInput(q.assetId, q.amount));
|
43354
43382
|
}
|
43355
43383
|
/**
|
@@ -43506,12 +43534,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43506
43534
|
*
|
43507
43535
|
* @param createTransactionRequestLike - The initial values for the instance
|
43508
43536
|
*/
|
43509
|
-
constructor({
|
43510
|
-
bytecodeWitnessIndex,
|
43511
|
-
salt,
|
43512
|
-
storageSlots,
|
43513
|
-
...rest
|
43514
|
-
} = {}) {
|
43537
|
+
constructor({ bytecodeWitnessIndex, salt, storageSlots, ...rest }) {
|
43515
43538
|
super(rest);
|
43516
43539
|
this.bytecodeWitnessIndex = bytecodeWitnessIndex ?? 0;
|
43517
43540
|
this.salt = hexlify(salt ?? ZeroBytes32);
|
@@ -43626,7 +43649,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43626
43649
|
*
|
43627
43650
|
* @param scriptTransactionRequestLike - The initial values for the instance.
|
43628
43651
|
*/
|
43629
|
-
constructor({ script, scriptData, gasLimit, ...rest }
|
43652
|
+
constructor({ script, scriptData, gasLimit, ...rest }) {
|
43630
43653
|
super(rest);
|
43631
43654
|
this.gasLimit = bn(gasLimit);
|
43632
43655
|
this.script = arrayify(script ?? returnZeroScript.bytes);
|
@@ -44725,6 +44748,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44725
44748
|
gasPerByte: bn(feeParams.gasPerByte),
|
44726
44749
|
maxMessageDataLength: bn(predicateParams.maxMessageDataLength),
|
44727
44750
|
chainId: bn(consensusParameters.chainId),
|
44751
|
+
baseAssetId: consensusParameters.baseAssetId,
|
44728
44752
|
gasCosts
|
44729
44753
|
},
|
44730
44754
|
gasCosts,
|
@@ -44967,6 +44991,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
44967
44991
|
} = this.getChain();
|
44968
44992
|
return chainId.toNumber();
|
44969
44993
|
}
|
44994
|
+
/**
|
44995
|
+
* Returns the base asset ID
|
44996
|
+
*
|
44997
|
+
* @returns A promise that resolves to the base asset ID
|
44998
|
+
*/
|
44999
|
+
getBaseAssetId() {
|
45000
|
+
const {
|
45001
|
+
consensusParameters: { baseAssetId }
|
45002
|
+
} = this.getChain();
|
45003
|
+
return baseAssetId;
|
45004
|
+
}
|
44970
45005
|
/**
|
44971
45006
|
* Submits a transaction to the chain to be executed.
|
44972
45007
|
*
|
@@ -45855,8 +45890,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45855
45890
|
* @param assetId - The asset ID to check the balance for.
|
45856
45891
|
* @returns A promise that resolves to the balance amount.
|
45857
45892
|
*/
|
45858
|
-
async getBalance(assetId
|
45859
|
-
const
|
45893
|
+
async getBalance(assetId) {
|
45894
|
+
const assetIdToFetch = assetId ?? this.provider.getBaseAssetId();
|
45895
|
+
const amount = await this.provider.getBalance(this.address, assetIdToFetch);
|
45860
45896
|
return amount;
|
45861
45897
|
}
|
45862
45898
|
/**
|
@@ -45894,9 +45930,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45894
45930
|
* @returns A promise that resolves when the resources are added to the transaction.
|
45895
45931
|
*/
|
45896
45932
|
async fund(request, coinQuantities, fee) {
|
45933
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
45897
45934
|
const updatedQuantities = addAmountToAsset({
|
45898
45935
|
amount: bn(fee),
|
45899
|
-
assetId:
|
45936
|
+
assetId: baseAssetId,
|
45900
45937
|
coinQuantities
|
45901
45938
|
});
|
45902
45939
|
const quantitiesDict = {};
|
@@ -45920,8 +45957,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45920
45957
|
quantitiesDict[assetId].owned = quantitiesDict[assetId].owned.add(amount);
|
45921
45958
|
cachedUtxos.push(input.id);
|
45922
45959
|
}
|
45923
|
-
} else if (input.recipient === owner && input.amount && quantitiesDict[
|
45924
|
-
quantitiesDict[
|
45960
|
+
} else if (input.recipient === owner && input.amount && quantitiesDict[baseAssetId]) {
|
45961
|
+
quantitiesDict[baseAssetId].owned = quantitiesDict[baseAssetId].owned.add(input.amount);
|
45925
45962
|
cachedMessages.push(input.nonce);
|
45926
45963
|
}
|
45927
45964
|
}
|
@@ -45953,11 +45990,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45953
45990
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
45954
45991
|
* @returns A promise that resolves to the prepared transaction request.
|
45955
45992
|
*/
|
45956
|
-
async createTransfer(destination, amount, assetId
|
45993
|
+
async createTransfer(destination, amount, assetId, txParams = {}) {
|
45957
45994
|
const { minGasPrice } = this.provider.getGasConfig();
|
45958
|
-
const
|
45995
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
45996
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
45997
|
+
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
45959
45998
|
const request = new ScriptTransactionRequest(params);
|
45960
|
-
request.addCoinOutput(Address.fromAddressOrString(destination), amount,
|
45999
|
+
request.addCoinOutput(Address.fromAddressOrString(destination), amount, assetIdToTransfer);
|
45961
46000
|
const { maxFee, requiredQuantities, gasUsed, estimatedInputs } = await this.provider.getTransactionCost(request, [], {
|
45962
46001
|
estimateTxDependencies: true,
|
45963
46002
|
resourcesOwner: this
|
@@ -45983,14 +46022,15 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
45983
46022
|
* @param txParams - The transaction parameters (gasLimit, gasPrice, maturity).
|
45984
46023
|
* @returns A promise that resolves to the transaction response.
|
45985
46024
|
*/
|
45986
|
-
async transfer(destination, amount, assetId
|
46025
|
+
async transfer(destination, amount, assetId, txParams = {}) {
|
45987
46026
|
if (bn(amount).lte(0)) {
|
45988
46027
|
throw new FuelError(
|
45989
46028
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
45990
46029
|
"Transfer amount must be a positive number."
|
45991
46030
|
);
|
45992
46031
|
}
|
45993
|
-
const
|
46032
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46033
|
+
const request = await this.createTransfer(destination, amount, assetIdToTransfer, txParams);
|
45994
46034
|
return this.sendTransaction(request, { estimateTxDependencies: false });
|
45995
46035
|
}
|
45996
46036
|
/**
|
@@ -46002,7 +46042,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46002
46042
|
* @param txParams - The optional transaction parameters.
|
46003
46043
|
* @returns A promise that resolves to the transaction response.
|
46004
46044
|
*/
|
46005
|
-
async transferToContract(contractId, amount, assetId
|
46045
|
+
async transferToContract(contractId, amount, assetId, txParams = {}) {
|
46006
46046
|
if (bn(amount).lte(0)) {
|
46007
46047
|
throw new FuelError(
|
46008
46048
|
ErrorCode.INVALID_TRANSFER_AMOUNT,
|
@@ -46011,11 +46051,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46011
46051
|
}
|
46012
46052
|
const contractAddress = Address.fromAddressOrString(contractId);
|
46013
46053
|
const { minGasPrice } = this.provider.getGasConfig();
|
46014
|
-
const
|
46054
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46055
|
+
const assetIdToTransfer = assetId ?? this.provider.getBaseAssetId();
|
46056
|
+
const params = { gasPrice: minGasPrice, baseAssetId, ...txParams };
|
46015
46057
|
const { script, scriptData } = await assembleTransferToContractScript({
|
46016
46058
|
hexlifiedContractId: contractAddress.toB256(),
|
46017
46059
|
amountToTransfer: bn(amount),
|
46018
|
-
assetId
|
46060
|
+
assetId: assetIdToTransfer
|
46019
46061
|
});
|
46020
46062
|
const request = new ScriptTransactionRequest({
|
46021
46063
|
...params,
|
@@ -46025,7 +46067,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46025
46067
|
request.addContractInputAndOutput(contractAddress);
|
46026
46068
|
const { maxFee, requiredQuantities, gasUsed } = await this.provider.getTransactionCost(
|
46027
46069
|
request,
|
46028
|
-
[{ amount: bn(amount), assetId: String(
|
46070
|
+
[{ amount: bn(amount), assetId: String(assetIdToTransfer) }]
|
46029
46071
|
);
|
46030
46072
|
request.gasLimit = bn(params.gasLimit ?? gasUsed);
|
46031
46073
|
this.validateGas({
|
@@ -46047,6 +46089,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46047
46089
|
*/
|
46048
46090
|
async withdrawToBaseLayer(recipient, amount, txParams = {}) {
|
46049
46091
|
const { minGasPrice } = this.provider.getGasConfig();
|
46092
|
+
const baseAssetId = this.provider.getBaseAssetId();
|
46050
46093
|
const recipientAddress = Address.fromAddressOrString(recipient);
|
46051
46094
|
const recipientDataArray = arrayify(
|
46052
46095
|
"0x".concat(recipientAddress.toHexString().substring(2).padStart(64, "0"))
|
@@ -46059,9 +46102,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
46059
46102
|
...recipientDataArray,
|
46060
46103
|
...amountDataArray
|
46061
46104
|
]);
|
46062
|
-
const params = {
|
46105
|
+
const params = {
|
46106
|
+
script,
|
46107
|
+
gasPrice: minGasPrice,
|
46108
|
+
baseAssetId,
|
46109
|
+
...txParams
|
46110
|
+
};
|
46063
46111
|
const request = new ScriptTransactionRequest(params);
|
46064
|
-
const forwardingQuantities = [{ amount: bn(amount), assetId:
|
46112
|
+
const forwardingQuantities = [{ amount: bn(amount), assetId: baseAssetId }];
|
46065
46113
|
const { requiredQuantities, maxFee, gasUsed } = await this.provider.getTransactionCost(
|
46066
46114
|
request,
|
46067
46115
|
forwardingQuantities
|
@@ -50493,7 +50541,9 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50493
50541
|
);
|
50494
50542
|
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50495
50543
|
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
50544
|
+
const baseAssetId = genesisWallet.provider.getBaseAssetId();
|
50496
50545
|
const request = new ScriptTransactionRequest({
|
50546
|
+
baseAssetId,
|
50497
50547
|
gasLimit: 1e4,
|
50498
50548
|
gasPrice: minGasPrice
|
50499
50549
|
});
|
@@ -50623,7 +50673,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50623
50673
|
{
|
50624
50674
|
owner: signer.address.toHexString(),
|
50625
50675
|
amount: toHex(1e9),
|
50626
|
-
asset_id:
|
50676
|
+
asset_id: defaultChainConfig?.consensus_parameters?.base_asset_id ?? ZeroBytes32
|
50627
50677
|
}
|
50628
50678
|
]
|
50629
50679
|
}
|
@@ -50689,9 +50739,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50689
50739
|
})
|
50690
50740
|
);
|
50691
50741
|
var generateWallets = async (count, provider) => {
|
50742
|
+
const baseAssetId = provider.getBaseAssetId();
|
50692
50743
|
const wallets = [];
|
50693
50744
|
for (let i = 0; i < count; i += 1) {
|
50694
|
-
const wallet = await generateTestWallet(provider, [[1e3,
|
50745
|
+
const wallet = await generateTestWallet(provider, [[1e3, baseAssetId]]);
|
50695
50746
|
wallets.push(wallet);
|
50696
50747
|
}
|
50697
50748
|
return wallets;
|