@algorandfoundation/algokit-utils 7.0.2 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "**"
7
7
  ],
8
8
  "name": "@algorandfoundation/algokit-utils",
9
- "version": "7.0.2",
9
+ "version": "7.1.0",
10
10
  "private": false,
11
11
  "description": "A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand.",
12
12
  "author": "Algorand Foundation",
@@ -8,29 +8,41 @@ import { AlgorandFixture, AlgorandFixtureConfig } from '../../types/testing';
8
8
  * and/or kmd (or their respective config) if you want to test against
9
9
  * an explicitly defined network.
10
10
  *
11
- * @example No config
11
+ * @example No config (per-test isolation)
12
12
  * ```typescript
13
- * const algorand = algorandFixture()
13
+ * const fixture = algorandFixture()
14
14
  *
15
- * beforeEach(algorand.beforeEach, 10_000)
15
+ * beforeEach(fixture.newScope, 10_000)
16
16
  *
17
17
  * test('My test', async () => {
18
- * const {algod, indexer, testAccount, ...} = algorand.context
18
+ * const {algod, indexer, testAccount, ...} = fixture.context
19
+ * // test things...
20
+ * })
21
+ * ```
22
+ *
23
+ * @example No config (test suite isolation)
24
+ * ```typescript
25
+ * const fixture = algorandFixture()
26
+ *
27
+ * beforeAll(fixture.newScope, 10_000)
28
+ *
29
+ * test('My test', async () => {
30
+ * const {algod, indexer, testAccount, ...} = fixture.context
19
31
  * // test things...
20
32
  * })
21
33
  * ```
22
34
  *
23
35
  * @example With config
24
36
  * ```typescript
25
- * const algorand = algorandFixture({
37
+ * const fixture = algorandFixture({
26
38
  * algod: new Algodv2('localhost', 12345, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),
27
39
  * // ...
28
40
  * })
29
41
  *
30
- * beforeEach(algorand.beforeEach, 10_000)
42
+ * beforeEach(fixture.newScope, 10_000)
31
43
  *
32
44
  * test('My test', async () => {
33
- * const {algod, indexer, testAccount, ...} = algorand.context
45
+ * const {algod, indexer, testAccount, ...} = fixture.context
34
46
  * // test things...
35
47
  * })
36
48
  * ```
@@ -48,18 +60,6 @@ export declare function algorandFixture(fixtureConfig?: AlgorandFixtureConfig):
48
60
  * a default LocalNet instance, but you can pass in an algod, indexer
49
61
  * and/or kmd if you want to test against an explicitly defined network.
50
62
  *
51
- * @example
52
- * ```typescript
53
- * const algorand = algorandFixture(undefined, getConfigFromEnvOrDefaults())
54
- *
55
- * beforeEach(algorand.beforeEach, 10_000)
56
- *
57
- * test('My test', async () => {
58
- * const {algod, indexer, testAccount, ...} = algorand.context
59
- * // test things...
60
- * })
61
- * ```
62
- *
63
63
  * @param fixtureConfig The fixture configuration
64
64
  * @param config The fixture configuration
65
65
  * @returns The fixture
@@ -19,13 +19,13 @@ function algorandFixture(fixtureConfig, config$1) {
19
19
  const kmd = fixtureConfig.kmd ?? types_clientManager.ClientManager.getKmdClient(fixtureConfig.kmdConfig);
20
20
  let context;
21
21
  let algorand;
22
- const beforeEach = async () => {
22
+ const newScope = async () => {
23
23
  config.Config.configure({ debug: true });
24
24
  const transactionLogger$1 = new transactionLogger.TransactionLogger();
25
25
  const transactionLoggerAlgod = transactionLogger$1.capture(algod);
26
- algorand = types_algorandClient.AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer: indexer$1, kmd });
26
+ algorand = types_algorandClient.AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer: indexer$1, kmd }).setSuggestedParamsCacheTimeout(0);
27
27
  const acc = await account.getTestAccount({ initialFunds: fixtureConfig?.testAccountFunding ?? amount.algos(10), suppressLog: true }, algorand);
28
- algorand.setSignerFromAccount(acc).setSuggestedParamsCacheTimeout(0);
28
+ algorand.setSignerFromAccount(acc);
29
29
  // If running against LocalNet we are likely in dev mode and we need to set a much higher validity window
30
30
  // otherwise we are more likely to get invalid transactions.
31
31
  if (await algorand.client.isLocalNet()) {
@@ -50,12 +50,15 @@ function algorandFixture(fixtureConfig, config$1) {
50
50
  };
51
51
  return {
52
52
  get context() {
53
+ if (!context)
54
+ throw new Error('Context not initialised; make sure to call fixture.newScope() before accessing context.');
53
55
  return context;
54
56
  },
55
57
  get algorand() {
56
58
  return algorand;
57
59
  },
58
- beforeEach,
60
+ beforeEach: newScope,
61
+ newScope,
59
62
  };
60
63
  }
61
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"algorand-fixture.js","sources":["../../../src/testing/fixtures/algorand-fixture.ts"],"sourcesContent":["import { algos, Config, lookupTransactionById } from '../../'\nimport { AlgorandClient } from '../../types/algorand-client'\nimport { ClientManager } from '../../types/client-manager'\nimport { AlgoConfig } from '../../types/network-client'\nimport { AlgorandFixture, AlgorandFixtureConfig, AlgorandTestAutomationContext, GetTestAccountParams } from '../../types/testing'\nimport { getTestAccount } from '../account'\nimport { runWhenIndexerCaughtUp } from '../indexer'\nimport { TransactionLogger } from '../transaction-logger'\n\n/**\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd (or their respective config) if you want to test against\n * an explicitly defined network.\n *\n * @example No config\n * ```typescript\n * const algorand = algorandFixture()\n *\n * beforeEach(algorand.beforeEach, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = algorand.context\n * // test things...\n * })\n * ```\n *\n * @example With config\n * ```typescript\n * const algorand = algorandFixture({\n * algod: new Algodv2('localhost', 12345, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),\n * // ...\n * })\n *\n * beforeEach(algorand.beforeEach, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = algorand.context\n * // test things...\n * })\n * ```\n *\n * @param fixtureConfig The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): AlgorandFixture\n\n/**\n * @deprecated Config can be passed in directly to fixture config now.\n *\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd if you want to test against an explicitly defined network.\n *\n * @example\n * ```typescript\n * const algorand = algorandFixture(undefined, getConfigFromEnvOrDefaults())\n *\n * beforeEach(algorand.beforeEach, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = algorand.context\n * // test things...\n * })\n * ```\n *\n * @param fixtureConfig The fixture configuration\n * @param config The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig: AlgorandFixtureConfig | undefined, config: AlgoConfig): AlgorandFixture\n\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig, config?: AlgoConfig): AlgorandFixture {\n fixtureConfig = { ...fixtureConfig, ...config }\n if (!fixtureConfig.algod || !fixtureConfig.indexer || !fixtureConfig.kmd) {\n fixtureConfig = { ...ClientManager.getConfigFromEnvironmentOrLocalNet(), ...fixtureConfig }\n }\n\n const algod = fixtureConfig.algod ?? ClientManager.getAlgodClient(fixtureConfig.algodConfig!)\n const indexer = fixtureConfig.indexer ?? ClientManager.getIndexerClient(fixtureConfig.indexerConfig!)\n const kmd = fixtureConfig.kmd ?? ClientManager.getKmdClient(fixtureConfig.kmdConfig!)\n let context: AlgorandTestAutomationContext\n let algorand: AlgorandClient\n\n const beforeEach = async () => {\n Config.configure({ debug: true })\n const transactionLogger = new TransactionLogger()\n const transactionLoggerAlgod = transactionLogger.capture(algod)\n algorand = AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer, kmd })\n const acc = await getTestAccount({ initialFunds: fixtureConfig?.testAccountFunding ?? algos(10), suppressLog: true }, algorand)\n algorand.setSignerFromAccount(acc).setSuggestedParamsCacheTimeout(0)\n // If running against LocalNet we are likely in dev mode and we need to set a much higher validity window\n // otherwise we are more likely to get invalid transactions.\n if (await algorand.client.isLocalNet()) {\n algorand.setDefaultValidityWindow(1000)\n }\n const testAccount = { ...acc, signer: algorand.account.getSigner(acc.addr) }\n context = {\n algorand,\n algod: transactionLoggerAlgod,\n indexer: indexer,\n kmd: kmd,\n testAccount,\n generateAccount: async (params: GetTestAccountParams) => {\n const account = await getTestAccount(params, algorand)\n algorand.setSignerFromAccount(account)\n return { ...account, signer: algorand.account.getSigner(account.addr) }\n },\n transactionLogger: transactionLogger,\n waitForIndexer: () => transactionLogger.waitForIndexer(indexer),\n waitForIndexerTransaction: (transactionId: string) => runWhenIndexerCaughtUp(() => lookupTransactionById(transactionId, indexer)),\n }\n }\n\n return {\n get context() {\n return context\n },\n get algorand() {\n return algorand\n },\n beforeEach,\n }\n}\n"],"names":["config","ClientManager","indexer","Config","transactionLogger","TransactionLogger","AlgorandClient","getTestAccount","algos","account","runWhenIndexerCaughtUp","lookupTransactionById"],"mappings":";;;;;;;;;;;AA4EgB,SAAA,eAAe,CAAC,aAAqC,EAAEA,QAAmB,EAAA;IACxF,aAAa,GAAG,EAAE,GAAG,aAAa,EAAE,GAAGA,QAAM,EAAE;AAC/C,IAAA,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;QACxE,aAAa,GAAG,EAAE,GAAGC,iCAAa,CAAC,kCAAkC,EAAE,EAAE,GAAG,aAAa,EAAE;;AAG7F,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,IAAIA,iCAAa,CAAC,cAAc,CAAC,aAAa,CAAC,WAAY,CAAC;AAC7F,IAAA,MAAMC,SAAO,GAAG,aAAa,CAAC,OAAO,IAAID,iCAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAc,CAAC;AACrG,IAAA,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,IAAIA,iCAAa,CAAC,YAAY,CAAC,aAAa,CAAC,SAAU,CAAC;AACrF,IAAA,IAAI,OAAsC;AAC1C,IAAA,IAAI,QAAwB;AAE5B,IAAA,MAAM,UAAU,GAAG,YAAW;QAC5BE,aAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjC,QAAA,MAAMC,mBAAiB,GAAG,IAAIC,mCAAiB,EAAE;QACjD,MAAM,sBAAsB,GAAGD,mBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;AAC/D,QAAA,QAAQ,GAAGE,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,sBAAsB,WAAEJ,SAAO,EAAE,GAAG,EAAE,CAAC;QACtF,MAAM,GAAG,GAAG,MAAMK,sBAAc,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,IAAIC,YAAK,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;QAC/H,QAAQ,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC;;;QAGpE,IAAI,MAAM,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;AACtC,YAAA,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC;;AAEzC,QAAA,MAAM,WAAW,GAAG,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAC5E,QAAA,OAAO,GAAG;YACR,QAAQ;AACR,YAAA,KAAK,EAAE,sBAAsB;AAC7B,YAAA,OAAO,EAAEN,SAAO;AAChB,YAAA,GAAG,EAAE,GAAG;YACR,WAAW;AACX,YAAA,eAAe,EAAE,OAAO,MAA4B,KAAI;gBACtD,MAAMO,SAAO,GAAG,MAAMF,sBAAc,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtD,gBAAA,QAAQ,CAAC,oBAAoB,CAACE,SAAO,CAAC;AACtC,gBAAA,OAAO,EAAE,GAAGA,SAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAACA,SAAO,CAAC,IAAI,CAAC,EAAE;aACxE;AACD,YAAA,iBAAiB,EAAEL,mBAAiB;YACpC,cAAc,EAAE,MAAMA,mBAAiB,CAAC,cAAc,CAACF,SAAO,CAAC;AAC/D,YAAA,yBAAyB,EAAE,CAAC,aAAqB,KAAKQ,8BAAsB,CAAC,MAAMC,mCAAqB,CAAC,aAAa,EAAET,SAAO,CAAC,CAAC;SAClI;AACH,KAAC;IAED,OAAO;AACL,QAAA,IAAI,OAAO,GAAA;AACT,YAAA,OAAO,OAAO;SACf;AACD,QAAA,IAAI,QAAQ,GAAA;AACV,YAAA,OAAO,QAAQ;SAChB;QACD,UAAU;KACX;AACH;;;;"}
1
+ {"version":3,"file":"algorand-fixture.js","sources":["../../../src/testing/fixtures/algorand-fixture.ts"],"sourcesContent":["import { algos, Config, lookupTransactionById } from '../../'\nimport { AlgorandClient } from '../../types/algorand-client'\nimport { ClientManager } from '../../types/client-manager'\nimport { AlgoConfig } from '../../types/network-client'\nimport { AlgorandFixture, AlgorandFixtureConfig, AlgorandTestAutomationContext, GetTestAccountParams } from '../../types/testing'\nimport { getTestAccount } from '../account'\nimport { runWhenIndexerCaughtUp } from '../indexer'\nimport { TransactionLogger } from '../transaction-logger'\n\n/**\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd (or their respective config) if you want to test against\n * an explicitly defined network.\n *\n * @example No config (per-test isolation)\n * ```typescript\n * const fixture = algorandFixture()\n *\n * beforeEach(fixture.newScope, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = fixture.context\n * // test things...\n * })\n * ```\n *\n * @example No config (test suite isolation)\n * ```typescript\n * const fixture = algorandFixture()\n *\n * beforeAll(fixture.newScope, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = fixture.context\n * // test things...\n * })\n * ```\n *\n * @example With config\n * ```typescript\n * const fixture = algorandFixture({\n * algod: new Algodv2('localhost', 12345, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),\n * // ...\n * })\n *\n * beforeEach(fixture.newScope, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = fixture.context\n * // test things...\n * })\n * ```\n *\n * @param fixtureConfig The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): AlgorandFixture\n\n/**\n * @deprecated Config can be passed in directly to fixture config now.\n *\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd if you want to test against an explicitly defined network.\n *\n * @param fixtureConfig The fixture configuration\n * @param config The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig: AlgorandFixtureConfig | undefined, config: AlgoConfig): AlgorandFixture\n\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig, config?: AlgoConfig): AlgorandFixture {\n fixtureConfig = { ...fixtureConfig, ...config }\n if (!fixtureConfig.algod || !fixtureConfig.indexer || !fixtureConfig.kmd) {\n fixtureConfig = { ...ClientManager.getConfigFromEnvironmentOrLocalNet(), ...fixtureConfig }\n }\n\n const algod = fixtureConfig.algod ?? ClientManager.getAlgodClient(fixtureConfig.algodConfig!)\n const indexer = fixtureConfig.indexer ?? ClientManager.getIndexerClient(fixtureConfig.indexerConfig!)\n const kmd = fixtureConfig.kmd ?? ClientManager.getKmdClient(fixtureConfig.kmdConfig!)\n let context: AlgorandTestAutomationContext\n let algorand: AlgorandClient\n\n const newScope = async () => {\n Config.configure({ debug: true })\n const transactionLogger = new TransactionLogger()\n const transactionLoggerAlgod = transactionLogger.capture(algod)\n algorand = AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer, kmd }).setSuggestedParamsCacheTimeout(0)\n\n const acc = await getTestAccount({ initialFunds: fixtureConfig?.testAccountFunding ?? algos(10), suppressLog: true }, algorand)\n algorand.setSignerFromAccount(acc)\n // If running against LocalNet we are likely in dev mode and we need to set a much higher validity window\n // otherwise we are more likely to get invalid transactions.\n if (await algorand.client.isLocalNet()) {\n algorand.setDefaultValidityWindow(1000)\n }\n const testAccount = { ...acc, signer: algorand.account.getSigner(acc.addr) }\n context = {\n algorand,\n algod: transactionLoggerAlgod,\n indexer: indexer,\n kmd: kmd,\n testAccount,\n generateAccount: async (params: GetTestAccountParams) => {\n const account = await getTestAccount(params, algorand)\n algorand.setSignerFromAccount(account)\n return { ...account, signer: algorand.account.getSigner(account.addr) }\n },\n transactionLogger: transactionLogger,\n waitForIndexer: () => transactionLogger.waitForIndexer(indexer),\n waitForIndexerTransaction: (transactionId: string) => runWhenIndexerCaughtUp(() => lookupTransactionById(transactionId, indexer)),\n }\n }\n\n return {\n get context() {\n if (!context) throw new Error('Context not initialised; make sure to call fixture.newScope() before accessing context.')\n return context\n },\n get algorand() {\n return algorand\n },\n beforeEach: newScope,\n newScope,\n }\n}\n"],"names":["config","ClientManager","indexer","Config","transactionLogger","TransactionLogger","AlgorandClient","getTestAccount","algos","account","runWhenIndexerCaughtUp","lookupTransactionById"],"mappings":";;;;;;;;;;;AA4EgB,SAAA,eAAe,CAAC,aAAqC,EAAEA,QAAmB,EAAA;IACxF,aAAa,GAAG,EAAE,GAAG,aAAa,EAAE,GAAGA,QAAM,EAAE;AAC/C,IAAA,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;QACxE,aAAa,GAAG,EAAE,GAAGC,iCAAa,CAAC,kCAAkC,EAAE,EAAE,GAAG,aAAa,EAAE;;AAG7F,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,IAAIA,iCAAa,CAAC,cAAc,CAAC,aAAa,CAAC,WAAY,CAAC;AAC7F,IAAA,MAAMC,SAAO,GAAG,aAAa,CAAC,OAAO,IAAID,iCAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAc,CAAC;AACrG,IAAA,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,IAAIA,iCAAa,CAAC,YAAY,CAAC,aAAa,CAAC,SAAU,CAAC;AACrF,IAAA,IAAI,OAAsC;AAC1C,IAAA,IAAI,QAAwB;AAE5B,IAAA,MAAM,QAAQ,GAAG,YAAW;QAC1BE,aAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjC,QAAA,MAAMC,mBAAiB,GAAG,IAAIC,mCAAiB,EAAE;QACjD,MAAM,sBAAsB,GAAGD,mBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;QAC/D,QAAQ,GAAGE,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,sBAAsB,WAAEJ,SAAO,EAAE,GAAG,EAAE,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAExH,MAAM,GAAG,GAAG,MAAMK,sBAAc,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,IAAIC,YAAK,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;AAC/H,QAAA,QAAQ,CAAC,oBAAoB,CAAC,GAAG,CAAC;;;QAGlC,IAAI,MAAM,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;AACtC,YAAA,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC;;AAEzC,QAAA,MAAM,WAAW,GAAG,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAC5E,QAAA,OAAO,GAAG;YACR,QAAQ;AACR,YAAA,KAAK,EAAE,sBAAsB;AAC7B,YAAA,OAAO,EAAEN,SAAO;AAChB,YAAA,GAAG,EAAE,GAAG;YACR,WAAW;AACX,YAAA,eAAe,EAAE,OAAO,MAA4B,KAAI;gBACtD,MAAMO,SAAO,GAAG,MAAMF,sBAAc,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtD,gBAAA,QAAQ,CAAC,oBAAoB,CAACE,SAAO,CAAC;AACtC,gBAAA,OAAO,EAAE,GAAGA,SAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAACA,SAAO,CAAC,IAAI,CAAC,EAAE;aACxE;AACD,YAAA,iBAAiB,EAAEL,mBAAiB;YACpC,cAAc,EAAE,MAAMA,mBAAiB,CAAC,cAAc,CAACF,SAAO,CAAC;AAC/D,YAAA,yBAAyB,EAAE,CAAC,aAAqB,KAAKQ,8BAAsB,CAAC,MAAMC,mCAAqB,CAAC,aAAa,EAAET,SAAO,CAAC,CAAC;SAClI;AACH,KAAC;IAED,OAAO;AACL,QAAA,IAAI,OAAO,GAAA;AACT,YAAA,IAAI,CAAC,OAAO;AAAE,gBAAA,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC;AACxH,YAAA,OAAO,OAAO;SACf;AACD,QAAA,IAAI,QAAQ,GAAA;AACV,YAAA,OAAO,QAAQ;SAChB;AACD,QAAA,UAAU,EAAE,QAAQ;QACpB,QAAQ;KACT;AACH;;;;"}
@@ -17,13 +17,13 @@ function algorandFixture(fixtureConfig, config) {
17
17
  const kmd = fixtureConfig.kmd ?? ClientManager.getKmdClient(fixtureConfig.kmdConfig);
18
18
  let context;
19
19
  let algorand;
20
- const beforeEach = async () => {
20
+ const newScope = async () => {
21
21
  Config.configure({ debug: true });
22
22
  const transactionLogger = new TransactionLogger();
23
23
  const transactionLoggerAlgod = transactionLogger.capture(algod);
24
- algorand = AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer, kmd });
24
+ algorand = AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer, kmd }).setSuggestedParamsCacheTimeout(0);
25
25
  const acc = await getTestAccount({ initialFunds: fixtureConfig?.testAccountFunding ?? algos(10), suppressLog: true }, algorand);
26
- algorand.setSignerFromAccount(acc).setSuggestedParamsCacheTimeout(0);
26
+ algorand.setSignerFromAccount(acc);
27
27
  // If running against LocalNet we are likely in dev mode and we need to set a much higher validity window
28
28
  // otherwise we are more likely to get invalid transactions.
29
29
  if (await algorand.client.isLocalNet()) {
@@ -48,12 +48,15 @@ function algorandFixture(fixtureConfig, config) {
48
48
  };
49
49
  return {
50
50
  get context() {
51
+ if (!context)
52
+ throw new Error('Context not initialised; make sure to call fixture.newScope() before accessing context.');
51
53
  return context;
52
54
  },
53
55
  get algorand() {
54
56
  return algorand;
55
57
  },
56
- beforeEach,
58
+ beforeEach: newScope,
59
+ newScope,
57
60
  };
58
61
  }
59
62
 
@@ -1 +1 @@
1
- {"version":3,"file":"algorand-fixture.mjs","sources":["../../../src/testing/fixtures/algorand-fixture.ts"],"sourcesContent":["import { algos, Config, lookupTransactionById } from '../../'\nimport { AlgorandClient } from '../../types/algorand-client'\nimport { ClientManager } from '../../types/client-manager'\nimport { AlgoConfig } from '../../types/network-client'\nimport { AlgorandFixture, AlgorandFixtureConfig, AlgorandTestAutomationContext, GetTestAccountParams } from '../../types/testing'\nimport { getTestAccount } from '../account'\nimport { runWhenIndexerCaughtUp } from '../indexer'\nimport { TransactionLogger } from '../transaction-logger'\n\n/**\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd (or their respective config) if you want to test against\n * an explicitly defined network.\n *\n * @example No config\n * ```typescript\n * const algorand = algorandFixture()\n *\n * beforeEach(algorand.beforeEach, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = algorand.context\n * // test things...\n * })\n * ```\n *\n * @example With config\n * ```typescript\n * const algorand = algorandFixture({\n * algod: new Algodv2('localhost', 12345, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),\n * // ...\n * })\n *\n * beforeEach(algorand.beforeEach, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = algorand.context\n * // test things...\n * })\n * ```\n *\n * @param fixtureConfig The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): AlgorandFixture\n\n/**\n * @deprecated Config can be passed in directly to fixture config now.\n *\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd if you want to test against an explicitly defined network.\n *\n * @example\n * ```typescript\n * const algorand = algorandFixture(undefined, getConfigFromEnvOrDefaults())\n *\n * beforeEach(algorand.beforeEach, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = algorand.context\n * // test things...\n * })\n * ```\n *\n * @param fixtureConfig The fixture configuration\n * @param config The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig: AlgorandFixtureConfig | undefined, config: AlgoConfig): AlgorandFixture\n\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig, config?: AlgoConfig): AlgorandFixture {\n fixtureConfig = { ...fixtureConfig, ...config }\n if (!fixtureConfig.algod || !fixtureConfig.indexer || !fixtureConfig.kmd) {\n fixtureConfig = { ...ClientManager.getConfigFromEnvironmentOrLocalNet(), ...fixtureConfig }\n }\n\n const algod = fixtureConfig.algod ?? ClientManager.getAlgodClient(fixtureConfig.algodConfig!)\n const indexer = fixtureConfig.indexer ?? ClientManager.getIndexerClient(fixtureConfig.indexerConfig!)\n const kmd = fixtureConfig.kmd ?? ClientManager.getKmdClient(fixtureConfig.kmdConfig!)\n let context: AlgorandTestAutomationContext\n let algorand: AlgorandClient\n\n const beforeEach = async () => {\n Config.configure({ debug: true })\n const transactionLogger = new TransactionLogger()\n const transactionLoggerAlgod = transactionLogger.capture(algod)\n algorand = AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer, kmd })\n const acc = await getTestAccount({ initialFunds: fixtureConfig?.testAccountFunding ?? algos(10), suppressLog: true }, algorand)\n algorand.setSignerFromAccount(acc).setSuggestedParamsCacheTimeout(0)\n // If running against LocalNet we are likely in dev mode and we need to set a much higher validity window\n // otherwise we are more likely to get invalid transactions.\n if (await algorand.client.isLocalNet()) {\n algorand.setDefaultValidityWindow(1000)\n }\n const testAccount = { ...acc, signer: algorand.account.getSigner(acc.addr) }\n context = {\n algorand,\n algod: transactionLoggerAlgod,\n indexer: indexer,\n kmd: kmd,\n testAccount,\n generateAccount: async (params: GetTestAccountParams) => {\n const account = await getTestAccount(params, algorand)\n algorand.setSignerFromAccount(account)\n return { ...account, signer: algorand.account.getSigner(account.addr) }\n },\n transactionLogger: transactionLogger,\n waitForIndexer: () => transactionLogger.waitForIndexer(indexer),\n waitForIndexerTransaction: (transactionId: string) => runWhenIndexerCaughtUp(() => lookupTransactionById(transactionId, indexer)),\n }\n }\n\n return {\n get context() {\n return context\n },\n get algorand() {\n return algorand\n },\n beforeEach,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AA4EgB,SAAA,eAAe,CAAC,aAAqC,EAAE,MAAmB,EAAA;IACxF,aAAa,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE;AAC/C,IAAA,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;QACxE,aAAa,GAAG,EAAE,GAAG,aAAa,CAAC,kCAAkC,EAAE,EAAE,GAAG,aAAa,EAAE;;AAG7F,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,WAAY,CAAC;AAC7F,IAAA,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAc,CAAC;AACrG,IAAA,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,IAAI,aAAa,CAAC,YAAY,CAAC,aAAa,CAAC,SAAU,CAAC;AACrF,IAAA,IAAI,OAAsC;AAC1C,IAAA,IAAI,QAAwB;AAE5B,IAAA,MAAM,UAAU,GAAG,YAAW;QAC5B,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjC,QAAA,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE;QACjD,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;AAC/D,QAAA,QAAQ,GAAG,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QACtF,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;QAC/H,QAAQ,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC;;;QAGpE,IAAI,MAAM,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;AACtC,YAAA,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC;;AAEzC,QAAA,MAAM,WAAW,GAAG,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAC5E,QAAA,OAAO,GAAG;YACR,QAAQ;AACR,YAAA,KAAK,EAAE,sBAAsB;AAC7B,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,GAAG,EAAE,GAAG;YACR,WAAW;AACX,YAAA,eAAe,EAAE,OAAO,MAA4B,KAAI;gBACtD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtD,gBAAA,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAC;AACtC,gBAAA,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;aACxE;AACD,YAAA,iBAAiB,EAAE,iBAAiB;YACpC,cAAc,EAAE,MAAM,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC;AAC/D,YAAA,yBAAyB,EAAE,CAAC,aAAqB,KAAK,sBAAsB,CAAC,MAAM,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;SAClI;AACH,KAAC;IAED,OAAO;AACL,QAAA,IAAI,OAAO,GAAA;AACT,YAAA,OAAO,OAAO;SACf;AACD,QAAA,IAAI,QAAQ,GAAA;AACV,YAAA,OAAO,QAAQ;SAChB;QACD,UAAU;KACX;AACH;;;;"}
1
+ {"version":3,"file":"algorand-fixture.mjs","sources":["../../../src/testing/fixtures/algorand-fixture.ts"],"sourcesContent":["import { algos, Config, lookupTransactionById } from '../../'\nimport { AlgorandClient } from '../../types/algorand-client'\nimport { ClientManager } from '../../types/client-manager'\nimport { AlgoConfig } from '../../types/network-client'\nimport { AlgorandFixture, AlgorandFixtureConfig, AlgorandTestAutomationContext, GetTestAccountParams } from '../../types/testing'\nimport { getTestAccount } from '../account'\nimport { runWhenIndexerCaughtUp } from '../indexer'\nimport { TransactionLogger } from '../transaction-logger'\n\n/**\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd (or their respective config) if you want to test against\n * an explicitly defined network.\n *\n * @example No config (per-test isolation)\n * ```typescript\n * const fixture = algorandFixture()\n *\n * beforeEach(fixture.newScope, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = fixture.context\n * // test things...\n * })\n * ```\n *\n * @example No config (test suite isolation)\n * ```typescript\n * const fixture = algorandFixture()\n *\n * beforeAll(fixture.newScope, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = fixture.context\n * // test things...\n * })\n * ```\n *\n * @example With config\n * ```typescript\n * const fixture = algorandFixture({\n * algod: new Algodv2('localhost', 12345, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),\n * // ...\n * })\n *\n * beforeEach(fixture.newScope, 10_000)\n *\n * test('My test', async () => {\n * const {algod, indexer, testAccount, ...} = fixture.context\n * // test things...\n * })\n * ```\n *\n * @param fixtureConfig The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig): AlgorandFixture\n\n/**\n * @deprecated Config can be passed in directly to fixture config now.\n *\n * Creates a test fixture for automated testing against Algorand.\n * By default it tests against an environment variable specified client\n * if the standard environment variables are specified, otherwise against\n * a default LocalNet instance, but you can pass in an algod, indexer\n * and/or kmd if you want to test against an explicitly defined network.\n *\n * @param fixtureConfig The fixture configuration\n * @param config The fixture configuration\n * @returns The fixture\n */\nexport function algorandFixture(fixtureConfig: AlgorandFixtureConfig | undefined, config: AlgoConfig): AlgorandFixture\n\nexport function algorandFixture(fixtureConfig?: AlgorandFixtureConfig, config?: AlgoConfig): AlgorandFixture {\n fixtureConfig = { ...fixtureConfig, ...config }\n if (!fixtureConfig.algod || !fixtureConfig.indexer || !fixtureConfig.kmd) {\n fixtureConfig = { ...ClientManager.getConfigFromEnvironmentOrLocalNet(), ...fixtureConfig }\n }\n\n const algod = fixtureConfig.algod ?? ClientManager.getAlgodClient(fixtureConfig.algodConfig!)\n const indexer = fixtureConfig.indexer ?? ClientManager.getIndexerClient(fixtureConfig.indexerConfig!)\n const kmd = fixtureConfig.kmd ?? ClientManager.getKmdClient(fixtureConfig.kmdConfig!)\n let context: AlgorandTestAutomationContext\n let algorand: AlgorandClient\n\n const newScope = async () => {\n Config.configure({ debug: true })\n const transactionLogger = new TransactionLogger()\n const transactionLoggerAlgod = transactionLogger.capture(algod)\n algorand = AlgorandClient.fromClients({ algod: transactionLoggerAlgod, indexer, kmd }).setSuggestedParamsCacheTimeout(0)\n\n const acc = await getTestAccount({ initialFunds: fixtureConfig?.testAccountFunding ?? algos(10), suppressLog: true }, algorand)\n algorand.setSignerFromAccount(acc)\n // If running against LocalNet we are likely in dev mode and we need to set a much higher validity window\n // otherwise we are more likely to get invalid transactions.\n if (await algorand.client.isLocalNet()) {\n algorand.setDefaultValidityWindow(1000)\n }\n const testAccount = { ...acc, signer: algorand.account.getSigner(acc.addr) }\n context = {\n algorand,\n algod: transactionLoggerAlgod,\n indexer: indexer,\n kmd: kmd,\n testAccount,\n generateAccount: async (params: GetTestAccountParams) => {\n const account = await getTestAccount(params, algorand)\n algorand.setSignerFromAccount(account)\n return { ...account, signer: algorand.account.getSigner(account.addr) }\n },\n transactionLogger: transactionLogger,\n waitForIndexer: () => transactionLogger.waitForIndexer(indexer),\n waitForIndexerTransaction: (transactionId: string) => runWhenIndexerCaughtUp(() => lookupTransactionById(transactionId, indexer)),\n }\n }\n\n return {\n get context() {\n if (!context) throw new Error('Context not initialised; make sure to call fixture.newScope() before accessing context.')\n return context\n },\n get algorand() {\n return algorand\n },\n beforeEach: newScope,\n newScope,\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AA4EgB,SAAA,eAAe,CAAC,aAAqC,EAAE,MAAmB,EAAA;IACxF,aAAa,GAAG,EAAE,GAAG,aAAa,EAAE,GAAG,MAAM,EAAE;AAC/C,IAAA,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE;QACxE,aAAa,GAAG,EAAE,GAAG,aAAa,CAAC,kCAAkC,EAAE,EAAE,GAAG,aAAa,EAAE;;AAG7F,IAAA,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,WAAY,CAAC;AAC7F,IAAA,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,aAAa,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAc,CAAC;AACrG,IAAA,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,IAAI,aAAa,CAAC,YAAY,CAAC,aAAa,CAAC,SAAU,CAAC;AACrF,IAAA,IAAI,OAAsC;AAC1C,IAAA,IAAI,QAAwB;AAE5B,IAAA,MAAM,QAAQ,GAAG,YAAW;QAC1B,MAAM,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACjC,QAAA,MAAM,iBAAiB,GAAG,IAAI,iBAAiB,EAAE;QACjD,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC;QAC/D,QAAQ,GAAG,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,8BAA8B,CAAC,CAAC,CAAC;QAExH,MAAM,GAAG,GAAG,MAAM,cAAc,CAAC,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,QAAQ,CAAC;AAC/H,QAAA,QAAQ,CAAC,oBAAoB,CAAC,GAAG,CAAC;;;QAGlC,IAAI,MAAM,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE;AACtC,YAAA,QAAQ,CAAC,wBAAwB,CAAC,IAAI,CAAC;;AAEzC,QAAA,MAAM,WAAW,GAAG,EAAE,GAAG,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;AAC5E,QAAA,OAAO,GAAG;YACR,QAAQ;AACR,YAAA,KAAK,EAAE,sBAAsB;AAC7B,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,GAAG,EAAE,GAAG;YACR,WAAW;AACX,YAAA,eAAe,EAAE,OAAO,MAA4B,KAAI;gBACtD,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC;AACtD,gBAAA,QAAQ,CAAC,oBAAoB,CAAC,OAAO,CAAC;AACtC,gBAAA,OAAO,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;aACxE;AACD,YAAA,iBAAiB,EAAE,iBAAiB;YACpC,cAAc,EAAE,MAAM,iBAAiB,CAAC,cAAc,CAAC,OAAO,CAAC;AAC/D,YAAA,yBAAyB,EAAE,CAAC,aAAqB,KAAK,sBAAsB,CAAC,MAAM,qBAAqB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;SAClI;AACH,KAAC;IAED,OAAO;AACL,QAAA,IAAI,OAAO,GAAA;AACT,YAAA,IAAI,CAAC,OAAO;AAAE,gBAAA,MAAM,IAAI,KAAK,CAAC,yFAAyF,CAAC;AACxH,YAAA,OAAO,OAAO;SACf;AACD,QAAA,IAAI,QAAQ,GAAA;AACV,YAAA,OAAO,QAAQ;SAChB;AACD,QAAA,UAAU,EAAE,QAAQ;QACpB,QAAQ;KACT;AACH;;;;"}
@@ -49,7 +49,10 @@ class TransactionLogger {
49
49
  }
50
50
  /** Wait until all logged transactions IDs appear in the given `Indexer`. */
51
51
  async waitForIndexer(indexer$1) {
52
- await Promise.all(this._sentTransactionIds.map((txnId) => indexer.runWhenIndexerCaughtUp(() => indexer$1.lookupTransactionByID(txnId).do())));
52
+ if (this._sentTransactionIds.length === 0)
53
+ return;
54
+ const lastTxId = this._sentTransactionIds[this._sentTransactionIds.length - 1];
55
+ await indexer.runWhenIndexerCaughtUp(() => indexer$1.lookupTransactionByID(lastTxId).do());
53
56
  }
54
57
  }
55
58
  class TransactionLoggingAlgodv2ProxyHandler {
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-logger.js","sources":["../../src/testing/transaction-logger.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { runWhenIndexerCaughtUp } from './indexer'\nimport Algodv2 = algosdk.Algodv2\nimport decodeSignedTransaction = algosdk.decodeSignedTransaction\nimport Indexer = algosdk.Indexer\n\n/**\n * Allows you to keep track of Algorand transaction IDs by wrapping an `Algodv2` in a proxy.\n * Useful for automated tests.\n */\nexport class TransactionLogger {\n private _sentTransactionIds: string[] = []\n\n /**\n * The list of transaction IDs that has been logged thus far.\n */\n get sentTransactionIds(): Readonly<string[]> {\n return this._sentTransactionIds\n }\n\n /**\n * Clear all logged IDs.\n */\n clear() {\n this._sentTransactionIds = []\n }\n\n /**\n * The method that captures raw transactions and stores the transaction IDs.\n */\n logRawTransaction(signedTransactions: Uint8Array | Uint8Array[]) {\n if (Array.isArray(signedTransactions)) {\n for (const stxn of signedTransactions) {\n const decoded = decodeSignedTransaction(stxn)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n } else {\n const decoded = decodeSignedTransaction(signedTransactions)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n }\n\n /** Return a proxy that wraps the given Algodv2 with this transaction logger.\n *\n * @param algod The `Algodv2` to wrap\n * @returns The wrapped `Algodv2`, any transactions sent using this algod instance will be logged by this transaction logger\n */\n capture(algod: Algodv2): Algodv2 {\n return new Proxy<Algodv2>(algod, new TransactionLoggingAlgodv2ProxyHandler(this))\n }\n\n /** Wait until all logged transactions IDs appear in the given `Indexer`. */\n async waitForIndexer(indexer: Indexer) {\n await Promise.all(this._sentTransactionIds.map((txnId) => runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do())))\n }\n}\n\nclass TransactionLoggingAlgodv2ProxyHandler implements ProxyHandler<Algodv2> {\n private transactionLogger: TransactionLogger\n\n constructor(transactionLogger: TransactionLogger) {\n this.transactionLogger = transactionLogger\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(target: Algodv2, property: string | symbol, receiver: any) {\n if (property === 'sendRawTransaction') {\n return (stxOrStxs: Uint8Array | Uint8Array[]) => {\n this.transactionLogger.logRawTransaction(stxOrStxs)\n return target[property].call(receiver, stxOrStxs)\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (target as any)[property]\n }\n}\n"],"names":["indexer","runWhenIndexerCaughtUp"],"mappings":";;;;;AAGA,IAAO,uBAAuB,GAAG,OAAO,CAAC,uBAAuB;AAGhE;;;AAGG;MACU,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACU,IAAmB,CAAA,mBAAA,GAAa,EAAE;;AAE1C;;AAEG;AACH,IAAA,IAAI,kBAAkB,GAAA;QACpB,OAAO,IAAI,CAAC,mBAAmB;;AAGjC;;AAEG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,mBAAmB,GAAG,EAAE;;AAG/B;;AAEG;AACH,IAAA,iBAAiB,CAAC,kBAA6C,EAAA;AAC7D,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AACrC,YAAA,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE;AACrC,gBAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAC7C,gBAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;aAE9C;AACL,YAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,kBAAkB,CAAC;AAC3D,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;AAIrD;;;;AAIG;AACH,IAAA,OAAO,CAAC,KAAc,EAAA;QACpB,OAAO,IAAI,KAAK,CAAU,KAAK,EAAE,IAAI,qCAAqC,CAAC,IAAI,CAAC,CAAC;;;IAInF,MAAM,cAAc,CAACA,SAAgB,EAAA;AACnC,QAAA,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,KAAKC,8BAAsB,CAAC,MAAMD,SAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;;AAEtI;AAED,MAAM,qCAAqC,CAAA;AAGzC,IAAA,WAAA,CAAY,iBAAoC,EAAA;AAC9C,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB;;;AAI5C,IAAA,GAAG,CAAC,MAAe,EAAE,QAAyB,EAAE,QAAa,EAAA;AAC3D,QAAA,IAAI,QAAQ,KAAK,oBAAoB,EAAE;YACrC,OAAO,CAAC,SAAoC,KAAI;AAC9C,gBAAA,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,SAAS,CAAC;gBACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;AACnD,aAAC;;;AAGH,QAAA,OAAQ,MAAc,CAAC,QAAQ,CAAC;;AAEnC;;;;"}
1
+ {"version":3,"file":"transaction-logger.js","sources":["../../src/testing/transaction-logger.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { runWhenIndexerCaughtUp } from './indexer'\nimport Algodv2 = algosdk.Algodv2\nimport decodeSignedTransaction = algosdk.decodeSignedTransaction\nimport Indexer = algosdk.Indexer\n\n/**\n * Allows you to keep track of Algorand transaction IDs by wrapping an `Algodv2` in a proxy.\n * Useful for automated tests.\n */\nexport class TransactionLogger {\n private _sentTransactionIds: string[] = []\n\n /**\n * The list of transaction IDs that has been logged thus far.\n */\n get sentTransactionIds(): Readonly<string[]> {\n return this._sentTransactionIds\n }\n\n /**\n * Clear all logged IDs.\n */\n clear() {\n this._sentTransactionIds = []\n }\n\n /**\n * The method that captures raw transactions and stores the transaction IDs.\n */\n logRawTransaction(signedTransactions: Uint8Array | Uint8Array[]) {\n if (Array.isArray(signedTransactions)) {\n for (const stxn of signedTransactions) {\n const decoded = decodeSignedTransaction(stxn)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n } else {\n const decoded = decodeSignedTransaction(signedTransactions)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n }\n\n /** Return a proxy that wraps the given Algodv2 with this transaction logger.\n *\n * @param algod The `Algodv2` to wrap\n * @returns The wrapped `Algodv2`, any transactions sent using this algod instance will be logged by this transaction logger\n */\n capture(algod: Algodv2): Algodv2 {\n return new Proxy<Algodv2>(algod, new TransactionLoggingAlgodv2ProxyHandler(this))\n }\n\n /** Wait until all logged transactions IDs appear in the given `Indexer`. */\n async waitForIndexer(indexer: Indexer) {\n if (this._sentTransactionIds.length === 0) return\n const lastTxId = this._sentTransactionIds[this._sentTransactionIds.length - 1]\n await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(lastTxId).do())\n }\n}\n\nclass TransactionLoggingAlgodv2ProxyHandler implements ProxyHandler<Algodv2> {\n private transactionLogger: TransactionLogger\n\n constructor(transactionLogger: TransactionLogger) {\n this.transactionLogger = transactionLogger\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(target: Algodv2, property: string | symbol, receiver: any) {\n if (property === 'sendRawTransaction') {\n return (stxOrStxs: Uint8Array | Uint8Array[]) => {\n this.transactionLogger.logRawTransaction(stxOrStxs)\n return target[property].call(receiver, stxOrStxs)\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (target as any)[property]\n }\n}\n"],"names":["indexer","runWhenIndexerCaughtUp"],"mappings":";;;;;AAGA,IAAO,uBAAuB,GAAG,OAAO,CAAC,uBAAuB;AAGhE;;;AAGG;MACU,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACU,IAAmB,CAAA,mBAAA,GAAa,EAAE;;AAE1C;;AAEG;AACH,IAAA,IAAI,kBAAkB,GAAA;QACpB,OAAO,IAAI,CAAC,mBAAmB;;AAGjC;;AAEG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,mBAAmB,GAAG,EAAE;;AAG/B;;AAEG;AACH,IAAA,iBAAiB,CAAC,kBAA6C,EAAA;AAC7D,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AACrC,YAAA,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE;AACrC,gBAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAC7C,gBAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;aAE9C;AACL,YAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,kBAAkB,CAAC;AAC3D,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;AAIrD;;;;AAIG;AACH,IAAA,OAAO,CAAC,KAAc,EAAA;QACpB,OAAO,IAAI,KAAK,CAAU,KAAK,EAAE,IAAI,qCAAqC,CAAC,IAAI,CAAC,CAAC;;;IAInF,MAAM,cAAc,CAACA,SAAgB,EAAA;AACnC,QAAA,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC;YAAE;AAC3C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9E,QAAA,MAAMC,8BAAsB,CAAC,MAAMD,SAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;;AAEnF;AAED,MAAM,qCAAqC,CAAA;AAGzC,IAAA,WAAA,CAAY,iBAAoC,EAAA;AAC9C,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB;;;AAI5C,IAAA,GAAG,CAAC,MAAe,EAAE,QAAyB,EAAE,QAAa,EAAA;AAC3D,QAAA,IAAI,QAAQ,KAAK,oBAAoB,EAAE;YACrC,OAAO,CAAC,SAAoC,KAAI;AAC9C,gBAAA,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,SAAS,CAAC;gBACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;AACnD,aAAC;;;AAGH,QAAA,OAAQ,MAAc,CAAC,QAAQ,CAAC;;AAEnC;;;;"}
@@ -47,7 +47,10 @@ class TransactionLogger {
47
47
  }
48
48
  /** Wait until all logged transactions IDs appear in the given `Indexer`. */
49
49
  async waitForIndexer(indexer) {
50
- await Promise.all(this._sentTransactionIds.map((txnId) => runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do())));
50
+ if (this._sentTransactionIds.length === 0)
51
+ return;
52
+ const lastTxId = this._sentTransactionIds[this._sentTransactionIds.length - 1];
53
+ await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(lastTxId).do());
51
54
  }
52
55
  }
53
56
  class TransactionLoggingAlgodv2ProxyHandler {
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-logger.mjs","sources":["../../src/testing/transaction-logger.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { runWhenIndexerCaughtUp } from './indexer'\nimport Algodv2 = algosdk.Algodv2\nimport decodeSignedTransaction = algosdk.decodeSignedTransaction\nimport Indexer = algosdk.Indexer\n\n/**\n * Allows you to keep track of Algorand transaction IDs by wrapping an `Algodv2` in a proxy.\n * Useful for automated tests.\n */\nexport class TransactionLogger {\n private _sentTransactionIds: string[] = []\n\n /**\n * The list of transaction IDs that has been logged thus far.\n */\n get sentTransactionIds(): Readonly<string[]> {\n return this._sentTransactionIds\n }\n\n /**\n * Clear all logged IDs.\n */\n clear() {\n this._sentTransactionIds = []\n }\n\n /**\n * The method that captures raw transactions and stores the transaction IDs.\n */\n logRawTransaction(signedTransactions: Uint8Array | Uint8Array[]) {\n if (Array.isArray(signedTransactions)) {\n for (const stxn of signedTransactions) {\n const decoded = decodeSignedTransaction(stxn)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n } else {\n const decoded = decodeSignedTransaction(signedTransactions)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n }\n\n /** Return a proxy that wraps the given Algodv2 with this transaction logger.\n *\n * @param algod The `Algodv2` to wrap\n * @returns The wrapped `Algodv2`, any transactions sent using this algod instance will be logged by this transaction logger\n */\n capture(algod: Algodv2): Algodv2 {\n return new Proxy<Algodv2>(algod, new TransactionLoggingAlgodv2ProxyHandler(this))\n }\n\n /** Wait until all logged transactions IDs appear in the given `Indexer`. */\n async waitForIndexer(indexer: Indexer) {\n await Promise.all(this._sentTransactionIds.map((txnId) => runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(txnId).do())))\n }\n}\n\nclass TransactionLoggingAlgodv2ProxyHandler implements ProxyHandler<Algodv2> {\n private transactionLogger: TransactionLogger\n\n constructor(transactionLogger: TransactionLogger) {\n this.transactionLogger = transactionLogger\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(target: Algodv2, property: string | symbol, receiver: any) {\n if (property === 'sendRawTransaction') {\n return (stxOrStxs: Uint8Array | Uint8Array[]) => {\n this.transactionLogger.logRawTransaction(stxOrStxs)\n return target[property].call(receiver, stxOrStxs)\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (target as any)[property]\n }\n}\n"],"names":[],"mappings":";;;AAGA,IAAO,uBAAuB,GAAG,OAAO,CAAC,uBAAuB;AAGhE;;;AAGG;MACU,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACU,IAAmB,CAAA,mBAAA,GAAa,EAAE;;AAE1C;;AAEG;AACH,IAAA,IAAI,kBAAkB,GAAA;QACpB,OAAO,IAAI,CAAC,mBAAmB;;AAGjC;;AAEG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,mBAAmB,GAAG,EAAE;;AAG/B;;AAEG;AACH,IAAA,iBAAiB,CAAC,kBAA6C,EAAA;AAC7D,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AACrC,YAAA,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE;AACrC,gBAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAC7C,gBAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;aAE9C;AACL,YAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,kBAAkB,CAAC;AAC3D,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;AAIrD;;;;AAIG;AACH,IAAA,OAAO,CAAC,KAAc,EAAA;QACpB,OAAO,IAAI,KAAK,CAAU,KAAK,EAAE,IAAI,qCAAqC,CAAC,IAAI,CAAC,CAAC;;;IAInF,MAAM,cAAc,CAAC,OAAgB,EAAA;AACnC,QAAA,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,KAAK,sBAAsB,CAAC,MAAM,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;;AAEtI;AAED,MAAM,qCAAqC,CAAA;AAGzC,IAAA,WAAA,CAAY,iBAAoC,EAAA;AAC9C,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB;;;AAI5C,IAAA,GAAG,CAAC,MAAe,EAAE,QAAyB,EAAE,QAAa,EAAA;AAC3D,QAAA,IAAI,QAAQ,KAAK,oBAAoB,EAAE;YACrC,OAAO,CAAC,SAAoC,KAAI;AAC9C,gBAAA,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,SAAS,CAAC;gBACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;AACnD,aAAC;;;AAGH,QAAA,OAAQ,MAAc,CAAC,QAAQ,CAAC;;AAEnC;;;;"}
1
+ {"version":3,"file":"transaction-logger.mjs","sources":["../../src/testing/transaction-logger.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { runWhenIndexerCaughtUp } from './indexer'\nimport Algodv2 = algosdk.Algodv2\nimport decodeSignedTransaction = algosdk.decodeSignedTransaction\nimport Indexer = algosdk.Indexer\n\n/**\n * Allows you to keep track of Algorand transaction IDs by wrapping an `Algodv2` in a proxy.\n * Useful for automated tests.\n */\nexport class TransactionLogger {\n private _sentTransactionIds: string[] = []\n\n /**\n * The list of transaction IDs that has been logged thus far.\n */\n get sentTransactionIds(): Readonly<string[]> {\n return this._sentTransactionIds\n }\n\n /**\n * Clear all logged IDs.\n */\n clear() {\n this._sentTransactionIds = []\n }\n\n /**\n * The method that captures raw transactions and stores the transaction IDs.\n */\n logRawTransaction(signedTransactions: Uint8Array | Uint8Array[]) {\n if (Array.isArray(signedTransactions)) {\n for (const stxn of signedTransactions) {\n const decoded = decodeSignedTransaction(stxn)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n } else {\n const decoded = decodeSignedTransaction(signedTransactions)\n this._sentTransactionIds.push(decoded.txn.txID())\n }\n }\n\n /** Return a proxy that wraps the given Algodv2 with this transaction logger.\n *\n * @param algod The `Algodv2` to wrap\n * @returns The wrapped `Algodv2`, any transactions sent using this algod instance will be logged by this transaction logger\n */\n capture(algod: Algodv2): Algodv2 {\n return new Proxy<Algodv2>(algod, new TransactionLoggingAlgodv2ProxyHandler(this))\n }\n\n /** Wait until all logged transactions IDs appear in the given `Indexer`. */\n async waitForIndexer(indexer: Indexer) {\n if (this._sentTransactionIds.length === 0) return\n const lastTxId = this._sentTransactionIds[this._sentTransactionIds.length - 1]\n await runWhenIndexerCaughtUp(() => indexer.lookupTransactionByID(lastTxId).do())\n }\n}\n\nclass TransactionLoggingAlgodv2ProxyHandler implements ProxyHandler<Algodv2> {\n private transactionLogger: TransactionLogger\n\n constructor(transactionLogger: TransactionLogger) {\n this.transactionLogger = transactionLogger\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n get(target: Algodv2, property: string | symbol, receiver: any) {\n if (property === 'sendRawTransaction') {\n return (stxOrStxs: Uint8Array | Uint8Array[]) => {\n this.transactionLogger.logRawTransaction(stxOrStxs)\n return target[property].call(receiver, stxOrStxs)\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (target as any)[property]\n }\n}\n"],"names":[],"mappings":";;;AAGA,IAAO,uBAAuB,GAAG,OAAO,CAAC,uBAAuB;AAGhE;;;AAGG;MACU,iBAAiB,CAAA;AAA9B,IAAA,WAAA,GAAA;QACU,IAAmB,CAAA,mBAAA,GAAa,EAAE;;AAE1C;;AAEG;AACH,IAAA,IAAI,kBAAkB,GAAA;QACpB,OAAO,IAAI,CAAC,mBAAmB;;AAGjC;;AAEG;IACH,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,mBAAmB,GAAG,EAAE;;AAG/B;;AAEG;AACH,IAAA,iBAAiB,CAAC,kBAA6C,EAAA;AAC7D,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AACrC,YAAA,KAAK,MAAM,IAAI,IAAI,kBAAkB,EAAE;AACrC,gBAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,IAAI,CAAC;AAC7C,gBAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;aAE9C;AACL,YAAA,MAAM,OAAO,GAAG,uBAAuB,CAAC,kBAAkB,CAAC;AAC3D,YAAA,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;;;AAIrD;;;;AAIG;AACH,IAAA,OAAO,CAAC,KAAc,EAAA;QACpB,OAAO,IAAI,KAAK,CAAU,KAAK,EAAE,IAAI,qCAAqC,CAAC,IAAI,CAAC,CAAC;;;IAInF,MAAM,cAAc,CAAC,OAAgB,EAAA;AACnC,QAAA,IAAI,IAAI,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC;YAAE;AAC3C,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9E,QAAA,MAAM,sBAAsB,CAAC,MAAM,OAAO,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC;;AAEnF;AAED,MAAM,qCAAqC,CAAA;AAGzC,IAAA,WAAA,CAAY,iBAAoC,EAAA;AAC9C,QAAA,IAAI,CAAC,iBAAiB,GAAG,iBAAiB;;;AAI5C,IAAA,GAAG,CAAC,MAAe,EAAE,QAAyB,EAAE,QAAa,EAAA;AAC3D,QAAA,IAAI,QAAQ,KAAK,oBAAoB,EAAE;YACrC,OAAO,CAAC,SAAoC,KAAI;AAC9C,gBAAA,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,SAAS,CAAC;gBACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;AACnD,aAAC;;;AAGH,QAAA,OAAQ,MAAc,CAAC,QAAQ,CAAC;;AAEnC;;;;"}
@@ -152,6 +152,8 @@ export interface TransactionResult extends Record<string, any> {
152
152
  'payment-transaction'?: PaymentTransactionResult;
153
153
  /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */
154
154
  'state-proof-transaction'?: StateProofTransactionResult;
155
+ /** If the transaction is a `hb` transaction this will be populated see `tx-type` */
156
+ 'heartbeat-transaction'?: HeartbeatTransactionResult;
155
157
  /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.
156
158
  * The backend can use this to ensure that auth addr is equal to the accounts auth addr.
157
159
  */
@@ -392,6 +394,51 @@ export interface StateProofTransactionResult {
392
394
  */
393
395
  'state-proof-type': number;
394
396
  }
397
+ /** Fields for a `hb` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionheartbeat */
398
+ export interface HeartbeatTransactionResult {
399
+ /** [hbad] HbAddress is the account this txn is proving onlineness for. */
400
+ 'hb-address': string;
401
+ /** [hbkd] HbKeyDilution must match HbAddress account's current KeyDilution. */
402
+ 'hb-key-dilution': number;
403
+ /** [hbprf] HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. */
404
+ 'hb-proof': {
405
+ /** [p] Public key of the heartbeat message.
406
+ *
407
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
408
+ */
409
+ 'hb-pk'?: string;
410
+ /** [p1s] Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the key PK2.
411
+ *
412
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
413
+ */
414
+ 'hb-pk1sig'?: string;
415
+ /** [p2] Key for new-style two-level ephemeral signature.
416
+ *
417
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
418
+ */
419
+ 'hb-pk2'?: string;
420
+ /** [p2s] Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master key (OneTimeSignatureVerifier).
421
+ *
422
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
423
+ */
424
+ 'hb-pk2sig'?: string;
425
+ /** [s] Signature of the heartbeat message.
426
+ *
427
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
428
+ */
429
+ 'hb-sig'?: string;
430
+ };
431
+ /** [hbsd] HbSeed must be the block seed for the this transaction's firstValid block.
432
+ *
433
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
434
+ */
435
+ 'hb-seed': string;
436
+ /** [hbvid] HbVoteID must match the HbAddress account's current VoteID.
437
+ *
438
+ * *Pattern:* `"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\|[A-Za-z0-9+/]{3}=)?$"`
439
+ */
440
+ 'hb-vote-id': string;
441
+ }
395
442
  /**
396
443
  * Merkle array Proof.
397
444
  *
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.js","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":["ApplicationOnComplete","SignatureType","AccountStatus"],"mappings":";;AA+rBA;AACYA;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAPWA,6BAAqB,KAArBA,6BAAqB,GAOhC,EAAA,CAAA,CAAA;AA6ED;AACYC;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;AAED;AACYC;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"indexer.js","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** If the transaction is a `hb` transaction this will be populated see `tx-type` */\n 'heartbeat-transaction'?: HeartbeatTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/** Fields for a `hb` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionheartbeat */\nexport interface HeartbeatTransactionResult {\n /** [hbad] HbAddress is the account this txn is proving onlineness for. */\n 'hb-address': string\n /** [hbkd] HbKeyDilution must match HbAddress account's current KeyDilution. */\n 'hb-key-dilution': number\n /** [hbprf] HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. */\n 'hb-proof': {\n /** [p] Public key of the heartbeat message.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk'?: string\n /** [p1s] Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the key PK2.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk1sig'?: string\n /** [p2] Key for new-style two-level ephemeral signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk2'?: string\n /** [p2s] Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master key (OneTimeSignatureVerifier).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk2sig'?: string\n /** [s] Signature of the heartbeat message.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-sig'?: string\n }\n /** [hbsd] HbSeed must be the block seed for the this transaction's firstValid block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-seed': string\n /** [hbvid] HbVoteID must match the HbAddress account's current VoteID.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-vote-id': string\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":["ApplicationOnComplete","SignatureType","AccountStatus"],"mappings":";;AA+uBA;AACYA;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAPWA,6BAAqB,KAArBA,6BAAqB,GAOhC,EAAA,CAAA,CAAA;AA6ED;AACYC;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;AAED;AACYC;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.mjs","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":[],"mappings":"AA+rBA;IACY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,GAOhC,EAAA,CAAA,CAAA;AA6ED;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;AAED;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"indexer.mjs","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** If the transaction is a `hb` transaction this will be populated see `tx-type` */\n 'heartbeat-transaction'?: HeartbeatTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/** Fields for a `hb` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionheartbeat */\nexport interface HeartbeatTransactionResult {\n /** [hbad] HbAddress is the account this txn is proving onlineness for. */\n 'hb-address': string\n /** [hbkd] HbKeyDilution must match HbAddress account's current KeyDilution. */\n 'hb-key-dilution': number\n /** [hbprf] HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. */\n 'hb-proof': {\n /** [p] Public key of the heartbeat message.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk'?: string\n /** [p1s] Signature of OneTimeSignatureSubkeyOffsetID(PK, Batch, Offset) under the key PK2.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk1sig'?: string\n /** [p2] Key for new-style two-level ephemeral signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk2'?: string\n /** [p2s] Signature of OneTimeSignatureSubkeyBatchID(PK2, Batch) under the master key (OneTimeSignatureVerifier).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-pk2sig'?: string\n /** [s] Signature of the heartbeat message.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-sig'?: string\n }\n /** [hbsd] HbSeed must be the block seed for the this transaction's firstValid block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-seed': string\n /** [hbvid] HbVoteID must match the HbAddress account's current VoteID.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'hb-vote-id': string\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":[],"mappings":"AA+uBA;IACY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,GAOhC,EAAA,CAAA,CAAA;AA6ED;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;AAED;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
@@ -64,10 +64,12 @@ export interface AlgorandFixture {
64
64
  /**
65
65
  * Retrieve the current context.
66
66
  * Useful with destructuring.
67
+ *
68
+ * If you haven't called `newScope` then this will throw an error.
67
69
  * @example
68
70
  * ```typescript
69
71
  * test('My test', () => {
70
- * const {algod, indexer, testAccount, ...} = algorand.context
72
+ * const {algod, indexer, testAccount, ...} = fixture.context
71
73
  * })
72
74
  * ```
73
75
  */
@@ -77,9 +79,49 @@ export interface AlgorandFixture {
77
79
  */
78
80
  get algorand(): AlgorandClient;
79
81
  /**
80
- * Testing framework agnostic handler method to run before each test to prepare the `context` for that test.
82
+ * @deprecated Use newScope instead.
83
+ * Testing framework agnostic handler method to run before each test to prepare the `context` for that test with per test isolation.
81
84
  */
82
85
  beforeEach: () => Promise<void>;
86
+ /**
87
+ * Creates a new isolated fixture scope (clean transaction logger, AlgorandClient, testAccount, etc.).
88
+ *
89
+ * You can call this from any testing framework specific hook method to control when you want a new scope.
90
+ *
91
+ * @example Jest / vitest - per test isolation (beforeEach)
92
+ * ```typescript
93
+ * describe('MY MODULE', () => {
94
+ * const fixture = algorandFixture()
95
+ * beforeEach(fixture.newScope, 10_000) // Add a 10s timeout to cater for occasionally slow LocalNet calls
96
+ *
97
+ * test('MY TEST', async () => {
98
+ * const { algorand, testAccount } = fixture.context
99
+ *
100
+ * // Test stuff!
101
+ * })
102
+ * })
103
+ * ```
104
+ *
105
+ * @example Jest / vitest - test suite isolation (beforeAll)
106
+ * ```typescript
107
+ * describe('MY MODULE', () => {
108
+ * const fixture = algorandFixture()
109
+ * beforeAll(fixture.newScope, 10_000) // Add a 10s timeout to cater for occasionally slow LocalNet calls
110
+ *
111
+ * test('test1', async () => {
112
+ * const { algorand, testAccount } = fixture.context
113
+ *
114
+ * // Test stuff!
115
+ * })
116
+ * test('test2', async () => {
117
+ * const { algorand, testAccount } = fixture.context
118
+ * // algorand and testAccount are the same as in test1
119
+ * })
120
+ * })
121
+ * ```
122
+ *
123
+ */
124
+ newScope: () => Promise<void>;
83
125
  }
84
126
  /** Configuration for preparing a captured log snapshot.
85
127
  * This helps ensure that the provided configuration items won't appear