@algorandfoundation/algokit-utils 6.2.1-beta.1 → 6.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/account/account.d.ts +13 -5
- package/account/account.d.ts.map +1 -1
- package/account/account.js +26 -6
- package/account/account.js.map +1 -1
- package/account/account.mjs +26 -6
- package/account/account.mjs.map +1 -1
- package/account/get-account.d.ts +4 -4
- package/account/get-account.js +2 -2
- package/account/get-account.mjs +2 -2
- package/amount.d.ts +28 -6
- package/amount.d.ts.map +1 -1
- package/amount.js +31 -11
- package/amount.js.map +1 -1
- package/amount.mjs +30 -12
- package/amount.mjs.map +1 -1
- package/asset.d.ts +10 -0
- package/asset.d.ts.map +1 -1
- package/asset.js +71 -198
- package/asset.js.map +1 -1
- package/asset.mjs +72 -199
- package/asset.mjs.map +1 -1
- package/dispenser-client.d.ts +1 -1
- package/dispenser-client.js +2 -2
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs +2 -2
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +4 -3
- package/index.d.ts.map +1 -1
- package/index.js +11 -8
- package/index.js.map +1 -1
- package/index.mjs +6 -4
- package/index.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -1
- package/localnet/get-or-create-kmd-wallet-account.js +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +1 -1
- package/package.json +3 -2
- package/testing/_asset.d.ts +2 -4
- package/testing/_asset.d.ts.map +1 -1
- package/testing/account.js +8 -2
- package/testing/account.js.map +1 -1
- package/testing/account.mjs +8 -2
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +1 -1
- package/testing/fixtures/algorand-fixture.js +7 -2
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +7 -2
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/transaction/legacy-bridge.d.ts +10 -0
- package/transaction/legacy-bridge.d.ts.map +1 -0
- package/transaction/legacy-bridge.js +35 -0
- package/transaction/legacy-bridge.js.map +1 -0
- package/transaction/legacy-bridge.mjs +33 -0
- package/transaction/legacy-bridge.mjs.map +1 -0
- package/transaction/transaction.d.ts +1 -1
- package/transaction/transaction.js +5 -5
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +5 -5
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/transfer-algos.d.ts +4 -2
- package/transfer/transfer-algos.d.ts.map +1 -1
- package/transfer/transfer-algos.js +13 -22
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +14 -23
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +8 -1
- package/transfer/transfer.d.ts.map +1 -1
- package/transfer/transfer.js +57 -94
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +58 -95
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +141 -24
- package/types/account-manager.d.ts.map +1 -1
- package/types/account-manager.js +217 -44
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +216 -43
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +122 -7
- package/types/account.d.ts.map +1 -1
- package/types/account.js.map +1 -1
- package/types/account.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +289 -0
- package/types/algorand-client-transaction-creator.d.ts.map +1 -0
- package/types/algorand-client-transaction-creator.js +299 -0
- package/types/algorand-client-transaction-creator.js.map +1 -0
- package/types/algorand-client-transaction-creator.mjs +297 -0
- package/types/algorand-client-transaction-creator.mjs.map +1 -0
- package/types/algorand-client-transaction-sender.d.ts +433 -0
- package/types/algorand-client-transaction-sender.d.ts.map +1 -0
- package/types/algorand-client-transaction-sender.js +422 -0
- package/types/algorand-client-transaction-sender.js.map +1 -0
- package/types/algorand-client-transaction-sender.mjs +420 -0
- package/types/algorand-client-transaction-sender.mjs.map +1 -0
- package/types/algorand-client.d.ts +28 -78
- package/types/algorand-client.d.ts.map +1 -1
- package/types/algorand-client.js +33 -122
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +34 -123
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +18 -6
- package/types/amount.d.ts.map +1 -1
- package/types/amount.js +33 -10
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +33 -10
- package/types/amount.mjs.map +1 -1
- package/types/app-client.d.ts +3 -3
- package/types/app-client.d.ts.map +1 -1
- package/types/app-client.js +7 -10
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +8 -11
- package/types/app-client.mjs.map +1 -1
- package/types/asset-manager.d.ts +205 -0
- package/types/asset-manager.d.ts.map +1 -0
- package/types/asset-manager.js +180 -0
- package/types/asset-manager.js.map +1 -0
- package/types/asset-manager.mjs +178 -0
- package/types/asset-manager.mjs.map +1 -0
- package/types/asset.d.ts +4 -4
- package/types/asset.d.ts.map +1 -1
- package/types/client-manager.d.ts +40 -2
- package/types/client-manager.d.ts.map +1 -1
- package/types/client-manager.js +44 -3
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +44 -3
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +226 -68
- package/types/composer.d.ts.map +1 -1
- package/types/composer.js +78 -64
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +75 -64
- package/types/composer.mjs.map +1 -1
- package/types/dispenser-client.d.ts +12 -4
- package/types/dispenser-client.d.ts.map +1 -1
- package/types/dispenser-client.js +9 -9
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +9 -9
- package/types/dispenser-client.mjs.map +1 -1
- package/types/indexer.d.ts +7 -7
- package/types/indexer.d.ts.map +1 -1
- package/types/kmd-account-manager.d.ts +3 -3
- package/types/kmd-account-manager.js +6 -6
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +7 -7
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/network-client.d.ts +7 -1
- package/types/network-client.d.ts.map +1 -1
- package/types/network-client.js +10 -0
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs +9 -0
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +1 -1
- package/types/testing.d.ts.map +1 -1
- package/types/transfer.d.ts +8 -7
- package/types/transfer.d.ts.map +1 -1
- package/util.d.ts +13 -0
- package/util.d.ts.map +1 -1
- package/util.js +25 -0
- package/util.js.map +1 -1
- package/util.mjs +24 -1
- package/util.mjs.map +1 -1
package/types/client-manager.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import algosdk from 'algosdk';
|
|
|
2
2
|
import { AlgoHttpClientWithRetry } from './algo-http-client-with-retry.mjs';
|
|
3
3
|
import { ApplicationClient } from './app-client.mjs';
|
|
4
4
|
import { TestNetDispenserApiClient } from './dispenser-client.mjs';
|
|
5
|
+
import { genesisIdIsLocalNet } from './network-client.mjs';
|
|
5
6
|
|
|
6
7
|
var Kmd = algosdk.Kmd;
|
|
7
8
|
var Indexer = algosdk.Indexer;
|
|
@@ -84,7 +85,7 @@ class ClientManager {
|
|
|
84
85
|
* @returns Whether the given genesis ID is associated with a LocalNet network
|
|
85
86
|
*/
|
|
86
87
|
static genesisIdIsLocalNet(genesisId) {
|
|
87
|
-
return genesisId
|
|
88
|
+
return genesisIdIsLocalNet(genesisId);
|
|
88
89
|
}
|
|
89
90
|
/**
|
|
90
91
|
* Returns true if the current network is LocalNet.
|
|
@@ -109,10 +110,10 @@ class ClientManager {
|
|
|
109
110
|
}
|
|
110
111
|
/**
|
|
111
112
|
* Returns a TestNet Dispenser API client.
|
|
113
|
+
*
|
|
112
114
|
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
|
113
115
|
*
|
|
114
116
|
* @param params An object containing parameters for the TestNetDispenserApiClient class.
|
|
115
|
-
* Or null if you want the client to load the access token from the environment variable `ALGOKIT_DISPENSER_ACCESS_TOKEN`.
|
|
116
117
|
* @example
|
|
117
118
|
* const client = clientManager.getTestNetDispenser(
|
|
118
119
|
* {
|
|
@@ -123,9 +124,27 @@ class ClientManager {
|
|
|
123
124
|
*
|
|
124
125
|
* @returns An instance of the TestNetDispenserApiClient class.
|
|
125
126
|
*/
|
|
126
|
-
getTestNetDispenser(params
|
|
127
|
+
getTestNetDispenser(params) {
|
|
127
128
|
return new TestNetDispenserApiClient(params);
|
|
128
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Returns a TestNet Dispenser API client, loading the auth token from `process.env.ALGOKIT_DISPENSER_ACCESS_TOKEN`.
|
|
132
|
+
*
|
|
133
|
+
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
|
134
|
+
*
|
|
135
|
+
* @param params An object containing parameters for the TestNetDispenserApiClient class.
|
|
136
|
+
* @example
|
|
137
|
+
* const client = clientManager.getTestNetDispenserFromEnvironment(
|
|
138
|
+
* {
|
|
139
|
+
* requestTimeout: 15,
|
|
140
|
+
* }
|
|
141
|
+
* )
|
|
142
|
+
*
|
|
143
|
+
* @returns An instance of the TestNetDispenserApiClient class.
|
|
144
|
+
*/
|
|
145
|
+
getTestNetDispenserFromEnvironment(params) {
|
|
146
|
+
return new TestNetDispenserApiClient(params ? { ...params, authToken: '' } : undefined);
|
|
147
|
+
}
|
|
129
148
|
/**
|
|
130
149
|
* Returns a new `ApplicationClient` client, resolving the app by creator address and name.
|
|
131
150
|
* @param details The details to resolve the app by creator address and name
|
|
@@ -148,6 +167,21 @@ class ClientManager {
|
|
|
148
167
|
* @param typedClient The typed client type to use
|
|
149
168
|
* @param details The details to resolve the app by creator address and name
|
|
150
169
|
* @param cachedAppLookup A cached app lookup that matches a name to on-chain details; either this is needed or indexer is required to be passed in to this manager on construction.
|
|
170
|
+
* @example Use name in ARC-32 app spec
|
|
171
|
+
* ```typescript
|
|
172
|
+
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
173
|
+
* creatorAddress: "CREATORADDRESS",
|
|
174
|
+
* sender: alice,
|
|
175
|
+
* })
|
|
176
|
+
* ```
|
|
177
|
+
* @example Specify name
|
|
178
|
+
* ```typescript
|
|
179
|
+
* const appClient = algorand.client.getTypedAppClientByCreatorAndName(MyContractClient, {
|
|
180
|
+
* creatorAddress: "CREATORADDRESS",
|
|
181
|
+
* name: "contract-name",
|
|
182
|
+
* sender: alice,
|
|
183
|
+
* })
|
|
184
|
+
* ```
|
|
151
185
|
* @returns The typed client instance
|
|
152
186
|
*/
|
|
153
187
|
getTypedAppClientByCreatorAndName(typedClient, details, cachedAppLookup) {
|
|
@@ -157,6 +191,13 @@ class ClientManager {
|
|
|
157
191
|
* Returns a new typed client, resolving the app by app ID.
|
|
158
192
|
* @param typedClient The typed client type to use
|
|
159
193
|
* @param details The details to resolve the app by ID
|
|
194
|
+
* @example
|
|
195
|
+
* ```typescript
|
|
196
|
+
* const appClient = algorand.client.getTypedAppClientById(MyContractClient, {
|
|
197
|
+
* id: 12345,
|
|
198
|
+
* sender: alice,
|
|
199
|
+
* })
|
|
200
|
+
* ```
|
|
160
201
|
* @returns The typed client instance
|
|
161
202
|
*/
|
|
162
203
|
getTypedAppClientById(typedClient, details) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-manager.mjs","sources":["../../src/types/client-manager.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client-manager.mjs","sources":["../../src/types/client-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAcA,IAAO,GAAG,GAAG,OAAO,CAAC,GAAG,CAAA;AACxB,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAA;AAEhC,IAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AA0BxC;MACa,aAAa,CAAA;AAKxB;;;;;;;;;;;;;;;;;;;AAmBG;AACH,IAAA,WAAA,CAAY,eAA4C,EAAA;AACtD,QAAA,MAAM,QAAQ,GACZ,OAAO,IAAI,eAAe;AACxB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QAAQ,IAAI,MAAM,EAAE,CAAC,CAAA;KAChI;AACF;;;;"}
|
package/types/composer.d.ts
CHANGED
|
@@ -4,113 +4,263 @@ import { AlgoAmount } from './amount';
|
|
|
4
4
|
import { SendAtomicTransactionComposerResults } from './transaction';
|
|
5
5
|
import Transaction = algosdk.Transaction;
|
|
6
6
|
import TransactionWithSigner = algosdk.TransactionWithSigner;
|
|
7
|
+
export declare const MAX_TRANSACTION_GROUP_SIZE = 16;
|
|
7
8
|
/** Common parameters for defining a transaction. */
|
|
8
9
|
export type CommonTransactionParams = {
|
|
9
|
-
/** The address sending the transaction */
|
|
10
|
+
/** The address of the account sending the transaction. */
|
|
10
11
|
sender: string;
|
|
11
|
-
/** The function used to sign
|
|
12
|
+
/** The function used to sign transaction(s); if not specified then
|
|
13
|
+
* an attempt will be made to find a registered signer for the
|
|
14
|
+
* given `sender` or use a default signer (if configured).
|
|
15
|
+
*/
|
|
12
16
|
signer?: algosdk.TransactionSigner | TransactionSignerAccount;
|
|
13
|
-
/** Change the signing key of the sender to the given address
|
|
17
|
+
/** Change the signing key of the sender to the given address.
|
|
18
|
+
*
|
|
19
|
+
* **Warning:** Please be careful with this parameter and be sure to read the [official rekey guidance](https://developer.algorand.org/docs/get-details/accounts/rekey/).
|
|
20
|
+
*/
|
|
14
21
|
rekeyTo?: string;
|
|
15
|
-
/** Note to attach to the transaction*/
|
|
22
|
+
/** Note to attach to the transaction. Max of 1000 bytes. */
|
|
16
23
|
note?: Uint8Array | string;
|
|
17
|
-
/** Prevent multiple transactions with the same lease being included within the validity window
|
|
24
|
+
/** Prevent multiple transactions with the same lease being included within the validity window.
|
|
25
|
+
*
|
|
26
|
+
* A [lease](https://developer.algorand.org/articles/leased-transactions-securing-advanced-smart-contract-design/)
|
|
27
|
+
* enforces a mutually exclusive transaction (useful to prevent double-posting and other scenarios).
|
|
28
|
+
*/
|
|
18
29
|
lease?: Uint8Array | string;
|
|
19
|
-
/** The transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction */
|
|
30
|
+
/** The static transaction fee. In most cases you want to use `extraFee` unless setting the fee to 0 to be covered by another transaction. */
|
|
20
31
|
staticFee?: AlgoAmount;
|
|
21
|
-
/** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees */
|
|
32
|
+
/** The fee to pay IN ADDITION to the suggested fee. Useful for covering inner transaction fees. */
|
|
22
33
|
extraFee?: AlgoAmount;
|
|
23
|
-
/** Throw an error if the fee for the transaction is more than this amount */
|
|
34
|
+
/** Throw an error if the fee for the transaction is more than this amount; prevents overspending on fees during high congestion periods. */
|
|
24
35
|
maxFee?: AlgoAmount;
|
|
25
|
-
/** How many rounds the transaction should be valid for */
|
|
36
|
+
/** How many rounds the transaction should be valid for, if not specified then the registered default validity window will be used. */
|
|
26
37
|
validityWindow?: number;
|
|
27
38
|
/**
|
|
28
39
|
* Set the first round this transaction is valid.
|
|
29
40
|
* If left undefined, the value from algod will be used.
|
|
30
|
-
*
|
|
41
|
+
*
|
|
42
|
+
* We recommend you only set this when you intentionally want this to be some time in the future.
|
|
31
43
|
*/
|
|
32
44
|
firstValidRound?: bigint;
|
|
33
|
-
/** The last round this transaction is valid. It is recommended to use validityWindow instead */
|
|
45
|
+
/** The last round this transaction is valid. It is recommended to use `validityWindow` instead. */
|
|
34
46
|
lastValidRound?: bigint;
|
|
35
47
|
};
|
|
36
48
|
/** Parameters to define a payment transaction. */
|
|
37
49
|
export type PaymentParams = CommonTransactionParams & {
|
|
38
|
-
/**
|
|
50
|
+
/** The address of the account that will receive the Algo */
|
|
39
51
|
receiver: string;
|
|
40
52
|
/** Amount to send */
|
|
41
53
|
amount: AlgoAmount;
|
|
42
|
-
/** If given, close the sender account and send the remaining balance to this address
|
|
54
|
+
/** If given, close the sender account and send the remaining balance to this address
|
|
55
|
+
*
|
|
56
|
+
* *Warning:* Be careful with this parameter as it can lead to loss of funds if not used correctly.
|
|
57
|
+
*/
|
|
43
58
|
closeRemainderTo?: string;
|
|
44
59
|
};
|
|
45
|
-
/** Parameters to define an asset create transaction.
|
|
60
|
+
/** Parameters to define an asset create transaction.
|
|
61
|
+
*
|
|
62
|
+
* The account that sends this transaction will automatically be opted in to the asset and will hold all units after creation.
|
|
63
|
+
*/
|
|
46
64
|
export type AssetCreateParams = CommonTransactionParams & {
|
|
47
|
-
/** The total amount of the smallest divisible unit to create
|
|
65
|
+
/** The total amount of the smallest divisible (decimal) unit to create.
|
|
66
|
+
*
|
|
67
|
+
* For example, if `decimals` is, say, 2, then for every 100 `total` there would be 1 whole unit.
|
|
68
|
+
*
|
|
69
|
+
* This field can only be specified upon asset creation.
|
|
70
|
+
*/
|
|
48
71
|
total: bigint;
|
|
49
|
-
/** The amount of decimal places the asset should have
|
|
72
|
+
/** The amount of decimal places the asset should have.
|
|
73
|
+
*
|
|
74
|
+
* If unspecified then the asset will be in whole units (i.e. `0`).
|
|
75
|
+
*
|
|
76
|
+
* * If 0, the asset is not divisible;
|
|
77
|
+
* * If 1, the base unit of the asset is in tenths;
|
|
78
|
+
* * If 2, the base unit of the asset is in hundredths;
|
|
79
|
+
* * If 3, the base unit of the asset is in thousandths;
|
|
80
|
+
* * and so on up to 19 decimal places.
|
|
81
|
+
*
|
|
82
|
+
* This field can only be specified upon asset creation.
|
|
83
|
+
*/
|
|
50
84
|
decimals?: number;
|
|
51
|
-
/**
|
|
85
|
+
/** The optional name of the asset.
|
|
86
|
+
*
|
|
87
|
+
* Max size is 32 bytes.
|
|
88
|
+
*
|
|
89
|
+
* This field can only be specified upon asset creation.
|
|
90
|
+
*/
|
|
91
|
+
assetName?: string;
|
|
92
|
+
/** The optional name of the unit of this asset (e.g. ticker name).
|
|
93
|
+
*
|
|
94
|
+
* Max size is 8 bytes.
|
|
95
|
+
*
|
|
96
|
+
* This field can only be specified upon asset creation.
|
|
97
|
+
*/
|
|
98
|
+
unitName?: string;
|
|
99
|
+
/** Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).
|
|
100
|
+
*
|
|
101
|
+
* Max size is 96 bytes.
|
|
102
|
+
*
|
|
103
|
+
* This field can only be specified upon asset creation.
|
|
104
|
+
*/
|
|
105
|
+
url?: string;
|
|
106
|
+
/** 32-byte hash of some metadata that is relevant to your asset and/or asset holders.
|
|
107
|
+
*
|
|
108
|
+
* The format of this metadata is up to the application.
|
|
109
|
+
*
|
|
110
|
+
* This field can only be specified upon asset creation.
|
|
111
|
+
*/
|
|
112
|
+
metadataHash?: string | Uint8Array;
|
|
113
|
+
/** Whether the asset is frozen by default for all accounts.
|
|
114
|
+
* Defaults to `false`.
|
|
115
|
+
*
|
|
116
|
+
* If `true` then for anyone apart from the creator to hold the
|
|
117
|
+
* asset it needs to be unfrozen per account using an asset freeze
|
|
118
|
+
* transaction from the `freeze` account, which must be set on creation.
|
|
119
|
+
*
|
|
120
|
+
* This field can only be specified upon asset creation.
|
|
121
|
+
*/
|
|
52
122
|
defaultFrozen?: boolean;
|
|
53
|
-
/** The address
|
|
123
|
+
/** The address of the optional account that can manage the configuration of the asset and destroy it.
|
|
124
|
+
*
|
|
125
|
+
* The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
|
|
126
|
+
*
|
|
127
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the `manager` the asset becomes permanently immutable.
|
|
128
|
+
*/
|
|
54
129
|
manager?: string;
|
|
55
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
|
|
132
|
+
*
|
|
133
|
+
* This address has no specific authority in the protocol itself and is informational only.
|
|
134
|
+
*
|
|
135
|
+
* Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
|
|
136
|
+
* rely on this field to hold meaningful data.
|
|
137
|
+
*
|
|
138
|
+
* It can be used in the case where you want to signal to holders of your asset that the uncirculated units
|
|
139
|
+
* of the asset reside in an account that is different from the default creator account.
|
|
140
|
+
*
|
|
141
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
142
|
+
*/
|
|
56
143
|
reserve?: string;
|
|
57
|
-
/**
|
|
144
|
+
/**
|
|
145
|
+
* The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
|
|
146
|
+
*
|
|
147
|
+
* If empty, freezing is not permitted.
|
|
148
|
+
*
|
|
149
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
150
|
+
*/
|
|
58
151
|
freeze?: string;
|
|
59
|
-
/**
|
|
152
|
+
/**
|
|
153
|
+
* The address of the optional account that can clawback holdings of this asset from any account.
|
|
154
|
+
*
|
|
155
|
+
* **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
|
|
156
|
+
*
|
|
157
|
+
* If empty, clawback is not permitted.
|
|
158
|
+
*
|
|
159
|
+
* If not set (`undefined` or `""`) at asset creation or subsequently set to empty by the manager the field is permanently empty.
|
|
160
|
+
*/
|
|
60
161
|
clawback?: string;
|
|
61
|
-
/** The short ticker name for the asset */
|
|
62
|
-
unitName?: string;
|
|
63
|
-
/** The full name of the asset */
|
|
64
|
-
assetName?: string;
|
|
65
|
-
/** The metadata URL for the asset */
|
|
66
|
-
url?: string;
|
|
67
|
-
/** Hash of the metadata contained in the metadata URL */
|
|
68
|
-
metadataHash?: Uint8Array;
|
|
69
162
|
};
|
|
70
|
-
/** Parameters to define an asset
|
|
163
|
+
/** Parameters to define an asset reconfiguration transaction.
|
|
164
|
+
*
|
|
165
|
+
* **Note:** The manager, reserve, freeze, and clawback addresses
|
|
166
|
+
* are immutably empty if they are not set. If manager is not set then
|
|
167
|
+
* all fields are immutable from that point forward.
|
|
168
|
+
*/
|
|
71
169
|
export type AssetConfigParams = CommonTransactionParams & {
|
|
72
|
-
/** ID of the asset */
|
|
170
|
+
/** ID of the asset to reconfigure */
|
|
73
171
|
assetId: bigint;
|
|
74
|
-
/** The address
|
|
75
|
-
|
|
76
|
-
|
|
172
|
+
/** The address of the optional account that can manage the configuration of the asset and destroy it.
|
|
173
|
+
*
|
|
174
|
+
* The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.
|
|
175
|
+
*
|
|
176
|
+
* If not set (`undefined` or `""`) the asset will become permanently immutable.
|
|
177
|
+
*/
|
|
178
|
+
manager: string | undefined;
|
|
179
|
+
/**
|
|
180
|
+
* The address of the optional account that holds the reserve (uncirculated supply) units of the asset.
|
|
181
|
+
*
|
|
182
|
+
* This address has no specific authority in the protocol itself and is informational only.
|
|
183
|
+
*
|
|
184
|
+
* Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)
|
|
185
|
+
* rely on this field to hold meaningful data.
|
|
186
|
+
*
|
|
187
|
+
* It can be used in the case where you want to signal to holders of your asset that the uncirculated units
|
|
188
|
+
* of the asset reside in an account that is different from the default creator account.
|
|
189
|
+
*
|
|
190
|
+
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
191
|
+
*/
|
|
77
192
|
reserve?: string;
|
|
78
|
-
/**
|
|
193
|
+
/**
|
|
194
|
+
* The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.
|
|
195
|
+
*
|
|
196
|
+
* If empty, freezing is not permitted.
|
|
197
|
+
*
|
|
198
|
+
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
199
|
+
*/
|
|
79
200
|
freeze?: string;
|
|
80
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* The address of the optional account that can clawback holdings of this asset from any account.
|
|
203
|
+
*
|
|
204
|
+
* **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.
|
|
205
|
+
*
|
|
206
|
+
* If empty, clawback is not permitted.
|
|
207
|
+
*
|
|
208
|
+
* If not set (`undefined` or `""`) the field will become permanently empty.
|
|
209
|
+
*/
|
|
81
210
|
clawback?: string;
|
|
82
211
|
};
|
|
83
212
|
/** Parameters to define an asset freeze transaction. */
|
|
84
213
|
export type AssetFreezeParams = CommonTransactionParams & {
|
|
85
|
-
/** The ID of the asset */
|
|
214
|
+
/** The ID of the asset to freeze/unfreeze */
|
|
86
215
|
assetId: bigint;
|
|
87
|
-
/** The account to freeze or unfreeze */
|
|
216
|
+
/** The address of the account to freeze or unfreeze */
|
|
88
217
|
account: string;
|
|
89
218
|
/** Whether the assets in the account should be frozen */
|
|
90
219
|
frozen: boolean;
|
|
91
220
|
};
|
|
92
|
-
/** Parameters to define an asset destroy transaction.
|
|
221
|
+
/** Parameters to define an asset destroy transaction.
|
|
222
|
+
*
|
|
223
|
+
* Created assets can be destroyed only by the asset manager account. All of the assets must be owned by the creator of the asset before the asset can be deleted.
|
|
224
|
+
*/
|
|
93
225
|
export type AssetDestroyParams = CommonTransactionParams & {
|
|
94
|
-
/** ID of the asset */
|
|
226
|
+
/** ID of the asset to destroy */
|
|
95
227
|
assetId: bigint;
|
|
96
228
|
};
|
|
97
229
|
/** Parameters to define an asset transfer transaction. */
|
|
98
230
|
export type AssetTransferParams = CommonTransactionParams & {
|
|
99
|
-
/** ID of the asset */
|
|
231
|
+
/** ID of the asset to transfer. */
|
|
100
232
|
assetId: bigint;
|
|
101
|
-
/** Amount of the asset to transfer (smallest divisible
|
|
233
|
+
/** Amount of the asset to transfer (in smallest divisible (decimal) units). */
|
|
102
234
|
amount: bigint;
|
|
103
|
-
/** The account
|
|
235
|
+
/** The address of the account that will receive the asset unit(s). */
|
|
104
236
|
receiver: string;
|
|
105
|
-
/**
|
|
237
|
+
/** Optional address of an account to clawback the asset from.
|
|
238
|
+
*
|
|
239
|
+
* Requires the sender to be the clawback account.
|
|
240
|
+
*
|
|
241
|
+
* **Warning:** Be careful with this parameter as it can lead to unexpected loss of funds if not used correctly.
|
|
242
|
+
*/
|
|
106
243
|
clawbackTarget?: string;
|
|
107
|
-
/**
|
|
244
|
+
/** Optional address of an account to close the asset position to.
|
|
245
|
+
*
|
|
246
|
+
* **Warning:** Be careful with this parameter as it can lead to loss of funds if not used correctly.
|
|
247
|
+
*/
|
|
108
248
|
closeAssetTo?: string;
|
|
109
249
|
};
|
|
110
250
|
/** Parameters to define an asset opt-in transaction. */
|
|
111
251
|
export type AssetOptInParams = CommonTransactionParams & {
|
|
112
|
-
/** ID of the asset */
|
|
252
|
+
/** ID of the asset that will be opted-in to. */
|
|
253
|
+
assetId: bigint;
|
|
254
|
+
};
|
|
255
|
+
/** Parameters to define an asset opt-out transaction. */
|
|
256
|
+
export type AssetOptOutParams = CommonTransactionParams & {
|
|
257
|
+
/** ID of the asset that will be opted-out of. */
|
|
113
258
|
assetId: bigint;
|
|
259
|
+
/**
|
|
260
|
+
* The address of the asset creator account to close the asset
|
|
261
|
+
* position to (any remaining asset units will be sent to this account).
|
|
262
|
+
*/
|
|
263
|
+
creator: string;
|
|
114
264
|
};
|
|
115
265
|
/** Parameters to define an online key registration transaction. */
|
|
116
266
|
export type OnlineKeyRegistrationParams = CommonTransactionParams & {
|
|
@@ -180,11 +330,11 @@ export type MethodCallParams = CommonTransactionParams & Omit<AppCallParams, 'ar
|
|
|
180
330
|
export interface ExecuteParams {
|
|
181
331
|
/** The number of rounds to wait for confirmation. By default until the latest lastValid has past. */
|
|
182
332
|
maxRoundsToWaitForConfirmation?: number;
|
|
183
|
-
/** Whether to suppress log messages from transaction send, default: do not suppress */
|
|
333
|
+
/** Whether to suppress log messages from transaction send, default: do not suppress. */
|
|
184
334
|
suppressLog?: boolean;
|
|
185
335
|
}
|
|
186
|
-
/** Parameters to create an `
|
|
187
|
-
export type
|
|
336
|
+
/** Parameters to create an `AlgoKitComposer`. */
|
|
337
|
+
export type AlgoKitComposerParams = {
|
|
188
338
|
/** The algod client to use to get suggestedParams and send the transaction group */
|
|
189
339
|
algod: algosdk.Algodv2;
|
|
190
340
|
/** The function used to get the TransactionSigner for a given address */
|
|
@@ -196,13 +346,8 @@ export type AlgokitComposerParams = {
|
|
|
196
346
|
*/
|
|
197
347
|
defaultValidityWindow?: number;
|
|
198
348
|
};
|
|
199
|
-
/** AlgoKit Composer helps you compose and execute transactions as a transaction group.
|
|
200
|
-
|
|
201
|
-
* Note: this class is a new Beta feature and may be subject to change.
|
|
202
|
-
*
|
|
203
|
-
* @beta
|
|
204
|
-
*/
|
|
205
|
-
export default class AlgokitComposer {
|
|
349
|
+
/** AlgoKit Composer helps you compose and execute transactions as a transaction group. */
|
|
350
|
+
export default class AlgoKitComposer {
|
|
206
351
|
/** The ATC used to compose the group */
|
|
207
352
|
private atc;
|
|
208
353
|
/** Map of txid to ABI method */
|
|
@@ -211,7 +356,7 @@ export default class AlgokitComposer {
|
|
|
211
356
|
private txns;
|
|
212
357
|
/** The algod client used by the composer. */
|
|
213
358
|
private algod;
|
|
214
|
-
/** An async function that will return
|
|
359
|
+
/** An async function that will return suggested params for the transaction. */
|
|
215
360
|
private getSuggestedParams;
|
|
216
361
|
/** A function that takes in an address and return a signer function for that address. */
|
|
217
362
|
private getSigner;
|
|
@@ -223,49 +368,55 @@ export default class AlgokitComposer {
|
|
|
223
368
|
* Create an `AlgoKitComposer`.
|
|
224
369
|
* @param params The configuration for this composer
|
|
225
370
|
*/
|
|
226
|
-
constructor(params:
|
|
371
|
+
constructor(params: AlgoKitComposerParams);
|
|
227
372
|
/**
|
|
228
373
|
* Add a payment transaction to the transaction group.
|
|
229
374
|
* @param params The payment transaction parameters
|
|
230
375
|
* @returns The composer so you can chain method calls
|
|
231
376
|
*/
|
|
232
|
-
addPayment(params: PaymentParams):
|
|
377
|
+
addPayment(params: PaymentParams): AlgoKitComposer;
|
|
233
378
|
/**
|
|
234
379
|
* Add an asset create transaction to the transaction group.
|
|
235
380
|
* @param params The asset create transaction parameters
|
|
236
381
|
* @returns The composer so you can chain method calls
|
|
237
382
|
*/
|
|
238
|
-
addAssetCreate(params: AssetCreateParams):
|
|
383
|
+
addAssetCreate(params: AssetCreateParams): AlgoKitComposer;
|
|
239
384
|
/**
|
|
240
385
|
* Add an asset config transaction to the transaction group.
|
|
241
386
|
* @param params The asset config transaction parameters
|
|
242
387
|
* @returns The composer so you can chain method calls
|
|
243
388
|
*/
|
|
244
|
-
addAssetConfig(params: AssetConfigParams):
|
|
389
|
+
addAssetConfig(params: AssetConfigParams): AlgoKitComposer;
|
|
245
390
|
/**
|
|
246
391
|
* Add an asset freeze transaction to the transaction group.
|
|
247
392
|
* @param params The asset freeze transaction parameters
|
|
248
393
|
* @returns The composer so you can chain method calls
|
|
249
394
|
*/
|
|
250
|
-
addAssetFreeze(params: AssetFreezeParams):
|
|
395
|
+
addAssetFreeze(params: AssetFreezeParams): AlgoKitComposer;
|
|
251
396
|
/**
|
|
252
397
|
* Add an asset destroy transaction to the transaction group.
|
|
253
398
|
* @param params The asset destroy transaction parameters
|
|
254
399
|
* @returns The composer so you can chain method calls
|
|
255
400
|
*/
|
|
256
|
-
addAssetDestroy(params: AssetDestroyParams):
|
|
401
|
+
addAssetDestroy(params: AssetDestroyParams): AlgoKitComposer;
|
|
257
402
|
/**
|
|
258
403
|
* Add an asset transfer transaction to the transaction group.
|
|
259
404
|
* @param params The asset transfer transaction parameters
|
|
260
405
|
* @returns The composer so you can chain method calls
|
|
261
406
|
*/
|
|
262
|
-
addAssetTransfer(params: AssetTransferParams):
|
|
407
|
+
addAssetTransfer(params: AssetTransferParams): AlgoKitComposer;
|
|
263
408
|
/**
|
|
264
409
|
* Add an asset opt-in transaction to the transaction group.
|
|
265
410
|
* @param params The asset opt-in transaction parameters
|
|
266
411
|
* @returns The composer so you can chain method calls
|
|
267
412
|
*/
|
|
268
|
-
addAssetOptIn(params: AssetOptInParams):
|
|
413
|
+
addAssetOptIn(params: AssetOptInParams): AlgoKitComposer;
|
|
414
|
+
/**
|
|
415
|
+
* Add an asset opt-out transaction to the transaction group.
|
|
416
|
+
* @param params The asset opt-out transaction parameters
|
|
417
|
+
* @returns The composer so you can chain method calls
|
|
418
|
+
*/
|
|
419
|
+
addAssetOptOut(params: AssetOptOutParams): AlgoKitComposer;
|
|
269
420
|
/**
|
|
270
421
|
* Add an application call transaction to the transaction group.
|
|
271
422
|
*
|
|
@@ -273,7 +424,7 @@ export default class AlgokitComposer {
|
|
|
273
424
|
* @param params The application call transaction parameters
|
|
274
425
|
* @returns The composer so you can chain method calls
|
|
275
426
|
*/
|
|
276
|
-
addAppCall(params: AppCallParams):
|
|
427
|
+
addAppCall(params: AppCallParams): AlgoKitComposer;
|
|
277
428
|
/**
|
|
278
429
|
* Add an ABI method application call transaction to the transaction group.
|
|
279
430
|
*
|
|
@@ -287,13 +438,13 @@ export default class AlgokitComposer {
|
|
|
287
438
|
* @param params The online key registration transaction parameters
|
|
288
439
|
* @returns The composer so you can chain method calls
|
|
289
440
|
*/
|
|
290
|
-
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams):
|
|
441
|
+
addOnlineKeyRegistration(params: OnlineKeyRegistrationParams): AlgoKitComposer;
|
|
291
442
|
/**
|
|
292
443
|
* Add the transactions within an `AtomicTransactionComposer` to the transaction group.
|
|
293
444
|
* @param atc The `AtomicTransactionComposer` to build transactions from and add to the group
|
|
294
445
|
* @returns The composer so you can chain method calls
|
|
295
446
|
*/
|
|
296
|
-
addAtc(atc: algosdk.AtomicTransactionComposer):
|
|
447
|
+
addAtc(atc: algosdk.AtomicTransactionComposer): AlgoKitComposer;
|
|
297
448
|
private buildAtc;
|
|
298
449
|
private commonTxnBuildStep;
|
|
299
450
|
private buildMethodCall;
|
|
@@ -306,6 +457,13 @@ export default class AlgokitComposer {
|
|
|
306
457
|
private buildAppCall;
|
|
307
458
|
private buildKeyReg;
|
|
308
459
|
private buildTxn;
|
|
460
|
+
private buildTxnWithSigner;
|
|
461
|
+
/**
|
|
462
|
+
* Compose all of the transactions without signers and return the transaction objects directly.
|
|
463
|
+
*
|
|
464
|
+
* @returns The array of built transactions
|
|
465
|
+
*/
|
|
466
|
+
buildTransactions(): Promise<algosdk.Transaction[]>;
|
|
309
467
|
/**
|
|
310
468
|
* Compose all of the transactions in a single atomic transaction group and an atomic transaction composer.
|
|
311
469
|
*
|
package/types/composer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/types/composer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AACxC,OAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAA;AAI5D,oDAAoD;AACpD,MAAM,MAAM,uBAAuB,GAAG;IACpC,
|
|
1
|
+
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../../src/types/composer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAErC,OAAO,EAAE,oCAAoC,EAAE,MAAM,eAAe,CAAA;AACpE,OAAO,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;AACxC,OAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAA;AAI5D,eAAO,MAAM,0BAA0B,KAAK,CAAA;AAE5C,oDAAoD;AACpD,MAAM,MAAM,uBAAuB,GAAG;IACpC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,GAAG,wBAAwB,CAAA;IAC7D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;IAC1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,UAAU,GAAG,MAAM,CAAA;IAC3B,6IAA6I;IAC7I,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,mGAA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