@algorandfoundation/algokit-utils 1.0.0 → 1.1.0
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/README.md +38 -0
- package/account.d.ts +11 -10
- package/account.d.ts.map +1 -1
- package/account.js +13 -12
- package/account.js.map +1 -1
- package/amount.d.ts +15 -3
- package/amount.d.ts.map +1 -1
- package/amount.js +15 -3
- package/amount.js.map +1 -1
- package/app-client.d.ts +14 -0
- package/app-client.d.ts.map +1 -0
- package/app-client.js +19 -0
- package/app-client.js.map +1 -0
- package/{deploy-app.d.ts → app-deploy.d.ts} +16 -14
- package/app-deploy.d.ts.map +1 -0
- package/{deploy-app.js → app-deploy.js} +47 -28
- package/app-deploy.js.map +1 -0
- package/app.d.ts +53 -8
- package/app.d.ts.map +1 -1
- package/app.js +305 -146
- package/app.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/indexer-lookup.d.ts +11 -4
- package/indexer-lookup.d.ts.map +1 -1
- package/indexer-lookup.js +19 -9
- package/indexer-lookup.js.map +1 -1
- package/localnet.d.ts +7 -7
- package/localnet.js +7 -7
- package/network-client.d.ts +4 -4
- package/network-client.js +5 -5
- package/network-client.js.map +1 -1
- package/package.json +1 -1
- package/testing/account.d.ts +2 -2
- package/testing/account.js +2 -2
- package/testing/fixtures/algorand-fixture.d.ts +6 -2
- package/testing/fixtures/algorand-fixture.d.ts.map +1 -1
- package/testing/fixtures/algorand-fixture.js +19 -8
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/indexer.d.ts.map +1 -1
- package/testing/indexer.js +1 -0
- package/testing/indexer.js.map +1 -1
- package/testing/test-logger.d.ts +3 -1
- package/testing/test-logger.d.ts.map +1 -1
- package/testing/test-logger.js +4 -2
- package/testing/test-logger.js.map +1 -1
- package/testing/transaction-logger.d.ts +4 -4
- package/testing/transaction-logger.d.ts.map +1 -1
- package/testing/transaction-logger.js +4 -4
- package/testing/transaction-logger.js.map +1 -1
- package/transaction.d.ts +54 -13
- package/transaction.d.ts.map +1 -1
- package/transaction.js +201 -93
- package/transaction.js.map +1 -1
- package/transfer.d.ts +4 -3
- package/transfer.d.ts.map +1 -1
- package/transfer.js +10 -8
- package/transfer.js.map +1 -1
- package/types/account.d.ts +6 -3
- package/types/account.d.ts.map +1 -1
- package/types/account.js +7 -2
- package/types/account.js.map +1 -1
- package/types/algo-http-client-with-retry.js +1 -1
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algod.d.ts +6 -6
- package/types/algod.d.ts.map +1 -1
- package/types/amount.d.ts +6 -2
- package/types/amount.d.ts.map +1 -1
- package/types/amount.js +6 -2
- package/types/amount.js.map +1 -1
- package/types/{application-client.d.ts → app-client.d.ts} +75 -22
- package/types/app-client.d.ts.map +1 -0
- package/types/{application-client.js → app-client.js} +115 -56
- package/types/app-client.js.map +1 -0
- package/types/app-spec.d.ts +141 -0
- package/types/app-spec.d.ts.map +1 -0
- package/types/{appspec.js → app-spec.js} +5 -7
- package/types/app-spec.js.map +1 -0
- package/types/app.d.ts +23 -17
- package/types/app.d.ts.map +1 -1
- package/types/app.js.map +1 -1
- package/types/config.d.ts +19 -2
- package/types/config.d.ts.map +1 -1
- package/types/config.js +28 -2
- package/types/config.js.map +1 -1
- package/types/indexer.d.ts +360 -49
- package/types/indexer.d.ts.map +1 -1
- package/types/indexer.js +9 -0
- package/types/indexer.js.map +1 -1
- package/types/logic-error.d.ts +5 -1
- package/types/logic-error.d.ts.map +1 -1
- package/types/logic-error.js +6 -2
- package/types/logic-error.js.map +1 -1
- package/types/testing.d.ts +9 -9
- package/types/testing.d.ts.map +1 -1
- package/types/transaction.d.ts +54 -9
- package/types/transaction.d.ts.map +1 -1
- package/types/transfer.d.ts +7 -7
- package/types/transfer.d.ts.map +1 -1
- package/application-client.d.ts +0 -10
- package/application-client.d.ts.map +0 -1
- package/application-client.js +0 -15
- package/application-client.js.map +0 -1
- package/deploy-app.d.ts.map +0 -1
- package/deploy-app.js.map +0 -1
- package/types/application-client.d.ts.map +0 -1
- package/types/application-client.js.map +0 -1
- package/types/appspec.d.ts +0 -77
- package/types/appspec.d.ts.map +0 -1
- package/types/appspec.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# AlgoKit TypeScript Utilities
|
|
2
|
+
|
|
3
|
+
A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand. This project is part of [AlgoKit](https://github.com/algorandfoundation/algokit-cli).
|
|
4
|
+
|
|
5
|
+
The goal of this library is to provide intuitive, productive utility functions that make it easier, quicker and safer to build applications on Algorand. Largely these functions wrap the underlying Algorand SDK, but provide a higher level interface with sensible defaults and capabilities for common tasks.
|
|
6
|
+
|
|
7
|
+
Note: If you prefer Python there's an equivalent [Python utility library](https://github.com/algorandfoundation/algokit-utils-py).
|
|
8
|
+
|
|
9
|
+
[Install](#install) | [Documentation](docs/README.md)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
This library can be installed from NPM using your favourite npm client, e.g.:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
npm install @algorandfoundation/algokit-utils
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Guiding principles
|
|
20
|
+
|
|
21
|
+
This library follows the [Guiding Principles of AlgoKit](https://github.com/algorandfoundation/algokit-cli/docs/algokit.md#guiding-principles).
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
This is an open source project managed by the Algorand Foundation. See the [AlgoKit contributing page](https://github.com/algorandfoundation/algokit-cli/blob/main/CONTRIBUTING.MD) to learn about making improvements.
|
|
26
|
+
|
|
27
|
+
To successfully run the tests in this repository you need to be running LocalNet via [AlgoKit](https://github.com/algorandfoundation/algokit-cli) and also have package dependencies and `.env.template` copied to `.env` (both of which `algokit bootstrap all` can do for you):
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
algokit bootstrap all
|
|
31
|
+
algokit localnet start
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
To run tests you can use VS Code, or:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
npm run test
|
|
38
|
+
```
|
package/account.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import algosdk, { Account, Algodv2, Kmd, MultisigMetadata, TransactionSigner } from 'algosdk';
|
|
2
2
|
import { MultisigAccount, SigningAccount, TransactionSignerAccount } from './types/account';
|
|
3
3
|
import { AlgoAmount } from './types/amount';
|
|
4
|
+
import { SendTransactionFrom } from './types/transaction';
|
|
4
5
|
/**
|
|
5
6
|
* Returns an account wrapper that supports partial or full multisig signing.
|
|
6
7
|
* @param multisigParams The parameters that define the multisig account
|
|
@@ -10,16 +11,16 @@ import { AlgoAmount } from './types/amount';
|
|
|
10
11
|
export declare function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]): MultisigAccount;
|
|
11
12
|
/**
|
|
12
13
|
* Returns an account wrapper that supports a rekeyed account.
|
|
13
|
-
* @param
|
|
14
|
+
* @param signer The account, with private key loaded, that is signing
|
|
14
15
|
* @param sender The address of the rekeyed account that will act as a sender
|
|
15
|
-
* @returns The
|
|
16
|
+
* @returns The SigningAccount wrapper
|
|
16
17
|
*/
|
|
17
|
-
export declare function rekeyedAccount(
|
|
18
|
+
export declare function rekeyedAccount(signer: Account, sender: string): SigningAccount;
|
|
18
19
|
/**
|
|
19
20
|
* Returns an account wrapper that supports a transaction signer with associated sender address.
|
|
20
21
|
* @param signer The transaction signer
|
|
21
22
|
* @param sender The address of sender account
|
|
22
|
-
* @returns The
|
|
23
|
+
* @returns The SigningAccount wrapper
|
|
23
24
|
*/
|
|
24
25
|
export declare function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount;
|
|
25
26
|
/** Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.
|
|
@@ -60,9 +61,9 @@ export declare function randomAccount(): Account;
|
|
|
60
61
|
*
|
|
61
62
|
* @param account The details of the account to get, wither the name identifier (string) or an object with:
|
|
62
63
|
* * `name`: The name identifier of the account
|
|
63
|
-
* * `fundWith`: The amount to fund the account with it it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account
|
|
64
|
+
* * `fundWith`: The amount to fund the account with it it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account
|
|
64
65
|
* @param algod An algod client
|
|
65
|
-
* @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables
|
|
66
|
+
* @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables
|
|
66
67
|
* @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)
|
|
67
68
|
*/
|
|
68
69
|
export declare function getAccount(account: {
|
|
@@ -73,7 +74,7 @@ export declare function getAccount(account: {
|
|
|
73
74
|
*
|
|
74
75
|
* @param account Either an account (with private key loaded) or the string address of an account
|
|
75
76
|
*/
|
|
76
|
-
export declare function getAccountAddressAsUint8Array(account:
|
|
77
|
+
export declare function getAccountAddressAsUint8Array(account: SendTransactionFrom | string): Uint8Array;
|
|
77
78
|
/** Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key
|
|
78
79
|
*
|
|
79
80
|
* @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key
|
|
@@ -81,11 +82,11 @@ export declare function getAccountAddressAsUint8Array(account: Account | string)
|
|
|
81
82
|
export declare function getAccountAddressAsString(addressEncodedInB64: string): string;
|
|
82
83
|
/** Returns an account (with private key loaded) that can act as a dispenser
|
|
83
84
|
*
|
|
84
|
-
* If running on
|
|
85
|
-
* otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC
|
|
85
|
+
* If running on LocalNet then it will return the default dispenser account automatically,
|
|
86
|
+
* otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC
|
|
86
87
|
*
|
|
87
88
|
* @param algod An algod client
|
|
88
|
-
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
89
|
+
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
89
90
|
*/
|
|
90
91
|
export declare function getDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<algosdk.Account | SigningAccount>;
|
|
91
92
|
//# sourceMappingURL=account.d.ts.map
|
package/account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAK7F,OAAO,EAAqB,eAAe,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAA;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAEzD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC,OAAO,GAAG,cAAc,CAAC,EAAE,mBAE9G;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAE7D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,wBAAwB,CAE5G;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAG/D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,UAAU,CAC9B,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,UAAU,CAAA;CAAE,GAAG,MAAM,EACzD,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,GAAG,GACd,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC,CAmCnC;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,cAElF;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,6CAIlE"}
|
package/account.js
CHANGED
|
@@ -8,6 +8,7 @@ const algosdk_1 = __importDefault(require("algosdk"));
|
|
|
8
8
|
const _1 = require("./");
|
|
9
9
|
const localnet_1 = require("./localnet");
|
|
10
10
|
const network_client_1 = require("./network-client");
|
|
11
|
+
const transaction_1 = require("./transaction");
|
|
11
12
|
const account_1 = require("./types/account");
|
|
12
13
|
/**
|
|
13
14
|
* Returns an account wrapper that supports partial or full multisig signing.
|
|
@@ -21,19 +22,19 @@ function multisigAccount(multisigParams, signingAccounts) {
|
|
|
21
22
|
exports.multisigAccount = multisigAccount;
|
|
22
23
|
/**
|
|
23
24
|
* Returns an account wrapper that supports a rekeyed account.
|
|
24
|
-
* @param
|
|
25
|
+
* @param signer The account, with private key loaded, that is signing
|
|
25
26
|
* @param sender The address of the rekeyed account that will act as a sender
|
|
26
|
-
* @returns The
|
|
27
|
+
* @returns The SigningAccount wrapper
|
|
27
28
|
*/
|
|
28
|
-
function rekeyedAccount(
|
|
29
|
-
return new account_1.SigningAccount(
|
|
29
|
+
function rekeyedAccount(signer, sender) {
|
|
30
|
+
return new account_1.SigningAccount(signer, sender);
|
|
30
31
|
}
|
|
31
32
|
exports.rekeyedAccount = rekeyedAccount;
|
|
32
33
|
/**
|
|
33
34
|
* Returns an account wrapper that supports a transaction signer with associated sender address.
|
|
34
35
|
* @param signer The transaction signer
|
|
35
36
|
* @param sender The address of sender account
|
|
36
|
-
* @returns The
|
|
37
|
+
* @returns The SigningAccount wrapper
|
|
37
38
|
*/
|
|
38
39
|
function transactionSignerAccount(signer, sender) {
|
|
39
40
|
return { addr: sender, signer };
|
|
@@ -85,9 +86,9 @@ exports.randomAccount = randomAccount;
|
|
|
85
86
|
*
|
|
86
87
|
* @param account The details of the account to get, wither the name identifier (string) or an object with:
|
|
87
88
|
* * `name`: The name identifier of the account
|
|
88
|
-
* * `fundWith`: The amount to fund the account with it it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account
|
|
89
|
+
* * `fundWith`: The amount to fund the account with it it gets created (when targeting LocalNet), if not specified then 1000 Algos will be funded from the dispenser account
|
|
89
90
|
* @param algod An algod client
|
|
90
|
-
* @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables
|
|
91
|
+
* @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables
|
|
91
92
|
* @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)
|
|
92
93
|
*/
|
|
93
94
|
async function getAccount(account, algod, kmdClient) {
|
|
@@ -130,7 +131,7 @@ exports.getAccount = getAccount;
|
|
|
130
131
|
* @param account Either an account (with private key loaded) or the string address of an account
|
|
131
132
|
*/
|
|
132
133
|
function getAccountAddressAsUint8Array(account) {
|
|
133
|
-
return algosdk_1.default.decodeAddress(typeof account === 'string' ? account :
|
|
134
|
+
return algosdk_1.default.decodeAddress(typeof account === 'string' ? account : (0, transaction_1.getSenderAddress)(account)).publicKey;
|
|
134
135
|
}
|
|
135
136
|
exports.getAccountAddressAsUint8Array = getAccountAddressAsUint8Array;
|
|
136
137
|
/** Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key
|
|
@@ -143,14 +144,14 @@ function getAccountAddressAsString(addressEncodedInB64) {
|
|
|
143
144
|
exports.getAccountAddressAsString = getAccountAddressAsString;
|
|
144
145
|
/** Returns an account (with private key loaded) that can act as a dispenser
|
|
145
146
|
*
|
|
146
|
-
* If running on
|
|
147
|
-
* otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC
|
|
147
|
+
* If running on LocalNet then it will return the default dispenser account automatically,
|
|
148
|
+
* otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC
|
|
148
149
|
*
|
|
149
150
|
* @param algod An algod client
|
|
150
|
-
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
151
|
+
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
151
152
|
*/
|
|
152
153
|
async function getDispenserAccount(algod, kmd) {
|
|
153
|
-
// If we are running against
|
|
154
|
+
// If we are running against LocalNet we can use the default account within it, otherwise use an automation account specified via environment variables and ensure it's populated with ALGOs
|
|
154
155
|
const canFundFromDefaultAccount = await (0, network_client_1.isLocalNet)(algod);
|
|
155
156
|
return canFundFromDefaultAccount ? await (0, localnet_1.getLocalNetDispenserAccount)(algod, kmd) : await getAccount(account_1.DISPENSER_ACCOUNT, algod);
|
|
156
157
|
}
|
package/account.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6F;AAC7F,yBAA2B;AAC3B,yCAAqF;AACrF,qDAA6C;AAC7C,6CAA8G;
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6F;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SAAS,CAAA;AAC3G,CAAC;AAFD,sEAEC;AAED;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,mBAA2B;IACnE,OAAO,iBAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC,CAAA;AAC1E,CAAC;AAFD,8DAEC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CAAC,KAAc,EAAE,GAAS;IACjE,4LAA4L;IAC5L,MAAM,yBAAyB,GAAG,MAAM,IAAA,2BAAU,EAAC,KAAK,CAAC,CAAA;IACzD,OAAO,yBAAyB,CAAC,CAAC,CAAC,MAAM,IAAA,sCAA2B,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,UAAU,CAAC,2BAAiB,EAAE,KAAK,CAAC,CAAA;AAC/H,CAAC;AAJD,kDAIC"}
|
package/amount.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { AlgoAmount } from './types/amount';
|
|
2
|
-
|
|
2
|
+
declare global {
|
|
3
|
+
interface Number {
|
|
4
|
+
microAlgos(this: number): AlgoAmount;
|
|
5
|
+
algos(this: number): AlgoAmount;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Returns an amount of Algos using AlgoAmount
|
|
9
|
+
* @param algos The amount in Algos
|
|
10
|
+
*/
|
|
3
11
|
export declare const algos: (algos: number) => AlgoAmount;
|
|
4
|
-
/** Returns an amount of µAlgos using
|
|
12
|
+
/** Returns an amount of µAlgos using AlgoAmount
|
|
13
|
+
* @param microAlgos The amount in µAlgos
|
|
14
|
+
*/
|
|
5
15
|
export declare const microAlgos: (microAlgos: number) => AlgoAmount;
|
|
6
|
-
/** Returns an amount of µAlgos to cover standard fees for the given number of transactions using
|
|
16
|
+
/** Returns an amount of µAlgos to cover standard fees for the given number of transactions using AlgoAmount
|
|
17
|
+
* @param numberOfTransactions The of standard transaction fees to return the amount of ALGOs
|
|
18
|
+
*/
|
|
7
19
|
export declare const transactionFees: (numberOfTransactions: number) => AlgoAmount;
|
|
8
20
|
//# sourceMappingURL=amount.d.ts.map
|
package/amount.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amount.d.ts","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,
|
|
1
|
+
{"version":3,"file":"amount.d.ts","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;QACpC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAA;KAChC;CACF;AAUD;;GAEG;AACH,eAAO,MAAM,KAAK,UAAW,MAAM,eAElC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,eAAgB,MAAM,eAE5C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,yBAA0B,MAAM,eAE3D,CAAA"}
|
package/amount.js
CHANGED
|
@@ -6,17 +6,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.transactionFees = exports.microAlgos = exports.algos = void 0;
|
|
7
7
|
const algosdk_1 = __importDefault(require("algosdk"));
|
|
8
8
|
const amount_1 = require("./types/amount");
|
|
9
|
-
|
|
9
|
+
Number.prototype.microAlgos = function () {
|
|
10
|
+
return amount_1.AlgoAmount.MicroAlgos(this);
|
|
11
|
+
};
|
|
12
|
+
Number.prototype.algos = function () {
|
|
13
|
+
return amount_1.AlgoAmount.Algos(this);
|
|
14
|
+
};
|
|
15
|
+
/** Returns an amount of Algos using AlgoAmount
|
|
16
|
+
* @param algos The amount in Algos
|
|
17
|
+
*/
|
|
10
18
|
const algos = (algos) => {
|
|
11
19
|
return amount_1.AlgoAmount.Algos(algos);
|
|
12
20
|
};
|
|
13
21
|
exports.algos = algos;
|
|
14
|
-
/** Returns an amount of µAlgos using
|
|
22
|
+
/** Returns an amount of µAlgos using AlgoAmount
|
|
23
|
+
* @param microAlgos The amount in µAlgos
|
|
24
|
+
*/
|
|
15
25
|
const microAlgos = (microAlgos) => {
|
|
16
26
|
return amount_1.AlgoAmount.MicroAlgos(microAlgos);
|
|
17
27
|
};
|
|
18
28
|
exports.microAlgos = microAlgos;
|
|
19
|
-
/** Returns an amount of µAlgos to cover standard fees for the given number of transactions using
|
|
29
|
+
/** Returns an amount of µAlgos to cover standard fees for the given number of transactions using AlgoAmount
|
|
30
|
+
* @param numberOfTransactions The of standard transaction fees to return the amount of ALGOs
|
|
31
|
+
*/
|
|
20
32
|
const transactionFees = (numberOfTransactions) => {
|
|
21
33
|
return amount_1.AlgoAmount.MicroAlgos(numberOfTransactions * algosdk_1.default.ALGORAND_MIN_TX_FEE);
|
|
22
34
|
};
|
package/amount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amount.js","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,2CAA2C;
|
|
1
|
+
{"version":3,"file":"amount.js","sourceRoot":"","sources":["../src/amount.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA6B;AAC7B,2CAA2C;AAS3C,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG;IAC5B,OAAO,mBAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG;IACvB,OAAO,mBAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAC,CAAA;AAED;;GAEG;AACI,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE;IACrC,OAAO,mBAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC,CAAA;AAFY,QAAA,KAAK,SAEjB;AAED;;GAEG;AACI,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAE,EAAE;IAC/C,OAAO,mBAAU,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AAC1C,CAAC,CAAA;AAFY,QAAA,UAAU,cAEtB;AAED;;GAEG;AACI,MAAM,eAAe,GAAG,CAAC,oBAA4B,EAAE,EAAE;IAC9D,OAAO,mBAAU,CAAC,UAAU,CAAC,oBAAoB,GAAG,iBAAO,CAAC,mBAAmB,CAAC,CAAA;AAClF,CAAC,CAAA;AAFY,QAAA,eAAe,mBAE3B"}
|
package/app-client.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Algodv2 } from 'algosdk';
|
|
2
|
+
import { ApplicationClient, AppSpecAppDetails } from './types/app-client';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `algokit.getAppClient`
|
|
5
|
+
*/
|
|
6
|
+
export declare const getApplicationClient: typeof getAppClient;
|
|
7
|
+
/**
|
|
8
|
+
* Create a new ApplicationClient instance
|
|
9
|
+
* @param appDetails The details of the app
|
|
10
|
+
* @param algod An algod instance
|
|
11
|
+
* @returns The application client
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2): ApplicationClient;
|
|
14
|
+
//# sourceMappingURL=app-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-client.d.ts","sourceRoot":"","sources":["../src/app-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEzE;;GAEG;AACH,eAAO,MAAM,oBAAoB,qBAAe,CAAA;AAEhD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,qBAEzE"}
|
package/app-client.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAppClient = exports.getApplicationClient = void 0;
|
|
4
|
+
const app_client_1 = require("./types/app-client");
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `algokit.getAppClient`
|
|
7
|
+
*/
|
|
8
|
+
exports.getApplicationClient = getAppClient;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new ApplicationClient instance
|
|
11
|
+
* @param appDetails The details of the app
|
|
12
|
+
* @param algod An algod instance
|
|
13
|
+
* @returns The application client
|
|
14
|
+
*/
|
|
15
|
+
function getAppClient(appDetails, algod) {
|
|
16
|
+
return new app_client_1.ApplicationClient(appDetails, algod);
|
|
17
|
+
}
|
|
18
|
+
exports.getAppClient = getAppClient;
|
|
19
|
+
//# sourceMappingURL=app-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-client.js","sourceRoot":"","sources":["../src/app-client.ts"],"names":[],"mappings":";;;AACA,mDAAyE;AAEzE;;GAEG;AACU,QAAA,oBAAoB,GAAG,YAAY,CAAA;AAEhD;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,UAA6B,EAAE,KAAc;IACxE,OAAO,IAAI,8BAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAFD,oCAEC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Algodv2, Indexer } from 'algosdk';
|
|
2
2
|
import { ApplicationStateSchema } from './types/algod';
|
|
3
|
-
import { AppCompilationResult, AppDeploymentParams, AppDeployMetadata, AppLookup, AppMetadata, CompiledTeal, TealTemplateParams } from './types/app';
|
|
4
|
-
import { ConfirmedTransactionResult, SendTransactionFrom } from './types/transaction';
|
|
3
|
+
import { ABIReturn, AppCompilationResult, AppDeploymentParams, AppDeployMetadata, AppLookup, AppMetadata, CompiledTeal, TealTemplateParams } from './types/app';
|
|
4
|
+
import { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction';
|
|
5
5
|
/**
|
|
6
6
|
* Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
|
|
7
7
|
*
|
|
8
|
-
* To understand the architecture decisions behind this functionality please
|
|
8
|
+
* To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
|
|
9
9
|
*
|
|
10
10
|
* **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.
|
|
11
11
|
*
|
|
@@ -17,9 +17,12 @@ import { ConfirmedTransactionResult, SendTransactionFrom } from './types/transac
|
|
|
17
17
|
* @param indexer An indexer client, needed if `existingDeployments` not passed in
|
|
18
18
|
* @returns The app reference of the new/existing app
|
|
19
19
|
*/
|
|
20
|
-
export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv2, indexer?: Indexer): Promise<Partial<AppCompilationResult> & ((
|
|
20
|
+
export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv2, indexer?: Indexer): Promise<Partial<AppCompilationResult> & ((ConfirmedTransactionResults & AppMetadata & {
|
|
21
|
+
return?: ABIReturn;
|
|
21
22
|
operationPerformed: 'create' | 'update';
|
|
22
|
-
}) | (
|
|
23
|
+
}) | (ConfirmedTransactionResults & AppMetadata & {
|
|
24
|
+
return?: ABIReturn;
|
|
25
|
+
deleteReturn?: ABIReturn;
|
|
23
26
|
deleteResult: ConfirmedTransactionResult;
|
|
24
27
|
operationPerformed: 'replace';
|
|
25
28
|
}) | (AppMetadata & {
|
|
@@ -35,7 +38,7 @@ export declare function deployApp(deployment: AppDeploymentParams, algod: Algodv
|
|
|
35
38
|
*/
|
|
36
39
|
export declare function isSchemaIsBroken(before: ApplicationStateSchema, after: ApplicationStateSchema): boolean;
|
|
37
40
|
/**
|
|
38
|
-
* Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an
|
|
41
|
+
* Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.
|
|
39
42
|
*
|
|
40
43
|
* **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).
|
|
41
44
|
*
|
|
@@ -49,16 +52,15 @@ export declare function getCreatorAppsByName(creatorAccount: SendTransactionFrom
|
|
|
49
52
|
* @param metadata The metadata of the deployment
|
|
50
53
|
* @returns The transaction note as a utf-8 string
|
|
51
54
|
*/
|
|
52
|
-
export declare function getAppDeploymentTransactionNote(metadata: AppDeployMetadata):
|
|
53
|
-
dAppName: string;
|
|
54
|
-
data: AppDeployMetadata;
|
|
55
|
-
format: string;
|
|
56
|
-
};
|
|
55
|
+
export declare function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote;
|
|
57
56
|
/**
|
|
58
57
|
* Replaces deploy-time deployment control parameters within the given teal code.
|
|
59
58
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
59
|
+
* * `TMPL_UPDATABLE` for updatability / immutability control
|
|
60
|
+
* * `TMPL_DELETABLE` for deletability / permanence control
|
|
61
|
+
*
|
|
62
|
+
* Note: If these values are not undefined, but the corresponding `TMPL_*` value
|
|
63
|
+
* isn't in the teal code it will throw an exception.
|
|
62
64
|
*
|
|
63
65
|
* @param tealCode The TEAL code to substitute
|
|
64
66
|
* @param params The deploy-time deployment control parameter value to replace
|
|
@@ -90,4 +92,4 @@ export declare function performTemplateSubstitution(tealCode: string, templatePa
|
|
|
90
92
|
* @returns The information about the compiled code
|
|
91
93
|
*/
|
|
92
94
|
export declare function performTemplateSubstitutionAndCompile(tealCode: string, algod: Algodv2, templateParams?: TealTemplateParams, deploymentMetadata?: AppDeployMetadata): Promise<CompiledTeal>;
|
|
93
|
-
//# sourceMappingURL=deploy
|
|
95
|
+
//# sourceMappingURL=app-deploy.d.ts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EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAoG7H;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,mBAAmB,CAMhG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,UAoBpH;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,kBAAkB,UAiBhG;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,qCAAqC,CACzD,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,cAAc,CAAC,EAAE,kBAAkB,EACnC,kBAAkB,CAAC,EAAE,iBAAiB,GACrC,OAAO,CAAC,YAAY,CAAC,CAQvB"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.performTemplateSubstitutionAndCompile = exports.performTemplateSubstitution = exports.replaceDeployTimeControlParams = exports.getAppDeploymentTransactionNote = exports.getCreatorAppsByName = exports.isSchemaIsBroken = exports.deployApp = void 0;
|
|
4
4
|
const algosdk_1 = require("algosdk");
|
|
5
|
-
const _1 = require("
|
|
5
|
+
const _1 = require(".");
|
|
6
6
|
const app_1 = require("./app");
|
|
7
7
|
const indexer_lookup_1 = require("./indexer-lookup");
|
|
8
8
|
const transaction_1 = require("./transaction");
|
|
@@ -10,7 +10,7 @@ const app_2 = require("./types/app");
|
|
|
10
10
|
/**
|
|
11
11
|
* Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.
|
|
12
12
|
*
|
|
13
|
-
* To understand the architecture decisions behind this functionality please
|
|
13
|
+
* To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md
|
|
14
14
|
*
|
|
15
15
|
* **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.
|
|
16
16
|
*
|
|
@@ -41,18 +41,22 @@ async function deployApp(deployment, algod, indexer) {
|
|
|
41
41
|
appParams.clearStateProgram = compiledClear ? compiledClear.compiledBase64ToBytes : appParams.clearStateProgram;
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
43
43
|
const apps = existingDeployments ?? (await getCreatorAppsByName(appParams.from, indexer));
|
|
44
|
-
const create = async (
|
|
44
|
+
const create = async (atc) => {
|
|
45
45
|
const result = await (0, app_1.createApp)({
|
|
46
46
|
...appParams,
|
|
47
47
|
args: createArgs,
|
|
48
48
|
note: getAppDeploymentTransactionNote(metadata),
|
|
49
|
-
|
|
49
|
+
atc,
|
|
50
50
|
skipWaiting: false,
|
|
51
51
|
}, algod);
|
|
52
52
|
return {
|
|
53
53
|
transaction: result.transaction,
|
|
54
|
+
transactions: result.transactions,
|
|
54
55
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
55
56
|
confirmation: result.confirmation,
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
58
|
+
confirmations: result.confirmations,
|
|
59
|
+
return: result.return,
|
|
56
60
|
appId: result.appId,
|
|
57
61
|
appAddress: result.appAddress,
|
|
58
62
|
createdMetadata: metadata,
|
|
@@ -71,7 +75,7 @@ async function deployApp(deployment, algod, indexer) {
|
|
|
71
75
|
return await create();
|
|
72
76
|
}
|
|
73
77
|
_1.Config.getLogger(appParams.suppressLog).info(`Existing app ${metadata.name} found by creator ${(0, transaction_1.getSenderAddress)(appParams.from)}, with app id ${existingApp.appId} and version ${existingApp.version}.`);
|
|
74
|
-
const existingAppRecord = await (0, app_1.
|
|
78
|
+
const existingAppRecord = await (0, app_1.getAppById)(existingApp.appId, algod);
|
|
75
79
|
const existingApproval = existingAppRecord.params['approval-program'];
|
|
76
80
|
const existingClear = existingAppRecord.params['clear-state-program'];
|
|
77
81
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -91,9 +95,11 @@ async function deployApp(deployment, algod, indexer) {
|
|
|
91
95
|
const isUpdate = newApproval !== existingApproval || newClear !== existingClear;
|
|
92
96
|
const isSchemaBreak = isSchemaIsBroken(existingGlobalSchema, newGlobalSchema) || isSchemaIsBroken(existingLocalSchema, newLocalSchema);
|
|
93
97
|
const replace = async () => {
|
|
98
|
+
const atc = new algosdk_1.AtomicTransactionComposer();
|
|
94
99
|
// Create
|
|
95
100
|
_1.Config.getLogger(appParams.suppressLog).info(`Deploying a new ${metadata.name} app for ${(0, transaction_1.getSenderAddress)(appParams.from)}; deploying app with version ${metadata.version}.`);
|
|
96
|
-
const { transaction: createTransaction } = await create(
|
|
101
|
+
const { transaction: createTransaction } = await create(atc);
|
|
102
|
+
const createTransactions = atc.clone().buildGroup();
|
|
97
103
|
// Delete
|
|
98
104
|
_1.Config.getLogger(appParams.suppressLog).warn(`Deleting existing ${metadata.name} app with id ${existingApp.appId} from ${(0, transaction_1.getSenderAddress)(appParams.from)} account.`);
|
|
99
105
|
const { transaction: deleteTransaction } = await (0, app_1.callApp)({
|
|
@@ -104,19 +110,11 @@ async function deployApp(deployment, algod, indexer) {
|
|
|
104
110
|
transactionParams: appParams.transactionParams,
|
|
105
111
|
suppressLog: appParams.suppressLog,
|
|
106
112
|
skipSending: true,
|
|
113
|
+
atc,
|
|
107
114
|
}, algod);
|
|
108
115
|
// Ensure create and delete happen atomically
|
|
109
|
-
const { confirmations } = await (0, transaction_1.
|
|
110
|
-
|
|
111
|
-
{
|
|
112
|
-
transaction: createTransaction,
|
|
113
|
-
signer: appParams.from,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
transaction: deleteTransaction,
|
|
117
|
-
signer: appParams.from,
|
|
118
|
-
},
|
|
119
|
-
],
|
|
116
|
+
const { transactions, confirmations, returns } = await (0, transaction_1.sendAtomicTransactionComposer)({
|
|
117
|
+
atc,
|
|
120
118
|
sendParams: {
|
|
121
119
|
maxRoundsToWaitForConfirmation: appParams.maxRoundsToWaitForConfirmation,
|
|
122
120
|
skipWaiting: false,
|
|
@@ -124,16 +122,21 @@ async function deployApp(deployment, algod, indexer) {
|
|
|
124
122
|
},
|
|
125
123
|
}, algod);
|
|
126
124
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
127
|
-
const createConfirmation = confirmations[
|
|
125
|
+
const createConfirmation = confirmations[createTransactions.length - 1];
|
|
128
126
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
129
|
-
const deleteConfirmation = confirmations[1];
|
|
127
|
+
const deleteConfirmation = confirmations[confirmations.length - 1];
|
|
130
128
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
131
129
|
const newAppIndex = createConfirmation['application-index'];
|
|
132
130
|
_1.Config.getLogger(appParams.suppressLog).warn(`Sent transactions ${createTransaction.txID()} to create app with id ${newAppIndex} and ${deleteTransaction.txID()} to delete app with id ${existingApp.appId} from ${(0, transaction_1.getSenderAddress)(appParams.from)} account.`);
|
|
133
131
|
return {
|
|
134
132
|
transaction: createTransaction,
|
|
133
|
+
transactions: transactions,
|
|
135
134
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
136
135
|
confirmation: createConfirmation,
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
137
|
+
confirmations: confirmations,
|
|
138
|
+
return: returns?.[0],
|
|
139
|
+
deleteReturn: returns?.[1],
|
|
137
140
|
appId: newAppIndex,
|
|
138
141
|
appAddress: (0, algosdk_1.getApplicationAddress)(newAppIndex),
|
|
139
142
|
createdMetadata: metadata,
|
|
@@ -163,8 +166,12 @@ async function deployApp(deployment, algod, indexer) {
|
|
|
163
166
|
}, algod);
|
|
164
167
|
return {
|
|
165
168
|
transaction: result.transaction,
|
|
169
|
+
transactions: result.transactions,
|
|
166
170
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
167
171
|
confirmation: result.confirmation,
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
173
|
+
confirmations: result.confirmations,
|
|
174
|
+
return: result.return,
|
|
168
175
|
appId: existingApp.appId,
|
|
169
176
|
appAddress: existingApp.appAddress,
|
|
170
177
|
createdMetadata: existingApp.createdMetadata,
|
|
@@ -244,7 +251,7 @@ function isSchemaIsBroken(before, after) {
|
|
|
244
251
|
}
|
|
245
252
|
exports.isSchemaIsBroken = isSchemaIsBroken;
|
|
246
253
|
/**
|
|
247
|
-
* Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an
|
|
254
|
+
* Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.
|
|
248
255
|
*
|
|
249
256
|
* **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).
|
|
250
257
|
*
|
|
@@ -256,12 +263,14 @@ async function getCreatorAppsByName(creatorAccount, indexer) {
|
|
|
256
263
|
const appLookup = {};
|
|
257
264
|
const creatorAddress = typeof creatorAccount !== 'string' ? (0, transaction_1.getSenderAddress)(creatorAccount) : creatorAccount;
|
|
258
265
|
// Extract all apps that account created
|
|
259
|
-
const createdApps = (await (0, indexer_lookup_1.lookupAccountCreatedApplicationByAddress)(indexer, creatorAddress))
|
|
266
|
+
const createdApps = (await (0, indexer_lookup_1.lookupAccountCreatedApplicationByAddress)(indexer, creatorAddress))
|
|
267
|
+
.map((a) => {
|
|
260
268
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
261
269
|
return { id: a.id, createdAtRound: a['created-at-round'], deleted: a.deleted };
|
|
262
|
-
})
|
|
270
|
+
})
|
|
271
|
+
.sort((a, b) => a.createdAtRound - b.createdAtRound);
|
|
263
272
|
// For each app that account created (in parallel)...
|
|
264
|
-
await Promise.all(createdApps.map(async (createdApp) => {
|
|
273
|
+
const apps = await Promise.all(createdApps.map(async (createdApp) => {
|
|
265
274
|
// Find any app transactions for that app in the round it was created (should always just be a single creation transaction)
|
|
266
275
|
const appTransactions = await (0, indexer_lookup_1.searchTransactions)(indexer, (s) => s
|
|
267
276
|
.minRound(createdApp.createdAtRound)
|
|
@@ -285,7 +294,14 @@ async function getCreatorAppsByName(creatorAccount, indexer) {
|
|
|
285
294
|
b['confirmed-round'] - a['confirmed-round'])[0];
|
|
286
295
|
if (!appCreationTransaction?.note)
|
|
287
296
|
// No note; ignoring
|
|
288
|
-
return;
|
|
297
|
+
return null;
|
|
298
|
+
return { createdApp, appCreationTransaction, latestAppUpdateTransaction };
|
|
299
|
+
}));
|
|
300
|
+
apps
|
|
301
|
+
.filter((a) => a !== null)
|
|
302
|
+
.forEach((a) => {
|
|
303
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
304
|
+
const { createdApp, appCreationTransaction, latestAppUpdateTransaction } = a;
|
|
289
305
|
const parseNote = (note) => {
|
|
290
306
|
if (!note) {
|
|
291
307
|
// No note; ignoring...
|
|
@@ -318,7 +334,7 @@ async function getCreatorAppsByName(creatorAccount, indexer) {
|
|
|
318
334
|
_1.Config.logger.warn(`Received error trying to retrieve app with ${createdApp.id} for creator ${creatorAddress}; failing silently`, e);
|
|
319
335
|
return;
|
|
320
336
|
}
|
|
321
|
-
})
|
|
337
|
+
});
|
|
322
338
|
return {
|
|
323
339
|
creator: creatorAddress,
|
|
324
340
|
apps: appLookup,
|
|
@@ -341,8 +357,11 @@ exports.getAppDeploymentTransactionNote = getAppDeploymentTransactionNote;
|
|
|
341
357
|
/**
|
|
342
358
|
* Replaces deploy-time deployment control parameters within the given teal code.
|
|
343
359
|
*
|
|
344
|
-
*
|
|
345
|
-
*
|
|
360
|
+
* * `TMPL_UPDATABLE` for updatability / immutability control
|
|
361
|
+
* * `TMPL_DELETABLE` for deletability / permanence control
|
|
362
|
+
*
|
|
363
|
+
* Note: If these values are not undefined, but the corresponding `TMPL_*` value
|
|
364
|
+
* isn't in the teal code it will throw an exception.
|
|
346
365
|
*
|
|
347
366
|
* @param tealCode The TEAL code to substitute
|
|
348
367
|
* @param params The deploy-time deployment control parameter value to replace
|
|
@@ -407,4 +426,4 @@ async function performTemplateSubstitutionAndCompile(tealCode, algod, templatePa
|
|
|
407
426
|
return await (0, app_1.compileTeal)(tealCode, algod);
|
|
408
427
|
}
|
|
409
428
|
exports.performTemplateSubstitutionAndCompile = performTemplateSubstitutionAndCompile;
|
|
410
|
-
//# sourceMappingURL=deploy
|
|
429
|
+
//# sourceMappingURL=app-deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-deploy.js","sourceRoot":"","sources":["../src/app-deploy.ts"],"names":[],"mappings":";;;AAAA,qCAA6G;AAC7G,wBAA0B;AAC1B,+BAA8E;AAC9E,qDAA+F;AAC/F,+CAA+E;AAE/E,qCAcoB;AAGpB;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,OAAiB;IAejB,MAAM,EACJ,QAAQ,EACR,gBAAgB,EAAE,oBAAoB,EACtC,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,UAAU,EACV,UAAU,EACV,GAAG,SAAS,EACb,GAAG,UAAU,CAAA;IAEd,IAAI,mBAAmB,IAAI,mBAAmB,CAAC,OAAO,KAAK,IAAA,8BAAgB,EAAC,SAAS,CAAC,IAAI,CAAC,EAAE;QAC3F,MAAM,IAAI,KAAK,CACb,0DAA0D,mBAAmB,CAAC,OAAO,0CAA0C,SAAS,CAAC,IAAI,EAAE,CAChJ,CAAA;KACF;IACD,IAAI,CAAC,mBAAmB,IAAI,CAAC,OAAO,EAAE;QACpC,MAAM,IAAI,KAAK,CAAC,uHAAuH,CAAC,CAAA;KACzI;IAED,SAAM,CAAC,SAAS,CAAC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