@fuel-ts/account 0.0.0-rc-2037-20240423110545 → 0.0.0-rc-2045-20240423120113
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 +57 -88
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +141 -201
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -118
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +2 -17
- package/dist/predicate/predicate.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/transaction-request/index.d.ts +0 -1
- package/dist/providers/transaction-request/index.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +20 -4
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils/index.d.ts +0 -1
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/seedTestWallet.d.ts +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils.global.js +58 -66
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +135 -173
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +64 -99
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts +2 -2
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +15 -15
- package/dist/providers/transaction-request/helpers.d.ts +0 -10
- package/dist/providers/transaction-request/helpers.d.ts.map +0 -1
- package/dist/test-utils/resources.d.ts +0 -4
- package/dist/test-utils/resources.d.ts.map +0 -1
- package/dist/test-utils/transactionRequest.d.ts +0 -5
- package/dist/test-utils/transactionRequest.d.ts.map +0 -1
@@ -4,7 +4,7 @@ import type { AbstractAddress, BytesLike } from '@fuel-ts/interfaces';
|
|
4
4
|
import type { BigNumberish } from '@fuel-ts/math';
|
5
5
|
import { Account } from '../account';
|
6
6
|
import type { TxParamsType } from '../account';
|
7
|
-
import type { CallResult,
|
7
|
+
import type { CallResult, Provider, ProviderSendTxParams, TransactionRequest, TransactionRequestLike, TransactionResponse } from '../providers';
|
8
8
|
export type PredicateParams<T = InputValue[]> = {
|
9
9
|
bytecode: BytesLike;
|
10
10
|
provider: Provider;
|
@@ -37,7 +37,7 @@ export declare class Predicate<TInputData extends InputValue[]> extends Account
|
|
37
37
|
* @param transactionRequestLike - The transaction request-like object.
|
38
38
|
* @returns The transaction request with predicate data.
|
39
39
|
*/
|
40
|
-
populateTransactionPredicateData
|
40
|
+
populateTransactionPredicateData(transactionRequestLike: TransactionRequestLike): TransactionRequest;
|
41
41
|
/**
|
42
42
|
* A helper that creates a transfer transaction request and returns it.
|
43
43
|
*
|
@@ -70,14 +70,6 @@ export declare class Predicate<TInputData extends InputValue[]> extends Account
|
|
70
70
|
* @returns A promise that resolves to the call result.
|
71
71
|
*/
|
72
72
|
simulateTransaction(transactionRequestLike: TransactionRequestLike): Promise<CallResult>;
|
73
|
-
/**
|
74
|
-
* Retrieves resources satisfying the spend query for the account.
|
75
|
-
*
|
76
|
-
* @param quantities - Coins to retrieve.
|
77
|
-
* @param excludedIds - IDs of resources to be excluded from the query.
|
78
|
-
* @returns A promise that resolves to an array of Resources.
|
79
|
-
*/
|
80
|
-
getResourcesToSpend(quantities: CoinQuantityLike[], excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
|
81
73
|
private getPredicateData;
|
82
74
|
/**
|
83
75
|
* Processes the predicate data and returns the altered bytecode and interface.
|
@@ -97,12 +89,5 @@ export declare class Predicate<TInputData extends InputValue[]> extends Account
|
|
97
89
|
* @returns The mutated bytes with the configurable constants set.
|
98
90
|
*/
|
99
91
|
private static setConfigurableConstants;
|
100
|
-
/**
|
101
|
-
* Returns the index of the witness placeholder that was added to this predicate.
|
102
|
-
* If no witness placeholder was added, it returns -1.
|
103
|
-
* @param request - The transaction request.
|
104
|
-
* @returns The index of the witness placeholder, or -1 if there is no witness placeholder.
|
105
|
-
*/
|
106
|
-
private getIndexFromPlaceholderWitness;
|
107
92
|
}
|
108
93
|
//# sourceMappingURL=predicate.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../src/predicate/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
1
|
+
{"version":3,"file":"predicate.d.ts","sourceRoot":"","sources":["../../src/predicate/predicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,SAAS,EAKV,MAAM,oBAAoB,CAAC;AAI5B,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIlD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,kBAAkB,EAElB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,eAAe,CAAC,CAAC,GAAG,UA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CxC"}
|
package/dist/providers/coin.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { AbstractAddress
|
1
|
+
import type { AbstractAddress } from '@fuel-ts/interfaces';
|
2
2
|
import type { BN } from '@fuel-ts/math';
|
3
3
|
/**
|
4
4
|
* A Fuel coin
|
@@ -11,6 +11,5 @@ export type Coin = {
|
|
11
11
|
maturity: number;
|
12
12
|
blockCreated: BN;
|
13
13
|
txCreatedIdx: BN;
|
14
|
-
predicate?: BytesLike;
|
15
14
|
};
|
16
15
|
//# sourceMappingURL=coin.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"coin.d.ts","sourceRoot":"","sources":["../../src/providers/coin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,
|
1
|
+
{"version":3,"file":"coin.d.ts","sourceRoot":"","sources":["../../src/providers/coin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,EAAE,CAAC;IACX,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,EAAE,CAAC;IACjB,YAAY,EAAE,EAAE,CAAC;CAClB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/providers/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE;;GAE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,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,UAAU,EAAE,EAAE,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,EAAE,CAAC;IACb,iBAAiB,EAAE,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,EAAE,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,EAAE,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE,WAAW,CAAC;IAC1B,UAAU,EAAE,WAAW,CAAC;IACxB,kBAAkB,EAAE,WAAW,CAAC;IAChC,iBAAiB,EAAE,WAAW,CAAC;IAC/B,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,EAAE,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
@@ -1,8 +1,10 @@
|
|
1
|
+
import type { InputValue } from '@fuel-ts/abi-coder';
|
1
2
|
import type { AddressLike, AbstractAddress, BytesLike } from '@fuel-ts/interfaces';
|
2
3
|
import type { BN, BigNumberish } from '@fuel-ts/math';
|
3
4
|
import type { TransactionScript, Policy, TransactionCreate } from '@fuel-ts/transactions';
|
4
5
|
import { TransactionType } from '@fuel-ts/transactions';
|
5
6
|
import type { Account } from '../../account';
|
7
|
+
import type { Predicate } from '../../predicate';
|
6
8
|
import type { GqlGasCosts } from '../__generated__/operations';
|
7
9
|
import type { Coin } from '../coin';
|
8
10
|
import type { CoinQuantity, CoinQuantityLike } from '../coin-quantity';
|
@@ -165,7 +167,7 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
165
167
|
* @param predicate - Predicate bytes.
|
166
168
|
* @param predicateData - Predicate data bytes.
|
167
169
|
*/
|
168
|
-
addCoinInput(coin: Coin): void;
|
170
|
+
addCoinInput(coin: Coin, predicate?: Predicate<InputValue[]>): void;
|
169
171
|
/**
|
170
172
|
* Adds a single message input to the transaction and a change output for the
|
171
173
|
* baseAssetId, if one it was not added yet.
|
@@ -174,7 +176,7 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
174
176
|
* @param predicate - Predicate bytes.
|
175
177
|
* @param predicateData - Predicate data bytes.
|
176
178
|
*/
|
177
|
-
addMessageInput(message: MessageCoin): void;
|
179
|
+
addMessageInput(message: MessageCoin, predicate?: Predicate<InputValue[]>): void;
|
178
180
|
/**
|
179
181
|
* Adds a single resource to the transaction by adding a coin/message input and a
|
180
182
|
* change output for the related assetId, if one it was not added yet.
|
@@ -191,6 +193,22 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
191
193
|
* @returns This transaction.
|
192
194
|
*/
|
193
195
|
addResources(resources: ReadonlyArray<Resource>): this;
|
196
|
+
/**
|
197
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
198
|
+
* outputs from the related assetIds.
|
199
|
+
*
|
200
|
+
* @param resources - The resources to add.
|
201
|
+
* @returns This transaction.
|
202
|
+
*/
|
203
|
+
addPredicateResource(resource: Resource, predicate: Predicate<InputValue[]>): this;
|
204
|
+
/**
|
205
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
206
|
+
* from the related assetIds.
|
207
|
+
*
|
208
|
+
* @param resources - The resources to add.
|
209
|
+
* @returns This transaction.
|
210
|
+
*/
|
211
|
+
addPredicateResources(resources: Resource[], predicate: Predicate<InputValue[]>): this;
|
194
212
|
/**
|
195
213
|
* Adds a coin output to the transaction.
|
196
214
|
*
|
@@ -255,8 +273,6 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
255
273
|
* @returns The transaction as a JSON object.
|
256
274
|
*/
|
257
275
|
toJSON(): any;
|
258
|
-
removeWitness(index: number): void;
|
259
276
|
updatePredicateInputs(inputs: TransactionRequestInput[]): void;
|
260
|
-
private adjustWitnessIndexes;
|
261
277
|
}
|
262
278
|
//# sourceMappingURL=transaction-request.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/transaction-request.ts"],"names":[],"mappings":"
|
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;AAKrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE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AAC,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;IAkC9E;;;;;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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import type { Account } from '../account';
|
2
2
|
import type { CoinQuantityLike } from '../providers';
|
3
|
-
export declare const seedTestWallet: (wallet: Account
|
3
|
+
export declare const seedTestWallet: (wallet: Account, quantities: CoinQuantityLike[]) => Promise<void>;
|
4
4
|
//# sourceMappingURL=seedTestWallet.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"seedTestWallet.d.ts","sourceRoot":"","sources":["../../src/test-utils/seedTestWallet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,eAAO,MAAM,cAAc,
|
1
|
+
{"version":3,"file":"seedTestWallet.d.ts","sourceRoot":"","sources":["../../src/test-utils/seedTestWallet.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrD,eAAO,MAAM,cAAc,WAAkB,OAAO,cAAc,gBAAgB,EAAE,kBAuBnF,CAAC"}
|
@@ -31914,7 +31914,7 @@ spurious results.`);
|
|
31914
31914
|
// ../versions/dist/index.mjs
|
31915
31915
|
function getBuiltinVersions() {
|
31916
31916
|
return {
|
31917
|
-
FORC: "0.
|
31917
|
+
FORC: "0.55.0",
|
31918
31918
|
FUEL_CORE: "0.22.1",
|
31919
31919
|
FUELS: "0.81.0"
|
31920
31920
|
};
|
@@ -34627,7 +34627,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34627
34627
|
toEvmAddress() {
|
34628
34628
|
const b256Address = toB256(this.bech32Address);
|
34629
34629
|
return {
|
34630
|
-
|
34630
|
+
bits: clearFirst12BytesFromB256(b256Address)
|
34631
34631
|
};
|
34632
34632
|
}
|
34633
34633
|
/**
|
@@ -34637,7 +34637,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
34637
34637
|
*/
|
34638
34638
|
toAssetId() {
|
34639
34639
|
return {
|
34640
|
-
|
34640
|
+
bits: this.toB256()
|
34641
34641
|
};
|
34642
34642
|
}
|
34643
34643
|
/**
|
@@ -35807,6 +35807,20 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
35807
35807
|
];
|
35808
35808
|
}
|
35809
35809
|
};
|
35810
|
+
var getEncodingVersion = (encoding) => {
|
35811
|
+
switch (encoding) {
|
35812
|
+
case void 0:
|
35813
|
+
case ENCODING_V0:
|
35814
|
+
return ENCODING_V0;
|
35815
|
+
case ENCODING_V1:
|
35816
|
+
return ENCODING_V1;
|
35817
|
+
default:
|
35818
|
+
throw new FuelError(
|
35819
|
+
ErrorCode.UNSUPPORTED_ENCODING_VERSION,
|
35820
|
+
`Encoding version '${encoding}' is unsupported.`
|
35821
|
+
);
|
35822
|
+
}
|
35823
|
+
};
|
35810
35824
|
var findFunctionByName = (abi, name) => {
|
35811
35825
|
const fn = abi.functions.find((f2) => f2.name === name);
|
35812
35826
|
if (!fn) {
|
@@ -36571,7 +36585,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36571
36585
|
this.signature = FunctionFragment.getSignature(this.jsonAbi, this.jsonFn);
|
36572
36586
|
this.selector = FunctionFragment.getFunctionSelector(this.signature);
|
36573
36587
|
this.selectorBytes = new StdStringCoder2().encode(name);
|
36574
|
-
this.encoding =
|
36588
|
+
this.encoding = getEncodingVersion(jsonAbi.encoding);
|
36575
36589
|
this.isInputDataPointer = this.#isInputDataPointer();
|
36576
36590
|
this.outputMetadata = {
|
36577
36591
|
isHeapType: this.#isOutputDataHeap(),
|
@@ -36709,8 +36723,10 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36709
36723
|
functions;
|
36710
36724
|
configurables;
|
36711
36725
|
jsonAbi;
|
36726
|
+
encoding;
|
36712
36727
|
constructor(jsonAbi) {
|
36713
36728
|
this.jsonAbi = jsonAbi;
|
36729
|
+
this.encoding = getEncodingVersion(jsonAbi.encoding);
|
36714
36730
|
this.functions = Object.fromEntries(
|
36715
36731
|
this.jsonAbi.functions.map((x) => [x.name, new FunctionFragment(this.jsonAbi, x.name)])
|
36716
36732
|
);
|
@@ -36754,7 +36770,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36754
36770
|
);
|
36755
36771
|
}
|
36756
36772
|
return AbiCoder.decode(this.jsonAbi, loggedType.loggedType, arrayify(data), 0, {
|
36757
|
-
encoding: this.
|
36773
|
+
encoding: this.encoding
|
36758
36774
|
});
|
36759
36775
|
}
|
36760
36776
|
encodeConfigurable(name, value) {
|
@@ -42914,11 +42930,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42914
42930
|
name = "NoWitnessAtIndexError";
|
42915
42931
|
};
|
42916
42932
|
|
42917
|
-
// src/providers/transaction-request/helpers.ts
|
42918
|
-
var isRequestInputCoin = (input) => input.type === InputType.Coin;
|
42919
|
-
var isRequestInputMessage = (input) => input.type === InputType.Message;
|
42920
|
-
var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
|
42921
|
-
|
42922
42933
|
// src/providers/transaction-request/witness.ts
|
42923
42934
|
var witnessify = (value) => {
|
42924
42935
|
const data = arrayify(value);
|
@@ -43158,8 +43169,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43158
43169
|
* @param predicate - Predicate bytes.
|
43159
43170
|
* @param predicateData - Predicate data bytes.
|
43160
43171
|
*/
|
43161
|
-
addCoinInput(coin) {
|
43162
|
-
const { assetId, owner, amount
|
43172
|
+
addCoinInput(coin, predicate) {
|
43173
|
+
const { assetId, owner, amount } = coin;
|
43163
43174
|
let witnessIndex;
|
43164
43175
|
if (predicate) {
|
43165
43176
|
witnessIndex = 0;
|
@@ -43170,14 +43181,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43170
43181
|
}
|
43171
43182
|
}
|
43172
43183
|
const input = {
|
43173
|
-
|
43184
|
+
...coin,
|
43174
43185
|
type: InputType.Coin,
|
43175
43186
|
owner: owner.toB256(),
|
43176
43187
|
amount,
|
43177
43188
|
assetId,
|
43178
43189
|
txPointer: "0x00000000000000000000000000000000",
|
43179
43190
|
witnessIndex,
|
43180
|
-
predicate
|
43191
|
+
predicate: predicate?.bytes
|
43181
43192
|
};
|
43182
43193
|
this.pushInput(input);
|
43183
43194
|
this.addChangeOutput(owner, assetId);
|
@@ -43190,8 +43201,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43190
43201
|
* @param predicate - Predicate bytes.
|
43191
43202
|
* @param predicateData - Predicate data bytes.
|
43192
43203
|
*/
|
43193
|
-
addMessageInput(message) {
|
43194
|
-
const { recipient, sender, amount
|
43204
|
+
addMessageInput(message, predicate) {
|
43205
|
+
const { recipient, sender, amount } = message;
|
43195
43206
|
const assetId = BaseAssetId;
|
43196
43207
|
let witnessIndex;
|
43197
43208
|
if (predicate) {
|
@@ -43203,13 +43214,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43203
43214
|
}
|
43204
43215
|
}
|
43205
43216
|
const input = {
|
43206
|
-
|
43217
|
+
...message,
|
43207
43218
|
type: InputType.Message,
|
43208
43219
|
sender: sender.toB256(),
|
43209
43220
|
recipient: recipient.toB256(),
|
43210
43221
|
amount,
|
43211
43222
|
witnessIndex,
|
43212
|
-
predicate
|
43223
|
+
predicate: predicate?.bytes
|
43213
43224
|
};
|
43214
43225
|
this.pushInput(input);
|
43215
43226
|
this.addChangeOutput(recipient, assetId);
|
@@ -43240,6 +43251,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43240
43251
|
resources.forEach((resource) => this.addResource(resource));
|
43241
43252
|
return this;
|
43242
43253
|
}
|
43254
|
+
/**
|
43255
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43256
|
+
* outputs from the related assetIds.
|
43257
|
+
*
|
43258
|
+
* @param resources - The resources to add.
|
43259
|
+
* @returns This transaction.
|
43260
|
+
*/
|
43261
|
+
addPredicateResource(resource, predicate) {
|
43262
|
+
if (isCoin(resource)) {
|
43263
|
+
this.addCoinInput(resource, predicate);
|
43264
|
+
} else {
|
43265
|
+
this.addMessageInput(resource, predicate);
|
43266
|
+
}
|
43267
|
+
return this;
|
43268
|
+
}
|
43269
|
+
/**
|
43270
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43271
|
+
* from the related assetIds.
|
43272
|
+
*
|
43273
|
+
* @param resources - The resources to add.
|
43274
|
+
* @returns This transaction.
|
43275
|
+
*/
|
43276
|
+
addPredicateResources(resources, predicate) {
|
43277
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43278
|
+
return this;
|
43279
|
+
}
|
43243
43280
|
/**
|
43244
43281
|
* Adds a coin output to the transaction.
|
43245
43282
|
*
|
@@ -43388,10 +43425,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43388
43425
|
toJSON() {
|
43389
43426
|
return normalizeJSON(this);
|
43390
43427
|
}
|
43391
|
-
removeWitness(index) {
|
43392
|
-
this.witnesses.splice(index, 1);
|
43393
|
-
this.adjustWitnessIndexes(index);
|
43394
|
-
}
|
43395
43428
|
updatePredicateInputs(inputs) {
|
43396
43429
|
this.inputs.forEach((i) => {
|
43397
43430
|
let correspondingInput;
|
@@ -43414,13 +43447,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43414
43447
|
}
|
43415
43448
|
});
|
43416
43449
|
}
|
43417
|
-
adjustWitnessIndexes(removedIndex) {
|
43418
|
-
this.inputs.filter(isRequestInputResource).forEach((input) => {
|
43419
|
-
if (input.witnessIndex > removedIndex) {
|
43420
|
-
input.witnessIndex -= 1;
|
43421
|
-
}
|
43422
|
-
});
|
43423
|
-
}
|
43424
43450
|
};
|
43425
43451
|
|
43426
43452
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -50511,11 +50537,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50511
50537
|
__publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
50512
50538
|
|
50513
50539
|
// src/test-utils/seedTestWallet.ts
|
50514
|
-
var seedTestWallet = async (wallet, quantities
|
50515
|
-
const toFundAccounts = Array.isArray(wallet) ? wallet : [wallet];
|
50540
|
+
var seedTestWallet = async (wallet, quantities) => {
|
50516
50541
|
const genesisWallet = new WalletUnlocked(
|
50517
50542
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50518
|
-
|
50543
|
+
wallet.provider
|
50519
50544
|
);
|
50520
50545
|
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50521
50546
|
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
@@ -50524,13 +50549,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50524
50549
|
gasPrice: minGasPrice
|
50525
50550
|
});
|
50526
50551
|
request.addResources(resources);
|
50527
|
-
quantities.map(coinQuantityfy).forEach(
|
50528
|
-
({ amount, assetId }) => toFundAccounts.forEach(({ address }) => {
|
50529
|
-
for (let i = 0; i < utxosAmount; i++) {
|
50530
|
-
request.addCoinOutput(address, amount.div(utxosAmount), assetId);
|
50531
|
-
}
|
50532
|
-
})
|
50533
|
-
);
|
50552
|
+
quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
|
50534
50553
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50535
50554
|
};
|
50536
50555
|
|
@@ -50740,33 +50759,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50740
50759
|
};
|
50741
50760
|
return { wallets, stop: cleanup, provider };
|
50742
50761
|
};
|
50743
|
-
|
50744
|
-
// src/test-utils/transactionRequest.ts
|
50745
|
-
var generateFakeRequestInputCoin = (partial = {}) => ({
|
50746
|
-
id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
50747
|
-
type: InputType.Coin,
|
50748
|
-
owner: getRandomB256(),
|
50749
|
-
amount: bn(100),
|
50750
|
-
assetId: ZeroBytes32,
|
50751
|
-
txPointer: "0x00000000000000000000000000000000",
|
50752
|
-
witnessIndex: 0,
|
50753
|
-
...partial
|
50754
|
-
});
|
50755
|
-
var generateFakeRequestInputMessage = (partial = {}) => ({
|
50756
|
-
nonce: getRandomB256(),
|
50757
|
-
type: InputType.Message,
|
50758
|
-
sender: getRandomB256(),
|
50759
|
-
recipient: getRandomB256(),
|
50760
|
-
amount: bn(100),
|
50761
|
-
witnessIndex: 0,
|
50762
|
-
...partial
|
50763
|
-
});
|
50764
|
-
var generateFakeRequestInputContract = (partial = {}) => ({
|
50765
|
-
contractId: getRandomB256(),
|
50766
|
-
type: InputType.Contract,
|
50767
|
-
txPointer: "0x00000000000000000000000000000000",
|
50768
|
-
...partial
|
50769
|
-
});
|
50770
50762
|
})();
|
50771
50763
|
/*! Bundled license information:
|
50772
50764
|
|