@fuel-ts/account 0.0.0-rc-2395-20240528075431 → 0.0.0-rc-1356-20240528093309
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/index.global.js +17 -30
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +126 -147
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -31
- package/dist/index.mjs.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts +0 -1
- package/dist/providers/transaction-summary/assemble-transaction-summary.d.ts.map +1 -1
- package/dist/providers/transaction-summary/get-transaction-summary.d.ts.map +1 -1
- package/dist/providers/transaction-summary/operations.d.ts +2 -4
- package/dist/providers/transaction-summary/operations.d.ts.map +1 -1
- package/dist/providers/transaction-summary/types.d.ts +0 -1
- package/dist/providers/transaction-summary/types.d.ts.map +1 -1
- package/dist/providers/utils/auto-retry-fetch.d.ts.map +1 -1
- package/dist/providers/utils/index.d.ts +0 -1
- package/dist/providers/utils/index.d.ts.map +1 -1
- package/dist/test-utils/asset-id.d.ts +8 -0
- package/dist/test-utils/asset-id.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +4 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +8 -1
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/setup-test-provider-and-wallets.d.ts +33 -0
- package/dist/test-utils/setup-test-provider-and-wallets.d.ts.map +1 -0
- package/dist/test-utils/test-message.d.ts +29 -0
- package/dist/test-utils/test-message.d.ts.map +1 -0
- package/dist/test-utils/wallet-config.d.ts +55 -0
- package/dist/test-utils/wallet-config.d.ts.map +1 -0
- package/dist/test-utils.global.js +401 -79
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +410 -179
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +304 -77
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -15
- package/dist/providers/utils/sleep.d.ts +0 -3
- package/dist/providers/utils/sleep.d.ts.map +0 -1
package/dist/index.mjs
CHANGED
@@ -1714,15 +1714,6 @@ function normalizeJSON(root) {
|
|
1714
1714
|
return normalize(clone(root));
|
1715
1715
|
}
|
1716
1716
|
|
1717
|
-
// src/providers/utils/sleep.ts
|
1718
|
-
function sleep(time) {
|
1719
|
-
return new Promise((resolve) => {
|
1720
|
-
setTimeout(() => {
|
1721
|
-
resolve(true);
|
1722
|
-
}, time);
|
1723
|
-
});
|
1724
|
-
}
|
1725
|
-
|
1726
1717
|
// src/providers/utils/extract-tx-error.ts
|
1727
1718
|
import { ErrorCode as ErrorCode7, FuelError as FuelError7 } from "@fuel-ts/errors";
|
1728
1719
|
import { bn as bn6 } from "@fuel-ts/math";
|
@@ -3122,12 +3113,12 @@ function getReceiptsTransferOut(receipts) {
|
|
3122
3113
|
}
|
3123
3114
|
function getWithdrawFromFuelOperations({
|
3124
3115
|
inputs,
|
3125
|
-
receipts
|
3126
|
-
assetId
|
3116
|
+
receipts
|
3127
3117
|
}) {
|
3128
3118
|
const messageOutReceipts = getReceiptsMessageOut(receipts);
|
3129
3119
|
const withdrawFromFuelOperations = messageOutReceipts.reduce(
|
3130
3120
|
(prevWithdrawFromFuelOps, receipt) => {
|
3121
|
+
const assetId = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
3131
3122
|
const input = getInputFromAssetId(inputs, assetId);
|
3132
3123
|
if (input) {
|
3133
3124
|
const inputAddress = getInputAccountAddress(input);
|
@@ -3341,8 +3332,7 @@ function getOperations({
|
|
3341
3332
|
receipts,
|
3342
3333
|
abiMap,
|
3343
3334
|
rawPayload,
|
3344
|
-
maxInputs
|
3345
|
-
assetId
|
3335
|
+
maxInputs
|
3346
3336
|
}) {
|
3347
3337
|
if (isTypeCreate(transactionType)) {
|
3348
3338
|
return [
|
@@ -3361,7 +3351,7 @@ function getOperations({
|
|
3361
3351
|
rawPayload,
|
3362
3352
|
maxInputs
|
3363
3353
|
}),
|
3364
|
-
...getWithdrawFromFuelOperations({ inputs, receipts
|
3354
|
+
...getWithdrawFromFuelOperations({ inputs, receipts })
|
3365
3355
|
];
|
3366
3356
|
}
|
3367
3357
|
return [...getPayProducerOperations(outputs)];
|
@@ -3497,8 +3487,7 @@ function assembleTransactionSummary(params) {
|
|
3497
3487
|
maxInputs,
|
3498
3488
|
gasCosts,
|
3499
3489
|
maxGasPerTx,
|
3500
|
-
gasPrice
|
3501
|
-
assetId
|
3490
|
+
gasPrice
|
3502
3491
|
} = params;
|
3503
3492
|
const gasUsed = getGasUsedFromReceipts(receipts);
|
3504
3493
|
const rawPayload = hexlify11(transactionBytes);
|
@@ -3509,8 +3498,7 @@ function assembleTransactionSummary(params) {
|
|
3509
3498
|
receipts,
|
3510
3499
|
rawPayload,
|
3511
3500
|
abiMap,
|
3512
|
-
maxInputs
|
3513
|
-
assetId
|
3501
|
+
maxInputs
|
3514
3502
|
});
|
3515
3503
|
const typeName = getTransactionTypeName(transaction.type);
|
3516
3504
|
const tip = bn15(transaction.policies?.find((policy) => policy.type === PolicyType3.Tip)?.data);
|
@@ -3670,7 +3658,6 @@ var TransactionResponse = class {
|
|
3670
3658
|
const { gasPerByte, gasPriceFactor, gasCosts, maxGasPerTx } = this.provider.getGasConfig();
|
3671
3659
|
const gasPrice = await this.provider.getLatestGasPrice();
|
3672
3660
|
const maxInputs = this.provider.getChain().consensusParameters.txParameters.maxInputs;
|
3673
|
-
const assetId = this.provider.getBaseAssetId();
|
3674
3661
|
const transactionSummary = assembleTransactionSummary({
|
3675
3662
|
id: this.id,
|
3676
3663
|
receipts,
|
@@ -3683,8 +3670,7 @@ var TransactionResponse = class {
|
|
3683
3670
|
maxInputs,
|
3684
3671
|
gasCosts,
|
3685
3672
|
maxGasPerTx,
|
3686
|
-
gasPrice
|
3687
|
-
assetId
|
3673
|
+
gasPrice
|
3688
3674
|
});
|
3689
3675
|
return transactionSummary;
|
3690
3676
|
}
|
@@ -3752,6 +3738,7 @@ var TransactionResponse = class {
|
|
3752
3738
|
};
|
3753
3739
|
|
3754
3740
|
// src/providers/utils/auto-retry-fetch.ts
|
3741
|
+
import { sleep } from "@fuel-ts/utils";
|
3755
3742
|
function getWaitDelay(options, retryAttemptNum) {
|
3756
3743
|
const duration = options.baseDelay ?? 150;
|
3757
3744
|
switch (options.backoff) {
|
@@ -5054,7 +5041,6 @@ async function getTransactionSummary(params) {
|
|
5054
5041
|
}
|
5055
5042
|
} = provider.getChain();
|
5056
5043
|
const gasPrice = await provider.getLatestGasPrice();
|
5057
|
-
const assetId = provider.getBaseAssetId();
|
5058
5044
|
const transactionInfo = assembleTransactionSummary({
|
5059
5045
|
id: gqlTransaction.id,
|
5060
5046
|
receipts,
|
@@ -5067,8 +5053,7 @@ async function getTransactionSummary(params) {
|
|
5067
5053
|
maxInputs,
|
5068
5054
|
gasCosts,
|
5069
5055
|
maxGasPerTx,
|
5070
|
-
gasPrice
|
5071
|
-
assetId
|
5056
|
+
gasPrice
|
5072
5057
|
});
|
5073
5058
|
return {
|
5074
5059
|
gqlTransaction,
|
@@ -5083,7 +5068,6 @@ async function getTransactionSummaryFromRequest(params) {
|
|
5083
5068
|
const transaction = transactionRequest.toTransaction();
|
5084
5069
|
const transactionBytes = transactionRequest.toTransactionBytes();
|
5085
5070
|
const gasPrice = await provider.getLatestGasPrice();
|
5086
|
-
const assetId = provider.getBaseAssetId();
|
5087
5071
|
const transactionSummary = assembleTransactionSummary({
|
5088
5072
|
receipts,
|
5089
5073
|
transaction,
|
@@ -5094,8 +5078,7 @@ async function getTransactionSummaryFromRequest(params) {
|
|
5094
5078
|
maxInputs,
|
5095
5079
|
gasCosts,
|
5096
5080
|
maxGasPerTx,
|
5097
|
-
gasPrice
|
5098
|
-
assetId
|
5081
|
+
gasPrice
|
5099
5082
|
});
|
5100
5083
|
return transactionSummary;
|
5101
5084
|
}
|
@@ -5111,7 +5094,6 @@ async function getTransactionsSummaries(params) {
|
|
5111
5094
|
}
|
5112
5095
|
} = provider.getChain();
|
5113
5096
|
const gasPrice = await provider.getLatestGasPrice();
|
5114
|
-
const assetId = provider.getBaseAssetId();
|
5115
5097
|
const transactions = edges.map((edge) => {
|
5116
5098
|
const { node: gqlTransaction } = edge;
|
5117
5099
|
const { id, rawPayload, status } = gqlTransaction;
|
@@ -5133,8 +5115,7 @@ async function getTransactionsSummaries(params) {
|
|
5133
5115
|
maxInputs,
|
5134
5116
|
gasCosts,
|
5135
5117
|
maxGasPerTx,
|
5136
|
-
gasPrice
|
5137
|
-
assetId
|
5118
|
+
gasPrice
|
5138
5119
|
});
|
5139
5120
|
const output = {
|
5140
5121
|
gqlTransaction,
|
@@ -10297,7 +10278,6 @@ export {
|
|
10297
10278
|
resolveGasDependentCosts,
|
10298
10279
|
resolveIconPaths,
|
10299
10280
|
returnZeroScript,
|
10300
|
-
sleep,
|
10301
10281
|
transactionRequestify,
|
10302
10282
|
urlJoin,
|
10303
10283
|
withTimeout,
|