@algorandfoundation/algokit-utils 2.3.3-beta.3 → 2.3.3-beta.5
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/cjs/account.d.ts.map +1 -0
- package/cjs/account.js.map +1 -0
- package/cjs/amount.d.ts.map +1 -0
- package/cjs/amount.js.map +1 -0
- package/cjs/app-client.d.ts.map +1 -0
- package/cjs/app-client.js.map +1 -0
- package/cjs/app-deploy.d.ts.map +1 -0
- package/cjs/app-deploy.js.map +1 -0
- package/cjs/app.d.ts.map +1 -0
- package/cjs/app.js.map +1 -0
- package/cjs/index.d.ts.map +1 -0
- package/cjs/index.js.map +1 -0
- package/cjs/indexer-lookup.d.ts.map +1 -0
- package/cjs/indexer-lookup.js.map +1 -0
- package/cjs/localnet.d.ts.map +1 -0
- package/{localnet.js → cjs/localnet.js} +1 -1
- package/cjs/localnet.js.map +1 -0
- package/cjs/network-client.d.ts.map +1 -0
- package/cjs/network-client.js.map +1 -0
- package/cjs/testing/account.d.ts.map +1 -0
- package/cjs/testing/account.js.map +1 -0
- package/cjs/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
- package/cjs/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/cjs/testing/fixtures/algorand-fixture.d.ts.map +1 -0
- package/cjs/testing/fixtures/algorand-fixture.js.map +1 -0
- package/cjs/testing/fixtures/index.d.ts.map +1 -0
- package/cjs/testing/fixtures/index.js.map +1 -0
- package/cjs/testing/index.d.ts.map +1 -0
- package/cjs/testing/index.js.map +1 -0
- package/cjs/testing/indexer.d.ts.map +1 -0
- package/cjs/testing/indexer.js.map +1 -0
- package/cjs/testing/test-logger.d.ts.map +1 -0
- package/{testing → cjs/testing}/test-logger.js +2 -0
- package/cjs/testing/test-logger.js.map +1 -0
- package/cjs/testing/transaction-logger.d.ts.map +1 -0
- package/{testing → cjs/testing}/transaction-logger.js +2 -3
- package/cjs/testing/transaction-logger.js.map +1 -0
- package/cjs/transaction.d.ts.map +1 -0
- package/cjs/transaction.js.map +1 -0
- package/cjs/transfer.d.ts.map +1 -0
- package/cjs/transfer.js.map +1 -0
- package/cjs/types/account.d.ts +66 -0
- package/cjs/types/account.d.ts.map +1 -0
- package/{types → cjs/types}/account.js +7 -0
- package/cjs/types/account.js.map +1 -0
- package/cjs/types/algo-http-client-with-retry.d.ts.map +1 -0
- package/{types → cjs/types}/algo-http-client-with-retry.js +16 -16
- package/cjs/types/algo-http-client-with-retry.js.map +1 -0
- package/cjs/types/amount.d.ts +24 -0
- package/cjs/types/amount.d.ts.map +1 -0
- package/{types → cjs/types}/amount.js +1 -0
- package/cjs/types/amount.js.map +1 -0
- package/cjs/types/app-client.d.ts +408 -0
- package/cjs/types/app-client.d.ts.map +1 -0
- package/{types → cjs/types}/app-client.js +13 -0
- package/cjs/types/app-client.js.map +1 -0
- package/cjs/types/app-spec.d.ts.map +1 -0
- package/{types → cjs/types}/app-spec.js.map +1 -1
- package/cjs/types/app.d.ts +308 -0
- package/cjs/types/app.d.ts.map +1 -0
- package/cjs/types/app.js.map +1 -0
- package/cjs/types/config.d.ts.map +1 -0
- package/{types → cjs/types}/config.js +1 -0
- package/cjs/types/config.js.map +1 -0
- package/cjs/types/indexer.d.ts.map +1 -0
- package/cjs/types/indexer.js.map +1 -0
- package/cjs/types/logging.d.ts.map +1 -0
- package/cjs/types/logging.js.map +1 -0
- package/cjs/types/logic-error.d.ts.map +1 -0
- package/{types → cjs/types}/logic-error.js +5 -2
- package/cjs/types/logic-error.js.map +1 -0
- package/cjs/types/network-client.d.ts +20 -0
- package/cjs/types/network-client.d.ts.map +1 -0
- package/cjs/types/network-client.js.map +1 -0
- package/cjs/types/testing.d.ts.map +1 -0
- package/{types → cjs/types}/testing.js.map +1 -1
- package/cjs/types/transaction.d.ts +111 -0
- package/cjs/types/transaction.d.ts.map +1 -0
- package/{types → cjs/types}/transaction.js.map +1 -1
- package/cjs/types/transfer.d.ts +32 -0
- package/cjs/types/transfer.d.ts.map +1 -0
- package/{types → cjs/types}/transfer.js.map +1 -1
- package/cjs/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
- package/{types → cjs/types}/urlTokenBaseHTTPClient.js +4 -0
- package/cjs/types/urlTokenBaseHTTPClient.js.map +1 -0
- package/cjs/util.d.ts.map +1 -0
- package/cjs/util.js.map +1 -0
- package/esm/account.js +170 -0
- package/esm/account.js.map +1 -0
- package/esm/amount.js +27 -0
- package/esm/amount.js.map +1 -0
- package/esm/app-client.js +76 -0
- package/esm/app-client.js.map +1 -0
- package/esm/app-deploy.js +446 -0
- package/esm/app-deploy.js.map +1 -0
- package/esm/app.js +572 -0
- package/esm/app.js.map +1 -0
- package/esm/index.js +14 -0
- package/esm/index.js.map +1 -0
- package/esm/indexer-lookup.js +98 -0
- package/esm/indexer-lookup.js.map +1 -0
- package/esm/localnet.js +111 -0
- package/esm/localnet.js.map +1 -0
- package/esm/network-client.js +179 -0
- package/esm/network-client.js.map +1 -0
- package/esm/testing/account.js +24 -0
- package/esm/testing/account.js.map +1 -0
- package/esm/testing/fixtures/algokit-log-capture-fixture.js +39 -0
- package/esm/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
- package/esm/testing/fixtures/algorand-fixture.js +53 -0
- package/esm/testing/fixtures/algorand-fixture.js.map +1 -0
- package/esm/testing/fixtures/index.js +3 -0
- package/esm/testing/fixtures/index.js.map +1 -0
- package/esm/testing/index.js +6 -0
- package/esm/testing/index.js.map +1 -0
- package/esm/testing/indexer.js +36 -0
- package/esm/testing/indexer.js.map +1 -0
- package/esm/testing/test-logger.js +69 -0
- package/esm/testing/test-logger.js.map +1 -0
- package/esm/testing/transaction-logger.js +66 -0
- package/esm/testing/transaction-logger.js.map +1 -0
- package/esm/transaction.js +365 -0
- package/esm/transaction.js.map +1 -0
- package/esm/transfer.js +59 -0
- package/esm/transfer.js.map +1 -0
- package/esm/types/account.js +90 -0
- package/esm/types/account.js.map +1 -0
- package/esm/types/algo-http-client-with-retry.js +58 -0
- package/esm/types/algo-http-client-with-retry.js.map +1 -0
- package/esm/types/amount.js +35 -0
- package/esm/types/amount.js.map +1 -0
- package/esm/types/app-client.js +624 -0
- package/esm/types/app-client.js.map +1 -0
- package/esm/types/app-spec.js +2 -0
- package/esm/types/app-spec.js.map +1 -0
- package/esm/types/app.js +33 -0
- package/esm/types/app.js.map +1 -0
- package/esm/types/config.js +50 -0
- package/esm/types/config.js.map +1 -0
- package/esm/types/indexer.js +31 -0
- package/esm/types/indexer.js.map +1 -0
- package/esm/types/logging.js +24 -0
- package/esm/types/logging.js.map +1 -0
- package/esm/types/logic-error.js +49 -0
- package/esm/types/logic-error.js.map +1 -0
- package/esm/types/network-client.js +2 -0
- package/esm/types/network-client.js.map +1 -0
- package/esm/types/testing.js +2 -0
- package/esm/types/testing.js.map +1 -0
- package/esm/types/transaction.js +2 -0
- package/esm/types/transaction.js.map +1 -0
- package/esm/types/transfer.js +2 -0
- package/esm/types/transfer.js.map +1 -0
- package/esm/types/urlTokenBaseHTTPClient.js +151 -0
- package/esm/types/urlTokenBaseHTTPClient.js.map +1 -0
- package/esm/util.js +20 -0
- package/esm/util.js.map +1 -0
- package/package.json +42 -6
- package/types/account.d.ts +125 -63
- package/types/account.d.ts.map +1 -1
- package/types/amount.d.ts +18 -22
- package/types/amount.d.ts.map +1 -1
- package/types/app-client.d.ts +70 -407
- package/types/app-client.d.ts.map +1 -1
- package/types/app-deploy.d.ts +101 -0
- package/types/app-deploy.d.ts.map +1 -0
- package/types/app.d.ts +145 -290
- package/types/app.d.ts.map +1 -1
- package/types/index.d.ts +14 -0
- package/types/index.d.ts.map +1 -0
- package/types/indexer-lookup.d.ts +38 -0
- package/types/indexer-lookup.d.ts.map +1 -0
- package/types/localnet.d.ts +54 -0
- package/types/localnet.d.ts.map +1 -0
- package/types/network-client.d.ts +96 -19
- package/types/network-client.d.ts.map +1 -1
- package/types/testing/account.d.ts +14 -0
- package/types/testing/account.d.ts.map +1 -0
- package/types/testing/fixtures/algokit-log-capture-fixture.d.ts +19 -0
- package/types/testing/fixtures/algokit-log-capture-fixture.d.ts.map +1 -0
- package/types/testing/fixtures/algorand-fixture.d.ts +48 -0
- package/types/testing/fixtures/algorand-fixture.d.ts.map +1 -0
- package/types/testing/fixtures/index.d.ts +3 -0
- package/types/testing/fixtures/index.d.ts.map +1 -0
- package/types/testing/index.d.ts +6 -0
- package/types/testing/index.d.ts.map +1 -0
- package/types/testing/indexer.d.ts +12 -0
- package/types/testing/indexer.d.ts.map +1 -0
- package/types/testing/test-logger.d.ts +41 -0
- package/types/testing/test-logger.d.ts.map +1 -0
- package/types/testing/transaction-logger.d.ts +29 -0
- package/types/testing/transaction-logger.d.ts.map +1 -0
- package/types/transaction.d.ts +133 -106
- package/types/transaction.d.ts.map +1 -1
- package/types/transfer.d.ts +21 -31
- package/types/transfer.d.ts.map +1 -1
- package/types/types/account.d.ts +66 -0
- package/types/types/account.d.ts.map +1 -0
- package/types/types/algo-http-client-with-retry.d.ts +14 -0
- package/types/types/algo-http-client-with-retry.d.ts.map +1 -0
- package/types/types/amount.d.ts +24 -0
- package/types/types/amount.d.ts.map +1 -0
- package/types/types/app-client.d.ts +408 -0
- package/types/types/app-client.d.ts.map +1 -0
- package/types/types/app-spec.d.ts +154 -0
- package/types/types/app-spec.d.ts.map +1 -0
- package/types/types/app.d.ts +308 -0
- package/types/types/app.d.ts.map +1 -0
- package/types/types/config.d.ts +32 -0
- package/types/types/config.d.ts.map +1 -0
- package/types/types/indexer.d.ts +623 -0
- package/types/types/indexer.d.ts.map +1 -0
- package/types/types/logging.d.ts +13 -0
- package/types/types/logging.d.ts.map +1 -0
- package/types/types/logic-error.d.ts +37 -0
- package/types/types/logic-error.d.ts.map +1 -0
- package/types/types/network-client.d.ts +20 -0
- package/types/types/network-client.d.ts.map +1 -0
- package/types/types/testing.d.ts +89 -0
- package/types/types/testing.d.ts.map +1 -0
- package/types/types/transaction.d.ts +111 -0
- package/types/types/transaction.d.ts.map +1 -0
- package/types/types/transfer.d.ts +32 -0
- package/types/types/transfer.d.ts.map +1 -0
- package/types/types/urlTokenBaseHTTPClient.d.ts +41 -0
- package/types/types/urlTokenBaseHTTPClient.d.ts.map +1 -0
- package/types/util.d.ts +10 -0
- package/types/util.d.ts.map +1 -0
- package/account.d.ts.map +0 -1
- package/account.js.map +0 -1
- package/amount.d.ts.map +0 -1
- package/amount.js.map +0 -1
- package/app-client.d.ts.map +0 -1
- package/app-client.js.map +0 -1
- package/app-deploy.d.ts.map +0 -1
- package/app-deploy.js.map +0 -1
- package/app.d.ts.map +0 -1
- package/app.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/indexer-lookup.d.ts.map +0 -1
- package/indexer-lookup.js.map +0 -1
- package/localnet.d.ts.map +0 -1
- package/localnet.js.map +0 -1
- package/network-client.d.ts.map +0 -1
- package/network-client.js.map +0 -1
- package/testing/account.d.ts.map +0 -1
- package/testing/account.js.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.d.ts.map +0 -1
- package/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
- package/testing/fixtures/algorand-fixture.d.ts.map +0 -1
- package/testing/fixtures/algorand-fixture.js.map +0 -1
- package/testing/fixtures/index.d.ts.map +0 -1
- package/testing/fixtures/index.js.map +0 -1
- package/testing/index.d.ts.map +0 -1
- package/testing/index.js.map +0 -1
- package/testing/indexer.d.ts.map +0 -1
- package/testing/indexer.js.map +0 -1
- package/testing/test-logger.d.ts.map +0 -1
- package/testing/test-logger.js.map +0 -1
- package/testing/transaction-logger.d.ts.map +0 -1
- package/testing/transaction-logger.js.map +0 -1
- package/transaction.d.ts.map +0 -1
- package/transaction.js.map +0 -1
- package/transfer.d.ts.map +0 -1
- package/transfer.js.map +0 -1
- package/types/account.js.map +0 -1
- package/types/algo-http-client-with-retry.d.ts.map +0 -1
- package/types/algo-http-client-with-retry.js.map +0 -1
- package/types/amount.js.map +0 -1
- package/types/app-client.js.map +0 -1
- package/types/app-spec.d.ts.map +0 -1
- package/types/app.js.map +0 -1
- package/types/config.d.ts.map +0 -1
- package/types/config.js.map +0 -1
- package/types/indexer.d.ts.map +0 -1
- package/types/indexer.js.map +0 -1
- package/types/logging.d.ts.map +0 -1
- package/types/logging.js.map +0 -1
- package/types/logic-error.d.ts.map +0 -1
- package/types/logic-error.js.map +0 -1
- package/types/network-client.js.map +0 -1
- package/types/testing.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.d.ts.map +0 -1
- package/types/urlTokenBaseHTTPClient.js.map +0 -1
- package/util.d.ts.map +0 -1
- package/util.js.map +0 -1
- /package/{account.d.ts → cjs/account.d.ts} +0 -0
- /package/{account.js → cjs/account.js} +0 -0
- /package/{amount.d.ts → cjs/amount.d.ts} +0 -0
- /package/{amount.js → cjs/amount.js} +0 -0
- /package/{app-client.d.ts → cjs/app-client.d.ts} +0 -0
- /package/{app-client.js → cjs/app-client.js} +0 -0
- /package/{app-deploy.d.ts → cjs/app-deploy.d.ts} +0 -0
- /package/{app-deploy.js → cjs/app-deploy.js} +0 -0
- /package/{app.d.ts → cjs/app.d.ts} +0 -0
- /package/{app.js → cjs/app.js} +0 -0
- /package/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/{index.js → cjs/index.js} +0 -0
- /package/{indexer-lookup.d.ts → cjs/indexer-lookup.d.ts} +0 -0
- /package/{indexer-lookup.js → cjs/indexer-lookup.js} +0 -0
- /package/{localnet.d.ts → cjs/localnet.d.ts} +0 -0
- /package/{network-client.d.ts → cjs/network-client.d.ts} +0 -0
- /package/{network-client.js → cjs/network-client.js} +0 -0
- /package/{testing → cjs/testing}/account.d.ts +0 -0
- /package/{testing → cjs/testing}/account.js +0 -0
- /package/{testing → cjs/testing}/fixtures/algokit-log-capture-fixture.d.ts +0 -0
- /package/{testing → cjs/testing}/fixtures/algokit-log-capture-fixture.js +0 -0
- /package/{testing → cjs/testing}/fixtures/algorand-fixture.d.ts +0 -0
- /package/{testing → cjs/testing}/fixtures/algorand-fixture.js +0 -0
- /package/{testing → cjs/testing}/fixtures/index.d.ts +0 -0
- /package/{testing → cjs/testing}/fixtures/index.js +0 -0
- /package/{testing → cjs/testing}/index.d.ts +0 -0
- /package/{testing → cjs/testing}/index.js +0 -0
- /package/{testing → cjs/testing}/indexer.d.ts +0 -0
- /package/{testing → cjs/testing}/indexer.js +0 -0
- /package/{testing → cjs/testing}/test-logger.d.ts +0 -0
- /package/{testing → cjs/testing}/transaction-logger.d.ts +0 -0
- /package/{transaction.d.ts → cjs/transaction.d.ts} +0 -0
- /package/{transaction.js → cjs/transaction.js} +0 -0
- /package/{transfer.d.ts → cjs/transfer.d.ts} +0 -0
- /package/{transfer.js → cjs/transfer.js} +0 -0
- /package/{types → cjs/types}/algo-http-client-with-retry.d.ts +0 -0
- /package/{types → cjs/types}/app-spec.d.ts +0 -0
- /package/{types → cjs/types}/app-spec.js +0 -0
- /package/{types → cjs/types}/app.js +0 -0
- /package/{types → cjs/types}/config.d.ts +0 -0
- /package/{types → cjs/types}/indexer.d.ts +0 -0
- /package/{types → cjs/types}/indexer.js +0 -0
- /package/{types → cjs/types}/logging.d.ts +0 -0
- /package/{types → cjs/types}/logging.js +0 -0
- /package/{types → cjs/types}/logic-error.d.ts +0 -0
- /package/{types → cjs/types}/network-client.js +0 -0
- /package/{types → cjs/types}/testing.d.ts +0 -0
- /package/{types → cjs/types}/testing.js +0 -0
- /package/{types → cjs/types}/transaction.js +0 -0
- /package/{types → cjs/types}/transfer.js +0 -0
- /package/{types → cjs/types}/urlTokenBaseHTTPClient.d.ts +0 -0
- /package/{util.d.ts → cjs/util.d.ts} +0 -0
- /package/{util.js → cjs/util.js} +0 -0
package/types/app.d.ts
CHANGED
|
@@ -1,308 +1,163 @@
|
|
|
1
|
-
import algosdk, {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare const UPDATABLE_TEMPLATE_NAME = "TMPL_UPDATABLE";
|
|
5
|
-
/** The name of the TEAL template variable for deploy-time permanence control */
|
|
6
|
-
export declare const DELETABLE_TEMPLATE_NAME = "TMPL_DELETABLE";
|
|
7
|
-
/** The app create/update ARC-2 transaction note prefix */
|
|
8
|
-
export declare const APP_DEPLOY_NOTE_DAPP = "ALGOKIT_DEPLOYER";
|
|
9
|
-
/** The maximum number of bytes in a single app code page */
|
|
10
|
-
export declare const APP_PAGE_MAX_SIZE = 2048;
|
|
11
|
-
/** First 4 bytes of SHA-512/256 hash of "return" for retrieving ABI return values */
|
|
12
|
-
export declare const ABI_RETURN_PREFIX: Uint8Array;
|
|
13
|
-
/** Information about an Algorand app */
|
|
14
|
-
export interface AppReference {
|
|
15
|
-
/** The id of the app */
|
|
16
|
-
appId: number | bigint;
|
|
17
|
-
/** The Algorand address of the account associated with the app */
|
|
18
|
-
appAddress: string;
|
|
19
|
-
}
|
|
1
|
+
import algosdk, { ABIMethod, ABIMethodParams, ABIValue, Algodv2, modelsv2, OnApplicationComplete } from 'algosdk';
|
|
2
|
+
import { ABIAppCallArgs, ABIReturn, AppCallArgs, AppCallParams, AppCallTransactionResult, AppCallType, AppCompilationResult, AppReference, AppState, BoxIdentifier, BoxName, BoxReference, BoxValueRequestParams, BoxValuesRequestParams, CompiledTeal, CreateAppParams, RawAppCallArgs, UpdateAppParams } from './types/app';
|
|
3
|
+
import { SendTransactionFrom } from './types/transaction';
|
|
20
4
|
/**
|
|
21
|
-
*
|
|
5
|
+
* Creates a smart contract app, returns the details of the created app.
|
|
6
|
+
* @param create The parameters to create the app with
|
|
7
|
+
* @param algod An algod client
|
|
8
|
+
* @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result
|
|
22
9
|
*/
|
|
23
|
-
export
|
|
24
|
-
/**
|
|
25
|
-
* A unique application id
|
|
26
|
-
*/
|
|
27
|
-
appId: number | bigint;
|
|
28
|
-
/**
|
|
29
|
-
* Name of box to reference
|
|
30
|
-
*/
|
|
31
|
-
name: BoxIdentifier;
|
|
32
|
-
}
|
|
10
|
+
export declare function createApp(create: CreateAppParams, algod: Algodv2): Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference>;
|
|
33
11
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
12
|
+
* Updates a smart contract app.
|
|
13
|
+
* @param update The parameters to update the app with
|
|
14
|
+
* @param algod An algod client
|
|
15
|
+
* @returns The transaction send result and the compilation result
|
|
38
16
|
*/
|
|
39
|
-
export
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/** IDs of any assets to load into the foreignAssets array */
|
|
51
|
-
assets?: number[];
|
|
52
|
-
}
|
|
17
|
+
export declare function updateApp(update: UpdateAppParams, algod: Algodv2): Promise<Partial<AppCompilationResult> & AppCallTransactionResult>;
|
|
18
|
+
/** Returns an `algosdk.OnApplicationComplete` for the given onCompleteAction.
|
|
19
|
+
*
|
|
20
|
+
* If given `undefined` will return `OnApplicationComplete.NoOpOC`.
|
|
21
|
+
*
|
|
22
|
+
* If given an `AppCallType` will convert the string enum to the correct underlying `algosdk.OnApplicationComplete`.
|
|
23
|
+
*
|
|
24
|
+
* @param onCompletionAction The on completion action
|
|
25
|
+
* @returns The `algosdk.OnApplicationComplete`
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAppOnCompleteAction(onCompletionAction?: AppCallType | OnApplicationComplete): algosdk.OnApplicationComplete;
|
|
53
28
|
/**
|
|
54
|
-
*
|
|
29
|
+
* Issues a call to a given app.
|
|
30
|
+
* @param call The call details.
|
|
31
|
+
* @param algod An algod client
|
|
32
|
+
* @returns The result of the call
|
|
55
33
|
*/
|
|
56
|
-
export
|
|
57
|
-
/** Any application arguments to pass through */
|
|
58
|
-
appArgs?: (Uint8Array | string)[];
|
|
59
|
-
/** Property to aid intellisense */
|
|
60
|
-
method?: undefined;
|
|
61
|
-
}
|
|
62
|
-
/** An argument for an ABI method, either a primitive value, or a transaction with or without signer, or the unawaited async return value of an algokit method that returns a `SendTransactionResult` */
|
|
63
|
-
export type ABIAppCallArg = ABIArgument | TransactionToSign | Transaction | Promise<SendTransactionResult> | SendTransactionResult | undefined;
|
|
34
|
+
export declare function callApp(call: AppCallParams, algod: Algodv2): Promise<AppCallTransactionResult>;
|
|
64
35
|
/**
|
|
65
|
-
*
|
|
36
|
+
* Returns any ABI return values for the given app call arguments and transaction confirmation.
|
|
37
|
+
* @param args The arguments that were used for the call
|
|
38
|
+
* @param confirmation The transaction confirmation from algod
|
|
39
|
+
* @returns The return value for the method call
|
|
66
40
|
*/
|
|
67
|
-
export
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/** Arguments to pass to an app call either:
|
|
74
|
-
* * The raw app call values to pass through into the transaction (after processing); or
|
|
75
|
-
* * An ABI method definition (method and args)
|
|
76
|
-
**/
|
|
77
|
-
export type AppCallArgs = RawAppCallArgs | ABIAppCallArgs;
|
|
78
|
-
/** Base interface for common data passed to an app create or update. */
|
|
79
|
-
interface CreateOrUpdateAppParams extends SendTransactionParams {
|
|
80
|
-
/** The account (with private key loaded) that will send the transaction */
|
|
81
|
-
from: SendTransactionFrom;
|
|
82
|
-
/** The approval program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
|
|
83
|
-
approvalProgram: Uint8Array | string;
|
|
84
|
-
/** The clear state program as raw teal (string) or compiled teal, base 64 encoded as a byte array (Uint8Array) */
|
|
85
|
-
clearStateProgram: Uint8Array | string;
|
|
86
|
-
/** Optional transaction parameters */
|
|
87
|
-
transactionParams?: SuggestedParams;
|
|
88
|
-
/** The (optional) transaction note */
|
|
89
|
-
note?: TransactionNote;
|
|
90
|
-
/** The arguments passed in to the app call */
|
|
91
|
-
args?: AppCallArgs;
|
|
92
|
-
}
|
|
93
|
-
/** Parameters that are passed in when creating an app. */
|
|
94
|
-
export interface CreateAppParams extends CreateOrUpdateAppParams {
|
|
95
|
-
/** The storage schema to request for the created app */
|
|
96
|
-
schema: AppStorageSchema;
|
|
97
|
-
/** Override the on-completion action for the create call; defaults to NoOp */
|
|
98
|
-
onCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
|
|
99
|
-
}
|
|
100
|
-
/** Parameters that are passed in when updating an app. */
|
|
101
|
-
export interface UpdateAppParams extends CreateOrUpdateAppParams {
|
|
102
|
-
/** The id of the app to update */
|
|
103
|
-
appId: number | bigint;
|
|
104
|
-
}
|
|
105
|
-
/** The type of call / [on-completion action](https://developer.algorand.org/docs/get-details/dapps/smart-contracts/apps/#the-lifecycle-of-a-smart-contract) for a smart contract call.
|
|
106
|
-
*
|
|
107
|
-
* Equivalent of `algosdk.OnApplicationComplete`, but as a more convenient string enum.
|
|
108
|
-
*
|
|
109
|
-
* * `no_op`: Normal smart contract call, no special on-complete action
|
|
110
|
-
* * `opt_in`: Opt-in to smart contract local storage
|
|
111
|
-
* * `close_out`: Close-out local storage storage
|
|
112
|
-
* * `clear_state`: Clear local storage state
|
|
113
|
-
* * `update_application`: Update the smart contract
|
|
114
|
-
* * `delete_application`: Delete the smart contract
|
|
41
|
+
export declare function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.PendingTransactionResponse): ABIReturn | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the current global state values for the given app ID
|
|
44
|
+
* @param appId The ID of the app return global state for
|
|
45
|
+
* @param algod An algod client instance
|
|
46
|
+
* @returns The current global state
|
|
115
47
|
*/
|
|
116
|
-
export
|
|
117
|
-
/** Parameters representing a call to an app. */
|
|
118
|
-
export interface AppCallParams extends SendTransactionParams {
|
|
119
|
-
/** The id of the app to call */
|
|
120
|
-
appId: number | bigint;
|
|
121
|
-
/** The type of call, everything except create (see `createApp`) and update (see `updateApp`) */
|
|
122
|
-
callType: Exclude<AppCallType, 'update_application'> | Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplicationOC>;
|
|
123
|
-
/** The account to make the call from */
|
|
124
|
-
from: SendTransactionFrom;
|
|
125
|
-
/** Optional transaction parameters */
|
|
126
|
-
transactionParams?: SuggestedParams;
|
|
127
|
-
/** The (optional) transaction note */
|
|
128
|
-
note?: TransactionNote;
|
|
129
|
-
/** The arguments passed in to the app call */
|
|
130
|
-
args?: AppCallArgs;
|
|
131
|
-
}
|
|
132
|
-
/** Parameters representing the storage schema of an app. */
|
|
133
|
-
export interface AppStorageSchema {
|
|
134
|
-
/** Restricts number of ints in per-user local state */
|
|
135
|
-
localInts: number;
|
|
136
|
-
/** Restricts number of byte slices in per-user local state */
|
|
137
|
-
localByteSlices: number;
|
|
138
|
-
/** Restricts number of ints in global state */
|
|
139
|
-
globalInts: number;
|
|
140
|
-
/** Restricts number of byte slices in global state */
|
|
141
|
-
globalByteSlices: number;
|
|
142
|
-
/** Any extra pages that are needed for the smart contract; if left blank then the right number of pages will be calculated based on the teal code size */
|
|
143
|
-
extraPages?: number;
|
|
144
|
-
}
|
|
145
|
-
/** Information about a compiled teal program */
|
|
146
|
-
export interface CompiledTeal {
|
|
147
|
-
/** Original TEAL code */
|
|
148
|
-
teal: string;
|
|
149
|
-
/** The compiled code */
|
|
150
|
-
compiled: string;
|
|
151
|
-
/** The has returned by the compiler */
|
|
152
|
-
compiledHash: string;
|
|
153
|
-
/** The base64 encoded code as a byte array */
|
|
154
|
-
compiledBase64ToBytes: Uint8Array;
|
|
155
|
-
/** Source map from the compilation */
|
|
156
|
-
sourceMap: SourceMap;
|
|
157
|
-
}
|
|
158
|
-
export interface AppCallTransactionResultOfType<T> extends SendTransactionResults, SendTransactionResult {
|
|
159
|
-
/** If an ABI method was called the processed return value */
|
|
160
|
-
return?: T;
|
|
161
|
-
}
|
|
162
|
-
/** Result from calling an app */
|
|
163
|
-
export interface AppCallTransactionResult extends AppCallTransactionResultOfType<ABIReturn> {
|
|
164
|
-
}
|
|
165
|
-
/** The return value of an ABI method call */
|
|
166
|
-
export type ABIReturn = {
|
|
167
|
-
rawReturnValue: Uint8Array;
|
|
168
|
-
returnValue: ABIValue;
|
|
169
|
-
decodeError: undefined;
|
|
170
|
-
} | {
|
|
171
|
-
rawReturnValue: undefined;
|
|
172
|
-
returnValue: undefined;
|
|
173
|
-
decodeError: Error;
|
|
174
|
-
};
|
|
48
|
+
export declare function getAppGlobalState(appId: number | bigint, algod: Algodv2): Promise<AppState>;
|
|
175
49
|
/**
|
|
176
|
-
*
|
|
50
|
+
* Returns the current global state values for the given app ID and account
|
|
51
|
+
* @param appId The ID of the app return global state for
|
|
52
|
+
* @param account Either the string address of an account or an account object for the account to get local state for the given app
|
|
53
|
+
* @param algod An algod client instance
|
|
54
|
+
* @returns The current local state for the given (app, account) combination
|
|
177
55
|
*/
|
|
178
|
-
export
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
56
|
+
export declare function getAppLocalState(appId: number | bigint, account: string | SendTransactionFrom, algod: Algodv2): Promise<AppState>;
|
|
57
|
+
/**
|
|
58
|
+
* Returns the names of the boxes for the given app.
|
|
59
|
+
* @param appId The ID of the app return box names for
|
|
60
|
+
* @param algod An algod client instance
|
|
61
|
+
* @returns The current box names
|
|
62
|
+
*/
|
|
63
|
+
export declare function getAppBoxNames(appId: number | bigint, algod: Algodv2): Promise<BoxName[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns the value of the given box name for the given app.
|
|
66
|
+
* @param appId The ID of the app return box names for
|
|
67
|
+
* @param boxName The name of the box to return either as a string, binary array or `BoxName`
|
|
68
|
+
* @param algod An algod client instance
|
|
69
|
+
* @returns The current box value as a byte array
|
|
70
|
+
*/
|
|
71
|
+
export declare function getAppBoxValue(appId: number | bigint, boxName: string | Uint8Array | BoxName, algod: Algodv2): Promise<Uint8Array>;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the value of the given box names for the given app.
|
|
74
|
+
* @param appId The ID of the app return box names for
|
|
75
|
+
* @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`
|
|
76
|
+
* @param algod An algod client instance
|
|
77
|
+
* @returns The current box values as a byte array in the same order as the passed in box names
|
|
78
|
+
*/
|
|
79
|
+
export declare function getAppBoxValues(appId: number, boxNames: (string | Uint8Array | BoxName)[], algod: Algodv2): Promise<Uint8Array[]>;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the value of the given box name for the given app decoded based on the given ABI type.
|
|
82
|
+
* @param request The parameters for the box value request
|
|
83
|
+
* @param algod An algod client instance
|
|
84
|
+
* @returns The current box value as an ABI value
|
|
85
|
+
*/
|
|
86
|
+
export declare function getAppBoxValueFromABIType(request: BoxValueRequestParams, algod: Algodv2): Promise<ABIValue>;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the value of the given box names for the given app decoded based on the given ABI type.
|
|
89
|
+
* @param request The parameters for the box value request
|
|
90
|
+
* @param algod An algod client instance
|
|
91
|
+
* @returns The current box values as an ABI value in the same order as the passed in box names
|
|
92
|
+
*/
|
|
93
|
+
export declare function getAppBoxValuesFromABIType(request: BoxValuesRequestParams, algod: Algodv2): Promise<ABIValue[]>;
|
|
94
|
+
/**
|
|
95
|
+
* Converts an array of global/local state values from the algod api to a more friendly
|
|
96
|
+
* generic object keyed by the UTF-8 value of the key.
|
|
97
|
+
* @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`
|
|
98
|
+
* @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values
|
|
99
|
+
*/
|
|
100
|
+
export declare function decodeAppState(state: {
|
|
101
|
+
key: string;
|
|
102
|
+
value: modelsv2.TealValue | modelsv2.EvalDelta;
|
|
103
|
+
}[]): AppState;
|
|
104
|
+
/**
|
|
105
|
+
* Returns the app args ready to load onto an app `Transaction` object
|
|
106
|
+
* @param args The app call args
|
|
107
|
+
* @returns The args ready to load into a `Transaction`
|
|
108
|
+
*/
|
|
109
|
+
export declare function getAppArgsForTransaction(args?: RawAppCallArgs): {
|
|
110
|
+
accounts: string[] | undefined;
|
|
111
|
+
appArgs: Uint8Array[] | undefined;
|
|
112
|
+
boxes: algosdk.BoxReference[] | undefined;
|
|
113
|
+
foreignApps: number[] | undefined;
|
|
114
|
+
foreignAssets: number[] | undefined;
|
|
115
|
+
lease: Uint8Array | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Returns the app args ready to load onto an ABI method call in `AtomicTransactionComposer`
|
|
119
|
+
* @param args The ABI app call args
|
|
120
|
+
* @param from The transaction signer
|
|
121
|
+
* @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer
|
|
122
|
+
*/
|
|
123
|
+
export declare function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom): Promise<{
|
|
124
|
+
method: algosdk.ABIMethod;
|
|
125
|
+
sender: string;
|
|
126
|
+
signer: algosdk.TransactionSigner;
|
|
127
|
+
boxes: algosdk.BoxReference[] | undefined;
|
|
128
|
+
lease: Uint8Array | undefined;
|
|
129
|
+
appForeignApps: number[] | undefined;
|
|
130
|
+
appForeignAssets: number[] | undefined;
|
|
131
|
+
appAccounts: string[] | undefined;
|
|
132
|
+
methodArgs: (string | number | bigint | boolean | Uint8Array | algosdk.ABIValue[] | algosdk.TransactionWithSigner)[];
|
|
133
|
+
rekeyTo: undefined;
|
|
134
|
+
}>;
|
|
135
|
+
/**
|
|
136
|
+
* Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.
|
|
137
|
+
* @param box The box to return a reference for
|
|
138
|
+
* @returns The box reference ready to pass into a `Transaction`
|
|
139
|
+
*/
|
|
140
|
+
export declare function getBoxReference(box: BoxIdentifier | BoxReference | algosdk.BoxReference): algosdk.BoxReference;
|
|
141
|
+
/**
|
|
142
|
+
* Gets the current data for the given app from algod.
|
|
209
143
|
*
|
|
144
|
+
* @param appId The id of the app
|
|
145
|
+
* @param algod An algod client
|
|
146
|
+
* @returns The data about the app
|
|
210
147
|
*/
|
|
211
|
-
export
|
|
212
|
-
[key: string]: string | bigint | number | Uint8Array;
|
|
213
|
-
}
|
|
214
|
-
/** What action to perform when deploying an app and an update is detected in the TEAL code */
|
|
215
|
-
export declare enum OnUpdate {
|
|
216
|
-
/** Fail the deployment */
|
|
217
|
-
Fail = 0,
|
|
218
|
-
/** Update the app */
|
|
219
|
-
UpdateApp = 1,
|
|
220
|
-
/** Delete the app and create a new one in its place */
|
|
221
|
-
ReplaceApp = 2,
|
|
222
|
-
/** Create a new app */
|
|
223
|
-
AppendApp = 3
|
|
224
|
-
}
|
|
225
|
-
/** What action to perform when deploying an app and a breaking schema change is detected */
|
|
226
|
-
export declare enum OnSchemaBreak {
|
|
227
|
-
/** Fail the deployment */
|
|
228
|
-
Fail = 0,
|
|
229
|
-
/** Delete the app and create a new one in its place */
|
|
230
|
-
ReplaceApp = 1,
|
|
231
|
-
/** Create a new app */
|
|
232
|
-
AppendApp = 2
|
|
233
|
-
}
|
|
234
|
-
/** The parameters to deploy an app */
|
|
235
|
-
export interface AppDeploymentParams extends Omit<CreateAppParams, 'onCompleteAction' | 'args' | 'note' | 'skipSending' | 'skipWaiting' | 'atc'> {
|
|
236
|
-
/** The deployment metadata */
|
|
237
|
-
metadata: AppDeployMetadata;
|
|
238
|
-
/** Any deploy-time parameters to replace in the TEAL code */
|
|
239
|
-
deployTimeParams?: TealTemplateParams;
|
|
240
|
-
/** What action to perform if a schema break is detected */
|
|
241
|
-
onSchemaBreak?: 'replace' | 'fail' | 'append' | OnSchemaBreak;
|
|
242
|
-
/** What action to perform if a TEAL update is detected */
|
|
243
|
-
onUpdate?: 'update' | 'replace' | 'fail' | 'append' | OnUpdate;
|
|
244
|
-
/** Optional cached value of the existing apps for the given creator */
|
|
245
|
-
existingDeployments?: AppLookup;
|
|
246
|
-
/** Any args to pass to any create transaction that is issued as part of deployment */
|
|
247
|
-
createArgs?: AppCallArgs;
|
|
248
|
-
/** Override the on-completion action for the create call; defaults to NoOp */
|
|
249
|
-
createOnCompleteAction?: Exclude<AppCallType, 'clear_state'> | Exclude<OnApplicationComplete, OnApplicationComplete.ClearStateOC>;
|
|
250
|
-
/** Any args to pass to any update transaction that is issued as part of deployment */
|
|
251
|
-
updateArgs?: AppCallArgs;
|
|
252
|
-
/** Any args to pass to any delete transaction that is issued as part of deployment */
|
|
253
|
-
deleteArgs?: AppCallArgs;
|
|
254
|
-
}
|
|
255
|
-
/** The result of compiling the approval and clear TEAL for an app */
|
|
256
|
-
export interface AppCompilationResult {
|
|
257
|
-
/** The compilation result of approval */
|
|
258
|
-
compiledApproval: CompiledTeal;
|
|
259
|
-
/** The compilation result of clear */
|
|
260
|
-
compiledClear: CompiledTeal;
|
|
261
|
-
}
|
|
262
|
-
/** Object holding app state values */
|
|
263
|
-
export interface AppState {
|
|
264
|
-
[key: string]: {
|
|
265
|
-
value: number | bigint;
|
|
266
|
-
keyRaw: Uint8Array;
|
|
267
|
-
keyBase64: string;
|
|
268
|
-
} | {
|
|
269
|
-
value: string;
|
|
270
|
-
valueRaw: Uint8Array;
|
|
271
|
-
valueBase64: string;
|
|
272
|
-
keyRaw: Uint8Array;
|
|
273
|
-
keyBase64: string;
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
/** The name of a box storage box */
|
|
277
|
-
export interface BoxName {
|
|
278
|
-
/** Name in UTF-8 */
|
|
279
|
-
name: string;
|
|
280
|
-
/** Name in binary bytes */
|
|
281
|
-
nameRaw: Uint8Array;
|
|
282
|
-
/** Name in Base64 */
|
|
283
|
-
nameBase64: string;
|
|
284
|
-
}
|
|
148
|
+
export declare function getAppById(appId: number | bigint, algod: Algodv2): Promise<algosdk.modelsv2.Application>;
|
|
285
149
|
/**
|
|
286
|
-
*
|
|
150
|
+
* Compiles the given TEAL using algod and returns the result, including source map.
|
|
151
|
+
*
|
|
152
|
+
* @param algod An algod client
|
|
153
|
+
* @param tealCode The TEAL code
|
|
154
|
+
* @returns The information about the compiled file
|
|
287
155
|
*/
|
|
288
|
-
export
|
|
289
|
-
/** The ID of the app return box names for */
|
|
290
|
-
appId: number | bigint;
|
|
291
|
-
/** The name of the box to return either as a string, binary array or `BoxName` */
|
|
292
|
-
boxName: string | Uint8Array | BoxName;
|
|
293
|
-
/** The ABI type to decode the value using */
|
|
294
|
-
type: ABIType;
|
|
295
|
-
}
|
|
156
|
+
export declare function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal>;
|
|
296
157
|
/**
|
|
297
|
-
*
|
|
158
|
+
* Returns the encoded ABI spec for a given ABI Method
|
|
159
|
+
* @param method The method to return a signature for
|
|
160
|
+
* @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`
|
|
298
161
|
*/
|
|
299
|
-
export
|
|
300
|
-
/** The ID of the app return box names for */
|
|
301
|
-
appId: number;
|
|
302
|
-
/** The names of the boxes to return either as a string, binary array or BoxName` */
|
|
303
|
-
boxNames: (string | Uint8Array | BoxName)[];
|
|
304
|
-
/** The ABI type to decode the value using */
|
|
305
|
-
type: ABIType;
|
|
306
|
-
}
|
|
307
|
-
export {};
|
|
162
|
+
export declare const getABIMethodSignature: (method: ABIMethodParams | ABIMethod) => string;
|
|
308
163
|
//# sourceMappingURL=app.d.ts.map
|
package/types/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":"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"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UpdatableConfig } from './types/config';
|
|
2
|
+
export * from './account';
|
|
3
|
+
export * from './amount';
|
|
4
|
+
export * from './app';
|
|
5
|
+
export * from './app-client';
|
|
6
|
+
export * from './app-deploy';
|
|
7
|
+
export * from './indexer-lookup';
|
|
8
|
+
export * from './localnet';
|
|
9
|
+
export * from './network-client';
|
|
10
|
+
export * from './transaction';
|
|
11
|
+
export * from './transfer';
|
|
12
|
+
/** The AlgoKit config. To update it use the configure method. */
|
|
13
|
+
export declare const Config: UpdatableConfig;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAE1B,iEAAiE;AACjE,eAAO,MAAM,MAAM,iBAAwB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Indexer } from 'algosdk';
|
|
2
|
+
import type SearchForTransactions from 'algosdk/dist/types/client/v2/indexer/searchForTransactions';
|
|
3
|
+
import { AccountLookupResult, ApplicationResult, TransactionLookupResult, TransactionSearchResults } from './types/indexer';
|
|
4
|
+
/**
|
|
5
|
+
* Looks up a transaction by ID using Indexer.
|
|
6
|
+
* @param transactionId The ID of the transaction to look up
|
|
7
|
+
* @param indexer An indexer client
|
|
8
|
+
* @returns The result of the look-up
|
|
9
|
+
*/
|
|
10
|
+
export declare function lookupTransactionById(transactionId: string, indexer: Indexer): Promise<TransactionLookupResult>;
|
|
11
|
+
/**
|
|
12
|
+
* Looks up an account by address using Indexer.
|
|
13
|
+
* @param transactionId The address of the account to look up
|
|
14
|
+
* @param indexer An indexer client
|
|
15
|
+
* @returns The result of the look-up
|
|
16
|
+
*/
|
|
17
|
+
export declare function lookupAccountByAddress(accountAddress: string, indexer: Indexer): Promise<AccountLookupResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Looks up applications that were created by the given address.
|
|
20
|
+
* @param indexer An indexer instance
|
|
21
|
+
* @param address The address of the creator to look up
|
|
22
|
+
* @param getAll Whether or not to include deleted applications
|
|
23
|
+
* @param paginationLimit The number of records to return per paginated request, default 1000
|
|
24
|
+
* @returns The list of application results
|
|
25
|
+
*/
|
|
26
|
+
export declare function lookupAccountCreatedApplicationByAddress(indexer: Indexer, address: string, getAll?: boolean | undefined, paginationLimit?: number): Promise<ApplicationResult[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Allows transactions to be searched for the given criteria.
|
|
29
|
+
* @param indexer An indexer client
|
|
30
|
+
* @param searchCriteria The criteria to search for
|
|
31
|
+
* @param paginationLimit The number of records to return per paginated request, default 1000
|
|
32
|
+
* @returns The search results
|
|
33
|
+
*/
|
|
34
|
+
export declare function searchTransactions(indexer: Indexer, searchCriteria: (s: SearchForTransactions) => SearchForTransactions, paginationLimit?: number): Promise<TransactionSearchResults>;
|
|
35
|
+
export declare function executePaginatedRequest<TResult, TRequest extends {
|
|
36
|
+
do: () => Promise<any>;
|
|
37
|
+
}>(extractItems: (response: any) => TResult[], buildRequest: (nextToken?: string) => TRequest): Promise<TResult[]>;
|
|
38
|
+
//# sourceMappingURL=indexer-lookup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indexer-lookup.d.ts","sourceRoot":"","sources":["../../src/indexer-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,KAAK,qBAAqB,MAAM,4DAA4D,CAAA;AACnG,OAAO,EACL,mBAAmB,EAEnB,iBAAiB,EACjB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,iBAAiB,CAAA;AAIxB;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAErH;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEnH;AAED;;;;;;;GAOG;AACH,wBAAsB,wCAAwC,CAC5D,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,OAAO,GAAG,SAAqB,EACvC,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAmB9B;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,CAAC,CAAC,EAAE,qBAAqB,KAAK,qBAAqB,EACnE,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,wBAAwB,CAAC,CA0BnC;AAID,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,QAAQ,SAAS;IAAE,EAAE,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAA;CAAE,EAEhG,YAAY,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,OAAO,EAAE,EAC1C,YAAY,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,QAAQ,GAC7C,OAAO,CAAC,OAAO,EAAE,CAAC,CAoBpB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Account, Algodv2, Kmd } from 'algosdk';
|
|
2
|
+
import { AlgoAmount } from './types/amount';
|
|
3
|
+
/** Returns true if the algod client is pointing to a LocalNet Algorand network */
|
|
4
|
+
export declare function isLocalNet(algod: Algodv2): Promise<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.
|
|
7
|
+
*
|
|
8
|
+
* This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).
|
|
9
|
+
*
|
|
10
|
+
* This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.
|
|
11
|
+
*
|
|
12
|
+
* If this is used via `getAccount`, then you can even use the same code that runs on production without changes for local development!
|
|
13
|
+
*
|
|
14
|
+
* @param walletAccount The wallet details with:
|
|
15
|
+
* * `name`: The name of the wallet to retrieve / create
|
|
16
|
+
* * `fundWith`: The number of Algos to fund the account with when it gets created, if not specified then 1000 Algos will be funded from the dispenser account
|
|
17
|
+
* @param algod An algod client
|
|
18
|
+
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
19
|
+
*
|
|
20
|
+
* @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you
|
|
21
|
+
*/
|
|
22
|
+
export declare function getOrCreateKmdWalletAccount(walletAccount: {
|
|
23
|
+
name: string;
|
|
24
|
+
fundWith?: AlgoAmount;
|
|
25
|
+
}, algod: Algodv2, kmdClient?: Kmd): Promise<Account>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).
|
|
28
|
+
*
|
|
29
|
+
* @param walletAccount The details of the wallet, with:
|
|
30
|
+
* * `name`: The name of the wallet to retrieve an account from
|
|
31
|
+
* * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)
|
|
32
|
+
* @param algod An algod client
|
|
33
|
+
* @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
34
|
+
* @example Get default funded account in a LocalNet
|
|
35
|
+
*
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const defaultDispenserAccount = await getKmdWalletAccount(algod,
|
|
38
|
+
* 'unencrypted-default-wallet',
|
|
39
|
+
* a => a.status !== 'Offline' && a.amount > 1_000_000_000
|
|
40
|
+
* )
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare function getKmdWalletAccount(walletAccount: {
|
|
44
|
+
name: string;
|
|
45
|
+
predicate?: (account: Record<string, any>) => boolean;
|
|
46
|
+
}, algod: Algodv2, kmdClient?: Kmd): Promise<Account | undefined>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)
|
|
49
|
+
*
|
|
50
|
+
* @param algod An algod client
|
|
51
|
+
* @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
|
|
52
|
+
*/
|
|
53
|
+
export declare function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account>;
|
|
54
|
+
//# sourceMappingURL=localnet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localnet.d.ts","sourceRoot":"","sources":["../../src/localnet.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAKxD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAE3C,kFAAkF;AAClF,wBAAsB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAIjE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,2BAA2B,CAC/C,aAAa,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,UAAU,CAAA;CAAE,EACtD,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,GAAG,GACd,OAAO,CAAC,OAAO,CAAC,CAmClB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,mBAAmB,CACvC,aAAa,EAAE;IACb,IAAI,EAAE,MAAM,CAAA;IAEZ,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAA;CACtD,EACD,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,GAAG,GACd,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAmC9B;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,CAW7F"}
|