@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
@@ -1,210 +1,205 @@
1
- import { AccountAssetInformation } from "./account.js";
2
- import { SendParams } from "./transaction.js";
3
- import { CommonTransactionParams, TransactionComposer } from "./composer.js";
4
- import algosdk, { Address } from "algosdk";
5
-
6
- //#region src/types/asset-manager.d.ts
1
+ import algosdk, { Address } from 'algosdk';
2
+ import { AccountAssetInformation } from './account';
3
+ import { CommonTransactionParams, TransactionComposer } from './composer';
4
+ import { SendParams } from './transaction';
7
5
  /** Individual result from performing a bulk opt-in or bulk opt-out for an account against a series of assets. */
8
- interface BulkAssetOptInOutResult {
9
- /** The ID of the asset opted into / out of */
10
- assetId: bigint;
11
- /** The transaction ID of the resulting opt in / out */
12
- transactionId: string;
6
+ export interface BulkAssetOptInOutResult {
7
+ /** The ID of the asset opted into / out of */
8
+ assetId: bigint;
9
+ /** The transaction ID of the resulting opt in / out */
10
+ transactionId: string;
13
11
  }
14
12
  /** Information about an asset. */
15
- interface AssetInformation {
16
- /** The ID of the asset. */
17
- assetId: bigint;
18
- /** The address of the account that created the asset.
19
- *
20
- * This is the address where the parameters for this asset can be found,
21
- * and also the address where unwanted asset units can be sent when
22
- * closing out an asset position and opting-out of the asset.
23
- */
24
- creator: string;
25
- /** The total amount of the smallest divisible (decimal) units that were created of the asset.
26
- *
27
- * For example, if `decimals` is, say, 2, then for every 100 `total` there is 1 whole unit.
28
- */
29
- total: bigint;
30
- /** The amount of decimal places the asset was created with.
31
- *
32
- * * If 0, the asset is not divisible;
33
- * * If 1, the base unit of the asset is in tenths;
34
- * * If 2, the base unit of the asset is in hundredths;
35
- * * If 3, the base unit of the asset is in thousandths;
36
- * * and so on up to 19 decimal places.
37
- */
38
- decimals: number;
39
- /** Whether the asset was frozen by default for all accounts.
40
- *
41
- * If `true` then for anyone apart from the creator to hold the
42
- * asset it needs to be unfrozen per account using an asset freeze
43
- * transaction from the `freeze` account.
44
- */
45
- defaultFrozen?: boolean;
46
- /** The address of the optional account that can manage the configuration of the asset and destroy it.
47
- *
48
- * If not set the asset is permanently immutable.
49
- */
50
- manager?: string;
51
- /**
52
- * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
53
- *
54
- * This address has no specific authority in the protocol itself and is informational only.
55
- *
56
- * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
57
- * rely on this field to hold meaningful data.
58
- *
59
- * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
60
- * of the asset reside in an account that is different from the default creator account.
61
- *
62
- * If not set the field is permanently empty.
63
- */
64
- reserve?: string;
65
- /**
66
- * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
67
- *
68
- * If empty, freezing is not permitted.
69
- *
70
- * If not set the field is permanently empty.
71
- */
72
- freeze?: string;
73
- /**
74
- * The address of the optional account that can clawback holdings of this asset from any account.
75
- *
76
- * The clawback account has the ability to **unconditionally take assets from any account**.
77
- *
78
- * If empty, clawback is not permitted.
79
- *
80
- * If not set the field is permanently empty.
81
- */
82
- clawback?: string;
83
- /** The optional name of the unit of this asset (e.g. ticker name).
84
- *
85
- * Max size is 8 bytes.
86
- */
87
- unitName?: string;
88
- /** The optional name of the unit of this asset (e.g. ticker name).
89
- *
90
- * Max size is 8 bytes.
91
- */
92
- unitNameAsBytes?: Uint8Array;
93
- /** The optional name of the asset.
94
- *
95
- * Max size is 32 bytes.
96
- */
97
- assetName?: string;
98
- /** The optional name of the asset.
99
- *
100
- * Max size is 32 bytes.
101
- */
102
- assetNameAsBytes?: Uint8Array;
103
- /** Optional URL where more information about the asset can be retrieved (e.g. metadata).
104
- *
105
- * Max size is 96 bytes.
106
- */
107
- url?: string;
108
- /** Optional URL where more information about the asset can be retrieved (e.g. metadata).
109
- *
110
- * Max size is 96 bytes.
111
- */
112
- urlAsBytes?: Uint8Array;
113
- /** 32-byte hash of some metadata that is relevant to the asset and/or asset holders.
114
- *
115
- * The format of this metadata is up to the application.
116
- */
117
- metadataHash?: Uint8Array;
13
+ export interface AssetInformation {
14
+ /** The ID of the asset. */
15
+ assetId: bigint;
16
+ /** The address of the account that created the asset.
17
+ *
18
+ * This is the address where the parameters for this asset can be found,
19
+ * and also the address where unwanted asset units can be sent when
20
+ * closing out an asset position and opting-out of the asset.
21
+ */
22
+ creator: string;
23
+ /** The total amount of the smallest divisible (decimal) units that were created of the asset.
24
+ *
25
+ * For example, if `decimals` is, say, 2, then for every 100 `total` there is 1 whole unit.
26
+ */
27
+ total: bigint;
28
+ /** The amount of decimal places the asset was created with.
29
+ *
30
+ * * If 0, the asset is not divisible;
31
+ * * If 1, the base unit of the asset is in tenths;
32
+ * * If 2, the base unit of the asset is in hundredths;
33
+ * * If 3, the base unit of the asset is in thousandths;
34
+ * * and so on up to 19 decimal places.
35
+ */
36
+ decimals: number;
37
+ /** Whether the asset was frozen by default for all accounts.
38
+ *
39
+ * If `true` then for anyone apart from the creator to hold the
40
+ * asset it needs to be unfrozen per account using an asset freeze
41
+ * transaction from the `freeze` account.
42
+ */
43
+ defaultFrozen?: boolean;
44
+ /** The address of the optional account that can manage the configuration of the asset and destroy it.
45
+ *
46
+ * If not set the asset is permanently immutable.
47
+ */
48
+ manager?: string;
49
+ /**
50
+ * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
51
+ *
52
+ * This address has no specific authority in the protocol itself and is informational only.
53
+ *
54
+ * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
55
+ * rely on this field to hold meaningful data.
56
+ *
57
+ * It can be used in the case where you want to signal to holders of your asset that the uncirculated units
58
+ * of the asset reside in an account that is different from the default creator account.
59
+ *
60
+ * If not set the field is permanently empty.
61
+ */
62
+ reserve?: string;
63
+ /**
64
+ * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
65
+ *
66
+ * If empty, freezing is not permitted.
67
+ *
68
+ * If not set the field is permanently empty.
69
+ */
70
+ freeze?: string;
71
+ /**
72
+ * The address of the optional account that can clawback holdings of this asset from any account.
73
+ *
74
+ * The clawback account has the ability to **unconditionally take assets from any account**.
75
+ *
76
+ * If empty, clawback is not permitted.
77
+ *
78
+ * If not set the field is permanently empty.
79
+ */
80
+ clawback?: string;
81
+ /** The optional name of the unit of this asset (e.g. ticker name).
82
+ *
83
+ * Max size is 8 bytes.
84
+ */
85
+ unitName?: string;
86
+ /** The optional name of the unit of this asset (e.g. ticker name).
87
+ *
88
+ * Max size is 8 bytes.
89
+ */
90
+ unitNameAsBytes?: Uint8Array;
91
+ /** The optional name of the asset.
92
+ *
93
+ * Max size is 32 bytes.
94
+ */
95
+ assetName?: string;
96
+ /** The optional name of the asset.
97
+ *
98
+ * Max size is 32 bytes.
99
+ */
100
+ assetNameAsBytes?: Uint8Array;
101
+ /** Optional URL where more information about the asset can be retrieved (e.g. metadata).
102
+ *
103
+ * Max size is 96 bytes.
104
+ */
105
+ url?: string;
106
+ /** Optional URL where more information about the asset can be retrieved (e.g. metadata).
107
+ *
108
+ * Max size is 96 bytes.
109
+ */
110
+ urlAsBytes?: Uint8Array;
111
+ /** 32-byte hash of some metadata that is relevant to the asset and/or asset holders.
112
+ *
113
+ * The format of this metadata is up to the application.
114
+ */
115
+ metadataHash?: Uint8Array;
118
116
  }
119
117
  /** Allows management of asset information. */
120
- declare class AssetManager {
121
- private _algod;
122
- private _newGroup;
123
- /**
124
- * Create a new asset manager.
125
- * @param algod An algod client
126
- * @param newGroup A function that creates a new `TransactionComposer` transaction group
127
- * @example Create a new asset manager
128
- * ```typescript
129
- * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))
130
- * ```
131
- */
132
- constructor(algod: algosdk.Algodv2, newGroup: () => TransactionComposer);
133
- /**
134
- * Returns the current asset information for the asset with the given ID.
135
- *
136
- * @example
137
- * ```typescript
138
- * const assetInfo = await assetManager.getById(12353n);
139
- * ```
140
- *
141
- * @param assetId The ID of the asset
142
- * @returns The asset information
143
- */
144
- getById(assetId: bigint): Promise<AssetInformation>;
145
- /**
146
- * Returns the given sender account's asset holding for a given asset.
147
- *
148
- * @example
149
- * ```typescript
150
- * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
151
- * const assetId = 123345n;
152
- * const accountInfo = await assetManager.getAccountInformation(address, assetId);
153
- * ```
154
- *
155
- * [Response data schema details](https://dev.algorand.co/reference/rest-api/algod/operations/accountassetinformation/)
156
- * @param sender The address of the sender/account to look up
157
- * @param assetId The ID of the asset to return a holding for
158
- * @returns The account asset holding information
159
- */
160
- getAccountInformation(sender: string | Address, assetId: bigint): Promise<AccountAssetInformation>;
161
- /**
162
- * Opt an account in to a list of Algorand Standard Assets.
163
- *
164
- * Transactions will be sent in batches of 16 as transaction groups.
165
- *
166
- * @param account The account to opt-in
167
- * @param assetIds The list of asset IDs to opt-in to
168
- * @param options Any parameters to control the transaction or execution of the transaction
169
- * @example Example using AlgorandClient
170
- * ```typescript
171
- * // Basic example
172
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n])
173
- * // With configuration
174
- * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })
175
- * ```
176
- * @returns An array of records matching asset ID to transaction ID of the opt in
177
- */
178
- bulkOptIn(account: string | Address, assetIds: bigint[], options?: Omit<CommonTransactionParams, 'sender'> & SendParams): Promise<BulkAssetOptInOutResult[]>;
179
- /**
180
- * Opt an account out of a list of Algorand Standard Assets.
181
- *
182
- * Transactions will be sent in batches of 16 as transaction groups.
183
- *
184
- * @param account The account to opt-in
185
- * @param assetIds The list of asset IDs to opt-out of
186
- * @param options Any parameters to control the transaction or execution of the transaction
187
- * @example Example using AlgorandClient
188
- * ```typescript
189
- * // Basic example
190
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n])
191
- * // With configuration
192
- * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })
193
- * ```
194
- * @returns An array of records matching asset ID to transaction ID of the opt in
195
- */
196
- bulkOptOut(account: string | Address, assetIds: bigint[], options?: Omit<CommonTransactionParams, 'sender'> & SendParams & {
197
- /** Whether or not to check if the account has a zero balance for each asset first or not.
198
- *
199
- * Defaults to `true`.
200
- *
201
- * If this is set to `true` and the account has an asset balance it will throw an error.
202
- *
203
- * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.
204
- */
205
- ensureZeroBalance?: boolean;
206
- }): Promise<BulkAssetOptInOutResult[]>;
118
+ export declare class AssetManager {
119
+ private _algod;
120
+ private _newGroup;
121
+ /**
122
+ * Create a new asset manager.
123
+ * @param algod An algod client
124
+ * @param newGroup A function that creates a new `TransactionComposer` transaction group
125
+ * @example Create a new asset manager
126
+ * ```typescript
127
+ * const assetManager = new AssetManager(algod, () => new TransactionComposer({algod, () => signer, () => suggestedParams}))
128
+ * ```
129
+ */
130
+ constructor(algod: algosdk.Algodv2, newGroup: () => TransactionComposer);
131
+ /**
132
+ * Returns the current asset information for the asset with the given ID.
133
+ *
134
+ * @example
135
+ * ```typescript
136
+ * const assetInfo = await assetManager.getById(12353n);
137
+ * ```
138
+ *
139
+ * @param assetId The ID of the asset
140
+ * @returns The asset information
141
+ */
142
+ getById(assetId: bigint): Promise<AssetInformation>;
143
+ /**
144
+ * Returns the given sender account's asset holding for a given asset.
145
+ *
146
+ * @example
147
+ * ```typescript
148
+ * const address = "XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA";
149
+ * const assetId = 123345n;
150
+ * const accountInfo = await assetManager.getAccountInformation(address, assetId);
151
+ * ```
152
+ *
153
+ * [Response data schema details](https://dev.algorand.co/reference/rest-api/algod/operations/accountassetinformation/)
154
+ * @param sender The address of the sender/account to look up
155
+ * @param assetId The ID of the asset to return a holding for
156
+ * @returns The account asset holding information
157
+ */
158
+ getAccountInformation(sender: string | Address, assetId: bigint): Promise<AccountAssetInformation>;
159
+ /**
160
+ * Opt an account in to a list of Algorand Standard Assets.
161
+ *
162
+ * Transactions will be sent in batches of 16 as transaction groups.
163
+ *
164
+ * @param account The account to opt-in
165
+ * @param assetIds The list of asset IDs to opt-in to
166
+ * @param options Any parameters to control the transaction or execution of the transaction
167
+ * @example Example using AlgorandClient
168
+ * ```typescript
169
+ * // Basic example
170
+ * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n])
171
+ * // With configuration
172
+ * assetManager.bulkOptIn("ACCOUNTADDRESS", [12345n, 67890n], { maxFee: (1000).microAlgo(), suppressLog: true })
173
+ * ```
174
+ * @returns An array of records matching asset ID to transaction ID of the opt in
175
+ */
176
+ bulkOptIn(account: string | Address, assetIds: bigint[], options?: Omit<CommonTransactionParams, 'sender'> & SendParams): Promise<BulkAssetOptInOutResult[]>;
177
+ /**
178
+ * Opt an account out of a list of Algorand Standard Assets.
179
+ *
180
+ * Transactions will be sent in batches of 16 as transaction groups.
181
+ *
182
+ * @param account The account to opt-in
183
+ * @param assetIds The list of asset IDs to opt-out of
184
+ * @param options Any parameters to control the transaction or execution of the transaction
185
+ * @example Example using AlgorandClient
186
+ * ```typescript
187
+ * // Basic example
188
+ * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n])
189
+ * // With configuration
190
+ * assetManager.bulkOptOut("ACCOUNTADDRESS", [12345n, 67890n], { ensureZeroBalance: true, maxFee: (1000).microAlgo(), suppressLog: true })
191
+ * ```
192
+ * @returns An array of records matching asset ID to transaction ID of the opt in
193
+ */
194
+ bulkOptOut(account: string | Address, assetIds: bigint[], options?: Omit<CommonTransactionParams, 'sender'> & SendParams & {
195
+ /** Whether or not to check if the account has a zero balance for each asset first or not.
196
+ *
197
+ * Defaults to `true`.
198
+ *
199
+ * If this is set to `true` and the account has an asset balance it will throw an error.
200
+ *
201
+ * If this is set to `false` and the account has an asset balance it will lose those assets to the asset creator.
202
+ */
203
+ ensureZeroBalance?: boolean;
204
+ }): Promise<BulkAssetOptInOutResult[]>;
207
205
  }
208
- //#endregion
209
- export { AssetInformation, AssetManager, BulkAssetOptInOutResult };
210
- //# sourceMappingURL=asset-manager.d.ts.map
package/types/asset.d.ts CHANGED
@@ -1,103 +1,99 @@
1
- import { AlgoAmount } from "./amount.js";
2
- import { SendTransactionFrom, SendTransactionParams, TransactionNote } from "./transaction.js";
3
- import algosdk from "algosdk";
4
-
5
- //#region src/types/asset.d.ts
1
+ import algosdk from 'algosdk';
2
+ import { AlgoAmount } from './amount';
3
+ import { SendTransactionFrom, SendTransactionParams, TransactionNote } from './transaction';
4
+ import SuggestedParams = algosdk.SuggestedParams;
6
5
  /** @deprecated Parameters for `createAsset` call. */
7
- interface CreateAssetParams extends SendTransactionParams {
8
- /** The account to create the asset.
9
- *
10
- * This account automatically is opted in to the asset and holds all units after creation. */
11
- creator: SendTransactionFrom;
12
- /** The total number of base (decimal) units of the asset to create.
13
- * If decimal is, say, 2, then for every 100 `total` there would be 1 whole unit.
14
- * This field can only be specified upon asset creation.
15
- */
16
- total: number | bigint;
17
- /** The number of digits to use after the decimal point when displaying the asset.
18
- * If 0, the asset is not divisible.
19
- * If 1, the base unit of the asset is in tenths.
20
- * If 2, the base unit of the asset is in hundredths.
21
- * If 3, the base unit of the asset is in thousandths, and so on up to 19 decimal places.
22
- * This field can only be specified upon asset creation.
23
- */
24
- decimals: number;
25
- /** The optional name of the asset. Max size if 32 bytes. This field can only be specified upon asset creation. */
26
- name?: string;
27
- /** The optional name of the unit of this asset. Max size is 8 bytes. This field can only be specified upon asset creation. */
28
- unit?: string;
29
- /** Specifies an optional URL where more information about the asset can be retrieved. Max size is 96 bytes.
30
- * This field can only be specified upon asset creation.
31
- */
32
- url?: string;
33
- /** This field is intended to be a 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
34
- * The format of this metadata is up to the application. This field can only be specified upon asset creation.
35
- */
36
- metadataHash?: string | Uint8Array;
37
- /** The optional account that can manage the configuration of the asset and destroy it.
38
- * If not set at asset creation or subsequently set to empty by the manager the asset becomes immutable.
39
- */
40
- manager?: string | SendTransactionFrom;
41
- /** The optional account that holds the reserve (non-minted) units of the asset. This address has no specific authority in the protocol itself and is informational.
42
- * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md) rely on this field to hold meaningful data.
43
- * It is used in the case where you want to signal to holders of your asset that the non-minted units of the asset reside in an account that is different from the default creator account.
44
- * If not set at asset creation or subsequently set to empty by the manager the field is permanently empty.
45
- */
46
- reserveAccount?: string | SendTransactionFrom;
47
- /** The optional account that can be used to freeze holdings of this asset. If empty, freezing is not permitted.
48
- * If not set at asset creation or subsequently set to empty by the manager the field is permanently empty.
49
- */
50
- freezeAccount?: string | SendTransactionFrom;
51
- /** The optional account that can clawback holdings of this asset. If empty, clawback is not permitted.
52
- * If not set at asset creation or subsequently set to empty by the manager the field is permanently empty.
53
- */
54
- clawbackAccount?: string | SendTransactionFrom;
55
- /** Whether to freeze holdings for this asset by default. If `true` then for anyone apart from the creator to hold the asset it needs to be unfrozen per account using `freeze`. Defaults to `false`. */
56
- frozenByDefault?: boolean;
57
- /** Optional transaction parameters */
58
- transactionParams?: SuggestedParams;
59
- /** The (optional) transaction note */
60
- note?: TransactionNote;
61
- /** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
62
- lease?: string | Uint8Array;
6
+ export interface CreateAssetParams extends SendTransactionParams {
7
+ /** The account to create the asset.
8
+ *
9
+ * This account automatically is opted in to the asset and holds all units after creation. */
10
+ creator: SendTransactionFrom;
11
+ /** The total number of base (decimal) units of the asset to create.
12
+ * If decimal is, say, 2, then for every 100 `total` there would be 1 whole unit.
13
+ * This field can only be specified upon asset creation.
14
+ */
15
+ total: number | bigint;
16
+ /** The number of digits to use after the decimal point when displaying the asset.
17
+ * If 0, the asset is not divisible.
18
+ * If 1, the base unit of the asset is in tenths.
19
+ * If 2, the base unit of the asset is in hundredths.
20
+ * If 3, the base unit of the asset is in thousandths, and so on up to 19 decimal places.
21
+ * This field can only be specified upon asset creation.
22
+ */
23
+ decimals: number;
24
+ /** The optional name of the asset. Max size if 32 bytes. This field can only be specified upon asset creation. */
25
+ name?: string;
26
+ /** The optional name of the unit of this asset. Max size is 8 bytes. This field can only be specified upon asset creation. */
27
+ unit?: string;
28
+ /** Specifies an optional URL where more information about the asset can be retrieved. Max size is 96 bytes.
29
+ * This field can only be specified upon asset creation.
30
+ */
31
+ url?: string;
32
+ /** This field is intended to be a 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
33
+ * The format of this metadata is up to the application. This field can only be specified upon asset creation.
34
+ */
35
+ metadataHash?: string | Uint8Array;
36
+ /** The optional account that can manage the configuration of the asset and destroy it.
37
+ * If not set at asset creation or subsequently set to empty by the manager the asset becomes immutable.
38
+ */
39
+ manager?: string | SendTransactionFrom;
40
+ /** The optional account that holds the reserve (non-minted) units of the asset. This address has no specific authority in the protocol itself and is informational.
41
+ * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md) rely on this field to hold meaningful data.
42
+ * It is used in the case where you want to signal to holders of your asset that the non-minted units of the asset reside in an account that is different from the default creator account.
43
+ * If not set at asset creation or subsequently set to empty by the manager the field is permanently empty.
44
+ */
45
+ reserveAccount?: string | SendTransactionFrom;
46
+ /** The optional account that can be used to freeze holdings of this asset. If empty, freezing is not permitted.
47
+ * If not set at asset creation or subsequently set to empty by the manager the field is permanently empty.
48
+ */
49
+ freezeAccount?: string | SendTransactionFrom;
50
+ /** The optional account that can clawback holdings of this asset. If empty, clawback is not permitted.
51
+ * If not set at asset creation or subsequently set to empty by the manager the field is permanently empty.
52
+ */
53
+ clawbackAccount?: string | SendTransactionFrom;
54
+ /** Whether to freeze holdings for this asset by default. If `true` then for anyone apart from the creator to hold the asset it needs to be unfrozen per account using `freeze`. Defaults to `false`. */
55
+ frozenByDefault?: boolean;
56
+ /** Optional transaction parameters */
57
+ transactionParams?: SuggestedParams;
58
+ /** The (optional) transaction note */
59
+ note?: TransactionNote;
60
+ /** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
61
+ lease?: string | Uint8Array;
63
62
  }
64
63
  /** @deprecated Parameters for `assetOptIn` call. */
65
- interface AssetOptInParams extends SendTransactionParams {
66
- /** The account to opt in/out for */
67
- account: SendTransactionFrom;
68
- /** The ID of the assets to opt in for / out of */
69
- assetId: number;
70
- /** Optional transaction parameters */
71
- transactionParams?: SuggestedParams;
72
- /** The (optional) transaction note */
73
- note?: TransactionNote;
74
- /** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
75
- lease?: string | Uint8Array;
64
+ export interface AssetOptInParams extends SendTransactionParams {
65
+ /** The account to opt in/out for */
66
+ account: SendTransactionFrom;
67
+ /** The ID of the assets to opt in for / out of */
68
+ assetId: number;
69
+ /** Optional transaction parameters */
70
+ transactionParams?: SuggestedParams;
71
+ /** The (optional) transaction note */
72
+ note?: TransactionNote;
73
+ /** An (optional) [transaction lease](https://dev.algorand.co/concepts/transactions/leases) to apply */
74
+ lease?: string | Uint8Array;
76
75
  }
77
76
  /** @deprecated Parameters for `assetOptOut` call. */
78
- interface AssetOptOutParams extends AssetOptInParams {
79
- /** The address of the creator account for the asset; if unspecified then it looks it up using algod */
80
- assetCreatorAddress?: string;
81
- /** Whether or not to validate the account has a zero-balance before issuing the opt-out; default = true */
82
- ensureZeroBalance?: boolean;
77
+ export interface AssetOptOutParams extends AssetOptInParams {
78
+ /** The address of the creator account for the asset; if unspecified then it looks it up using algod */
79
+ assetCreatorAddress?: string;
80
+ /** Whether or not to validate the account has a zero-balance before issuing the opt-out; default = true */
81
+ ensureZeroBalance?: boolean;
83
82
  }
84
83
  /** @deprecated Parameters for `assetBulkOptIn` / `assetBulkOptOut` call. */
85
- interface AssetBulkOptInOutParams {
86
- /** The account to opt in/out for */
87
- account: SendTransactionFrom;
88
- /** The IDs of the assets to opt in for / out of */
89
- assetIds: number[];
90
- /** Whether or not to validate the opt-in/out is valid before issuing transactions; default = true */
91
- validateBalances?: boolean;
92
- /** Optional transaction parameters */
93
- transactionParams?: SuggestedParams;
94
- /** The (optional) transaction note */
95
- note?: TransactionNote;
96
- /** The maximum fee that you are happy to pay per transaction (default: unbounded) - if this is set it's possible the transaction could get rejected during network congestion */
97
- maxFee?: AlgoAmount;
98
- /** Whether to suppress log messages from transaction send, default: do not suppress */
99
- suppressLog?: boolean;
84
+ export interface AssetBulkOptInOutParams {
85
+ /** The account to opt in/out for */
86
+ account: SendTransactionFrom;
87
+ /** The IDs of the assets to opt in for / out of */
88
+ assetIds: number[];
89
+ /** Whether or not to validate the opt-in/out is valid before issuing transactions; default = true */
90
+ validateBalances?: boolean;
91
+ /** Optional transaction parameters */
92
+ transactionParams?: SuggestedParams;
93
+ /** The (optional) transaction note */
94
+ note?: TransactionNote;
95
+ /** The maximum fee that you are happy to pay per transaction (default: unbounded) - if this is set it's possible the transaction could get rejected during network congestion */
96
+ maxFee?: AlgoAmount;
97
+ /** Whether to suppress log messages from transaction send, default: do not suppress */
98
+ suppressLog?: boolean;
100
99
  }
101
- //#endregion
102
- export { AssetBulkOptInOutParams, AssetOptInParams, AssetOptOutParams, CreateAssetParams };
103
- //# sourceMappingURL=asset.d.ts.map