@fuel-ts/account 0.0.0-rc-1356-20240522164420 → 0.0.0-rc-1356-20240523144307
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 +32 -49
- package/dist/account.d.ts.map +1 -1
- package/dist/index.global.js +144 -49
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +144 -49
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +144 -49
- package/dist/index.mjs.map +1 -1
- package/dist/providers/provider.d.ts +126 -72
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/transaction-request/script-transaction-request.d.ts +7 -0
- package/dist/providers/transaction-request/script-transaction-request.d.ts.map +1 -1
- package/dist/test-utils.global.js +144 -49
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +144 -49
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +144 -49
- package/dist/test-utils.mjs.map +1 -1
- package/dist/wallet/base-wallet-unlocked.d.ts +8 -0
- package/dist/wallet/base-wallet-unlocked.d.ts.map +1 -1
- package/package.json +15 -15
package/dist/account.d.ts
CHANGED
@@ -23,12 +23,16 @@ export declare class Account extends AbstractAccount {
|
|
23
23
|
* The provider used to interact with the network.
|
24
24
|
*/
|
25
25
|
protected _provider?: Provider;
|
26
|
+
/**
|
27
|
+
* The connector for use with external wallets
|
28
|
+
*/
|
26
29
|
protected _connector?: FuelConnector;
|
27
30
|
/**
|
28
31
|
* Creates a new Account instance.
|
29
32
|
*
|
30
33
|
* @param address - The address of the account.
|
31
34
|
* @param provider - A Provider instance (optional).
|
35
|
+
* @param connector - A FuelConnector instance (optional).
|
32
36
|
*/
|
33
37
|
constructor(address: string | AbstractAddress, provider?: Provider, connector?: FuelConnector);
|
34
38
|
/**
|
@@ -55,15 +59,15 @@ export declare class Account extends AbstractAccount {
|
|
55
59
|
/**
|
56
60
|
* Retrieves resources satisfying the spend query for the account.
|
57
61
|
*
|
58
|
-
* @param quantities -
|
59
|
-
* @param excludedIds - IDs of resources to be excluded from the query.
|
62
|
+
* @param quantities - Quantities of resources to be obtained.
|
63
|
+
* @param excludedIds - IDs of resources to be excluded from the query (optional).
|
60
64
|
* @returns A promise that resolves to an array of Resources.
|
61
65
|
*/
|
62
|
-
getResourcesToSpend(quantities: CoinQuantityLike[]
|
66
|
+
getResourcesToSpend(quantities: CoinQuantityLike[], excludedIds?: ExcludeResourcesOption): Promise<Resource[]>;
|
63
67
|
/**
|
64
68
|
* Retrieves coins owned by the account.
|
65
69
|
*
|
66
|
-
* @param assetId - The asset ID of the coins to retrieve.
|
70
|
+
* @param assetId - The asset ID of the coins to retrieve (optional).
|
67
71
|
* @returns A promise that resolves to an array of Coins.
|
68
72
|
*/
|
69
73
|
getCoins(assetId?: BytesLike): Promise<Coin[]>;
|
@@ -76,7 +80,7 @@ export declare class Account extends AbstractAccount {
|
|
76
80
|
/**
|
77
81
|
* Retrieves the balance of the account for the given asset.
|
78
82
|
*
|
79
|
-
* @param assetId - The asset ID to check the balance for.
|
83
|
+
* @param assetId - The asset ID to check the balance for (optional).
|
80
84
|
* @returns A promise that resolves to the balance amount.
|
81
85
|
*/
|
82
86
|
getBalance(assetId?: BytesLike): Promise<BN>;
|
@@ -92,7 +96,7 @@ export declare class Account extends AbstractAccount {
|
|
92
96
|
* @typeParam T - The type of the TransactionRequest.
|
93
97
|
* @param request - The transaction request to fund.
|
94
98
|
* @param params - The estimated transaction parameters.
|
95
|
-
* @returns
|
99
|
+
* @returns A promise that resolves to the funded transaction request.
|
96
100
|
*/
|
97
101
|
fund<T extends TransactionRequest>(request: T, params: EstimatedTxParams): Promise<T>;
|
98
102
|
/**
|
@@ -100,37 +104,21 @@ export declare class Account extends AbstractAccount {
|
|
100
104
|
*
|
101
105
|
* @param destination - The address of the destination.
|
102
106
|
* @param amount - The amount of coins to transfer.
|
103
|
-
* @param assetId - The asset ID of the coins to transfer.
|
104
|
-
* @param txParams - The transaction parameters (
|
107
|
+
* @param assetId - The asset ID of the coins to transfer (optional).
|
108
|
+
* @param txParams - The transaction parameters (optional).
|
105
109
|
* @returns A promise that resolves to the prepared transaction request.
|
106
110
|
*/
|
107
|
-
createTransfer(
|
108
|
-
/** Address of the destination */
|
109
|
-
destination: string | AbstractAddress,
|
110
|
-
/** Amount of coins */
|
111
|
-
amount: BigNumberish,
|
112
|
-
/** Asset ID of coins */
|
113
|
-
assetId?: BytesLike,
|
114
|
-
/** Tx Params */
|
115
|
-
txParams?: TxParamsType): Promise<TransactionRequest>;
|
111
|
+
createTransfer(destination: string | AbstractAddress, amount: BigNumberish, assetId?: BytesLike, txParams?: TxParamsType): Promise<TransactionRequest>;
|
116
112
|
/**
|
117
113
|
* Transfers coins to a destination address.
|
118
114
|
*
|
119
115
|
* @param destination - The address of the destination.
|
120
116
|
* @param amount - The amount of coins to transfer.
|
121
|
-
* @param assetId - The asset ID of the coins to transfer.
|
122
|
-
* @param txParams - The transaction parameters (
|
117
|
+
* @param assetId - The asset ID of the coins to transfer (optional).
|
118
|
+
* @param txParams - The transaction parameters (optional).
|
123
119
|
* @returns A promise that resolves to the transaction response.
|
124
120
|
*/
|
125
|
-
transfer(
|
126
|
-
/** Address of the destination */
|
127
|
-
destination: string | AbstractAddress,
|
128
|
-
/** Amount of coins */
|
129
|
-
amount: BigNumberish,
|
130
|
-
/** Asset ID of coins */
|
131
|
-
assetId?: BytesLike,
|
132
|
-
/** Tx Params */
|
133
|
-
txParams?: TxParamsType): Promise<TransactionResponse>;
|
121
|
+
transfer(destination: string | AbstractAddress, amount: BigNumberish, assetId?: BytesLike, txParams?: TxParamsType): Promise<TransactionResponse>;
|
134
122
|
/**
|
135
123
|
* Transfers multiple amounts of a token to multiple recipients.
|
136
124
|
*
|
@@ -160,38 +148,31 @@ export declare class Account extends AbstractAccount {
|
|
160
148
|
*
|
161
149
|
* @param contractId - The address of the contract.
|
162
150
|
* @param amount - The amount of coins to transfer.
|
163
|
-
* @param assetId - The asset ID of the coins to transfer.
|
164
|
-
* @param txParams - The
|
151
|
+
* @param assetId - The asset ID of the coins to transfer (optional).
|
152
|
+
* @param txParams - The transaction parameters (optional).
|
165
153
|
* @returns A promise that resolves to the transaction response.
|
166
154
|
*/
|
167
|
-
transferToContract(
|
168
|
-
/** Contract address */
|
169
|
-
contractId: string | AbstractAddress,
|
170
|
-
/** Amount of coins */
|
171
|
-
amount: BigNumberish,
|
172
|
-
/** Asset ID of coins */
|
173
|
-
assetId?: BytesLike,
|
174
|
-
/** Tx Params */
|
175
|
-
txParams?: TxParamsType): Promise<TransactionResponse>;
|
155
|
+
transferToContract(contractId: string | AbstractAddress, amount: BigNumberish, assetId?: BytesLike, txParams?: TxParamsType): Promise<TransactionResponse>;
|
176
156
|
/**
|
177
157
|
* Withdraws an amount of the base asset to the base chain.
|
178
158
|
*
|
179
159
|
* @param recipient - Address of the recipient on the base chain.
|
180
160
|
* @param amount - Amount of base asset.
|
181
|
-
* @param txParams - The
|
161
|
+
* @param txParams - The transaction parameters (optional).
|
182
162
|
* @returns A promise that resolves to the transaction response.
|
183
163
|
*/
|
184
|
-
withdrawToBaseLayer(
|
185
|
-
/**
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
164
|
+
withdrawToBaseLayer(recipient: string | AbstractAddress, amount: BigNumberish, txParams?: TxParamsType): Promise<TransactionResponse>;
|
165
|
+
/**
|
166
|
+
* Sign a message from the account via the connector.
|
167
|
+
*
|
168
|
+
* @param message - the message to sign.
|
169
|
+
* @returns a promise that resolves to the signature.
|
170
|
+
*
|
171
|
+
* @hidden
|
172
|
+
*/
|
192
173
|
signMessage(message: string): Promise<string>;
|
193
174
|
/**
|
194
|
-
* Signs a transaction
|
175
|
+
* Signs a transaction from the account via the connector..
|
195
176
|
*
|
196
177
|
* @param transactionRequestLike - The transaction request to sign.
|
197
178
|
* @returns A promise that resolves to the signature of the transaction.
|
@@ -201,6 +182,7 @@ export declare class Account extends AbstractAccount {
|
|
201
182
|
* Sends a transaction to the network.
|
202
183
|
*
|
203
184
|
* @param transactionRequestLike - The transaction request to be sent.
|
185
|
+
* @param sendTransactionParams - The provider send transaction parameters (optional).
|
204
186
|
* @returns A promise that resolves to the transaction response.
|
205
187
|
*/
|
206
188
|
sendTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies, awaitExecution }?: ProviderSendTxParams): Promise<TransactionResponse>;
|
@@ -208,6 +190,7 @@ export declare class Account extends AbstractAccount {
|
|
208
190
|
* Simulates a transaction.
|
209
191
|
*
|
210
192
|
* @param transactionRequestLike - The transaction request to be simulated.
|
193
|
+
* @param estimateTxParams - The estimate transaction params (optional).
|
211
194
|
* @returns A promise that resolves to the call result.
|
212
195
|
*/
|
213
196
|
simulateTransaction(transactionRequestLike: TransactionRequestLike, { estimateTxDependencies }?: EstimateTransactionParams): Promise<CallResult>;
|
package/dist/account.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAKtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EACV,sBAAsB,EACtB,UAAU,EACV,kBAAkB,EAClB,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,sBAAsB,EACtB,QAAQ,EACR,4BAA4B,EAC5B,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,wBAAwB,EAGzB,MAAM,aAAa,CAAC;AASrB,MAAM,MAAM,YAAY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