@fuel-ts/account 0.0.0-rc-2143-20240429105111 → 0.0.0-rc-2037-20240429115810
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 +69 -8
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +192 -118
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +107 -39
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +9 -2
- package/dist/predicate/predicate.d.ts.map +1 -1
- package/dist/providers/transaction-request/helpers.d.ts +10 -0
- package/dist/providers/transaction-request/helpers.d.ts.map +1 -0
- package/dist/providers/transaction-request/index.d.ts +1 -0
- package/dist/providers/transaction-request/index.d.ts.map +1 -1
- package/dist/providers/transaction-request/transaction-request.d.ts +2 -0
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils/index.d.ts +1 -0
- package/dist/test-utils/index.d.ts.map +1 -1
- package/dist/test-utils/launchNode.d.ts +2 -4
- package/dist/test-utils/launchNode.d.ts.map +1 -1
- package/dist/test-utils/resources.d.ts +4 -0
- package/dist/test-utils/resources.d.ts.map +1 -0
- package/dist/test-utils/seedTestWallet.d.ts +1 -1
- package/dist/test-utils/seedTestWallet.d.ts.map +1 -1
- package/dist/test-utils/transactionRequest.d.ts +5 -0
- package/dist/test-utils/transactionRequest.d.ts.map +1 -0
- package/dist/test-utils.global.js +63 -14
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +180 -117
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +104 -44
- 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
@@ -2,7 +2,7 @@ import type { JsonAbi, InputValue } from '@fuel-ts/abi-coder';
|
|
2
2
|
import { Interface } from '@fuel-ts/abi-coder';
|
3
3
|
import type { BytesLike } from '@fuel-ts/interfaces';
|
4
4
|
import { Account } from '../account';
|
5
|
-
import type { CallResult, CoinQuantityLike, ExcludeResourcesOption, Provider, Resource, TransactionRequestLike, TransactionResponse } from '../providers';
|
5
|
+
import type { CallResult, CoinQuantityLike, ExcludeResourcesOption, Provider, Resource, TransactionRequest, TransactionRequestLike, TransactionResponse } from '../providers';
|
6
6
|
export type PredicateParams<T = InputValue[]> = {
|
7
7
|
bytecode: BytesLike;
|
8
8
|
provider: Provider;
|
@@ -35,7 +35,7 @@ export declare class Predicate<TInputData extends InputValue[]> extends Account
|
|
35
35
|
* @param transactionRequestLike - The transaction request-like object.
|
36
36
|
* @returns The transaction request with predicate data.
|
37
37
|
*/
|
38
|
-
populateTransactionPredicateData(transactionRequestLike: TransactionRequestLike):
|
38
|
+
populateTransactionPredicateData<T extends TransactionRequest>(transactionRequestLike: TransactionRequestLike): T;
|
39
39
|
/**
|
40
40
|
* Sends a transaction with the populated predicate data.
|
41
41
|
*
|
@@ -77,5 +77,12 @@ export declare class Predicate<TInputData extends InputValue[]> extends Account
|
|
77
77
|
* @returns The mutated bytes with the configurable constants set.
|
78
78
|
*/
|
79
79
|
private static setConfigurableConstants;
|
80
|
+
/**
|
81
|
+
* Returns the index of the witness placeholder that was added to this predicate.
|
82
|
+
* If no witness placeholder was added, it returns -1.
|
83
|
+
* @param request - The transaction request.
|
84
|
+
* @returns The index of the witness placeholder, or -1 if there is no witness placeholder.
|
85
|
+
*/
|
86
|
+
private getIndexFromPlaceholderWitness;
|
80
87
|
}
|
81
88
|
//# 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,C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AAsB,EAAE,sBAAsB;IA0BhD;;;;;OAKG;IACH,eAAe,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAK7F;;;;;OAKG;IACH,mBAAmB,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC;IAKxF,OAAO,CAAC,gBAAgB;IAsBxB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAgCnC;;;;;;OAMG;IACG,mBAAmB,CACvB,UAAU,EAAE,gBAAgB,EAAE,CAAC,8BAA8B,EAC7D,WAAW,CAAC,EAAE,sBAAsB,GACnC,OAAO,CAAC,QAAQ,EAAE,CAAC;IAatB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAuCvC;;;;;OAKG;IACH,OAAO,CAAC,8BAA8B;CAgCvC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import type { AbstractAddress } from '@fuel-ts/interfaces';
|
2
|
+
import type { Resource, ExcludeResourcesOption } from '../resource';
|
3
|
+
import type { TransactionRequestInput, CoinTransactionRequestInput, MessageTransactionRequestInput } from './input';
|
4
|
+
export declare const isRequestInputCoin: (input: TransactionRequestInput) => input is CoinTransactionRequestInput;
|
5
|
+
export declare const isRequestInputMessage: (input: TransactionRequestInput) => input is MessageTransactionRequestInput;
|
6
|
+
export declare const isRequestInputResource: (input: TransactionRequestInput) => input is CoinTransactionRequestInput | MessageTransactionRequestInput;
|
7
|
+
export declare const getRequestInputResourceOwner: (input: CoinTransactionRequestInput | MessageTransactionRequestInput) => import("@fuel-ts/interfaces").BytesLike;
|
8
|
+
export declare const isRequestInputResourceFromOwner: (input: CoinTransactionRequestInput | MessageTransactionRequestInput, owner: AbstractAddress) => boolean;
|
9
|
+
export declare const cacheResources: (resources: Array<Resource>) => Required<ExcludeResourcesOption>;
|
10
|
+
//# sourceMappingURL=helpers.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAG3D,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGpE,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,UACtB,uBAAuB,yCACwC,CAAC;AAEzE,eAAO,MAAM,qBAAqB,UACzB,uBAAuB,4CAC8C,CAAC;AAE/E,eAAO,MAAM,sBAAsB,UAC1B,uBAAuB,0EAE2B,CAAC;AAE5D,eAAO,MAAM,4BAA4B,UAChC,2BAA2B,GAAG,8BAA8B,4CACL,CAAC;AAEjE,eAAO,MAAM,+BAA+B,UACnC,2BAA2B,GAAG,8BAA8B,SAC5D,eAAe,YACmC,CAAC;AAE5D,eAAO,MAAM,cAAc,cAAe,MAAM,QAAQ,CAAC,qCActD,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;AACxB,cAAc,WAAW,CAAC"}
|
@@ -252,6 +252,8 @@ export declare abstract class BaseTransactionRequest implements BaseTransactionR
|
|
252
252
|
* @returns The transaction as a JSON object.
|
253
253
|
*/
|
254
254
|
toJSON(): any;
|
255
|
+
removeWitness(index: number): void;
|
256
|
+
private adjustWitnessIndexes;
|
255
257
|
updatePredicateGasUsed(inputs: TransactionRequestInput[]): void;
|
256
258
|
shiftPredicateData(): void;
|
257
259
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/providers/transaction-request/transaction-request.ts"],"names":[],"mappings":"AAIA,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,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,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;
|
1
|
+
{"version":3,"file":"transaction-request.d.ts","sourceRoot":"","sources":["../../../src/provid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AIvC;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,EAAE;IAYzC,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE;IAiBrD;;;;;;OAMG;IACH,iBAAiB,CACf,UAAU,EAAE,YAAY,EAAE,EAC1B,WAAW,EAAE,MAAM,EACnB,cAAc,CAAC,EAAE,eAAe;IAwClC;;;;;OAKG;IACH,wBAAwB,IAAI,YAAY,EAAE;IAS1C;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAElD;;;;;OAKG;IACH,MAAM;IAIN,aAAa,CAAC,KAAK,EAAE,MAAM;IAK3B,OAAO,CAAC,oBAAoB;IAS5B,sBAAsB,CAAC,MAAM,EAAE,uBAAuB,EAAE;IA8BxD,kBAAkB;CAenB"}
|
@@ -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;AAC7B,cAAc,sBAAsB,CAAC"}
|
@@ -6,7 +6,6 @@ export type LaunchNodeOptions = {
|
|
6
6
|
ip?: string;
|
7
7
|
port?: string;
|
8
8
|
args?: string[];
|
9
|
-
fuelCorePath?: string;
|
10
9
|
useSystemFuelCore?: boolean;
|
11
10
|
loggingEnabled?: boolean;
|
12
11
|
debugEnabled?: boolean;
|
@@ -32,13 +31,12 @@ export declare const killNode: (params: KillNodeParams) => void;
|
|
32
31
|
* @param ip - the ip to bind to. (optional, defaults to 0.0.0.0)
|
33
32
|
* @param port - the port to bind to. (optional, defaults to 4000 or the next available port)
|
34
33
|
* @param args - additional arguments to pass to fuel-core.
|
35
|
-
* @param
|
36
|
-
* @param useSystemFuelCore - whether to use the system fuel-core binary or the one provided by the \@internal/fuel-core package.
|
34
|
+
* @param useSystemFuelCore - whether to use the system fuel-core binary or the one provided by the \@fuel-ts/fuel-core package.
|
37
35
|
* @param loggingEnabled - whether the node should output logs. (optional, defaults to true)
|
38
36
|
* @param debugEnabled - whether the node should log debug messages. (optional, defaults to false)
|
39
37
|
* @param basePath - the base path to use for the temporary folder. (optional, defaults to os.tmpdir())
|
40
38
|
* */
|
41
|
-
export declare const launchNode: ({ ip, port, args,
|
39
|
+
export declare const launchNode: ({ ip, port, args, useSystemFuelCore, loggingEnabled, debugEnabled, basePath, }: LaunchNodeOptions) => LaunchNodeResult;
|
42
40
|
export type LaunchNodeAndGetWalletsResult = Promise<{
|
43
41
|
wallets: WalletUnlocked[];
|
44
42
|
stop: () => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"launchNode.d.ts","sourceRoot":"","sources":["../../src/test-utils/launchNode.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AASpE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAuBhD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,
|
1
|
+
{"version":3,"file":"launchNode.d.ts","sourceRoot":"","sources":["../../src/test-utils/launchNode.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,eAAe,CAAC;AASpE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE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AAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,eAAO,MAAM,gBAAgB,aAAa,QAAQ,IAAI,CAAC,KAAQ,IAQ7D,CAAC;AAEH,eAAO,MAAM,uBAAuB,aAAa,QAAQ,WAAW,CAAC,KAAQ,WAQ3E,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, quantities: CoinQuantityLike[]) => Promise<void>;
|
3
|
+
export declare const seedTestWallet: (wallet: Account | Account[], quantities: CoinQuantityLike[], utxosAmount?: number) => 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,WACjB,OAAO,GAAG,OAAO,EAAE,cACf,gBAAgB,EAAE,wCA8B/B,CAAC"}
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import type { CoinTransactionRequestInput, ContractTransactionRequestInput, MessageTransactionRequestInput } from '../providers';
|
2
|
+
export declare const generateFakeRequestInputCoin: (partial?: Partial<CoinTransactionRequestInput>) => CoinTransactionRequestInput;
|
3
|
+
export declare const generateFakeRequestInputMessage: (partial?: Partial<MessageTransactionRequestInput>) => MessageTransactionRequestInput;
|
4
|
+
export declare const generateFakeRequestInputContract: (partial?: Partial<ContractTransactionRequestInput>) => ContractTransactionRequestInput;
|
5
|
+
//# sourceMappingURL=transactionRequest.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transactionRequest.d.ts","sourceRoot":"","sources":["../../src/test-utils/transactionRequest.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,4BAA4B,aAC9B,QAAQ,2BAA2B,CAAC,KAC5C,2BASD,CAAC;AAEH,eAAO,MAAM,+BAA+B,aACjC,QAAQ,8BAA8B,CAAC,KAC/C,8BAQD,CAAC;AAEH,eAAO,MAAM,gCAAgC,aAClC,QAAQ,+BAA+B,CAAC,KAChD,+BAKD,CAAC"}
|
@@ -43260,6 +43260,11 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43260
43260
|
name = "NoWitnessAtIndexError";
|
43261
43261
|
};
|
43262
43262
|
|
43263
|
+
// src/providers/transaction-request/helpers.ts
|
43264
|
+
var isRequestInputCoin = (input) => input.type === InputType.Coin;
|
43265
|
+
var isRequestInputMessage = (input) => input.type === InputType.Message;
|
43266
|
+
var isRequestInputResource = (input) => isRequestInputCoin(input) || isRequestInputMessage(input);
|
43267
|
+
|
43263
43268
|
// src/providers/transaction-request/witness.ts
|
43264
43269
|
var witnessify = (value) => {
|
43265
43270
|
const data = arrayify(value);
|
@@ -43498,7 +43503,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43498
43503
|
* @param coin - Coin resource.
|
43499
43504
|
*/
|
43500
43505
|
addCoinInput(coin) {
|
43501
|
-
const { assetId, owner, amount } = coin;
|
43506
|
+
const { assetId, owner, amount, id, predicate } = coin;
|
43502
43507
|
let witnessIndex;
|
43503
43508
|
if (coin.predicate) {
|
43504
43509
|
witnessIndex = 0;
|
@@ -43509,13 +43514,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43509
43514
|
}
|
43510
43515
|
}
|
43511
43516
|
const input = {
|
43512
|
-
|
43517
|
+
id,
|
43513
43518
|
type: InputType.Coin,
|
43514
43519
|
owner: owner.toB256(),
|
43515
43520
|
amount,
|
43516
43521
|
assetId,
|
43517
43522
|
txPointer: "0x00000000000000000000000000000000",
|
43518
|
-
witnessIndex
|
43523
|
+
witnessIndex,
|
43524
|
+
predicate
|
43519
43525
|
};
|
43520
43526
|
this.pushInput(input);
|
43521
43527
|
this.addChangeOutput(owner, assetId);
|
@@ -43527,7 +43533,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43527
43533
|
* @param message - Message resource.
|
43528
43534
|
*/
|
43529
43535
|
addMessageInput(message) {
|
43530
|
-
const { recipient, sender, amount, assetId } = message;
|
43536
|
+
const { recipient, sender, amount, predicate, nonce, assetId } = message;
|
43531
43537
|
let witnessIndex;
|
43532
43538
|
if (message.predicate) {
|
43533
43539
|
witnessIndex = 0;
|
@@ -43538,12 +43544,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43538
43544
|
}
|
43539
43545
|
}
|
43540
43546
|
const input = {
|
43541
|
-
|
43547
|
+
nonce,
|
43542
43548
|
type: InputType.Message,
|
43543
43549
|
sender: sender.toB256(),
|
43544
43550
|
recipient: recipient.toB256(),
|
43545
43551
|
amount,
|
43546
|
-
witnessIndex
|
43552
|
+
witnessIndex,
|
43553
|
+
predicate
|
43547
43554
|
};
|
43548
43555
|
this.pushInput(input);
|
43549
43556
|
this.addChangeOutput(recipient, assetId);
|
@@ -43727,6 +43734,17 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43727
43734
|
toJSON() {
|
43728
43735
|
return normalizeJSON(this);
|
43729
43736
|
}
|
43737
|
+
removeWitness(index) {
|
43738
|
+
this.witnesses.splice(index, 1);
|
43739
|
+
this.adjustWitnessIndexes(index);
|
43740
|
+
}
|
43741
|
+
adjustWitnessIndexes(removedIndex) {
|
43742
|
+
this.inputs.filter(isRequestInputResource).forEach((input) => {
|
43743
|
+
if (input.witnessIndex > removedIndex) {
|
43744
|
+
input.witnessIndex -= 1;
|
43745
|
+
}
|
43746
|
+
});
|
43747
|
+
}
|
43730
43748
|
updatePredicateGasUsed(inputs) {
|
43731
43749
|
this.inputs.forEach((i) => {
|
43732
43750
|
let correspondingInput;
|
@@ -51002,16 +51020,21 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51002
51020
|
__publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
51003
51021
|
|
51004
51022
|
// src/test-utils/seedTestWallet.ts
|
51005
|
-
var seedTestWallet = async (wallet, quantities) => {
|
51023
|
+
var seedTestWallet = async (wallet, quantities, utxosAmount = 1) => {
|
51024
|
+
const toFundAccounts = Array.isArray(wallet) ? wallet : [wallet];
|
51006
51025
|
const genesisWallet = new WalletUnlocked(
|
51007
51026
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
51008
|
-
wallet
|
51027
|
+
// Connect to the same Provider as wallet
|
51028
|
+
toFundAccounts[0].provider
|
51009
51029
|
);
|
51010
51030
|
const request = new ScriptTransactionRequest();
|
51011
|
-
quantities.forEach(
|
51012
|
-
|
51013
|
-
|
51014
|
-
|
51031
|
+
quantities.map(coinQuantityfy).forEach(
|
51032
|
+
({ amount, assetId }) => toFundAccounts.forEach(({ address }) => {
|
51033
|
+
for (let i = 0; i < utxosAmount; i++) {
|
51034
|
+
request.addCoinOutput(address, amount.div(utxosAmount), assetId);
|
51035
|
+
}
|
51036
|
+
})
|
51037
|
+
);
|
51015
51038
|
const txCost = await genesisWallet.provider.getTransactionCost(request);
|
51016
51039
|
request.gasLimit = txCost.gasUsed;
|
51017
51040
|
request.maxFee = txCost.maxFee;
|
@@ -51086,7 +51109,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51086
51109
|
ip,
|
51087
51110
|
port,
|
51088
51111
|
args = [],
|
51089
|
-
fuelCorePath = void 0,
|
51090
51112
|
useSystemFuelCore = false,
|
51091
51113
|
loggingEnabled = true,
|
51092
51114
|
debugEnabled = false,
|
@@ -51107,7 +51129,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51107
51129
|
const poaInstantFlagValue = getFlagValueFromArgs(args, "--poa-instant");
|
51108
51130
|
const poaInstant = poaInstantFlagValue === "true" || poaInstantFlagValue === void 0;
|
51109
51131
|
const graphQLStartSubstring = "Binding GraphQL provider to";
|
51110
|
-
const binPath =
|
51132
|
+
const binPath = findBinPath("fuels-core", __dirname);
|
51111
51133
|
const command = useSystemFuelCore ? "fuel-core" : binPath;
|
51112
51134
|
const ipToUse = ip || "0.0.0.0";
|
51113
51135
|
const portToUse = port || (await (0, import_portfinder.getPortPromise)({
|
@@ -51245,6 +51267,33 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
51245
51267
|
};
|
51246
51268
|
return { wallets, stop: cleanup, provider };
|
51247
51269
|
};
|
51270
|
+
|
51271
|
+
// src/test-utils/transactionRequest.ts
|
51272
|
+
var generateFakeRequestInputCoin = (partial = {}) => ({
|
51273
|
+
id: hexlify(randomBytes22(UTXO_ID_LEN)),
|
51274
|
+
type: InputType.Coin,
|
51275
|
+
owner: getRandomB256(),
|
51276
|
+
amount: bn(100),
|
51277
|
+
assetId: ZeroBytes32,
|
51278
|
+
txPointer: "0x00000000000000000000000000000000",
|
51279
|
+
witnessIndex: 0,
|
51280
|
+
...partial
|
51281
|
+
});
|
51282
|
+
var generateFakeRequestInputMessage = (partial = {}) => ({
|
51283
|
+
nonce: getRandomB256(),
|
51284
|
+
type: InputType.Message,
|
51285
|
+
sender: getRandomB256(),
|
51286
|
+
recipient: getRandomB256(),
|
51287
|
+
amount: bn(100),
|
51288
|
+
witnessIndex: 0,
|
51289
|
+
...partial
|
51290
|
+
});
|
51291
|
+
var generateFakeRequestInputContract = (partial = {}) => ({
|
51292
|
+
contractId: getRandomB256(),
|
51293
|
+
type: InputType.Contract,
|
51294
|
+
txPointer: "0x00000000000000000000000000000000",
|
51295
|
+
...partial
|
51296
|
+
});
|
51248
51297
|
})();
|
51249
51298
|
/*! Bundled license information:
|
51250
51299
|
|