@algorandfoundation/algokit-utils 6.2.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/asset.mjs
CHANGED
|
@@ -1,54 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { legacySendTransactionBridge } from './transaction/legacy-bridge.mjs';
|
|
2
|
+
import { AlgorandClient } from './types/algorand-client.mjs';
|
|
3
|
+
import { ClientManager } from './types/client-manager.mjs';
|
|
4
|
+
import { getSenderAddress, encodeTransactionNote } from './transaction/transaction.mjs';
|
|
4
5
|
|
|
5
|
-
var ValidationType;
|
|
6
|
-
(function (ValidationType) {
|
|
7
|
-
ValidationType[ValidationType["OptIn"] = 0] = "OptIn";
|
|
8
|
-
ValidationType[ValidationType["OptOut"] = 1] = "OptOut";
|
|
9
|
-
})(ValidationType || (ValidationType = {}));
|
|
10
|
-
function* chunks(arr, n) {
|
|
11
|
-
for (let i = 0; i < arr.length; i += n)
|
|
12
|
-
yield arr.slice(i, i + n);
|
|
13
|
-
}
|
|
14
|
-
async function ensureAssetBalanceConditions(account, assetIds, validationType, algod) {
|
|
15
|
-
const accountAddress = getSenderAddress(account);
|
|
16
|
-
const accountInfo = await algod.accountInformation(accountAddress).do();
|
|
17
|
-
const assetPromises = assetIds.map(async (assetId) => {
|
|
18
|
-
if (validationType === ValidationType.OptIn) {
|
|
19
|
-
if (accountInfo.assets.find((a) => a['asset-id'] === assetId)) {
|
|
20
|
-
Config.logger.debug(`Account ${accountAddress} has already opted-in to asset ${assetId}`);
|
|
21
|
-
return assetId;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
else if (validationType === ValidationType.OptOut) {
|
|
25
|
-
try {
|
|
26
|
-
const accountAssetInfo = await algod.accountAssetInformation(accountAddress, assetId).do();
|
|
27
|
-
if (accountAssetInfo['asset-holding']['amount'] !== 0) {
|
|
28
|
-
Config.logger.debug(`Asset ${assetId} is not with zero balance`);
|
|
29
|
-
return assetId;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
Config.logger.debug(`Account ${accountAddress} does not have asset ${assetId}`);
|
|
34
|
-
return assetId;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
38
|
-
});
|
|
39
|
-
const invalidAssets = (await Promise.all(assetPromises)).filter((assetId) => assetId !== null);
|
|
40
|
-
if (invalidAssets.length > 0) {
|
|
41
|
-
let errorMessage = '';
|
|
42
|
-
if (validationType === ValidationType.OptIn) {
|
|
43
|
-
errorMessage = `Asset${invalidAssets.length === 1 ? '' : 's'} ${invalidAssets.join(', ')} cannot be opted in. Ensure that they are valid and that the account has not previously opted into them.`;
|
|
44
|
-
}
|
|
45
|
-
else if (validationType === ValidationType.OptOut) {
|
|
46
|
-
errorMessage = `Asset${invalidAssets.length === 1 ? '' : 's'} ${invalidAssets.join(', ')} cannot be opted out. Ensure that they are valid and that the account has previously opted into them and holds zero balance.`;
|
|
47
|
-
}
|
|
48
|
-
throw new Error(errorMessage);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
6
|
/**
|
|
7
|
+
* @deprecated use `algorandClient.send.assetCreate()` / `algorandClient.transaction.assetCreate()` instead
|
|
8
|
+
*
|
|
52
9
|
* Create an Algorand Standard Asset (ASA).
|
|
53
10
|
* @param create The asset creation definition
|
|
54
11
|
* @param algod An algod client
|
|
@@ -60,36 +17,27 @@ async function ensureAssetBalanceConditions(account, assetIds, validationType, a
|
|
|
60
17
|
* ```
|
|
61
18
|
*/
|
|
62
19
|
async function createAsset(create, algod) {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
81
|
-
const encodedLease = encodeLease(lease);
|
|
82
|
-
if (encodedLease) {
|
|
83
|
-
transaction.addLease(encodedLease);
|
|
84
|
-
}
|
|
85
|
-
const result = await sendTransaction({ transaction, from: creator, sendParams }, algod);
|
|
86
|
-
if (!sendParams.skipSending) {
|
|
87
|
-
Config.getLogger(sendParams.suppressLog).info(`Successfully created asset ${name ? `${name} ` : ''}${unit ? `(${unit}) ` : ''} with ${total} units and ${decimals} decimals via transaction ${transaction.txID()} with asset index ${result.confirmation?.assetIndex} and creator ${getSenderAddress(creator)}.`);
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
return { transaction: result.transaction };
|
|
20
|
+
const params = {
|
|
21
|
+
sender: getSenderAddress(create.creator),
|
|
22
|
+
total: BigInt(create.total),
|
|
23
|
+
decimals: create.decimals,
|
|
24
|
+
assetName: create.name,
|
|
25
|
+
unitName: create.unit,
|
|
26
|
+
manager: create.manager ? getSenderAddress(create.manager) : undefined,
|
|
27
|
+
clawback: create.clawbackAccount ? getSenderAddress(create.clawbackAccount) : undefined,
|
|
28
|
+
freeze: create.freezeAccount ? getSenderAddress(create.freezeAccount) : undefined,
|
|
29
|
+
reserve: create.reserveAccount ? getSenderAddress(create.reserveAccount) : undefined,
|
|
30
|
+
defaultFrozen: create.frozenByDefault,
|
|
31
|
+
lease: create.lease,
|
|
32
|
+
metadataHash: create.metadataHash,
|
|
33
|
+
note: encodeTransactionNote(create.note),
|
|
34
|
+
url: create.url,
|
|
35
|
+
};
|
|
36
|
+
return (await legacySendTransactionBridge(algod, create.creator, create, params, (client) => client.assetCreate, (client) => client.assetCreate));
|
|
91
37
|
}
|
|
92
38
|
/**
|
|
39
|
+
* @deprecated use `algorandClient.send.assetOptIn()` / `algorandClient.transaction.assetOptIn()` instead
|
|
40
|
+
*
|
|
93
41
|
* Opt-in an account to an asset.
|
|
94
42
|
* @param optIn The opt-in definition
|
|
95
43
|
* @param algod An algod client
|
|
@@ -101,28 +49,17 @@ async function createAsset(create, algod) {
|
|
|
101
49
|
* ```
|
|
102
50
|
*/
|
|
103
51
|
async function assetOptIn(optIn, algod) {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
revocationTarget: undefined,
|
|
112
|
-
closeRemainderTo: undefined,
|
|
113
|
-
suggestedParams: await getTransactionParams(transactionParams, algod),
|
|
114
|
-
note: encodeTransactionNote(note),
|
|
115
|
-
});
|
|
116
|
-
const encodedLease = encodeLease(lease);
|
|
117
|
-
if (encodedLease) {
|
|
118
|
-
transaction.addLease(encodedLease);
|
|
119
|
-
}
|
|
120
|
-
if (!sendParams.skipSending) {
|
|
121
|
-
Config.getLogger(sendParams.suppressLog).debug(`Opted-in ${getSenderAddress(account)} to asset ${assetId}`);
|
|
122
|
-
}
|
|
123
|
-
return sendTransaction({ transaction, from: account, sendParams }, algod);
|
|
52
|
+
const params = {
|
|
53
|
+
assetId: BigInt(optIn.assetId),
|
|
54
|
+
sender: getSenderAddress(optIn.account),
|
|
55
|
+
note: encodeTransactionNote(optIn.note),
|
|
56
|
+
lease: optIn.lease,
|
|
57
|
+
};
|
|
58
|
+
return legacySendTransactionBridge(algod, optIn.account, optIn, params, (c) => c.assetOptIn, (c) => c.assetOptIn);
|
|
124
59
|
}
|
|
125
60
|
/**
|
|
61
|
+
* @deprecated use `algorandClient.send.assetOptOut()` / `algorandClient.transaction.assetOptOut()` instead
|
|
62
|
+
*
|
|
126
63
|
* Opt-out an account from an asset.
|
|
127
64
|
* @param optOut The opt-in definition
|
|
128
65
|
* @param algod An algod client
|
|
@@ -134,32 +71,19 @@ async function assetOptIn(optIn, algod) {
|
|
|
134
71
|
* ```
|
|
135
72
|
*/
|
|
136
73
|
async function assetOptOut(optOut, algod) {
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
amount: 0,
|
|
147
|
-
rekeyTo: undefined,
|
|
148
|
-
revocationTarget: undefined,
|
|
149
|
-
closeRemainderTo: assetCreatorAddress,
|
|
150
|
-
suggestedParams: await getTransactionParams(transactionParams, algod),
|
|
151
|
-
note: encodeTransactionNote(note),
|
|
152
|
-
});
|
|
153
|
-
const encodedLease = encodeLease(lease);
|
|
154
|
-
if (encodedLease) {
|
|
155
|
-
transaction.addLease(encodedLease);
|
|
156
|
-
}
|
|
157
|
-
if (!sendParams.skipSending) {
|
|
158
|
-
Config.getLogger(sendParams.suppressLog).debug(`Opted-out ${getSenderAddress(account)} from asset ${assetId}`);
|
|
159
|
-
}
|
|
160
|
-
return sendTransaction({ transaction, from: account, sendParams }, algod);
|
|
74
|
+
const assetCreatorAddress = optOut.assetCreatorAddress ?? (await algod.getAssetByID(optOut.assetId).do()).params.creator;
|
|
75
|
+
const params = {
|
|
76
|
+
assetId: BigInt(optOut.assetId),
|
|
77
|
+
creator: assetCreatorAddress,
|
|
78
|
+
sender: getSenderAddress(optOut.account),
|
|
79
|
+
note: encodeTransactionNote(optOut.note),
|
|
80
|
+
lease: optOut.lease,
|
|
81
|
+
};
|
|
82
|
+
return legacySendTransactionBridge(algod, optOut.account, optOut, params, (c) => c.assetOptOut, (c) => (params) => c.assetOptOut({ ...params, ensureZeroBalance: optOut.ensureZeroBalance ?? true }));
|
|
161
83
|
}
|
|
162
84
|
/**
|
|
85
|
+
* @deprecated use `algorandClient.asset.bulkOptIn()` instead
|
|
86
|
+
*
|
|
163
87
|
* Opt in to a list of assets on the Algorand blockchain.
|
|
164
88
|
*
|
|
165
89
|
* @param optIn - The bulk opt-in request.
|
|
@@ -169,47 +93,23 @@ async function assetOptOut(optOut, algod) {
|
|
|
169
93
|
* @example algokit.bulkOptIn({ account: account, assetIds: [12345, 67890] }, algod)
|
|
170
94
|
*/
|
|
171
95
|
async function assetBulkOptIn(optIn, algod) {
|
|
172
|
-
|
|
173
|
-
const result = {}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
assetId,
|
|
184
|
-
transactionParams: suggestedParams,
|
|
185
|
-
note,
|
|
186
|
-
maxFee,
|
|
187
|
-
skipSending: true,
|
|
188
|
-
suppressLog: true,
|
|
189
|
-
}, algod)).transaction,
|
|
190
|
-
signer: account,
|
|
191
|
-
})));
|
|
192
|
-
const txnGrp = {
|
|
193
|
-
transactions: transactionsToSign,
|
|
194
|
-
signer: account,
|
|
195
|
-
sendParams: {
|
|
196
|
-
suppressLog: true,
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
const sendGroupOfTransactionsResult = await sendGroupOfTransactions(txnGrp, algod);
|
|
200
|
-
assetGroup.map((assetId, index) => {
|
|
201
|
-
result[assetId] = sendGroupOfTransactionsResult.txIds[index];
|
|
202
|
-
Config.getLogger(suppressLog).info(`Successfully opted in ${getSenderAddress(account)} for asset ${assetId} with transaction ID ${sendGroupOfTransactionsResult.txIds[index]},
|
|
203
|
-
grouped under ${sendGroupOfTransactionsResult.groupId} round ${sendGroupOfTransactionsResult.confirmations?.[0]?.confirmedRound}.`);
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
throw new Error(`Received error trying to opt in ${e}`);
|
|
208
|
-
}
|
|
96
|
+
new ClientManager({ algod });
|
|
97
|
+
const result = await AlgorandClient.fromClients({ algod })
|
|
98
|
+
.setSignerFromAccount(optIn.account)
|
|
99
|
+
.asset.bulkOptIn(getSenderAddress(optIn.account), optIn.assetIds.map(BigInt), {
|
|
100
|
+
note: encodeTransactionNote(optIn.note),
|
|
101
|
+
maxFee: optIn.maxFee,
|
|
102
|
+
suppressLog: optIn.suppressLog,
|
|
103
|
+
});
|
|
104
|
+
const returnResult = {};
|
|
105
|
+
for (const r of result) {
|
|
106
|
+
returnResult[Number(r.assetId)] = r.transactionId;
|
|
209
107
|
}
|
|
210
|
-
return
|
|
108
|
+
return returnResult;
|
|
211
109
|
}
|
|
212
110
|
/**
|
|
111
|
+
* @deprecated use `algorandClient.asset.bulkOptOut()` instead
|
|
112
|
+
*
|
|
213
113
|
* Opt out of multiple assets in Algorand blockchain.
|
|
214
114
|
*
|
|
215
115
|
* @param optOut The bulk opt-out request.
|
|
@@ -219,47 +119,20 @@ async function assetBulkOptIn(optIn, algod) {
|
|
|
219
119
|
* @example algokit.bulkOptOut({ account: account, assetIds: [12345, 67890] }, algod)
|
|
220
120
|
*/
|
|
221
121
|
async function assetBulkOptOut(optOut, algod) {
|
|
222
|
-
|
|
223
|
-
const result = {}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
assetId: asset.index,
|
|
235
|
-
assetCreatorAddress: asset.params.creator,
|
|
236
|
-
transactionParams: suggestedParams,
|
|
237
|
-
note,
|
|
238
|
-
maxFee,
|
|
239
|
-
skipSending: true,
|
|
240
|
-
suppressLog: true,
|
|
241
|
-
}, algod)).transaction,
|
|
242
|
-
signer: account,
|
|
243
|
-
})));
|
|
244
|
-
const txnGrp = {
|
|
245
|
-
transactions: transactionToSign,
|
|
246
|
-
signer: account,
|
|
247
|
-
sendParams: {
|
|
248
|
-
suppressLog: true,
|
|
249
|
-
},
|
|
250
|
-
};
|
|
251
|
-
const sendGroupOfTransactionsResult = await sendGroupOfTransactions(txnGrp, algod);
|
|
252
|
-
assetGroup.map((asset, index) => {
|
|
253
|
-
result[asset.index] = sendGroupOfTransactionsResult.txIds[index];
|
|
254
|
-
Config.getLogger(suppressLog).info(`Successfully opted out ${getSenderAddress(account)} from asset ${asset.index} with transaction ID ${sendGroupOfTransactionsResult.txIds[index]},
|
|
255
|
-
grouped under ${sendGroupOfTransactionsResult.groupId} round ${sendGroupOfTransactionsResult.confirmations?.[0]?.confirmedRound}.`);
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
catch (e) {
|
|
259
|
-
throw new Error(`Received error trying to opt out ${e}`);
|
|
260
|
-
}
|
|
122
|
+
new ClientManager({ algod });
|
|
123
|
+
const result = await AlgorandClient.fromClients({ algod })
|
|
124
|
+
.setSignerFromAccount(optOut.account)
|
|
125
|
+
.asset.bulkOptOut(getSenderAddress(optOut.account), optOut.assetIds.map(BigInt), {
|
|
126
|
+
ensureZeroBalance: optOut.validateBalances ?? true,
|
|
127
|
+
note: encodeTransactionNote(optOut.note),
|
|
128
|
+
maxFee: optOut.maxFee,
|
|
129
|
+
suppressLog: optOut.suppressLog,
|
|
130
|
+
});
|
|
131
|
+
const returnResult = {};
|
|
132
|
+
for (const r of result) {
|
|
133
|
+
returnResult[Number(r.assetId)] = r.transactionId;
|
|
261
134
|
}
|
|
262
|
-
return
|
|
135
|
+
return returnResult;
|
|
263
136
|
}
|
|
264
137
|
|
|
265
138
|
export { assetBulkOptIn, assetBulkOptOut, assetOptIn, assetOptOut, createAsset };
|
package/asset.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.mjs","sources":["../src/asset.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"asset.mjs","sources":["../src/asset.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;;;AAYG;AACI,eAAe,WAAW,CAC/B,MAAyB,EACzB,KAAc,EAAA;AAEd,IAAA,MAAM,MAAM,GAAsB;AAChC,QAAA,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC;AACxC,QAAA,KAAK,EAAE,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J,MAAM,YAAY,GAA2B,EAAE,CAAA;AAC/C,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;AACtB,QAAA,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,CAAA;KAClD;AACD,IAAA,OAAO,YAAY,CAAA;AACrB;;;;"}
|
package/dispenser-client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './types/dispenser-client';
|
|
2
2
|
/**
|
|
3
|
-
* @deprecated Use `clientManager.getTestNetDispenser` instead
|
|
3
|
+
* @deprecated Use `clientManager.getTestNetDispenser` or `clientManager.getTestNetDispenserFromEnvironment` instead
|
|
4
4
|
*
|
|
5
5
|
* Create a new TestNetDispenserApiClient instance.
|
|
6
6
|
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
package/dispenser-client.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var types_dispenserClient = require('./types/dispenser-client.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated Use `clientManager.getTestNetDispenser` instead
|
|
6
|
+
* @deprecated Use `clientManager.getTestNetDispenser` or `clientManager.getTestNetDispenserFromEnvironment` instead
|
|
7
7
|
*
|
|
8
8
|
* Create a new TestNetDispenserApiClient instance.
|
|
9
9
|
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
|
@@ -21,7 +21,7 @@ var types_dispenserClient = require('./types/dispenser-client.js');
|
|
|
21
21
|
* @returns An instance of the TestNetDispenserApiClient class.
|
|
22
22
|
*/
|
|
23
23
|
function getTestNetDispenserApiClient(params = null) {
|
|
24
|
-
return new types_dispenserClient.TestNetDispenserApiClient(params);
|
|
24
|
+
return new types_dispenserClient.TestNetDispenserApiClient(params === null ? undefined : params);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
exports.getTestNetDispenserApiClient = getTestNetDispenserApiClient;
|
package/dispenser-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispenser-client.js","sources":["../src/dispenser-client.ts"],"sourcesContent":[null],"names":["TestNetDispenserApiClient"],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,MAAA,GAAiD,IAAI,EAAA;AAChG,IAAA,OAAO,IAAIA,+CAAyB,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"dispenser-client.js","sources":["../src/dispenser-client.ts"],"sourcesContent":[null],"names":["TestNetDispenserApiClient"],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,MAAA,GAAiD,IAAI,EAAA;AAChG,IAAA,OAAO,IAAIA,+CAAyB,CAAC,MAAM,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,CAAA;AAC5E;;;;"}
|
package/dispenser-client.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TestNetDispenserApiClient } from './types/dispenser-client.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @deprecated Use `clientManager.getTestNetDispenser` instead
|
|
4
|
+
* @deprecated Use `clientManager.getTestNetDispenser` or `clientManager.getTestNetDispenserFromEnvironment` instead
|
|
5
5
|
*
|
|
6
6
|
* Create a new TestNetDispenserApiClient instance.
|
|
7
7
|
* Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.
|
|
@@ -19,7 +19,7 @@ import { TestNetDispenserApiClient } from './types/dispenser-client.mjs';
|
|
|
19
19
|
* @returns An instance of the TestNetDispenserApiClient class.
|
|
20
20
|
*/
|
|
21
21
|
function getTestNetDispenserApiClient(params = null) {
|
|
22
|
-
return new TestNetDispenserApiClient(params);
|
|
22
|
+
return new TestNetDispenserApiClient(params === null ? undefined : params);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export { getTestNetDispenserApiClient };
|
package/dispenser-client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispenser-client.mjs","sources":["../src/dispenser-client.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,MAAA,GAAiD,IAAI,EAAA;AAChG,IAAA,OAAO,IAAI,yBAAyB,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"dispenser-client.mjs","sources":["../src/dispenser-client.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,MAAA,GAAiD,IAAI,EAAA;AAChG,IAAA,OAAO,IAAI,yBAAyB,CAAC,MAAM,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,CAAA;AAC5E;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
export * from './app';
|
|
2
2
|
export * from './app-client';
|
|
3
3
|
export * from './app-deploy';
|
|
4
|
-
export * from './asset';
|
|
5
4
|
export * from './debugging';
|
|
6
|
-
export * from './indexer-lookup';
|
|
7
5
|
export * from './transaction';
|
|
8
|
-
export * from './transfer';
|
|
9
6
|
export * from './account';
|
|
7
|
+
export * from './asset';
|
|
10
8
|
export * from './dispenser-client';
|
|
9
|
+
export * from './indexer-lookup';
|
|
11
10
|
export * from './localnet';
|
|
12
11
|
export * from './network-client';
|
|
12
|
+
export * from './transfer';
|
|
13
13
|
export * from './amount';
|
|
14
14
|
export * from './config';
|
|
15
|
+
export * as indexer from './indexer-lookup';
|
|
15
16
|
export { AlgorandClient } from './types/algorand-client';
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAG7B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAG1B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA"}
|
package/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var app = require('./app.js');
|
|
|
4
4
|
var appClient = require('./app-client.js');
|
|
5
5
|
var appDeploy = require('./app-deploy.js');
|
|
6
6
|
var asset = require('./asset.js');
|
|
7
|
-
var indexerLookup = require('./indexer-lookup.js');
|
|
8
7
|
var dispenserClient = require('./dispenser-client.js');
|
|
8
|
+
var indexerLookup = require('./indexer-lookup.js');
|
|
9
9
|
var networkClient = require('./network-client.js');
|
|
10
10
|
var amount = require('./amount.js');
|
|
11
11
|
var config = require('./config.js');
|
|
@@ -14,8 +14,6 @@ var debugging = require('./debugging/debugging.js');
|
|
|
14
14
|
var simulateAndPersistResponse = require('./debugging/simulate-and-persist-response.js');
|
|
15
15
|
var performAtomicTransactionComposerSimulate = require('./transaction/perform-atomic-transaction-composer-simulate.js');
|
|
16
16
|
var transaction = require('./transaction/transaction.js');
|
|
17
|
-
var transfer = require('./transfer/transfer.js');
|
|
18
|
-
var transferAlgos = require('./transfer/transfer-algos.js');
|
|
19
17
|
var account = require('./account/account.js');
|
|
20
18
|
var getAccount = require('./account/get-account.js');
|
|
21
19
|
var getAccountConfigFromEnvironment = require('./account/get-account-config-from-environment.js');
|
|
@@ -25,6 +23,8 @@ var getKmdWalletAccount = require('./localnet/get-kmd-wallet-account.js');
|
|
|
25
23
|
var getLocalnetDispenserAccount = require('./localnet/get-localnet-dispenser-account.js');
|
|
26
24
|
var getOrCreateKmdWalletAccount = require('./localnet/get-or-create-kmd-wallet-account.js');
|
|
27
25
|
var isLocalnet = require('./localnet/is-localnet.js');
|
|
26
|
+
var transfer = require('./transfer/transfer.js');
|
|
27
|
+
var transferAlgos = require('./transfer/transfer-algos.js');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
@@ -63,13 +63,14 @@ exports.assetBulkOptOut = asset.assetBulkOptOut;
|
|
|
63
63
|
exports.assetOptIn = asset.assetOptIn;
|
|
64
64
|
exports.assetOptOut = asset.assetOptOut;
|
|
65
65
|
exports.createAsset = asset.createAsset;
|
|
66
|
+
exports.getTestNetDispenserApiClient = dispenserClient.getTestNetDispenserApiClient;
|
|
66
67
|
exports.executePaginatedRequest = indexerLookup.executePaginatedRequest;
|
|
68
|
+
exports.indexer = indexerLookup;
|
|
67
69
|
exports.lookupAccountByAddress = indexerLookup.lookupAccountByAddress;
|
|
68
70
|
exports.lookupAccountCreatedApplicationByAddress = indexerLookup.lookupAccountCreatedApplicationByAddress;
|
|
69
71
|
exports.lookupAssetHoldings = indexerLookup.lookupAssetHoldings;
|
|
70
72
|
exports.lookupTransactionById = indexerLookup.lookupTransactionById;
|
|
71
73
|
exports.searchTransactions = indexerLookup.searchTransactions;
|
|
72
|
-
exports.getTestNetDispenserApiClient = dispenserClient.getTestNetDispenserApiClient;
|
|
73
74
|
exports.getAlgoClient = networkClient.getAlgoClient;
|
|
74
75
|
exports.getAlgoIndexerClient = networkClient.getAlgoIndexerClient;
|
|
75
76
|
exports.getAlgoKmdClient = networkClient.getAlgoKmdClient;
|
|
@@ -80,7 +81,9 @@ exports.getDefaultLocalNetConfig = networkClient.getDefaultLocalNetConfig;
|
|
|
80
81
|
exports.getIndexerConfigFromEnvironment = networkClient.getIndexerConfigFromEnvironment;
|
|
81
82
|
exports.isMainNet = networkClient.isMainNet;
|
|
82
83
|
exports.isTestNet = networkClient.isTestNet;
|
|
84
|
+
exports.algo = amount.algo;
|
|
83
85
|
exports.algos = amount.algos;
|
|
86
|
+
exports.microAlgo = amount.microAlgo;
|
|
84
87
|
exports.microAlgos = amount.microAlgos;
|
|
85
88
|
exports.transactionFees = amount.transactionFees;
|
|
86
89
|
exports.Config = config.Config;
|
|
@@ -107,10 +110,6 @@ exports.sendGroupOfTransactions = transaction.sendGroupOfTransactions;
|
|
|
107
110
|
exports.sendTransaction = transaction.sendTransaction;
|
|
108
111
|
exports.signTransaction = transaction.signTransaction;
|
|
109
112
|
exports.waitForConfirmation = transaction.waitForConfirmation;
|
|
110
|
-
exports.ensureFunded = transfer.ensureFunded;
|
|
111
|
-
exports.rekeyAccount = transfer.rekeyAccount;
|
|
112
|
-
exports.transferAsset = transfer.transferAsset;
|
|
113
|
-
exports.transferAlgos = transferAlgos.transferAlgos;
|
|
114
113
|
exports.getAccountAddressAsString = account.getAccountAddressAsString;
|
|
115
114
|
exports.getAccountAddressAsUint8Array = account.getAccountAddressAsUint8Array;
|
|
116
115
|
exports.getAccountAssetInformation = account.getAccountAssetInformation;
|
|
@@ -128,4 +127,8 @@ exports.getKmdWalletAccount = getKmdWalletAccount.getKmdWalletAccount;
|
|
|
128
127
|
exports.getLocalNetDispenserAccount = getLocalnetDispenserAccount.getLocalNetDispenserAccount;
|
|
129
128
|
exports.getOrCreateKmdWalletAccount = getOrCreateKmdWalletAccount.getOrCreateKmdWalletAccount;
|
|
130
129
|
exports.isLocalNet = isLocalnet.isLocalNet;
|
|
130
|
+
exports.ensureFunded = transfer.ensureFunded;
|
|
131
|
+
exports.rekeyAccount = transfer.rekeyAccount;
|
|
132
|
+
exports.transferAsset = transfer.transferAsset;
|
|
133
|
+
exports.transferAlgos = transferAlgos.transferAlgos;
|
|
131
134
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/index.mjs
CHANGED
|
@@ -2,18 +2,18 @@ export { callApp, compileTeal, createApp, decodeAppState, getABIMethodSignature,
|
|
|
2
2
|
export { getAppClient, getAppClientByCreatorAndName, getAppClientById } from './app-client.mjs';
|
|
3
3
|
export { deployApp, getAppDeploymentTransactionNote, getCreatorAppsByName, isSchemaIsBroken, performTemplateSubstitution, performTemplateSubstitutionAndCompile, replaceDeployTimeControlParams, stripTealComments } from './app-deploy.mjs';
|
|
4
4
|
export { assetBulkOptIn, assetBulkOptOut, assetOptIn, assetOptOut, createAsset } from './asset.mjs';
|
|
5
|
-
export { executePaginatedRequest, lookupAccountByAddress, lookupAccountCreatedApplicationByAddress, lookupAssetHoldings, lookupTransactionById, searchTransactions } from './indexer-lookup.mjs';
|
|
6
5
|
export { getTestNetDispenserApiClient } from './dispenser-client.mjs';
|
|
6
|
+
import * as indexerLookup from './indexer-lookup.mjs';
|
|
7
|
+
export { indexerLookup as indexer };
|
|
8
|
+
export { executePaginatedRequest, lookupAccountByAddress, lookupAccountCreatedApplicationByAddress, lookupAssetHoldings, lookupTransactionById, searchTransactions } from './indexer-lookup.mjs';
|
|
7
9
|
export { getAlgoClient, getAlgoIndexerClient, getAlgoKmdClient, getAlgoNodeConfig, getAlgodConfigFromEnvironment, getConfigFromEnvOrDefaults, getDefaultLocalNetConfig, getIndexerConfigFromEnvironment, isMainNet, isTestNet } from './network-client.mjs';
|
|
8
|
-
export { algos, microAlgos, transactionFees } from './amount.mjs';
|
|
10
|
+
export { algo, algos, microAlgo, microAlgos, transactionFees } from './amount.mjs';
|
|
9
11
|
export { Config } from './config.mjs';
|
|
10
12
|
export { AlgorandClient } from './types/algorand-client.mjs';
|
|
11
13
|
export { persistSourceMaps } from './debugging/debugging.mjs';
|
|
12
14
|
export { simulateAndPersistResponse } from './debugging/simulate-and-persist-response.mjs';
|
|
13
15
|
export { performAtomicTransactionComposerSimulate } from './transaction/perform-atomic-transaction-composer-simulate.mjs';
|
|
14
16
|
export { MAX_APP_CALL_ACCOUNT_REFERENCES, MAX_APP_CALL_FOREIGN_REFERENCES, MAX_TRANSACTION_GROUP_SIZE, capTransactionFee, controlFees, encodeLease, encodeTransactionNote, getAtomicTransactionComposerTransactions, getSenderAddress, getSenderTransactionSigner, getTransactionParams, getTransactionWithSigner, performAtomicTransactionComposerDryrun, populateAppCallResources, sendAtomicTransactionComposer, sendGroupOfTransactions, sendTransaction, signTransaction, waitForConfirmation } from './transaction/transaction.mjs';
|
|
15
|
-
export { ensureFunded, rekeyAccount, transferAsset } from './transfer/transfer.mjs';
|
|
16
|
-
export { transferAlgos } from './transfer/transfer-algos.mjs';
|
|
17
17
|
export { getAccountAddressAsString, getAccountAddressAsUint8Array, getAccountAssetInformation, getAccountInformation, mnemonicAccountFromEnvironment, multisigAccount, randomAccount, rekeyedAccount, transactionSignerAccount } from './account/account.mjs';
|
|
18
18
|
export { getAccount } from './account/get-account.mjs';
|
|
19
19
|
export { getAccountConfigFromEnvironment } from './account/get-account-config-from-environment.mjs';
|
|
@@ -23,4 +23,6 @@ export { getKmdWalletAccount } from './localnet/get-kmd-wallet-account.mjs';
|
|
|
23
23
|
export { getLocalNetDispenserAccount } from './localnet/get-localnet-dispenser-account.mjs';
|
|
24
24
|
export { getOrCreateKmdWalletAccount } from './localnet/get-or-create-kmd-wallet-account.mjs';
|
|
25
25
|
export { isLocalNet } from './localnet/is-localnet.mjs';
|
|
26
|
+
export { ensureFunded, rekeyAccount, transferAsset } from './transfer/transfer.mjs';
|
|
27
|
+
export { transferAlgos } from './transfer/transfer-algos.mjs';
|
|
26
28
|
//# sourceMappingURL=index.mjs.map
|
package/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -16,7 +16,7 @@ import Kmd = algosdk.Kmd;
|
|
|
16
16
|
*
|
|
17
17
|
* @param walletAccount The wallet details with:
|
|
18
18
|
* * `name`: The name of the wallet to retrieve / create
|
|
19
|
-
* * `fundWith`: The number of
|
|
19
|
+
* * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
|
|
20
20
|
* @param algod An algod client
|
|
21
21
|
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
22
22
|
*
|
|
@@ -16,7 +16,7 @@ var types_kmdAccountManager = require('../types/kmd-account-manager.js');
|
|
|
16
16
|
*
|
|
17
17
|
* @param walletAccount The wallet details with:
|
|
18
18
|
* * `name`: The name of the wallet to retrieve / create
|
|
19
|
-
* * `fundWith`: The number of
|
|
19
|
+
* * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
|
|
20
20
|
* @param algod An algod client
|
|
21
21
|
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
22
22
|
*
|
|
@@ -14,7 +14,7 @@ import { KmdAccountManager } from '../types/kmd-account-manager.mjs';
|
|
|
14
14
|
*
|
|
15
15
|
* @param walletAccount The wallet details with:
|
|
16
16
|
* * `name`: The name of the wallet to retrieve / create
|
|
17
|
-
* * `fundWith`: The number of
|
|
17
|
+
* * `fundWith`: The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account
|
|
18
18
|
* @param algod An algod client
|
|
19
19
|
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
20
20
|
*
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"**"
|
|
7
7
|
],
|
|
8
8
|
"name": "@algorandfoundation/algokit-utils",
|
|
9
|
-
"version": "6.
|
|
9
|
+
"version": "6.3.0-beta.1",
|
|
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",
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"overrides": {
|
|
39
39
|
"semver": "7.5.2",
|
|
40
40
|
"eslint-plugin-prettier": "5.0.0",
|
|
41
|
-
"braces": "3.0.3"
|
|
41
|
+
"braces": "3.0.3",
|
|
42
|
+
"micromatch": "4.0.8"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
45
|
"buffer": "^6.0.3"
|
package/testing/_asset.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import Algodv2 = algosdk.Algodv2;
|
|
4
|
-
export declare function generateTestAsset(client: Algodv2, sender: Account, total?: number): Promise<any>;
|
|
1
|
+
import { AlgorandClient } from '../types/algorand-client';
|
|
2
|
+
export declare function generateTestAsset(algorand: AlgorandClient, sender: string, total?: number): Promise<bigint>;
|
|
5
3
|
//# sourceMappingURL=_asset.d.ts.map
|