@algorandfoundation/algokit-utils 6.2.1-beta.1 → 6.3.0-beta.1
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.
- package/account/account.d.ts +13 -5
- package/account/account.d.ts.map +1 -1
- package/account/account.js +26 -6
- package/account/account.js.map +1 -1
- package/account/account.mjs +26 -6
- package/account/account.mjs.map +1 -1
- package/account/get-account.d.ts +4 -4
- package/account/get-account.js +2 -2
- package/account/get-account.mjs +2 -2
- package/amount.d.ts +28 -6
- package/amount.d.ts.map +1 -1
- package/amount.js +31 -11
- package/amount.js.map +1 -1
- package/amount.mjs +30 -12
- package/amount.mjs.map +1 -1
- package/asset.d.ts +10 -0
- package/asset.d.ts.map +1 -1
- package/asset.js +71 -198
- package/asset.js.map +1 -1
- package/asset.mjs +72 -199
- package/asset.mjs.map +1 -1
- package/dispenser-client.d.ts +1 -1
- package/dispenser-client.js +2 -2
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +2 -2
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +4 -3
- package/index.d.ts.map +1 -1
- package/index.js +11 -8
- package/index.js.map +1 -1
- package/index.mjs +6 -4
- package/index.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -1
- package/localnet/get-or-create-kmd-wallet-account.js +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +1 -1
- package/package.json +3 -2
- package/testing/_asset.d.ts +2 -4
- package/testing/_asset.d.ts.map +1 -1
- package/testing/account.js +8 -2
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +8 -2
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +1 -1
- package/testing/fixtures/algorand-fixture.js +7 -2
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +7 -2
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/transaction/legacy-bridge.d.ts +10 -0
- package/transaction/legacy-bridge.d.ts.map +1 -0
- package/transaction/legacy-bridge.js +35 -0
- package/transaction/legacy-bridge.js.map +1 -0
- package/transaction/legacy-bridge.mjs +33 -0
- package/transaction/legacy-bridge.mjs.map +1 -0
- package/transaction/transaction.d.ts +1 -1
- package/transaction/transaction.js +5 -5
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +5 -5
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +4 -2
- package/transfer/transfer-algos.d.ts.map +1 -1
- package/transfer/transfer-algos.js +13 -22
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +14 -23
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +8 -1
- package/transfer/transfer.d.ts.map +1 -1
- package/transfer/transfer.js +57 -94
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +58 -95
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +141 -24
- package/types/account-manager.d.ts.map +1 -1
- package/types/account-manager.js +217 -44
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +216 -43
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +122 -7
- package/types/account.d.ts.map +1 -1
- package/types/account.js.map +1 -1
- package/types/account.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +289 -0
- package/types/algorand-client-transaction-creator.d.ts.map +1 -0
- package/types/algorand-client-transaction-creator.js +299 -0
- package/types/algorand-client-transaction-creator.js.map +1 -0
- package/types/algorand-client-transaction-creator.mjs +297 -0
- package/types/algorand-client-transaction-creator.mjs.map +1 -0
- package/types/algorand-client-transaction-sender.d.ts +433 -0
- package/types/algorand-client-transaction-sender.d.ts.map +1 -0
- package/types/algorand-client-transaction-sender.js +422 -0
- package/types/algorand-client-transaction-sender.js.map +1 -0
- package/types/algorand-client-transaction-sender.mjs +420 -0
- package/types/algorand-client-transaction-sender.mjs.map +1 -0
- package/types/algorand-client.d.ts +28 -78
- package/types/algorand-client.d.ts.map +1 -1
- package/types/algorand-client.js +33 -122
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +34 -123
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +18 -6
- package/types/amount.d.ts.map +1 -1
- package/types/amount.js +33 -10
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +33 -10
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +3 -3
- package/types/app-client.d.ts.map +1 -1
- package/types/app-client.js +7 -10
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +8 -11
- package/types/app-client.mjs.map +1 -1
- package/types/asset-manager.d.ts +205 -0
- package/types/asset-manager.d.ts.map +1 -0
- package/types/asset-manager.js +180 -0
- package/types/asset-manager.js.map +1 -0
- package/types/asset-manager.mjs +178 -0
- package/types/asset-manager.mjs.map +1 -0
- package/types/asset.d.ts +4 -4
- package/types/asset.d.ts.map +1 -1
- package/types/client-manager.d.ts +40 -2
- package/types/client-manager.d.ts.map +1 -1
- package/types/client-manager.js +44 -3
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +44 -3
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +226 -68
- package/types/composer.d.ts.map +1 -1
- package/types/composer.js +78 -64
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +75 -64
- package/types/composer.mjs.map +1 -1
- package/types/dispenser-client.d.ts +12 -4
- package/types/dispenser-client.d.ts.map +1 -1
- package/types/dispenser-client.js +9 -9
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +9 -9
- package/types/dispenser-client.mjs.map +1 -1
- package/types/indexer.d.ts +7 -7
- package/types/indexer.d.ts.map +1 -1
- package/types/kmd-account-manager.d.ts +3 -3
- package/types/kmd-account-manager.js +6 -6
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +7 -7
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/network-client.d.ts +7 -1
- package/types/network-client.d.ts.map +1 -1
- package/types/network-client.js +10 -0
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -0
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +1 -1
- package/types/testing.d.ts.map +1 -1
- package/types/transfer.d.ts +8 -7
- package/types/transfer.d.ts.map +1 -1
- package/util.d.ts +13 -0
- package/util.d.ts.map +1 -1
- package/util.js +25 -0
- package/util.js.map +1 -1
- package/util.mjs +24 -1
- package/util.mjs.map +1 -1
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import algosdk from 'algosdk';
|
|
2
2
|
import { AccountInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from './account';
|
|
3
|
+
import { SendSingleTransactionResult } from './algorand-client-transaction-sender';
|
|
3
4
|
import { AlgoAmount } from './amount';
|
|
4
5
|
import { ClientManager } from './client-manager';
|
|
6
|
+
import { CommonTransactionParams, ExecuteParams } from './composer';
|
|
7
|
+
import { TestNetDispenserApiClient } from './dispenser-client';
|
|
5
8
|
import { KmdAccountManager } from './kmd-account-manager';
|
|
6
9
|
import LogicSigAccount = algosdk.LogicSigAccount;
|
|
7
10
|
import Account = algosdk.Account;
|
|
11
|
+
/** Result from performing an ensureFunded call. */
|
|
12
|
+
export interface EnsureFundedResult {
|
|
13
|
+
/** The transaction ID of the transaction that funded the account. */
|
|
14
|
+
transactionId: string;
|
|
15
|
+
/** The amount that was sent to the account. */
|
|
16
|
+
amountFunded: AlgoAmount;
|
|
17
|
+
}
|
|
8
18
|
/**
|
|
9
19
|
* Returns a `TransactionSigner` for the given account that can sign a transaction.
|
|
10
20
|
* This function has memoization, so will return the same transaction signer for a given account.
|
|
@@ -27,6 +37,7 @@ export declare class AccountManager {
|
|
|
27
37
|
* ```
|
|
28
38
|
*/
|
|
29
39
|
constructor(clientManager: ClientManager);
|
|
40
|
+
private _getComposer;
|
|
30
41
|
/** KMD account manager that allows you to easily get and create accounts using KMD. */
|
|
31
42
|
get kmd(): KmdAccountManager;
|
|
32
43
|
/**
|
|
@@ -125,27 +136,6 @@ export declare class AccountManager {
|
|
|
125
136
|
* @returns The account information
|
|
126
137
|
*/
|
|
127
138
|
getInformation(sender: string | TransactionSignerAccount): Promise<AccountInformation>;
|
|
128
|
-
/**
|
|
129
|
-
* Returns the given sender account's asset holding for a given asset.
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```typescript
|
|
133
|
-
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
134
|
-
* const assetId = 123345;
|
|
135
|
-
* const accountInfo = await accountManager.getAssetInformation(address, assetId);
|
|
136
|
-
* ```
|
|
137
|
-
*
|
|
138
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)
|
|
139
|
-
* @param sender The address of the sender/account to look up
|
|
140
|
-
* @param assetId The ID of the asset to return a holding for
|
|
141
|
-
* @returns The account asset holding information
|
|
142
|
-
*/
|
|
143
|
-
getAssetInformation(sender: string | TransactionSignerAccount, assetId: number | bigint): Promise<{
|
|
144
|
-
assetId: bigint;
|
|
145
|
-
balance: bigint;
|
|
146
|
-
frozen: boolean;
|
|
147
|
-
round: bigint;
|
|
148
|
-
}>;
|
|
149
139
|
/**
|
|
150
140
|
* Tracks and returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.
|
|
151
141
|
*
|
|
@@ -174,7 +164,7 @@ export declare class AccountManager {
|
|
|
174
164
|
* @param sender The sender address to use as the new sender
|
|
175
165
|
* @returns The account
|
|
176
166
|
*/
|
|
177
|
-
rekeyed(
|
|
167
|
+
rekeyed(sender: string, account: TransactionSignerAccount): TransactionSignerAccount & {
|
|
178
168
|
account: {
|
|
179
169
|
addr: string;
|
|
180
170
|
signer: algosdk.TransactionSigner;
|
|
@@ -200,11 +190,11 @@ export declare class AccountManager {
|
|
|
200
190
|
* const account = await accountManager.fromEnvironment('MY_ACCOUNT')
|
|
201
191
|
* ```
|
|
202
192
|
*
|
|
203
|
-
* If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default)
|
|
193
|
+
* If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.
|
|
204
194
|
* If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.
|
|
205
195
|
*
|
|
206
196
|
* @param name The name identifier of the account
|
|
207
|
-
* @param fundWith The optional amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000
|
|
197
|
+
* @param fundWith The optional amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account
|
|
208
198
|
* @returns The account
|
|
209
199
|
*/
|
|
210
200
|
fromEnvironment(name: string, fundWith?: AlgoAmount): Promise<TransactionSignerAccount & {
|
|
@@ -300,5 +290,132 @@ export declare class AccountManager {
|
|
|
300
290
|
localNetDispenser(): Promise<TransactionSignerAccount & {
|
|
301
291
|
account: SigningAccount;
|
|
302
292
|
}>;
|
|
293
|
+
/**
|
|
294
|
+
* Rekey an account to a new address.
|
|
295
|
+
*
|
|
296
|
+
* **Note:** Please be careful with this function and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/).
|
|
297
|
+
*
|
|
298
|
+
* @param account The account to rekey
|
|
299
|
+
* @param rekeyTo The account address or signing account of the account that will be used to authorise transactions for the rekeyed account going forward.
|
|
300
|
+
* If a signing account is provided that will now be tracked as the signer for `account` in this `AccountManager`
|
|
301
|
+
* @param options Any parameters to control the transaction or execution of the transaction
|
|
302
|
+
*
|
|
303
|
+
* @example Basic example (with string addresses)
|
|
304
|
+
* ```typescript
|
|
305
|
+
* await algorand.account.rekeyAccount({account: "ACCOUNTADDRESS", rekeyTo: "NEWADDRESS"})
|
|
306
|
+
* ```
|
|
307
|
+
* @example Basic example (with signer accounts)
|
|
308
|
+
* ```typescript
|
|
309
|
+
* await algorand.account.rekeyAccount({account: account1, rekeyTo: newSignerAccount})
|
|
310
|
+
* ```
|
|
311
|
+
* @example Advanced example
|
|
312
|
+
* ```typescript
|
|
313
|
+
* await algorand.account.rekeyAccount({
|
|
314
|
+
* account: "ACCOUNTADDRESS",
|
|
315
|
+
* rekeyTo: "NEWADDRESS",
|
|
316
|
+
* lease: 'lease',
|
|
317
|
+
* note: 'note',
|
|
318
|
+
* firstValidRound: 1000n,
|
|
319
|
+
* validityWindow: 10,
|
|
320
|
+
* extraFee: (1000).microAlgo(),
|
|
321
|
+
* staticFee: (1000).microAlgo(),
|
|
322
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
323
|
+
* // already specified, but here for completeness
|
|
324
|
+
* maxFee: (3000).microAlgo(),
|
|
325
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
326
|
+
* suppressLog: true,
|
|
327
|
+
* })
|
|
328
|
+
* ```
|
|
329
|
+
* @returns The result of the transaction and the transaction that was sent
|
|
330
|
+
*/
|
|
331
|
+
rekeyAccount(account: string | TransactionSignerAccount, rekeyTo: string | TransactionSignerAccount, options?: Omit<CommonTransactionParams, 'sender'> & ExecuteParams): Promise<SendSingleTransactionResult>;
|
|
332
|
+
private _getEnsureFundedAmount;
|
|
333
|
+
/**
|
|
334
|
+
* Funds a given account using a dispenser account as a funding source such that
|
|
335
|
+
* the given account has a certain amount of Algo free to spend (accounting for
|
|
336
|
+
* Algo locked in minimum balance requirement).
|
|
337
|
+
*
|
|
338
|
+
* https://developer.algorand.org/docs/get-details/accounts/#minimum-balance
|
|
339
|
+
*
|
|
340
|
+
* @param accountToFund The account to fund
|
|
341
|
+
* @param dispenserAccount The account to use as a dispenser funding source
|
|
342
|
+
* @param minSpendingBalance The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement)
|
|
343
|
+
* @param options Optional parameters to control the funding increment, transaction or execution of the transaction
|
|
344
|
+
* @example Example using AlgorandClient
|
|
345
|
+
* ```typescript
|
|
346
|
+
* // Basic example
|
|
347
|
+
* await algorand.account.ensureFunded("ACCOUNTADDRESS", "DISPENSERADDRESS", algokit.algo(1))
|
|
348
|
+
* // With configuration
|
|
349
|
+
* await algorand.account.ensureFunded("ACCOUNTADDRESS", "DISPENSERADDRESS", algokit.algo(1),
|
|
350
|
+
* { minFundingIncrement: algokit.algo(2), fee: (1000).microAlgo(), suppressLog: true }
|
|
351
|
+
* )
|
|
352
|
+
* ```
|
|
353
|
+
* @returns
|
|
354
|
+
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
355
|
+
* - `undefined` if no funds were needed.
|
|
356
|
+
*/
|
|
357
|
+
ensureFunded(accountToFund: string | TransactionSignerAccount, dispenserAccount: string | TransactionSignerAccount, minSpendingBalance: AlgoAmount, options?: {
|
|
358
|
+
minFundingIncrement?: AlgoAmount;
|
|
359
|
+
} & ExecuteParams & Omit<CommonTransactionParams, 'sender'>): Promise<(SendSingleTransactionResult & EnsureFundedResult) | undefined>;
|
|
360
|
+
/**
|
|
361
|
+
* Funds a given account using a dispenser account retrieved from the environment,
|
|
362
|
+
* per the `dispenserFromEnvironment` method, as a funding source such that
|
|
363
|
+
* the given account has a certain amount of Algo free to spend (accounting for
|
|
364
|
+
* Algo locked in minimum balance requirement).
|
|
365
|
+
*
|
|
366
|
+
* **Note:** requires a Node.js environment to execute.
|
|
367
|
+
*
|
|
368
|
+
* The dispenser account is retrieved from the account mnemonic stored in
|
|
369
|
+
* process.env.DISPENSER_MNEMONIC and optionally process.env.DISPENSER_SENDER
|
|
370
|
+
* if it's a rekeyed account, or against default LocalNet if no environment variables present.
|
|
371
|
+
*
|
|
372
|
+
* https://developer.algorand.org/docs/get-details/accounts/#minimum-balance
|
|
373
|
+
*
|
|
374
|
+
* @param accountToFund The account to fund
|
|
375
|
+
* @param minSpendingBalance The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement)
|
|
376
|
+
* @param options Optional parameters to control the funding increment, transaction or execution of the transaction
|
|
377
|
+
* @example Example using AlgorandClient
|
|
378
|
+
* ```typescript
|
|
379
|
+
* // Basic example
|
|
380
|
+
* await algorand.account.ensureFundedFromEnvironment("ACCOUNTADDRESS", algokit.algo(1))
|
|
381
|
+
* // With configuration
|
|
382
|
+
* await algorand.account.ensureFundedFromEnvironment("ACCOUNTADDRESS", algokit.algo(1),
|
|
383
|
+
* { minFundingIncrement: algokit.algo(2), fee: (1000).microAlgo(), suppressLog: true }
|
|
384
|
+
* )
|
|
385
|
+
* ```
|
|
386
|
+
* @returns
|
|
387
|
+
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
388
|
+
* - `undefined` if no funds were needed.
|
|
389
|
+
*/
|
|
390
|
+
ensureFundedFromEnvironment(accountToFund: string | TransactionSignerAccount, minSpendingBalance: AlgoAmount, options?: {
|
|
391
|
+
minFundingIncrement?: AlgoAmount;
|
|
392
|
+
} & ExecuteParams & Omit<CommonTransactionParams, 'sender'>): Promise<(SendSingleTransactionResult & EnsureFundedResult) | undefined>;
|
|
393
|
+
/**
|
|
394
|
+
* Funds a given account using the TestNet Dispenser API as a funding source such that
|
|
395
|
+
* the account has a certain amount of Algo free to spend (accounting for Algo locked
|
|
396
|
+
* in minimum balance requirement).
|
|
397
|
+
*
|
|
398
|
+
* https://developer.algorand.org/docs/get-details/accounts/#minimum-balance
|
|
399
|
+
*
|
|
400
|
+
* @param accountToFund The account to fund
|
|
401
|
+
* @param dispenserClient The TestNet dispenser funding client
|
|
402
|
+
* @param minSpendingBalance The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement)
|
|
403
|
+
* @param options Optional parameters to control the funding increment, transaction or execution of the transaction
|
|
404
|
+
* @example Example using AlgorandClient
|
|
405
|
+
* ```typescript
|
|
406
|
+
* // Basic example
|
|
407
|
+
* await algorand.account.ensureFundedUsingDispenserAPI("ACCOUNTADDRESS", algorand.client.getTestNetDispenserFromEnvironment(), algokit.algo(1))
|
|
408
|
+
* // With configuration
|
|
409
|
+
* await algorand.account.ensureFundedUsingDispenserAPI("ACCOUNTADDRESS", algorand.client.getTestNetDispenserFromEnvironment(), algokit.algo(1),
|
|
410
|
+
* { minFundingIncrement: algokit.algo(2) }
|
|
411
|
+
* )
|
|
412
|
+
* ```
|
|
413
|
+
* @returns
|
|
414
|
+
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
415
|
+
* - `undefined` if no funds were needed.
|
|
416
|
+
*/
|
|
417
|
+
ensureFundedFromTestNetDispenserApi(accountToFund: string | TransactionSignerAccount, dispenserClient: TestNetDispenserApiClient, minSpendingBalance: AlgoAmount, options: {
|
|
418
|
+
minFundingIncrement?: AlgoAmount;
|
|
419
|
+
}): Promise<EnsureFundedResult | undefined>;
|
|
303
420
|
}
|
|
304
421
|
//# sourceMappingURL=account-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-manager.d.ts","sourceRoot":"","sources":["../../src/types/account-manager.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"account-manager.d.ts","sourceRoot":"","sources":["../../src/types/account-manager.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAG7B,OAAO,EAAE,kBAAkB,EAAqB,eAAe,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAC5H,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAA;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAwB,EAAE,uBAAuB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AACpF,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,eAAe,GAAG,OAAO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,EAC9B,OAAO,CAAC,EAAE;QACR,mBAAmB,CAAC,EAAE,UAAU,CAAA;KACjC,GAAG,aAAa,GACf,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GACxC,OAAO,CAAC,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,GAAG,SAAS,CAAC;IAwB1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,2BAA2B,CAC/B,aAAa,EAAE,MAAM,GAAG,wBAAwB,EAChD,kBAAkB,EAAE,UAAU,EAC9B,OAAO,CAAC,EAAE;QACR,mBAAmB,CAAC,EAAE,UAAU,CAAA;KACjC,GAAG,aAAa,GACf,IAAI,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GACxC,OAAO,CAAC,CAAC,2BAA2B,GAAG,kBAAkB,CAAC,GAAG,SAAS,CAAC;IAyB1E;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,mCAAmC,CACvC,aAAa,EAAE,MAAM,GAAG,wBAAwB,EAChD,eAAe,EAAE,yBAAyB,EAC1C,kBAAkB,EAAE,UAAU,EAC9B,OAAO,EAAE;QACP,mBAAmB,CAAC,EAAE,UAAU,CAAA;KACjC,GACA,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC;CAgB3C"}
|
package/types/account-manager.js
CHANGED
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var algosdk = require('algosdk');
|
|
4
|
+
var config = require('../config.js');
|
|
5
|
+
var util = require('../util.js');
|
|
4
6
|
var types_account = require('./account.js');
|
|
7
|
+
var types_amount = require('./amount.js');
|
|
8
|
+
var types_composer = require('./composer.js');
|
|
5
9
|
var types_kmdAccountManager = require('./kmd-account-manager.js');
|
|
6
10
|
|
|
7
11
|
var LogicSigAccount = algosdk.LogicSigAccount;
|
|
8
12
|
var AccountInformationModel = algosdk.modelsv2.Account;
|
|
9
|
-
const memoize = (fn) => {
|
|
10
|
-
const cache = new Map();
|
|
11
|
-
const cached = function (val) {
|
|
12
|
-
return cache.has(val) ? cache.get(val) : cache.set(val, fn.call(this, val)) && cache.get(val);
|
|
13
|
-
};
|
|
14
|
-
cached.cache = cache;
|
|
15
|
-
return cached;
|
|
16
|
-
};
|
|
17
13
|
/**
|
|
18
14
|
* Returns a `TransactionSigner` for the given account that can sign a transaction.
|
|
19
15
|
* This function has memoization, so will return the same transaction signer for a given account.
|
|
20
16
|
* @param account An account that can sign a transaction
|
|
21
17
|
* @returns A transaction signer
|
|
22
18
|
*/
|
|
23
|
-
const getAccountTransactionSigner = memoize(function (account) {
|
|
19
|
+
const getAccountTransactionSigner = util.memoize(function (account) {
|
|
24
20
|
return 'signer' in account
|
|
25
21
|
? account.signer
|
|
26
22
|
: 'lsig' in account
|
|
@@ -42,6 +38,13 @@ class AccountManager {
|
|
|
42
38
|
this._clientManager = clientManager;
|
|
43
39
|
this._kmdAccountManager = new types_kmdAccountManager.KmdAccountManager(clientManager);
|
|
44
40
|
}
|
|
41
|
+
_getComposer(getSuggestedParams) {
|
|
42
|
+
return new types_composer.default({
|
|
43
|
+
algod: this._clientManager.algod,
|
|
44
|
+
getSigner: this.getSigner.bind(this),
|
|
45
|
+
getSuggestedParams: getSuggestedParams ?? (() => this._clientManager.algod.getTransactionParams().do()),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
45
48
|
/** KMD account manager that allows you to easily get and create accounts using KMD. */
|
|
46
49
|
get kmd() {
|
|
47
50
|
return this._kmdAccountManager;
|
|
@@ -172,12 +175,12 @@ class AccountManager {
|
|
|
172
175
|
return {
|
|
173
176
|
...account,
|
|
174
177
|
// None of these can practically overflow 2^53
|
|
175
|
-
|
|
176
|
-
amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),
|
|
177
|
-
minBalance: Number(account.minBalance),
|
|
178
|
-
pendingRewards: Number(account.pendingRewards),
|
|
179
|
-
rewards: Number(account.rewards),
|
|
180
|
-
|
|
178
|
+
balance: types_amount.AlgoAmount.MicroAlgo(Number(account.amount)),
|
|
179
|
+
amountWithoutPendingRewards: types_amount.AlgoAmount.MicroAlgo(Number(account.amountWithoutPendingRewards)),
|
|
180
|
+
minBalance: types_amount.AlgoAmount.MicroAlgo(Number(account.minBalance)),
|
|
181
|
+
pendingRewards: types_amount.AlgoAmount.MicroAlgo(Number(account.pendingRewards)),
|
|
182
|
+
rewards: types_amount.AlgoAmount.MicroAlgo(Number(account.rewards)),
|
|
183
|
+
validAsOfRound: BigInt(account.round),
|
|
181
184
|
totalAppsOptedIn: Number(account.totalAppsOptedIn),
|
|
182
185
|
totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
|
|
183
186
|
totalCreatedApps: Number(account.totalCreatedApps),
|
|
@@ -188,32 +191,6 @@ class AccountManager {
|
|
|
188
191
|
totalBoxes: account.totalBoxes ? Number(account.totalBoxes) : undefined,
|
|
189
192
|
};
|
|
190
193
|
}
|
|
191
|
-
/**
|
|
192
|
-
* Returns the given sender account's asset holding for a given asset.
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* ```typescript
|
|
196
|
-
* const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
|
|
197
|
-
* const assetId = 123345;
|
|
198
|
-
* const accountInfo = await accountManager.getAssetInformation(address, assetId);
|
|
199
|
-
* ```
|
|
200
|
-
*
|
|
201
|
-
* [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)
|
|
202
|
-
* @param sender The address of the sender/account to look up
|
|
203
|
-
* @param assetId The ID of the asset to return a holding for
|
|
204
|
-
* @returns The account asset holding information
|
|
205
|
-
*/
|
|
206
|
-
async getAssetInformation(sender, assetId) {
|
|
207
|
-
const info = await this._clientManager.algod
|
|
208
|
-
.accountAssetInformation(typeof sender === 'string' ? sender : sender.addr, Number(assetId))
|
|
209
|
-
.do();
|
|
210
|
-
return {
|
|
211
|
-
assetId: BigInt(assetId),
|
|
212
|
-
balance: BigInt(info['asset-holding']['amount']),
|
|
213
|
-
frozen: info['asset-holding']['is-frozen'] === true,
|
|
214
|
-
round: BigInt(info['round']),
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
194
|
/**
|
|
218
195
|
* Tracks and returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.
|
|
219
196
|
*
|
|
@@ -243,7 +220,7 @@ class AccountManager {
|
|
|
243
220
|
* @param sender The sender address to use as the new sender
|
|
244
221
|
* @returns The account
|
|
245
222
|
*/
|
|
246
|
-
rekeyed(
|
|
223
|
+
rekeyed(sender, account) {
|
|
247
224
|
return this.signerAccount({ addr: sender, signer: account.signer });
|
|
248
225
|
}
|
|
249
226
|
/**
|
|
@@ -266,11 +243,11 @@ class AccountManager {
|
|
|
266
243
|
* const account = await accountManager.fromEnvironment('MY_ACCOUNT')
|
|
267
244
|
* ```
|
|
268
245
|
*
|
|
269
|
-
* If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default)
|
|
246
|
+
* If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.
|
|
270
247
|
* If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.
|
|
271
248
|
*
|
|
272
249
|
* @param name The name identifier of the account
|
|
273
|
-
* @param fundWith The optional amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000
|
|
250
|
+
* @param fundWith The optional amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account
|
|
274
251
|
* @returns The account
|
|
275
252
|
*/
|
|
276
253
|
async fromEnvironment(name, fundWith) {
|
|
@@ -390,6 +367,202 @@ class AccountManager {
|
|
|
390
367
|
const dispenser = await this._kmdAccountManager.getLocalNetDispenserAccount();
|
|
391
368
|
return this.signerAccount(dispenser.account);
|
|
392
369
|
}
|
|
370
|
+
/**
|
|
371
|
+
* Rekey an account to a new address.
|
|
372
|
+
*
|
|
373
|
+
* **Note:** Please be careful with this function and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/).
|
|
374
|
+
*
|
|
375
|
+
* @param account The account to rekey
|
|
376
|
+
* @param rekeyTo The account address or signing account of the account that will be used to authorise transactions for the rekeyed account going forward.
|
|
377
|
+
* If a signing account is provided that will now be tracked as the signer for `account` in this `AccountManager`
|
|
378
|
+
* @param options Any parameters to control the transaction or execution of the transaction
|
|
379
|
+
*
|
|
380
|
+
* @example Basic example (with string addresses)
|
|
381
|
+
* ```typescript
|
|
382
|
+
* await algorand.account.rekeyAccount({account: "ACCOUNTADDRESS", rekeyTo: "NEWADDRESS"})
|
|
383
|
+
* ```
|
|
384
|
+
* @example Basic example (with signer accounts)
|
|
385
|
+
* ```typescript
|
|
386
|
+
* await algorand.account.rekeyAccount({account: account1, rekeyTo: newSignerAccount})
|
|
387
|
+
* ```
|
|
388
|
+
* @example Advanced example
|
|
389
|
+
* ```typescript
|
|
390
|
+
* await algorand.account.rekeyAccount({
|
|
391
|
+
* account: "ACCOUNTADDRESS",
|
|
392
|
+
* rekeyTo: "NEWADDRESS",
|
|
393
|
+
* lease: 'lease',
|
|
394
|
+
* note: 'note',
|
|
395
|
+
* firstValidRound: 1000n,
|
|
396
|
+
* validityWindow: 10,
|
|
397
|
+
* extraFee: (1000).microAlgo(),
|
|
398
|
+
* staticFee: (1000).microAlgo(),
|
|
399
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
400
|
+
* // already specified, but here for completeness
|
|
401
|
+
* maxFee: (3000).microAlgo(),
|
|
402
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
403
|
+
* suppressLog: true,
|
|
404
|
+
* })
|
|
405
|
+
* ```
|
|
406
|
+
* @returns The result of the transaction and the transaction that was sent
|
|
407
|
+
*/
|
|
408
|
+
async rekeyAccount(account, rekeyTo, options) {
|
|
409
|
+
const result = await this._getComposer()
|
|
410
|
+
.addPayment({
|
|
411
|
+
...options,
|
|
412
|
+
sender: typeof account === 'string' ? account : account.addr,
|
|
413
|
+
receiver: typeof account === 'string' ? account : account.addr,
|
|
414
|
+
amount: types_amount.AlgoAmount.MicroAlgo(0),
|
|
415
|
+
rekeyTo: typeof rekeyTo === 'string' ? rekeyTo : rekeyTo.addr,
|
|
416
|
+
})
|
|
417
|
+
.execute(options);
|
|
418
|
+
// If the rekey is a signing account set it as the signer for this account
|
|
419
|
+
if (typeof rekeyTo !== 'string') {
|
|
420
|
+
this.rekeyed(typeof account === 'string' ? account : account.addr, rekeyTo);
|
|
421
|
+
}
|
|
422
|
+
config.Config.getLogger(options?.suppressLog).info(`Rekeyed ${account} to ${rekeyTo} via transaction ${result.txIds.at(-1)}`);
|
|
423
|
+
return { ...result, transaction: result.transactions.at(-1), confirmation: result.confirmations.at(-1) };
|
|
424
|
+
}
|
|
425
|
+
async _getEnsureFundedAmount(sender, minSpendingBalance, minFundingIncrement) {
|
|
426
|
+
const accountInfo = await this.getInformation(sender);
|
|
427
|
+
const currentSpendingBalance = accountInfo.balance.microAlgo - accountInfo.minBalance.microAlgo;
|
|
428
|
+
const amountFunded = util.calculateFundAmount(minSpendingBalance.microAlgo, currentSpendingBalance, minFundingIncrement?.microAlgo ?? 0);
|
|
429
|
+
return amountFunded === null ? undefined : types_amount.AlgoAmount.MicroAlgo(amountFunded);
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Funds a given account using a dispenser account as a funding source such that
|
|
433
|
+
* the given account has a certain amount of Algo free to spend (accounting for
|
|
434
|
+
* Algo locked in minimum balance requirement).
|
|
435
|
+
*
|
|
436
|
+
* https://developer.algorand.org/docs/get-details/accounts/#minimum-balance
|
|
437
|
+
*
|
|
438
|
+
* @param accountToFund The account to fund
|
|
439
|
+
* @param dispenserAccount The account to use as a dispenser funding source
|
|
440
|
+
* @param minSpendingBalance The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement)
|
|
441
|
+
* @param options Optional parameters to control the funding increment, transaction or execution of the transaction
|
|
442
|
+
* @example Example using AlgorandClient
|
|
443
|
+
* ```typescript
|
|
444
|
+
* // Basic example
|
|
445
|
+
* await algorand.account.ensureFunded("ACCOUNTADDRESS", "DISPENSERADDRESS", algokit.algo(1))
|
|
446
|
+
* // With configuration
|
|
447
|
+
* await algorand.account.ensureFunded("ACCOUNTADDRESS", "DISPENSERADDRESS", algokit.algo(1),
|
|
448
|
+
* { minFundingIncrement: algokit.algo(2), fee: (1000).microAlgo(), suppressLog: true }
|
|
449
|
+
* )
|
|
450
|
+
* ```
|
|
451
|
+
* @returns
|
|
452
|
+
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
453
|
+
* - `undefined` if no funds were needed.
|
|
454
|
+
*/
|
|
455
|
+
async ensureFunded(accountToFund, dispenserAccount, minSpendingBalance, options) {
|
|
456
|
+
const addressToFund = typeof accountToFund === 'string' ? accountToFund : accountToFund.addr;
|
|
457
|
+
const amountFunded = await this._getEnsureFundedAmount(addressToFund, minSpendingBalance, options?.minFundingIncrement);
|
|
458
|
+
if (!amountFunded)
|
|
459
|
+
return undefined;
|
|
460
|
+
const result = await this._getComposer()
|
|
461
|
+
.addPayment({
|
|
462
|
+
...options,
|
|
463
|
+
sender: typeof dispenserAccount === 'string' ? dispenserAccount : dispenserAccount.addr,
|
|
464
|
+
receiver: addressToFund,
|
|
465
|
+
amount: amountFunded,
|
|
466
|
+
})
|
|
467
|
+
.execute(options);
|
|
468
|
+
return {
|
|
469
|
+
...result,
|
|
470
|
+
transaction: result.transactions[0],
|
|
471
|
+
confirmation: result.confirmations[0],
|
|
472
|
+
transactionId: result.txIds[0],
|
|
473
|
+
amountFunded: amountFunded,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Funds a given account using a dispenser account retrieved from the environment,
|
|
478
|
+
* per the `dispenserFromEnvironment` method, as a funding source such that
|
|
479
|
+
* the given account has a certain amount of Algo free to spend (accounting for
|
|
480
|
+
* Algo locked in minimum balance requirement).
|
|
481
|
+
*
|
|
482
|
+
* **Note:** requires a Node.js environment to execute.
|
|
483
|
+
*
|
|
484
|
+
* The dispenser account is retrieved from the account mnemonic stored in
|
|
485
|
+
* process.env.DISPENSER_MNEMONIC and optionally process.env.DISPENSER_SENDER
|
|
486
|
+
* if it's a rekeyed account, or against default LocalNet if no environment variables present.
|
|
487
|
+
*
|
|
488
|
+
* https://developer.algorand.org/docs/get-details/accounts/#minimum-balance
|
|
489
|
+
*
|
|
490
|
+
* @param accountToFund The account to fund
|
|
491
|
+
* @param minSpendingBalance The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement)
|
|
492
|
+
* @param options Optional parameters to control the funding increment, transaction or execution of the transaction
|
|
493
|
+
* @example Example using AlgorandClient
|
|
494
|
+
* ```typescript
|
|
495
|
+
* // Basic example
|
|
496
|
+
* await algorand.account.ensureFundedFromEnvironment("ACCOUNTADDRESS", algokit.algo(1))
|
|
497
|
+
* // With configuration
|
|
498
|
+
* await algorand.account.ensureFundedFromEnvironment("ACCOUNTADDRESS", algokit.algo(1),
|
|
499
|
+
* { minFundingIncrement: algokit.algo(2), fee: (1000).microAlgo(), suppressLog: true }
|
|
500
|
+
* )
|
|
501
|
+
* ```
|
|
502
|
+
* @returns
|
|
503
|
+
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
504
|
+
* - `undefined` if no funds were needed.
|
|
505
|
+
*/
|
|
506
|
+
async ensureFundedFromEnvironment(accountToFund, minSpendingBalance, options) {
|
|
507
|
+
const addressToFund = typeof accountToFund === 'string' ? accountToFund : accountToFund.addr;
|
|
508
|
+
const dispenserAccount = await this.dispenserFromEnvironment();
|
|
509
|
+
const amountFunded = await this._getEnsureFundedAmount(addressToFund, minSpendingBalance, options?.minFundingIncrement);
|
|
510
|
+
if (!amountFunded)
|
|
511
|
+
return undefined;
|
|
512
|
+
const result = await this._getComposer()
|
|
513
|
+
.addPayment({
|
|
514
|
+
...options,
|
|
515
|
+
sender: dispenserAccount.addr,
|
|
516
|
+
receiver: addressToFund,
|
|
517
|
+
amount: amountFunded,
|
|
518
|
+
})
|
|
519
|
+
.execute(options);
|
|
520
|
+
return {
|
|
521
|
+
...result,
|
|
522
|
+
transaction: result.transactions[0],
|
|
523
|
+
confirmation: result.confirmations[0],
|
|
524
|
+
transactionId: result.txIds[0],
|
|
525
|
+
amountFunded: amountFunded,
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Funds a given account using the TestNet Dispenser API as a funding source such that
|
|
530
|
+
* the account has a certain amount of Algo free to spend (accounting for Algo locked
|
|
531
|
+
* in minimum balance requirement).
|
|
532
|
+
*
|
|
533
|
+
* https://developer.algorand.org/docs/get-details/accounts/#minimum-balance
|
|
534
|
+
*
|
|
535
|
+
* @param accountToFund The account to fund
|
|
536
|
+
* @param dispenserClient The TestNet dispenser funding client
|
|
537
|
+
* @param minSpendingBalance The minimum balance of Algo that the account should have available to spend (i.e. on top of minimum balance requirement)
|
|
538
|
+
* @param options Optional parameters to control the funding increment, transaction or execution of the transaction
|
|
539
|
+
* @example Example using AlgorandClient
|
|
540
|
+
* ```typescript
|
|
541
|
+
* // Basic example
|
|
542
|
+
* await algorand.account.ensureFundedUsingDispenserAPI("ACCOUNTADDRESS", algorand.client.getTestNetDispenserFromEnvironment(), algokit.algo(1))
|
|
543
|
+
* // With configuration
|
|
544
|
+
* await algorand.account.ensureFundedUsingDispenserAPI("ACCOUNTADDRESS", algorand.client.getTestNetDispenserFromEnvironment(), algokit.algo(1),
|
|
545
|
+
* { minFundingIncrement: algokit.algo(2) }
|
|
546
|
+
* )
|
|
547
|
+
* ```
|
|
548
|
+
* @returns
|
|
549
|
+
* - The result of executing the dispensing transaction and the `amountFunded` if funds were needed.
|
|
550
|
+
* - `undefined` if no funds were needed.
|
|
551
|
+
*/
|
|
552
|
+
async ensureFundedFromTestNetDispenserApi(accountToFund, dispenserClient, minSpendingBalance, options) {
|
|
553
|
+
if (!(await this._clientManager.isTestNet())) {
|
|
554
|
+
throw new Error('Attempt to fund using TestNet dispenser API on non TestNet network.');
|
|
555
|
+
}
|
|
556
|
+
const addressToFund = typeof accountToFund === 'string' ? accountToFund : accountToFund.addr;
|
|
557
|
+
const amountFunded = await this._getEnsureFundedAmount(addressToFund, minSpendingBalance, options?.minFundingIncrement);
|
|
558
|
+
if (!amountFunded)
|
|
559
|
+
return undefined;
|
|
560
|
+
const result = await dispenserClient.fund(addressToFund, amountFunded.microAlgo);
|
|
561
|
+
return {
|
|
562
|
+
amountFunded: types_amount.AlgoAmount.MicroAlgo(result.amount),
|
|
563
|
+
transactionId: result.txId,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
393
566
|
}
|
|
394
567
|
|
|
395
568
|
exports.AccountManager = AccountManager;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-manager.js","sources":["../../src/types/account-manager.ts"],"sourcesContent":[null],"names":["KmdAccountManager","SigningAccount","MultisigAccount","DISPENSER_ACCOUNT"],"mappings":"
|
|
1
|
+
{"version":3,"file":"account-manager.js","sources":["../../src/types/account-manager.ts"],"sourcesContent":[null],"names":["memoize","KmdAccountManager","AlgoKitComposer","AlgoAmount","SigningAccount","MultisigAccount","DISPENSER_ACCOUNT","Config","calculateFundAmount"],"mappings":";;;;;;;;;;AAUA,IAAO,eAAe,GAAG,OAAO,CAAC,eAAe,CAAA;AAGhD,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAUzD;;;;;AAKG;AACU,MAAA,2BAA2B,GAAGA,YAAO,CAAC,UACjD,OAAgG,EAAA;IAEhG,OAAO,QAAQ,IAAI,OAAO;UACtB,OAAO,CAAC,MAAM;UACd,MAAM,IAAI,OAAO;AACjB,cAAE,OAAO,CAAC,oCAAoC,CAAC,OAAO,CAAC;AACvD,cAAE,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAA;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