@algorandfoundation/algokit-utils 9.2.1 → 9.2.2

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.
Files changed (75) hide show
  1. package/account/account.d.ts +28 -23
  2. package/account/get-account-config-from-environment.d.ts +2 -7
  3. package/account/get-account.d.ts +12 -14
  4. package/account/get-dispenser-account.d.ts +5 -9
  5. package/account/index.d.ts +5 -0
  6. package/account/mnemonic-account.d.ts +3 -7
  7. package/amount.d.ts +35 -40
  8. package/app-client.d.ts +6 -10
  9. package/app-deploy.d.ts +23 -25
  10. package/app.d.ts +46 -45
  11. package/asset.d.ts +12 -16
  12. package/config.d.ts +2 -7
  13. package/debugging/debugging.d.ts +1 -5
  14. package/debugging/index.d.ts +1 -0
  15. package/dispenser-client.d.ts +2 -7
  16. package/index.d.ts +18 -27
  17. package/indexer-lookup.d.ts +11 -18
  18. package/localnet/get-kmd-wallet-account.d.ts +7 -9
  19. package/localnet/get-localnet-dispenser-account.d.ts +5 -7
  20. package/localnet/get-or-create-kmd-wallet-account.d.ts +8 -10
  21. package/localnet/index.d.ts +4 -0
  22. package/localnet/is-localnet.d.ts +3 -7
  23. package/network-client.d.ts +15 -17
  24. package/package.json +1 -1
  25. package/testing/_asset.d.ts +3 -0
  26. package/testing/account.d.ts +9 -11
  27. package/testing/fixtures/algokit-log-capture-fixture.d.ts +2 -7
  28. package/testing/fixtures/algorand-fixture.d.ts +4 -9
  29. package/testing/fixtures/index.d.ts +2 -0
  30. package/testing/index.d.ts +5 -7
  31. package/testing/indexer.d.ts +1 -5
  32. package/testing/test-logger.d.ts +36 -41
  33. package/testing/transaction-logger.d.ts +27 -30
  34. package/transaction/index.d.ts +2 -0
  35. package/transaction/legacy-bridge.d.ts +35 -0
  36. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +5 -7
  37. package/transaction/resolve-signed-transactions.d.ts +16 -0
  38. package/transaction/transaction.d.ts +35 -34
  39. package/transfer/index.d.ts +2 -0
  40. package/transfer/transfer-algos.d.ts +5 -9
  41. package/transfer/transfer.d.ts +8 -11
  42. package/types/account-manager.d.ts +429 -432
  43. package/types/account.d.ts +202 -192
  44. package/types/algo-http-client-with-retry.d.ts +10 -15
  45. package/types/algorand-client-transaction-creator.d.ts +771 -778
  46. package/types/algorand-client-transaction-sender.d.ts +1085 -1090
  47. package/types/algorand-client.d.ts +236 -239
  48. package/types/amount.d.ts +43 -47
  49. package/types/app-arc56.d.ts +272 -235
  50. package/types/app-client.d.ts +1151 -1128
  51. package/types/app-deployer.d.ts +141 -139
  52. package/types/app-factory.d.ts +783 -762
  53. package/types/app-manager.d.ts +310 -304
  54. package/types/app-spec.d.ts +117 -118
  55. package/types/app.d.ts +241 -229
  56. package/types/asset-manager.d.ts +199 -204
  57. package/types/asset.d.ts +91 -95
  58. package/types/async-event-emitter.d.ts +13 -18
  59. package/types/client-manager.d.ts +451 -453
  60. package/types/composer.d.ts +1257 -1210
  61. package/types/config.d.ts +48 -53
  62. package/types/debugging.d.ts +23 -25
  63. package/types/dispenser-client.d.ts +52 -57
  64. package/types/expand.d.ts +3 -5
  65. package/types/indexer.d.ts +66 -70
  66. package/types/instance-of.d.ts +3 -5
  67. package/types/kmd-account-manager.d.ts +70 -75
  68. package/types/lifecycle-events.d.ts +8 -13
  69. package/types/logging.d.ts +11 -15
  70. package/types/logic-error.d.ts +29 -33
  71. package/types/network-client.d.ts +27 -32
  72. package/types/testing.d.ts +132 -131
  73. package/types/transaction.d.ts +110 -110
  74. package/types/transfer.d.ts +66 -70
  75. package/util.d.ts +48 -0
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "**"
7
7
  ],
8
8
  "name": "@algorandfoundation/algokit-utils",
9
- "version": "9.2.1",
9
+ "version": "9.2.2",
10
10
  "private": false,
11
11
  "description": "A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand.",
12
12
  "author": "Algorand Foundation",
@@ -0,0 +1,3 @@
1
+ import { Address } from 'algosdk';
2
+ import { AlgorandClient } from '../types/algorand-client';
3
+ export declare function generateTestAsset(algorand: AlgorandClient, sender: Address | string, total?: number): Promise<bigint>;
@@ -1,9 +1,10 @@
1
- import { TransactionSignerAccount } from "../types/account.js";
2
- import { AlgorandClient } from "../types/algorand-client.js";
3
- import { GetTestAccountParams } from "../types/testing.js";
4
- import algosdk, { Address } from "algosdk";
5
-
6
- //#region src/testing/account.d.ts
1
+ import algosdk, { Address } from 'algosdk';
2
+ import { AlgorandClient } from '../';
3
+ import { TransactionSignerAccount } from '../types/account';
4
+ import { GetTestAccountParams } from '../types/testing';
5
+ import Account = algosdk.Account;
6
+ import Algodv2 = algosdk.Algodv2;
7
+ import Kmd = algosdk.Kmd;
7
8
  /**
8
9
  * @deprecated Use `getTestAccount(params, algorandClient)` instead. The `algorandClient` object can be created using `AlgorandClient.fromClients({ algod, kmd })`.
9
10
  *
@@ -16,7 +17,7 @@ import algosdk, { Address } from "algosdk";
16
17
  * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables and if not found fallback to the default LocalNet KMD client
17
18
  * @returns The account, with private key loaded
18
19
  */
19
- declare function getTestAccount(params: GetTestAccountParams, algod: Algodv2, kmd?: Kmd): Promise<Address & Account & TransactionSignerAccount>;
20
+ export declare function getTestAccount(params: GetTestAccountParams, algod: Algodv2, kmd?: Kmd): Promise<Address & Account & TransactionSignerAccount>;
20
21
  /**
21
22
  * Creates an ephemeral Algorand account for the purposes of testing.
22
23
  * Returns a newly created random test account that is funded from the dispenser
@@ -26,7 +27,4 @@ declare function getTestAccount(params: GetTestAccountParams, algod: Algodv2, km
26
27
  * @param algorand An AlgorandClient client
27
28
  * @returns The account, with private key loaded
28
29
  */
29
- declare function getTestAccount(params: GetTestAccountParams, algorand: AlgorandClient): Promise<Address & Account & TransactionSignerAccount>;
30
- //#endregion
31
- export { getTestAccount };
32
- //# sourceMappingURL=account.d.ts.map
30
+ export declare function getTestAccount(params: GetTestAccountParams, algorand: AlgorandClient): Promise<Address & Account & TransactionSignerAccount>;
@@ -1,6 +1,4 @@
1
- import { AlgoKitLogCaptureFixture } from "../../types/testing.js";
2
-
3
- //#region src/testing/fixtures/algokit-log-capture-fixture.d.ts
1
+ import { AlgoKitLogCaptureFixture } from '../../types/testing';
4
2
  /**
5
3
  * Creates a test fixture for capturing AlgoKit logs.
6
4
  *
@@ -18,7 +16,4 @@ import { AlgoKitLogCaptureFixture } from "../../types/testing.js";
18
16
  *
19
17
  * @returns The fixture
20
18
  */
21
- declare const algoKitLogCaptureFixture: () => AlgoKitLogCaptureFixture;
22
- //#endregion
23
- export { algoKitLogCaptureFixture };
24
- //# sourceMappingURL=algokit-log-capture-fixture.d.ts.map
19
+ export declare const algoKitLogCaptureFixture: () => AlgoKitLogCaptureFixture;
@@ -1,7 +1,5 @@
1
- import { AlgoConfig } from "../../types/network-client.js";
2
- import { AlgorandFixture, AlgorandFixtureConfig } from "../../types/testing.js";
3
-
4
- //#region src/testing/fixtures/algorand-fixture.d.ts
1
+ import { AlgoConfig } from '../../types/network-client';
2
+ import { AlgorandFixture, AlgorandFixtureConfig } from '../../types/testing';
5
3
  /**
6
4
  * Creates a test fixture for automated testing against Algorand.
7
5
  * By default it tests against an environment variable specified client
@@ -52,7 +50,7 @@ import { AlgorandFixture, AlgorandFixtureConfig } from "../../types/testing.js";
52
50
  * @param fixtureConfig The fixture configuration
53
51
  * @returns The fixture
54
52
  */
55
- declare function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): AlgorandFixture;
53
+ export declare function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): AlgorandFixture;
56
54
  /**
57
55
  * @deprecated Config can be passed in directly to fixture config now.
58
56
  *
@@ -66,7 +64,4 @@ declare function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): Algoran
66
64
  * @param config The fixture configuration
67
65
  * @returns The fixture
68
66
  */
69
- declare function algorandFixture(fixtureConfig: AlgorandFixtureConfig | undefined, config: AlgoConfig): AlgorandFixture;
70
- //#endregion
71
- export { algorandFixture };
72
- //# sourceMappingURL=algorand-fixture.d.ts.map
67
+ export declare function algorandFixture(fixtureConfig: AlgorandFixtureConfig | undefined, config: AlgoConfig): AlgorandFixture;
@@ -0,0 +1,2 @@
1
+ export * from './algokit-log-capture-fixture';
2
+ export * from './algorand-fixture';
@@ -1,7 +1,5 @@
1
- import { TestLogger } from "./test-logger.js";
2
- import { getTestAccount } from "./account.js";
3
- import { algoKitLogCaptureFixture } from "./fixtures/algokit-log-capture-fixture.js";
4
- import { algorandFixture } from "./fixtures/algorand-fixture.js";
5
- import { runWhenIndexerCaughtUp } from "./indexer.js";
6
- import { TransactionLogger } from "./transaction-logger.js";
7
- export { TestLogger, TransactionLogger, algoKitLogCaptureFixture, algorandFixture, getTestAccount, runWhenIndexerCaughtUp };
1
+ export * from './account';
2
+ export * from './fixtures';
3
+ export * from './indexer';
4
+ export * from './test-logger';
5
+ export * from './transaction-logger';
@@ -1,4 +1,3 @@
1
- //#region src/testing/indexer.d.ts
2
1
  /**
3
2
  * Runs the given indexer call until a 404 error is no longer returned.
4
3
  * Tried every 200ms up to 100 times.
@@ -10,7 +9,4 @@
10
9
  * @param run The code to run
11
10
  * @returns The result (as a promise), or throws if the indexer didn't catch up in time
12
11
  */
13
- declare function runWhenIndexerCaughtUp<T>(run: () => Promise<T>): Promise<T>;
14
- //#endregion
15
- export { runWhenIndexerCaughtUp };
16
- //# sourceMappingURL=indexer.d.ts.map
12
+ export declare function runWhenIndexerCaughtUp<T>(run: () => Promise<T>): Promise<T>;
@@ -1,45 +1,40 @@
1
- import { Logger } from "../types/logging.js";
2
- import { LogSnapshotConfig } from "../types/testing.js";
3
-
4
- //#region src/testing/test-logger.d.ts
1
+ import { Logger } from '../types/logging';
2
+ import { LogSnapshotConfig } from '../types/testing';
5
3
  /** Exposes an AlgoKit logger which captures log messages, while wrapping an original logger.
6
4
  * This is useful for automated testing.
7
5
  */
8
- declare class TestLogger implements Logger {
9
- private originalLogger;
10
- private logs;
11
- /**
12
- * Create a new test logger that wraps the given logger if provided.
13
- * @param originalLogger The optional original logger to wrap.
14
- */
15
- constructor(originalLogger?: Logger);
16
- /** Returns all logs captured thus far. */
17
- get capturedLogs(): string[];
18
- /** Clears all logs captured so far. */
19
- clear(): void;
20
- /**
21
- * Returns a captured log snapshot.
22
- * This helps ensure that the provided configuration items won't appear
23
- * with random values in the log snapshot, but rather will get substituted with predictable ids.
24
- *
25
- * https://jestjs.io/docs/snapshot-testing#2-tests-should-be-deterministic
26
- *
27
- * @example Jest Example
28
- * ```typescript
29
- * const logger = new TestLogger()
30
- * ...
31
- * expect(logger.getLogSnapshot()).toMatchSnapshot()
32
- * ```
33
- * @param config The snapshot configuration
34
- * @returns The snapshotted logs.
35
- */
36
- getLogSnapshot(config?: LogSnapshotConfig): string;
37
- error(message: string, ...optionalParams: unknown[]): void;
38
- warn(message: string, ...optionalParams: unknown[]): void;
39
- info(message: string, ...optionalParams: unknown[]): void;
40
- verbose(message: string, ...optionalParams: unknown[]): void;
41
- debug(message: string, ...optionalParams: unknown[]): void;
6
+ export declare class TestLogger implements Logger {
7
+ private originalLogger;
8
+ private logs;
9
+ /**
10
+ * Create a new test logger that wraps the given logger if provided.
11
+ * @param originalLogger The optional original logger to wrap.
12
+ */
13
+ constructor(originalLogger?: Logger);
14
+ /** Returns all logs captured thus far. */
15
+ get capturedLogs(): string[];
16
+ /** Clears all logs captured so far. */
17
+ clear(): void;
18
+ /**
19
+ * Returns a captured log snapshot.
20
+ * This helps ensure that the provided configuration items won't appear
21
+ * with random values in the log snapshot, but rather will get substituted with predictable ids.
22
+ *
23
+ * https://jestjs.io/docs/snapshot-testing#2-tests-should-be-deterministic
24
+ *
25
+ * @example Jest Example
26
+ * ```typescript
27
+ * const logger = new TestLogger()
28
+ * ...
29
+ * expect(logger.getLogSnapshot()).toMatchSnapshot()
30
+ * ```
31
+ * @param config The snapshot configuration
32
+ * @returns The snapshotted logs.
33
+ */
34
+ getLogSnapshot(config?: LogSnapshotConfig): string;
35
+ error(message: string, ...optionalParams: unknown[]): void;
36
+ warn(message: string, ...optionalParams: unknown[]): void;
37
+ info(message: string, ...optionalParams: unknown[]): void;
38
+ verbose(message: string, ...optionalParams: unknown[]): void;
39
+ debug(message: string, ...optionalParams: unknown[]): void;
42
40
  }
43
- //#endregion
44
- export { TestLogger };
45
- //# sourceMappingURL=test-logger.d.ts.map
@@ -1,35 +1,32 @@
1
- import algosdk from "algosdk";
2
-
3
- //#region src/testing/transaction-logger.d.ts
1
+ import algosdk from 'algosdk';
2
+ import Algodv2 = algosdk.Algodv2;
3
+ import Indexer = algosdk.Indexer;
4
4
  /**
5
5
  * Allows you to keep track of Algorand transaction IDs by wrapping an `Algodv2` in a proxy.
6
6
  * Useful for automated tests.
7
7
  */
8
- declare class TransactionLogger {
9
- private _sentTransactionIds;
10
- private _latestLastValidRound?;
11
- private _pushTxn;
12
- /**
13
- * The list of transaction IDs that has been logged thus far.
14
- */
15
- get sentTransactionIds(): Readonly<string[]>;
16
- /**
17
- * Clear all logged IDs.
18
- */
19
- clear(): void;
20
- /**
21
- * The method that captures raw transactions and stores the transaction IDs.
22
- */
23
- logRawTransaction(signedTransactions: Uint8Array | Uint8Array[]): void;
24
- /** Return a proxy that wraps the given Algodv2 with this transaction logger.
25
- *
26
- * @param algod The `Algodv2` to wrap
27
- * @returns The wrapped `Algodv2`, any transactions sent using this algod instance will be logged by this transaction logger
28
- */
29
- capture(algod: Algodv2): Algodv2;
30
- /** Wait until all logged transactions IDs appear in the given `Indexer`. */
31
- waitForIndexer(indexer: Indexer): Promise<void>;
8
+ export declare class TransactionLogger {
9
+ private _sentTransactionIds;
10
+ private _latestLastValidRound?;
11
+ private _pushTxn;
12
+ /**
13
+ * The list of transaction IDs that has been logged thus far.
14
+ */
15
+ get sentTransactionIds(): Readonly<string[]>;
16
+ /**
17
+ * Clear all logged IDs.
18
+ */
19
+ clear(): void;
20
+ /**
21
+ * The method that captures raw transactions and stores the transaction IDs.
22
+ */
23
+ logRawTransaction(signedTransactions: Uint8Array | Uint8Array[]): void;
24
+ /** Return a proxy that wraps the given Algodv2 with this transaction logger.
25
+ *
26
+ * @param algod The `Algodv2` to wrap
27
+ * @returns The wrapped `Algodv2`, any transactions sent using this algod instance will be logged by this transaction logger
28
+ */
29
+ capture(algod: Algodv2): Algodv2;
30
+ /** Wait until all logged transactions IDs appear in the given `Indexer`. */
31
+ waitForIndexer(indexer: Indexer): Promise<void>;
32
32
  }
33
- //#endregion
34
- export { TransactionLogger };
35
- //# sourceMappingURL=transaction-logger.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './perform-atomic-transaction-composer-simulate';
2
+ export * from './transaction';
@@ -0,0 +1,35 @@
1
+ import algosdk from 'algosdk';
2
+ import { AlgorandClientTransactionCreator } from '../types/algorand-client-transaction-creator';
3
+ import { AlgorandClientTransactionSender } from '../types/algorand-client-transaction-sender';
4
+ import { ABIAppCallArgs, BoxIdentifier as LegacyBoxIdentifier, BoxReference as LegacyBoxReference, RawAppCallArgs } from '../types/app';
5
+ import { AppCallMethodCall, AppCallParams, AppCreateMethodCall, AppCreateParams, AppDeleteMethodCall, AppDeleteParams, AppUpdateMethodCall, AppUpdateParams, BuiltTransactions, CommonTransactionParams } from '../types/composer';
6
+ import { SendParams, SendSingleTransactionResult, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionNote } from '../types/transaction';
7
+ import Algodv2 = algosdk.Algodv2;
8
+ import Transaction = algosdk.Transaction;
9
+ /** @deprecated Bridges between legacy `sendTransaction` behaviour and new `AlgorandClient` behaviour. */
10
+ export declare function legacySendTransactionBridge<T extends CommonTransactionParams, TResult extends SendSingleTransactionResult>(algod: Algodv2, from: SendTransactionFrom, sendParams: SendTransactionParams, params: T, txn: ((c: AlgorandClientTransactionCreator) => (params: T) => Promise<Transaction>) | ((c: AlgorandClientTransactionCreator) => (params: T) => Promise<BuiltTransactions>), send: (c: AlgorandClientTransactionSender) => (params: T & SendParams) => Promise<TResult>, suggestedParams?: algosdk.SuggestedParams): Promise<(SendTransactionResult | TResult) & {
11
+ transactions: Transaction[];
12
+ }>;
13
+ /** @deprecated Bridges between legacy `sendTransaction` behaviour for app transactions and new `AlgorandClient` behaviour. */
14
+ export declare function legacySendAppTransactionBridge<T extends AppCreateParams | AppUpdateParams | AppDeleteParams | AppCallParams | AppCreateMethodCall | AppUpdateMethodCall | AppDeleteMethodCall | AppCallMethodCall, TResult extends SendSingleTransactionResult>(algod: Algodv2, from: SendTransactionFrom, appArgs: RawAppCallArgs | ABIAppCallArgs | undefined, sendParams: SendTransactionParams & {
15
+ note?: TransactionNote;
16
+ }, params: Omit<T, 'accountReferences' | 'appReferences' | 'assetReferences' | 'boxReferences' | 'args' | 'lease' | 'rekeyTo' | 'note'>, txn: ((c: AlgorandClientTransactionCreator) => (params: T) => Promise<Transaction>) | ((c: AlgorandClientTransactionCreator) => (params: T) => Promise<BuiltTransactions>), send: (c: AlgorandClientTransactionSender) => (params: T & SendParams) => Promise<TResult>, suggestedParams?: algosdk.SuggestedParams): Promise<(SendTransactionResult | TResult) & {
17
+ transactions: Transaction[];
18
+ }>;
19
+ /**
20
+ * @deprecated
21
+ */
22
+ export declare function _getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom): Promise<{
23
+ method: algosdk.ABIMethod;
24
+ sender: string;
25
+ signer: algosdk.TransactionSigner;
26
+ boxes: algosdk.BoxReference[] | undefined;
27
+ lease: Uint8Array<ArrayBufferLike> | undefined;
28
+ appForeignApps: number[] | undefined;
29
+ appForeignAssets: number[] | undefined;
30
+ appAccounts: string[] | undefined;
31
+ methodArgs: (string | number | bigint | boolean | algosdk.Address | Uint8Array<ArrayBufferLike> | algosdk.ABIValue[] | algosdk.TransactionWithSigner)[];
32
+ rekeyTo: string | undefined;
33
+ }>;
34
+ /** @deprecated */
35
+ export declare function _getBoxReference(box: LegacyBoxIdentifier | LegacyBoxReference | algosdk.BoxReference): algosdk.BoxReference;
@@ -1,6 +1,7 @@
1
- import algosdk from "algosdk";
2
-
3
- //#region src/transaction/perform-atomic-transaction-composer-simulate.d.ts
1
+ import algosdk from 'algosdk';
2
+ import Algodv2 = algosdk.Algodv2;
3
+ import AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
4
+ import modelsv2 = algosdk.modelsv2;
4
5
  /**
5
6
  * Performs a simulation of the transactions loaded into the given AtomicTransactionComposer.
6
7
  * Uses empty transaction signers for all transactions.
@@ -9,7 +10,4 @@ import algosdk from "algosdk";
9
10
  * @param algod An Algod client to perform the simulation.
10
11
  * @returns The simulation result, which includes various details about how the transactions would be processed.
11
12
  */
12
- declare function performAtomicTransactionComposerSimulate(atc: AtomicTransactionComposer, algod: Algodv2, options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>): Promise<algosdk.modelsv2.SimulateResponse>;
13
- //#endregion
14
- export { performAtomicTransactionComposerSimulate };
15
- //# sourceMappingURL=perform-atomic-transaction-composer-simulate.d.ts.map
13
+ export declare function performAtomicTransactionComposerSimulate(atc: AtomicTransactionComposer, algod: Algodv2, options?: Omit<ConstructorParameters<typeof modelsv2.SimulateRequest>[0], 'txnGroups'>): Promise<algosdk.modelsv2.SimulateResponse>;
@@ -0,0 +1,16 @@
1
+ import algosdk from 'algosdk';
2
+ import Transaction = algosdk.Transaction;
3
+ /**
4
+ * Resolve the transactions as they were signed.
5
+ *
6
+ * Signers (e.g. wallets) can mutate the transactions they are given, so the signed transactions are the source of truth
7
+ * for what is actually sent to the network. Without this, a mutated transaction would be reported (and waited for)
8
+ * under the transaction ID of the transaction that was built, which was never sent.
9
+ *
10
+ * The built transaction is returned when it wasn't mutated, so callers keep the exact transaction they built.
11
+ *
12
+ * @param builtTransactions The transactions that were given to the signers
13
+ * @param encodedSignedTransactions The signed transactions returned by the signers
14
+ * @returns The transactions as they were signed
15
+ */
16
+ export declare function resolveSignedTransactions(builtTransactions: Transaction[], encodedSignedTransactions: Uint8Array[]): Transaction[];
@@ -1,12 +1,16 @@
1
- import { AlgoAmount } from "../types/amount.js";
2
- import { ABIReturn } from "../types/app.js";
3
- import { AdditionalAtomicTransactionComposerContext, AtomicTransactionComposerToSend, SendAtomicTransactionComposerResults, SendParams, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionGroupToSend, TransactionNote, TransactionToSign } from "../types/transaction.js";
4
- import algosdk, { ABIReturnType } from "algosdk";
5
-
6
- //#region src/transaction/transaction.d.ts
7
- declare const MAX_TRANSACTION_GROUP_SIZE = 16;
8
- declare const MAX_APP_CALL_FOREIGN_REFERENCES = 8;
9
- declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 8;
1
+ import algosdk, { ABIReturnType } from 'algosdk';
2
+ import { AlgoAmount } from '../types/amount';
3
+ import { ABIReturn } from '../types/app';
4
+ import { AdditionalAtomicTransactionComposerContext, AtomicTransactionComposerToSend, SendAtomicTransactionComposerResults, SendParams, SendTransactionFrom, SendTransactionParams, SendTransactionResult, TransactionGroupToSend, TransactionNote, TransactionToSign } from '../types/transaction';
5
+ import Algodv2 = algosdk.Algodv2;
6
+ import AtomicTransactionComposer = algosdk.AtomicTransactionComposer;
7
+ import modelsv2 = algosdk.modelsv2;
8
+ import SuggestedParams = algosdk.SuggestedParams;
9
+ import Transaction = algosdk.Transaction;
10
+ import TransactionWithSigner = algosdk.TransactionWithSigner;
11
+ export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
12
+ export declare const MAX_APP_CALL_FOREIGN_REFERENCES = 8;
13
+ export declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 8;
10
14
  /**
11
15
  * @deprecated Convert your data to a `string` or `Uint8Array`, if using ARC-2 use `TransactionComposer.arc2Note`.
12
16
  *
@@ -22,7 +26,7 @@ declare const MAX_APP_CALL_ACCOUNT_REFERENCES = 8;
22
26
  * * Arc2TransactionNote object: ARC-0002 compatible transaction note
23
27
  * * Else: The object/value converted into a JSON string representation
24
28
  */
25
- declare function encodeTransactionNote(note?: TransactionNote): Uint8Array | undefined;
29
+ export declare function encodeTransactionNote(note?: TransactionNote): Uint8Array | undefined;
26
30
  /** Encodes a transaction lease into a 32-byte array ready to be included in an Algorand transaction.
27
31
  *
28
32
  * @param lease The transaction lease as a string or binary array or null/undefined if there is no lease
@@ -31,7 +35,7 @@ declare function encodeTransactionNote(note?: TransactionNote): Uint8Array | und
31
35
  * @example algokit.encodeLease('UNIQUE_ID')
32
36
  * @example algokit.encodeLease(new Uint8Array([1, 2, 3]))
33
37
  */
34
- declare function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined;
38
+ export declare function encodeLease(lease?: string | Uint8Array): Uint8Array | undefined;
35
39
  /**
36
40
  * @deprecated Use `algorand.client` to interact with accounts, and use `.addr` to get the address
37
41
  * and/or move from using `SendTransactionFrom` to `TransactionSignerAccount` and use `.addr` instead.
@@ -40,7 +44,7 @@ declare function encodeLease(lease?: string | Uint8Array): Uint8Array | undefine
40
44
  * @param sender A transaction sender
41
45
  * @returns The public address
42
46
  */
43
- declare const getSenderAddress: (sender: string | SendTransactionFrom) => string;
47
+ export declare const getSenderAddress: (sender: string | SendTransactionFrom) => string;
44
48
  /**
45
49
  * @deprecated Use `AlgorandClient` / `TransactionComposer` to construct transactions instead or
46
50
  * construct an `algosdk.TransactionWithSigner` manually instead.
@@ -54,7 +58,7 @@ declare const getSenderAddress: (sender: string | SendTransactionFrom) => string
54
58
  * include a signer.
55
59
  * @returns A TransactionWithSigner object.
56
60
  */
57
- declare const getTransactionWithSigner: (transaction: TransactionWithSigner | TransactionToSign | Transaction | Promise<SendTransactionResult>, defaultSender?: SendTransactionFrom) => Promise<TransactionWithSigner>;
61
+ export declare const getTransactionWithSigner: (transaction: TransactionWithSigner | TransactionToSign | Transaction | Promise<SendTransactionResult>, defaultSender?: SendTransactionFrom) => Promise<TransactionWithSigner>;
58
62
  /**
59
63
  * @deprecated Use `TransactionSignerAccount` instead of `SendTransactionFrom` or use
60
64
  * `algosdk.makeBasicAccountTransactionSigner` / `algosdk.makeLogicSigAccountTransactionSigner`.
@@ -64,7 +68,7 @@ declare const getTransactionWithSigner: (transaction: TransactionWithSigner | Tr
64
68
  * @param sender A transaction sender
65
69
  * @returns A transaction signer
66
70
  */
67
- declare const getSenderTransactionSigner: (val: SendTransactionFrom) => algosdk.TransactionSigner;
71
+ export declare const getSenderTransactionSigner: (val: SendTransactionFrom) => algosdk.TransactionSigner;
68
72
  /**
69
73
  * @deprecated Use `AlgorandClient` / `TransactionComposer` to sign transactions
70
74
  * or use the relevant underlying `account.signTxn` / `algosdk.signLogicSigTransactionObject`
@@ -75,7 +79,7 @@ declare const getSenderTransactionSigner: (val: SendTransactionFrom) => algosdk.
75
79
  * @param signer The signer to sign
76
80
  * @returns The signed transaction as a `Uint8Array`
77
81
  */
78
- declare const signTransaction: (transaction: Transaction, signer: SendTransactionFrom) => Promise<Uint8Array<ArrayBufferLike>>;
82
+ export declare const signTransaction: (transaction: Transaction, signer: SendTransactionFrom) => Promise<Uint8Array<ArrayBufferLike>>;
79
83
  /**
80
84
  * @deprecated Use `AlgorandClient` / `TransactionComposer` to send transactions.
81
85
  *
@@ -89,10 +93,10 @@ declare const signTransaction: (transaction: Transaction, signer: SendTransactio
89
93
  *
90
94
  * @returns An object with transaction (`transaction`) and (if `skipWaiting` is `false` or `undefined`) confirmation (`confirmation`)
91
95
  */
92
- declare const sendTransaction: (send: {
93
- transaction: Transaction;
94
- from: SendTransactionFrom;
95
- sendParams?: SendTransactionParams;
96
+ export declare const sendTransaction: (send: {
97
+ transaction: Transaction;
98
+ from: SendTransactionFrom;
99
+ sendParams?: SendTransactionParams;
96
100
  }, algod: Algodv2) => Promise<SendTransactionResult>;
97
101
  /**
98
102
  * Take an existing Atomic Transaction Composer and return a new one with the required
@@ -111,7 +115,7 @@ declare const sendTransaction: (send: {
111
115
  * See https://github.com/algorand/go-algorand/pull/5684
112
116
  *
113
117
  */
114
- declare function populateAppCallResources(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2): Promise<algosdk.AtomicTransactionComposer>;
118
+ export declare function populateAppCallResources(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2): Promise<algosdk.AtomicTransactionComposer>;
115
119
  /**
116
120
  * Take an existing Atomic Transaction Composer and return a new one with changes applied to the transactions
117
121
  * based on the supplied sendParams to prepare it for sending.
@@ -127,20 +131,20 @@ declare function populateAppCallResources(atc: algosdk.AtomicTransactionComposer
127
131
  * Parts of this function will eventually be implemented in algod. Namely:
128
132
  * - Simulate will return information on how to populate reference arrays, see https://github.com/algorand/go-algorand/pull/6015
129
133
  */
130
- declare function prepareGroupForSending(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2, sendParams: SendParams, additionalAtcContext?: AdditionalAtomicTransactionComposerContext): Promise<algosdk.AtomicTransactionComposer>;
134
+ export declare function prepareGroupForSending(atc: algosdk.AtomicTransactionComposer, algod: algosdk.Algodv2, sendParams: SendParams, additionalAtcContext?: AdditionalAtomicTransactionComposerContext): Promise<algosdk.AtomicTransactionComposer>;
131
135
  /**
132
136
  * Signs and sends transactions that have been collected by an `AtomicTransactionComposer`.
133
137
  * @param atcSend The parameters controlling the send, including `atc` The `AtomicTransactionComposer` and params to control send behaviour
134
138
  * @param algod An algod client
135
139
  * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)
136
140
  */
137
- declare const sendAtomicTransactionComposer: (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) => Promise<SendAtomicTransactionComposerResults>;
141
+ export declare const sendAtomicTransactionComposer: (atcSend: AtomicTransactionComposerToSend, algod: Algodv2) => Promise<SendAtomicTransactionComposerResults>;
138
142
  /**
139
143
  * Takes an algosdk `ABIResult` and converts it to an `ABIReturn`.
140
144
  * Converts `bigint`'s for Uint's < 64 to `number` for easier use.
141
145
  * @param result The `ABIReturn`
142
146
  */
143
- declare function getABIReturnValue(result: algosdk.ABIResult, type: ABIReturnType): ABIReturn;
147
+ export declare function getABIReturnValue(result: algosdk.ABIResult, type: ABIReturnType): ABIReturn;
144
148
  /**
145
149
  * @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.
146
150
  *
@@ -152,7 +156,7 @@ declare function getABIReturnValue(result: algosdk.ABIResult, type: ABIReturnTyp
152
156
  * @param algod An algod client
153
157
  * @returns An object with transaction IDs, transactions, group transaction ID (`groupTransactionId`) if more than 1 transaction sent, and (if `skipWaiting` is `false` or unset) confirmation (`confirmation`)
154
158
  */
155
- declare const sendGroupOfTransactions: (groupSend: TransactionGroupToSend, algod: Algodv2) => Promise<Omit<SendAtomicTransactionComposerResults, "returns">>;
159
+ export declare const sendGroupOfTransactions: (groupSend: TransactionGroupToSend, algod: Algodv2) => Promise<Omit<SendAtomicTransactionComposerResults, "returns">>;
156
160
  /**
157
161
  * Wait until the transaction is confirmed or rejected, or until `timeout`
158
162
  * number of rounds have passed.
@@ -164,7 +168,7 @@ declare const sendGroupOfTransactions: (groupSend: TransactionGroupToSend, algod
164
168
  * @return Pending transaction information
165
169
  * @throws Throws an error if the transaction is not confirmed or rejected in the next `timeout` rounds
166
170
  */
167
- declare const waitForConfirmation: (transactionId: string, maxRoundsToWait: number | bigint, algod: Algodv2) => Promise<modelsv2.PendingTransactionResponse>;
171
+ export declare const waitForConfirmation: (transactionId: string, maxRoundsToWait: number | bigint, algod: Algodv2) => Promise<modelsv2.PendingTransactionResponse>;
168
172
  /**
169
173
  * @deprecated Use `TransactionComposer` and the `maxFee` field in the transaction params instead.
170
174
  *
@@ -174,7 +178,7 @@ declare const waitForConfirmation: (transactionId: string, maxRoundsToWait: numb
174
178
  * @param transaction The transaction to cap or suggested params object about to be used to create a transaction
175
179
  * @param maxAcceptableFee The maximum acceptable fee to pay
176
180
  */
177
- declare function capTransactionFee(transaction: algosdk.Transaction | SuggestedParams, maxAcceptableFee: AlgoAmount): void;
181
+ export declare function capTransactionFee(transaction: algosdk.Transaction | SuggestedParams, maxAcceptableFee: AlgoAmount): void;
178
182
  /**
179
183
  * @deprecated Use `TransactionComposer` and the `maxFee` and `staticFee` fields in the transaction params instead.
180
184
  *
@@ -182,9 +186,9 @@ declare function capTransactionFee(transaction: algosdk.Transaction | SuggestedP
182
186
  * @param transaction The transaction or suggested params
183
187
  * @param feeControl The fee control parameters
184
188
  */
185
- declare function controlFees<T extends SuggestedParams | Transaction>(transaction: T, feeControl: {
186
- fee?: AlgoAmount;
187
- maxFee?: AlgoAmount;
189
+ export declare function controlFees<T extends SuggestedParams | Transaction>(transaction: T, feeControl: {
190
+ fee?: AlgoAmount;
191
+ maxFee?: AlgoAmount;
188
192
  }): T;
189
193
  /**
190
194
  * @deprecated Use `suggestedParams ? { ...suggestedParams } : await algod.getTransactionParams().do()` instead
@@ -194,7 +198,7 @@ declare function controlFees<T extends SuggestedParams | Transaction>(transactio
194
198
  * @param algod Algod algod
195
199
  * @returns The suggested transaction parameters
196
200
  */
197
- declare function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<SuggestedParams>;
201
+ export declare function getTransactionParams(params: SuggestedParams | undefined, algod: Algodv2): Promise<SuggestedParams>;
198
202
  /**
199
203
  * @deprecated Use `atc.clone().buildGroup()` instead.
200
204
  *
@@ -202,7 +206,4 @@ declare function getTransactionParams(params: SuggestedParams | undefined, algod
202
206
  * @param atc The atomic transaction composer
203
207
  * @returns The array of transactions with signers
204
208
  */
205
- declare function getAtomicTransactionComposerTransactions(atc: AtomicTransactionComposer): algosdk.TransactionWithSigner[];
206
- //#endregion
207
- export { MAX_APP_CALL_ACCOUNT_REFERENCES, MAX_APP_CALL_FOREIGN_REFERENCES, MAX_TRANSACTION_GROUP_SIZE, capTransactionFee, controlFees, encodeLease, encodeTransactionNote, getABIReturnValue, getAtomicTransactionComposerTransactions, getSenderAddress, getSenderTransactionSigner, getTransactionParams, getTransactionWithSigner, populateAppCallResources, prepareGroupForSending, sendAtomicTransactionComposer, sendGroupOfTransactions, sendTransaction, signTransaction, waitForConfirmation };
208
- //# sourceMappingURL=transaction.d.ts.map
209
+ export declare function getAtomicTransactionComposerTransactions(atc: AtomicTransactionComposer): algosdk.TransactionWithSigner[];
@@ -0,0 +1,2 @@
1
+ export * from './transfer';
2
+ export * from './transfer-algos';
@@ -1,8 +1,7 @@
1
- import { SendTransactionResult } from "../types/transaction.js";
2
- import { AlgoTransferParams } from "../types/transfer.js";
3
- import algosdk from "algosdk";
4
-
5
- //#region src/transfer/transfer-algos.d.ts
1
+ import algosdk from 'algosdk';
2
+ import { SendTransactionResult } from '../types/transaction';
3
+ import { AlgoTransferParams } from '../types/transfer';
4
+ import Algodv2 = algosdk.Algodv2;
6
5
  /**
7
6
  * @deprecated Use `algorand.send.payment()` / `algorand.createTransaction.payment()` instead
8
7
  *
@@ -16,7 +15,4 @@ import algosdk from "algosdk";
16
15
  * await algokit.transferAlgos({ from, to, amount: algokit.algo(1) }, algod)
17
16
  * ```
18
17
  */
19
- declare function transferAlgos(transfer: AlgoTransferParams, algod: Algodv2): Promise<SendTransactionResult>;
20
- //#endregion
21
- export { transferAlgos };
22
- //# sourceMappingURL=transfer-algos.d.ts.map
18
+ export declare function transferAlgos(transfer: AlgoTransferParams, algod: Algodv2): Promise<SendTransactionResult>;
@@ -1,8 +1,8 @@
1
- import { SendTransactionResult } from "../types/transaction.js";
2
- import { AlgoRekeyParams, EnsureFundedParams, EnsureFundedReturnType, TransferAssetParams } from "../types/transfer.js";
3
- import algosdk from "algosdk";
4
-
5
- //#region src/transfer/transfer.d.ts
1
+ import algosdk from 'algosdk';
2
+ import { SendTransactionResult } from '../types/transaction';
3
+ import { AlgoRekeyParams, EnsureFundedParams, EnsureFundedReturnType, TransferAssetParams } from '../types/transfer';
4
+ import Algodv2 = algosdk.Algodv2;
5
+ import Kmd = algosdk.Kmd;
6
6
  /**
7
7
  * @deprecated Use `algorand.account.ensureFunded()` / `algorand.account.ensureFundedFromEnvironment()`
8
8
  * / `algorand.account.ensureFundedFromTestNetDispenserApi()` instead
@@ -18,7 +18,7 @@ import algosdk from "algosdk";
18
18
  * - `EnsureFundedReturnType` if funds were transferred.
19
19
  * - `undefined` if no funds were needed.
20
20
  */
21
- declare function ensureFunded<T extends EnsureFundedParams>(funding: T, algod: Algodv2, kmd?: Kmd): Promise<EnsureFundedReturnType | undefined>;
21
+ export declare function ensureFunded<T extends EnsureFundedParams>(funding: T, algod: Algodv2, kmd?: Kmd): Promise<EnsureFundedReturnType | undefined>;
22
22
  /**
23
23
  * @deprecated Use `algorand.send.assetTransfer()` / `algorand.createTransaction.assetTransfer()` instead
24
24
  *
@@ -32,7 +32,7 @@ declare function ensureFunded<T extends EnsureFundedParams>(funding: T, algod: A
32
32
  * await algokit.transferAsset({ from, to, assetId, amount }, algod)
33
33
  * ```
34
34
  */
35
- declare function transferAsset(transfer: TransferAssetParams, algod: Algodv2): Promise<SendTransactionResult>;
35
+ export declare function transferAsset(transfer: TransferAssetParams, algod: Algodv2): Promise<SendTransactionResult>;
36
36
  /**
37
37
  * @deprecated Use `algorand.account.rekeyAccount()` instead
38
38
  *
@@ -49,7 +49,4 @@ declare function transferAsset(transfer: TransferAssetParams, algod: Algodv2): P
49
49
  * await algokit.rekeyAccount({ from, rekeyTo }, algod)
50
50
  * ```
51
51
  */
52
- declare function rekeyAccount(rekey: AlgoRekeyParams, algod: Algodv2): Promise<SendTransactionResult>;
53
- //#endregion
54
- export { ensureFunded, rekeyAccount, transferAsset };
55
- //# sourceMappingURL=transfer.d.ts.map
52
+ export declare function rekeyAccount(rekey: AlgoRekeyParams, algod: Algodv2): Promise<SendTransactionResult>;