@algorandfoundation/algokit-utils 9.2.1 → 9.2.2-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.
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
@@ -1,209 +1,219 @@
1
- import { AlgoAmount } from "./amount.js";
2
- import algosdk, { Address } from "algosdk";
3
-
4
- //#region src/types/account.d.ts
1
+ import algosdk, { Address } from 'algosdk';
2
+ import { AlgoAmount } from './amount';
3
+ import ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState;
4
+ import ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema;
5
+ import AssetHolding = algosdk.modelsv2.AssetHolding;
6
+ import Application = algosdk.modelsv2.Application;
7
+ import Asset = algosdk.modelsv2.Asset;
8
+ import AccountParticipation = algosdk.modelsv2.AccountParticipation;
9
+ import Account = algosdk.Account;
10
+ import MultisigMetadata = algosdk.MultisigMetadata;
11
+ import Transaction = algosdk.Transaction;
12
+ import TransactionSigner = algosdk.TransactionSigner;
5
13
  /**
6
14
  * The account name identifier used for fund dispensing in test environments
7
15
  */
8
- declare const DISPENSER_ACCOUNT = "DISPENSER";
16
+ export declare const DISPENSER_ACCOUNT = "DISPENSER";
9
17
  /** Account wrapper that supports partial or full multisig signing. */
10
- declare class MultisigAccount {
11
- _params: algosdk.MultisigMetadata;
12
- _signingAccounts: (algosdk.Account | SigningAccount)[];
13
- _addr: Address;
14
- _signer: TransactionSigner;
15
- /** The parameters for the multisig account */
16
- get params(): Readonly<algosdk.MultisigMetadata>;
17
- /** The list of accounts that are present to sign */
18
- get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]>;
19
- /** The address of the multisig account */
20
- get addr(): Readonly<Address>;
21
- /** The transaction signer for the multisig account */
22
- get signer(): TransactionSigner;
23
- constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]);
24
- /**
25
- * Sign the given transaction
26
- * @param transaction Either a transaction object or a raw, partially signed transaction
27
- * @returns The transaction signed by the present signers
28
- * @example
29
- * ```typescript
30
- * const signedTxn = multisigAccount.sign(myTransaction)
31
- * ```
32
- */
33
- sign(transaction: Transaction | Uint8Array): Uint8Array;
18
+ export declare class MultisigAccount {
19
+ _params: algosdk.MultisigMetadata;
20
+ _signingAccounts: (algosdk.Account | SigningAccount)[];
21
+ _addr: Address;
22
+ _signer: TransactionSigner;
23
+ /** The parameters for the multisig account */
24
+ get params(): Readonly<algosdk.MultisigMetadata>;
25
+ /** The list of accounts that are present to sign */
26
+ get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]>;
27
+ /** The address of the multisig account */
28
+ get addr(): Readonly<Address>;
29
+ /** The transaction signer for the multisig account */
30
+ get signer(): TransactionSigner;
31
+ constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]);
32
+ /**
33
+ * Sign the given transaction
34
+ * @param transaction Either a transaction object or a raw, partially signed transaction
35
+ * @returns The transaction signed by the present signers
36
+ * @example
37
+ * ```typescript
38
+ * const signedTxn = multisigAccount.sign(myTransaction)
39
+ * ```
40
+ */
41
+ sign(transaction: Transaction | Uint8Array): Uint8Array;
34
42
  }
35
43
  /** Account wrapper that supports a rekeyed account */
36
- declare class SigningAccount implements Account {
37
- private _account;
38
- private _signer;
39
- private _sender;
40
- /**
41
- * Algorand address of the sender
42
- */
43
- get addr(): Readonly<Address>;
44
- /**
45
- * Secret key belonging to the signer
46
- */
47
- get sk(): Readonly<Uint8Array>;
48
- /**
49
- * Transaction signer for the underlying signing account
50
- */
51
- get signer(): TransactionSigner;
52
- /**
53
- * Algorand account of the sender address and signer private key
54
- */
55
- get sender(): Account;
56
- constructor(account: Account, sender: string | Address | undefined);
44
+ export declare class SigningAccount implements Account {
45
+ private _account;
46
+ private _signer;
47
+ private _sender;
48
+ /**
49
+ * Algorand address of the sender
50
+ */
51
+ get addr(): Readonly<Address>;
52
+ /**
53
+ * Secret key belonging to the signer
54
+ */
55
+ get sk(): Readonly<Uint8Array>;
56
+ /**
57
+ * Transaction signer for the underlying signing account
58
+ */
59
+ get signer(): TransactionSigner;
60
+ /**
61
+ * Algorand account of the sender address and signer private key
62
+ */
63
+ get sender(): Account;
64
+ constructor(account: Account, sender: string | Address | undefined);
57
65
  }
58
66
  /** A wrapper around `TransactionSigner` that also has the sender address. */
59
- interface TransactionSignerAccount {
60
- addr: Readonly<Address>;
61
- signer: TransactionSigner;
67
+ export interface TransactionSignerAccount {
68
+ addr: Readonly<Address>;
69
+ signer: TransactionSigner;
62
70
  }
63
71
  /** Account information at a given round. */
64
- type AccountInformation = {
65
- /**
66
- * The account public key
67
- */
68
- address: Address; /** The balance of Algo currently held by the account. */
69
- balance: AlgoAmount;
70
- /**
71
- * The amount of Algo in the account, without the pending rewards.
72
- */
73
- amountWithoutPendingRewards: AlgoAmount;
74
- /**
75
- * Algo balance required to be held by the account.
76
- *
77
- * The requirement grows based on asset and application usage.
78
- */
79
- minBalance: AlgoAmount;
80
- /**
81
- * Amount of Algo of pending rewards in this account.
82
- */
83
- pendingRewards: AlgoAmount;
84
- /**
85
- * Total rewards of Algo the account has received, including pending
86
- * rewards.
87
- */
88
- rewards: AlgoAmount;
89
- /**
90
- * The round number for which this information is relevant.
91
- */
92
- validAsOfRound: bigint;
93
- /**
94
- * Delegation status of the account's Algo:
95
- * * Offline - indicates that the associated account is delegated.
96
- * * Online - indicates that the associated account used as part of the delegation pool.
97
- * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.
98
- */
99
- status: string;
100
- /**
101
- * The count of all applications that have been opted in, equivalent to the count
102
- * of application local data (AppLocalState objects) stored in this account.
103
- */
104
- totalAppsOptedIn: number;
105
- /**
106
- * The count of all assets that have been opted in, equivalent to the count of
107
- * AssetHolding objects held by this account.
108
- */
109
- totalAssetsOptedIn: number;
110
- /**
111
- * The count of all apps (AppParams objects) created by this account.
112
- */
113
- totalCreatedApps: number;
114
- /**
115
- * The count of all assets (AssetParams objects) created by this account.
116
- */
117
- totalCreatedAssets: number;
118
- /**
119
- * Applications local data stored in this account.
120
- */
121
- appsLocalState?: ApplicationLocalState[];
122
- /**
123
- * The sum of all extra application program pages for this account.
124
- */
125
- appsTotalExtraPages?: number;
126
- /**
127
- * (tsch) stores the sum of all of the local schemas and global schemas in this
128
- * account.
129
- * Note: the raw account uses `StateSchema` for this type.
130
- */
131
- appsTotalSchema?: ApplicationStateSchema;
132
- /**
133
- * Assets held by this account.
134
- */
135
- assets?: AssetHolding[];
136
- /**
137
- * The address against which signing should be checked. If empty, the
138
- * address of the current account is used. This field can be updated in any
139
- * transaction by setting the `RekeyTo` field.
140
- */
141
- authAddr?: Address;
142
- /**
143
- * Parameters of applications created by this account including app global data.
144
- */
145
- createdApps?: Application[];
146
- /**
147
- * (apar) parameters of assets created by this account.
148
- * Note: the raw account uses `map[int] -> Asset` for this type.
149
- */
150
- createdAssets?: Asset[];
151
- /**
152
- * AccountParticipation describes the parameters used by this account in consensus
153
- * protocol.
154
- */
155
- participation?: AccountParticipation;
156
- /**
157
- * Used as part of the rewards computation. Only applicable to accounts
158
- * which are participating.
159
- */
160
- rewardBase?: number;
161
- /**
162
- * Indicates what type of signature is used by this account, must be one of:
163
- * * sig
164
- * * msig
165
- * * lsig
166
- */
167
- sigType?: string;
168
- /**
169
- * The total number of bytes used by this account's app's box keys and
170
- * values.
171
- */
172
- totalBoxBytes?: number;
173
- /**
174
- * The number of existing boxes created by this account's app.
175
- */
176
- totalBoxes?: number;
177
- /**
178
- * The round in which this account last went online, or explicitly renewed their
179
- * online status.
180
- */
181
- lastHeartbeatRound?: bigint;
182
- /**
183
- * The round in which this account last proposed the block.
184
- */
185
- lastProposedRound?: bigint;
72
+ export type AccountInformation = {
73
+ /**
74
+ * The account public key
75
+ */
76
+ address: Address;
77
+ /** The balance of Algo currently held by the account. */
78
+ balance: AlgoAmount;
79
+ /**
80
+ * The amount of Algo in the account, without the pending rewards.
81
+ */
82
+ amountWithoutPendingRewards: AlgoAmount;
83
+ /**
84
+ * Algo balance required to be held by the account.
85
+ *
86
+ * The requirement grows based on asset and application usage.
87
+ */
88
+ minBalance: AlgoAmount;
89
+ /**
90
+ * Amount of Algo of pending rewards in this account.
91
+ */
92
+ pendingRewards: AlgoAmount;
93
+ /**
94
+ * Total rewards of Algo the account has received, including pending
95
+ * rewards.
96
+ */
97
+ rewards: AlgoAmount;
98
+ /**
99
+ * The round number for which this information is relevant.
100
+ */
101
+ validAsOfRound: bigint;
102
+ /**
103
+ * Delegation status of the account's Algo:
104
+ * * Offline - indicates that the associated account is delegated.
105
+ * * Online - indicates that the associated account used as part of the delegation pool.
106
+ * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.
107
+ */
108
+ status: string;
109
+ /**
110
+ * The count of all applications that have been opted in, equivalent to the count
111
+ * of application local data (AppLocalState objects) stored in this account.
112
+ */
113
+ totalAppsOptedIn: number;
114
+ /**
115
+ * The count of all assets that have been opted in, equivalent to the count of
116
+ * AssetHolding objects held by this account.
117
+ */
118
+ totalAssetsOptedIn: number;
119
+ /**
120
+ * The count of all apps (AppParams objects) created by this account.
121
+ */
122
+ totalCreatedApps: number;
123
+ /**
124
+ * The count of all assets (AssetParams objects) created by this account.
125
+ */
126
+ totalCreatedAssets: number;
127
+ /**
128
+ * Applications local data stored in this account.
129
+ */
130
+ appsLocalState?: ApplicationLocalState[];
131
+ /**
132
+ * The sum of all extra application program pages for this account.
133
+ */
134
+ appsTotalExtraPages?: number;
135
+ /**
136
+ * (tsch) stores the sum of all of the local schemas and global schemas in this
137
+ * account.
138
+ * Note: the raw account uses `StateSchema` for this type.
139
+ */
140
+ appsTotalSchema?: ApplicationStateSchema;
141
+ /**
142
+ * Assets held by this account.
143
+ */
144
+ assets?: AssetHolding[];
145
+ /**
146
+ * The address against which signing should be checked. If empty, the
147
+ * address of the current account is used. This field can be updated in any
148
+ * transaction by setting the `RekeyTo` field.
149
+ */
150
+ authAddr?: Address;
151
+ /**
152
+ * Parameters of applications created by this account including app global data.
153
+ */
154
+ createdApps?: Application[];
155
+ /**
156
+ * (apar) parameters of assets created by this account.
157
+ * Note: the raw account uses `map[int] -> Asset` for this type.
158
+ */
159
+ createdAssets?: Asset[];
160
+ /**
161
+ * AccountParticipation describes the parameters used by this account in consensus
162
+ * protocol.
163
+ */
164
+ participation?: AccountParticipation;
165
+ /**
166
+ * Used as part of the rewards computation. Only applicable to accounts
167
+ * which are participating.
168
+ */
169
+ rewardBase?: number;
170
+ /**
171
+ * Indicates what type of signature is used by this account, must be one of:
172
+ * * sig
173
+ * * msig
174
+ * * lsig
175
+ */
176
+ sigType?: string;
177
+ /**
178
+ * The total number of bytes used by this account's app's box keys and
179
+ * values.
180
+ */
181
+ totalBoxBytes?: number;
182
+ /**
183
+ * The number of existing boxes created by this account's app.
184
+ */
185
+ totalBoxes?: number;
186
+ /**
187
+ * The round in which this account last went online, or explicitly renewed their
188
+ * online status.
189
+ */
190
+ lastHeartbeatRound?: bigint;
191
+ /**
192
+ * The round in which this account last proposed the block.
193
+ */
194
+ lastProposedRound?: bigint;
186
195
  };
187
196
  /** Account asset holding information at a given round. */
188
- type AccountAssetInformation = {
189
- /** The ID of the asset held. */assetId: bigint; /** The current balance of that asset holding. */
190
- balance: bigint; /** Whether or not the asset is frozen for the account. */
191
- frozen: boolean; /** The round as at which the holding was correct. */
192
- round: bigint;
197
+ export type AccountAssetInformation = {
198
+ /** The ID of the asset held. */
199
+ assetId: bigint;
200
+ /** The current balance of that asset holding. */
201
+ balance: bigint;
202
+ /** Whether or not the asset is frozen for the account. */
203
+ frozen: boolean;
204
+ /** The round as at which the holding was correct. */
205
+ round: bigint;
193
206
  };
194
207
  /**
195
208
  * @deprecated The methods that use this can be achieved using `AccountManager` instead.
196
209
  * Config for an account config */
197
- interface AccountConfig {
198
- /** Mnemonic for an account */
199
- accountMnemonic: string;
200
- /** Address of a rekeyed account */
201
- senderAddress?: string;
202
- /** Account name used to retrieve config */
203
- accountName: string;
204
- /** @deprecated Renamed to senderAddress in 2.3.1 */
205
- senderMnemonic?: string;
210
+ export interface AccountConfig {
211
+ /** Mnemonic for an account */
212
+ accountMnemonic: string;
213
+ /** Address of a rekeyed account */
214
+ senderAddress?: string;
215
+ /** Account name used to retrieve config */
216
+ accountName: string;
217
+ /** @deprecated Renamed to senderAddress in 2.3.1 */
218
+ senderMnemonic?: string;
206
219
  }
207
- //#endregion
208
- export { AccountAssetInformation, AccountConfig, AccountInformation, DISPENSER_ACCOUNT, MultisigAccount, SigningAccount, TransactionSignerAccount };
209
- //# sourceMappingURL=account.d.ts.map
@@ -1,17 +1,12 @@
1
- import { BaseHTTPClientResponse, Query, URLTokenBaseHTTPClient } from "algosdk/client";
2
-
3
- //#region src/types/algo-http-client-with-retry.d.ts
1
+ import { BaseHTTPClientResponse, Query, URLTokenBaseHTTPClient } from 'algosdk/client';
4
2
  /** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */
5
- declare class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {
6
- private static readonly MAX_TRIES;
7
- private static readonly MAX_BACKOFF_MS;
8
- private static readonly RETRY_STATUS_CODES;
9
- private static readonly RETRY_ERROR_CODES;
10
- private callWithRetry;
11
- get(relativePath: string, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
12
- post(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
13
- delete(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
3
+ export declare class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {
4
+ private static readonly MAX_TRIES;
5
+ private static readonly MAX_BACKOFF_MS;
6
+ private static readonly RETRY_STATUS_CODES;
7
+ private static readonly RETRY_ERROR_CODES;
8
+ private callWithRetry;
9
+ get(relativePath: string, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
10
+ post(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
11
+ delete(relativePath: string, data: Uint8Array, query?: Query<string>, requestHeaders?: Record<string, string>): Promise<BaseHTTPClientResponse>;
14
12
  }
15
- //#endregion
16
- export { AlgoHttpClientWithRetry };
17
- //# sourceMappingURL=algo-http-client-with-retry.d.ts.map