@fuel-ts/account 0.100.4 → 0.100.6
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.
- package/dist/account.d.ts +1 -1
- package/dist/account.d.ts.map +1 -1
- package/dist/index.global.js +60 -12
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +63 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -11
- package/dist/index.mjs.map +1 -1
- package/dist/providers/__generated__/operations.d.ts +18 -3
- package/dist/providers/__generated__/operations.d.ts.map +1 -1
- package/dist/providers/index.d.ts +1 -0
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/provider.d.ts +5 -0
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +3 -3
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/providers/transaction-response/getAllDecodedLogs.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts +17 -5
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/utils/serialization.d.ts.map +1 -1
- package/dist/providers/utils/transaction-response-serialization.d.ts +9 -0
- package/dist/providers/utils/transaction-response-serialization.d.ts.map +1 -0
- package/dist/test-utils.global.js +23 -12
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +22 -11
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +22 -11
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +14 -14
package/dist/index.mjs
CHANGED
@@ -1408,6 +1408,11 @@ var ChainInfoFragmentDoc = gql`
|
|
1408
1408
|
consensusParameters {
|
1409
1409
|
...consensusParametersFragment
|
1410
1410
|
}
|
1411
|
+
latestBlock {
|
1412
|
+
header {
|
1413
|
+
consensusParametersVersion
|
1414
|
+
}
|
1415
|
+
}
|
1411
1416
|
}
|
1412
1417
|
${ConsensusParametersFragmentDoc}`;
|
1413
1418
|
var ContractBalanceFragmentDoc = gql`
|
@@ -1881,7 +1886,7 @@ ${OutputContractCreatedFragmentDoc}
|
|
1881
1886
|
${DryRunFailureAssembleTxFragmentDoc}
|
1882
1887
|
${DryRunSuccessAssembleTxFragmentDoc}`;
|
1883
1888
|
var DryRunDocument = gql`
|
1884
|
-
|
1889
|
+
query dryRun($encodedTransactions: [HexString!]!, $utxoValidation: Boolean, $gasPrice: U64) {
|
1885
1890
|
dryRun(
|
1886
1891
|
txs: $encodedTransactions
|
1887
1892
|
utxoValidation: $utxoValidation
|
@@ -2510,7 +2515,7 @@ import {
|
|
2510
2515
|
} from "@fuel-ts/transactions";
|
2511
2516
|
import { hexlify as hexlify5, arrayify as arrayify2, assertUnreachable } from "@fuel-ts/utils";
|
2512
2517
|
var deserializeChain = /* @__PURE__ */ __name((chain) => {
|
2513
|
-
const { name, daHeight, consensusParameters } = chain;
|
2518
|
+
const { name, daHeight, consensusParameters, latestBlock } = chain;
|
2514
2519
|
const {
|
2515
2520
|
contractParams,
|
2516
2521
|
feeParams,
|
@@ -2561,11 +2566,12 @@ var deserializeChain = /* @__PURE__ */ __name((chain) => {
|
|
2561
2566
|
maxScriptDataLength: bn5(scriptParams.maxScriptDataLength)
|
2562
2567
|
},
|
2563
2568
|
gasCosts
|
2564
|
-
}
|
2569
|
+
},
|
2570
|
+
latestBlock
|
2565
2571
|
};
|
2566
2572
|
}, "deserializeChain");
|
2567
2573
|
var serializeChain = /* @__PURE__ */ __name((chain) => {
|
2568
|
-
const { name, baseChainHeight, consensusParameters } = chain;
|
2574
|
+
const { name, baseChainHeight, consensusParameters, latestBlock } = chain;
|
2569
2575
|
const {
|
2570
2576
|
contractParameters,
|
2571
2577
|
feeParameters,
|
@@ -2616,7 +2622,8 @@ var serializeChain = /* @__PURE__ */ __name((chain) => {
|
|
2616
2622
|
maxScriptDataLength: scriptParameters.maxScriptDataLength.toString()
|
2617
2623
|
},
|
2618
2624
|
gasCosts
|
2619
|
-
}
|
2625
|
+
},
|
2626
|
+
latestBlock
|
2620
2627
|
};
|
2621
2628
|
}, "serializeChain");
|
2622
2629
|
var deserializeNodeInfo = /* @__PURE__ */ __name((nodeInfo) => {
|
@@ -3495,8 +3502,6 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
3495
3502
|
/** List of witnesses */
|
3496
3503
|
witnesses = [];
|
3497
3504
|
/**
|
3498
|
-
* @hidden
|
3499
|
-
*
|
3500
3505
|
* The current status of the transaction
|
3501
3506
|
*/
|
3502
3507
|
flag = { state: void 0, transactionId: void 0, summary: void 0 };
|
@@ -3513,7 +3518,8 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
3513
3518
|
witnessLimit,
|
3514
3519
|
inputs,
|
3515
3520
|
outputs,
|
3516
|
-
witnesses
|
3521
|
+
witnesses,
|
3522
|
+
flag
|
3517
3523
|
} = {}) {
|
3518
3524
|
this.tip = tip ? bn9(tip) : void 0;
|
3519
3525
|
this.maturity = maturity && maturity > 0 ? maturity : void 0;
|
@@ -3523,6 +3529,7 @@ var BaseTransactionRequest = class _BaseTransactionRequest {
|
|
3523
3529
|
this.inputs = inputs ?? [];
|
3524
3530
|
this.outputs = outputs ?? [];
|
3525
3531
|
this.witnesses = witnesses ?? [];
|
3532
|
+
this.flag = flag ?? { state: void 0, transactionId: void 0, summary: void 0 };
|
3526
3533
|
}
|
3527
3534
|
static getPolicyMeta(req) {
|
3528
3535
|
let policyTypes = 0;
|
@@ -5879,7 +5886,9 @@ function getAllDecodedLogs(opts) {
|
|
5879
5886
|
const firstCallReceipt = receipts.find(
|
5880
5887
|
(r) => r.type === ReceiptType7.Call && r.id === ZeroBytes3210
|
5881
5888
|
);
|
5882
|
-
|
5889
|
+
if (firstCallReceipt) {
|
5890
|
+
mainContract = firstCallReceipt.to;
|
5891
|
+
}
|
5883
5892
|
}
|
5884
5893
|
return receipts.reduce(
|
5885
5894
|
({ logs, groupedLogs }, receipt) => {
|
@@ -5936,9 +5945,9 @@ var TransactionResponse = class _TransactionResponse {
|
|
5936
5945
|
request;
|
5937
5946
|
status;
|
5938
5947
|
abis;
|
5948
|
+
preConfirmationStatus;
|
5939
5949
|
waitingForStreamData = false;
|
5940
5950
|
statusResolvers = /* @__PURE__ */ new Map();
|
5941
|
-
preConfirmationStatus;
|
5942
5951
|
/**
|
5943
5952
|
* Async constructor for `TransactionResponse`. This method can be used to create
|
5944
5953
|
* an instance of `TransactionResponse` and wait for the transaction to be fetched
|
@@ -7168,7 +7177,9 @@ var Provider = class _Provider {
|
|
7168
7177
|
}
|
7169
7178
|
const chainInfo = _Provider.chainInfoCache[this.urlWithoutAuth];
|
7170
7179
|
const {
|
7171
|
-
|
7180
|
+
latestBlock: {
|
7181
|
+
header: { consensusParametersVersion: previous }
|
7182
|
+
}
|
7172
7183
|
} = chainInfo;
|
7173
7184
|
const {
|
7174
7185
|
chain: {
|
@@ -8316,6 +8327,43 @@ var assembleTransactionSummaryFromJson = /* @__PURE__ */ __name(async (opts) =>
|
|
8316
8327
|
});
|
8317
8328
|
}, "assembleTransactionSummaryFromJson");
|
8318
8329
|
|
8330
|
+
// src/providers/utils/transaction-response-serialization.ts
|
8331
|
+
var serializeTransactionResponseJson = /* @__PURE__ */ __name(async (response) => {
|
8332
|
+
const { id, status, abis, request: request2, provider, gqlTransaction, preConfirmationStatus } = response;
|
8333
|
+
return {
|
8334
|
+
id,
|
8335
|
+
status,
|
8336
|
+
abis,
|
8337
|
+
requestJson: request2 ? JSON.stringify(request2.toJSON()) : void 0,
|
8338
|
+
providerUrl: provider.url,
|
8339
|
+
providerCache: await serializeProviderCache(provider),
|
8340
|
+
gqlTransaction,
|
8341
|
+
preConfirmationStatus
|
8342
|
+
};
|
8343
|
+
}, "serializeTransactionResponseJson");
|
8344
|
+
var deserializeTransactionResponseJson = /* @__PURE__ */ __name((json) => {
|
8345
|
+
const {
|
8346
|
+
id,
|
8347
|
+
abis,
|
8348
|
+
status,
|
8349
|
+
providerUrl,
|
8350
|
+
requestJson,
|
8351
|
+
providerCache,
|
8352
|
+
gqlTransaction,
|
8353
|
+
preConfirmationStatus
|
8354
|
+
} = json;
|
8355
|
+
const provider = new Provider(providerUrl, { cache: providerCache });
|
8356
|
+
const { chainId } = providerCache.chain.consensusParameters;
|
8357
|
+
const response = new TransactionResponse(id, provider, Number(chainId), abis);
|
8358
|
+
if (requestJson) {
|
8359
|
+
response.request = transactionRequestify(JSON.parse(requestJson));
|
8360
|
+
}
|
8361
|
+
response.status = status;
|
8362
|
+
response.gqlTransaction = gqlTransaction;
|
8363
|
+
response.preConfirmationStatus = preConfirmationStatus;
|
8364
|
+
return response;
|
8365
|
+
}, "deserializeTransactionResponseJson");
|
8366
|
+
|
8319
8367
|
// src/types.ts
|
8320
8368
|
var AbstractAccount = class {
|
8321
8369
|
static {
|
@@ -13919,6 +13967,7 @@ export {
|
|
13919
13967
|
deserializeProcessedTxOutput,
|
13920
13968
|
deserializeProviderCache,
|
13921
13969
|
deserializeReceipt,
|
13970
|
+
deserializeTransactionResponseJson,
|
13922
13971
|
dispatchFuelConnectorEvent,
|
13923
13972
|
english,
|
13924
13973
|
extractBurnedAssetsFromReceipts,
|
@@ -14019,6 +14068,7 @@ export {
|
|
14019
14068
|
serializeChain,
|
14020
14069
|
serializeNodeInfo,
|
14021
14070
|
serializeProviderCache,
|
14071
|
+
serializeTransactionResponseJson,
|
14022
14072
|
setAndValidateGasAndFeeForAssembledTx,
|
14023
14073
|
transactionRequestify,
|
14024
14074
|
urlJoin,
|