@algorandfoundation/algokit-utils 7.0.0-beta.1 → 7.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -25
- package/account/account.d.ts +8 -9
- package/account/account.js +7 -7
- package/account/account.js.map +1 -1
- package/account/account.mjs +7 -7
- 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 +2 -3
- package/account/get-account.js +1 -1
- package/account/get-account.js.map +1 -1
- package/account/get-account.mjs +1 -1
- package/account/get-account.mjs.map +1 -1
- package/account/get-dispenser-account.d.ts +1 -2
- package/account/get-dispenser-account.js +1 -1
- package/account/get-dispenser-account.js.map +1 -1
- package/account/get-dispenser-account.mjs +1 -1
- package/account/get-dispenser-account.mjs.map +1 -1
- package/account/index.d.ts +0 -1
- package/account/mnemonic-account.d.ts +1 -2
- package/account/mnemonic-account.js +1 -1
- package/account/mnemonic-account.js.map +1 -1
- package/account/mnemonic-account.mjs +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 +18 -2
- package/app-deploy.js +140 -333
- package/app-deploy.js.map +1 -1
- package/app-deploy.mjs +143 -336
- package/app-deploy.mjs.map +1 -1
- package/app.d.ts +39 -3
- package/app.js +116 -369
- package/app.js.map +1 -1
- package/app.mjs +117 -370
- package/app.mjs.map +1 -1
- package/asset.d.ts +5 -6
- package/asset.js +5 -8
- package/asset.js.map +1 -1
- package/asset.mjs +5 -8
- 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 +4 -4
- package/index.js +31 -26
- package/index.js.map +1 -1
- package/index.mjs +4 -4
- 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 +1 -2
- package/localnet/get-kmd-wallet-account.js +1 -1
- package/localnet/get-kmd-wallet-account.js.map +1 -1
- package/localnet/get-kmd-wallet-account.mjs +1 -1
- package/localnet/get-kmd-wallet-account.mjs.map +1 -1
- package/localnet/get-localnet-dispenser-account.d.ts +1 -2
- package/localnet/get-localnet-dispenser-account.js +1 -1
- package/localnet/get-localnet-dispenser-account.js.map +1 -1
- package/localnet/get-localnet-dispenser-account.mjs +1 -1
- package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.d.ts +1 -2
- package/localnet/get-or-create-kmd-wallet-account.js +1 -1
- package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
- package/localnet/get-or-create-kmd-wallet-account.mjs +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 +1 -2
- package/localnet/is-localnet.js +1 -1
- package/localnet/is-localnet.js.map +1 -1
- package/localnet/is-localnet.mjs +1 -1
- package/localnet/is-localnet.mjs.map +1 -1
- package/network-client.d.ts +2 -3
- package/network-client.js +2 -2
- package/network-client.js.map +1 -1
- package/network-client.mjs +2 -2
- package/network-client.mjs.map +1 -1
- package/package.json +1 -1
- 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 +12 -12
- package/testing/fixtures/algorand-fixture.js.map +1 -1
- package/testing/fixtures/algorand-fixture.mjs +12 -12
- 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 +31 -6
- package/transaction/legacy-bridge.js +100 -6
- package/transaction/legacy-bridge.js.map +1 -1
- package/transaction/legacy-bridge.mjs +99 -8
- 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.map +1 -1
- package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
- package/transaction/transaction.d.ts +41 -6
- package/transaction/transaction.js +108 -45
- package/transaction/transaction.js.map +1 -1
- package/transaction/transaction.mjs +108 -46
- 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 +14 -6
- package/types/account-manager.js +18 -4
- package/types/account-manager.js.map +1 -1
- package/types/account-manager.mjs +18 -4
- package/types/account-manager.mjs.map +1 -1
- package/types/account.d.ts +0 -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 +450 -21
- package/types/algorand-client-transaction-creator.js +406 -22
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs +406 -22
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +758 -33
- package/types/algorand-client-transaction-sender.js +444 -14
- package/types/algorand-client-transaction-sender.js.map +1 -1
- package/types/algorand-client-transaction-sender.mjs +444 -14
- package/types/algorand-client-transaction-sender.mjs.map +1 -1
- package/types/algorand-client.d.ts +18 -10
- package/types/algorand-client.js +23 -10
- package/types/algorand-client.js.map +1 -1
- package/types/algorand-client.mjs +23 -10
- 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 +348 -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 +1496 -9
- package/types/app-client.js +903 -21
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs +904 -23
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +126 -0
- package/types/app-deployer.js +354 -0
- package/types/app-deployer.js.map +1 -0
- package/types/app-deployer.mjs +352 -0
- package/types/app-deployer.mjs.map +1 -0
- package/types/app-factory.d.ts +846 -0
- package/types/app-factory.js +411 -0
- package/types/app-factory.js.map +1 -0
- package/types/app-factory.mjs +409 -0
- package/types/app-factory.mjs.map +1 -0
- package/types/app-manager.d.ts +244 -0
- package/types/app-manager.js +334 -0
- package/types/app-manager.js.map +1 -0
- package/types/app-manager.mjs +332 -0
- package/types/app-manager.mjs.map +1 -0
- package/types/app-spec.d.ts +2 -1
- package/types/app-spec.js +121 -0
- package/types/app-spec.js.map +1 -1
- package/types/app-spec.mjs +120 -0
- package/types/app-spec.mjs.map +1 -1
- package/types/app.d.ts +53 -13
- package/types/app.js +1 -1
- package/types/app.js.map +1 -1
- package/types/app.mjs +1 -1
- package/types/app.mjs.map +1 -1
- package/types/asset-manager.d.ts +4 -4
- package/types/asset-manager.js +3 -4
- package/types/asset-manager.js.map +1 -1
- package/types/asset-manager.mjs +3 -4
- package/types/asset-manager.mjs.map +1 -1
- package/types/asset.d.ts +0 -1
- package/types/async-event-emitter.d.ts +23 -0
- package/types/async-event-emitter.js +55 -0
- package/types/async-event-emitter.js.map +1 -0
- package/types/async-event-emitter.mjs +53 -0
- package/types/async-event-emitter.mjs.map +1 -0
- package/types/client-manager.d.ts +133 -51
- package/types/client-manager.js +147 -23
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs +148 -24
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +232 -49
- package/types/composer.js +320 -65
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +321 -66
- 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 +7 -0
- package/types/expand.js +3 -0
- package/types/expand.js.map +1 -0
- package/types/expand.mjs +2 -0
- package/types/expand.mjs.map +1 -0
- 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 +2 -2
- package/types/kmd-account-manager.mjs.map +1 -1
- 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 +0 -1
- package/types/logic-error.js.map +1 -1
- 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 +17 -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-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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"algo-http-client-with-retry.mjs","sources":["../../src/types/algo-http-client-with-retry.ts"],"sourcesContent":[null],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"algo-http-client-with-retry.mjs","sources":["../../src/types/algo-http-client-with-retry.ts"],"sourcesContent":["import type { BaseHTTPClientResponse, Query } from 'algosdk/dist/types/client/baseHTTPClient'\nimport { Config } from '../config'\nimport { URLTokenBaseHTTPClient } from './urlTokenBaseHTTPClient'\n\n/** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */\nexport class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {\n private static readonly MAX_TRIES = 5\n private static readonly MAX_BACKOFF_MS = 10000\n\n // These lists come from https://visionmedia.github.io/superagent/#retrying-requests\n // which is the underlying library used by algosdk - but the CloudFlare specific 52X status codes have been removed\n private static readonly RETRY_STATUS_CODES = [408, 413, 429, 500, 502, 503, 504]\n private static readonly RETRY_ERROR_CODES = [\n 'ETIMEDOUT',\n 'ECONNRESET',\n 'EADDRINUSE',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EAI_AGAIN',\n 'EPROTO', // We get this intermittently with AlgoNode API\n ]\n\n private async callWithRetry(func: () => Promise<BaseHTTPClientResponse>): Promise<BaseHTTPClientResponse> {\n let response: BaseHTTPClientResponse | undefined\n let numTries = 1\n do {\n try {\n response = await func()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n if (numTries >= AlgoHttpClientWithRetry.MAX_TRIES) {\n throw err\n }\n // Only retry for one of the hardcoded conditions\n if (\n !(\n AlgoHttpClientWithRetry.RETRY_ERROR_CODES.includes(err.code) ||\n AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.status)) ||\n ('response' in err && AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.response.status)))\n )\n ) {\n throw err\n }\n // Retry immediately the first time, then exponentially backoff.\n const delayTimeMs = numTries == 1 ? 0 : Math.min(1000 * Math.pow(2, numTries - 1), AlgoHttpClientWithRetry.MAX_BACKOFF_MS)\n if (delayTimeMs > 0) {\n await new Promise((r) => setTimeout(r, delayTimeMs))\n }\n Config.logger.warn(`algosdk request failed ${numTries} times. Retrying in ${delayTimeMs}ms: ${err}`)\n }\n } while (!response && ++numTries <= AlgoHttpClientWithRetry.MAX_TRIES)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return response!\n }\n\n async get(relativePath: string, query?: Query<string>, requestHeaders: Record<string, string> = {}): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.get(relativePath, query, requestHeaders))\n }\n\n async post(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.post(relativePath, data, query, requestHeaders))\n }\n\n async delete(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.delete(relativePath, data, query, requestHeaders))\n }\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import algosdk from 'algosdk';
|
|
2
|
+
import { AlgorandClientTransactionCreator } from './algorand-client-transaction-creator';
|
|
3
|
+
import { AlgorandClientTransactionSender } from './algorand-client-transaction-sender';
|
|
4
|
+
import { AppDeployer } from './app-deployer';
|
|
5
|
+
import { AppManager } from './app-manager';
|
|
6
|
+
import AlgoKitComposer from './composer';
|
|
7
|
+
import { NetworkDetails } from './network-client';
|
|
8
|
+
import Algodv2 = algosdk.Algodv2;
|
|
9
|
+
import Indexer = algosdk.Indexer;
|
|
10
|
+
/** Interface for the bulk of the `AlgorandClient` functionality.
|
|
11
|
+
*
|
|
12
|
+
* Used to take a dependency on AlgorandClient without generating a circular dependency.
|
|
13
|
+
*/
|
|
14
|
+
export interface AlgorandClientInterface {
|
|
15
|
+
app: AppManager;
|
|
16
|
+
appDeployer: AppDeployer;
|
|
17
|
+
send: AlgorandClientTransactionSender;
|
|
18
|
+
createTransaction: AlgorandClientTransactionCreator;
|
|
19
|
+
newGroup(): AlgoKitComposer;
|
|
20
|
+
client: {
|
|
21
|
+
algod: Algodv2;
|
|
22
|
+
indexer?: Indexer;
|
|
23
|
+
network(): Promise<NetworkDetails>;
|
|
24
|
+
isLocalNet(): Promise<boolean>;
|
|
25
|
+
isTestNet(): Promise<boolean>;
|
|
26
|
+
isMainNet(): Promise<boolean>;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"algorand-client-interface.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"algorand-client-interface.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import algosdk from 'algosdk';
|
|
2
|
-
import AlgoKitComposer, {
|
|
2
|
+
import AlgoKitComposer, { BuiltTransactions } from './composer';
|
|
3
|
+
import { Expand } from './expand';
|
|
3
4
|
import Transaction = algosdk.Transaction;
|
|
4
5
|
/** Orchestrates creating transactions for `AlgorandClient`. */
|
|
5
6
|
export declare class AlgorandClientTransactionCreator {
|
|
@@ -10,12 +11,13 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
10
11
|
*/
|
|
11
12
|
constructor(newGroup: () => AlgoKitComposer);
|
|
12
13
|
private _transaction;
|
|
14
|
+
private _transactions;
|
|
13
15
|
/**
|
|
14
16
|
* Create a payment transaction to transfer Algo between accounts.
|
|
15
17
|
* @param params The parameters for the payment transaction
|
|
16
18
|
* @example Basic example
|
|
17
19
|
* ```typescript
|
|
18
|
-
* const result = await
|
|
20
|
+
* const result = await algorand.send.payment({
|
|
19
21
|
* sender: 'SENDERADDRESS',
|
|
20
22
|
* receiver: 'RECEIVERADDRESS',
|
|
21
23
|
* amount: (4).algo(),
|
|
@@ -23,7 +25,7 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
23
25
|
* ```
|
|
24
26
|
* @example Advanced example
|
|
25
27
|
* ```typescript
|
|
26
|
-
* const result = await
|
|
28
|
+
* const result = await algorand.send.payment({
|
|
27
29
|
* amount: (4).algo(),
|
|
28
30
|
* receiver: 'RECEIVERADDRESS',
|
|
29
31
|
* sender: 'SENDERADDRESS',
|
|
@@ -55,11 +57,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
55
57
|
*
|
|
56
58
|
* @example Basic example
|
|
57
59
|
* ```typescript
|
|
58
|
-
* await algorand.
|
|
60
|
+
* await algorand.createTransaction.assetCreate({sender: "CREATORADDRESS", total: 100n})
|
|
59
61
|
* ```
|
|
60
62
|
* @example Advanced example
|
|
61
63
|
* ```typescript
|
|
62
|
-
* await algorand.
|
|
64
|
+
* await algorand.createTransaction.assetCreate({
|
|
63
65
|
* sender: 'CREATORADDRESS',
|
|
64
66
|
* total: 100n,
|
|
65
67
|
* decimals: 2,
|
|
@@ -97,11 +99,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
97
99
|
*
|
|
98
100
|
* @example Basic example
|
|
99
101
|
* ```typescript
|
|
100
|
-
* await algorand.
|
|
102
|
+
* await algorand.createTransaction.assetConfig({sender: "MANAGERADDRESS", assetId: 123456n, manager: "MANAGERADDRESS" })
|
|
101
103
|
* ```
|
|
102
104
|
* @example Advanced example
|
|
103
105
|
* ```typescript
|
|
104
|
-
* await algorand.
|
|
106
|
+
* await algorand.createTransaction.assetConfig({
|
|
105
107
|
* sender: 'MANAGERADDRESS',
|
|
106
108
|
* assetId: 123456n,
|
|
107
109
|
* manager: 'MANAGERADDRESS',
|
|
@@ -129,11 +131,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
129
131
|
*
|
|
130
132
|
* @example Basic example
|
|
131
133
|
* ```typescript
|
|
132
|
-
* await algorand.
|
|
134
|
+
* await algorand.createTransaction.assetFreeze({sender: "MANAGERADDRESS", assetId: 123456n, account: "ACCOUNTADDRESS", frozen: true })
|
|
133
135
|
* ```
|
|
134
136
|
* @example Advanced example
|
|
135
137
|
* ```typescript
|
|
136
|
-
* await algorand.
|
|
138
|
+
* await algorand.createTransaction.assetFreeze({
|
|
137
139
|
* sender: 'MANAGERADDRESS',
|
|
138
140
|
* assetId: 123456n,
|
|
139
141
|
* account: 'ACCOUNTADDRESS',
|
|
@@ -163,11 +165,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
163
165
|
*
|
|
164
166
|
* @example Basic example
|
|
165
167
|
* ```typescript
|
|
166
|
-
* await algorand.
|
|
168
|
+
* await algorand.createTransaction.assetDestroy({sender: "MANAGERADDRESS", assetId: 123456n })
|
|
167
169
|
* ```
|
|
168
170
|
* @example Advanced example
|
|
169
171
|
* ```typescript
|
|
170
|
-
* await algorand.
|
|
172
|
+
* await algorand.createTransaction.assetDestroy({
|
|
171
173
|
* sender: 'MANAGERADDRESS',
|
|
172
174
|
* assetId: 123456n,
|
|
173
175
|
* lease: 'lease',
|
|
@@ -191,11 +193,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
191
193
|
*
|
|
192
194
|
* @example Basic example
|
|
193
195
|
* ```typescript
|
|
194
|
-
* await algorand.
|
|
196
|
+
* await algorand.createTransaction.assetTransfer({sender: "HOLDERADDRESS", assetId: 123456n, amount: 1n, receiver: "RECEIVERADDRESS" })
|
|
195
197
|
* ```
|
|
196
198
|
* @example Advanced example (with clawback)
|
|
197
199
|
* ```typescript
|
|
198
|
-
* await algorand.
|
|
200
|
+
* await algorand.createTransaction.assetTransfer({
|
|
199
201
|
* sender: 'CLAWBACKADDRESS',
|
|
200
202
|
* assetId: 123456n,
|
|
201
203
|
* amount: 1n,
|
|
@@ -224,11 +226,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
224
226
|
*
|
|
225
227
|
* @example Basic example
|
|
226
228
|
* ```typescript
|
|
227
|
-
* await algorand.
|
|
229
|
+
* await algorand.createTransaction.assetOptIn({sender: "SENDERADDRESS", assetId: 123456n })
|
|
228
230
|
* ```
|
|
229
231
|
* @example Advanced example
|
|
230
232
|
* ```typescript
|
|
231
|
-
* await algorand.
|
|
233
|
+
* await algorand.createTransaction.assetOptIn({
|
|
232
234
|
* sender: 'SENDERADDRESS',
|
|
233
235
|
* assetId: 123456n,
|
|
234
236
|
* lease: 'lease',
|
|
@@ -255,11 +257,11 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
255
257
|
*
|
|
256
258
|
* @example Basic example
|
|
257
259
|
* ```typescript
|
|
258
|
-
* await algorand.
|
|
260
|
+
* await algorand.createTransaction.assetOptOut({sender: "SENDERADDRESS", creator: "CREATORADDRESS", assetId: 123456n })
|
|
259
261
|
* ```
|
|
260
262
|
* @example Advanced example
|
|
261
263
|
* ```typescript
|
|
262
|
-
* await algorand.
|
|
264
|
+
* await algorand.createTransaction.assetOptIn({
|
|
263
265
|
* sender: 'SENDERADDRESS',
|
|
264
266
|
* assetId: 123456n,
|
|
265
267
|
* creator: 'CREATORADDRESS',
|
|
@@ -279,11 +281,438 @@ export declare class AlgorandClientTransactionCreator {
|
|
|
279
281
|
* @returns The asset opt-out transaction
|
|
280
282
|
*/
|
|
281
283
|
assetOptOut: (params: import("./composer").AssetOptOutParams) => Promise<Transaction>;
|
|
282
|
-
/** Create an application
|
|
284
|
+
/** Create an application create transaction.
|
|
285
|
+
*
|
|
286
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
287
|
+
*
|
|
288
|
+
* @param params The parameters for the app creation transaction
|
|
289
|
+
* @example Basic example
|
|
290
|
+
* ```typescript
|
|
291
|
+
* const result = await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
292
|
+
* const createdAppId = result.appId
|
|
293
|
+
* ```
|
|
294
|
+
* @example Advanced example
|
|
295
|
+
* ```typescript
|
|
296
|
+
* await algorand.createTransaction.appCreate({
|
|
297
|
+
* sender: 'CREATORADDRESS',
|
|
298
|
+
* approvalProgram: "TEALCODE",
|
|
299
|
+
* clearStateProgram: "TEALCODE",
|
|
300
|
+
* schema: {
|
|
301
|
+
* globalInts: 1,
|
|
302
|
+
* globalByteSlices: 2,
|
|
303
|
+
* localInts: 3,
|
|
304
|
+
* localByteSlices: 4
|
|
305
|
+
* },
|
|
306
|
+
* extraProgramPages: 1,
|
|
307
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
308
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
309
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
310
|
+
* appReferences: [123n, 1234n]
|
|
311
|
+
* assetReferences: [12345n]
|
|
312
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
313
|
+
* lease: 'lease',
|
|
314
|
+
* note: 'note',
|
|
315
|
+
* // You wouldn't normally set this field
|
|
316
|
+
* firstValidRound: 1000n,
|
|
317
|
+
* validityWindow: 10,
|
|
318
|
+
* extraFee: (1000).microAlgo(),
|
|
319
|
+
* staticFee: (1000).microAlgo(),
|
|
320
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
321
|
+
* // already specified, but here for completeness
|
|
322
|
+
* maxFee: (3000).microAlgo(),
|
|
323
|
+
* // Signer only needed if you want to provide one,
|
|
324
|
+
* // generally you'd register it with AlgorandClient
|
|
325
|
+
* // against the sender and not need to pass it in
|
|
326
|
+
* signer: transactionSigner,
|
|
327
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
328
|
+
* suppressLog: true,
|
|
329
|
+
*})
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
appCreate: (params: {
|
|
333
|
+
lease?: string | Uint8Array | undefined;
|
|
334
|
+
note?: string | Uint8Array | undefined;
|
|
335
|
+
maxFee?: import("./amount").AlgoAmount | undefined;
|
|
336
|
+
args?: Uint8Array[] | undefined;
|
|
337
|
+
signer?: algosdk.TransactionSigner | import("./account").TransactionSignerAccount | undefined;
|
|
338
|
+
sender: string;
|
|
339
|
+
rekeyTo?: string | undefined;
|
|
340
|
+
staticFee?: import("./amount").AlgoAmount | undefined;
|
|
341
|
+
extraFee?: import("./amount").AlgoAmount | undefined;
|
|
342
|
+
validityWindow?: number | undefined;
|
|
343
|
+
firstValidRound?: bigint | undefined;
|
|
344
|
+
lastValidRound?: bigint | undefined;
|
|
345
|
+
onComplete?: algosdk.OnApplicationComplete.NoOpOC | algosdk.OnApplicationComplete.OptInOC | algosdk.OnApplicationComplete.CloseOutOC | algosdk.OnApplicationComplete.UpdateApplicationOC | algosdk.OnApplicationComplete.DeleteApplicationOC | undefined;
|
|
346
|
+
accountReferences?: string[] | undefined;
|
|
347
|
+
appReferences?: bigint[] | undefined;
|
|
348
|
+
assetReferences?: bigint[] | undefined;
|
|
349
|
+
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
350
|
+
approvalProgram: string | Uint8Array;
|
|
351
|
+
clearStateProgram: string | Uint8Array;
|
|
352
|
+
schema?: {
|
|
353
|
+
globalInts: number;
|
|
354
|
+
globalByteSlices: number;
|
|
355
|
+
localInts: number;
|
|
356
|
+
localByteSlices: number;
|
|
357
|
+
} | undefined;
|
|
358
|
+
extraProgramPages?: number | undefined;
|
|
359
|
+
}) => Promise<Transaction>;
|
|
360
|
+
/** Create an application update transaction.
|
|
361
|
+
*
|
|
362
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
363
|
+
*
|
|
364
|
+
* @param params The parameters for the app update transaction
|
|
365
|
+
* @example Basic example
|
|
366
|
+
* ```typescript
|
|
367
|
+
* await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })
|
|
368
|
+
* ```
|
|
369
|
+
* @example Advanced example
|
|
370
|
+
* ```typescript
|
|
371
|
+
* await algorand.createTransaction.appUpdate({
|
|
372
|
+
* sender: 'CREATORADDRESS',
|
|
373
|
+
* approvalProgram: "TEALCODE",
|
|
374
|
+
* clearStateProgram: "TEALCODE",
|
|
375
|
+
* onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
|
|
376
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
377
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
378
|
+
* appReferences: [123n, 1234n]
|
|
379
|
+
* assetReferences: [12345n]
|
|
380
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
381
|
+
* lease: 'lease',
|
|
382
|
+
* note: 'note',
|
|
383
|
+
* // You wouldn't normally set this field
|
|
384
|
+
* firstValidRound: 1000n,
|
|
385
|
+
* validityWindow: 10,
|
|
386
|
+
* extraFee: (1000).microAlgo(),
|
|
387
|
+
* staticFee: (1000).microAlgo(),
|
|
388
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
389
|
+
* // already specified, but here for completeness
|
|
390
|
+
* maxFee: (3000).microAlgo(),
|
|
391
|
+
* // Signer only needed if you want to provide one,
|
|
392
|
+
* // generally you'd register it with AlgorandClient
|
|
393
|
+
* // against the sender and not need to pass it in
|
|
394
|
+
* signer: transactionSigner,
|
|
395
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
396
|
+
* suppressLog: true,
|
|
397
|
+
*})
|
|
398
|
+
* ```
|
|
399
|
+
*/
|
|
400
|
+
appUpdate: (params: {
|
|
401
|
+
sender: string;
|
|
402
|
+
signer?: algosdk.TransactionSigner | import("./account").TransactionSignerAccount | undefined;
|
|
403
|
+
rekeyTo?: string | undefined;
|
|
404
|
+
note?: string | Uint8Array | undefined;
|
|
405
|
+
lease?: string | Uint8Array | undefined;
|
|
406
|
+
staticFee?: import("./amount").AlgoAmount | undefined;
|
|
407
|
+
extraFee?: import("./amount").AlgoAmount | undefined;
|
|
408
|
+
maxFee?: import("./amount").AlgoAmount | undefined;
|
|
409
|
+
validityWindow?: number | undefined;
|
|
410
|
+
firstValidRound?: bigint | undefined;
|
|
411
|
+
lastValidRound?: bigint | undefined;
|
|
412
|
+
appId: bigint;
|
|
413
|
+
onComplete?: algosdk.OnApplicationComplete.UpdateApplicationOC | undefined;
|
|
414
|
+
args?: Uint8Array[] | undefined;
|
|
415
|
+
accountReferences?: string[] | undefined;
|
|
416
|
+
appReferences?: bigint[] | undefined;
|
|
417
|
+
assetReferences?: bigint[] | undefined;
|
|
418
|
+
boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
|
|
419
|
+
approvalProgram: string | Uint8Array;
|
|
420
|
+
clearStateProgram: string | Uint8Array;
|
|
421
|
+
}) => Promise<Transaction>;
|
|
422
|
+
/** Create an application delete transaction.
|
|
423
|
+
*
|
|
424
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
425
|
+
*
|
|
426
|
+
* @param params The parameters for the app deletion transaction
|
|
427
|
+
* @example Basic example
|
|
428
|
+
* ```typescript
|
|
429
|
+
* await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })
|
|
430
|
+
* ```
|
|
431
|
+
* @example Advanced example
|
|
432
|
+
* ```typescript
|
|
433
|
+
* await algorand.createTransaction.appDelete({
|
|
434
|
+
* sender: 'CREATORADDRESS',
|
|
435
|
+
* onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
|
|
436
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
437
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
438
|
+
* appReferences: [123n, 1234n]
|
|
439
|
+
* assetReferences: [12345n]
|
|
440
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
441
|
+
* lease: 'lease',
|
|
442
|
+
* note: 'note',
|
|
443
|
+
* // You wouldn't normally set this field
|
|
444
|
+
* firstValidRound: 1000n,
|
|
445
|
+
* validityWindow: 10,
|
|
446
|
+
* extraFee: (1000).microAlgo(),
|
|
447
|
+
* staticFee: (1000).microAlgo(),
|
|
448
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
449
|
+
* // already specified, but here for completeness
|
|
450
|
+
* maxFee: (3000).microAlgo(),
|
|
451
|
+
* // Signer only needed if you want to provide one,
|
|
452
|
+
* // generally you'd register it with AlgorandClient
|
|
453
|
+
* // against the sender and not need to pass it in
|
|
454
|
+
* signer: transactionSigner,
|
|
455
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
456
|
+
* suppressLog: true,
|
|
457
|
+
*})
|
|
458
|
+
* ```
|
|
459
|
+
*/
|
|
460
|
+
appDelete: (params: import("./composer").AppDeleteParams) => Promise<Transaction>;
|
|
461
|
+
/** Create an application call transaction.
|
|
462
|
+
*
|
|
463
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
464
|
+
*
|
|
465
|
+
* @param params The parameters for the app call transaction
|
|
466
|
+
* @example Basic example
|
|
467
|
+
* ```typescript
|
|
468
|
+
* await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })
|
|
469
|
+
* ```
|
|
470
|
+
* @example Advanced example
|
|
471
|
+
* ```typescript
|
|
472
|
+
* await algorand.createTransaction.appCall({
|
|
473
|
+
* sender: 'CREATORADDRESS',
|
|
474
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
475
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
476
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
477
|
+
* appReferences: [123n, 1234n]
|
|
478
|
+
* assetReferences: [12345n]
|
|
479
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
480
|
+
* lease: 'lease',
|
|
481
|
+
* note: 'note',
|
|
482
|
+
* // You wouldn't normally set this field
|
|
483
|
+
* firstValidRound: 1000n,
|
|
484
|
+
* validityWindow: 10,
|
|
485
|
+
* extraFee: (1000).microAlgo(),
|
|
486
|
+
* staticFee: (1000).microAlgo(),
|
|
487
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
488
|
+
* // already specified, but here for completeness
|
|
489
|
+
* maxFee: (3000).microAlgo(),
|
|
490
|
+
* // Signer only needed if you want to provide one,
|
|
491
|
+
* // generally you'd register it with AlgorandClient
|
|
492
|
+
* // against the sender and not need to pass it in
|
|
493
|
+
* signer: transactionSigner,
|
|
494
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
495
|
+
* suppressLog: true,
|
|
496
|
+
*})
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
283
499
|
appCall: (params: import("./composer").AppCallParams) => Promise<Transaction>;
|
|
284
|
-
/** Create an application call with ABI method call transaction.
|
|
285
|
-
|
|
500
|
+
/** Create an application create call with ABI method call transaction.
|
|
501
|
+
*
|
|
502
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
503
|
+
*
|
|
504
|
+
* @param params The parameters for the app creation transaction
|
|
505
|
+
* @example Basic example
|
|
506
|
+
* ```typescript
|
|
507
|
+
* const method = new ABIMethod({
|
|
508
|
+
* name: 'method',
|
|
509
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
510
|
+
* returns: { type: 'string' },
|
|
511
|
+
* })
|
|
512
|
+
* const result = await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
513
|
+
* const createdAppId = result.appId
|
|
514
|
+
* ```
|
|
515
|
+
* @example Advanced example
|
|
516
|
+
* ```typescript
|
|
517
|
+
* const method = new ABIMethod({
|
|
518
|
+
* name: 'method',
|
|
519
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
520
|
+
* returns: { type: 'string' },
|
|
521
|
+
* })
|
|
522
|
+
* await algorand.createTransaction.appCreate({
|
|
523
|
+
* sender: 'CREATORADDRESS',
|
|
524
|
+
* method: method,
|
|
525
|
+
* args: ["arg1_value"],
|
|
526
|
+
* approvalProgram: "TEALCODE",
|
|
527
|
+
* clearStateProgram: "TEALCODE",
|
|
528
|
+
* schema: {
|
|
529
|
+
* globalInts: 1,
|
|
530
|
+
* globalByteSlices: 2,
|
|
531
|
+
* localInts: 3,
|
|
532
|
+
* localByteSlices: 4
|
|
533
|
+
* },
|
|
534
|
+
* extraProgramPages: 1,
|
|
535
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
536
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
537
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
538
|
+
* appReferences: [123n, 1234n]
|
|
539
|
+
* assetReferences: [12345n]
|
|
540
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
541
|
+
* lease: 'lease',
|
|
542
|
+
* note: 'note',
|
|
543
|
+
* // You wouldn't normally set this field
|
|
544
|
+
* firstValidRound: 1000n,
|
|
545
|
+
* validityWindow: 10,
|
|
546
|
+
* extraFee: (1000).microAlgo(),
|
|
547
|
+
* staticFee: (1000).microAlgo(),
|
|
548
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
549
|
+
* // already specified, but here for completeness
|
|
550
|
+
* maxFee: (3000).microAlgo(),
|
|
551
|
+
* // Signer only needed if you want to provide one,
|
|
552
|
+
* // generally you'd register it with AlgorandClient
|
|
553
|
+
* // against the sender and not need to pass it in
|
|
554
|
+
* signer: transactionSigner,
|
|
555
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
556
|
+
* suppressLog: true,
|
|
557
|
+
*})
|
|
558
|
+
* ```
|
|
559
|
+
*/
|
|
560
|
+
appCreateMethodCall: (params: import("./composer").AppCreateMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
561
|
+
/** Create an application update call with ABI method call transaction.
|
|
562
|
+
*
|
|
563
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
564
|
+
*
|
|
565
|
+
* @param params The parameters for the app update transaction
|
|
566
|
+
* @example Basic example
|
|
567
|
+
* ```typescript
|
|
568
|
+
* const method = new ABIMethod({
|
|
569
|
+
* name: 'method',
|
|
570
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
571
|
+
* returns: { type: 'string' },
|
|
572
|
+
* })
|
|
573
|
+
* await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: ["arg1_value"] })
|
|
574
|
+
* ```
|
|
575
|
+
* @example Advanced example
|
|
576
|
+
* ```typescript
|
|
577
|
+
* const method = new ABIMethod({
|
|
578
|
+
* name: 'method',
|
|
579
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
580
|
+
* returns: { type: 'string' },
|
|
581
|
+
* })
|
|
582
|
+
* await algorand.createTransaction.appUpdateMethodCall({
|
|
583
|
+
* sender: 'CREATORADDRESS',
|
|
584
|
+
* method: method,
|
|
585
|
+
* args: ["arg1_value"],
|
|
586
|
+
* approvalProgram: "TEALCODE",
|
|
587
|
+
* clearStateProgram: "TEALCODE",
|
|
588
|
+
* onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,
|
|
589
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
590
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
591
|
+
* appReferences: [123n, 1234n]
|
|
592
|
+
* assetReferences: [12345n]
|
|
593
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
594
|
+
* lease: 'lease',
|
|
595
|
+
* note: 'note',
|
|
596
|
+
* // You wouldn't normally set this field
|
|
597
|
+
* firstValidRound: 1000n,
|
|
598
|
+
* validityWindow: 10,
|
|
599
|
+
* extraFee: (1000).microAlgo(),
|
|
600
|
+
* staticFee: (1000).microAlgo(),
|
|
601
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
602
|
+
* // already specified, but here for completeness
|
|
603
|
+
* maxFee: (3000).microAlgo(),
|
|
604
|
+
* // Signer only needed if you want to provide one,
|
|
605
|
+
* // generally you'd register it with AlgorandClient
|
|
606
|
+
* // against the sender and not need to pass it in
|
|
607
|
+
* signer: transactionSigner,
|
|
608
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
609
|
+
* suppressLog: true,
|
|
610
|
+
*})
|
|
611
|
+
* ```
|
|
612
|
+
*/
|
|
613
|
+
appUpdateMethodCall: (params: import("./composer").AppUpdateMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
614
|
+
/** Create an application delete call with ABI method call transaction.
|
|
615
|
+
*
|
|
616
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
617
|
+
*
|
|
618
|
+
* @param params The parameters for the app deletion transaction
|
|
619
|
+
* @example Basic example
|
|
620
|
+
* ```typescript
|
|
621
|
+
* const method = new ABIMethod({
|
|
622
|
+
* name: 'method',
|
|
623
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
624
|
+
* returns: { type: 'string' },
|
|
625
|
+
* })
|
|
626
|
+
* await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
627
|
+
* ```
|
|
628
|
+
* @example Advanced example
|
|
629
|
+
* ```typescript
|
|
630
|
+
* const method = new ABIMethod({
|
|
631
|
+
* name: 'method',
|
|
632
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
633
|
+
* returns: { type: 'string' },
|
|
634
|
+
* })
|
|
635
|
+
* await algorand.createTransaction.appDeleteMethodCall({
|
|
636
|
+
* sender: 'CREATORADDRESS',
|
|
637
|
+
* method: method,
|
|
638
|
+
* args: ["arg1_value"],
|
|
639
|
+
* onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,
|
|
640
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
641
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
642
|
+
* appReferences: [123n, 1234n]
|
|
643
|
+
* assetReferences: [12345n]
|
|
644
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
645
|
+
* lease: 'lease',
|
|
646
|
+
* note: 'note',
|
|
647
|
+
* // You wouldn't normally set this field
|
|
648
|
+
* firstValidRound: 1000n,
|
|
649
|
+
* validityWindow: 10,
|
|
650
|
+
* extraFee: (1000).microAlgo(),
|
|
651
|
+
* staticFee: (1000).microAlgo(),
|
|
652
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
653
|
+
* // already specified, but here for completeness
|
|
654
|
+
* maxFee: (3000).microAlgo(),
|
|
655
|
+
* // Signer only needed if you want to provide one,
|
|
656
|
+
* // generally you'd register it with AlgorandClient
|
|
657
|
+
* // against the sender and not need to pass it in
|
|
658
|
+
* signer: transactionSigner,
|
|
659
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
660
|
+
* suppressLog: true,
|
|
661
|
+
*})
|
|
662
|
+
* ```
|
|
663
|
+
*/
|
|
664
|
+
appDeleteMethodCall: (params: import("./composer").AppDeleteMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
665
|
+
/** Create an application call with ABI method call transaction.
|
|
666
|
+
*
|
|
667
|
+
* Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.
|
|
668
|
+
*
|
|
669
|
+
* @param params The parameters for the app call transaction
|
|
670
|
+
* @example Basic example
|
|
671
|
+
* ```typescript
|
|
672
|
+
* const method = new ABIMethod({
|
|
673
|
+
* name: 'method',
|
|
674
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
675
|
+
* returns: { type: 'string' },
|
|
676
|
+
* })
|
|
677
|
+
* await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: ["arg1_value"] })
|
|
678
|
+
* ```
|
|
679
|
+
* @example Advanced example
|
|
680
|
+
* ```typescript
|
|
681
|
+
* const method = new ABIMethod({
|
|
682
|
+
* name: 'method',
|
|
683
|
+
* args: [{ name: 'arg1', type: 'string' }],
|
|
684
|
+
* returns: { type: 'string' },
|
|
685
|
+
* })
|
|
686
|
+
* await algorand.createTransaction.appCallMethodCall({
|
|
687
|
+
* sender: 'CREATORADDRESS',
|
|
688
|
+
* method: method,
|
|
689
|
+
* args: ["arg1_value"],
|
|
690
|
+
* onComplete: algosdk.OnApplicationComplete.OptInOC,
|
|
691
|
+
* args: [new Uint8Array(1, 2, 3, 4)]
|
|
692
|
+
* accountReferences: ["ACCOUNT_1"]
|
|
693
|
+
* appReferences: [123n, 1234n]
|
|
694
|
+
* assetReferences: [12345n]
|
|
695
|
+
* boxReferences: ["box1", {appId: 1234n, name: "box2"}]
|
|
696
|
+
* lease: 'lease',
|
|
697
|
+
* note: 'note',
|
|
698
|
+
* // You wouldn't normally set this field
|
|
699
|
+
* firstValidRound: 1000n,
|
|
700
|
+
* validityWindow: 10,
|
|
701
|
+
* extraFee: (1000).microAlgo(),
|
|
702
|
+
* staticFee: (1000).microAlgo(),
|
|
703
|
+
* // Max fee doesn't make sense with extraFee AND staticFee
|
|
704
|
+
* // already specified, but here for completeness
|
|
705
|
+
* maxFee: (3000).microAlgo(),
|
|
706
|
+
* // Signer only needed if you want to provide one,
|
|
707
|
+
* // generally you'd register it with AlgorandClient
|
|
708
|
+
* // against the sender and not need to pass it in
|
|
709
|
+
* signer: transactionSigner,
|
|
710
|
+
* maxRoundsToWaitForConfirmation: 5,
|
|
711
|
+
* suppressLog: true,
|
|
712
|
+
*})
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
appCallMethodCall: (params: import("./composer").AppCallMethodCall) => Promise<Expand<BuiltTransactions>>;
|
|
286
716
|
/** Create an online key registration transaction. */
|
|
287
717
|
onlineKeyRegistration: (params: import("./composer").OnlineKeyRegistrationParams) => Promise<Transaction>;
|
|
288
718
|
}
|
|
289
|
-
//# sourceMappingURL=algorand-client-transaction-creator.d.ts.map
|