@fuel-ts/account 0.0.0-rc-1815-20240322131329 → 0.0.0-rc-1832-20240322144804
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 +0 -7
- package/dist/account.d.ts.map +1 -1
- package/dist/connectors/fuel-connector.d.ts +0 -10
- package/dist/connectors/fuel-connector.d.ts.map +1 -1
- package/dist/index.global.js +78 -91
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +6 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -66
- package/dist/index.mjs.map +1 -1
- package/dist/providers/provider.d.ts +2 -3
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +1 -20
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils.global.js +78 -79
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +6 -54
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +6 -54
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +16 -16
@@ -10,7 +10,7 @@ import type { CoinQuantity, CoinQuantityLike } from './coin-quantity';
|
|
10
10
|
import { MemoryCache } from './memory-cache';
|
11
11
|
import type { Message, MessageProof, MessageStatus } from './message';
|
12
12
|
import type { ExcludeResourcesOption, Resource } from './resource';
|
13
|
-
import type { TransactionRequestLike, TransactionRequest, TransactionRequestInput
|
13
|
+
import type { TransactionRequestLike, TransactionRequest, TransactionRequestInput } from './transaction-request';
|
14
14
|
import type { TransactionResultReceipt } from './transaction-response';
|
15
15
|
import { TransactionResponse } from './transaction-response';
|
16
16
|
import type { RetryOptions } from './utils/auto-retry-fetch';
|
@@ -163,7 +163,6 @@ export type EstimatePredicateParams = {
|
|
163
163
|
};
|
164
164
|
export type TransactionCostParams = EstimateTransactionParams & EstimatePredicateParams & {
|
165
165
|
resourcesOwner?: AbstractAccount;
|
166
|
-
signatureCallback?: (request: ScriptTransactionRequest) => Promise<ScriptTransactionRequest>;
|
167
166
|
};
|
168
167
|
/**
|
169
168
|
* Provider Call transaction params
|
@@ -357,7 +356,7 @@ export default class Provider {
|
|
357
356
|
* @param tolerance - The tolerance to add on top of the gasUsed.
|
358
357
|
* @returns A promise that resolves to the transaction cost object.
|
359
358
|
*/
|
360
|
-
getTransactionCost(transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[], { estimateTxDependencies, estimatePredicates, resourcesOwner,
|
359
|
+
getTransactionCost(transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[], { estimateTxDependencies, estimatePredicates, resourcesOwner, }?: TransactionCostParams): Promise<TransactionCost>;
|
361
360
|
getResourcesForTransaction(owner: string | AbstractAddress, transactionRequestLike: TransactionRequestLike, forwardingQuantities?: CoinQuantity[]): Promise<{
|
362
361
|
receipts: TransactionResultReceipt[];
|
363
362
|
minGasPrice: BN;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/providers/provider.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,EAAE,EAAW,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAUzD,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAOjC,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAEV,WAAW,EACX,0BAA0B,EAC1B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EA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KAAK,EAAE,MAAM,GAAG,eAAe;IAC/B,2BAA2B;IAC3B,cAAc,CAAC,EAAE,oBAAoB,GACpC,OAAO,CAAC,YAAY,EAAE,CAAC;IAe1B;;;;;;OAMG;IACG,WAAW;IACf,sCAAsC;IACtC,OAAO,EAAE,MAAM,GAAG,eAAe;IACjC,2BAA2B;IAC3B,cAAc,CAAC,EAAE,oBAAoB,GACpC,OAAO,CAAC,OAAO,EAAE,CAAC;IA0BrB;;;;;;;;OAQG;IACG,eAAe;IACnB,0CAA0C;IAC1C,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,MAAM,EACtB,iBAAiB,CAAC,EAAE,EAAE,GACrB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC;IA8F/B;;;;;OAKG;IACG,gBAAgB;IACpB,kDAAkD;IAClD,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,CAAC;IAKzB;;;;;;OAMG;IACG,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAShD,sBAAsB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAGlF"}
|
@@ -3,7 +3,6 @@ import type { AddressLike, AbstractAddress, BytesLike } from '@fuel-ts/interface
|
|
3
3
|
import type { BN, BigNumberish } from '@fuel-ts/math';
|
4
4
|
import type { TransactionScript, Policy, TransactionCreate } from '@fuel-ts/transactions';
|
5
5
|
import { TransactionType } from '@fuel-ts/transactions';
|
6
|
-
import type { Account } from '../../account';
|
7
6
|
import type { Predicate } from '../../predicate';
|
8
7
|
import type { GqlGasCosts } from '../__generated__/operations';
|
9
8
|
import type { Coin } from '../coin';
|
@@ -96,23 +95,12 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
96
95
|
* Pushes an output to the list without any side effects and returns the index
|
97
96
|
*/
|
98
97
|
protected pushOutput(output: TransactionRequestOutput): number;
|
99
|
-
/**
|
100
|
-
* @hidden
|
101
|
-
*
|
102
|
-
* Pushes a witness to the list and returns the index
|
103
|
-
*
|
104
|
-
* @param signature - The signature to add to the witness.
|
105
|
-
* @returns The index of the created witness.
|
106
|
-
*/
|
107
|
-
addWitness(signature: BytesLike): number;
|
108
98
|
/**
|
109
99
|
* @hidden
|
110
100
|
*
|
111
101
|
* Creates an empty witness without any side effects and returns the index
|
112
|
-
*
|
113
|
-
* @returns The index of the created witness.
|
114
102
|
*/
|
115
|
-
protected
|
103
|
+
protected createWitness(): number;
|
116
104
|
/**
|
117
105
|
* Updates the witness for a given owner and signature.
|
118
106
|
*
|
@@ -128,13 +116,6 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
128
116
|
* @throws If the witness does not exist.
|
129
117
|
*/
|
130
118
|
updateWitness(index: number, witness: TransactionRequestWitness): void;
|
131
|
-
/**
|
132
|
-
* Helper function to add an external signature to the transaction.
|
133
|
-
*
|
134
|
-
* @param account - The account/s to sign to the transaction.
|
135
|
-
* @returns The transaction with the signature witness added.
|
136
|
-
*/
|
137
|
-
addAccountWitnesses(account: Account | Account[]): Promise<this>;
|
138
119
|
/**
|
139
120
|
* Gets the coin inputs for a transaction.
|
140
121
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/transaction-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAKL,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/transaction-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EAKL,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAE5B,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EACV,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AAG3D,OAAO;AACL;;GAEG;AACH,eAAe,GAChB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAA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,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,SAAuB;IAWrF;;;;;OAKG;IACH,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,gBAAgB,EAAE;IAa9D;;;;;OAKG;IACH,eAAe,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,GAAE,SAAuB;IAgBjE;;OAEG;IACH,QAAQ;IAIR;;OAEG;IACH,WAAW,CAAC,SAAS,EAAE,WAAW,GAAG,EAAE;IAIvC;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,EAAE;IAYzC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE;IAgBrD;;;;;OAKG;IACH,iBAAiB,CAAC,UAAU,EAAE,YAAY,EAAE,EAAE,cAAc,CAAC,EAAE,eAAe;IAyC9E;;;;;OAKG;IACH,wBAAwB,IAAI,YAAY,EAAE;IAS1C;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAElD;;;;;OAKG;IACH,MAAM;IAIN,qBAAqB,CAAC,MAAM,EAAE,uBAAuB,EAAE;CA6BxD"}
|
@@ -31914,7 +31914,7 @@ spurious results.`);
|
|
31914
31914
|
// ../versions/dist/index.mjs
|
31915
31915
|
function getBuiltinVersions() {
|
31916
31916
|
return {
|
31917
|
-
FORC: "
|
31917
|
+
FORC: "git:xunilrj/encoding-contract-call",
|
31918
31918
|
FUEL_CORE: "0.22.1",
|
31919
31919
|
FUELS: "0.77.0"
|
31920
31920
|
};
|
@@ -35383,9 +35383,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35383
35383
|
__privateAdd2(this, _getPaddedData);
|
35384
35384
|
}
|
35385
35385
|
encode(value) {
|
35386
|
-
if (!Array.isArray(value)) {
|
35387
|
-
throw new FuelError(ErrorCode.ENCODE_ERROR, `Expected array value.`);
|
35388
|
-
}
|
35389
35386
|
const parts = [];
|
35390
35387
|
const pointer = new BigNumberCoder("u64").encode(BASE_VECTOR_OFFSET);
|
35391
35388
|
const data = __privateMethod2(this, _getPaddedData, getPaddedData_fn).call(this, value);
|
@@ -35412,7 +35409,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35412
35409
|
};
|
35413
35410
|
_getPaddedData = /* @__PURE__ */ new WeakSet();
|
35414
35411
|
getPaddedData_fn = function(value) {
|
35415
|
-
const
|
35412
|
+
const bytes3 = value instanceof Uint8Array ? value : new Uint8Array(value);
|
35413
|
+
const data = [Uint8Array.from(bytes3)];
|
35416
35414
|
const paddingLength = (WORD_SIZE - value.length % WORD_SIZE) % WORD_SIZE;
|
35417
35415
|
if (paddingLength) {
|
35418
35416
|
data.push(new Uint8Array(paddingLength));
|
@@ -35505,7 +35503,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35505
35503
|
return { None: [] };
|
35506
35504
|
}
|
35507
35505
|
decode(data, offset) {
|
35508
|
-
if (data.length < this.encodedLength
|
35506
|
+
if (data.length < this.encodedLength) {
|
35509
35507
|
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid option data size.`);
|
35510
35508
|
}
|
35511
35509
|
const [decoded, newOffset] = super.decode(data, offset);
|
@@ -36088,11 +36086,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36088
36086
|
super("struct", "struct Bytes", WORD_SIZE);
|
36089
36087
|
}
|
36090
36088
|
encode(value) {
|
36091
|
-
|
36092
|
-
|
36093
|
-
}
|
36094
|
-
const bytes3 = new Uint8Array(value);
|
36095
|
-
const lengthBytes = new BigNumberCoder("u64").encode(value.length);
|
36089
|
+
const bytes3 = value instanceof Uint8Array ? value : new Uint8Array(value);
|
36090
|
+
const lengthBytes = new BigNumberCoder("u64").encode(bytes3.length);
|
36096
36091
|
return new Uint8Array([...lengthBytes, ...bytes3]);
|
36097
36092
|
}
|
36098
36093
|
decode(data, offset) {
|
@@ -36223,6 +36218,28 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36223
36218
|
return [toNumber2(bytes3), offset + this.length];
|
36224
36219
|
}
|
36225
36220
|
};
|
36221
|
+
var OptionCoder2 = class extends EnumCoder2 {
|
36222
|
+
encode(value) {
|
36223
|
+
const result = super.encode(this.toSwayOption(value));
|
36224
|
+
return result;
|
36225
|
+
}
|
36226
|
+
toSwayOption(input) {
|
36227
|
+
if (input !== void 0) {
|
36228
|
+
return { Some: input };
|
36229
|
+
}
|
36230
|
+
return { None: [] };
|
36231
|
+
}
|
36232
|
+
decode(data, offset) {
|
36233
|
+
const [decoded, newOffset] = super.decode(data, offset);
|
36234
|
+
return [this.toOption(decoded), newOffset];
|
36235
|
+
}
|
36236
|
+
toOption(output3) {
|
36237
|
+
if (output3 && "Some" in output3) {
|
36238
|
+
return output3.Some;
|
36239
|
+
}
|
36240
|
+
return void 0;
|
36241
|
+
}
|
36242
|
+
};
|
36226
36243
|
var RawSliceCoder2 = class extends Coder {
|
36227
36244
|
constructor() {
|
36228
36245
|
super("raw untyped slice", "raw untyped slice", WORD_SIZE);
|
@@ -36276,6 +36293,30 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36276
36293
|
}
|
36277
36294
|
};
|
36278
36295
|
__publicField4(StdStringCoder2, "memorySize", 1);
|
36296
|
+
var StrSliceCoder = class extends Coder {
|
36297
|
+
constructor() {
|
36298
|
+
super("strSlice", "str", WORD_SIZE);
|
36299
|
+
}
|
36300
|
+
encode(value) {
|
36301
|
+
const bytes3 = toUtf8Bytes(value);
|
36302
|
+
const lengthBytes = new BigNumberCoder("u64").encode(value.length);
|
36303
|
+
return new Uint8Array([...lengthBytes, ...bytes3]);
|
36304
|
+
}
|
36305
|
+
decode(data, offset) {
|
36306
|
+
if (data.length < this.encodedLength) {
|
36307
|
+
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string slice data size.`);
|
36308
|
+
}
|
36309
|
+
const offsetAndLength = offset + WORD_SIZE;
|
36310
|
+
const lengthBytes = data.slice(offset, offsetAndLength);
|
36311
|
+
const length = bn(new BigNumberCoder("u64").decode(lengthBytes, 0)[0]).toNumber();
|
36312
|
+
const bytes3 = data.slice(offsetAndLength, offsetAndLength + length);
|
36313
|
+
if (bytes3.length !== length) {
|
36314
|
+
throw new FuelError(ErrorCode.DECODE_ERROR, `Invalid string slice byte data size.`);
|
36315
|
+
}
|
36316
|
+
return [toUtf8String(bytes3), offsetAndLength + length];
|
36317
|
+
}
|
36318
|
+
};
|
36319
|
+
__publicField4(StrSliceCoder, "memorySize", 1);
|
36279
36320
|
var StringCoder2 = class extends Coder {
|
36280
36321
|
constructor(length) {
|
36281
36322
|
super("string", `str[${length}]`, length);
|
@@ -36314,7 +36355,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36314
36355
|
Object.keys(this.coders).map((fieldName) => {
|
36315
36356
|
const fieldCoder = this.coders[fieldName];
|
36316
36357
|
const fieldValue = value[fieldName];
|
36317
|
-
if (!(fieldCoder instanceof
|
36358
|
+
if (!(fieldCoder instanceof OptionCoder2) && fieldValue == null) {
|
36318
36359
|
throw new FuelError(
|
36319
36360
|
ErrorCode.ENCODE_ERROR,
|
36320
36361
|
`Invalid ${this.type}. Field "${fieldName}" not present.`
|
@@ -36422,6 +36463,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36422
36463
|
return new ByteCoder2();
|
36423
36464
|
case STD_STRING_CODER_TYPE:
|
36424
36465
|
return new StdStringCoder2();
|
36466
|
+
case STR_SLICE_CODER_TYPE:
|
36467
|
+
return new StrSliceCoder();
|
36425
36468
|
default:
|
36426
36469
|
break;
|
36427
36470
|
}
|
@@ -36466,7 +36509,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36466
36509
|
const coders = getCoders(components, { getCoder: getCoder2 });
|
36467
36510
|
const isOptionEnum = resolvedAbiType.type === OPTION_CODER_TYPE;
|
36468
36511
|
if (isOptionEnum) {
|
36469
|
-
return new
|
36512
|
+
return new OptionCoder2(enumMatch.name, coders);
|
36470
36513
|
}
|
36471
36514
|
return new EnumCoder2(enumMatch.name, coders);
|
36472
36515
|
}
|
@@ -36477,12 +36520,6 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36477
36520
|
);
|
36478
36521
|
return new TupleCoder2(coders);
|
36479
36522
|
}
|
36480
|
-
if (resolvedAbiType.type === STR_SLICE_CODER_TYPE) {
|
36481
|
-
throw new FuelError(
|
36482
|
-
ErrorCode.INVALID_DATA,
|
36483
|
-
"String slices can not be decoded from logs. Convert the slice to `str[N]` with `__to_str_array`"
|
36484
|
-
);
|
36485
|
-
}
|
36486
36523
|
throw new FuelError(
|
36487
36524
|
ErrorCode.CODER_NOT_FOUND,
|
36488
36525
|
`Coder not found: ${JSON.stringify(resolvedAbiType)}.`
|
@@ -36518,6 +36555,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36518
36555
|
var FunctionFragment = class {
|
36519
36556
|
signature;
|
36520
36557
|
selector;
|
36558
|
+
selectorBytes;
|
36559
|
+
encoding;
|
36521
36560
|
name;
|
36522
36561
|
jsonFn;
|
36523
36562
|
attributes;
|
@@ -36530,6 +36569,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36530
36569
|
this.name = name;
|
36531
36570
|
this.signature = FunctionFragment.getSignature(this.jsonAbi, this.jsonFn);
|
36532
36571
|
this.selector = FunctionFragment.getFunctionSelector(this.signature);
|
36572
|
+
this.selectorBytes = new StdStringCoder2().encode(name);
|
36573
|
+
this.encoding = this.jsonAbi.encoding;
|
36533
36574
|
this.isInputDataPointer = this.#isInputDataPointer();
|
36534
36575
|
this.outputMetadata = {
|
36535
36576
|
isHeapType: this.#isOutputDataHeap(),
|
@@ -36583,11 +36624,14 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36583
36624
|
}
|
36584
36625
|
const coders = nonEmptyInputs.map(
|
36585
36626
|
(t) => AbiCoder.getCoder(this.jsonAbi, t, {
|
36586
|
-
isRightPadded: nonEmptyInputs.length > 1
|
36627
|
+
isRightPadded: nonEmptyInputs.length > 1,
|
36628
|
+
encoding: this.encoding
|
36587
36629
|
})
|
36588
36630
|
);
|
36589
|
-
|
36590
|
-
|
36631
|
+
if (this.encoding === ENCODING_V1) {
|
36632
|
+
return new TupleCoder2(coders).encode(shallowCopyValues);
|
36633
|
+
}
|
36634
|
+
const results = new TupleCoder(coders).encode(shallowCopyValues);
|
36591
36635
|
return unpackDynamicData(results, offset, results.byteLength);
|
36592
36636
|
}
|
36593
36637
|
static verifyArgsAndInputsAlign(args, inputs, abi) {
|
@@ -36634,7 +36678,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36634
36678
|
}
|
36635
36679
|
const result = nonEmptyInputs.reduce(
|
36636
36680
|
(obj, input) => {
|
36637
|
-
const coder = AbiCoder.getCoder(this.jsonAbi, input);
|
36681
|
+
const coder = AbiCoder.getCoder(this.jsonAbi, input, { encoding: this.encoding });
|
36638
36682
|
const [decodedValue, decodedValueByteSize] = coder.decode(bytes3, obj.offset);
|
36639
36683
|
return {
|
36640
36684
|
decoded: [...obj.decoded, decodedValue],
|
@@ -36654,7 +36698,9 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36654
36698
|
return [void 0, 0];
|
36655
36699
|
}
|
36656
36700
|
const bytes3 = arrayify(data);
|
36657
|
-
const coder = AbiCoder.getCoder(this.jsonAbi, this.jsonFn.output
|
36701
|
+
const coder = AbiCoder.getCoder(this.jsonAbi, this.jsonFn.output, {
|
36702
|
+
encoding: this.encoding
|
36703
|
+
});
|
36658
36704
|
return coder.decode(bytes3, 0);
|
36659
36705
|
}
|
36660
36706
|
};
|
@@ -36739,7 +36785,8 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36739
36785
|
}
|
36740
36786
|
);
|
36741
36787
|
return AbiCoder.encode(this.jsonAbi, configurable.configurableType, value, {
|
36742
|
-
isRightPadded: true
|
36788
|
+
isRightPadded: true,
|
36789
|
+
encoding: this.jsonAbi.encoding
|
36743
36790
|
});
|
36744
36791
|
}
|
36745
36792
|
getTypeById(typeId) {
|
@@ -42882,27 +42929,13 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42882
42929
|
this.outputs.push(output3);
|
42883
42930
|
return this.outputs.length - 1;
|
42884
42931
|
}
|
42885
|
-
/**
|
42886
|
-
* @hidden
|
42887
|
-
*
|
42888
|
-
* Pushes a witness to the list and returns the index
|
42889
|
-
*
|
42890
|
-
* @param signature - The signature to add to the witness.
|
42891
|
-
* @returns The index of the created witness.
|
42892
|
-
*/
|
42893
|
-
addWitness(signature) {
|
42894
|
-
this.witnesses.push(signature);
|
42895
|
-
return this.witnesses.length - 1;
|
42896
|
-
}
|
42897
42932
|
/**
|
42898
42933
|
* @hidden
|
42899
42934
|
*
|
42900
42935
|
* Creates an empty witness without any side effects and returns the index
|
42901
|
-
*
|
42902
|
-
* @returns The index of the created witness.
|
42903
42936
|
*/
|
42904
|
-
|
42905
|
-
this.
|
42937
|
+
createWitness() {
|
42938
|
+
this.witnesses.push(concat([ZeroBytes32, ZeroBytes32]));
|
42906
42939
|
return this.witnesses.length - 1;
|
42907
42940
|
}
|
42908
42941
|
/**
|
@@ -42931,21 +42964,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
42931
42964
|
}
|
42932
42965
|
this.witnesses[index] = witness;
|
42933
42966
|
}
|
42934
|
-
/**
|
42935
|
-
* Helper function to add an external signature to the transaction.
|
42936
|
-
*
|
42937
|
-
* @param account - The account/s to sign to the transaction.
|
42938
|
-
* @returns The transaction with the signature witness added.
|
42939
|
-
*/
|
42940
|
-
async addAccountWitnesses(account) {
|
42941
|
-
const accounts = Array.isArray(account) ? account : [account];
|
42942
|
-
await Promise.all(
|
42943
|
-
accounts.map(async (acc) => {
|
42944
|
-
this.addWitness(await acc.signTransaction(this));
|
42945
|
-
})
|
42946
|
-
);
|
42947
|
-
return this;
|
42948
|
-
}
|
42949
42967
|
/**
|
42950
42968
|
* Gets the coin inputs for a transaction.
|
42951
42969
|
*
|
@@ -43011,7 +43029,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
43011
43029
|
} else {
|
43012
43030
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(owner);
|
43013
43031
|
if (typeof witnessIndex !== "number") {
|
43014
|
-
witnessIndex = this.
|
43032
|
+
witnessIndex = this.createWitness();
|
43015
43033
|
}
|
43016
43034
|
}
|
43017
43035
|
const input = {
|
@@ -43045,7 +43063,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
43045
43063
|
} else {
|
43046
43064
|
witnessIndex = this.getCoinInputWitnessIndexByOwner(recipient);
|
43047
43065
|
if (typeof witnessIndex !== "number") {
|
43048
|
-
witnessIndex = this.
|
43066
|
+
witnessIndex = this.createWitness();
|
43049
43067
|
}
|
43050
43068
|
}
|
43051
43069
|
const input = {
|
@@ -45019,8 +45037,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
45019
45037
|
async getTransactionCost(transactionRequestLike, forwardingQuantities = [], {
|
45020
45038
|
estimateTxDependencies = true,
|
45021
45039
|
estimatePredicates = true,
|
45022
|
-
resourcesOwner
|
45023
|
-
signatureCallback
|
45040
|
+
resourcesOwner
|
45024
45041
|
} = {}) {
|
45025
45042
|
const txRequestClone = clone_default(transactionRequestify(transactionRequestLike));
|
45026
45043
|
const chainInfo = this.getChain();
|
@@ -45039,9 +45056,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
45039
45056
|
}
|
45040
45057
|
await this.estimatePredicates(txRequestClone);
|
45041
45058
|
}
|
45042
|
-
if (signatureCallback && isScriptTransaction) {
|
45043
|
-
await signatureCallback(txRequestClone);
|
45044
|
-
}
|
45045
45059
|
const minGas = txRequestClone.calculateMinGas(chainInfo);
|
45046
45060
|
const maxGas = txRequestClone.calculateMaxGas(chainInfo, minGas);
|
45047
45061
|
let receipts = [];
|
@@ -45914,21 +45928,6 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
45914
45928
|
}
|
45915
45929
|
return this._connector.signMessage(this.address.toString(), message);
|
45916
45930
|
}
|
45917
|
-
/**
|
45918
|
-
* Signs a transaction with the wallet's private key.
|
45919
|
-
*
|
45920
|
-
* @param transactionRequestLike - The transaction request to sign.
|
45921
|
-
* @returns A promise that resolves to the signature of the transaction.
|
45922
|
-
*/
|
45923
|
-
async signTransaction(transactionRequestLike) {
|
45924
|
-
if (!this._connector) {
|
45925
|
-
throw new FuelError(
|
45926
|
-
ErrorCode.MISSING_CONNECTOR,
|
45927
|
-
"A connector is required to sign transactions."
|
45928
|
-
);
|
45929
|
-
}
|
45930
|
-
return this._connector.signTransaction(this.address.toString(), transactionRequestLike);
|
45931
|
-
}
|
45932
45931
|
/**
|
45933
45932
|
* Sends a transaction to the network.
|
45934
45933
|
*
|
@@ -47540,7 +47539,7 @@ ${MessageCoinFragmentFragmentDoc}`;
|
|
47540
47539
|
*/
|
47541
47540
|
async signTransaction(transactionRequestLike) {
|
47542
47541
|
const transactionRequest = transactionRequestify(transactionRequestLike);
|
47543
|
-
const chainId = this.provider.
|
47542
|
+
const chainId = this.provider.getChain().consensusParameters.chainId.toNumber();
|
47544
47543
|
const hashedTransaction = transactionRequest.getTransactionId(chainId);
|
47545
47544
|
const signature = await this.signer().sign(hashedTransaction);
|
47546
47545
|
return hexlify(signature);
|