@algorandfoundation/algokit-utils 10.0.0-alpha.5 → 10.0.0-alpha.6
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/algod-client/index.d.ts +1 -4
- package/package.json +1 -1
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.d.ts +3 -5
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js +4 -6
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.js.map +1 -1
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs +3 -5
- package/packages/algod_client/src/models/simulate-unnamed-resources-accessed.mjs.map +1 -1
- package/packages/common/src/json.mjs +2 -2
- package/packages/common/src/json.mjs.map +1 -1
- package/packages/sdk/src/utils/utils.mjs +2 -2
- package/packages/sdk/src/utils/utils.mjs.map +1 -1
- package/packages/transact/src/multisig.d.ts +2 -2
- package/packages/transact/src/multisig.js +15 -15
- package/packages/transact/src/multisig.js.map +1 -1
- package/packages/transact/src/multisig.mjs +15 -15
- package/packages/transact/src/multisig.mjs.map +1 -1
- package/packages/transact/src/transactions/app-call.d.ts +8 -8
- package/packages/transact/src/transactions/app-call.js.map +1 -1
- package/packages/transact/src/transactions/app-call.mjs.map +1 -1
- package/packages/transact/src/transactions/reference-types-meta.d.ts +26 -0
- package/packages/transact/src/transactions/reference-types-meta.js +71 -0
- package/packages/transact/src/transactions/reference-types-meta.js.map +1 -0
- package/packages/transact/src/transactions/reference-types-meta.mjs +69 -0
- package/packages/transact/src/transactions/reference-types-meta.mjs.map +1 -0
- package/packages/transact/src/transactions/transaction-meta.js +22 -22
- package/packages/transact/src/transactions/transaction-meta.js.map +1 -1
- package/packages/transact/src/transactions/transaction-meta.mjs +22 -22
- package/packages/transact/src/transactions/transaction-meta.mjs.map +1 -1
- package/transact/index.d.ts +3 -2
- package/transact/index.js +4 -0
- package/transact/index.mjs +2 -1
- package/transactions/app-call.d.ts +2 -2
- package/transactions/app-call.js +15 -15
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs +15 -15
- package/transactions/app-call.mjs.map +1 -1
- package/transactions/asset-config.d.ts +1 -1
- package/transactions/asset-config.js +1 -1
- package/transactions/asset-config.js.map +1 -1
- package/transactions/asset-config.mjs +1 -1
- package/transactions/asset-config.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +80 -80
- package/types/algorand-client-transaction-sender.d.ts +83 -83
- package/types/app-client.d.ts +145 -145
- package/types/app-factory.d.ts +70 -70
- package/types/app-manager.js +5 -5
- package/types/app-manager.js.map +1 -1
- package/types/app-manager.mjs +5 -5
- package/types/app-manager.mjs.map +1 -1
- package/types/composer.js +3 -3
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +3 -3
- package/types/composer.mjs.map +1 -1
- package/packages/algod_client/src/models/application-local-reference.d.ts +0 -20
- package/packages/algod_client/src/models/application-local-reference.js +0 -23
- package/packages/algod_client/src/models/application-local-reference.js.map +0 -1
- package/packages/algod_client/src/models/application-local-reference.mjs +0 -23
- package/packages/algod_client/src/models/application-local-reference.mjs.map +0 -1
- package/packages/algod_client/src/models/asset-holding-reference.d.ts +0 -20
- package/packages/algod_client/src/models/asset-holding-reference.js +0 -23
- package/packages/algod_client/src/models/asset-holding-reference.js.map +0 -1
- package/packages/algod_client/src/models/asset-holding-reference.mjs +0 -23
- package/packages/algod_client/src/models/asset-holding-reference.mjs.map +0 -1
- package/packages/algod_client/src/models/box-reference.d.ts +0 -17
- package/packages/algod_client/src/models/box-reference.js +0 -23
- package/packages/algod_client/src/models/box-reference.js.map +0 -1
- package/packages/algod_client/src/models/box-reference.mjs +0 -23
- package/packages/algod_client/src/models/box-reference.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-meta.mjs","names":["transactionType: TransactionType","result: Record<string, unknown>","accessList: WireAccessReference[]","result: AccessReference[]","appId: bigint","PaymentTransactionFieldsMeta: ObjectModelMetadata<PaymentTransactionFields>","AssetTransferTransactionFieldsMeta: ObjectModelMetadata<AssetTransferTransactionFields>","AssetFreezeTransactionFieldsMeta: ObjectModelMetadata<AssetFreezeTransactionFields>","KeyRegistrationTransactionFieldsMeta: ObjectModelMetadata<KeyRegistrationTransactionFields>","AssetParamsMeta: ObjectModelMetadata<Omit<AssetConfigTransactionFields, 'assetId'>>","StateSchemaMeta: ObjectModelMetadata<StateSchema>","AppCallTransactionFieldsMeta: ObjectModelMetadata<AppCallTransactionFields>","MerkleArrayProofMeta: ObjectModelMetadata<MerkleArrayProof>","FalconVerifierMeta: ObjectModelMetadata<FalconVerifier>","SigslotCommitMeta: ObjectModelMetadata<SigslotCommit>","ParticipantMeta: ObjectModelMetadata<Participant>","RevealMeta: ObjectModelMetadata<Reveal>","StateProofMeta: ObjectModelMetadata<StateProof>","StateProofMessageMeta: ObjectModelMetadata<StateProofMessage>","StateProofTransactionFieldsMeta: ObjectModelMetadata<StateProofTransactionFields>","HeartbeatTransactionFieldsMeta: ObjectModelMetadata<HeartbeatTransactionFields>","TransactionParamsMeta: ObjectModelMetadata<TransactionParams>"],"sources":["../../../../../packages/transact/src/transactions/transaction-meta.ts"],"sourcesContent":["import type { EncodingFormat, ObjectModelMetadata, WireBigInt, WireObject, WireString } from '@algorandfoundation/algokit-common'\nimport {\n Address,\n Codec,\n MapCodec,\n ObjectModelCodec,\n addressArrayCodec,\n addressCodec,\n bigIntArrayCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes1793Codec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n normalizeWireObject,\n normalizeWireString,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { AccessReference, AppCallTransactionFields, BoxReference, StateSchema } from './app-call'\nimport { AssetConfigTransactionFields } from './asset-config'\nimport { AssetFreezeTransactionFields } from './asset-freeze'\nimport { AssetTransferTransactionFields } from './asset-transfer'\nimport { HeartbeatProof, HeartbeatTransactionFields } from './heartbeat'\nimport { KeyRegistrationTransactionFields } from './key-registration'\nimport { PaymentTransactionFields } from './payment'\nimport {\n FalconSignatureStruct,\n FalconVerifier,\n HashFactory,\n MerkleArrayProof,\n MerkleSignatureVerifier,\n Participant,\n Reveal,\n SigslotCommit,\n StateProof,\n StateProofMessage,\n StateProofTransactionFields,\n} from './state-proof'\nimport type { TransactionParams } from './transaction'\nimport { TransactionType } from './transaction-type'\n\ntype WireBoxReference = {\n /** App index (0 or index into access list) */\n i?: number\n /** Box name */\n n?: WireString\n}\n\ntype WireAccessReference = {\n /** Account address */\n d?: WireString\n\n /** App index */\n p?: WireBigInt\n\n /** Asset index */\n s?: WireBigInt\n\n /** Box reference */\n b?: WireBoxReference\n\n /** Holding reference (1-based indices into access list) */\n h?: {\n /** Address index */\n d?: number\n /** Asset index (1-based index into access list) */\n s?: number\n }\n\n /** Local state reference (1-based indices into access list) */\n l?: {\n /** Address index */\n d?: number\n /** App index (0 means current app, or 1-based index into access list) */\n p?: number\n }\n}\n\nclass TransactionTypeCodec extends Codec<TransactionType, string, WireString> {\n public defaultValue(): TransactionType {\n // This ensure that we never omit the transaction type, as a transaction should never be created with this value\n return TransactionType.Unknown\n }\n\n protected toEncoded(value: TransactionType, _format: EncodingFormat): string {\n switch (value) {\n case TransactionType.Payment:\n return 'pay'\n case TransactionType.AssetTransfer:\n return 'axfer'\n case TransactionType.AssetFreeze:\n return 'afrz'\n case TransactionType.AssetConfig:\n return 'acfg'\n case TransactionType.KeyRegistration:\n return 'keyreg'\n case TransactionType.AppCall:\n return 'appl'\n case TransactionType.StateProof:\n return 'stpf'\n case TransactionType.Heartbeat:\n return 'hb'\n default:\n return 'unknown'\n }\n }\n\n protected fromEncoded(value: WireString, _format: EncodingFormat): TransactionType {\n // Convert Uint8Array to string if needed (msgpack may return transaction type as bytes)\n const typeString = normalizeWireString(value)\n\n switch (typeString) {\n case 'pay':\n return TransactionType.Payment\n case 'axfer':\n return TransactionType.AssetTransfer\n case 'afrz':\n return TransactionType.AssetFreeze\n case 'acfg':\n return TransactionType.AssetConfig\n case 'keyreg':\n return TransactionType.KeyRegistration\n case 'appl':\n return TransactionType.AppCall\n case 'stpf':\n return TransactionType.StateProof\n case 'hb':\n return TransactionType.Heartbeat\n default:\n return TransactionType.Unknown\n }\n }\n}\n\nclass TransactionDataCodec<\n T extends\n | PaymentTransactionFields\n | AssetTransferTransactionFields\n | AssetFreezeTransactionFields\n | KeyRegistrationTransactionFields\n | StateProofTransactionFields,\n> extends Codec<T | undefined, Record<string, unknown>> {\n private transactionDataCodec: ObjectModelCodec<T>\n\n constructor(\n private readonly transactionType: TransactionType,\n transactionTypeDataMetadata: ObjectModelMetadata<T>,\n ) {\n super()\n this.transactionDataCodec = new ObjectModelCodec<T>(transactionTypeDataMetadata)\n }\n\n public defaultValue(): T | undefined {\n return undefined\n }\n\n protected toEncoded(value: T | undefined, format: EncodingFormat): Record<string, unknown> {\n if (!value) {\n throw new Error('Transaction data is missing')\n }\n return this.transactionDataCodec.encode(value, format)\n }\n\n protected fromEncoded(value: Record<string, unknown>, format: EncodingFormat): T | undefined {\n if (value.type === undefined) {\n throw new Error('Transaction is missing type field')\n }\n const type = normalizeWireString(value.type as WireString)\n if (type === this.transactionType.toString()) {\n return this.transactionDataCodec.decode(value, format)\n }\n\n return undefined\n }\n}\n\nclass AssetConfigDataCodec extends Codec<AssetConfigTransactionFields | undefined, Record<string, unknown>> {\n private assetParamsCodec = new ObjectModelCodec<Omit<AssetConfigTransactionFields, 'assetId'>>(AssetParamsMeta)\n\n public defaultValue(): AssetConfigTransactionFields | undefined {\n return undefined\n }\n\n protected toEncoded(value: AssetConfigTransactionFields | undefined, format: EncodingFormat): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n\n if (!value) {\n throw new Error('Transaction is not an asset config')\n }\n\n const { assetId, ...assetParams } = value\n\n const encodedAssetId = bigIntCodec.encodeOptional(assetId, format)\n if (encodedAssetId !== undefined) {\n result.caid = encodedAssetId\n }\n\n const encodedParams = this.assetParamsCodec.encodeOptional(assetParams, format)\n if (encodedParams && Object.keys(encodedParams).length > 0) {\n result.apar = encodedParams\n }\n\n return result\n }\n\n protected fromEncoded(value: Record<string, unknown>, format: EncodingFormat): AssetConfigTransactionFields | undefined {\n if (value.type === undefined) {\n throw new Error('Transaction is missing type field')\n }\n const type = normalizeWireString(value.type as WireString)\n const caid = value.caid as WireBigInt | undefined\n const apar = value.apar as WireObject | undefined\n\n if (type !== TransactionType.AssetConfig || (caid === undefined && !apar)) {\n return undefined\n }\n\n return {\n assetId: bigIntCodec.decode(caid, format),\n ...this.assetParamsCodec.decode(apar, format),\n } satisfies AssetConfigTransactionFields\n }\n\n public isDefaultValue(value: AssetConfigTransactionFields | undefined): boolean {\n return value === undefined\n }\n}\n\nclass AppCallDataCodec extends Codec<AppCallTransactionFields | undefined, Record<string, unknown>> {\n private appCallFieldsCodec = new ObjectModelCodec<Omit<AppCallTransactionFields, 'accessReferences' | 'boxReferences'>>(\n AppCallTransactionFieldsMeta,\n )\n\n public defaultValue(): AppCallTransactionFields | undefined {\n return undefined\n }\n\n private encodeAccessReferences(\n appId: bigint,\n accessReferences: AccessReference[] | undefined,\n format: EncodingFormat,\n ): WireAccessReference[] | undefined {\n if (!accessReferences || accessReferences.length === 0) return undefined\n\n const accessList: WireAccessReference[] = []\n\n // Helper to find or add a simple reference and return its 1-based index\n const ensure = (target: Pick<AccessReference, 'address' | 'assetId' | 'appId'>): number => {\n // Search for existing entry\n for (let idx = 0; idx < accessList.length; idx++) {\n const entry = accessList[idx]\n const matchesAddress =\n (!entry.d && !target.address) || (entry.d && target.address && addressCodec.decode(entry.d, format).equals(target.address))\n const matchesAssetId =\n (entry.s === undefined && target.assetId === undefined) ||\n (entry.s !== undefined && target.assetId !== undefined && bigIntCodec.decode(entry.s, format) === target.assetId)\n const matchesAppId =\n (entry.p === undefined && target.appId === undefined) ||\n (entry.p !== undefined && target.appId !== undefined && bigIntCodec.decode(entry.p, format) === target.appId)\n\n if (matchesAddress && matchesAssetId && matchesAppId) {\n return idx + 1 // Return 1-based index\n }\n }\n\n // Add new entries for each field\n if (target.address && !target.address.equals(Address.zeroAddress())) {\n accessList.push({ d: addressCodec.encodeOptional(target.address, format)! })\n }\n if (target.assetId !== undefined) {\n accessList.push({ s: bigIntCodec.encodeOptional(target.assetId, format)! })\n }\n if (target.appId !== undefined) {\n accessList.push({ p: bigIntCodec.encodeOptional(target.appId, format)! })\n }\n\n return accessList.length // Return 1-based index of last added\n }\n\n // Process each access reference\n for (const accessRef of accessReferences) {\n // Simple references (address, assetId, or appId)\n if (accessRef.address || accessRef.assetId !== undefined || accessRef.appId !== undefined) {\n ensure(accessRef)\n continue\n }\n\n // Holding reference\n if (accessRef.holding) {\n const holding = accessRef.holding\n let addressIndex = 0\n if (holding.address && !holding.address.equals(Address.zeroAddress())) {\n addressIndex = ensure({ address: holding.address })\n }\n const assetIndex = ensure({ assetId: holding.assetId })\n accessList.push({\n h: {\n d: numberCodec.encodeOptional(addressIndex, format),\n s: numberCodec.encodeOptional(assetIndex, format),\n },\n })\n continue\n }\n\n // Locals reference\n if (accessRef.locals) {\n const locals = accessRef.locals\n let addressIndex = 0\n if (locals.address && !locals.address.equals(Address.zeroAddress())) {\n addressIndex = ensure({ address: locals.address })\n }\n\n let appIndex = 0\n if (locals.appId && locals.appId !== appId) {\n appIndex = ensure({ appId: locals.appId })\n }\n if (addressIndex !== 0 || appIndex !== 0) {\n accessList.push({\n l: {\n d: numberCodec.encodeOptional(addressIndex, format),\n p: numberCodec.encodeOptional(appIndex, format),\n },\n })\n }\n continue\n }\n\n // Box reference\n if (accessRef.box) {\n const box = accessRef.box\n // Only add appId to access list if it's different from the calling app's ID\n // Use appIndex = 0 when box is for the current app\n let appIndex = 0\n if (box.appId && box.appId !== appId) {\n appIndex = ensure({ appId: box.appId })\n }\n accessList.push({\n b: {\n i: numberCodec.encodeOptional(appIndex, format),\n n: bytesCodec.encodeOptional(box.name, format),\n },\n })\n continue\n }\n }\n\n return accessList.length > 0 ? accessList : undefined\n }\n\n private decodeAccessReferences(_wireAccessReferences: WireAccessReference[] | undefined, format: EncodingFormat): AccessReference[] {\n if (!_wireAccessReferences || _wireAccessReferences.length === 0) return []\n\n const result: AccessReference[] = []\n\n // Process each entry in the access list\n\n const wireAccessReferences = _wireAccessReferences.map((ref) => normalizeWireObject(ref))\n for (const ref of wireAccessReferences) {\n const d = ref.d as WireString | undefined\n const s = ref.s as WireBigInt | undefined\n const p = ref.p as WireBigInt | undefined\n const _h = ref.h as WireObject | undefined\n const h = _h ? normalizeWireObject(_h) : undefined\n const _l = ref.l as WireObject | undefined\n const l = _l ? normalizeWireObject(_l) : undefined\n const _b = ref.b as WireObject | undefined\n const b = _b ? normalizeWireObject(_b) : undefined\n\n // Simple address reference\n if (d) {\n result.push({ address: addressCodec.decode(d, format) })\n continue\n }\n\n // Simple asset ID reference\n if (s !== undefined) {\n result.push({ assetId: bigIntCodec.decode(s, format) })\n continue\n }\n\n // Simple app ID reference\n if (p !== undefined) {\n result.push({ appId: bigIntCodec.decode(p, format) })\n continue\n }\n\n // Holding reference (h)\n if (h) {\n const addrIdx = (h.d ?? 0) as number\n const assetIdx = h.s as number | undefined\n\n if (assetIdx === undefined) {\n throw new Error('Access list holding reference is missing asset index')\n }\n\n const holdingAddress =\n addrIdx === 0 ? Address.zeroAddress() : addressCodec.decode(wireAccessReferences[addrIdx - 1].d! as WireString, format)\n const holdingAssetId = wireAccessReferences[assetIdx - 1].s! as WireBigInt\n\n result.push({\n holding: {\n assetId: bigIntCodec.decode(holdingAssetId, format),\n address: holdingAddress,\n },\n })\n continue\n }\n\n // Locals reference (l)\n if (l) {\n const addrIdx = (l.d ?? 0) as number\n const appIdx = (l.p ?? 0) as number\n\n const localsAddress =\n addrIdx === 0 ? Address.zeroAddress() : addressCodec.decode(wireAccessReferences[addrIdx - 1].d! as WireString, format)\n const localsAppId = appIdx === 0 ? 0n : (wireAccessReferences[appIdx - 1].p! as WireBigInt)\n\n result.push({\n locals: {\n appId: bigIntCodec.decode(localsAppId, format),\n address: localsAddress,\n },\n })\n continue\n }\n\n // Box reference (b)\n if (b) {\n const boxAppIdx = (b.i ?? 0) as number\n const name = b.n as WireString | undefined\n\n if (!name) {\n throw new Error('Access list box reference is missing name')\n }\n\n const boxAppId = boxAppIdx === 0 ? 0n : (wireAccessReferences[boxAppIdx - 1].p! as WireBigInt)\n\n result.push({\n box: {\n appId: bigIntCodec.decode(boxAppId, format),\n name: bytesCodec.decode(name, format),\n },\n })\n continue\n }\n }\n\n return result\n }\n\n private encodeBoxReferences(\n appId: bigint,\n appReferences: bigint[] | undefined,\n boxReferences: BoxReference[] | undefined,\n format: EncodingFormat,\n ): WireBoxReference[] | undefined {\n if (!boxReferences || boxReferences.length === 0) return undefined\n\n const appRefs = appReferences ?? []\n\n return boxReferences.map((box) => {\n const isCurrentApp = box.appId === 0n || box.appId === appId\n // Index 0 means current app, index > 0 references foreign apps array (1-indexed)\n const index = isCurrentApp ? 0 : appRefs.indexOf(box.appId) + 1\n\n if (index === 0 && !isCurrentApp) {\n throw new Error(`Box ref with appId ${box.appId} not in appReferences`)\n }\n\n return {\n i: numberCodec.encodeOptional(index, format), // This returns undefined when index is 0, which omits the field\n n: bytesCodec.encodeOptional(box.name, format),\n }\n })\n }\n\n private decodeBoxReferences(\n appReferences: bigint[] | undefined,\n wireBoxReferences: WireBoxReference[] | undefined,\n format: EncodingFormat,\n ): BoxReference[] {\n if (!wireBoxReferences || wireBoxReferences.length === 0) return []\n\n return wireBoxReferences.map((_box) => {\n const box = normalizeWireObject(_box)\n const boxIndex = box.i as number | undefined\n const boxName = box.n as WireString | undefined\n\n const index = boxIndex ?? 0\n\n let appId: bigint\n if (index === 0) {\n // 0 means current app\n appId = 0n\n } else {\n // 1-based index into foreignApps array\n const foreignAppId = appReferences?.[index - 1]\n if (foreignAppId === undefined) {\n throw new Error(`Failed to find the app reference at index ${index - 1}`)\n }\n appId = bigIntCodec.decode(foreignAppId, format)\n }\n\n return {\n appId,\n name: bytesCodec.decode(boxName, format),\n }\n })\n }\n\n protected toEncoded(value: AppCallTransactionFields | undefined, format: EncodingFormat): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n\n if (!value) {\n throw new Error('Transaction is not an app call')\n }\n\n const encodedParams = this.appCallFieldsCodec.encodeOptional(value, format)\n if (encodedParams && Object.keys(encodedParams).length > 0) {\n Object.assign(result, encodedParams)\n }\n\n const wireBoxReferences = this.encodeBoxReferences(value.appId, value.appReferences, value.boxReferences, format)\n if (wireBoxReferences) {\n result.apbx = wireBoxReferences\n }\n\n const wireAccessReferences = this.encodeAccessReferences(value.appId, value.accessReferences, format)\n if (wireAccessReferences) {\n result.al = wireAccessReferences\n }\n\n return result\n }\n\n protected fromEncoded(value: Record<string, unknown>, format: EncodingFormat): AppCallTransactionFields | undefined {\n if (value.type === undefined) {\n throw new Error('Transaction is missing type field')\n }\n const type = normalizeWireString(value.type as WireString)\n if (type !== TransactionType.AppCall) {\n return undefined\n }\n\n const appReferences = value.apfa as WireBigInt[] | undefined\n const wireBoxReferences = value.apbx as WireBoxReference[] | undefined\n const wireAccessReferences = value.al as WireAccessReference[] | undefined\n const boxReferences = this.decodeBoxReferences(\n appReferences?.map((ar) => bigIntCodec.decode(ar, format)),\n wireBoxReferences,\n format,\n )\n const accessReferences = this.decodeAccessReferences(wireAccessReferences, format)\n\n return {\n ...this.appCallFieldsCodec.decode(value, format),\n ...(accessReferences.length > 0 && { accessReferences }),\n ...(boxReferences.length > 0 && { boxReferences }),\n } satisfies AppCallTransactionFields\n }\n\n public isDefaultValue(value: AppCallTransactionFields | undefined): boolean {\n return value === undefined\n }\n}\n\nconst PaymentTransactionFieldsMeta: ObjectModelMetadata<PaymentTransactionFields> = {\n name: 'PaymentTransactionFields',\n kind: 'object',\n fields: [\n { name: 'amount', wireKey: 'amt', optional: false, codec: bigIntCodec },\n { name: 'receiver', wireKey: 'rcv', optional: false, codec: addressCodec },\n { name: 'closeRemainderTo', wireKey: 'close', optional: true, codec: addressCodec },\n ],\n}\n\nconst AssetTransferTransactionFieldsMeta: ObjectModelMetadata<AssetTransferTransactionFields> = {\n name: 'AssetTransferTransactionFields',\n kind: 'object',\n fields: [\n { name: 'assetId', wireKey: 'xaid', optional: false, codec: bigIntCodec },\n { name: 'amount', wireKey: 'aamt', optional: false, codec: bigIntCodec },\n { name: 'receiver', wireKey: 'arcv', optional: false, codec: addressCodec },\n { name: 'assetSender', wireKey: 'asnd', optional: true, codec: addressCodec },\n { name: 'closeRemainderTo', wireKey: 'aclose', optional: true, codec: addressCodec },\n ],\n}\n\nconst AssetFreezeTransactionFieldsMeta: ObjectModelMetadata<AssetFreezeTransactionFields> = {\n name: 'AssetFreezeTransactionFields',\n kind: 'object',\n fields: [\n { name: 'assetId', wireKey: 'faid', optional: false, codec: bigIntCodec },\n { name: 'freezeTarget', wireKey: 'fadd', optional: false, codec: addressCodec },\n { name: 'frozen', wireKey: 'afrz', optional: false, codec: booleanCodec },\n ],\n}\n\nconst KeyRegistrationTransactionFieldsMeta: ObjectModelMetadata<KeyRegistrationTransactionFields> = {\n name: 'KeyRegistrationTransactionFields',\n kind: 'object',\n fields: [\n { name: 'voteKey', wireKey: 'votekey', optional: true, codec: fixedBytes32Codec },\n { name: 'selectionKey', wireKey: 'selkey', optional: true, codec: fixedBytes32Codec },\n { name: 'stateProofKey', wireKey: 'sprfkey', optional: true, codec: fixedBytes64Codec },\n { name: 'voteFirst', wireKey: 'votefst', optional: true, codec: bigIntCodec },\n { name: 'voteLast', wireKey: 'votelst', optional: true, codec: bigIntCodec },\n { name: 'voteKeyDilution', wireKey: 'votekd', optional: true, codec: bigIntCodec },\n { name: 'nonParticipation', wireKey: 'nonpart', optional: true, codec: booleanCodec },\n ],\n}\n\nconst AssetParamsMeta: ObjectModelMetadata<Omit<AssetConfigTransactionFields, 'assetId'>> = {\n name: 'AssetParams',\n kind: 'object',\n fields: [\n { name: 'total', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'decimals', wireKey: 'dc', optional: true, codec: numberCodec },\n { name: 'defaultFrozen', wireKey: 'df', optional: true, codec: booleanCodec },\n { name: 'unitName', wireKey: 'un', optional: true, codec: stringCodec },\n { name: 'assetName', wireKey: 'an', optional: true, codec: stringCodec },\n { name: 'url', wireKey: 'au', optional: true, codec: stringCodec },\n { name: 'metadataHash', wireKey: 'am', optional: true, codec: fixedBytes32Codec },\n { name: 'manager', wireKey: 'm', optional: true, codec: addressCodec },\n { name: 'reserve', wireKey: 'r', optional: true, codec: addressCodec },\n { name: 'freeze', wireKey: 'f', optional: true, codec: addressCodec },\n { name: 'clawback', wireKey: 'c', optional: true, codec: addressCodec },\n ],\n}\n\nconst StateSchemaMeta: ObjectModelMetadata<StateSchema> = {\n name: 'StateSchema',\n kind: 'object',\n fields: [\n { name: 'numUints', wireKey: 'nui', optional: false, codec: numberCodec },\n { name: 'numByteSlices', wireKey: 'nbs', optional: false, codec: numberCodec },\n ],\n}\n\nconst AppCallTransactionFieldsMeta: ObjectModelMetadata<AppCallTransactionFields> = {\n name: 'AppCallTransactionFields',\n kind: 'object',\n fields: [\n { name: 'appId', wireKey: 'apid', optional: false, codec: bigIntCodec },\n { name: 'onComplete', wireKey: 'apan', optional: false, codec: numberCodec },\n { name: 'approvalProgram', wireKey: 'apap', optional: true, codec: bytesCodec },\n { name: 'clearStateProgram', wireKey: 'apsu', optional: true, codec: bytesCodec },\n {\n name: 'globalStateSchema',\n wireKey: 'apgs',\n optional: true,\n codec: new ObjectModelCodec(StateSchemaMeta),\n },\n {\n name: 'localStateSchema',\n wireKey: 'apls',\n optional: true,\n codec: new ObjectModelCodec(StateSchemaMeta),\n },\n { name: 'extraProgramPages', wireKey: 'apep', optional: true, codec: numberCodec },\n { name: 'args', wireKey: 'apaa', optional: true, codec: bytesArrayCodec },\n { name: 'accountReferences', wireKey: 'apat', optional: true, codec: addressArrayCodec },\n { name: 'appReferences', wireKey: 'apfa', optional: true, codec: bigIntArrayCodec },\n { name: 'assetReferences', wireKey: 'apas', optional: true, codec: bigIntArrayCodec },\n // boxReferences and accessReferences are handled by the parent codec, as they require more complex mappings\n ],\n}\n\nconst HashFactoryMeta: ObjectModelMetadata<HashFactory> = {\n name: 'HashFactory',\n kind: 'object',\n fields: [{ name: 'hashType', wireKey: 't', optional: false, codec: numberCodec }],\n}\n\nconst MerkleArrayProofMeta: ObjectModelMetadata<MerkleArrayProof> = {\n name: 'MerkleArrayProof',\n kind: 'object',\n fields: [\n { name: 'path', wireKey: 'pth', optional: false, codec: bytesArrayCodec },\n { name: 'hashFactory', wireKey: 'hsh', optional: false, codec: new ObjectModelCodec(HashFactoryMeta) },\n { name: 'treeDepth', wireKey: 'td', optional: false, codec: numberCodec },\n ],\n}\n\nconst FalconVerifierMeta: ObjectModelMetadata<FalconVerifier> = {\n name: 'FalconVerifier',\n kind: 'object',\n fields: [{ name: 'publicKey', wireKey: 'k', optional: false, codec: fixedBytes1793Codec }],\n}\n\nconst FalconSignatureStructMeta: ObjectModelMetadata<FalconSignatureStruct> = {\n name: 'FalconSignatureStruct',\n kind: 'object',\n fields: [\n { name: 'signature', wireKey: 'sig', optional: false, codec: bytesCodec },\n { name: 'vectorCommitmentIndex', wireKey: 'idx', optional: false, codec: bigIntCodec },\n { name: 'proof', wireKey: 'prf', optional: false, codec: new ObjectModelCodec(MerkleArrayProofMeta) },\n { name: 'verifyingKey', wireKey: 'vkey', optional: false, codec: new ObjectModelCodec(FalconVerifierMeta) },\n ],\n}\n\nconst SigslotCommitMeta: ObjectModelMetadata<SigslotCommit> = {\n name: 'SigslotCommit',\n kind: 'object',\n fields: [\n { name: 'sig', wireKey: 's', optional: false, codec: new ObjectModelCodec(FalconSignatureStructMeta) },\n { name: 'lowerSigWeight', wireKey: 'l', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst MerkleSignatureVerifierMeta: ObjectModelMetadata<MerkleSignatureVerifier> = {\n name: 'MerkleSignatureVerifier',\n kind: 'object',\n fields: [\n { name: 'commitment', wireKey: 'cmt', optional: false, codec: fixedBytes64Codec },\n { name: 'keyLifetime', wireKey: 'lf', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst ParticipantMeta: ObjectModelMetadata<Participant> = {\n name: 'Participant',\n kind: 'object',\n fields: [\n { name: 'verifier', wireKey: 'p', optional: false, codec: new ObjectModelCodec(MerkleSignatureVerifierMeta) },\n { name: 'weight', wireKey: 'w', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst RevealMeta: ObjectModelMetadata<Reveal> = {\n name: 'Reveal',\n kind: 'object',\n fields: [\n { name: 'sigslot', wireKey: 's', optional: false, codec: new ObjectModelCodec(SigslotCommitMeta) },\n { name: 'participant', wireKey: 'p', optional: false, codec: new ObjectModelCodec(ParticipantMeta) },\n ],\n}\n\nconst StateProofMeta: ObjectModelMetadata<StateProof> = {\n name: 'StateProof',\n kind: 'object',\n fields: [\n { name: 'sigCommit', wireKey: 'c', optional: false, codec: bytesCodec },\n { name: 'signedWeight', wireKey: 'w', optional: false, codec: bigIntCodec },\n { name: 'sigProofs', wireKey: 'S', optional: false, codec: new ObjectModelCodec(MerkleArrayProofMeta) },\n { name: 'partProofs', wireKey: 'P', optional: false, codec: new ObjectModelCodec(MerkleArrayProofMeta) },\n { name: 'merkleSignatureSaltVersion', wireKey: 'v', optional: false, codec: numberCodec },\n {\n name: 'reveals',\n wireKey: 'r',\n optional: false,\n codec: new MapCodec(bigIntCodec, new ObjectModelCodec(RevealMeta)),\n },\n { name: 'positionsToReveal', wireKey: 'pr', optional: false, codec: bigIntArrayCodec },\n ],\n}\n\nconst StateProofMessageMeta: ObjectModelMetadata<StateProofMessage> = {\n name: 'StateProofMessage',\n kind: 'object',\n fields: [\n { name: 'blockHeadersCommitment', wireKey: 'b', optional: false, codec: bytesCodec },\n { name: 'votersCommitment', wireKey: 'v', optional: false, codec: bytesCodec },\n { name: 'lnProvenWeight', wireKey: 'P', optional: false, codec: bigIntCodec },\n { name: 'firstAttestedRound', wireKey: 'f', optional: false, codec: bigIntCodec },\n { name: 'lastAttestedRound', wireKey: 'l', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst StateProofTransactionFieldsMeta: ObjectModelMetadata<StateProofTransactionFields> = {\n name: 'StateProofTransactionFields',\n kind: 'object',\n fields: [\n { name: 'stateProofType', wireKey: 'sptype', optional: false, codec: numberCodec },\n { name: 'stateProof', wireKey: 'sp', optional: true, codec: new ObjectModelCodec(StateProofMeta) },\n { name: 'message', wireKey: 'spmsg', optional: true, codec: new ObjectModelCodec(StateProofMessageMeta) },\n ],\n}\n\nconst HeartbeatProofMeta: ObjectModelMetadata<HeartbeatProof> = {\n name: 'HeartbeatProof',\n kind: 'object',\n fields: [\n { name: 'sig', wireKey: 's', optional: false, codec: fixedBytes64Codec },\n { name: 'pk', wireKey: 'p', optional: false, codec: fixedBytes32Codec },\n { name: 'pk2', wireKey: 'p2', optional: false, codec: fixedBytes32Codec },\n { name: 'pk1Sig', wireKey: 'p1s', optional: false, codec: fixedBytes64Codec },\n { name: 'pk2Sig', wireKey: 'p2s', optional: false, codec: fixedBytes64Codec },\n ],\n}\n\nconst HeartbeatTransactionFieldsMeta: ObjectModelMetadata<HeartbeatTransactionFields> = {\n name: 'HeartbeatTransactionFields',\n kind: 'object',\n fields: [\n { name: 'address', wireKey: 'a', optional: false, codec: addressCodec },\n { name: 'proof', wireKey: 'prf', optional: false, codec: new ObjectModelCodec(HeartbeatProofMeta) },\n { name: 'seed', wireKey: 'sd', optional: false, codec: bytesCodec },\n { name: 'voteId', wireKey: 'vid', optional: false, codec: fixedBytes32Codec },\n { name: 'keyDilution', wireKey: 'kd', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Metadata for TransactionParams\n */\nexport const TransactionParamsMeta: ObjectModelMetadata<TransactionParams> = {\n name: 'TransactionParams',\n kind: 'object',\n fields: [\n // Common transaction fields\n { name: 'type', wireKey: 'type', optional: false, codec: new TransactionTypeCodec() },\n { name: 'sender', wireKey: 'snd', optional: false, codec: addressCodec },\n { name: 'fee', wireKey: 'fee', optional: true, codec: bigIntCodec },\n { name: 'firstValid', wireKey: 'fv', optional: false, codec: bigIntCodec },\n { name: 'lastValid', wireKey: 'lv', optional: false, codec: bigIntCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: true, codec: fixedBytes32Codec },\n { name: 'genesisId', wireKey: 'gen', optional: true, codec: stringCodec },\n { name: 'note', wireKey: 'note', optional: true, codec: bytesCodec },\n { name: 'rekeyTo', wireKey: 'rekey', optional: true, codec: addressCodec },\n { name: 'lease', wireKey: 'lx', optional: true, codec: fixedBytes32Codec },\n { name: 'group', wireKey: 'grp', optional: true, codec: fixedBytes32Codec },\n // Transaction type-specific fields (flattened)\n {\n name: 'payment',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.Payment, PaymentTransactionFieldsMeta),\n },\n {\n name: 'assetTransfer',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.AssetTransfer, AssetTransferTransactionFieldsMeta),\n },\n {\n name: 'assetFreeze',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.AssetFreeze, AssetFreezeTransactionFieldsMeta),\n },\n {\n name: 'keyRegistration',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.KeyRegistration, KeyRegistrationTransactionFieldsMeta),\n },\n {\n name: 'assetConfig',\n flattened: true,\n optional: true,\n codec: new AssetConfigDataCodec(),\n },\n {\n name: 'heartbeat',\n wireKey: 'hb',\n optional: true,\n // Heartbeat is not flattened and therefore does not need the type check for conditional decoding\n codec: new ObjectModelCodec(HeartbeatTransactionFieldsMeta),\n },\n {\n name: 'appCall',\n flattened: true,\n optional: true,\n codec: new AppCallDataCodec(),\n },\n {\n name: 'stateProof',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.StateProof, StateProofTransactionFieldsMeta),\n },\n ],\n}\n\nexport const transactionParamsCodec = new ObjectModelCodec<TransactionParams>(TransactionParamsMeta)\n"],"mappings":";;;;;;;;;;;;;;;;AAiFA,IAAM,uBAAN,cAAmC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;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,iBAAiB,qCAAqC;GACvG;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,sBAAsB;GAClC;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GAEV,OAAO,IAAI,iBAAiB,+BAA+B;GAC5D;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,kBAAkB;GAC9B;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,YAAY,gCAAgC;GAC7F;EACF;CACF;AAED,MAAa,yBAAyB,IAAI,iBAAoC,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"transaction-meta.mjs","names":["transactionType: TransactionType","result: Record<string, unknown>","accessList: WireResourceReference[]","result: ResourceReference[]","appId: bigint","PaymentTransactionFieldsMeta: ObjectModelMetadata<PaymentTransactionFields>","AssetTransferTransactionFieldsMeta: ObjectModelMetadata<AssetTransferTransactionFields>","AssetFreezeTransactionFieldsMeta: ObjectModelMetadata<AssetFreezeTransactionFields>","KeyRegistrationTransactionFieldsMeta: ObjectModelMetadata<KeyRegistrationTransactionFields>","AssetParamsMeta: ObjectModelMetadata<Omit<AssetConfigTransactionFields, 'assetId'>>","StateSchemaMeta: ObjectModelMetadata<StateSchema>","AppCallTransactionFieldsMeta: ObjectModelMetadata<AppCallTransactionFields>","MerkleArrayProofMeta: ObjectModelMetadata<MerkleArrayProof>","FalconVerifierMeta: ObjectModelMetadata<FalconVerifier>","SigslotCommitMeta: ObjectModelMetadata<SigslotCommit>","ParticipantMeta: ObjectModelMetadata<Participant>","RevealMeta: ObjectModelMetadata<Reveal>","StateProofMeta: ObjectModelMetadata<StateProof>","StateProofMessageMeta: ObjectModelMetadata<StateProofMessage>","StateProofTransactionFieldsMeta: ObjectModelMetadata<StateProofTransactionFields>","HeartbeatTransactionFieldsMeta: ObjectModelMetadata<HeartbeatTransactionFields>","TransactionParamsMeta: ObjectModelMetadata<TransactionParams>"],"sources":["../../../../../packages/transact/src/transactions/transaction-meta.ts"],"sourcesContent":["import type { EncodingFormat, ObjectModelMetadata, WireBigInt, WireObject, WireString } from '@algorandfoundation/algokit-common'\nimport {\n Address,\n Codec,\n MapCodec,\n ObjectModelCodec,\n addressArrayCodec,\n addressCodec,\n bigIntArrayCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes1793Codec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n normalizeWireObject,\n normalizeWireString,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { AppCallTransactionFields, BoxReference, ResourceReference, StateSchema } from './app-call'\nimport { AssetConfigTransactionFields } from './asset-config'\nimport { AssetFreezeTransactionFields } from './asset-freeze'\nimport { AssetTransferTransactionFields } from './asset-transfer'\nimport { HeartbeatProof, HeartbeatTransactionFields } from './heartbeat'\nimport { KeyRegistrationTransactionFields } from './key-registration'\nimport { PaymentTransactionFields } from './payment'\nimport {\n FalconSignatureStruct,\n FalconVerifier,\n HashFactory,\n MerkleArrayProof,\n MerkleSignatureVerifier,\n Participant,\n Reveal,\n SigslotCommit,\n StateProof,\n StateProofMessage,\n StateProofTransactionFields,\n} from './state-proof'\nimport type { TransactionParams } from './transaction'\nimport { TransactionType } from './transaction-type'\n\ntype WireBoxReference = {\n /** App index (0 or index into access list) */\n i?: number\n /** Box name */\n n?: WireString\n}\n\ntype WireResourceReference = {\n /** Account address */\n d?: WireString\n\n /** App index */\n p?: WireBigInt\n\n /** Asset index */\n s?: WireBigInt\n\n /** Box reference */\n b?: WireBoxReference\n\n /** Holding reference (1-based indices into access list) */\n h?: {\n /** Address index */\n d?: number\n /** Asset index (1-based index into access list) */\n s?: number\n }\n\n /** Local state reference (1-based indices into access list) */\n l?: {\n /** Address index */\n d?: number\n /** App index (0 means current app, or 1-based index into access list) */\n p?: number\n }\n}\n\nclass TransactionTypeCodec extends Codec<TransactionType, string, WireString> {\n public defaultValue(): TransactionType {\n // This ensure that we never omit the transaction type, as a transaction should never be created with this value\n return TransactionType.Unknown\n }\n\n protected toEncoded(value: TransactionType, _format: EncodingFormat): string {\n switch (value) {\n case TransactionType.Payment:\n return 'pay'\n case TransactionType.AssetTransfer:\n return 'axfer'\n case TransactionType.AssetFreeze:\n return 'afrz'\n case TransactionType.AssetConfig:\n return 'acfg'\n case TransactionType.KeyRegistration:\n return 'keyreg'\n case TransactionType.AppCall:\n return 'appl'\n case TransactionType.StateProof:\n return 'stpf'\n case TransactionType.Heartbeat:\n return 'hb'\n default:\n return 'unknown'\n }\n }\n\n protected fromEncoded(value: WireString, _format: EncodingFormat): TransactionType {\n // Convert Uint8Array to string if needed (msgpack may return transaction type as bytes)\n const typeString = normalizeWireString(value)\n\n switch (typeString) {\n case 'pay':\n return TransactionType.Payment\n case 'axfer':\n return TransactionType.AssetTransfer\n case 'afrz':\n return TransactionType.AssetFreeze\n case 'acfg':\n return TransactionType.AssetConfig\n case 'keyreg':\n return TransactionType.KeyRegistration\n case 'appl':\n return TransactionType.AppCall\n case 'stpf':\n return TransactionType.StateProof\n case 'hb':\n return TransactionType.Heartbeat\n default:\n return TransactionType.Unknown\n }\n }\n}\n\nclass TransactionDataCodec<\n T extends\n | PaymentTransactionFields\n | AssetTransferTransactionFields\n | AssetFreezeTransactionFields\n | KeyRegistrationTransactionFields\n | StateProofTransactionFields,\n> extends Codec<T | undefined, Record<string, unknown>> {\n private transactionDataCodec: ObjectModelCodec<T>\n\n constructor(\n private readonly transactionType: TransactionType,\n transactionTypeDataMetadata: ObjectModelMetadata<T>,\n ) {\n super()\n this.transactionDataCodec = new ObjectModelCodec<T>(transactionTypeDataMetadata)\n }\n\n public defaultValue(): T | undefined {\n return undefined\n }\n\n protected toEncoded(value: T | undefined, format: EncodingFormat): Record<string, unknown> {\n if (!value) {\n throw new Error('Transaction data is missing')\n }\n return this.transactionDataCodec.encode(value, format)\n }\n\n protected fromEncoded(value: Record<string, unknown>, format: EncodingFormat): T | undefined {\n if (value.type === undefined) {\n throw new Error('Transaction is missing type field')\n }\n const type = normalizeWireString(value.type as WireString)\n if (type === this.transactionType.toString()) {\n return this.transactionDataCodec.decode(value, format)\n }\n\n return undefined\n }\n}\n\nclass AssetConfigDataCodec extends Codec<AssetConfigTransactionFields | undefined, Record<string, unknown>> {\n private assetParamsCodec = new ObjectModelCodec<Omit<AssetConfigTransactionFields, 'assetId'>>(AssetParamsMeta)\n\n public defaultValue(): AssetConfigTransactionFields | undefined {\n return undefined\n }\n\n protected toEncoded(value: AssetConfigTransactionFields | undefined, format: EncodingFormat): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n\n if (!value) {\n throw new Error('Transaction is not an asset config')\n }\n\n const { assetId, ...assetParams } = value\n\n const encodedAssetId = bigIntCodec.encodeOptional(assetId, format)\n if (encodedAssetId !== undefined) {\n result.caid = encodedAssetId\n }\n\n const encodedParams = this.assetParamsCodec.encodeOptional(assetParams, format)\n if (encodedParams && Object.keys(encodedParams).length > 0) {\n result.apar = encodedParams\n }\n\n return result\n }\n\n protected fromEncoded(value: Record<string, unknown>, format: EncodingFormat): AssetConfigTransactionFields | undefined {\n if (value.type === undefined) {\n throw new Error('Transaction is missing type field')\n }\n const type = normalizeWireString(value.type as WireString)\n const caid = value.caid as WireBigInt | undefined\n const apar = value.apar as WireObject | undefined\n\n if (type !== TransactionType.AssetConfig || (caid === undefined && !apar)) {\n return undefined\n }\n\n return {\n assetId: bigIntCodec.decode(caid, format),\n ...this.assetParamsCodec.decode(apar, format),\n } satisfies AssetConfigTransactionFields\n }\n\n public isDefaultValue(value: AssetConfigTransactionFields | undefined): boolean {\n return value === undefined\n }\n}\n\nclass AppCallDataCodec extends Codec<AppCallTransactionFields | undefined, Record<string, unknown>> {\n private appCallFieldsCodec = new ObjectModelCodec<Omit<AppCallTransactionFields, 'accessReferences' | 'boxReferences'>>(\n AppCallTransactionFieldsMeta,\n )\n\n public defaultValue(): AppCallTransactionFields | undefined {\n return undefined\n }\n\n private encodeResourceReferences(\n appId: bigint,\n resourceReferences: ResourceReference[] | undefined,\n format: EncodingFormat,\n ): WireResourceReference[] | undefined {\n if (!resourceReferences || resourceReferences.length === 0) return undefined\n\n const accessList: WireResourceReference[] = []\n\n // Helper to find or add a simple reference and return its 1-based index\n const ensure = (target: Pick<ResourceReference, 'address' | 'assetId' | 'appId'>): number => {\n // Search for existing entry\n for (let idx = 0; idx < accessList.length; idx++) {\n const entry = accessList[idx]\n const matchesAddress =\n (!entry.d && !target.address) || (entry.d && target.address && addressCodec.decode(entry.d, format).equals(target.address))\n const matchesAssetId =\n (entry.s === undefined && target.assetId === undefined) ||\n (entry.s !== undefined && target.assetId !== undefined && bigIntCodec.decode(entry.s, format) === target.assetId)\n const matchesAppId =\n (entry.p === undefined && target.appId === undefined) ||\n (entry.p !== undefined && target.appId !== undefined && bigIntCodec.decode(entry.p, format) === target.appId)\n\n if (matchesAddress && matchesAssetId && matchesAppId) {\n return idx + 1 // Return 1-based index\n }\n }\n\n // Add new entries for each field\n if (target.address && !target.address.equals(Address.zeroAddress())) {\n accessList.push({ d: addressCodec.encodeOptional(target.address, format)! })\n }\n if (target.assetId !== undefined) {\n accessList.push({ s: bigIntCodec.encodeOptional(target.assetId, format)! })\n }\n if (target.appId !== undefined) {\n accessList.push({ p: bigIntCodec.encodeOptional(target.appId, format)! })\n }\n\n return accessList.length // Return 1-based index of last added\n }\n\n // Process each access reference\n for (const resourceRef of resourceReferences) {\n // Simple references (address, assetId, or appId)\n if (resourceRef.address || resourceRef.assetId !== undefined || resourceRef.appId !== undefined) {\n ensure(resourceRef)\n continue\n }\n\n // Holding reference\n if (resourceRef.holding) {\n const holding = resourceRef.holding\n let addressIndex = 0\n if (holding.address && !holding.address.equals(Address.zeroAddress())) {\n addressIndex = ensure({ address: holding.address })\n }\n const assetIndex = ensure({ assetId: holding.assetId })\n accessList.push({\n h: {\n d: numberCodec.encodeOptional(addressIndex, format),\n s: numberCodec.encodeOptional(assetIndex, format),\n },\n })\n continue\n }\n\n // Locals reference\n if (resourceRef.locals) {\n const locals = resourceRef.locals\n let addressIndex = 0\n if (locals.address && !locals.address.equals(Address.zeroAddress())) {\n addressIndex = ensure({ address: locals.address })\n }\n\n let appIndex = 0\n if (locals.appId && locals.appId !== appId) {\n appIndex = ensure({ appId: locals.appId })\n }\n if (addressIndex !== 0 || appIndex !== 0) {\n accessList.push({\n l: {\n d: numberCodec.encodeOptional(addressIndex, format),\n p: numberCodec.encodeOptional(appIndex, format),\n },\n })\n }\n continue\n }\n\n // Box reference\n if (resourceRef.box) {\n const box = resourceRef.box\n // Only add appId to access list if it's different from the calling app's ID\n // Use appIndex = 0 when box is for the current app\n let appIndex = 0\n if (box.appId && box.appId !== appId) {\n appIndex = ensure({ appId: box.appId })\n }\n accessList.push({\n b: {\n i: numberCodec.encodeOptional(appIndex, format),\n n: bytesCodec.encodeOptional(box.name, format),\n },\n })\n continue\n }\n }\n\n return accessList.length > 0 ? accessList : undefined\n }\n\n private decodeResourceReferences(\n _wireResourceReferences: WireResourceReference[] | undefined,\n format: EncodingFormat,\n ): ResourceReference[] {\n if (!_wireResourceReferences || _wireResourceReferences.length === 0) return []\n\n const result: ResourceReference[] = []\n\n // Process each entry in the access list\n\n const wireResourceReferences = _wireResourceReferences.map((ref) => normalizeWireObject(ref))\n for (const ref of wireResourceReferences) {\n const d = ref.d as WireString | undefined\n const s = ref.s as WireBigInt | undefined\n const p = ref.p as WireBigInt | undefined\n const _h = ref.h as WireObject | undefined\n const h = _h ? normalizeWireObject(_h) : undefined\n const _l = ref.l as WireObject | undefined\n const l = _l ? normalizeWireObject(_l) : undefined\n const _b = ref.b as WireObject | undefined\n const b = _b ? normalizeWireObject(_b) : undefined\n\n // Simple address reference\n if (d) {\n result.push({ address: addressCodec.decode(d, format) })\n continue\n }\n\n // Simple asset ID reference\n if (s !== undefined) {\n result.push({ assetId: bigIntCodec.decode(s, format) })\n continue\n }\n\n // Simple app ID reference\n if (p !== undefined) {\n result.push({ appId: bigIntCodec.decode(p, format) })\n continue\n }\n\n // Holding reference (h)\n if (h) {\n const addrIdx = (h.d ?? 0) as number\n const assetIdx = h.s as number | undefined\n\n if (assetIdx === undefined) {\n throw new Error('Access list holding reference is missing asset index')\n }\n\n const holdingAddress =\n addrIdx === 0 ? Address.zeroAddress() : addressCodec.decode(wireResourceReferences[addrIdx - 1].d! as WireString, format)\n const holdingAssetId = wireResourceReferences[assetIdx - 1].s! as WireBigInt\n\n result.push({\n holding: {\n assetId: bigIntCodec.decode(holdingAssetId, format),\n address: holdingAddress,\n },\n })\n continue\n }\n\n // Locals reference (l)\n if (l) {\n const addrIdx = (l.d ?? 0) as number\n const appIdx = (l.p ?? 0) as number\n\n const localsAddress =\n addrIdx === 0 ? Address.zeroAddress() : addressCodec.decode(wireResourceReferences[addrIdx - 1].d! as WireString, format)\n const localsAppId = appIdx === 0 ? 0n : (wireResourceReferences[appIdx - 1].p! as WireBigInt)\n\n result.push({\n locals: {\n appId: bigIntCodec.decode(localsAppId, format),\n address: localsAddress,\n },\n })\n continue\n }\n\n // Box reference (b)\n if (b) {\n const boxAppIdx = (b.i ?? 0) as number\n const name = b.n as WireString | undefined\n\n if (!name) {\n throw new Error('Access list box reference is missing name')\n }\n\n const boxAppId = boxAppIdx === 0 ? 0n : (wireResourceReferences[boxAppIdx - 1].p! as WireBigInt)\n\n result.push({\n box: {\n appId: bigIntCodec.decode(boxAppId, format),\n name: bytesCodec.decode(name, format),\n },\n })\n continue\n }\n }\n\n return result\n }\n\n private encodeBoxReferences(\n appId: bigint,\n appReferences: bigint[] | undefined,\n boxReferences: BoxReference[] | undefined,\n format: EncodingFormat,\n ): WireBoxReference[] | undefined {\n if (!boxReferences || boxReferences.length === 0) return undefined\n\n const appRefs = appReferences ?? []\n\n return boxReferences.map((box) => {\n const isCurrentApp = box.appId === 0n || box.appId === appId\n // Index 0 means current app, index > 0 references foreign apps array (1-indexed)\n const index = isCurrentApp ? 0 : appRefs.indexOf(box.appId) + 1\n\n if (index === 0 && !isCurrentApp) {\n throw new Error(`Box ref with appId ${box.appId} not in appReferences`)\n }\n\n return {\n i: numberCodec.encodeOptional(index, format), // This returns undefined when index is 0, which omits the field\n n: bytesCodec.encodeOptional(box.name, format),\n }\n })\n }\n\n private decodeBoxReferences(\n appReferences: bigint[] | undefined,\n wireBoxReferences: WireBoxReference[] | undefined,\n format: EncodingFormat,\n ): BoxReference[] {\n if (!wireBoxReferences || wireBoxReferences.length === 0) return []\n\n return wireBoxReferences.map((_box) => {\n const box = normalizeWireObject(_box)\n const boxIndex = box.i as number | undefined\n const boxName = box.n as WireString | undefined\n\n const index = boxIndex ?? 0\n\n let appId: bigint\n if (index === 0) {\n // 0 means current app\n appId = 0n\n } else {\n // 1-based index into foreignApps array\n const foreignAppId = appReferences?.[index - 1]\n if (foreignAppId === undefined) {\n throw new Error(`Failed to find the app reference at index ${index - 1}`)\n }\n appId = bigIntCodec.decode(foreignAppId, format)\n }\n\n return {\n appId,\n name: bytesCodec.decode(boxName, format),\n }\n })\n }\n\n protected toEncoded(value: AppCallTransactionFields | undefined, format: EncodingFormat): Record<string, unknown> {\n const result: Record<string, unknown> = {}\n\n if (!value) {\n throw new Error('Transaction is not an app call')\n }\n\n const encodedParams = this.appCallFieldsCodec.encodeOptional(value, format)\n if (encodedParams && Object.keys(encodedParams).length > 0) {\n Object.assign(result, encodedParams)\n }\n\n const wireBoxReferences = this.encodeBoxReferences(value.appId, value.appReferences, value.boxReferences, format)\n if (wireBoxReferences) {\n result.apbx = wireBoxReferences\n }\n\n const wireAccessReferences = this.encodeResourceReferences(value.appId, value.accessReferences, format)\n if (wireAccessReferences) {\n result.al = wireAccessReferences\n }\n\n return result\n }\n\n protected fromEncoded(value: Record<string, unknown>, format: EncodingFormat): AppCallTransactionFields | undefined {\n if (value.type === undefined) {\n throw new Error('Transaction is missing type field')\n }\n const type = normalizeWireString(value.type as WireString)\n if (type !== TransactionType.AppCall) {\n return undefined\n }\n\n const appReferences = value.apfa as WireBigInt[] | undefined\n const wireBoxReferences = value.apbx as WireBoxReference[] | undefined\n const wireAccessReferences = value.al as WireResourceReference[] | undefined\n const boxReferences = this.decodeBoxReferences(\n appReferences?.map((ar) => bigIntCodec.decode(ar, format)),\n wireBoxReferences,\n format,\n )\n const accessReferences = this.decodeResourceReferences(wireAccessReferences, format)\n\n return {\n ...this.appCallFieldsCodec.decode(value, format),\n ...(accessReferences.length > 0 && { accessReferences }),\n ...(boxReferences.length > 0 && { boxReferences }),\n } satisfies AppCallTransactionFields\n }\n\n public isDefaultValue(value: AppCallTransactionFields | undefined): boolean {\n return value === undefined\n }\n}\n\nconst PaymentTransactionFieldsMeta: ObjectModelMetadata<PaymentTransactionFields> = {\n name: 'PaymentTransactionFields',\n kind: 'object',\n fields: [\n { name: 'amount', wireKey: 'amt', optional: false, codec: bigIntCodec },\n { name: 'receiver', wireKey: 'rcv', optional: false, codec: addressCodec },\n { name: 'closeRemainderTo', wireKey: 'close', optional: true, codec: addressCodec },\n ],\n}\n\nconst AssetTransferTransactionFieldsMeta: ObjectModelMetadata<AssetTransferTransactionFields> = {\n name: 'AssetTransferTransactionFields',\n kind: 'object',\n fields: [\n { name: 'assetId', wireKey: 'xaid', optional: false, codec: bigIntCodec },\n { name: 'amount', wireKey: 'aamt', optional: false, codec: bigIntCodec },\n { name: 'receiver', wireKey: 'arcv', optional: false, codec: addressCodec },\n { name: 'assetSender', wireKey: 'asnd', optional: true, codec: addressCodec },\n { name: 'closeRemainderTo', wireKey: 'aclose', optional: true, codec: addressCodec },\n ],\n}\n\nconst AssetFreezeTransactionFieldsMeta: ObjectModelMetadata<AssetFreezeTransactionFields> = {\n name: 'AssetFreezeTransactionFields',\n kind: 'object',\n fields: [\n { name: 'assetId', wireKey: 'faid', optional: false, codec: bigIntCodec },\n { name: 'freezeTarget', wireKey: 'fadd', optional: false, codec: addressCodec },\n { name: 'frozen', wireKey: 'afrz', optional: false, codec: booleanCodec },\n ],\n}\n\nconst KeyRegistrationTransactionFieldsMeta: ObjectModelMetadata<KeyRegistrationTransactionFields> = {\n name: 'KeyRegistrationTransactionFields',\n kind: 'object',\n fields: [\n { name: 'voteKey', wireKey: 'votekey', optional: true, codec: fixedBytes32Codec },\n { name: 'selectionKey', wireKey: 'selkey', optional: true, codec: fixedBytes32Codec },\n { name: 'stateProofKey', wireKey: 'sprfkey', optional: true, codec: fixedBytes64Codec },\n { name: 'voteFirst', wireKey: 'votefst', optional: true, codec: bigIntCodec },\n { name: 'voteLast', wireKey: 'votelst', optional: true, codec: bigIntCodec },\n { name: 'voteKeyDilution', wireKey: 'votekd', optional: true, codec: bigIntCodec },\n { name: 'nonParticipation', wireKey: 'nonpart', optional: true, codec: booleanCodec },\n ],\n}\n\nconst AssetParamsMeta: ObjectModelMetadata<Omit<AssetConfigTransactionFields, 'assetId'>> = {\n name: 'AssetParams',\n kind: 'object',\n fields: [\n { name: 'total', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'decimals', wireKey: 'dc', optional: true, codec: numberCodec },\n { name: 'defaultFrozen', wireKey: 'df', optional: true, codec: booleanCodec },\n { name: 'unitName', wireKey: 'un', optional: true, codec: stringCodec },\n { name: 'assetName', wireKey: 'an', optional: true, codec: stringCodec },\n { name: 'url', wireKey: 'au', optional: true, codec: stringCodec },\n { name: 'metadataHash', wireKey: 'am', optional: true, codec: fixedBytes32Codec },\n { name: 'manager', wireKey: 'm', optional: true, codec: addressCodec },\n { name: 'reserve', wireKey: 'r', optional: true, codec: addressCodec },\n { name: 'freeze', wireKey: 'f', optional: true, codec: addressCodec },\n { name: 'clawback', wireKey: 'c', optional: true, codec: addressCodec },\n ],\n}\n\nconst StateSchemaMeta: ObjectModelMetadata<StateSchema> = {\n name: 'StateSchema',\n kind: 'object',\n fields: [\n { name: 'numUints', wireKey: 'nui', optional: false, codec: numberCodec },\n { name: 'numByteSlices', wireKey: 'nbs', optional: false, codec: numberCodec },\n ],\n}\n\nconst AppCallTransactionFieldsMeta: ObjectModelMetadata<AppCallTransactionFields> = {\n name: 'AppCallTransactionFields',\n kind: 'object',\n fields: [\n { name: 'appId', wireKey: 'apid', optional: false, codec: bigIntCodec },\n { name: 'onComplete', wireKey: 'apan', optional: false, codec: numberCodec },\n { name: 'approvalProgram', wireKey: 'apap', optional: true, codec: bytesCodec },\n { name: 'clearStateProgram', wireKey: 'apsu', optional: true, codec: bytesCodec },\n {\n name: 'globalStateSchema',\n wireKey: 'apgs',\n optional: true,\n codec: new ObjectModelCodec(StateSchemaMeta),\n },\n {\n name: 'localStateSchema',\n wireKey: 'apls',\n optional: true,\n codec: new ObjectModelCodec(StateSchemaMeta),\n },\n { name: 'extraProgramPages', wireKey: 'apep', optional: true, codec: numberCodec },\n { name: 'args', wireKey: 'apaa', optional: true, codec: bytesArrayCodec },\n { name: 'accountReferences', wireKey: 'apat', optional: true, codec: addressArrayCodec },\n { name: 'appReferences', wireKey: 'apfa', optional: true, codec: bigIntArrayCodec },\n { name: 'assetReferences', wireKey: 'apas', optional: true, codec: bigIntArrayCodec },\n // boxReferences and accessReferences are handled by the parent codec, as they require more complex mappings\n ],\n}\n\nconst HashFactoryMeta: ObjectModelMetadata<HashFactory> = {\n name: 'HashFactory',\n kind: 'object',\n fields: [{ name: 'hashType', wireKey: 't', optional: false, codec: numberCodec }],\n}\n\nconst MerkleArrayProofMeta: ObjectModelMetadata<MerkleArrayProof> = {\n name: 'MerkleArrayProof',\n kind: 'object',\n fields: [\n { name: 'path', wireKey: 'pth', optional: false, codec: bytesArrayCodec },\n { name: 'hashFactory', wireKey: 'hsh', optional: false, codec: new ObjectModelCodec(HashFactoryMeta) },\n { name: 'treeDepth', wireKey: 'td', optional: false, codec: numberCodec },\n ],\n}\n\nconst FalconVerifierMeta: ObjectModelMetadata<FalconVerifier> = {\n name: 'FalconVerifier',\n kind: 'object',\n fields: [{ name: 'publicKey', wireKey: 'k', optional: false, codec: fixedBytes1793Codec }],\n}\n\nconst FalconSignatureStructMeta: ObjectModelMetadata<FalconSignatureStruct> = {\n name: 'FalconSignatureStruct',\n kind: 'object',\n fields: [\n { name: 'signature', wireKey: 'sig', optional: false, codec: bytesCodec },\n { name: 'vectorCommitmentIndex', wireKey: 'idx', optional: false, codec: bigIntCodec },\n { name: 'proof', wireKey: 'prf', optional: false, codec: new ObjectModelCodec(MerkleArrayProofMeta) },\n { name: 'verifyingKey', wireKey: 'vkey', optional: false, codec: new ObjectModelCodec(FalconVerifierMeta) },\n ],\n}\n\nconst SigslotCommitMeta: ObjectModelMetadata<SigslotCommit> = {\n name: 'SigslotCommit',\n kind: 'object',\n fields: [\n { name: 'sig', wireKey: 's', optional: false, codec: new ObjectModelCodec(FalconSignatureStructMeta) },\n { name: 'lowerSigWeight', wireKey: 'l', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst MerkleSignatureVerifierMeta: ObjectModelMetadata<MerkleSignatureVerifier> = {\n name: 'MerkleSignatureVerifier',\n kind: 'object',\n fields: [\n { name: 'commitment', wireKey: 'cmt', optional: false, codec: fixedBytes64Codec },\n { name: 'keyLifetime', wireKey: 'lf', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst ParticipantMeta: ObjectModelMetadata<Participant> = {\n name: 'Participant',\n kind: 'object',\n fields: [\n { name: 'verifier', wireKey: 'p', optional: false, codec: new ObjectModelCodec(MerkleSignatureVerifierMeta) },\n { name: 'weight', wireKey: 'w', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst RevealMeta: ObjectModelMetadata<Reveal> = {\n name: 'Reveal',\n kind: 'object',\n fields: [\n { name: 'sigslot', wireKey: 's', optional: false, codec: new ObjectModelCodec(SigslotCommitMeta) },\n { name: 'participant', wireKey: 'p', optional: false, codec: new ObjectModelCodec(ParticipantMeta) },\n ],\n}\n\nconst StateProofMeta: ObjectModelMetadata<StateProof> = {\n name: 'StateProof',\n kind: 'object',\n fields: [\n { name: 'sigCommit', wireKey: 'c', optional: false, codec: bytesCodec },\n { name: 'signedWeight', wireKey: 'w', optional: false, codec: bigIntCodec },\n { name: 'sigProofs', wireKey: 'S', optional: false, codec: new ObjectModelCodec(MerkleArrayProofMeta) },\n { name: 'partProofs', wireKey: 'P', optional: false, codec: new ObjectModelCodec(MerkleArrayProofMeta) },\n { name: 'merkleSignatureSaltVersion', wireKey: 'v', optional: false, codec: numberCodec },\n {\n name: 'reveals',\n wireKey: 'r',\n optional: false,\n codec: new MapCodec(bigIntCodec, new ObjectModelCodec(RevealMeta)),\n },\n { name: 'positionsToReveal', wireKey: 'pr', optional: false, codec: bigIntArrayCodec },\n ],\n}\n\nconst StateProofMessageMeta: ObjectModelMetadata<StateProofMessage> = {\n name: 'StateProofMessage',\n kind: 'object',\n fields: [\n { name: 'blockHeadersCommitment', wireKey: 'b', optional: false, codec: bytesCodec },\n { name: 'votersCommitment', wireKey: 'v', optional: false, codec: bytesCodec },\n { name: 'lnProvenWeight', wireKey: 'P', optional: false, codec: bigIntCodec },\n { name: 'firstAttestedRound', wireKey: 'f', optional: false, codec: bigIntCodec },\n { name: 'lastAttestedRound', wireKey: 'l', optional: false, codec: bigIntCodec },\n ],\n}\n\nconst StateProofTransactionFieldsMeta: ObjectModelMetadata<StateProofTransactionFields> = {\n name: 'StateProofTransactionFields',\n kind: 'object',\n fields: [\n { name: 'stateProofType', wireKey: 'sptype', optional: false, codec: numberCodec },\n { name: 'stateProof', wireKey: 'sp', optional: true, codec: new ObjectModelCodec(StateProofMeta) },\n { name: 'message', wireKey: 'spmsg', optional: true, codec: new ObjectModelCodec(StateProofMessageMeta) },\n ],\n}\n\nconst HeartbeatProofMeta: ObjectModelMetadata<HeartbeatProof> = {\n name: 'HeartbeatProof',\n kind: 'object',\n fields: [\n { name: 'sig', wireKey: 's', optional: false, codec: fixedBytes64Codec },\n { name: 'pk', wireKey: 'p', optional: false, codec: fixedBytes32Codec },\n { name: 'pk2', wireKey: 'p2', optional: false, codec: fixedBytes32Codec },\n { name: 'pk1Sig', wireKey: 'p1s', optional: false, codec: fixedBytes64Codec },\n { name: 'pk2Sig', wireKey: 'p2s', optional: false, codec: fixedBytes64Codec },\n ],\n}\n\nconst HeartbeatTransactionFieldsMeta: ObjectModelMetadata<HeartbeatTransactionFields> = {\n name: 'HeartbeatTransactionFields',\n kind: 'object',\n fields: [\n { name: 'address', wireKey: 'a', optional: false, codec: addressCodec },\n { name: 'proof', wireKey: 'prf', optional: false, codec: new ObjectModelCodec(HeartbeatProofMeta) },\n { name: 'seed', wireKey: 'sd', optional: false, codec: bytesCodec },\n { name: 'voteId', wireKey: 'vid', optional: false, codec: fixedBytes32Codec },\n { name: 'keyDilution', wireKey: 'kd', optional: false, codec: bigIntCodec },\n ],\n}\n\n/**\n * Metadata for TransactionParams\n */\nexport const TransactionParamsMeta: ObjectModelMetadata<TransactionParams> = {\n name: 'TransactionParams',\n kind: 'object',\n fields: [\n // Common transaction fields\n { name: 'type', wireKey: 'type', optional: false, codec: new TransactionTypeCodec() },\n { name: 'sender', wireKey: 'snd', optional: false, codec: addressCodec },\n { name: 'fee', wireKey: 'fee', optional: true, codec: bigIntCodec },\n { name: 'firstValid', wireKey: 'fv', optional: false, codec: bigIntCodec },\n { name: 'lastValid', wireKey: 'lv', optional: false, codec: bigIntCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: true, codec: fixedBytes32Codec },\n { name: 'genesisId', wireKey: 'gen', optional: true, codec: stringCodec },\n { name: 'note', wireKey: 'note', optional: true, codec: bytesCodec },\n { name: 'rekeyTo', wireKey: 'rekey', optional: true, codec: addressCodec },\n { name: 'lease', wireKey: 'lx', optional: true, codec: fixedBytes32Codec },\n { name: 'group', wireKey: 'grp', optional: true, codec: fixedBytes32Codec },\n // Transaction type-specific fields (flattened)\n {\n name: 'payment',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.Payment, PaymentTransactionFieldsMeta),\n },\n {\n name: 'assetTransfer',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.AssetTransfer, AssetTransferTransactionFieldsMeta),\n },\n {\n name: 'assetFreeze',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.AssetFreeze, AssetFreezeTransactionFieldsMeta),\n },\n {\n name: 'keyRegistration',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.KeyRegistration, KeyRegistrationTransactionFieldsMeta),\n },\n {\n name: 'assetConfig',\n flattened: true,\n optional: true,\n codec: new AssetConfigDataCodec(),\n },\n {\n name: 'heartbeat',\n wireKey: 'hb',\n optional: true,\n // Heartbeat is not flattened and therefore does not need the type check for conditional decoding\n codec: new ObjectModelCodec(HeartbeatTransactionFieldsMeta),\n },\n {\n name: 'appCall',\n flattened: true,\n optional: true,\n codec: new AppCallDataCodec(),\n },\n {\n name: 'stateProof',\n flattened: true,\n optional: true,\n codec: new TransactionDataCodec(TransactionType.StateProof, StateProofTransactionFieldsMeta),\n },\n ],\n}\n\nexport const transactionParamsCodec = new ObjectModelCodec<TransactionParams>(TransactionParamsMeta)\n"],"mappings":";;;;;;;;;;;;;;;;AAiFA,IAAM,uBAAN,cAAmC,MAA2C;CAC5E,AAAO,eAAgC;AAErC,SAAO,gBAAgB;;CAGzB,AAAU,UAAU,OAAwB,SAAiC;AAC3E,UAAQ,OAAR;GACE,KAAK,gBAAgB,QACnB,QAAO;GACT,KAAK,gBAAgB,cACnB,QAAO;GACT,KAAK,gBAAgB,YACnB,QAAO;GACT,KAAK,gBAAgB,YACnB,QAAO;GACT,KAAK,gBAAgB,gBACnB,QAAO;GACT,KAAK,gBAAgB,QACnB,QAAO;GACT,KAAK,gBAAgB,WACnB,QAAO;GACT,KAAK,gBAAgB,UACnB,QAAO;GACT,QACE,QAAO;;;CAIb,AAAU,YAAY,OAAmB,SAA0C;AAIjF,UAFmB,oBAAoB,MAAM,EAE7C;GACE,KAAK,MACH,QAAO,gBAAgB;GACzB,KAAK,QACH,QAAO,gBAAgB;GACzB,KAAK,OACH,QAAO,gBAAgB;GACzB,KAAK,OACH,QAAO,gBAAgB;GACzB,KAAK,SACH,Q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zE;GAAE,MAAM;GAAe,SAAS;GAAM,UAAU;GAAM,OAAO;GAAmB;EAChF;GAAE,MAAM;GAAa,SAAS;GAAO,UAAU;GAAM,OAAO;GAAa;EACzE;GAAE,MAAM;GAAQ,SAAS;GAAQ,UAAU;GAAM,OAAO;GAAY;EACpE;GAAE,MAAM;GAAW,SAAS;GAAS,UAAU;GAAM,OAAO;GAAc;EAC1E;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAO;GAAmB;EAC1E;GAAE,MAAM;GAAS,SAAS;GAAO,UAAU;GAAM,OAAO;GAAmB;EAE3E;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,SAAS,6BAA6B;GACvF;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,eAAe,mCAAmC;GACnG;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,aAAa,iCAAiC;GAC/F;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,iBAAiB,qCAAqC;GACvG;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,sBAAsB;GAClC;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GAEV,OAAO,IAAI,iBAAiB,+BAA+B;GAC5D;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,kBAAkB;GAC9B;EACD;GACE,MAAM;GACN,WAAW;GACX,UAAU;GACV,OAAO,IAAI,qBAAqB,gBAAgB,YAAY,gCAAgC;GAC7F;EACF;CACF;AAED,MAAa,yBAAyB,IAAI,iBAAoC,sBAAsB"}
|
package/transact/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AppCallTransactionFields, BoxReference, HoldingReference, LocalsReference, OnApplicationComplete, ResourceReference, StateSchema, validateAppCallTransaction } from "../packages/transact/src/transactions/app-call.js";
|
|
2
2
|
import { AssetConfigTransactionFields, validateAssetConfigTransaction } from "../packages/transact/src/transactions/asset-config.js";
|
|
3
3
|
import { AssetFreezeTransactionFields, validateAssetFreezeTransaction } from "../packages/transact/src/transactions/asset-freeze.js";
|
|
4
4
|
import { AssetTransferTransactionFields, validateAssetTransferTransaction } from "../packages/transact/src/transactions/asset-transfer.js";
|
|
@@ -10,8 +10,9 @@ import { TransactionType } from "../packages/transact/src/transactions/transacti
|
|
|
10
10
|
import { Transaction, TransactionParams, assignFee, calculateFee, decodeTransaction, decodeTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, getEncodedTransactionType, groupTransactions, transactionCodec } from "../packages/transact/src/transactions/transaction.js";
|
|
11
11
|
import { LogicSignature, MultisigSignature, MultisigSubsignature, SignedTransaction, decodeSignedTransaction, decodeSignedTransactions, encodeSignedTransaction, encodeSignedTransactions } from "../packages/transact/src/transactions/signed-transaction.js";
|
|
12
12
|
import { SignedTransactionMeta } from "../packages/transact/src/transactions/signed-transaction-meta.js";
|
|
13
|
+
import { BoxReferenceMeta, HoldingReferenceMeta, LocalsReferenceMeta } from "../packages/transact/src/transactions/reference-types-meta.js";
|
|
13
14
|
import { TransactionParamsMeta, transactionParamsCodec } from "../packages/transact/src/transactions/transaction-meta.js";
|
|
14
15
|
import { MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG, MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG, MULTISIG_MERGE_MISMATCH_ERROR_MSG, MULTISIG_MERGE_SIG_MISMATCH_ERROR_MSG, MULTISIG_MERGE_WRONG_PREIMAGE_ERROR_MSG, MULTISIG_NO_MUTATE_ERROR_MSG, MULTISIG_SIGNATURE_LENGTH_ERROR_MSG, MULTISIG_USE_PARTIAL_SIGN_ERROR_MSG, MultisigAccount, MultisigMetadata, addressFromMultisigPreImg, addressFromMultisigPreImgAddrs, addressFromMultisigSignature, appendSignRawMultisigSignature, applyMultisigSubsignature, createMultisigTransaction, decodeMultiSignature, mergeMultisigTransactions, mergeMultisignatures, multisigAddress, newMultisigSignature, participantsFromMultisigSignature } from "../packages/transact/src/multisig.js";
|
|
15
16
|
import { DelegatedLsigSigner, LogicSigAccount, ProgramDataSigner, decodeLogicSignature, sanityCheckProgram } from "../packages/transact/src/logicsig.js";
|
|
16
17
|
import { AddressWithDelegatedLsigSigner, AddressWithMxBytesSigner, AddressWithProgramDataSigner, AddressWithSigners, AddressWithTransactionSigner, MxBytesSigner, SendingAddress, TransactionSigner, generateAddressWithSigners, makeEmptyTransactionSigner } from "../packages/transact/src/signer.js";
|
|
17
|
-
export {
|
|
18
|
+
export { AddressWithDelegatedLsigSigner, AddressWithMxBytesSigner, AddressWithProgramDataSigner, AddressWithSigners, AddressWithTransactionSigner, AppCallTransactionFields, AssetConfigTransactionFields, AssetFreezeTransactionFields, AssetTransferTransactionFields, BoxReference, BoxReferenceMeta, DelegatedLsigSigner, FalconSignatureStruct, FalconVerifier, HashFactory, HeartbeatProof, HeartbeatTransactionFields, HoldingReference, HoldingReferenceMeta, KeyRegistrationTransactionFields, LocalsReference, LocalsReferenceMeta, LogicSigAccount, LogicSignature, MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG, MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG, MULTISIG_MERGE_MISMATCH_ERROR_MSG, MULTISIG_MERGE_SIG_MISMATCH_ERROR_MSG, MULTISIG_MERGE_WRONG_PREIMAGE_ERROR_MSG, MULTISIG_NO_MUTATE_ERROR_MSG, MULTISIG_SIGNATURE_LENGTH_ERROR_MSG, MULTISIG_USE_PARTIAL_SIGN_ERROR_MSG, MerkleArrayProof, MerkleSignatureVerifier, MultisigAccount, MultisigMetadata, MultisigSignature, MultisigSubsignature, MxBytesSigner, OnApplicationComplete, Participant, PaymentTransactionFields, ProgramDataSigner, ResourceReference, Reveal, SendingAddress, SignedTransaction, SignedTransactionMeta, SigslotCommit, StateProof, StateProofMessage, StateProofTransactionFields, StateSchema, Transaction, TransactionParams, TransactionParamsMeta, TransactionSigner, TransactionType, addressFromMultisigPreImg, addressFromMultisigPreImgAddrs, addressFromMultisigSignature, appendSignRawMultisigSignature, applyMultisigSubsignature, assignFee, calculateFee, createMultisigTransaction, decodeLogicSignature, decodeMultiSignature, decodeSignedTransaction, decodeSignedTransactions, decodeTransaction, decodeTransactions, encodeSignedTransaction, encodeSignedTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, generateAddressWithSigners, getEncodedTransactionType, groupTransactions, makeEmptyTransactionSigner, mergeMultisigTransactions, mergeMultisignatures, multisigAddress, newMultisigSignature, participantsFromMultisigSignature, sanityCheckProgram, transactionCodec, transactionParamsCodec, validateAppCallTransaction, validateAssetConfigTransaction, validateAssetFreezeTransaction, validateAssetTransferTransaction, validateKeyRegistrationTransaction };
|
package/transact/index.js
CHANGED
|
@@ -8,10 +8,14 @@ const require_transaction_meta = require('../packages/transact/src/transactions/
|
|
|
8
8
|
const require_transaction = require('../packages/transact/src/transactions/transaction.js');
|
|
9
9
|
const require_signed_transaction_meta = require('../packages/transact/src/transactions/signed-transaction-meta.js');
|
|
10
10
|
const require_signed_transaction = require('../packages/transact/src/transactions/signed-transaction.js');
|
|
11
|
+
const require_reference_types_meta = require('../packages/transact/src/transactions/reference-types-meta.js');
|
|
11
12
|
const require_signer = require('../packages/transact/src/signer.js');
|
|
12
13
|
const require_multisig = require('../packages/transact/src/multisig.js');
|
|
13
14
|
const require_logicsig = require('../packages/transact/src/logicsig.js');
|
|
14
15
|
|
|
16
|
+
exports.BoxReferenceMeta = require_reference_types_meta.BoxReferenceMeta;
|
|
17
|
+
exports.HoldingReferenceMeta = require_reference_types_meta.HoldingReferenceMeta;
|
|
18
|
+
exports.LocalsReferenceMeta = require_reference_types_meta.LocalsReferenceMeta;
|
|
15
19
|
exports.LogicSigAccount = require_logicsig.LogicSigAccount;
|
|
16
20
|
exports.MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG = require_multisig.MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG;
|
|
17
21
|
exports.MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG = require_multisig.MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG;
|
package/transact/index.mjs
CHANGED
|
@@ -8,8 +8,9 @@ import { TransactionParamsMeta, transactionParamsCodec } from "../packages/trans
|
|
|
8
8
|
import { Transaction, assignFee, calculateFee, decodeTransaction, decodeTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, getEncodedTransactionType, groupTransactions, transactionCodec } from "../packages/transact/src/transactions/transaction.mjs";
|
|
9
9
|
import { SignedTransactionMeta } from "../packages/transact/src/transactions/signed-transaction-meta.mjs";
|
|
10
10
|
import { decodeSignedTransaction, decodeSignedTransactions, encodeSignedTransaction, encodeSignedTransactions } from "../packages/transact/src/transactions/signed-transaction.mjs";
|
|
11
|
+
import { BoxReferenceMeta, HoldingReferenceMeta, LocalsReferenceMeta } from "../packages/transact/src/transactions/reference-types-meta.mjs";
|
|
11
12
|
import { generateAddressWithSigners, makeEmptyTransactionSigner } from "../packages/transact/src/signer.mjs";
|
|
12
13
|
import { MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG, MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG, MULTISIG_MERGE_MISMATCH_ERROR_MSG, MULTISIG_MERGE_SIG_MISMATCH_ERROR_MSG, MULTISIG_MERGE_WRONG_PREIMAGE_ERROR_MSG, MULTISIG_NO_MUTATE_ERROR_MSG, MULTISIG_SIGNATURE_LENGTH_ERROR_MSG, MULTISIG_USE_PARTIAL_SIGN_ERROR_MSG, MultisigAccount, addressFromMultisigPreImg, addressFromMultisigPreImgAddrs, addressFromMultisigSignature, appendSignRawMultisigSignature, applyMultisigSubsignature, createMultisigTransaction, decodeMultiSignature, mergeMultisigTransactions, mergeMultisignatures, multisigAddress, newMultisigSignature, participantsFromMultisigSignature } from "../packages/transact/src/multisig.mjs";
|
|
13
14
|
import { LogicSigAccount, decodeLogicSignature, sanityCheckProgram } from "../packages/transact/src/logicsig.mjs";
|
|
14
15
|
|
|
15
|
-
export { LogicSigAccount, MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG, MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG, MULTISIG_MERGE_MISMATCH_ERROR_MSG, MULTISIG_MERGE_SIG_MISMATCH_ERROR_MSG, MULTISIG_MERGE_WRONG_PREIMAGE_ERROR_MSG, MULTISIG_NO_MUTATE_ERROR_MSG, MULTISIG_SIGNATURE_LENGTH_ERROR_MSG, MULTISIG_USE_PARTIAL_SIGN_ERROR_MSG, MultisigAccount, OnApplicationComplete, SignedTransactionMeta, Transaction, TransactionParamsMeta, TransactionType, addressFromMultisigPreImg, addressFromMultisigPreImgAddrs, addressFromMultisigSignature, appendSignRawMultisigSignature, applyMultisigSubsignature, assignFee, calculateFee, createMultisigTransaction, decodeLogicSignature, decodeMultiSignature, decodeSignedTransaction, decodeSignedTransactions, decodeTransaction, decodeTransactions, encodeSignedTransaction, encodeSignedTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, generateAddressWithSigners, getEncodedTransactionType, groupTransactions, makeEmptyTransactionSigner, mergeMultisigTransactions, mergeMultisignatures, multisigAddress, newMultisigSignature, participantsFromMultisigSignature, sanityCheckProgram, transactionCodec, transactionParamsCodec, validateAppCallTransaction, validateAssetConfigTransaction, validateAssetFreezeTransaction, validateAssetTransferTransaction, validateKeyRegistrationTransaction };
|
|
16
|
+
export { BoxReferenceMeta, HoldingReferenceMeta, LocalsReferenceMeta, LogicSigAccount, MULTISIG_MERGE_LESSTHANTWO_ERROR_MSG, MULTISIG_MERGE_MISMATCH_AUTH_ADDR_MSG, MULTISIG_MERGE_MISMATCH_ERROR_MSG, MULTISIG_MERGE_SIG_MISMATCH_ERROR_MSG, MULTISIG_MERGE_WRONG_PREIMAGE_ERROR_MSG, MULTISIG_NO_MUTATE_ERROR_MSG, MULTISIG_SIGNATURE_LENGTH_ERROR_MSG, MULTISIG_USE_PARTIAL_SIGN_ERROR_MSG, MultisigAccount, OnApplicationComplete, SignedTransactionMeta, Transaction, TransactionParamsMeta, TransactionType, addressFromMultisigPreImg, addressFromMultisigPreImgAddrs, addressFromMultisigSignature, appendSignRawMultisigSignature, applyMultisigSubsignature, assignFee, calculateFee, createMultisigTransaction, decodeLogicSignature, decodeMultiSignature, decodeSignedTransaction, decodeSignedTransactions, decodeTransaction, decodeTransactions, encodeSignedTransaction, encodeSignedTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, generateAddressWithSigners, getEncodedTransactionType, groupTransactions, makeEmptyTransactionSigner, mergeMultisigTransactions, mergeMultisignatures, multisigAddress, newMultisigSignature, participantsFromMultisigSignature, sanityCheckProgram, transactionCodec, transactionParamsCodec, validateAppCallTransaction, validateAssetConfigTransaction, validateAssetFreezeTransaction, validateAssetTransferTransaction, validateKeyRegistrationTransaction };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReadableAddress } from "../packages/common/src/address.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OnApplicationComplete, ResourceReference } from "../packages/transact/src/transactions/app-call.js";
|
|
3
3
|
import { BoxIdentifier, BoxReference } from "../types/app-manager.js";
|
|
4
4
|
import { Expand } from "../types/expand.js";
|
|
5
5
|
import { CommonTransactionParams } from "./common.js";
|
|
@@ -26,7 +26,7 @@ type CommonAppCallParams = CommonTransactionParams & {
|
|
|
26
26
|
*/
|
|
27
27
|
boxReferences?: (BoxReference | BoxIdentifier)[];
|
|
28
28
|
/** Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. */
|
|
29
|
-
accessReferences?:
|
|
29
|
+
accessReferences?: ResourceReference[];
|
|
30
30
|
/** The lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed. */
|
|
31
31
|
rejectVersion?: number;
|
|
32
32
|
};
|
package/transactions/app-call.js
CHANGED
|
@@ -143,16 +143,16 @@ function populateGroupResources(transactions, groupResources) {
|
|
|
143
143
|
type: GroupResourceType.AppLocal,
|
|
144
144
|
data: appLocal
|
|
145
145
|
});
|
|
146
|
-
remainingAccounts = remainingAccounts.filter((acc) => acc !== appLocal.
|
|
147
|
-
remainingApps = remainingApps.filter((app) => app !== appLocal.
|
|
146
|
+
remainingAccounts = remainingAccounts.filter((acc) => acc !== appLocal.address);
|
|
147
|
+
remainingApps = remainingApps.filter((app) => app !== appLocal.appId);
|
|
148
148
|
});
|
|
149
149
|
if (groupResources.assetHoldings) groupResources.assetHoldings.forEach((assetHolding) => {
|
|
150
150
|
populateGroupResource(transactions, {
|
|
151
151
|
type: GroupResourceType.AssetHolding,
|
|
152
152
|
data: assetHolding
|
|
153
153
|
});
|
|
154
|
-
remainingAccounts = remainingAccounts.filter((acc) => acc !== assetHolding.
|
|
155
|
-
remainingAssets = remainingAssets.filter((asset) => asset !== assetHolding.
|
|
154
|
+
remainingAccounts = remainingAccounts.filter((acc) => acc !== assetHolding.address);
|
|
155
|
+
remainingAssets = remainingAssets.filter((asset) => asset !== assetHolding.assetId);
|
|
156
156
|
});
|
|
157
157
|
remainingAccounts.forEach((account) => {
|
|
158
158
|
populateGroupResource(transactions, {
|
|
@@ -164,11 +164,11 @@ function populateGroupResources(transactions, groupResources) {
|
|
|
164
164
|
populateGroupResource(transactions, {
|
|
165
165
|
type: GroupResourceType.Box,
|
|
166
166
|
data: {
|
|
167
|
-
appId: boxRef.
|
|
167
|
+
appId: boxRef.appId,
|
|
168
168
|
name: boxRef.name
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
|
-
remainingApps = remainingApps.filter((app) => app !== boxRef.
|
|
171
|
+
remainingApps = remainingApps.filter((app) => app !== boxRef.appId);
|
|
172
172
|
});
|
|
173
173
|
remainingAssets.forEach((asset) => {
|
|
174
174
|
populateGroupResource(transactions, {
|
|
@@ -201,7 +201,7 @@ function isAppCallBelowResourceLimit(txn) {
|
|
|
201
201
|
*/
|
|
202
202
|
function populateGroupResource(transactions, resource) {
|
|
203
203
|
if (resource.type === GroupResourceType.AssetHolding || resource.type === GroupResourceType.AppLocal) {
|
|
204
|
-
const address = resource.data.
|
|
204
|
+
const address = resource.data.address;
|
|
205
205
|
const groupIndex1 = transactions.findIndex((txn) => {
|
|
206
206
|
if (!isAppCallBelowResourceLimit(txn)) return false;
|
|
207
207
|
const appCall$1 = txn.appCall;
|
|
@@ -216,10 +216,10 @@ function populateGroupResource(transactions, resource) {
|
|
|
216
216
|
const appCall$1 = transactions[groupIndex1].appCall;
|
|
217
217
|
if (resource.type === GroupResourceType.AssetHolding) {
|
|
218
218
|
appCall$1.assetReferences = appCall$1.assetReferences ?? [];
|
|
219
|
-
if (!appCall$1.assetReferences.includes(resource.data.
|
|
219
|
+
if (!appCall$1.assetReferences.includes(resource.data.assetId)) appCall$1.assetReferences.push(resource.data.assetId);
|
|
220
220
|
} else {
|
|
221
221
|
appCall$1.appReferences = appCall$1.appReferences ?? [];
|
|
222
|
-
if (!appCall$1.appReferences.includes(resource.data.
|
|
222
|
+
if (!appCall$1.appReferences.includes(resource.data.appId)) appCall$1.appReferences.push(resource.data.appId);
|
|
223
223
|
}
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
@@ -227,8 +227,8 @@ function populateGroupResource(transactions, resource) {
|
|
|
227
227
|
if (!isAppCallBelowResourceLimit(txn)) return false;
|
|
228
228
|
const appCall$1 = txn.appCall;
|
|
229
229
|
if ((appCall$1.accountReferences?.length ?? 0) >= require_constants.MAX_ACCOUNT_REFERENCES) return false;
|
|
230
|
-
if (resource.type === GroupResourceType.AssetHolding) return appCall$1.assetReferences?.includes(resource.data.
|
|
231
|
-
else return appCall$1.appReferences?.includes(resource.data.
|
|
230
|
+
if (resource.type === GroupResourceType.AssetHolding) return appCall$1.assetReferences?.includes(resource.data.assetId) || false;
|
|
231
|
+
else return appCall$1.appReferences?.includes(resource.data.appId) || appCall$1.appId === resource.data.appId;
|
|
232
232
|
});
|
|
233
233
|
if (groupIndex2 !== -1) {
|
|
234
234
|
const appCall$1 = transactions[groupIndex2].appCall;
|
|
@@ -303,16 +303,16 @@ function populateGroupResource(transactions, resource) {
|
|
|
303
303
|
break;
|
|
304
304
|
case GroupResourceType.AssetHolding: {
|
|
305
305
|
appCall.assetReferences = appCall.assetReferences ?? [];
|
|
306
|
-
if (!appCall.assetReferences.includes(resource.data.
|
|
307
|
-
const address = resource.data.
|
|
306
|
+
if (!appCall.assetReferences.includes(resource.data.assetId)) appCall.assetReferences.push(resource.data.assetId);
|
|
307
|
+
const address = resource.data.address;
|
|
308
308
|
appCall.accountReferences = appCall.accountReferences ?? [];
|
|
309
309
|
if (!appCall.accountReferences.some((a) => a.equals(address))) appCall.accountReferences.push(address);
|
|
310
310
|
break;
|
|
311
311
|
}
|
|
312
312
|
case GroupResourceType.AppLocal: {
|
|
313
313
|
appCall.appReferences = appCall.appReferences ?? [];
|
|
314
|
-
if (!appCall.appReferences.includes(resource.data.
|
|
315
|
-
const address = resource.data.
|
|
314
|
+
if (!appCall.appReferences.includes(resource.data.appId)) appCall.appReferences.push(resource.data.appId);
|
|
315
|
+
const address = resource.data.address;
|
|
316
316
|
appCall.accountReferences = appCall.accountReferences ?? [];
|
|
317
317
|
if (!appCall.accountReferences.some((a) => a.equals(address))) appCall.accountReferences.push(address);
|
|
318
318
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-call.js","names":["buildTransactionCommonData","calculateExtraProgramPages","Transaction","TransactionType","OnApplicationComplete","getAddress","AppManager","MAX_OVERALL_REFERENCES","appCall","getApplicationAddress","MAX_ACCOUNT_REFERENCES","groupIndex"],"sources":["../../src/transactions/app-call.ts"],"sourcesContent":["import {\n ApplicationLocalReference,\n AssetHoldingReference,\n SimulateUnnamedResourcesAccessed,\n SuggestedParams,\n} from '@algorandfoundation/algokit-algod-client'\nimport {\n Address,\n MAX_ACCOUNT_REFERENCES,\n MAX_OVERALL_REFERENCES,\n ReadableAddress,\n getAddress,\n getApplicationAddress,\n} from '@algorandfoundation/algokit-common'\nimport {\n AccessReference,\n OnApplicationComplete,\n BoxReference as TransactBoxReference,\n Transaction,\n TransactionType,\n} from '@algorandfoundation/algokit-transact'\nimport { AppManager, BoxIdentifier, BoxReference as UtilsBoxReference } from '../types/app-manager'\nimport { Expand } from '../types/expand'\nimport { calculateExtraProgramPages } from '../util'\nimport { CommonTransactionParams, buildTransactionCommonData } from './common'\n\n/** Common parameters for defining an application call transaction. */\nexport type CommonAppCallParams = CommonTransactionParams & {\n /** ID of the application; 0 if the application is being created. */\n appId: bigint\n /** The [on-complete](https://dev.algorand.co/concepts/smart-contracts/avm#oncomplete) action of the call; defaults to no-op. */\n onComplete?: OnApplicationComplete\n /** Any [arguments to pass to the smart contract call](/concepts/smart-contracts/languages/teal/#argument-passing). */\n args?: Uint8Array[]\n /** Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */\n accountReferences?: ReadableAddress[]\n /** The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */\n appReferences?: bigint[]\n /** The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */\n assetReferences?: bigint[]\n /** Any boxes to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).\n *\n * Either the name identifier (which will be set against app ID of `0` i.e.\n * the current app), or a box identifier with the name identifier and app ID.\n */\n boxReferences?: (UtilsBoxReference | BoxIdentifier)[]\n /** Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. */\n accessReferences?: AccessReference[]\n /** The lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed. */\n rejectVersion?: number\n}\n\n/** Parameters to define an app create transaction */\nexport type AppCreateParams = Expand<\n Omit<CommonAppCallParams, 'appId'> & {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearState>\n /** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */\n approvalProgram: string | Uint8Array\n /** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */\n clearStateProgram: string | Uint8Array\n /** The state schema for the app. This is immutable once the app is created. */\n schema?: {\n /** The number of integers saved in global state. */\n globalInts: number\n /** The number of byte slices saved in global state. */\n globalByteSlices: number\n /** The number of integers saved in local state. */\n localInts: number\n /** The number of byte slices saved in local state. */\n localByteSlices: number\n }\n /** Number of extra pages required for the programs.\n * Defaults to the number needed for the programs in this call if not specified.\n * This is immutable once the app is created. */\n extraProgramPages?: number\n }\n>\n\n/** Parameters to define an app update transaction */\nexport type AppUpdateParams = Expand<\n CommonAppCallParams & {\n onComplete?: OnApplicationComplete.UpdateApplication\n /** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */\n approvalProgram: string | Uint8Array\n /** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */\n clearStateProgram: string | Uint8Array\n }\n>\n\n/** Parameters to define an application call transaction. */\nexport type AppCallParams = CommonAppCallParams & {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplication>\n}\n\n/** Common parameters to define an ABI method call transaction. */\nexport type AppMethodCallParams = CommonAppCallParams & {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplication | OnApplicationComplete.ClearState>\n}\n\n/** Parameters to define an application delete call transaction. */\nexport type AppDeleteParams = CommonAppCallParams & {\n onComplete?: OnApplicationComplete.DeleteApplication\n}\n\nexport const buildAppCreate = async (\n params: AppCreateParams,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n const globalStateSchema =\n params.schema?.globalByteSlices !== undefined || params.schema?.globalInts !== undefined\n ? {\n numByteSlices: params.schema?.globalByteSlices ?? 0,\n numUints: params.schema?.globalInts ?? 0,\n }\n : undefined\n const localStateSchema =\n params.schema?.localByteSlices !== undefined || params.schema?.localInts !== undefined\n ? {\n numByteSlices: params.schema?.localByteSlices ?? 0,\n numUints: params.schema?.localInts ?? 0,\n }\n : undefined\n const extraProgramPages =\n params.extraProgramPages !== undefined ? params.extraProgramPages : calculateExtraProgramPages(approvalProgram!, clearStateProgram!)\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: 0n, // App creation always uses ID 0\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n globalStateSchema: globalStateSchema,\n localStateSchema: localStateSchema,\n extraProgramPages: extraProgramPages,\n args: params.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppUpdate = async (\n params: AppUpdateParams,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: OnApplicationComplete.UpdateApplication,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n args: params.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppCall = (\n params: AppCallParams | AppDeleteParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n args: params.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\n/**\n * Populate transaction-level resources for app call transactions\n */\nexport function populateTransactionResources(\n transaction: Transaction, // NOTE: transaction is mutated in place\n resourcesAccessed: SimulateUnnamedResourcesAccessed,\n groupIndex: number,\n): void {\n if (transaction.type !== TransactionType.AppCall || transaction.appCall === undefined) {\n return\n }\n\n // Check for unexpected resources at transaction level\n if (resourcesAccessed.boxes || resourcesAccessed.extraBoxRefs) {\n throw new Error('Unexpected boxes at the transaction level')\n }\n if (resourcesAccessed.appLocals) {\n throw new Error('Unexpected app locals at the transaction level')\n }\n if (resourcesAccessed.assetHoldings) {\n throw new Error('Unexpected asset holdings at the transaction level')\n }\n\n let accountsCount = 0\n let appsCount = 0\n let assetsCount = 0\n const boxesCount = transaction.appCall.boxReferences?.length ?? 0\n\n // Populate accounts\n if (resourcesAccessed.accounts) {\n transaction.appCall.accountReferences = transaction.appCall.accountReferences ?? []\n for (const account of resourcesAccessed.accounts) {\n const address = account\n if (!transaction.appCall.accountReferences.some((a) => a.equals(address))) {\n transaction.appCall.accountReferences.push(address)\n }\n }\n accountsCount = transaction.appCall.accountReferences.length\n }\n\n // Populate apps\n if (resourcesAccessed.apps) {\n transaction.appCall.appReferences = transaction.appCall.appReferences ?? []\n for (const appId of resourcesAccessed.apps) {\n if (!transaction.appCall.appReferences.includes(appId)) {\n transaction.appCall.appReferences.push(appId)\n }\n }\n appsCount = transaction.appCall.appReferences.length\n }\n\n // Populate assets\n if (resourcesAccessed.assets) {\n transaction.appCall.assetReferences = transaction.appCall.assetReferences ?? []\n for (const assetId of resourcesAccessed.assets) {\n if (!transaction.appCall.assetReferences.includes(assetId)) {\n transaction.appCall.assetReferences.push(assetId)\n }\n }\n assetsCount = transaction.appCall.assetReferences.length\n }\n\n if (accountsCount + assetsCount + appsCount + boxesCount > MAX_OVERALL_REFERENCES) {\n throw new Error(`Resource reference limit of ${MAX_OVERALL_REFERENCES} exceeded in transaction ${groupIndex}`)\n }\n}\n\nenum GroupResourceType {\n Account,\n App,\n Asset,\n Box,\n ExtraBoxRef,\n AssetHolding,\n AppLocal,\n}\n\n/**\n * Populate group-level resources for app call transactions\n */\nexport function populateGroupResources(\n transactions: Transaction[], // NOTE: transactions are mutated in place\n groupResources: SimulateUnnamedResourcesAccessed,\n): void {\n let remainingAccounts = [...(groupResources.accounts ?? [])]\n let remainingApps = [...(groupResources.apps ?? [])]\n let remainingAssets = [...(groupResources.assets ?? [])]\n const remainingBoxes = [...(groupResources.boxes ?? [])]\n\n // Process cross-reference resources first (app locals and asset holdings) as they are most restrictive\n if (groupResources.appLocals) {\n groupResources.appLocals.forEach((appLocal) => {\n populateGroupResource(transactions, { type: GroupResourceType.AppLocal, data: appLocal })\n // Remove resources from remaining if we're adding them here\n remainingAccounts = remainingAccounts.filter((acc) => acc !== appLocal.account)\n remainingApps = remainingApps.filter((app) => app !== appLocal.app)\n })\n }\n\n if (groupResources.assetHoldings) {\n groupResources.assetHoldings.forEach((assetHolding) => {\n populateGroupResource(transactions, { type: GroupResourceType.AssetHolding, data: assetHolding })\n // Remove resources from remaining if we're adding them here\n remainingAccounts = remainingAccounts.filter((acc) => acc !== assetHolding.account)\n remainingAssets = remainingAssets.filter((asset) => asset !== assetHolding.asset)\n })\n }\n\n // Process accounts next because account limit is 4\n remainingAccounts.forEach((account) => {\n populateGroupResource(transactions, { type: GroupResourceType.Account, data: account })\n })\n\n // Process boxes\n remainingBoxes.forEach((boxRef) => {\n populateGroupResource(transactions, {\n type: GroupResourceType.Box,\n data: {\n appId: boxRef.app,\n name: boxRef.name,\n },\n })\n // Remove apps as resource if we're adding it here\n remainingApps = remainingApps.filter((app) => app !== boxRef.app)\n })\n\n // Process assets\n remainingAssets.forEach((asset) => {\n populateGroupResource(transactions, { type: GroupResourceType.Asset, data: asset })\n })\n\n // Process remaining apps\n remainingApps.forEach((app) => {\n populateGroupResource(transactions, { type: GroupResourceType.App, data: app })\n })\n\n // Handle extra box refs\n if (groupResources.extraBoxRefs) {\n for (let i = 0; i < groupResources.extraBoxRefs; i++) {\n populateGroupResource(transactions, { type: GroupResourceType.ExtraBoxRef })\n }\n }\n}\n\n/**\n * Helper function to check if an app call transaction is below resource limit\n */\nfunction isAppCallBelowResourceLimit(txn: Transaction): boolean {\n if (txn.type !== TransactionType.AppCall) {\n return false\n }\n if (txn.appCall?.accessReferences?.length) {\n return false\n }\n\n const accountsCount = txn.appCall?.accountReferences?.length || 0\n const assetsCount = txn.appCall?.assetReferences?.length || 0\n const appsCount = txn.appCall?.appReferences?.length || 0\n const boxesCount = txn.appCall?.boxReferences?.length || 0\n\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n}\n\ntype GroupResourceToPopulate =\n | { type: GroupResourceType.Account; data: Address }\n | { type: GroupResourceType.App; data: bigint }\n | { type: GroupResourceType.Asset; data: bigint }\n | { type: GroupResourceType.Box; data: TransactBoxReference }\n | { type: GroupResourceType.ExtraBoxRef }\n | { type: GroupResourceType.AssetHolding; data: AssetHoldingReference }\n | { type: GroupResourceType.AppLocal; data: ApplicationLocalReference }\n\n/**\n * Helper function to populate a specific resource into a transaction group\n */\nfunction populateGroupResource(\n transactions: Transaction[], // NOTE: transactions are mutated in place\n resource: GroupResourceToPopulate,\n): void {\n // For asset holdings and app locals, first try to find a transaction that already has the account available\n if (resource.type === GroupResourceType.AssetHolding || resource.type === GroupResourceType.AppLocal) {\n const address = resource.data.account\n\n // Try to find a transaction that already has the account available\n const groupIndex1 = transactions.findIndex((txn) => {\n if (!isAppCallBelowResourceLimit(txn)) {\n return false\n }\n\n const appCall = txn.appCall!\n\n // Check if account is in foreign accounts array\n if (appCall.accountReferences?.some((a) => a.equals(address))) {\n return true\n }\n\n // Check if account is available as an app account\n if (appCall.appReferences) {\n for (const appId of appCall.appReferences) {\n if (address === getApplicationAddress(appId)) {\n return true\n }\n }\n }\n\n // Check if account appears in any app call transaction fields\n if (txn.sender.equals(address)) {\n return true\n }\n\n return false\n })\n\n if (groupIndex1 !== -1) {\n const appCall = transactions[groupIndex1].appCall!\n if (resource.type === GroupResourceType.AssetHolding) {\n appCall.assetReferences = appCall.assetReferences ?? []\n if (!appCall.assetReferences.includes(resource.data.asset)) {\n appCall.assetReferences.push(resource.data.asset)\n }\n } else {\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data.app)) {\n appCall.appReferences.push(resource.data.app)\n }\n }\n return\n }\n\n // Try to find a transaction that has the asset/app available and space for account\n const groupIndex2 = transactions.findIndex((txn) => {\n if (!isAppCallBelowResourceLimit(txn)) {\n return false\n }\n\n const appCall = txn.appCall!\n if ((appCall.accountReferences?.length ?? 0) >= MAX_ACCOUNT_REFERENCES) {\n return false\n }\n\n if (resource.type === GroupResourceType.AssetHolding) {\n return appCall.assetReferences?.includes(resource.data.asset) || false\n } else {\n return appCall.appReferences?.includes(resource.data.app) || appCall.appId === resource.data.app\n }\n })\n\n if (groupIndex2 !== -1) {\n const appCall = transactions[groupIndex2].appCall!\n appCall.accountReferences = appCall.accountReferences ?? []\n if (!appCall.accountReferences.includes(address)) {\n appCall.accountReferences.push(address)\n }\n return\n }\n }\n\n // For boxes, first try to find a transaction that already has the app available\n if (resource.type === GroupResourceType.Box) {\n const groupIndex = transactions.findIndex((txn) => {\n if (!isAppCallBelowResourceLimit(txn)) {\n return false\n }\n\n const appCall = txn.appCall!\n return appCall.appReferences?.includes(resource.data.appId) || appCall.appId === resource.data.appId\n })\n\n if (groupIndex !== -1) {\n const appCall = transactions[groupIndex].appCall!\n appCall.boxReferences = appCall.boxReferences ?? []\n const exists = appCall.boxReferences.some(\n (b) =>\n b.appId === resource.data.appId &&\n b.name.length === resource.data.name.length &&\n b.name.every((byte, i) => byte === resource.data.name[i]),\n )\n if (!exists) {\n appCall.boxReferences.push({ appId: resource.data.appId, name: resource.data.name })\n }\n return\n }\n }\n\n // Find the first transaction that can accommodate the resource\n const groupIndex = transactions.findIndex((txn) => {\n if (txn.type !== TransactionType.AppCall) {\n return false\n }\n if (txn.appCall?.accessReferences?.length) {\n return false\n }\n\n const appCall = txn.appCall!\n const accountsCount = appCall.accountReferences?.length ?? 0\n const assetsCount = appCall.assetReferences?.length ?? 0\n const appsCount = appCall.appReferences?.length ?? 0\n const boxesCount = appCall.boxReferences?.length ?? 0\n\n switch (resource.type) {\n case GroupResourceType.Account:\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n case GroupResourceType.AssetHolding:\n case GroupResourceType.AppLocal:\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES - 1\n case GroupResourceType.Box:\n if (resource.data.appId !== 0n) {\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES - 1\n } else {\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n }\n default:\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n }\n })\n\n if (groupIndex === -1) {\n throw new Error('No more transactions below reference limit. Add another app call to the group.')\n }\n\n const appCall = transactions[groupIndex].appCall!\n\n switch (resource.type) {\n case GroupResourceType.Account: {\n appCall.accountReferences = appCall.accountReferences ?? []\n const address = resource.data\n if (!appCall.accountReferences.some((a) => a.equals(address))) {\n appCall.accountReferences.push(address)\n }\n break\n }\n case GroupResourceType.App:\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data)) {\n appCall.appReferences.push(resource.data)\n }\n break\n case GroupResourceType.Box: {\n appCall.boxReferences = appCall.boxReferences ?? []\n const exists = appCall.boxReferences.some(\n (b) =>\n b.appId === resource.data.appId &&\n b.name.length === resource.data.name.length &&\n b.name.every((byte, i) => byte === resource.data.name[i]),\n )\n if (!exists) {\n appCall.boxReferences.push({ appId: resource.data.appId, name: resource.data.name })\n }\n if (resource.data.appId !== 0n) {\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data.appId)) {\n appCall.appReferences.push(resource.data.appId)\n }\n }\n break\n }\n case GroupResourceType.ExtraBoxRef:\n appCall.boxReferences = appCall.boxReferences ?? []\n appCall.boxReferences.push({ appId: 0n, name: new Uint8Array(0) })\n break\n case GroupResourceType.AssetHolding: {\n appCall.assetReferences = appCall.assetReferences ?? []\n if (!appCall.assetReferences.includes(resource.data.asset)) {\n appCall.assetReferences.push(resource.data.asset)\n }\n const address = resource.data.account\n appCall.accountReferences = appCall.accountReferences ?? []\n if (!appCall.accountReferences.some((a) => a.equals(address))) {\n appCall.accountReferences.push(address)\n }\n break\n }\n case GroupResourceType.AppLocal: {\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data.app)) {\n appCall.appReferences.push(resource.data.app)\n }\n const address = resource.data.account\n appCall.accountReferences = appCall.accountReferences ?? []\n if (!appCall.accountReferences.some((a) => a.equals(address))) {\n appCall.accountReferences.push(address)\n }\n break\n }\n case GroupResourceType.Asset:\n appCall.assetReferences = appCall.assetReferences ?? []\n if (!appCall.assetReferences.includes(resource.data)) {\n appCall.assetReferences.push(resource.data)\n }\n break\n }\n}\n"],"mappings":";;;;;;;;;;AAwGA,MAAa,iBAAiB,OAC5B,QACA,YACA,iBACA,0BACyB;CACzB,MAAM,aAAaA,0CAA2B,QAAQ,iBAAiB,sBAAsB;CAC7F,MAAM,kBACJ,OAAO,OAAO,oBAAoB,YAC7B,MAAM,WAAW,YAAY,OAAO,gBAAgB,EAAE,wBACvD,OAAO;CACb,MAAM,oBACJ,OAAO,OAAO,sBAAsB,YAC/B,MAAM,WAAW,YAAY,OAAO,kBAAkB,EAAE,wBACzD,OAAO;CACb,MAAM,oBACJ,OAAO,QAAQ,qBAAqB,UAAa,OAAO,QAAQ,eAAe,SAC3E;EACE,eAAe,OAAO,QAAQ,oBAAoB;EAClD,UAAU,OAAO,QAAQ,cAAc;EACxC,GACD;CACN,MAAM,mBACJ,OAAO,QAAQ,oBAAoB,UAAa,OAAO,QAAQ,cAAc,SACzE;EACE,eAAe,OAAO,QAAQ,mBAAmB;EACjD,UAAU,OAAO,QAAQ,aAAa;EACvC,GACD;CACN,MAAM,oBACJ,OAAO,sBAAsB,SAAY,OAAO,oBAAoBC,wCAA2B,iBAAkB,kBAAmB;CAGtI,MAAM,sBAAsB,OAAO,oBAA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AmB,EAAE;AACvD,OAAI,CAAC,QAAQ,gBAAgB,SAAS,SAAS,KAAK,MAAM,CACxD,SAAQ,gBAAgB,KAAK,SAAS,KAAK,MAAM;GAEnD,MAAM,UAAU,SAAS,KAAK;AAC9B,WAAQ,oBAAoB,QAAQ,qBAAqB,EAAE;AAC3D,OAAI,CAAC,QAAQ,kBAAkB,MAAM,MAAM,EAAE,OAAO,QAAQ,CAAC,CAC3D,SAAQ,kBAAkB,KAAK,QAAQ;AAEzC;;EAEF,KAAK,kBAAkB,UAAU;AAC/B,WAAQ,gBAAgB,QAAQ,iBAAiB,EAAE;AACnD,OAAI,CAAC,QAAQ,cAAc,SAAS,SAAS,KAAK,IAAI,CACpD,SAAQ,cAAc,KAAK,SAAS,KAAK,IAAI;GAE/C,MAAM,UAAU,SAAS,KAAK;AAC9B,WAAQ,oBAAoB,QAAQ,qBAAqB,EAAE;AAC3D,OAAI,CAAC,QAAQ,kBAAkB,MAAM,MAAM,EAAE,OAAO,QAAQ,CAAC,CAC3D,SAAQ,kBAAkB,KAAK,QAAQ;AAEzC;;EAEF,KAAK,kBAAkB;AACrB,WAAQ,kBAAkB,QAAQ,mBAAmB,EAAE;AACvD,OAAI,CAAC,QAAQ,gBAAgB,SAAS,SAAS,KAAK,CAClD,SAAQ,gBAAgB,KAAK,SAAS,KAAK;AAE7C"}
|
|
1
|
+
{"version":3,"file":"app-call.js","names":["buildTransactionCommonData","calculateExtraProgramPages","Transaction","TransactionType","OnApplicationComplete","getAddress","AppManager","MAX_OVERALL_REFERENCES","appCall","getApplicationAddress","MAX_ACCOUNT_REFERENCES","groupIndex"],"sources":["../../src/transactions/app-call.ts"],"sourcesContent":["import { SimulateUnnamedResourcesAccessed, SuggestedParams } from '@algorandfoundation/algokit-algod-client'\nimport {\n Address,\n MAX_ACCOUNT_REFERENCES,\n MAX_OVERALL_REFERENCES,\n ReadableAddress,\n getAddress,\n getApplicationAddress,\n} from '@algorandfoundation/algokit-common'\nimport {\n HoldingReference,\n LocalsReference,\n OnApplicationComplete,\n ResourceReference,\n BoxReference as TransactBoxReference,\n Transaction,\n TransactionType,\n} from '@algorandfoundation/algokit-transact'\nimport { AppManager, BoxIdentifier, BoxReference as UtilsBoxReference } from '../types/app-manager'\nimport { Expand } from '../types/expand'\nimport { calculateExtraProgramPages } from '../util'\nimport { CommonTransactionParams, buildTransactionCommonData } from './common'\n\n/** Common parameters for defining an application call transaction. */\nexport type CommonAppCallParams = CommonTransactionParams & {\n /** ID of the application; 0 if the application is being created. */\n appId: bigint\n /** The [on-complete](https://dev.algorand.co/concepts/smart-contracts/avm#oncomplete) action of the call; defaults to no-op. */\n onComplete?: OnApplicationComplete\n /** Any [arguments to pass to the smart contract call](/concepts/smart-contracts/languages/teal/#argument-passing). */\n args?: Uint8Array[]\n /** Any account addresses to add to the [accounts array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */\n accountReferences?: ReadableAddress[]\n /** The ID of any apps to load to the [foreign apps array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */\n appReferences?: bigint[]\n /** The ID of any assets to load to the [foreign assets array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays). */\n assetReferences?: bigint[]\n /** Any boxes to load to the [boxes array](https://dev.algorand.co/concepts/smart-contracts/resource-usage#what-are-reference-arrays).\n *\n * Either the name identifier (which will be set against app ID of `0` i.e.\n * the current app), or a box identifier with the name identifier and app ID.\n */\n boxReferences?: (UtilsBoxReference | BoxIdentifier)[]\n /** Access references unifies `accountReferences`, `appReferences`, `assetReferences`, and `boxReferences` under a single list. If non-empty, these other reference lists must be empty. If access is empty, those other reference lists may be non-empty. */\n accessReferences?: ResourceReference[]\n /** The lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed. */\n rejectVersion?: number\n}\n\n/** Parameters to define an app create transaction */\nexport type AppCreateParams = Expand<\n Omit<CommonAppCallParams, 'appId'> & {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.ClearState>\n /** The program to execute for all OnCompletes other than ClearState as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */\n approvalProgram: string | Uint8Array\n /** The program to execute for ClearState OnComplete as raw teal that will be compiled (string) or compiled teal (encoded as a byte array (Uint8Array)). */\n clearStateProgram: string | Uint8Array\n /** The state schema for the app. This is immutable once the app is created. */\n schema?: {\n /** The number of integers saved in global state. */\n globalInts: number\n /** The number of byte slices saved in global state. */\n globalByteSlices: number\n /** The number of integers saved in local state. */\n localInts: number\n /** The number of byte slices saved in local state. */\n localByteSlices: number\n }\n /** Number of extra pages required for the programs.\n * Defaults to the number needed for the programs in this call if not specified.\n * This is immutable once the app is created. */\n extraProgramPages?: number\n }\n>\n\n/** Parameters to define an app update transaction */\nexport type AppUpdateParams = Expand<\n CommonAppCallParams & {\n onComplete?: OnApplicationComplete.UpdateApplication\n /** The program to execute for all OnCompletes other than ClearState as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */\n approvalProgram: string | Uint8Array\n /** The program to execute for ClearState OnComplete as raw teal (string) or compiled teal (base 64 encoded as a byte array (Uint8Array)) */\n clearStateProgram: string | Uint8Array\n }\n>\n\n/** Parameters to define an application call transaction. */\nexport type AppCallParams = CommonAppCallParams & {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplication>\n}\n\n/** Common parameters to define an ABI method call transaction. */\nexport type AppMethodCallParams = CommonAppCallParams & {\n onComplete?: Exclude<OnApplicationComplete, OnApplicationComplete.UpdateApplication | OnApplicationComplete.ClearState>\n}\n\n/** Parameters to define an application delete call transaction. */\nexport type AppDeleteParams = CommonAppCallParams & {\n onComplete?: OnApplicationComplete.DeleteApplication\n}\n\nexport const buildAppCreate = async (\n params: AppCreateParams,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n const globalStateSchema =\n params.schema?.globalByteSlices !== undefined || params.schema?.globalInts !== undefined\n ? {\n numByteSlices: params.schema?.globalByteSlices ?? 0,\n numUints: params.schema?.globalInts ?? 0,\n }\n : undefined\n const localStateSchema =\n params.schema?.localByteSlices !== undefined || params.schema?.localInts !== undefined\n ? {\n numByteSlices: params.schema?.localByteSlices ?? 0,\n numUints: params.schema?.localInts ?? 0,\n }\n : undefined\n const extraProgramPages =\n params.extraProgramPages !== undefined ? params.extraProgramPages : calculateExtraProgramPages(approvalProgram!, clearStateProgram!)\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: 0n, // App creation always uses ID 0\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n globalStateSchema: globalStateSchema,\n localStateSchema: localStateSchema,\n extraProgramPages: extraProgramPages,\n args: params.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppUpdate = async (\n params: AppUpdateParams,\n appManager: AppManager,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Promise<Transaction> => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n const approvalProgram =\n typeof params.approvalProgram === 'string'\n ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes\n : params.approvalProgram\n const clearStateProgram =\n typeof params.clearStateProgram === 'string'\n ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes\n : params.clearStateProgram\n\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: OnApplicationComplete.UpdateApplication,\n approvalProgram: approvalProgram,\n clearStateProgram: clearStateProgram,\n args: params.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\nexport const buildAppCall = (\n params: AppCallParams | AppDeleteParams,\n suggestedParams: SuggestedParams,\n defaultValidityWindow: bigint,\n): Transaction => {\n const commonData = buildTransactionCommonData(params, suggestedParams, defaultValidityWindow)\n // If accessReferences is provided, we should not pass legacy foreign arrays\n const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0\n\n return new Transaction({\n ...commonData,\n type: TransactionType.AppCall,\n appCall: {\n appId: params.appId,\n onComplete: params.onComplete ?? OnApplicationComplete.NoOp,\n args: params.args,\n ...(hasAccessReferences\n ? { accessReferences: params.accessReferences }\n : {\n accountReferences: params.accountReferences?.map((a) => getAddress(a)),\n appReferences: params.appReferences,\n assetReferences: params.assetReferences,\n boxReferences: params.boxReferences?.map(AppManager.getBoxReference),\n }),\n rejectVersion: params.rejectVersion,\n },\n })\n}\n\n/**\n * Populate transaction-level resources for app call transactions\n */\nexport function populateTransactionResources(\n transaction: Transaction, // NOTE: transaction is mutated in place\n resourcesAccessed: SimulateUnnamedResourcesAccessed,\n groupIndex: number,\n): void {\n if (transaction.type !== TransactionType.AppCall || transaction.appCall === undefined) {\n return\n }\n\n // Check for unexpected resources at transaction level\n if (resourcesAccessed.boxes || resourcesAccessed.extraBoxRefs) {\n throw new Error('Unexpected boxes at the transaction level')\n }\n if (resourcesAccessed.appLocals) {\n throw new Error('Unexpected app locals at the transaction level')\n }\n if (resourcesAccessed.assetHoldings) {\n throw new Error('Unexpected asset holdings at the transaction level')\n }\n\n let accountsCount = 0\n let appsCount = 0\n let assetsCount = 0\n const boxesCount = transaction.appCall.boxReferences?.length ?? 0\n\n // Populate accounts\n if (resourcesAccessed.accounts) {\n transaction.appCall.accountReferences = transaction.appCall.accountReferences ?? []\n for (const account of resourcesAccessed.accounts) {\n const address = account\n if (!transaction.appCall.accountReferences.some((a) => a.equals(address))) {\n transaction.appCall.accountReferences.push(address)\n }\n }\n accountsCount = transaction.appCall.accountReferences.length\n }\n\n // Populate apps\n if (resourcesAccessed.apps) {\n transaction.appCall.appReferences = transaction.appCall.appReferences ?? []\n for (const appId of resourcesAccessed.apps) {\n if (!transaction.appCall.appReferences.includes(appId)) {\n transaction.appCall.appReferences.push(appId)\n }\n }\n appsCount = transaction.appCall.appReferences.length\n }\n\n // Populate assets\n if (resourcesAccessed.assets) {\n transaction.appCall.assetReferences = transaction.appCall.assetReferences ?? []\n for (const assetId of resourcesAccessed.assets) {\n if (!transaction.appCall.assetReferences.includes(assetId)) {\n transaction.appCall.assetReferences.push(assetId)\n }\n }\n assetsCount = transaction.appCall.assetReferences.length\n }\n\n if (accountsCount + assetsCount + appsCount + boxesCount > MAX_OVERALL_REFERENCES) {\n throw new Error(`Resource reference limit of ${MAX_OVERALL_REFERENCES} exceeded in transaction ${groupIndex}`)\n }\n}\n\nenum GroupResourceType {\n Account,\n App,\n Asset,\n Box,\n ExtraBoxRef,\n AssetHolding,\n AppLocal,\n}\n\n/**\n * Populate group-level resources for app call transactions\n */\nexport function populateGroupResources(\n transactions: Transaction[], // NOTE: transactions are mutated in place\n groupResources: SimulateUnnamedResourcesAccessed,\n): void {\n let remainingAccounts = [...(groupResources.accounts ?? [])]\n let remainingApps = [...(groupResources.apps ?? [])]\n let remainingAssets = [...(groupResources.assets ?? [])]\n const remainingBoxes = [...(groupResources.boxes ?? [])]\n\n // Process cross-reference resources first (app locals and asset holdings) as they are most restrictive\n if (groupResources.appLocals) {\n groupResources.appLocals.forEach((appLocal) => {\n populateGroupResource(transactions, { type: GroupResourceType.AppLocal, data: appLocal })\n // Remove resources from remaining if we're adding them here\n remainingAccounts = remainingAccounts.filter((acc) => acc !== appLocal.address)\n remainingApps = remainingApps.filter((app) => app !== appLocal.appId)\n })\n }\n\n if (groupResources.assetHoldings) {\n groupResources.assetHoldings.forEach((assetHolding) => {\n populateGroupResource(transactions, { type: GroupResourceType.AssetHolding, data: assetHolding })\n // Remove resources from remaining if we're adding them here\n remainingAccounts = remainingAccounts.filter((acc) => acc !== assetHolding.address)\n remainingAssets = remainingAssets.filter((asset) => asset !== assetHolding.assetId)\n })\n }\n\n // Process accounts next because account limit is 4\n remainingAccounts.forEach((account) => {\n populateGroupResource(transactions, { type: GroupResourceType.Account, data: account })\n })\n\n // Process boxes\n remainingBoxes.forEach((boxRef) => {\n populateGroupResource(transactions, {\n type: GroupResourceType.Box,\n data: {\n appId: boxRef.appId,\n name: boxRef.name,\n },\n })\n // Remove apps as resource if we're adding it here\n remainingApps = remainingApps.filter((app) => app !== boxRef.appId)\n })\n\n // Process assets\n remainingAssets.forEach((asset) => {\n populateGroupResource(transactions, { type: GroupResourceType.Asset, data: asset })\n })\n\n // Process remaining apps\n remainingApps.forEach((app) => {\n populateGroupResource(transactions, { type: GroupResourceType.App, data: app })\n })\n\n // Handle extra box refs\n if (groupResources.extraBoxRefs) {\n for (let i = 0; i < groupResources.extraBoxRefs; i++) {\n populateGroupResource(transactions, { type: GroupResourceType.ExtraBoxRef })\n }\n }\n}\n\n/**\n * Helper function to check if an app call transaction is below resource limit\n */\nfunction isAppCallBelowResourceLimit(txn: Transaction): boolean {\n if (txn.type !== TransactionType.AppCall) {\n return false\n }\n if (txn.appCall?.accessReferences?.length) {\n return false\n }\n\n const accountsCount = txn.appCall?.accountReferences?.length || 0\n const assetsCount = txn.appCall?.assetReferences?.length || 0\n const appsCount = txn.appCall?.appReferences?.length || 0\n const boxesCount = txn.appCall?.boxReferences?.length || 0\n\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n}\n\ntype GroupResourceToPopulate =\n | { type: GroupResourceType.Account; data: Address }\n | { type: GroupResourceType.App; data: bigint }\n | { type: GroupResourceType.Asset; data: bigint }\n | { type: GroupResourceType.Box; data: TransactBoxReference }\n | { type: GroupResourceType.ExtraBoxRef }\n | { type: GroupResourceType.AssetHolding; data: HoldingReference }\n | { type: GroupResourceType.AppLocal; data: LocalsReference }\n\n/**\n * Helper function to populate a specific resource into a transaction group\n */\nfunction populateGroupResource(\n transactions: Transaction[], // NOTE: transactions are mutated in place\n resource: GroupResourceToPopulate,\n): void {\n // For asset holdings and app locals, first try to find a transaction that already has the account available\n if (resource.type === GroupResourceType.AssetHolding || resource.type === GroupResourceType.AppLocal) {\n const address = resource.data.address\n\n // Try to find a transaction that already has the account available\n const groupIndex1 = transactions.findIndex((txn) => {\n if (!isAppCallBelowResourceLimit(txn)) {\n return false\n }\n\n const appCall = txn.appCall!\n\n // Check if account is in foreign accounts array\n if (appCall.accountReferences?.some((a) => a.equals(address))) {\n return true\n }\n\n // Check if account is available as an app account\n if (appCall.appReferences) {\n for (const appId of appCall.appReferences) {\n if (address === getApplicationAddress(appId)) {\n return true\n }\n }\n }\n\n // Check if account appears in any app call transaction fields\n if (txn.sender.equals(address)) {\n return true\n }\n\n return false\n })\n\n if (groupIndex1 !== -1) {\n const appCall = transactions[groupIndex1].appCall!\n if (resource.type === GroupResourceType.AssetHolding) {\n appCall.assetReferences = appCall.assetReferences ?? []\n if (!appCall.assetReferences.includes(resource.data.assetId)) {\n appCall.assetReferences.push(resource.data.assetId)\n }\n } else {\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data.appId)) {\n appCall.appReferences.push(resource.data.appId)\n }\n }\n return\n }\n\n // Try to find a transaction that has the asset/app available and space for account\n const groupIndex2 = transactions.findIndex((txn) => {\n if (!isAppCallBelowResourceLimit(txn)) {\n return false\n }\n\n const appCall = txn.appCall!\n if ((appCall.accountReferences?.length ?? 0) >= MAX_ACCOUNT_REFERENCES) {\n return false\n }\n\n if (resource.type === GroupResourceType.AssetHolding) {\n return appCall.assetReferences?.includes(resource.data.assetId) || false\n } else {\n return appCall.appReferences?.includes(resource.data.appId) || appCall.appId === resource.data.appId\n }\n })\n\n if (groupIndex2 !== -1) {\n const appCall = transactions[groupIndex2].appCall!\n appCall.accountReferences = appCall.accountReferences ?? []\n if (!appCall.accountReferences.includes(address)) {\n appCall.accountReferences.push(address)\n }\n return\n }\n }\n\n // For boxes, first try to find a transaction that already has the app available\n if (resource.type === GroupResourceType.Box) {\n const groupIndex = transactions.findIndex((txn) => {\n if (!isAppCallBelowResourceLimit(txn)) {\n return false\n }\n\n const appCall = txn.appCall!\n return appCall.appReferences?.includes(resource.data.appId) || appCall.appId === resource.data.appId\n })\n\n if (groupIndex !== -1) {\n const appCall = transactions[groupIndex].appCall!\n appCall.boxReferences = appCall.boxReferences ?? []\n const exists = appCall.boxReferences.some(\n (b) =>\n b.appId === resource.data.appId &&\n b.name.length === resource.data.name.length &&\n b.name.every((byte, i) => byte === resource.data.name[i]),\n )\n if (!exists) {\n appCall.boxReferences.push({ appId: resource.data.appId, name: resource.data.name })\n }\n return\n }\n }\n\n // Find the first transaction that can accommodate the resource\n const groupIndex = transactions.findIndex((txn) => {\n if (txn.type !== TransactionType.AppCall) {\n return false\n }\n if (txn.appCall?.accessReferences?.length) {\n return false\n }\n\n const appCall = txn.appCall!\n const accountsCount = appCall.accountReferences?.length ?? 0\n const assetsCount = appCall.assetReferences?.length ?? 0\n const appsCount = appCall.appReferences?.length ?? 0\n const boxesCount = appCall.boxReferences?.length ?? 0\n\n switch (resource.type) {\n case GroupResourceType.Account:\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n case GroupResourceType.AssetHolding:\n case GroupResourceType.AppLocal:\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES - 1\n case GroupResourceType.Box:\n if (resource.data.appId !== 0n) {\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES - 1\n } else {\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n }\n default:\n return accountsCount + assetsCount + appsCount + boxesCount < MAX_OVERALL_REFERENCES\n }\n })\n\n if (groupIndex === -1) {\n throw new Error('No more transactions below reference limit. Add another app call to the group.')\n }\n\n const appCall = transactions[groupIndex].appCall!\n\n switch (resource.type) {\n case GroupResourceType.Account: {\n appCall.accountReferences = appCall.accountReferences ?? []\n const address = resource.data\n if (!appCall.accountReferences.some((a) => a.equals(address))) {\n appCall.accountReferences.push(address)\n }\n break\n }\n case GroupResourceType.App:\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data)) {\n appCall.appReferences.push(resource.data)\n }\n break\n case GroupResourceType.Box: {\n appCall.boxReferences = appCall.boxReferences ?? []\n const exists = appCall.boxReferences.some(\n (b) =>\n b.appId === resource.data.appId &&\n b.name.length === resource.data.name.length &&\n b.name.every((byte, i) => byte === resource.data.name[i]),\n )\n if (!exists) {\n appCall.boxReferences.push({ appId: resource.data.appId, name: resource.data.name })\n }\n if (resource.data.appId !== 0n) {\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data.appId)) {\n appCall.appReferences.push(resource.data.appId)\n }\n }\n break\n }\n case GroupResourceType.ExtraBoxRef:\n appCall.boxReferences = appCall.boxReferences ?? []\n appCall.boxReferences.push({ appId: 0n, name: new Uint8Array(0) })\n break\n case GroupResourceType.AssetHolding: {\n appCall.assetReferences = appCall.assetReferences ?? []\n if (!appCall.assetReferences.includes(resource.data.assetId)) {\n appCall.assetReferences.push(resource.data.assetId)\n }\n const address = resource.data.address\n appCall.accountReferences = appCall.accountReferences ?? []\n if (!appCall.accountReferences.some((a) => a.equals(address))) {\n appCall.accountReferences.push(address)\n }\n break\n }\n case GroupResourceType.AppLocal: {\n appCall.appReferences = appCall.appReferences ?? []\n if (!appCall.appReferences.includes(resource.data.appId)) {\n appCall.appReferences.push(resource.data.appId)\n }\n const address = resource.data.address\n appCall.accountReferences = appCall.accountReferences ?? []\n if (!appCall.accountReferences.some((a) => a.equals(address))) {\n appCall.accountReferences.push(address)\n }\n break\n }\n case GroupResourceType.Asset:\n appCall.assetReferences = appCall.assetReferences ?? []\n if (!appCall.assetReferences.includes(resource.data)) {\n appCall.assetReferences.push(resource.data)\n }\n break\n }\n}\n"],"mappings":";;;;;;;;;;AAqGA,MAAa,iBAAiB,OAC5B,QACA,YACA,iBACA,0BACyB;CACzB,MAAM,aAAaA,0CAA2B,QAAQ,iBAAiB,sBAAsB;CAC7F,MAAM,kBACJ,OAAO,OAAO,oBAAoB,YAC7B,MAAM,WAAW,YAAY,OAAO,gBAAgB,EAAE,wBACvD,OAAO;CACb,MAAM,oBACJ,OAAO,OAAO,sBAAsB,YAC/B,MAAM,WAAW,YAAY,OAAO,kBAAkB,EAAE,wBACzD,OAAO;CACb,MAAM,oBACJ,OAAO,QAAQ,qBAAqB,UAAa,OAAO,QAAQ,eAAe,SAC3E;EACE,eAAe,OAAO,QAAQ,oBAAoB;EAClD,UAAU,OAAO,QAAQ,cAAc;EACxC,GACD;CACN,MAAM,mBACJ,OAAO,QAAQ,oBAAoB,UAAa,OAAO,QAAQ,cAAc,SACzE;EACE,eAAe,OAAO,QAAQ,mBAAmB;EACjD,UAAU,OAAO,QAAQ,aAAa;EACvC,GACD;CACN,MAAM,oBACJ,OAAO,sBAAsB,SAAY,OAAO,oBAAoBC,wCAA2B,iBAAkB,kBAAmB;CAGtI,MAAM,sBAAsB,OAAO,oBAAoB,OAAO,iBAAiB,SAAS;AAExF,QAAO,IAAIC,gCAAY;EACrB,GAAG;EACH,MAAMC,yCAAgB;EACtB,S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