@fuel-ts/account 0.0.0-rc-2037-20240411020051 → 0.0.0-rc-2040-20240411095959
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 +44 -25
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +34 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -23
- package/dist/index.mjs.map +1 -1
- package/dist/predicate/predicate.d.ts +1 -9
- 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/transaction-request.d.ts +20 -2
- package/dist/providers/transaction-request/transaction-request.d.ts.map +1 -1
- package/dist/test-utils.global.js +44 -10
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +34 -8
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +34 -8
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +16 -16
@@ -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;
|
@@ -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 - IDs of coins to exclude.
|
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[] /** IDs of coins to exclude */, excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
|
81
73
|
private getPredicateData;
|
82
74
|
/**
|
83
75
|
* Processes the predicate data and returns the altered bytecode and interface.
|
@@ -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;AAE/C,OAAO,KAAK,EACV,UAAU,EACV,
|
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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CAAC;IAKxF,OAAO,CAAC,gBAAgB;IAsBxB;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAgCnC;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAsCxC"}
|
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,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IACxB,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,EAAE,CAAC;IACX,QAAQ,EAAE,EAAE,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,WAAW,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,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
|
*
|
@@ -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;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,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,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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AE;CA6BxD"}
|
@@ -36694,6 +36694,15 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36694
36694
|
});
|
36695
36695
|
return coder.decode(bytes3, 0);
|
36696
36696
|
}
|
36697
|
+
/**
|
36698
|
+
* Checks if the function is read-only i.e. it only reads from storage, does not write to it.
|
36699
|
+
*
|
36700
|
+
* @returns True if the function is read-only or pure, false otherwise.
|
36701
|
+
*/
|
36702
|
+
isReadOnly() {
|
36703
|
+
const storageAttribute = this.attributes.find((attr) => attr.name === "storage");
|
36704
|
+
return !storageAttribute?.arguments.includes("write");
|
36705
|
+
}
|
36697
36706
|
};
|
36698
36707
|
var Interface = class {
|
36699
36708
|
functions;
|
@@ -36756,8 +36765,7 @@ This unreleased fuel-core build may include features and updates not yet support
|
|
36756
36765
|
);
|
36757
36766
|
}
|
36758
36767
|
return AbiCoder.encode(this.jsonAbi, configurable.configurableType, value, {
|
36759
|
-
isRightPadded: true
|
36760
|
-
encoding: this.jsonAbi.encoding
|
36768
|
+
isRightPadded: true
|
36761
36769
|
});
|
36762
36770
|
}
|
36763
36771
|
getTypeById(typeId) {
|
@@ -43133,8 +43141,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43133
43141
|
* @param predicate - Predicate bytes.
|
43134
43142
|
* @param predicateData - Predicate data bytes.
|
43135
43143
|
*/
|
43136
|
-
addCoinInput(coin) {
|
43137
|
-
const { assetId, owner, amount
|
43144
|
+
addCoinInput(coin, predicate) {
|
43145
|
+
const { assetId, owner, amount } = coin;
|
43138
43146
|
let witnessIndex;
|
43139
43147
|
if (predicate) {
|
43140
43148
|
witnessIndex = 0;
|
@@ -43145,14 +43153,14 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43145
43153
|
}
|
43146
43154
|
}
|
43147
43155
|
const input = {
|
43148
|
-
|
43156
|
+
...coin,
|
43149
43157
|
type: InputType.Coin,
|
43150
43158
|
owner: owner.toB256(),
|
43151
43159
|
amount,
|
43152
43160
|
assetId,
|
43153
43161
|
txPointer: "0x00000000000000000000000000000000",
|
43154
43162
|
witnessIndex,
|
43155
|
-
predicate
|
43163
|
+
predicate: predicate?.bytes
|
43156
43164
|
};
|
43157
43165
|
this.pushInput(input);
|
43158
43166
|
this.addChangeOutput(owner, assetId);
|
@@ -43165,8 +43173,8 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43165
43173
|
* @param predicate - Predicate bytes.
|
43166
43174
|
* @param predicateData - Predicate data bytes.
|
43167
43175
|
*/
|
43168
|
-
addMessageInput(message) {
|
43169
|
-
const { recipient, sender, amount
|
43176
|
+
addMessageInput(message, predicate) {
|
43177
|
+
const { recipient, sender, amount } = message;
|
43170
43178
|
const assetId = BaseAssetId;
|
43171
43179
|
let witnessIndex;
|
43172
43180
|
if (predicate) {
|
@@ -43178,13 +43186,13 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43178
43186
|
}
|
43179
43187
|
}
|
43180
43188
|
const input = {
|
43181
|
-
|
43189
|
+
...message,
|
43182
43190
|
type: InputType.Message,
|
43183
43191
|
sender: sender.toB256(),
|
43184
43192
|
recipient: recipient.toB256(),
|
43185
43193
|
amount,
|
43186
43194
|
witnessIndex,
|
43187
|
-
predicate
|
43195
|
+
predicate: predicate?.bytes
|
43188
43196
|
};
|
43189
43197
|
this.pushInput(input);
|
43190
43198
|
this.addChangeOutput(recipient, assetId);
|
@@ -43215,6 +43223,32 @@ ${PANIC_DOC_URL}#variant.${status.reason}`;
|
|
43215
43223
|
resources.forEach((resource) => this.addResource(resource));
|
43216
43224
|
return this;
|
43217
43225
|
}
|
43226
|
+
/**
|
43227
|
+
* Adds multiple resources to the transaction by adding coin/message inputs and change
|
43228
|
+
* outputs from the related assetIds.
|
43229
|
+
*
|
43230
|
+
* @param resources - The resources to add.
|
43231
|
+
* @returns This transaction.
|
43232
|
+
*/
|
43233
|
+
addPredicateResource(resource, predicate) {
|
43234
|
+
if (isCoin(resource)) {
|
43235
|
+
this.addCoinInput(resource, predicate);
|
43236
|
+
} else {
|
43237
|
+
this.addMessageInput(resource, predicate);
|
43238
|
+
}
|
43239
|
+
return this;
|
43240
|
+
}
|
43241
|
+
/**
|
43242
|
+
* Adds multiple predicate coin/message inputs to the transaction and change outputs
|
43243
|
+
* from the related assetIds.
|
43244
|
+
*
|
43245
|
+
* @param resources - The resources to add.
|
43246
|
+
* @returns This transaction.
|
43247
|
+
*/
|
43248
|
+
addPredicateResources(resources, predicate) {
|
43249
|
+
resources.forEach((resource) => this.addPredicateResource(resource, predicate));
|
43250
|
+
return this;
|
43251
|
+
}
|
43218
43252
|
/**
|
43219
43253
|
* Adds a coin output to the transaction.
|
43220
43254
|
*
|