@fuel-ts/account 0.0.0-rc-2037-20240419083713 → 0.0.0-rc-2045-20240419094011
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 +39 -86
- 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 +40 -64
- 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.53.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
|
/**
|
@@ -42914,11 +42914,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
42914
42914
|
name = "NoWitnessAtIndexError";
|
42915
42915
|
};
|
42916
42916
|
|
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
42917
|
// src/providers/transaction-request/witness.ts
|
42923
42918
|
var witnessify = (value) => {
|
42924
42919
|
const data = arrayify(value);
|
@@ -43158,8 +43153,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43158
43153
|
* @param predicate - Predicate bytes.
|
43159
43154
|
* @param predicateData - Predicate data bytes.
|
43160
43155
|
*/
|
43161
|
-
addCoinInput(coin) {
|
43162
|
-
const { assetId, owner, amount
|
43156
|
+
addCoinInput(coin, predicate) {
|
43157
|
+
const { assetId, owner, amount } = coin;
|
43163
43158
|
let witnessIndex;
|
43164
43159
|
if (predicate) {
|
43165
43160
|
witnessIndex = 0;
|
@@ -43170,14 +43165,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43170
43165
|
}
|
43171
43166
|
}
|
43172
43167
|
const input = {
|
43173
|
-
|
43168
|
+
...coin,
|
43174
43169
|
type: InputType.Coin,
|
43175
43170
|
owner: owner.toB256(),
|
43176
43171
|
amount,
|
43177
43172
|
assetId,
|
43178
43173
|
txPointer: "0x00000000000000000000000000000000",
|
43179
43174
|
witnessIndex,
|
43180
|
-
predicate
|
43175
|
+
predicate: predicate?.bytes
|
43181
43176
|
};
|
43182
43177
|
this.pushInput(input);
|
43183
43178
|
this.addChangeOutput(owner, assetId);
|
@@ -43190,8 +43185,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43190
43185
|
* @param predicate - Predicate bytes.
|
43191
43186
|
* @param predicateData - Predicate data bytes.
|
43192
43187
|
*/
|
43193
|
-
addMessageInput(message) {
|
43194
|
-
const { recipient, sender, amount
|
43188
|
+
addMessageInput(message, predicate) {
|
43189
|
+
const { recipient, sender, amount } = message;
|
43195
43190
|
const assetId = BaseAssetId;
|
43196
43191
|
let witnessIndex;
|
43197
43192
|
if (predicate) {
|
@@ -43203,13 +43198,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43203
43198
|
}
|
43204
43199
|
}
|
43205
43200
|
const input = {
|
43206
|
-
|
43201
|
+
...message,
|
43207
43202
|
type: InputType.Message,
|
43208
43203
|
sender: sender.toB256(),
|
43209
43204
|
recipient: recipient.toB256(),
|
43210
43205
|
amount,
|
43211
43206
|
witnessIndex,
|
43212
|
-
predicate
|
43207
|
+
predicate: predicate?.bytes
|
43213
43208
|
};
|
43214
43209
|
this.pushInput(input);
|
43215
43210
|
this.addChangeOutput(recipient, assetId);
|
@@ -43240,6 +43235,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43240
43235
|
resources.forEach((resource) => this.addResource(resource));
|
43241
43236
|
return this;
|
43242
43237
|
}
|
43238
|
+
/**
|
43239
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43240
|
+
* outputs from the related assetIds.
|
43241
|
+
*
|
43242
|
+
* @param resources - The resources to add.
|
43243
|
+
* @returns This transaction.
|
43244
|
+
*/
|
43245
|
+
addPredicateResource(resource, predicate) {
|
43246
|
+
if (isCoin(resource)) {
|
43247
|
+
this.addCoinInput(resource, predicate);
|
43248
|
+
} else {
|
43249
|
+
this.addMessageInput(resource, predicate);
|
43250
|
+
}
|
43251
|
+
return this;
|
43252
|
+
}
|
43253
|
+
/**
|
43254
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43255
|
+
* from the related assetIds.
|
43256
|
+
*
|
43257
|
+
* @param resources - The resources to add.
|
43258
|
+
* @returns This transaction.
|
43259
|
+
*/
|
43260
|
+
addPredicateResources(resources, predicate) {
|
43261
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43262
|
+
return this;
|
43263
|
+
}
|
43243
43264
|
/**
|
43244
43265
|
* Adds a coin output to the transaction.
|
43245
43266
|
*
|
@@ -43388,10 +43409,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43388
43409
|
toJSON() {
|
43389
43410
|
return normalizeJSON(this);
|
43390
43411
|
}
|
43391
|
-
removeWitness(index) {
|
43392
|
-
this.witnesses.splice(index, 1);
|
43393
|
-
this.adjustWitnessIndexes(index);
|
43394
|
-
}
|
43395
43412
|
updatePredicateInputs(inputs) {
|
43396
43413
|
this.inputs.forEach((i) => {
|
43397
43414
|
let correspondingInput;
|
@@ -43414,13 +43431,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43414
43431
|
}
|
43415
43432
|
});
|
43416
43433
|
}
|
43417
|
-
adjustWitnessIndexes(removedIndex) {
|
43418
|
-
this.inputs.filter(isRequestInputResource).forEach((input) => {
|
43419
|
-
if (input.witnessIndex > removedIndex) {
|
43420
|
-
input.witnessIndex -= 1;
|
43421
|
-
}
|
43422
|
-
});
|
43423
|
-
}
|
43424
43434
|
};
|
43425
43435
|
|
43426
43436
|
// src/providers/transaction-request/hash-transaction.ts
|
@@ -50511,11 +50521,10 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50511
50521
|
__publicField(Wallet, "fromEncryptedJson", WalletUnlocked.fromEncryptedJson);
|
50512
50522
|
|
50513
50523
|
// src/test-utils/seedTestWallet.ts
|
50514
|
-
var seedTestWallet = async (wallet, quantities
|
50515
|
-
const toFundAccounts = Array.isArray(wallet) ? wallet : [wallet];
|
50524
|
+
var seedTestWallet = async (wallet, quantities) => {
|
50516
50525
|
const genesisWallet = new WalletUnlocked(
|
50517
50526
|
process.env.GENESIS_SECRET || randomBytes22(32),
|
50518
|
-
|
50527
|
+
wallet.provider
|
50519
50528
|
);
|
50520
50529
|
const resources = await genesisWallet.getResourcesToSpend(quantities);
|
50521
50530
|
const { minGasPrice } = genesisWallet.provider.getGasConfig();
|
@@ -50524,13 +50533,7 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50524
50533
|
gasPrice: minGasPrice
|
50525
50534
|
});
|
50526
50535
|
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
|
-
);
|
50536
|
+
quantities.map(coinQuantityfy).forEach(({ amount, assetId }) => request.addCoinOutput(wallet.address, amount, assetId));
|
50534
50537
|
await genesisWallet.sendTransaction(request, { awaitExecution: true });
|
50535
50538
|
};
|
50536
50539
|
|
@@ -50740,33 +50743,6 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
50740
50743
|
};
|
50741
50744
|
return { wallets, stop: cleanup, provider };
|
50742
50745
|
};
|
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
50746
|
})();
|
50771
50747
|
/*! Bundled license information:
|
50772
50748
|
|