@fuel-ts/account 0.101.0 → 0.101.2
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 +3 -1
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +3 -3
- package/dist/connectors/fuel-connector.d.ts.map +1 -1
- package/dist/connectors/types/connector-types.d.ts +1 -0
- package/dist/connectors/types/connector-types.d.ts.map +1 -1
- package/dist/index.global.js +223 -82
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +379 -243
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +312 -176
- package/dist/index.mjs.map +1 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-response/transaction-response.d.ts.map +1 -1
- package/dist/providers/transaction-summary/call.d.ts +4 -7
- package/dist/providers/transaction-summary/call.d.ts.map +1 -1
- package/dist/providers/transaction-summary/operations.d.ts +1 -1
- package/dist/providers/transaction-summary/operations.d.ts.map +1 -1
- package/dist/providers/utils/extract-tx-error.d.ts +10 -1
- package/dist/providers/utils/extract-tx-error.d.ts.map +1 -1
- package/dist/test-utils.global.js +221 -81
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +337 -204
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +273 -139
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +15 -15
package/dist/account.d.ts
CHANGED
@@ -263,7 +263,7 @@ export declare class Account extends AbstractAccount implements WithAddress {
|
|
263
263
|
* @param transactionRequestLike - The transaction request to sign.
|
264
264
|
* @returns A promise that resolves to the signature of the transaction.
|
265
265
|
*/
|
266
|
-
signTransaction(transactionRequestLike: TransactionRequestLike): Promise<string>;
|
266
|
+
signTransaction(transactionRequestLike: TransactionRequestLike, connectorOptions?: AccountSendTxParams): Promise<string | TransactionRequest>;
|
267
267
|
/**
|
268
268
|
* Sends a transaction to the network.
|
269
269
|
*
|
@@ -301,5 +301,7 @@ export declare class Account extends AbstractAccount implements WithAddress {
|
|
301
301
|
private validateGasLimitAndMaxFee;
|
302
302
|
/** @hidden * */
|
303
303
|
private validateConsolidationTxsCoins;
|
304
|
+
/** @hidden * */
|
305
|
+
private setTransactionStateForConnectors;
|
304
306
|
}
|
305
307
|
//# sourceMappingURL=account.d.ts.map
|
package/dist/account.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAa,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAEhB,QAAQ,EACR,oBAAoB,EACpB,QAAQ,EACR,4BAA4B,EAC5B,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACnB,IAAI,EACJ,qBAAqB,EACrB,oBAAoB,EAEpB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,wBAAwB,EAKzB,MAAM,aAAa,CAAC;AAUrB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI1C,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,4BAA4B,EAC5B,UAAU,GAAG,KAAK,GAAG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AU9D,cAAc;YACA,yBAAyB;IAqBvC,cAAc;YACA,yBAAyB;IAcvC,gBAAgB;YACF,UAAU;IAoBxB,gBAAgB;IAChB,OAAO,CAAC,sBAAsB;IAS9B,gBAAgB;YACF,0BAA0B;IAiBxC,gBAAgB;IAChB,OAAO,CAAC,yBAAyB;IAkCjC,gBAAgB;IAChB,OAAO,CAAC,6BAA6B;IAarC,gBAAgB;YACF,gCAAgC;CA0B/C"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { HashableMessage } from '@fuel-ts/hasher';
|
2
2
|
import { EventEmitter } from 'events';
|
3
3
|
import type { Asset } from '../assets/types';
|
4
|
-
import type { TransactionRequestLike, TransactionResponse } from '../providers';
|
4
|
+
import type { TransactionRequest, TransactionRequestLike, TransactionResponse } from '../providers';
|
5
5
|
import { FuelConnectorEventTypes } from './types';
|
6
6
|
import type { FuelConnectorEvents, ConnectorMetadata, FuelABI, Network, FuelEventArg, Version, SelectNetworkArguments, FuelConnectorSendTxParams } from './types';
|
7
7
|
interface Connector {
|
@@ -12,7 +12,7 @@ interface Connector {
|
|
12
12
|
connect(): Promise<boolean>;
|
13
13
|
disconnect(): Promise<boolean>;
|
14
14
|
signMessage(address: string, message: HashableMessage): Promise<string>;
|
15
|
-
signTransaction(address: string, transaction: TransactionRequestLike): Promise<string>;
|
15
|
+
signTransaction(address: string, transaction: TransactionRequestLike, params?: FuelConnectorSendTxParams): Promise<string | TransactionRequest>;
|
16
16
|
sendTransaction(address: string, transaction: TransactionRequestLike, params?: FuelConnectorSendTxParams): Promise<string | TransactionResponse>;
|
17
17
|
currentAccount(): Promise<string | null>;
|
18
18
|
addAssets(assets: Array<Asset>): Promise<boolean>;
|
@@ -104,7 +104,7 @@ export declare abstract class FuelConnector extends EventEmitter implements Conn
|
|
104
104
|
*
|
105
105
|
* @returns Transaction signature
|
106
106
|
*/
|
107
|
-
signTransaction(_address: string, _transaction: TransactionRequestLike): Promise<string>;
|
107
|
+
signTransaction(_address: string, _transaction: TransactionRequestLike, _params?: FuelConnectorSendTxParams): Promise<string | TransactionRequest>;
|
108
108
|
/**
|
109
109
|
* Should start the send transaction process and return
|
110
110
|
* the transaction id submitted to the network.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"fuel-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-connector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"fuel-connector.d.ts","sourceRoot":"","sources":["../../src/connectors/fuel-connector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEpG,OAAO,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,OAAO,EACP,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAEjB,UAAU,SAAS;IAEjB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGzB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAG5B,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGhC,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC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AUG;IACG,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxD;;;;;;;;;;OAUG;IACG,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC;IAI/C;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAIrC;;;;;;;OAOG;IACG,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvD;;;;;;;OAOG;IACG,aAAa,CAAC,QAAQ,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvE;;;;OAIG;IACG,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAIzC;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxC;;;;;;OAMG;IACG,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIlE;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAIlD;;;;;OAKG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI3C;;;;;OAKG;IACM,EAAE,CAAC,CAAC,SAAS,mBAAmB,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,YAAY,CAAC,CAAC,CAAC,EAC1E,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,GAC1B,IAAI;CAIR"}
|
@@ -6,6 +6,7 @@ export declare enum FuelConnectorMethods {
|
|
6
6
|
isConnected = "isConnected",
|
7
7
|
accounts = "accounts",
|
8
8
|
currentAccount = "currentAccount",
|
9
|
+
signTransaction = "signTransaction",
|
9
10
|
signMessage = "signMessage",
|
10
11
|
sendTransaction = "sendTransaction",
|
11
12
|
assets = "assets",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"connector-types.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/connector-types.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAE9B,IAAI,SAAS;IACb,OAAO,YAAY;IAEnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAE3B,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IAEjC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IAEnC,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IAEvB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAE/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,uBAAuB;IACjC,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,sBAAsB,kBAAkB,CAAC"}
|
1
|
+
{"version":3,"file":"connector-types.d.ts","sourceRoot":"","sources":["../../../src/connectors/types/connector-types.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAE9B,IAAI,SAAS;IACb,OAAO,YAAY;IAEnB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAE3B,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IAEjC,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IAEnC,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,SAAS,cAAc;IAEvB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,UAAU,eAAe;IACzB,aAAa,kBAAkB;IAE/B,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,uBAAuB;IACjC,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,sBAAsB,kBAAkB,CAAC"}
|
package/dist/index.global.js
CHANGED
@@ -17990,8 +17990,8 @@
|
|
17990
17990
|
function getBuiltinVersions() {
|
17991
17991
|
return {
|
17992
17992
|
FUEL_CORE: "0.43.1",
|
17993
|
-
FORC: "0.68.
|
17994
|
-
FUELS: "0.101.
|
17993
|
+
FORC: "0.68.7",
|
17994
|
+
FUELS: "0.101.2"
|
17995
17995
|
};
|
17996
17996
|
}
|
17997
17997
|
__name(getBuiltinVersions, "getBuiltinVersions");
|
@@ -21301,7 +21301,8 @@ If you are attempting to transform a hex value, please make sure it is being pas
|
|
21301
21301
|
functions,
|
21302
21302
|
loggedTypes,
|
21303
21303
|
messagesTypes: abi.messagesTypes,
|
21304
|
-
configurables
|
21304
|
+
configurables,
|
21305
|
+
errorCodes: abi.errorCodes
|
21305
21306
|
};
|
21306
21307
|
return transpiled;
|
21307
21308
|
}
|
@@ -28831,6 +28832,7 @@ ${incompatibleNodeVersionMessage}`,
|
|
28831
28832
|
var FAILED_ASSERT_EQ_SIGNAL = "0xffffffffffff0003";
|
28832
28833
|
var FAILED_ASSERT_SIGNAL = "0xffffffffffff0004";
|
28833
28834
|
var FAILED_ASSERT_NE_SIGNAL = "0xffffffffffff0005";
|
28835
|
+
var REVERT_WITH_LOG_SIGNAL = "0xffffffffffff0006";
|
28834
28836
|
var PANIC_REASONS = [
|
28835
28837
|
"ArithmeticError",
|
28836
28838
|
"ArithmeticOverflow",
|
@@ -28899,6 +28901,14 @@ ${incompatibleNodeVersionMessage}`,
|
|
28899
28901
|
"WitnessNotFound"
|
28900
28902
|
];
|
28901
28903
|
var PANIC_DOC_URL = "https://docs.rs/fuel-asm/latest/fuel_asm/enum.PanicReason.html";
|
28904
|
+
var SwaySignalErrors = {
|
28905
|
+
FAILED_REQUIRE_SIGNAL,
|
28906
|
+
FAILED_TRANSFER_TO_ADDRESS_SIGNAL,
|
28907
|
+
FAILED_ASSERT_EQ_SIGNAL,
|
28908
|
+
FAILED_ASSERT_SIGNAL,
|
28909
|
+
FAILED_ASSERT_NE_SIGNAL,
|
28910
|
+
REVERT_WITH_LOG_SIGNAL
|
28911
|
+
};
|
28902
28912
|
|
28903
28913
|
// src/providers/utils/serialization.ts
|
28904
28914
|
var deserializeChain = /* @__PURE__ */ __name((chain) => {
|
@@ -29648,58 +29658,97 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
29648
29658
|
});
|
29649
29659
|
}, "assemblePanicError");
|
29650
29660
|
var stringify = /* @__PURE__ */ __name((obj) => JSON.stringify(obj, null, 2), "stringify");
|
29651
|
-
var
|
29661
|
+
var assembleSignalErrorMessage = /* @__PURE__ */ __name((reasonHex, logs, metadata) => {
|
29652
29662
|
let errorMessage = "The transaction reverted with an unknown reason.";
|
29653
|
-
const revertReceipt = receipts.find(({ type: type3 }) => type3 === ReceiptType.Revert);
|
29654
29663
|
let reason = "";
|
29655
|
-
|
29656
|
-
|
29657
|
-
|
29658
|
-
|
29659
|
-
|
29660
|
-
|
29661
|
-
|
29662
|
-
|
29663
|
-
|
29664
|
-
}
|
29665
|
-
|
29666
|
-
|
29667
|
-
|
29668
|
-
|
29669
|
-
|
29670
|
-
}
|
29671
|
-
|
29672
|
-
|
29673
|
-
|
29674
|
-
|
29675
|
-
|
29676
|
-
|
29677
|
-
|
29678
|
-
|
29679
|
-
|
29680
|
-
|
29681
|
-
|
29682
|
-
|
29683
|
-
|
29684
|
-
|
29685
|
-
|
29686
|
-
|
29687
|
-
|
29688
|
-
|
29689
|
-
|
29690
|
-
|
29691
|
-
|
29692
|
-
|
29693
|
-
|
29664
|
+
const lastLog = logs[logs.length - 1];
|
29665
|
+
const lastButOneLog = logs[logs.length - 2];
|
29666
|
+
switch (reasonHex) {
|
29667
|
+
case FAILED_REQUIRE_SIGNAL: {
|
29668
|
+
reason = "require";
|
29669
|
+
errorMessage = `The transaction reverted because a "require" statement has thrown ${logs.length ? stringify(lastLog) : "an error."}.`;
|
29670
|
+
break;
|
29671
|
+
}
|
29672
|
+
case FAILED_ASSERT_EQ_SIGNAL: {
|
29673
|
+
const suffix = logs.length >= 2 ? ` comparing ${stringify(lastLog)} and ${stringify(lastButOneLog)}.` : ".";
|
29674
|
+
reason = "assert_eq";
|
29675
|
+
errorMessage = `The transaction reverted because of an "assert_eq" statement${suffix}`;
|
29676
|
+
break;
|
29677
|
+
}
|
29678
|
+
case FAILED_ASSERT_NE_SIGNAL: {
|
29679
|
+
const suffix = logs.length >= 2 ? ` comparing ${stringify(lastButOneLog)} and ${stringify(lastLog)}.` : ".";
|
29680
|
+
reason = "assert_ne";
|
29681
|
+
errorMessage = `The transaction reverted because of an "assert_ne" statement${suffix}`;
|
29682
|
+
break;
|
29683
|
+
}
|
29684
|
+
case FAILED_ASSERT_SIGNAL:
|
29685
|
+
reason = "assert";
|
29686
|
+
errorMessage = `The transaction reverted because an "assert" statement failed to evaluate to true.`;
|
29687
|
+
break;
|
29688
|
+
case FAILED_TRANSFER_TO_ADDRESS_SIGNAL:
|
29689
|
+
reason = "MissingOutputVariable";
|
29690
|
+
errorMessage = `The transaction reverted because it's missing an "OutputVariable".`;
|
29691
|
+
break;
|
29692
|
+
default:
|
29693
|
+
reason = `revert_with_log`;
|
29694
|
+
errorMessage = `The transaction reverted because a "revert_with_log" statement has thrown ${logs.length ? stringify(lastLog) : "an error."}.`;
|
29695
|
+
break;
|
29696
|
+
}
|
29697
|
+
return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
|
29698
|
+
...metadata,
|
29699
|
+
reason
|
29700
|
+
});
|
29701
|
+
}, "assembleSignalErrorMessage");
|
29702
|
+
function buildAbiErrorMessage(abiError, logs, metadata, reason) {
|
29703
|
+
const { pos, msg } = abiError;
|
29704
|
+
let errorMessage = "";
|
29705
|
+
const positionMessage = pos ? `
|
29706
|
+
|
29707
|
+
This error originated at ${JSON.stringify(pos, null, 2)}` : "";
|
29708
|
+
if (msg) {
|
29709
|
+
errorMessage = `A sway "panic" expression was invoked with the message: "${msg}".${positionMessage}`;
|
29710
|
+
} else {
|
29711
|
+
const value = logs[logs.length - 1];
|
29712
|
+
errorMessage = `A sway "panic" expression was invoked with the value: ${JSON.stringify(value)}.${positionMessage}`;
|
29713
|
+
}
|
29714
|
+
return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
|
29715
|
+
...metadata,
|
29716
|
+
reason
|
29717
|
+
});
|
29718
|
+
}
|
29719
|
+
__name(buildAbiErrorMessage, "buildAbiErrorMessage");
|
29720
|
+
function findErrorInAbis(statusReason, abis = []) {
|
29721
|
+
for (const abi of abis) {
|
29722
|
+
if (abi.errorCodes?.[statusReason]) {
|
29723
|
+
return abi.errorCodes[statusReason];
|
29694
29724
|
}
|
29695
29725
|
}
|
29726
|
+
return void 0;
|
29727
|
+
}
|
29728
|
+
__name(findErrorInAbis, "findErrorInAbis");
|
29729
|
+
var assembleRevertError = /* @__PURE__ */ __name((_receipts, logs, metadata, statusReason, abis) => {
|
29730
|
+
const match = statusReason.match(/Revert\((\d+)\)/);
|
29731
|
+
const reason = match?.[1] ?? statusReason;
|
29732
|
+
const reasonHex = bn(reason).toHex();
|
29733
|
+
if (Object.values(SwaySignalErrors).includes(reasonHex)) {
|
29734
|
+
return assembleSignalErrorMessage(reasonHex, logs, metadata);
|
29735
|
+
}
|
29736
|
+
let abiError;
|
29737
|
+
if (abis) {
|
29738
|
+
const abisArr = [abis.main, ...Object.values(abis.otherContractsAbis)];
|
29739
|
+
abiError = findErrorInAbis(reason, abisArr);
|
29740
|
+
}
|
29741
|
+
if (abiError) {
|
29742
|
+
return buildAbiErrorMessage(abiError, logs, metadata, reason);
|
29743
|
+
}
|
29744
|
+
const errorMessage = `The transaction reverted with reason: ${reason}.`;
|
29696
29745
|
return new FuelError(ErrorCode.SCRIPT_REVERTED, errorMessage, {
|
29697
29746
|
...metadata,
|
29698
29747
|
reason
|
29699
29748
|
});
|
29700
29749
|
}, "assembleRevertError");
|
29701
29750
|
var extractTxError = /* @__PURE__ */ __name((params) => {
|
29702
|
-
const { receipts, statusReason, logs, groupedLogs } = params;
|
29751
|
+
const { receipts, statusReason, logs, groupedLogs, abis } = params;
|
29703
29752
|
const isPanic = receipts.some(({ type: type3 }) => type3 === ReceiptType.Panic);
|
29704
29753
|
const isRevert = receipts.some(({ type: type3 }) => type3 === ReceiptType.Revert);
|
29705
29754
|
const metadata = {
|
@@ -29713,7 +29762,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
29713
29762
|
if (isPanic) {
|
29714
29763
|
return assemblePanicError(statusReason, metadata);
|
29715
29764
|
}
|
29716
|
-
return assembleRevertError(receipts, logs, metadata);
|
29765
|
+
return assembleRevertError(receipts, logs, metadata, statusReason, abis);
|
29717
29766
|
}, "extractTxError");
|
29718
29767
|
|
29719
29768
|
// src/providers/utils/merge-quantities.ts
|
@@ -31315,6 +31364,42 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
31315
31364
|
return maxFee;
|
31316
31365
|
}, "calculateTXFeeForSummary");
|
31317
31366
|
|
31367
|
+
// src/providers/transaction-summary/call.ts
|
31368
|
+
var getFunctionCall = /* @__PURE__ */ __name(({
|
31369
|
+
abi,
|
31370
|
+
receipt,
|
31371
|
+
offset,
|
31372
|
+
scriptData
|
31373
|
+
}) => {
|
31374
|
+
const [functionSelector, argumentsOffset] = new StdStringCoder().decode(scriptData, offset);
|
31375
|
+
const abiInterface = new Interface(abi);
|
31376
|
+
const functionFragment = abiInterface.getFunction(functionSelector);
|
31377
|
+
const inputs = functionFragment.jsonFn.inputs;
|
31378
|
+
let argumentsProvided;
|
31379
|
+
if (inputs.length) {
|
31380
|
+
const functionArgsBytes = scriptData.slice(argumentsOffset);
|
31381
|
+
const decodedArguments = functionFragment.decodeArguments(functionArgsBytes);
|
31382
|
+
argumentsProvided = inputs.reduce((prev, input, index) => {
|
31383
|
+
const value = decodedArguments?.[index];
|
31384
|
+
const name = input.name;
|
31385
|
+
if (name) {
|
31386
|
+
return {
|
31387
|
+
...prev,
|
31388
|
+
// reparse to remove bn
|
31389
|
+
[name]: JSON.parse(JSON.stringify(value))
|
31390
|
+
};
|
31391
|
+
}
|
31392
|
+
return prev;
|
31393
|
+
}, {});
|
31394
|
+
}
|
31395
|
+
return {
|
31396
|
+
functionSignature: functionFragment.signature,
|
31397
|
+
functionName: functionFragment.name,
|
31398
|
+
argumentsProvided,
|
31399
|
+
...receipt.amount?.isZero() ? {} : { amount: receipt.amount, assetId: receipt.assetId }
|
31400
|
+
};
|
31401
|
+
}, "getFunctionCall");
|
31402
|
+
|
31318
31403
|
// src/providers/transaction-summary/input.ts
|
31319
31404
|
function getInputsByTypes(inputs, types) {
|
31320
31405
|
return inputs.filter((i) => types.includes(i.type));
|
@@ -31644,12 +31729,45 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
31644
31729
|
return withdrawFromFuelOperations;
|
31645
31730
|
}
|
31646
31731
|
__name(getWithdrawFromFuelOperations, "getWithdrawFromFuelOperations");
|
31647
|
-
function
|
31732
|
+
function findBytesSegmentIndex(whole, segment) {
|
31733
|
+
for (let i = 0; i <= whole.length - segment.length; i++) {
|
31734
|
+
let match = true;
|
31735
|
+
for (let j = 0; j < segment.length; j++) {
|
31736
|
+
if (whole[i + j] !== segment[j]) {
|
31737
|
+
match = false;
|
31738
|
+
break;
|
31739
|
+
}
|
31740
|
+
}
|
31741
|
+
if (match) {
|
31742
|
+
return i;
|
31743
|
+
}
|
31744
|
+
}
|
31745
|
+
return -1;
|
31746
|
+
}
|
31747
|
+
__name(findBytesSegmentIndex, "findBytesSegmentIndex");
|
31748
|
+
function getContractCalls(contractInput, abiMap, receipt, scriptData) {
|
31749
|
+
const calls = [];
|
31648
31750
|
const abi = abiMap?.[contractInput.contractID];
|
31649
|
-
if (!abi) {
|
31650
|
-
return
|
31751
|
+
if (!abi || !scriptData) {
|
31752
|
+
return calls;
|
31753
|
+
}
|
31754
|
+
const bytesSegment = concat([
|
31755
|
+
arrayify(receipt.to),
|
31756
|
+
// Contract ID (32 bytes)
|
31757
|
+
toBytes(receipt.param1.toHex(), 8),
|
31758
|
+
// Function selector offset (8 bytes)
|
31759
|
+
toBytes(receipt.param2.toHex(), 8)
|
31760
|
+
// Function args offset (8 bytes)
|
31761
|
+
]);
|
31762
|
+
const segmentIndex = findBytesSegmentIndex(scriptData, bytesSegment);
|
31763
|
+
const canDecodeFunctionCall = segmentIndex !== -1;
|
31764
|
+
if (!canDecodeFunctionCall) {
|
31765
|
+
return calls;
|
31651
31766
|
}
|
31652
|
-
|
31767
|
+
const offset = segmentIndex + bytesSegment.length;
|
31768
|
+
const call = getFunctionCall({ abi, receipt, offset, scriptData });
|
31769
|
+
calls.push(call);
|
31770
|
+
return calls;
|
31653
31771
|
}
|
31654
31772
|
__name(getContractCalls, "getContractCalls");
|
31655
31773
|
function getAssetsSent(receipt) {
|
@@ -31661,14 +31779,14 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
31661
31779
|
];
|
31662
31780
|
}
|
31663
31781
|
__name(getAssetsSent, "getAssetsSent");
|
31664
|
-
function processCallReceipt(receipt, contractInput, inputs, abiMap,
|
31782
|
+
function processCallReceipt(receipt, contractInput, inputs, abiMap, scriptData, baseAssetId) {
|
31665
31783
|
const assetId = receipt.assetId === ZeroBytes32 ? baseAssetId : receipt.assetId;
|
31666
31784
|
const input = getInputFromAssetId(inputs, assetId, assetId === baseAssetId);
|
31667
31785
|
if (!input) {
|
31668
31786
|
return [];
|
31669
31787
|
}
|
31670
31788
|
const inputAddress = getInputAccountAddress(input);
|
31671
|
-
const calls = getContractCalls(contractInput, abiMap, receipt,
|
31789
|
+
const calls = getContractCalls(contractInput, abiMap, receipt, scriptData);
|
31672
31790
|
return [
|
31673
31791
|
{
|
31674
31792
|
name: "Contract call" /* contractCall */,
|
@@ -31693,7 +31811,6 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
31693
31811
|
receipts,
|
31694
31812
|
abiMap,
|
31695
31813
|
rawPayload,
|
31696
|
-
maxInputs,
|
31697
31814
|
baseAssetId
|
31698
31815
|
}) {
|
31699
31816
|
const contractCallReceipts = getReceiptsCall(receipts);
|
@@ -31703,16 +31820,15 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
31703
31820
|
if (!contractInput) {
|
31704
31821
|
return [];
|
31705
31822
|
}
|
31823
|
+
let scriptData;
|
31824
|
+
if (rawPayload) {
|
31825
|
+
const [transaction] = new TransactionCoder().decode(arrayify(rawPayload), 0);
|
31826
|
+
if (transaction.type === TransactionType.Script) {
|
31827
|
+
scriptData = arrayify(transaction.scriptData);
|
31828
|
+
}
|
31829
|
+
}
|
31706
31830
|
return contractCallReceipts.filter((receipt) => receipt.to === contractInput.contractID).flatMap(
|
31707
|
-
(receipt) => processCallReceipt(
|
31708
|
-
receipt,
|
31709
|
-
contractInput,
|
31710
|
-
inputs,
|
31711
|
-
abiMap,
|
31712
|
-
rawPayload,
|
31713
|
-
maxInputs,
|
31714
|
-
baseAssetId
|
31715
|
-
)
|
31831
|
+
(receipt) => processCallReceipt(receipt, contractInput, inputs, abiMap, scriptData, baseAssetId)
|
31716
31832
|
);
|
31717
31833
|
});
|
31718
31834
|
}
|
@@ -32477,6 +32593,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
32477
32593
|
...transactionSummary
|
32478
32594
|
};
|
32479
32595
|
let { logs, groupedLogs } = { logs: [], groupedLogs: {} };
|
32596
|
+
let abis;
|
32480
32597
|
if (this.abis) {
|
32481
32598
|
({ logs, groupedLogs } = getAllDecodedLogs({
|
32482
32599
|
receipts: transactionSummary.receipts,
|
@@ -32485,6 +32602,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
32485
32602
|
}));
|
32486
32603
|
transactionResult.logs = logs;
|
32487
32604
|
transactionResult.groupedLogs = groupedLogs;
|
32605
|
+
abis = this.abis;
|
32488
32606
|
}
|
32489
32607
|
const { receipts } = transactionResult;
|
32490
32608
|
const status = this.getTransactionStatus();
|
@@ -32494,7 +32612,8 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
32494
32612
|
receipts,
|
32495
32613
|
statusReason: reason,
|
32496
32614
|
logs,
|
32497
|
-
groupedLogs
|
32615
|
+
groupedLogs,
|
32616
|
+
abis
|
32498
32617
|
});
|
32499
32618
|
}
|
32500
32619
|
return transactionResult;
|
@@ -34370,18 +34489,21 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
34370
34489
|
extractDryRunError(transactionRequest, receipts, reason) {
|
34371
34490
|
let logs = [];
|
34372
34491
|
let groupedLogs = {};
|
34492
|
+
let abis;
|
34373
34493
|
if (transactionRequest.type === TransactionType.Script && transactionRequest.abis) {
|
34374
34494
|
({ logs, groupedLogs } = getAllDecodedLogs({
|
34375
34495
|
receipts,
|
34376
34496
|
mainAbi: transactionRequest.abis.main,
|
34377
34497
|
externalAbis: transactionRequest.abis.otherContractsAbis
|
34378
34498
|
}));
|
34499
|
+
abis = transactionRequest.abis;
|
34379
34500
|
}
|
34380
34501
|
return extractTxError({
|
34381
34502
|
logs,
|
34382
34503
|
groupedLogs,
|
34383
34504
|
receipts,
|
34384
|
-
statusReason: reason
|
34505
|
+
statusReason: reason,
|
34506
|
+
abis
|
34385
34507
|
});
|
34386
34508
|
}
|
34387
34509
|
/**
|
@@ -35307,14 +35429,23 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
35307
35429
|
* @param transactionRequestLike - The transaction request to sign.
|
35308
35430
|
* @returns A promise that resolves to the signature of the transaction.
|
35309
35431
|
*/
|
35310
|
-
async signTransaction(transactionRequestLike) {
|
35432
|
+
async signTransaction(transactionRequestLike, connectorOptions = {}) {
|
35311
35433
|
if (!this._connector) {
|
35312
35434
|
throw new FuelError(
|
35313
35435
|
ErrorCode.MISSING_CONNECTOR,
|
35314
35436
|
"A connector is required to sign transactions."
|
35315
35437
|
);
|
35316
35438
|
}
|
35317
|
-
|
35439
|
+
const transactionRequest = transactionRequestify(transactionRequestLike);
|
35440
|
+
const { transactionRequest: requestToSign, connectorsSendTxParams } = await this.setTransactionStateForConnectors({
|
35441
|
+
transactionRequest,
|
35442
|
+
connectorOptions
|
35443
|
+
});
|
35444
|
+
return this._connector.signTransaction(
|
35445
|
+
this.address.toString(),
|
35446
|
+
requestToSign,
|
35447
|
+
connectorsSendTxParams
|
35448
|
+
);
|
35318
35449
|
}
|
35319
35450
|
/**
|
35320
35451
|
* Sends a transaction to the network.
|
@@ -35324,24 +35455,16 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
35324
35455
|
* @returns A promise that resolves to the transaction response.
|
35325
35456
|
*/
|
35326
35457
|
async sendTransaction(transactionRequestLike, { estimateTxDependencies = true, ...connectorOptions } = {}) {
|
35327
|
-
|
35458
|
+
const transactionRequest = transactionRequestify(transactionRequestLike);
|
35328
35459
|
if (this._connector) {
|
35329
|
-
const
|
35330
|
-
|
35331
|
-
|
35332
|
-
|
35333
|
-
skipCustomFee,
|
35334
|
-
provider: {
|
35335
|
-
url: this.provider.url,
|
35336
|
-
cache: await serializeProviderCache(this.provider)
|
35337
|
-
},
|
35338
|
-
transactionState: transactionRequest.flag.state,
|
35339
|
-
transactionSummary: await this.prepareTransactionSummary(transactionRequest)
|
35340
|
-
};
|
35460
|
+
const response = await this.setTransactionStateForConnectors({
|
35461
|
+
transactionRequest,
|
35462
|
+
connectorOptions
|
35463
|
+
});
|
35341
35464
|
const transaction = await this._connector.sendTransaction(
|
35342
35465
|
this.address.toString(),
|
35343
|
-
transactionRequest,
|
35344
|
-
|
35466
|
+
response.transactionRequest,
|
35467
|
+
response.connectorsSendTxParams
|
35345
35468
|
);
|
35346
35469
|
return typeof transaction === "string" ? this.provider.getTransactionResponse(transaction) : transaction;
|
35347
35470
|
}
|
@@ -35475,6 +35598,23 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
35475
35598
|
);
|
35476
35599
|
}
|
35477
35600
|
}
|
35601
|
+
/** @hidden * */
|
35602
|
+
async setTransactionStateForConnectors(params) {
|
35603
|
+
const { transactionRequest: requestToPrepare, connectorOptions } = params;
|
35604
|
+
const { onBeforeSend, skipCustomFee = false } = connectorOptions;
|
35605
|
+
const transactionRequest = await this.prepareTransactionForSend(requestToPrepare);
|
35606
|
+
const connectorsSendTxParams = {
|
35607
|
+
onBeforeSend,
|
35608
|
+
skipCustomFee,
|
35609
|
+
provider: {
|
35610
|
+
url: this.provider.url,
|
35611
|
+
cache: await serializeProviderCache(this.provider)
|
35612
|
+
},
|
35613
|
+
transactionState: requestToPrepare.flag.state,
|
35614
|
+
transactionSummary: await this.prepareTransactionSummary(requestToPrepare)
|
35615
|
+
};
|
35616
|
+
return { transactionRequest, connectorsSendTxParams };
|
35617
|
+
}
|
35478
35618
|
};
|
35479
35619
|
|
35480
35620
|
// ../../node_modules/.pnpm/@noble+curves@1.8.1/node_modules/@noble/curves/esm/abstract/utils.js
|
@@ -41674,6 +41814,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
41674
41814
|
FuelConnectorMethods2["isConnected"] = "isConnected";
|
41675
41815
|
FuelConnectorMethods2["accounts"] = "accounts";
|
41676
41816
|
FuelConnectorMethods2["currentAccount"] = "currentAccount";
|
41817
|
+
FuelConnectorMethods2["signTransaction"] = "signTransaction";
|
41677
41818
|
FuelConnectorMethods2["signMessage"] = "signMessage";
|
41678
41819
|
FuelConnectorMethods2["sendTransaction"] = "sendTransaction";
|
41679
41820
|
FuelConnectorMethods2["assets"] = "assets";
|
@@ -41815,7 +41956,7 @@ ${PANIC_DOC_URL}#variant.${statusReason}`;
|
|
41815
41956
|
*
|
41816
41957
|
* @returns Transaction signature
|
41817
41958
|
*/
|
41818
|
-
async signTransaction(_address, _transaction) {
|
41959
|
+
async signTransaction(_address, _transaction, _params) {
|
41819
41960
|
throw new FuelError(FuelError.CODES.NOT_IMPLEMENTED, "Method not implemented.");
|
41820
41961
|
}
|
41821
41962
|
/**
|