@algorandfoundation/algokit-utils 7.0.0-beta.2 → 7.0.0-beta.21
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/LICENSE +21 -0
- package/README.md +3 -25
- package/account/account.d.ts +1 -2
- package/account/account.js +6 -4
- package/account/account.js.map +1 -1
- package/account/account.mjs +6 -4
- package/account/account.mjs.map +1 -1
- package/account/get-account-config-from-environment.d.ts +0 -1
- package/account/get-account-config-from-environment.js.map +1 -1
- package/account/get-account-config-from-environment.mjs.map +1 -1
- package/account/get-account.d.ts +0 -1
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +0 -1
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/index.d.ts +0 -1
- package/account/mnemonic-account.d.ts +0 -1
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs.map +1 -1
- package/amount.d.ts +14 -5
- package/amount.js +6 -0
- package/amount.js.map +1 -1
- package/amount.mjs +6 -0
- package/amount.mjs.map +1 -1
- package/app-client.d.ts +15 -1
- package/app-client.js +15 -0
- package/app-client.js.map +1 -1
- package/app-client.mjs +15 -0
- package/app-client.mjs.map +1 -1
- package/app-deploy.d.ts +0 -1
- package/app-deploy.js +4 -6
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +7 -9
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +10 -11
- package/app.js +15 -11
- package/app.js.map +1 -1
- package/app.mjs +15 -11
- package/app.mjs.map +1 -1
- package/asset.d.ts +3 -4
- package/asset.js +3 -6
- package/asset.js.map +1 -1
- package/asset.mjs +3 -6
- package/asset.mjs.map +1 -1
- package/config.d.ts +0 -1
- package/config.js.map +1 -1
- package/config.mjs.map +1 -1
- package/debugging/debugging.d.ts +3 -5
- package/debugging/debugging.js +4 -128
- package/debugging/debugging.js.map +1 -1
- package/debugging/debugging.mjs +4 -109
- package/debugging/debugging.mjs.map +1 -1
- package/debugging/index.d.ts +0 -2
- package/dispenser-client.d.ts +0 -1
- package/dispenser-client.js.map +1 -1
- package/dispenser-client.mjs.map +1 -1
- package/index.d.ts +6 -5
- package/index.js +48 -38
- package/index.js.map +1 -1
- package/index.mjs +6 -5
- package/index.mjs.map +1 -1
- package/indexer-lookup.d.ts +0 -1
- package/indexer-lookup.js.map +1 -1
- package/indexer-lookup.mjs.map +1 -1
- package/localnet/get-kmd-wallet-account.d.ts +0 -1
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +0 -1
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +0 -1
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
- package/localnet/index.d.ts +0 -1
- package/localnet/is-localnet.d.ts +0 -1
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +0 -1
- package/network-client.js.map +1 -1
- package/network-client.mjs.map +1 -1
- package/package.json +2 -2
- package/testing/_asset.d.ts +0 -1
- package/testing/account.d.ts +0 -1
- package/testing/account.js.map +1 -1
- package/testing/account.mjs.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
- package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
- package/testing/fixtures/algorand-fixture.d.ts +0 -1
- package/testing/fixtures/algorand-fixture.js +1 -1
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +1 -1
- package/testing/fixtures/algorand-fixture.mjs.map +1 -1
- package/testing/fixtures/index.d.ts +0 -1
- package/testing/index.d.ts +0 -1
- package/testing/indexer.d.ts +0 -1
- package/testing/indexer.js.map +1 -1
- package/testing/indexer.mjs.map +1 -1
- package/testing/test-logger.d.ts +0 -1
- package/testing/test-logger.js +1 -3
- package/testing/test-logger.js.map +1 -1
- package/testing/test-logger.mjs +1 -3
- package/testing/test-logger.mjs.map +1 -1
- package/testing/transaction-logger.d.ts +0 -1
- package/testing/transaction-logger.js.map +1 -1
- package/testing/transaction-logger.mjs.map +1 -1
- package/transaction/index.d.ts +0 -1
- package/transaction/legacy-bridge.d.ts +5 -6
- package/transaction/legacy-bridge.js +1 -1
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +4 -4
- package/transaction/legacy-bridge.mjs.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.js +1 -0
- package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs +1 -0
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +41 -6
- package/transaction/transaction.js +113 -61
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +113 -62
- package/transaction/transaction.mjs.map +1 -1
- package/transfer/index.d.ts +0 -1
- package/transfer/transfer-algos.d.ts +1 -2
- package/transfer/transfer-algos.js +1 -1
- package/transfer/transfer-algos.js.map +1 -1
- package/transfer/transfer-algos.mjs +1 -1
- package/transfer/transfer-algos.mjs.map +1 -1
- package/transfer/transfer.d.ts +1 -2
- package/transfer/transfer.js +3 -3
- package/transfer/transfer.js.map +1 -1
- package/transfer/transfer.mjs +3 -3
- package/transfer/transfer.mjs.map +1 -1
- package/types/account-manager.d.ts +15 -7
- package/types/account-manager.js +27 -11
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +29 -13
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +9 -1
- package/types/account.js.map +1 -1
- package/types/account.mjs.map +1 -1
- package/types/algo-http-client-with-retry.d.ts +0 -1
- package/types/algo-http-client-with-retry.js.map +1 -1
- package/types/algo-http-client-with-retry.mjs.map +1 -1
- package/types/algorand-client-interface.d.ts +28 -0
- package/types/algorand-client-interface.js +3 -0
- package/types/algorand-client-interface.js.map +1 -0
- package/types/algorand-client-interface.mjs +2 -0
- package/types/algorand-client-interface.mjs.map +1 -0
- package/types/algorand-client-transaction-creator.d.ts +33 -34
- package/types/algorand-client-transaction-creator.js +31 -31
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +31 -31
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +31 -32
- package/types/algorand-client-transaction-sender.js +25 -9
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +25 -9
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +13 -13
- package/types/algorand-client.js +10 -10
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +12 -12
- package/types/algorand-client.mjs.map +1 -1
- package/types/amount.d.ts +10 -11
- package/types/amount.js +7 -7
- package/types/amount.js.map +1 -1
- package/types/amount.mjs +7 -7
- package/types/amount.mjs.map +1 -1
- package/types/app-arc56.d.ts +359 -0
- package/types/app-arc56.js +184 -0
- package/types/app-arc56.js.map +1 -0
- package/types/app-arc56.mjs +175 -0
- package/types/app-arc56.mjs.map +1 -0
- package/types/app-client.d.ts +1494 -8
- package/types/app-client.js +1009 -19
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +1009 -20
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +19 -14
- package/types/app-deployer.js +25 -25
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs +27 -27
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +846 -0
- package/types/app-factory.js +409 -0
- package/types/app-factory.js.map +1 -0
- package/types/app-factory.mjs +407 -0
- package/types/app-factory.mjs.map +1 -0
- package/types/app-manager.d.ts +12 -3
- package/types/app-manager.js +13 -15
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +13 -15
- package/types/app-manager.mjs.map +1 -1
- package/types/app-spec.d.ts +2 -1
- package/types/app-spec.js +127 -0
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +126 -0
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +14 -9
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +7 -7
- package/types/asset-manager.js +5 -6
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +5 -6
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +0 -1
- package/types/async-event-emitter.d.ts +14 -0
- package/types/async-event-emitter.js +50 -0
- package/types/async-event-emitter.js.map +1 -0
- package/types/async-event-emitter.mjs +48 -0
- package/types/async-event-emitter.mjs.map +1 -0
- package/types/client-manager.d.ts +131 -51
- package/types/client-manager.js +143 -23
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +144 -24
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +110 -37
- package/types/composer.js +139 -26
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +140 -27
- package/types/composer.mjs.map +1 -1
- package/types/config.d.ts +3 -6
- package/types/config.js +5 -44
- package/types/config.js.map +1 -1
- package/types/config.mjs +5 -27
- package/types/config.mjs.map +1 -1
- package/types/debugging.d.ts +29 -101
- package/types/debugging.js +16 -109
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs +12 -107
- package/types/debugging.mjs.map +1 -1
- package/types/dispenser-client.d.ts +1 -2
- package/types/dispenser-client.js +6 -5
- package/types/dispenser-client.js.map +1 -1
- package/types/dispenser-client.mjs +6 -5
- package/types/dispenser-client.mjs.map +1 -1
- package/types/expand.d.ts +0 -1
- package/types/indexer.d.ts +0 -1
- package/types/indexer.js.map +1 -1
- package/types/indexer.mjs.map +1 -1
- package/types/kmd-account-manager.d.ts +0 -1
- package/types/kmd-account-manager.js +2 -2
- package/types/kmd-account-manager.js.map +1 -1
- package/types/kmd-account-manager.mjs +4 -4
- package/types/kmd-account-manager.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +10 -0
- package/types/lifecycle-events.js +8 -0
- package/types/lifecycle-events.js.map +1 -0
- package/types/lifecycle-events.mjs +8 -0
- package/types/lifecycle-events.mjs.map +1 -0
- package/types/logging.d.ts +0 -1
- package/types/logging.js.map +1 -1
- package/types/logging.mjs.map +1 -1
- package/types/logic-error.d.ts +2 -4
- package/types/logic-error.js +3 -3
- package/types/logic-error.js.map +1 -1
- package/types/logic-error.mjs +3 -3
- package/types/logic-error.mjs.map +1 -1
- package/types/network-client.d.ts +13 -1
- package/types/network-client.js.map +1 -1
- package/types/network-client.mjs.map +1 -1
- package/types/testing.d.ts +3 -4
- package/types/transaction.d.ts +14 -4
- package/types/transfer.d.ts +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts +0 -1
- package/types/urlTokenBaseHTTPClient.js +1 -1
- package/types/urlTokenBaseHTTPClient.js.map +1 -1
- package/types/urlTokenBaseHTTPClient.mjs +1 -1
- package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
- package/util.d.ts +2 -2
- package/util.js +11 -10
- package/util.js.map +1 -1
- package/util.mjs +11 -10
- package/util.mjs.map +1 -1
- package/account/account.d.ts.map +0 -1
- package/account/get-account-config-from-environment.d.ts.map +0 -1
- package/account/get-account.d.ts.map +0 -1
- package/account/get-dispenser-account.d.ts.map +0 -1
- package/account/index.d.ts.map +0 -1
- package/account/mnemonic-account.d.ts.map +0 -1
- package/amount.d.ts.map +0 -1
- package/app-client.d.ts.map +0 -1
- package/app-deploy.d.ts.map +0 -1
- package/app.d.ts.map +0 -1
- package/asset.d.ts.map +0 -1
- package/config.d.ts.map +0 -1
- package/debugging/debugging.d.ts.map +0 -1
- package/debugging/index.d.ts.map +0 -1
- package/debugging/simulate-and-persist-response.d.ts +0 -20
- package/debugging/simulate-and-persist-response.d.ts.map +0 -1
- package/debugging/simulate-and-persist-response.js +0 -108
- package/debugging/simulate-and-persist-response.js.map +0 -1
- package/debugging/simulate-and-persist-response.mjs +0 -89
- package/debugging/simulate-and-persist-response.mjs.map +0 -1
- package/dispenser-client.d.ts.map +0 -1
- package/index.d.ts.map +0 -1
- package/indexer-lookup.d.ts.map +0 -1
- package/localnet/get-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/get-localnet-dispenser-account.d.ts.map +0 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts.map +0 -1
- package/localnet/index.d.ts.map +0 -1
- package/localnet/is-localnet.d.ts.map +0 -1
- package/network-client.d.ts.map +0 -1
- package/testing/_asset.d.ts.map +0 -1
- package/testing/account.d.ts.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
- package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
- package/testing/fixtures/index.d.ts.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/indexer.d.ts.map +0 -1
- package/testing/test-logger.d.ts.map +0 -1
- package/testing/transaction-logger.d.ts.map +0 -1
- package/transaction/index.d.ts.map +0 -1
- package/transaction/legacy-bridge.d.ts.map +0 -1
- package/transaction/perform-atomic-transaction-composer-simulate.d.ts.map +0 -1
- package/transaction/transaction.d.ts.map +0 -1
- package/transfer/index.d.ts.map +0 -1
- package/transfer/transfer-algos.d.ts.map +0 -1
- package/transfer/transfer.d.ts.map +0 -1
- package/types/account-manager.d.ts.map +0 -1
- package/types/account.d.ts.map +0 -1
- package/types/algo-http-client-with-retry.d.ts.map +0 -1
- package/types/algorand-client-transaction-creator.d.ts.map +0 -1
- package/types/algorand-client-transaction-sender.d.ts.map +0 -1
- package/types/algorand-client.d.ts.map +0 -1
- package/types/amount.d.ts.map +0 -1
- package/types/app-client.d.ts.map +0 -1
- package/types/app-deployer.d.ts.map +0 -1
- package/types/app-manager.d.ts.map +0 -1
- package/types/app-spec.d.ts.map +0 -1
- package/types/app.d.ts.map +0 -1
- package/types/asset-manager.d.ts.map +0 -1
- package/types/asset.d.ts.map +0 -1
- package/types/client-manager.d.ts.map +0 -1
- package/types/composer.d.ts.map +0 -1
- package/types/config.d.ts.map +0 -1
- package/types/debugging.d.ts.map +0 -1
- package/types/dispenser-client.d.ts.map +0 -1
- package/types/expand.d.ts.map +0 -1
- package/types/indexer.d.ts.map +0 -1
- package/types/kmd-account-manager.d.ts.map +0 -1
- package/types/logging.d.ts.map +0 -1
- package/types/logic-error.d.ts.map +0 -1
- package/types/network-client.d.ts.map +0 -1
- package/types/testing.d.ts.map +0 -1
- package/types/transaction.d.ts.map +0 -1
- package/types/transfer.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/util.d.ts.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Algorand Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
# AlgoKit TypeScript Utilities
|
|
2
2
|
|
|
3
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
4
|
|
|
@@ -13,7 +13,7 @@ Note: If you prefer Python there's an equivalent [Python utility library](https:
|
|
|
13
13
|
This library can be installed from NPM using your favourite npm client, e.g.:
|
|
14
14
|
|
|
15
15
|
```
|
|
16
|
-
npm install @algorandfoundation/algokit-utils
|
|
16
|
+
npm install algosdk@2 @algorandfoundation/algokit-utils
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Then to import it:
|
|
@@ -22,34 +22,12 @@ Then to import it:
|
|
|
22
22
|
import { AlgorandClient, Config } from '@algorandfoundation/algokit-utils'
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
See [usage](./docs/README.md#usage) for more.
|
|
25
|
+
See [usage](./docs/README.md#usage) for more details.
|
|
26
26
|
|
|
27
27
|
## Guiding principles
|
|
28
28
|
|
|
29
29
|
This library follows the [Guiding Principles of AlgoKit](https://github.com/algorandfoundation/algokit-cli/blob/main/docs/algokit.md#guiding-principles).
|
|
30
30
|
|
|
31
|
-
## NextJS compatibility
|
|
32
|
-
|
|
33
|
-
`algokit-utils-ts` has a set of `node` specific utilities used for simplifying aggregation of artifacts for [AlgoKit VSCode Debugger Extension](https://github.com/algorandfoundation/algokit-avm-vscode-debugger). Which causes Next.js based projects to fail on `fs` module not found. To fix this issue, you can add the following to your `next.config.js` file:
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
webpack: (config, { isServer }) => {
|
|
37
|
-
// Fix for Module not found: Can't resolve 'fs'
|
|
38
|
-
if (!isServer) {
|
|
39
|
-
config.resolve.fallback.fs = false;
|
|
40
|
-
}
|
|
41
|
-
return config;
|
|
42
|
-
},
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
The root cause is due to the fact that, unlike many frameworks, Next.js allows you to import server-only (Node.js APIs that don't work in a browser) code into your page files. When Next.js builds your project, it removes server only code from your client-side bundle by checking which code exists inside one any of the following built-in methods (code splitting):
|
|
46
|
-
|
|
47
|
-
- getServerSideProps
|
|
48
|
-
- getStaticProps
|
|
49
|
-
- getStaticPaths
|
|
50
|
-
|
|
51
|
-
The Module not found: can't resolve 'xyz' error happens when you try to use server only code outside of these methods. Despite `algokit-utils` lazy loading the node specific code dynamically, Next.js does not seem to correctly identify whether a dynamic import is specific to server or client side. Hence the above fix disables the fallback for `fs` module so it ignores polyfilling it on client side.
|
|
52
|
-
|
|
53
31
|
## Contributing
|
|
54
32
|
|
|
55
33
|
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.
|
package/account/account.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export declare function getAccountAddressAsUint8Array(account: SendTransactionFr
|
|
|
96
96
|
* @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key
|
|
97
97
|
*/
|
|
98
98
|
export declare function getAccountAddressAsString(addressEncodedInB64: string): string;
|
|
99
|
-
type NumberConverter<T extends AccountInformationModel> = {
|
|
99
|
+
export type NumberConverter<T extends AccountInformationModel> = {
|
|
100
100
|
[key in keyof T]: ToNumberIfExtends<T[key], number | bigint>;
|
|
101
101
|
};
|
|
102
102
|
type ToNumberIfExtends<K, E> = K extends E ? number : K;
|
|
@@ -139,4 +139,3 @@ export declare function getAccountInformation(sender: string | SendTransactionFr
|
|
|
139
139
|
*/
|
|
140
140
|
export declare function getAccountAssetInformation(sender: string | SendTransactionFrom, assetId: number | bigint, algod: Algodv2): Promise<AccountAssetInformation>;
|
|
141
141
|
export {};
|
|
142
|
-
//# sourceMappingURL=account.d.ts.map
|
package/account/account.js
CHANGED
|
@@ -139,10 +139,12 @@ async function getAccountInformation(sender, algod) {
|
|
|
139
139
|
totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
|
|
140
140
|
totalCreatedApps: Number(account.totalCreatedApps),
|
|
141
141
|
totalCreatedAssets: Number(account.totalCreatedAssets),
|
|
142
|
-
appsTotalExtraPages: account.appsTotalExtraPages ? Number(account.appsTotalExtraPages) : undefined,
|
|
143
|
-
rewardBase: account.rewardBase ? Number(account.rewardBase) : undefined,
|
|
144
|
-
totalBoxBytes: account.totalBoxBytes ? Number(account.totalBoxBytes) : undefined,
|
|
145
|
-
totalBoxes: account.totalBoxes ? Number(account.totalBoxes) : undefined,
|
|
142
|
+
appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,
|
|
143
|
+
rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,
|
|
144
|
+
totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,
|
|
145
|
+
totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,
|
|
146
|
+
lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,
|
|
147
|
+
lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,
|
|
146
148
|
};
|
|
147
149
|
}
|
|
148
150
|
/**
|
package/account/account.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.js","sources":["../../src/account/account.ts"],"sourcesContent":[null],"names":["MultisigAccount","SigningAccount","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"mappings":";;;;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAA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AAC,aAAa,CAAC,GAAG,SAAS;AAChF,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS;KACxE,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAOC,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAACD,4BAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"account.js","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { getSenderAddress } from '../transaction/transaction'\nimport { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgorandClient } from '../types/algorand-client'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { SendTransactionFrom } from '../types/transaction'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport TransactionSigner = algosdk.TransactionSigner\nimport AccountInformationModel = algosdk.modelsv2.Account\n\n/**\n * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.\n *\n * Returns an account wrapper that supports partial or full multisig signing.\n * @param multisigParams The parameters that define the multisig account\n * @param signingAccounts The signers that are currently present\n * @returns A multisig account wrapper\n */\nexport function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n return new MultisigAccount(multisigParams, signingAccounts)\n}\n\n/**\n * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.\n *\n * Returns an account wrapper that supports a rekeyed account.\n * @param signer The account, with private key loaded, that is signing\n * @param sender The address of the rekeyed account that will act as a sender\n * @returns The SigningAccount wrapper\n */\nexport function rekeyedAccount(signer: Account, sender: string) {\n return new SigningAccount(signer, sender)\n}\n\n/**\n * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.\n *\n * Returns an account wrapper that supports a transaction signer with associated sender address.\n * @param signer The transaction signer\n * @param sender The address of sender account\n * @returns The SigningAccount wrapper\n */\nexport function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount {\n return { addr: sender, signer }\n}\n\n/**\n * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.\n *\n * Returns a new, random Algorand account with secret key loaded.\n *\n * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.\n *\n */\nexport function randomAccount(): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.generateAccount()\n}\n\n/**\n * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.\n *\n * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.MY_ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n * If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: string: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function mnemonicAccountFromEnvironment(\n account: string | { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n return (\n await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(\n typeof account === 'string' ? account : account.name,\n typeof account === 'string' ? undefined : account.fundWith,\n )\n ).account\n}\n\n/**\n * @deprecated Use `algosdk.decodeAddress` instead.\n *\n * Returns an account's address as a byte array\n *\n * @param account Either an account (with private key loaded) or the string address of an account\n */\nexport function getAccountAddressAsUint8Array(account: SendTransactionFrom | string) {\n return algosdk.decodeAddress(typeof account === 'string' ? account : getSenderAddress(account)).publicKey\n}\n\n/**\n * @deprecated Use `algosdk.encodeAddress` instead.\n *\n * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key\n *\n * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key\n */\nexport function getAccountAddressAsString(addressEncodedInB64: string): string {\n return algosdk.encodeAddress(Buffer.from(addressEncodedInB64, 'base64'))\n}\n\nexport type NumberConverter<T extends AccountInformationModel> = { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> }\ntype ToNumberIfExtends<K, E> = K extends E ? number : K\n/** @deprecated Account information at a given round. */\nexport type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'get_obj_for_encoding'>\n\n/**\n * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.\n *\n * Returns the given sender account's current status, balance and spendable amounts.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const accountInfo = await account.getInformation(address, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)\n * @param sender The address of the sender/account to look up\n * @param algod The algod instance\n * @returns The account information\n */\nexport async function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation> {\n const account = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do())\n\n return {\n ...account,\n // None of these can practically overflow 2^53\n amount: Number(account.amount),\n amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),\n minBalance: Number(account.minBalance),\n pendingRewards: Number(account.pendingRewards),\n rewards: Number(account.rewards),\n round: Number(account.round),\n totalAppsOptedIn: Number(account.totalAppsOptedIn),\n totalAssetsOptedIn: Number(account.totalAssetsOptedIn),\n totalCreatedApps: Number(account.totalCreatedApps),\n totalCreatedAssets: Number(account.totalCreatedAssets),\n appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,\n rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,\n totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,\n totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,\n lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,\n lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,\n }\n}\n\n/**\n * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.\n *\n * Returns the given sender account's asset holding for a given asset.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const assetId = 123345;\n * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)\n * @param sender The address of the sender/account to look up\n * @param assetId The ID of the asset to return a holding for\n * @param algod The algod instance\n * @returns The account asset holding information\n */\nexport async function getAccountAssetInformation(\n sender: string | SendTransactionFrom,\n assetId: number | bigint,\n algod: Algodv2,\n): Promise<AccountAssetInformation> {\n return AlgorandClient.fromClients({ algod }).asset.getAccountInformation(getSenderAddress(sender), BigInt(assetId))\n}\n"],"names":["MultisigAccount","SigningAccount","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"mappings":";;;;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAIA,6BAAe,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAIC,4BAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AACjC,CAAC;AAED;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE,CAAA;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAACD,4BAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;;;;;;;;;"}
|
package/account/account.mjs
CHANGED
|
@@ -137,10 +137,12 @@ async function getAccountInformation(sender, algod) {
|
|
|
137
137
|
totalAssetsOptedIn: Number(account.totalAssetsOptedIn),
|
|
138
138
|
totalCreatedApps: Number(account.totalCreatedApps),
|
|
139
139
|
totalCreatedAssets: Number(account.totalCreatedAssets),
|
|
140
|
-
appsTotalExtraPages: account.appsTotalExtraPages ? Number(account.appsTotalExtraPages) : undefined,
|
|
141
|
-
rewardBase: account.rewardBase ? Number(account.rewardBase) : undefined,
|
|
142
|
-
totalBoxBytes: account.totalBoxBytes ? Number(account.totalBoxBytes) : undefined,
|
|
143
|
-
totalBoxes: account.totalBoxes ? Number(account.totalBoxes) : undefined,
|
|
140
|
+
appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,
|
|
141
|
+
rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,
|
|
142
|
+
totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,
|
|
143
|
+
totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,
|
|
144
|
+
lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,
|
|
145
|
+
lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,
|
|
144
146
|
};
|
|
145
147
|
}
|
|
146
148
|
/**
|
package/account/account.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.mjs","sources":["../../src/account/account.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,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AG,SAAS;AAChF,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS;KACxE,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAO,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;"}
|
|
1
|
+
{"version":3,"file":"account.mjs","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { getSenderAddress } from '../transaction/transaction'\nimport { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgorandClient } from '../types/algorand-client'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { SendTransactionFrom } from '../types/transaction'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport TransactionSigner = algosdk.TransactionSigner\nimport AccountInformationModel = algosdk.modelsv2.Account\n\n/**\n * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.\n *\n * Returns an account wrapper that supports partial or full multisig signing.\n * @param multisigParams The parameters that define the multisig account\n * @param signingAccounts The signers that are currently present\n * @returns A multisig account wrapper\n */\nexport function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n return new MultisigAccount(multisigParams, signingAccounts)\n}\n\n/**\n * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.\n *\n * Returns an account wrapper that supports a rekeyed account.\n * @param signer The account, with private key loaded, that is signing\n * @param sender The address of the rekeyed account that will act as a sender\n * @returns The SigningAccount wrapper\n */\nexport function rekeyedAccount(signer: Account, sender: string) {\n return new SigningAccount(signer, sender)\n}\n\n/**\n * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.\n *\n * Returns an account wrapper that supports a transaction signer with associated sender address.\n * @param signer The transaction signer\n * @param sender The address of sender account\n * @returns The SigningAccount wrapper\n */\nexport function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount {\n return { addr: sender, signer }\n}\n\n/**\n * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.\n *\n * Returns a new, random Algorand account with secret key loaded.\n *\n * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.\n *\n */\nexport function randomAccount(): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.generateAccount()\n}\n\n/**\n * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.\n *\n * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.MY_ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n * If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: string: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function mnemonicAccountFromEnvironment(\n account: string | { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n return (\n await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(\n typeof account === 'string' ? account : account.name,\n typeof account === 'string' ? undefined : account.fundWith,\n )\n ).account\n}\n\n/**\n * @deprecated Use `algosdk.decodeAddress` instead.\n *\n * Returns an account's address as a byte array\n *\n * @param account Either an account (with private key loaded) or the string address of an account\n */\nexport function getAccountAddressAsUint8Array(account: SendTransactionFrom | string) {\n return algosdk.decodeAddress(typeof account === 'string' ? account : getSenderAddress(account)).publicKey\n}\n\n/**\n * @deprecated Use `algosdk.encodeAddress` instead.\n *\n * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key\n *\n * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key\n */\nexport function getAccountAddressAsString(addressEncodedInB64: string): string {\n return algosdk.encodeAddress(Buffer.from(addressEncodedInB64, 'base64'))\n}\n\nexport type NumberConverter<T extends AccountInformationModel> = { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> }\ntype ToNumberIfExtends<K, E> = K extends E ? number : K\n/** @deprecated Account information at a given round. */\nexport type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'get_obj_for_encoding'>\n\n/**\n * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.\n *\n * Returns the given sender account's current status, balance and spendable amounts.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const accountInfo = await account.getInformation(address, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)\n * @param sender The address of the sender/account to look up\n * @param algod The algod instance\n * @returns The account information\n */\nexport async function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation> {\n const account = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do())\n\n return {\n ...account,\n // None of these can practically overflow 2^53\n amount: Number(account.amount),\n amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),\n minBalance: Number(account.minBalance),\n pendingRewards: Number(account.pendingRewards),\n rewards: Number(account.rewards),\n round: Number(account.round),\n totalAppsOptedIn: Number(account.totalAppsOptedIn),\n totalAssetsOptedIn: Number(account.totalAssetsOptedIn),\n totalCreatedApps: Number(account.totalCreatedApps),\n totalCreatedAssets: Number(account.totalCreatedAssets),\n appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,\n rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,\n totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,\n totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,\n lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,\n lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,\n }\n}\n\n/**\n * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.\n *\n * Returns the given sender account's asset holding for a given asset.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const assetId = 123345;\n * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)\n * @param sender The address of the sender/account to look up\n * @param assetId The ID of the asset to return a holding for\n * @param algod The algod instance\n * @returns The account asset holding information\n */\nexport async function getAccountAssetInformation(\n sender: string | SendTransactionFrom,\n assetId: number | bigint,\n algod: Algodv2,\n): Promise<AccountAssetInformation> {\n return AlgorandClient.fromClients({ algod }).asset.getAccountInformation(getSenderAddress(sender), BigInt(assetId))\n}\n"],"names":[],"mappings":";;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAA;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AACjC,CAAC;AAED;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE,CAAA;AAClC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACI,eAAe,8BAA8B,CAClD,OAAyD,EACzD,KAAc,EACd,SAAe,EAAA;IAEf,OAAO,CACL,MA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AAO,CAAC,CAAC,CAAA;AACrH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-account-config-from-environment.js","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-account-config-from-environment.js","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":["import { AccountConfig } from '../types/account'\n\n/** @deprecated Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function\n * Returns the Account configuration from environment variables\n *\n * @param accountName account name\n *\n * @example environment variables\n * {accountName}_MNEMONIC\n * {accountName}_SENDER\n *\n */\nexport function getAccountConfigFromEnvironment(accountName: string): AccountConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get account with private key from a non Node.js context; not supported!')\n }\n\n return {\n accountMnemonic: process.env[`${accountName.toUpperCase()}_MNEMONIC`] || '',\n senderAddress: process.env[`${accountName.toUpperCase()}_SENDER`],\n accountName,\n }\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-account-config-from-environment.mjs","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-account-config-from-environment.mjs","sources":["../../src/account/get-account-config-from-environment.ts"],"sourcesContent":["import { AccountConfig } from '../types/account'\n\n/** @deprecated Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function\n * Returns the Account configuration from environment variables\n *\n * @param accountName account name\n *\n * @example environment variables\n * {accountName}_MNEMONIC\n * {accountName}_SENDER\n *\n */\nexport function getAccountConfigFromEnvironment(accountName: string): AccountConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get account with private key from a non Node.js context; not supported!')\n }\n\n return {\n accountMnemonic: process.env[`${accountName.toUpperCase()}_MNEMONIC`] || '',\n senderAddress: process.env[`${accountName.toUpperCase()}_SENDER`],\n accountName,\n }\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
|
package/account/get-account.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-account.js","sources":["../../src/account/get-account.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-account.js","sources":["../../src/account/get-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountConfig, SigningAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { getAccountConfigFromEnvironment } from './get-account-config-from-environment'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n *\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount('ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName)\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { config: AccountConfig; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) OR\n * * `name`: string: The name identifier of the account (deprecated)\n * And optionally\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | { config: AccountConfig; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n let name: string\n let fundWith: AlgoAmount | undefined = undefined\n let config: AccountConfig\n\n if (typeof account === 'string') {\n name = account\n config = getAccountConfigFromEnvironment(name)\n } else if ('name' in account) {\n name = account.name\n config = getAccountConfigFromEnvironment(name)\n fundWith = account.fundWith\n } else if ('config' in account) {\n config = account.config\n name = config.accountName\n fundWith = account.fundWith\n } else {\n throw new Error('Missing name or account config')\n }\n\n return (await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(name, fundWith)).account\n}\n"],"names":["getAccountConfigFromEnvironment","AccountManager","ClientManager"],"mappings":";;;;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;KAClD;IAED,OAAO,CAAC,MAAM,IAAIC,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-account.mjs","sources":["../../src/account/get-account.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-account.mjs","sources":["../../src/account/get-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountConfig, SigningAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { getAccountConfigFromEnvironment } from './get-account-config-from-environment'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n *\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount('ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName)\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { config: AccountConfig; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) OR\n * * `name`: string: The name identifier of the account (deprecated)\n * And optionally\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @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\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | { config: AccountConfig; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n let name: string\n let fundWith: AlgoAmount | undefined = undefined\n let config: AccountConfig\n\n if (typeof account === 'string') {\n name = account\n config = getAccountConfigFromEnvironment(name)\n } else if ('name' in account) {\n name = account.name\n config = getAccountConfigFromEnvironment(name)\n fundWith = account.fundWith\n } else if ('config' in account) {\n config = account.config\n name = config.accountName\n fundWith = account.fundWith\n } else {\n throw new Error('Missing name or account config')\n }\n\n return (await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(name, fundWith)).account\n}\n"],"names":[],"mappings":";;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;KAClD;IAED,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
|
|
@@ -15,4 +15,3 @@ import Kmd = algosdk.Kmd;
|
|
|
15
15
|
export declare function getDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<import("../types/account").TransactionSignerAccount & {
|
|
16
16
|
account: import("../types/account").SigningAccount;
|
|
17
17
|
}>;
|
|
18
|
-
//# sourceMappingURL=get-dispenser-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-dispenser-account.js","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-dispenser-account.js","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\n\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated Use `algorand.account.dispenserFromEnvironment()` or `new AccountManager(clientManager).dispenserFromEnvironment()` instead\n *\n * Returns an account (with private key loaded) that can act as a dispenser\n *\n * If running on LocalNet then it will return the default dispenser account automatically,\n * otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getDispenserAccount(algod: Algodv2, kmd?: Kmd) {\n return new AccountManager(new ClientManager({ algod, kmd })).dispenserFromEnvironment()\n}\n"],"names":["AccountManager","ClientManager"],"mappings":";;;;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAIA,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-dispenser-account.mjs","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-dispenser-account.mjs","sources":["../../src/account/get-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\n\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated Use `algorand.account.dispenserFromEnvironment()` or `new AccountManager(clientManager).dispenserFromEnvironment()` instead\n *\n * Returns an account (with private key loaded) that can act as a dispenser\n *\n * If running on LocalNet then it will return the default dispenser account automatically,\n * otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getDispenserAccount(algod: Algodv2, kmd?: Kmd) {\n return new AccountManager(new ClientManager({ algod, kmd })).dispenserFromEnvironment()\n}\n"],"names":[],"mappings":";;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
|
package/account/index.d.ts
CHANGED
|
@@ -11,4 +11,3 @@ import Account = algosdk.Account;
|
|
|
11
11
|
* never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.
|
|
12
12
|
*/
|
|
13
13
|
export declare function mnemonicAccount(mnemonicSecret: string): Account;
|
|
14
|
-
//# sourceMappingURL=mnemonic-account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mnemonic-account.js","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"mnemonic-account.js","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Account = algosdk.Account\n\n/**\n * @deprecated Use `algorand.account.fromMnemonic(mnemonicSecret)` or `algosdk.mnemonicToSecretKey(mnemonicSecret)` instead.\n *\n * Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.\n *\n * This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.\n *\n * @param mnemonicSecret The mnemonic secret representing the private key of an account; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.\n */\nexport function mnemonicAccount(mnemonicSecret: string): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.mnemonicToSecretKey(mnemonicSecret)\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mnemonic-account.mjs","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"mnemonic-account.mjs","sources":["../../src/account/mnemonic-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Account = algosdk.Account\n\n/**\n * @deprecated Use `algorand.account.fromMnemonic(mnemonicSecret)` or `algosdk.mnemonicToSecretKey(mnemonicSecret)` instead.\n *\n * Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.\n *\n * This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.\n *\n * @param mnemonicSecret The mnemonic secret representing the private key of an account; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.\n */\nexport function mnemonicAccount(mnemonicSecret: string): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.mnemonicToSecretKey(mnemonicSecret)\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
|
package/amount.d.ts
CHANGED
|
@@ -18,25 +18,34 @@ declare global {
|
|
|
18
18
|
*/
|
|
19
19
|
algo(this: number): AlgoAmount;
|
|
20
20
|
}
|
|
21
|
+
interface BigInt {
|
|
22
|
+
/**
|
|
23
|
+
* Returns an `AlgoAmount` using this number of microAlgo.
|
|
24
|
+
*/
|
|
25
|
+
microAlgo(this: bigint): AlgoAmount;
|
|
26
|
+
/**
|
|
27
|
+
* Returns an `AlgoAmount` using this number of Algo.
|
|
28
|
+
*/
|
|
29
|
+
algo(this: bigint): AlgoAmount;
|
|
30
|
+
}
|
|
21
31
|
}
|
|
22
32
|
/** Returns an amount of Algo using AlgoAmount
|
|
23
33
|
* @param algos The amount of Algo
|
|
24
34
|
*/
|
|
25
|
-
export declare const algos: (algos: number) => AlgoAmount;
|
|
35
|
+
export declare const algos: (algos: number | bigint) => AlgoAmount;
|
|
26
36
|
/** Returns an amount of Algo using AlgoAmount
|
|
27
37
|
* @param algos The amount of Algo
|
|
28
38
|
*/
|
|
29
|
-
export declare const algo: (algos: number) => AlgoAmount;
|
|
39
|
+
export declare const algo: (algos: number | bigint) => AlgoAmount;
|
|
30
40
|
/** Returns an amount of µAlgo using AlgoAmount
|
|
31
41
|
* @param microAlgos The amount of µAlgo
|
|
32
42
|
*/
|
|
33
|
-
export declare const microAlgos: (microAlgos: number) => AlgoAmount;
|
|
43
|
+
export declare const microAlgos: (microAlgos: number | bigint) => AlgoAmount;
|
|
34
44
|
/** Returns an amount of µAlgo using AlgoAmount
|
|
35
45
|
* @param microAlgos The amount of µAlgo
|
|
36
46
|
*/
|
|
37
|
-
export declare const microAlgo: (microAlgos: number) => AlgoAmount;
|
|
47
|
+
export declare const microAlgo: (microAlgos: number | bigint) => AlgoAmount;
|
|
38
48
|
/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount
|
|
39
49
|
* @param numberOfTransactions The of standard transaction fees to return the amount of Algo
|
|
40
50
|
*/
|
|
41
51
|
export declare const transactionFees: (numberOfTransactions: number) => AlgoAmount;
|
|
42
|
-
//# sourceMappingURL=amount.d.ts.map
|
package/amount.js
CHANGED
|
@@ -15,6 +15,12 @@ Number.prototype.microAlgo = function () {
|
|
|
15
15
|
Number.prototype.algo = function () {
|
|
16
16
|
return types_amount.AlgoAmount.Algo(this);
|
|
17
17
|
};
|
|
18
|
+
BigInt.prototype.microAlgo = function () {
|
|
19
|
+
return types_amount.AlgoAmount.MicroAlgo(this);
|
|
20
|
+
};
|
|
21
|
+
BigInt.prototype.algo = function () {
|
|
22
|
+
return types_amount.AlgoAmount.Algo(this);
|
|
23
|
+
};
|
|
18
24
|
/** Returns an amount of Algo using AlgoAmount
|
|
19
25
|
* @param algos The amount of Algo
|
|
20
26
|
*/
|
package/amount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amount.js","sources":["../src/amount.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"amount.js","sources":["../src/amount.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from './types/amount'\n\ndeclare global {\n interface Number {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: number): AlgoAmount\n }\n interface BigInt {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: bigint): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: bigint): AlgoAmount\n }\n}\n\nNumber.prototype.microAlgos = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n return AlgoAmount.MicroAlgo(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE)\n}\n"],"names":["AlgoAmount"],"mappings":";;;;;AAkCA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAA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AAC,oBAA4B,KAAI;IAC9D,OAAOA,uBAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjF;;;;;;;;"}
|
package/amount.mjs
CHANGED
|
@@ -13,6 +13,12 @@ Number.prototype.microAlgo = function () {
|
|
|
13
13
|
Number.prototype.algo = function () {
|
|
14
14
|
return AlgoAmount.Algo(this);
|
|
15
15
|
};
|
|
16
|
+
BigInt.prototype.microAlgo = function () {
|
|
17
|
+
return AlgoAmount.MicroAlgo(this);
|
|
18
|
+
};
|
|
19
|
+
BigInt.prototype.algo = function () {
|
|
20
|
+
return AlgoAmount.Algo(this);
|
|
21
|
+
};
|
|
16
22
|
/** Returns an amount of Algo using AlgoAmount
|
|
17
23
|
* @param algos The amount of Algo
|
|
18
24
|
*/
|
package/amount.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amount.mjs","sources":["../src/amount.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"amount.mjs","sources":["../src/amount.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from './types/amount'\n\ndeclare global {\n interface Number {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: number): AlgoAmount\n }\n interface BigInt {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: bigint): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: bigint): AlgoAmount\n }\n}\n\nNumber.prototype.microAlgos = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n return AlgoAmount.MicroAlgo(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE)\n}\n"],"names":[],"mappings":";;;AAkCA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;IAC9D,OAAO,UAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AACjF;;;;"}
|
package/app-client.d.ts
CHANGED
|
@@ -2,6 +2,11 @@ import algosdk from 'algosdk';
|
|
|
2
2
|
import { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client';
|
|
3
3
|
import Algodv2 = algosdk.Algodv2;
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
|
|
6
|
+
* `algorand.client.getAppClientByCreatorAndName`.
|
|
7
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
8
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
9
|
+
*
|
|
5
10
|
* Create a new ApplicationClient instance
|
|
6
11
|
* @param appDetails The details of the app
|
|
7
12
|
* @param algod An algod instance
|
|
@@ -33,6 +38,11 @@ import Algodv2 = algosdk.Algodv2;
|
|
|
33
38
|
*/
|
|
34
39
|
export declare function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2): ApplicationClient;
|
|
35
40
|
/**
|
|
41
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.
|
|
42
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
43
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
44
|
+
*
|
|
45
|
+
*
|
|
36
46
|
* Create a new ApplicationClient instance by id
|
|
37
47
|
* @param appDetails The details of the app
|
|
38
48
|
* @param algod An algod instance
|
|
@@ -51,6 +61,11 @@ export declare function getAppClient(appDetails: AppSpecAppDetails, algod: Algod
|
|
|
51
61
|
*/
|
|
52
62
|
export declare function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2): ApplicationClient;
|
|
53
63
|
/**
|
|
64
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.
|
|
65
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
66
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
67
|
+
*
|
|
68
|
+
*
|
|
54
69
|
* Create a new ApplicationClient instance by creator and name
|
|
55
70
|
* @param appDetails The details of the app by creator and name
|
|
56
71
|
* @param algod An algod instance
|
|
@@ -69,4 +84,3 @@ export declare function getAppClientById(appDetails: AppSpecAppDetailsById, algo
|
|
|
69
84
|
* @returns The application client
|
|
70
85
|
*/
|
|
71
86
|
export declare function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2): ApplicationClient;
|
|
72
|
-
//# sourceMappingURL=app-client.d.ts.map
|
package/app-client.js
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
var types_appClient = require('./types/app-client.js');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
|
|
7
|
+
* `algorand.client.getAppClientByCreatorAndName`.
|
|
8
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
9
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
10
|
+
*
|
|
6
11
|
* Create a new ApplicationClient instance
|
|
7
12
|
* @param appDetails The details of the app
|
|
8
13
|
* @param algod An algod instance
|
|
@@ -36,6 +41,11 @@ function getAppClient(appDetails, algod) {
|
|
|
36
41
|
return new types_appClient.ApplicationClient(appDetails, algod);
|
|
37
42
|
}
|
|
38
43
|
/**
|
|
44
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.
|
|
45
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
46
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
47
|
+
*
|
|
48
|
+
*
|
|
39
49
|
* Create a new ApplicationClient instance by id
|
|
40
50
|
* @param appDetails The details of the app
|
|
41
51
|
* @param algod An algod instance
|
|
@@ -56,6 +66,11 @@ function getAppClientById(appDetails, algod) {
|
|
|
56
66
|
return new types_appClient.ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod);
|
|
57
67
|
}
|
|
58
68
|
/**
|
|
69
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.
|
|
70
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
71
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
72
|
+
*
|
|
73
|
+
*
|
|
59
74
|
* Create a new ApplicationClient instance by creator and name
|
|
60
75
|
* @param appDetails The details of the app by creator and name
|
|
61
76
|
* @param algod An algod instance
|
package/app-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-client.js","sources":["../src/app-client.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"app-client.js","sources":["../src/app-client.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n * `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n * Create a new ApplicationClient instance\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example Resolve by creator and name\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'creatorAndName',\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {creator},\n * findExistingUsing: indexerClient,\n * },\n * algodClient,\n * )\n *\n * @example Resolve by id:\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'id',\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {\n return new ApplicationClient(appDetails, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by id\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientById(\n * {\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by creator and name\n * @param appDetails The details of the app by creator and name\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientByCreatorAndName(\n * {\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {account.addr},\n * findExistingUsing: {indexerClient},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'creatorAndName' }, algod)\n}\n"],"names":["ApplicationClient"],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAIA,iCAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;;;"}
|
package/app-client.mjs
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ApplicationClient } from './types/app-client.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or
|
|
5
|
+
* `algorand.client.getAppClientByCreatorAndName`.
|
|
6
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
7
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
8
|
+
*
|
|
4
9
|
* Create a new ApplicationClient instance
|
|
5
10
|
* @param appDetails The details of the app
|
|
6
11
|
* @param algod An algod instance
|
|
@@ -34,6 +39,11 @@ function getAppClient(appDetails, algod) {
|
|
|
34
39
|
return new ApplicationClient(appDetails, algod);
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
42
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.
|
|
43
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
44
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
45
|
+
*
|
|
46
|
+
*
|
|
37
47
|
* Create a new ApplicationClient instance by id
|
|
38
48
|
* @param appDetails The details of the app
|
|
39
49
|
* @param algod An algod instance
|
|
@@ -54,6 +64,11 @@ function getAppClientById(appDetails, algod) {
|
|
|
54
64
|
return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod);
|
|
55
65
|
}
|
|
56
66
|
/**
|
|
67
|
+
* @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.
|
|
68
|
+
* If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,
|
|
69
|
+
* which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.
|
|
70
|
+
*
|
|
71
|
+
*
|
|
57
72
|
* Create a new ApplicationClient instance by creator and name
|
|
58
73
|
* @param appDetails The details of the app by creator and name
|
|
59
74
|
* @param algod An algod instance
|
package/app-client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-client.mjs","sources":["../src/app-client.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"app-client.mjs","sources":["../src/app-client.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n * `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n * Create a new ApplicationClient instance\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example Resolve by creator and name\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'creatorAndName',\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {creator},\n * findExistingUsing: indexerClient,\n * },\n * algodClient,\n * )\n *\n * @example Resolve by id:\n * const client = algokit.getAppClient(\n * {\n * resolveBy: 'id',\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {\n return new ApplicationClient(appDetails, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by id\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientById(\n * {\n * app: {appSpec},\n * sender: {account},\n * id: {id},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by creator and name\n * @param appDetails The details of the app by creator and name\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientByCreatorAndName(\n * {\n * app: {appSpec},\n * sender: {account},\n * creatorAddress: {account.addr},\n * findExistingUsing: {indexerClient},\n * },\n * algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) {\n return new ApplicationClient({ ...appDetails, resolveBy: 'creatorAndName' }, algod)\n}\n"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;"}
|
package/app-deploy.d.ts
CHANGED