@algorandfoundation/algokit-utils 10.0.0-alpha.19 → 10.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/packages/abi/src/abi-method.js +1 -1
- package/packages/abi/src/abi-method.js.map +1 -1
- package/packages/abi/src/abi-method.mjs +1 -1
- package/packages/abi/src/abi-method.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +18 -18
- package/types/algorand-client-transaction-sender.d.ts +18 -18
- package/types/app-client.d.ts +63 -63
- package/types/app-factory.d.ts +24 -24
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"**"
|
|
7
7
|
],
|
|
8
8
|
"name": "@algorandfoundation/algokit-utils",
|
|
9
|
-
"version": "10.0.0-alpha.
|
|
9
|
+
"version": "10.0.0-alpha.20",
|
|
10
10
|
"private": false,
|
|
11
11
|
"description": "A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand.",
|
|
12
12
|
"author": "Algorand Foundation",
|
|
@@ -139,7 +139,7 @@ function arc56MethodToABIMethod(method, appSpec) {
|
|
|
139
139
|
});
|
|
140
140
|
const returns = {
|
|
141
141
|
type: method.returns.type === "void" ? "void" : method.returns.struct ? require_abi_type.ABIStructType.fromStruct(method.returns.struct, appSpec.structs) : require_abi_type.ABIType.from(method.returns.type),
|
|
142
|
-
|
|
142
|
+
description: method.returns.desc
|
|
143
143
|
};
|
|
144
144
|
return new ABIMethod({
|
|
145
145
|
name: method.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi-method.js","names":["sha512","parseTupleContent","ABIType","convertedDefaultValue: ABIDefaultValue | undefined","ABIStructType","ABIUintType","ABIAddressType"],"sources":["../../../../packages/abi/src/abi-method.ts"],"sourcesContent":["import sha512 from 'js-sha512'\nimport { ABIAddressType, ABIStructType, ABIType, ABIUintType, parseTupleContent } from './abi-type'\nimport { ABIValue } from './abi-value'\nimport { ARC28Event } from './arc28-event'\nimport { AVMType, Arc56Contract, Arc56Method } from './arc56-contract'\n\nexport enum ABITransactionType {\n Txn = 'txn',\n Payment = 'pay',\n KeyRegistration = 'keyreg',\n AssetConfig = 'acfg',\n AssetTransfer = 'axfer',\n AssetFreeze = 'afrz',\n AppCall = 'appl',\n}\nexport enum ABIReferenceType {\n Account = 'account',\n Application = 'application',\n Asset = 'asset',\n}\nexport type ABIMethodArgType = ABIType | ABITransactionType | ABIReferenceType\nexport type ABIMethodReturnType = ABIType | 'void'\n\nexport type ABIMethodArg = {\n type: ABIMethodArgType\n name?: string\n description?: string\n defaultValue?: ABIDefaultValue\n}\n\nexport type ABIMethodReturn = {\n type: ABIMethodReturnType\n description?: string\n}\n\nexport type ABIDefaultValue = {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** Where the default value is coming from */\n source: DefaultValueSource\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABIType | AVMType\n}\n\nexport enum DefaultValueSource {\n Box = 'box',\n Global = 'global',\n Local = 'local',\n Literal = 'literal',\n Method = 'method',\n}\n\n/** Represents an ABI method return value with parsed data. */\nexport type ABIReturn =\n | {\n /** The method that was called. */\n method: ABIMethod\n /** The raw return value as bytes.\n *\n * This is the value from the last app call log with the first 4 bytes (the ABI return prefix) omitted.\n */\n rawReturnValue: Uint8Array\n /** The parsed ABI return value. */\n returnValue: ABIValue\n decodeError: undefined\n }\n | { rawReturnValue?: undefined; returnValue?: undefined; method: ABIMethod; decodeError?: Error }\n\n/** Decoded ARC-56 struct as a struct rather than a tuple. */\nexport type ABIStruct = {\n [key: string]: ABIStruct | ABIValue\n}\n\nexport class ABIMethod {\n readonly name: string\n readonly description?: string\n readonly args: ABIMethodArg[]\n readonly returns: ABIMethodReturn\n readonly events?: ARC28Event[]\n readonly readonly?: boolean\n\n constructor(params: {\n name: string\n description?: string\n args: ABIMethodArg[]\n returns: ABIMethodReturn\n events?: ARC28Event[]\n readonly?: boolean\n }) {\n this.name = params.name\n this.description = params.description\n this.args = params.args\n this.returns = params.returns\n this.events = params.events\n this.readonly = params.readonly\n }\n\n /**\n * Returns the signature of this ABI method.\n * @returns The signature, e.g. `my_method(unit64,string)bytes`\n */\n getSignature(): string {\n const args = this.args\n .map((arg) => {\n if (argTypeIsTransaction(arg.type) || argTypeIsReference(arg.type)) return arg.type\n return arg.type.name\n })\n .join(',')\n const returns = this.returns.type === 'void' ? 'void' : this.returns.type.name\n return `${this.name}(${args})${returns}`\n }\n\n /**\n * Returns the method selector of this ABI method.\n * @returns The 4-byte method selector\n */\n getSelector(): Uint8Array {\n const hash = sha512.sha512_256.array(this.getSignature())\n return new Uint8Array(hash.slice(0, 4))\n }\n\n /**\n * Returns the ABI method object for a given method signature.\n * @param signature The method signature\n * e.g. `my_method(unit64,string)bytes`\n * @returns The `ABIMethod`\n */\n static fromSignature(signature: string): ABIMethod {\n const argsStart = signature.indexOf('(')\n if (argsStart === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n let argsEnd = -1\n let depth = 0\n for (let i = argsStart; i < signature.length; i++) {\n const char = signature[i]\n\n if (char === '(') {\n depth += 1\n } else if (char === ')') {\n if (depth === 0) {\n // unpaired parenthesis\n break\n }\n\n depth -= 1\n if (depth === 0) {\n argsEnd = i\n break\n }\n }\n }\n\n if (argsEnd === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n const name = signature.slice(0, argsStart)\n const args = parseTupleContent(signature.slice(argsStart + 1, argsEnd)).map((n: string) => {\n if (argTypeIsTransaction(n as ABIMethodArgType) || argTypeIsReference(n as ABIMethodArgType)) {\n return { type: n as ABIMethodArgType } satisfies ABIMethodArg\n }\n return { type: ABIType.from(n) } satisfies ABIMethodArg\n })\n const returnType = signature.slice(argsEnd + 1)\n const returns = { type: returnType === 'void' ? ('void' as const) : ABIType.from(returnType) } satisfies ABIMethodReturn\n\n return new ABIMethod({\n name,\n args,\n returns,\n })\n }\n}\n\n/**\n * Returns the ABI method object for a given method name or signature and ARC-56 app spec.\n * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n * e.g. `my_method` or `my_method(unit64,string)bytes`\n * @param appSpec The app spec for the app\n * @returns The `ABIMethod`\n */\nexport function getABIMethod(methodNameOrSignature: string, appSpec: Arc56Contract): ABIMethod {\n if (!methodNameOrSignature.includes('(')) {\n const methods = appSpec.methods.filter((m) => m.name === methodNameOrSignature)\n if (methods.length === 0) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n if (methods.length > 1) {\n throw new Error(\n `Received a call to method ${methodNameOrSignature} in contract ${\n appSpec.name\n }, but this resolved to multiple methods; please pass in an ABI signature instead: ${appSpec.methods\n .map((m) => getArc56MethodSignature(m))\n .join(', ')}`,\n )\n }\n return arc56MethodToABIMethod(methods[0], appSpec)\n } else {\n const method = appSpec.methods.find((m) => getArc56MethodSignature(m) === methodNameOrSignature)\n if (!method) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n return arc56MethodToABIMethod(method, appSpec)\n }\n}\n\nexport function arc56MethodToABIMethod(method: Arc56Method, appSpec: Arc56Contract): ABIMethod {\n if (typeof method.name !== 'string' || typeof method.returns !== 'object' || !Array.isArray(method.args)) {\n throw new Error('Invalid ABIMethod parameters')\n }\n\n const args = method.args.map(({ type, name, desc, struct, defaultValue }) => {\n const convertedDefaultValue: ABIDefaultValue | undefined = defaultValue\n ? {\n data: defaultValue.data,\n source: defaultValue.source as DefaultValueSource,\n type: defaultValue.type ? (isAVMType(defaultValue.type) ? defaultValue.type : ABIType.from(defaultValue.type)) : undefined,\n }\n : undefined\n\n if (argTypeIsTransaction(type as ABIMethodArgType) || argTypeIsReference(type as ABIMethodArgType)) {\n return {\n type: type as ABIMethodArgType,\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n if (struct) {\n return {\n type: ABIStructType.fromStruct(struct, appSpec.structs),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n return {\n type: ABIType.from(type),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n })\n\n const returns = {\n type:\n method.returns.type === ('void' as const)\n ? ('void' as const)\n : method.returns.struct\n ? ABIStructType.fromStruct(method.returns.struct, appSpec.structs)\n : ABIType.from(method.returns.type),\n desc: method.returns.desc,\n }\n\n return new ABIMethod({\n name: method.name,\n description: method.desc,\n args,\n returns,\n events: method.events,\n readonly: method.readonly,\n })\n}\n\nexport function argTypeIsTransaction(type: ABIMethodArgType): type is ABITransactionType {\n return (\n typeof type === 'string' &&\n (type === ABITransactionType.Txn ||\n type === ABITransactionType.Payment ||\n type === ABITransactionType.KeyRegistration ||\n type === ABITransactionType.AssetConfig ||\n type === ABITransactionType.AssetTransfer ||\n type === ABITransactionType.AssetFreeze ||\n type === ABITransactionType.AppCall)\n )\n}\n\nexport function argTypeIsReference(type: ABIMethodArgType): type is ABIReferenceType {\n return (\n typeof type === 'string' &&\n (type === ABIReferenceType.Account || type === ABIReferenceType.Application || type === ABIReferenceType.Asset)\n )\n}\n\nexport function argTypeIsAbiType(type: ABIMethodArgType): type is ABIType {\n return !argTypeIsTransaction(type) && !argTypeIsReference(type)\n}\n\nfunction getArc56MethodSignature(method: Arc56Method): string {\n const args = method.args.map((arg) => arg.type).join(',')\n const returns = method.returns.type\n return `${method.name}(${args})${returns}`\n}\n\nexport function decodeAVMValue(avmType: AVMType, bytes: Uint8Array): ABIValue {\n switch (avmType) {\n case 'AVMString':\n return Buffer.from(bytes).toString('utf-8')\n case 'AVMBytes':\n return bytes\n case 'AVMUint64':\n return ABIType.from('uint64').decode(bytes)\n }\n}\n\nexport function encodeAVMValue(avmType: AVMType, value: ABIValue): Uint8Array {\n switch (avmType) {\n case 'AVMString':\n return ABIType.from('string').encode(value)\n case 'AVMBytes':\n if (typeof value === 'string') return Buffer.from(value, 'utf-8')\n if (typeof value !== 'object' || !(value instanceof Uint8Array))\n throw new Error(`Expected bytes value for AVMBytes, but got ${value}`)\n return value\n case 'AVMUint64':\n return ABIType.from('uint64').encode(value)\n }\n}\n\nexport function isAVMType(type: unknown): type is AVMType {\n return typeof type === 'string' && (type === 'AVMString' || type === 'AVMBytes' || type === 'AVMUint64')\n}\n\nexport function getABIDecodedValue(type: AVMType | ABIType | ABIReferenceType, bytes: Uint8Array): ABIValue {\n if (type === ABIReferenceType.Asset || type === ABIReferenceType.Application) {\n return new ABIUintType(64).decode(bytes)\n } else if (type === ABIReferenceType.Account) {\n return new ABIAddressType().decode(bytes)\n } else if (isAVMType(type)) {\n return decodeAVMValue(type, bytes)\n }\n return type.decode(bytes)\n}\n\nexport function getABIEncodedValue(type: AVMType | ABIType, value: ABIValue): Uint8Array {\n return isAVMType(type) ? encodeAVMValue(type, value) : type.encode(value)\n}\n"],"mappings":";;;;;;AAMA,IAAY,oEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEF,IAAY,gEAAL;AACL;AACA;AACA;;;AAuDF,IAAa,YAAb,MAAa,UAAU;CACrB,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,QAOT;AACD,OAAK,OAAO,OAAO;AACnB,OAAK,cAAc,OAAO;AAC1B,OAAK,OAAO,OAAO;AACnB,OAAK,UAAU,OAAO;AACtB,OAAK,SAAS,OAAO;AACrB,OAAK,WAAW,OAAO;;;;;;CAOzB,eAAuB;EACrB,MAAM,OAAO,KAAK,KACf,KAAK,QAAQ;AACZ,OAAI,qBAAqB,IAAI,KAAK,IAAI,mBAAmB,IAAI,KAAK,CAAE,QAAO,IAAI;AAC/E,UAAO,IAAI,KAAK;IAChB,CACD,KAAK,IAAI;AAEZ,SAAO,GAAG,KAAK,KAAK,GAAG,KAAK,GADZ,KAAK,QAAQ,SAAS,SAAS,SAAS,KAAK,QAAQ,KAAK;;;;;;CAQ5E,cAA0B;EACxB,MAAM,OA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yBAAQ,KAAK,SAAS,CAAC,OAAO,MAAM;;;AAIjD,SAAgB,UAAU,MAAgC;AACxD,QAAO,OAAO,SAAS,aAAa,SAAS,eAAe,SAAS,cAAc,SAAS;;AAG9F,SAAgB,mBAAmB,MAA4C,OAA6B;AAC1G,KAAI,SAAS,iBAAiB,SAAS,SAAS,iBAAiB,YAC/D,QAAO,IAAIG,6BAAY,GAAG,CAAC,OAAO,MAAM;UAC/B,SAAS,iBAAiB,QACnC,QAAO,IAAIC,iCAAgB,CAAC,OAAO,MAAM;UAChC,UAAU,KAAK,CACxB,QAAO,eAAe,MAAM,MAAM;AAEpC,QAAO,KAAK,OAAO,MAAM;;AAG3B,SAAgB,mBAAmB,MAAyB,OAA6B;AACvF,QAAO,UAAU,KAAK,GAAG,eAAe,MAAM,MAAM,GAAG,KAAK,OAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"abi-method.js","names":["sha512","parseTupleContent","ABIType","convertedDefaultValue: ABIDefaultValue | undefined","ABIStructType","ABIUintType","ABIAddressType"],"sources":["../../../../packages/abi/src/abi-method.ts"],"sourcesContent":["import sha512 from 'js-sha512'\nimport { ABIAddressType, ABIStructType, ABIType, ABIUintType, parseTupleContent } from './abi-type'\nimport { ABIValue } from './abi-value'\nimport { ARC28Event } from './arc28-event'\nimport { AVMType, Arc56Contract, Arc56Method } from './arc56-contract'\n\nexport enum ABITransactionType {\n Txn = 'txn',\n Payment = 'pay',\n KeyRegistration = 'keyreg',\n AssetConfig = 'acfg',\n AssetTransfer = 'axfer',\n AssetFreeze = 'afrz',\n AppCall = 'appl',\n}\nexport enum ABIReferenceType {\n Account = 'account',\n Application = 'application',\n Asset = 'asset',\n}\nexport type ABIMethodArgType = ABIType | ABITransactionType | ABIReferenceType\nexport type ABIMethodReturnType = ABIType | 'void'\n\nexport type ABIMethodArg = {\n type: ABIMethodArgType\n name?: string\n description?: string\n defaultValue?: ABIDefaultValue\n}\n\nexport type ABIMethodReturn = {\n type: ABIMethodReturnType\n description?: string\n}\n\nexport type ABIDefaultValue = {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** Where the default value is coming from */\n source: DefaultValueSource\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABIType | AVMType\n}\n\nexport enum DefaultValueSource {\n Box = 'box',\n Global = 'global',\n Local = 'local',\n Literal = 'literal',\n Method = 'method',\n}\n\n/** Represents an ABI method return value with parsed data. */\nexport type ABIReturn =\n | {\n /** The method that was called. */\n method: ABIMethod\n /** The raw return value as bytes.\n *\n * This is the value from the last app call log with the first 4 bytes (the ABI return prefix) omitted.\n */\n rawReturnValue: Uint8Array\n /** The parsed ABI return value. */\n returnValue: ABIValue\n decodeError: undefined\n }\n | { rawReturnValue?: undefined; returnValue?: undefined; method: ABIMethod; decodeError?: Error }\n\n/** Decoded ARC-56 struct as a struct rather than a tuple. */\nexport type ABIStruct = {\n [key: string]: ABIStruct | ABIValue\n}\n\nexport class ABIMethod {\n readonly name: string\n readonly description?: string\n readonly args: ABIMethodArg[]\n readonly returns: ABIMethodReturn\n readonly events?: ARC28Event[]\n readonly readonly?: boolean\n\n constructor(params: {\n name: string\n description?: string\n args: ABIMethodArg[]\n returns: ABIMethodReturn\n events?: ARC28Event[]\n readonly?: boolean\n }) {\n this.name = params.name\n this.description = params.description\n this.args = params.args\n this.returns = params.returns\n this.events = params.events\n this.readonly = params.readonly\n }\n\n /**\n * Returns the signature of this ABI method.\n * @returns The signature, e.g. `my_method(unit64,string)bytes`\n */\n getSignature(): string {\n const args = this.args\n .map((arg) => {\n if (argTypeIsTransaction(arg.type) || argTypeIsReference(arg.type)) return arg.type\n return arg.type.name\n })\n .join(',')\n const returns = this.returns.type === 'void' ? 'void' : this.returns.type.name\n return `${this.name}(${args})${returns}`\n }\n\n /**\n * Returns the method selector of this ABI method.\n * @returns The 4-byte method selector\n */\n getSelector(): Uint8Array {\n const hash = sha512.sha512_256.array(this.getSignature())\n return new Uint8Array(hash.slice(0, 4))\n }\n\n /**\n * Returns the ABI method object for a given method signature.\n * @param signature The method signature\n * e.g. `my_method(unit64,string)bytes`\n * @returns The `ABIMethod`\n */\n static fromSignature(signature: string): ABIMethod {\n const argsStart = signature.indexOf('(')\n if (argsStart === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n let argsEnd = -1\n let depth = 0\n for (let i = argsStart; i < signature.length; i++) {\n const char = signature[i]\n\n if (char === '(') {\n depth += 1\n } else if (char === ')') {\n if (depth === 0) {\n // unpaired parenthesis\n break\n }\n\n depth -= 1\n if (depth === 0) {\n argsEnd = i\n break\n }\n }\n }\n\n if (argsEnd === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n const name = signature.slice(0, argsStart)\n const args = parseTupleContent(signature.slice(argsStart + 1, argsEnd)).map((n: string) => {\n if (argTypeIsTransaction(n as ABIMethodArgType) || argTypeIsReference(n as ABIMethodArgType)) {\n return { type: n as ABIMethodArgType } satisfies ABIMethodArg\n }\n return { type: ABIType.from(n) } satisfies ABIMethodArg\n })\n const returnType = signature.slice(argsEnd + 1)\n const returns = { type: returnType === 'void' ? ('void' as const) : ABIType.from(returnType) } satisfies ABIMethodReturn\n\n return new ABIMethod({\n name,\n args,\n returns,\n })\n }\n}\n\n/**\n * Returns the ABI method object for a given method name or signature and ARC-56 app spec.\n * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n * e.g. `my_method` or `my_method(unit64,string)bytes`\n * @param appSpec The app spec for the app\n * @returns The `ABIMethod`\n */\nexport function getABIMethod(methodNameOrSignature: string, appSpec: Arc56Contract): ABIMethod {\n if (!methodNameOrSignature.includes('(')) {\n const methods = appSpec.methods.filter((m) => m.name === methodNameOrSignature)\n if (methods.length === 0) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n if (methods.length > 1) {\n throw new Error(\n `Received a call to method ${methodNameOrSignature} in contract ${\n appSpec.name\n }, but this resolved to multiple methods; please pass in an ABI signature instead: ${appSpec.methods\n .map((m) => getArc56MethodSignature(m))\n .join(', ')}`,\n )\n }\n return arc56MethodToABIMethod(methods[0], appSpec)\n } else {\n const method = appSpec.methods.find((m) => getArc56MethodSignature(m) === methodNameOrSignature)\n if (!method) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n return arc56MethodToABIMethod(method, appSpec)\n }\n}\n\nexport function arc56MethodToABIMethod(method: Arc56Method, appSpec: Arc56Contract): ABIMethod {\n if (typeof method.name !== 'string' || typeof method.returns !== 'object' || !Array.isArray(method.args)) {\n throw new Error('Invalid ABIMethod parameters')\n }\n\n const args = method.args.map(({ type, name, desc, struct, defaultValue }) => {\n const convertedDefaultValue: ABIDefaultValue | undefined = defaultValue\n ? {\n data: defaultValue.data,\n source: defaultValue.source as DefaultValueSource,\n type: defaultValue.type ? (isAVMType(defaultValue.type) ? defaultValue.type : ABIType.from(defaultValue.type)) : undefined,\n }\n : undefined\n\n if (argTypeIsTransaction(type as ABIMethodArgType) || argTypeIsReference(type as ABIMethodArgType)) {\n return {\n type: type as ABIMethodArgType,\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n if (struct) {\n return {\n type: ABIStructType.fromStruct(struct, appSpec.structs),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n return {\n type: ABIType.from(type),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n })\n\n const returns = {\n type:\n method.returns.type === ('void' as const)\n ? ('void' as const)\n : method.returns.struct\n ? ABIStructType.fromStruct(method.returns.struct, appSpec.structs)\n : ABIType.from(method.returns.type),\n description: method.returns.desc,\n } satisfies ABIMethodReturn\n\n return new ABIMethod({\n name: method.name,\n description: method.desc,\n args,\n returns,\n events: method.events,\n readonly: method.readonly,\n })\n}\n\nexport function argTypeIsTransaction(type: ABIMethodArgType): type is ABITransactionType {\n return (\n typeof type === 'string' &&\n (type === ABITransactionType.Txn ||\n type === ABITransactionType.Payment ||\n type === ABITransactionType.KeyRegistration ||\n type === ABITransactionType.AssetConfig ||\n type === ABITransactionType.AssetTransfer ||\n type === ABITransactionType.AssetFreeze ||\n type === ABITransactionType.AppCall)\n )\n}\n\nexport function argTypeIsReference(type: ABIMethodArgType): type is ABIReferenceType {\n return (\n typeof type === 'string' &&\n (type === ABIReferenceType.Account || type === ABIReferenceType.Application || type === ABIReferenceType.Asset)\n )\n}\n\nexport function argTypeIsAbiType(type: ABIMethodArgType): type is ABIType {\n return !argTypeIsTransaction(type) && !argTypeIsReference(type)\n}\n\nfunction getArc56MethodSignature(method: Arc56Method): string {\n const args = method.args.map((arg) => arg.type).join(',')\n const returns = method.returns.type\n return `${method.name}(${args})${returns}`\n}\n\nexport function decodeAVMValue(avmType: AVMType, bytes: Uint8Array): ABIValue {\n switch (avmType) {\n case 'AVMString':\n return Buffer.from(bytes).toString('utf-8')\n case 'AVMBytes':\n return bytes\n case 'AVMUint64':\n return ABIType.from('uint64').decode(bytes)\n }\n}\n\nexport function encodeAVMValue(avmType: AVMType, value: ABIValue): Uint8Array {\n switch (avmType) {\n case 'AVMString':\n return ABIType.from('string').encode(value)\n case 'AVMBytes':\n if (typeof value === 'string') return Buffer.from(value, 'utf-8')\n if (typeof value !== 'object' || !(value instanceof Uint8Array))\n throw new Error(`Expected bytes value for AVMBytes, but got ${value}`)\n return value\n case 'AVMUint64':\n return ABIType.from('uint64').encode(value)\n }\n}\n\nexport function isAVMType(type: unknown): type is AVMType {\n return typeof type === 'string' && (type === 'AVMString' || type === 'AVMBytes' || type === 'AVMUint64')\n}\n\nexport function getABIDecodedValue(type: AVMType | ABIType | ABIReferenceType, bytes: Uint8Array): ABIValue {\n if (type === ABIReferenceType.Asset || type === ABIReferenceType.Application) {\n return new ABIUintType(64).decode(bytes)\n } else if (type === ABIReferenceType.Account) {\n return new ABIAddressType().decode(bytes)\n } else if (isAVMType(type)) {\n return decodeAVMValue(type, bytes)\n }\n return type.decode(bytes)\n}\n\nexport function getABIEncodedValue(type: AVMType | ABIType, value: ABIValue): Uint8Array {\n return isAVMType(type) ? encodeAVMValue(type, value) : type.encode(value)\n}\n"],"mappings":";;;;;;AAMA,IAAY,oEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEF,IAAY,gEAAL;AACL;AACA;AACA;;;AAuDF,IAAa,YAAb,MAAa,UAAU;CACrB,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,QAOT;AACD,OAAK,OAAO,OAAO;AACnB,OAAK,cAAc,OAAO;AAC1B,OAAK,OAAO,OAAO;AACnB,OAAK,UAAU,OAAO;AACtB,OAAK,SAAS,OAAO;AACrB,OAAK,WAAW,OAAO;;;;;;CAOzB,eAAuB;EACrB,MAAM,OAAO,KAAK,KACf,KAAK,QAAQ;AACZ,OAAI,qBAAqB,IAAI,KAAK,IAAI,mBAAmB,IAAI,KAAK,CAAE,QAAO,IAAI;AAC/E,UAAO,IAAI,KAAK;IAChB,CACD,KAAK,IAAI;AAEZ,SAAO,GAAG,KAAK,KAAK,GAAG,KAAK,GADZ,KAAK,QAAQ,SAAS,SAAS,SAAS,KAAK,QAAQ,KAAK;;;;;;CAQ5E,cAA0B;EACxB,MAAM,OAAOA,kBAAO,WAAW,MAAM,KAAK,cAAc,CAAC;AACzD,SAAO,IAAI,WAAW,KAAK,MAAM,GAAG,EAAE,CAAC;;;;;;;;CASzC,OAAO,cAAc,WAA8B;EACjD,MAAM,YAAY,UAAU,QAAQ,IAAI;AACxC,MAAI,cAAc,GAChB,OAAM,IAAI,MAAM,6BAA6B,YAAY;EAG3D,IAAI,UAAU;EACd,IAAI,QAAQ;AACZ,OAAK,IAAI,IAAI,WAAW,IAAI,UAAU,QAAQ,KAAK;GACjD,MAAM,OAAO,UAAU;AAEvB,OAAI,SAAS,IACX,UAAS;YACA,SAAS,KAAK;AACvB,QAAI,UAAU,EAEZ;AAGF,aAAS;AACT,QAAI,UAAU,GAA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,OAA6B;AACvF,QAAO,UAAU,KAAK,GAAG,eAAe,MAAM,MAAM,GAAG,KAAK,OAAO,MAAM"}
|
|
@@ -137,7 +137,7 @@ function arc56MethodToABIMethod(method, appSpec) {
|
|
|
137
137
|
});
|
|
138
138
|
const returns = {
|
|
139
139
|
type: method.returns.type === "void" ? "void" : method.returns.struct ? ABIStructType.fromStruct(method.returns.struct, appSpec.structs) : ABIType.from(method.returns.type),
|
|
140
|
-
|
|
140
|
+
description: method.returns.desc
|
|
141
141
|
};
|
|
142
142
|
return new ABIMethod({
|
|
143
143
|
name: method.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abi-method.mjs","names":["convertedDefaultValue: ABIDefaultValue | undefined"],"sources":["../../../../packages/abi/src/abi-method.ts"],"sourcesContent":["import sha512 from 'js-sha512'\nimport { ABIAddressType, ABIStructType, ABIType, ABIUintType, parseTupleContent } from './abi-type'\nimport { ABIValue } from './abi-value'\nimport { ARC28Event } from './arc28-event'\nimport { AVMType, Arc56Contract, Arc56Method } from './arc56-contract'\n\nexport enum ABITransactionType {\n Txn = 'txn',\n Payment = 'pay',\n KeyRegistration = 'keyreg',\n AssetConfig = 'acfg',\n AssetTransfer = 'axfer',\n AssetFreeze = 'afrz',\n AppCall = 'appl',\n}\nexport enum ABIReferenceType {\n Account = 'account',\n Application = 'application',\n Asset = 'asset',\n}\nexport type ABIMethodArgType = ABIType | ABITransactionType | ABIReferenceType\nexport type ABIMethodReturnType = ABIType | 'void'\n\nexport type ABIMethodArg = {\n type: ABIMethodArgType\n name?: string\n description?: string\n defaultValue?: ABIDefaultValue\n}\n\nexport type ABIMethodReturn = {\n type: ABIMethodReturnType\n description?: string\n}\n\nexport type ABIDefaultValue = {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** Where the default value is coming from */\n source: DefaultValueSource\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABIType | AVMType\n}\n\nexport enum DefaultValueSource {\n Box = 'box',\n Global = 'global',\n Local = 'local',\n Literal = 'literal',\n Method = 'method',\n}\n\n/** Represents an ABI method return value with parsed data. */\nexport type ABIReturn =\n | {\n /** The method that was called. */\n method: ABIMethod\n /** The raw return value as bytes.\n *\n * This is the value from the last app call log with the first 4 bytes (the ABI return prefix) omitted.\n */\n rawReturnValue: Uint8Array\n /** The parsed ABI return value. */\n returnValue: ABIValue\n decodeError: undefined\n }\n | { rawReturnValue?: undefined; returnValue?: undefined; method: ABIMethod; decodeError?: Error }\n\n/** Decoded ARC-56 struct as a struct rather than a tuple. */\nexport type ABIStruct = {\n [key: string]: ABIStruct | ABIValue\n}\n\nexport class ABIMethod {\n readonly name: string\n readonly description?: string\n readonly args: ABIMethodArg[]\n readonly returns: ABIMethodReturn\n readonly events?: ARC28Event[]\n readonly readonly?: boolean\n\n constructor(params: {\n name: string\n description?: string\n args: ABIMethodArg[]\n returns: ABIMethodReturn\n events?: ARC28Event[]\n readonly?: boolean\n }) {\n this.name = params.name\n this.description = params.description\n this.args = params.args\n this.returns = params.returns\n this.events = params.events\n this.readonly = params.readonly\n }\n\n /**\n * Returns the signature of this ABI method.\n * @returns The signature, e.g. `my_method(unit64,string)bytes`\n */\n getSignature(): string {\n const args = this.args\n .map((arg) => {\n if (argTypeIsTransaction(arg.type) || argTypeIsReference(arg.type)) return arg.type\n return arg.type.name\n })\n .join(',')\n const returns = this.returns.type === 'void' ? 'void' : this.returns.type.name\n return `${this.name}(${args})${returns}`\n }\n\n /**\n * Returns the method selector of this ABI method.\n * @returns The 4-byte method selector\n */\n getSelector(): Uint8Array {\n const hash = sha512.sha512_256.array(this.getSignature())\n return new Uint8Array(hash.slice(0, 4))\n }\n\n /**\n * Returns the ABI method object for a given method signature.\n * @param signature The method signature\n * e.g. `my_method(unit64,string)bytes`\n * @returns The `ABIMethod`\n */\n static fromSignature(signature: string): ABIMethod {\n const argsStart = signature.indexOf('(')\n if (argsStart === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n let argsEnd = -1\n let depth = 0\n for (let i = argsStart; i < signature.length; i++) {\n const char = signature[i]\n\n if (char === '(') {\n depth += 1\n } else if (char === ')') {\n if (depth === 0) {\n // unpaired parenthesis\n break\n }\n\n depth -= 1\n if (depth === 0) {\n argsEnd = i\n break\n }\n }\n }\n\n if (argsEnd === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n const name = signature.slice(0, argsStart)\n const args = parseTupleContent(signature.slice(argsStart + 1, argsEnd)).map((n: string) => {\n if (argTypeIsTransaction(n as ABIMethodArgType) || argTypeIsReference(n as ABIMethodArgType)) {\n return { type: n as ABIMethodArgType } satisfies ABIMethodArg\n }\n return { type: ABIType.from(n) } satisfies ABIMethodArg\n })\n const returnType = signature.slice(argsEnd + 1)\n const returns = { type: returnType === 'void' ? ('void' as const) : ABIType.from(returnType) } satisfies ABIMethodReturn\n\n return new ABIMethod({\n name,\n args,\n returns,\n })\n }\n}\n\n/**\n * Returns the ABI method object for a given method name or signature and ARC-56 app spec.\n * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n * e.g. `my_method` or `my_method(unit64,string)bytes`\n * @param appSpec The app spec for the app\n * @returns The `ABIMethod`\n */\nexport function getABIMethod(methodNameOrSignature: string, appSpec: Arc56Contract): ABIMethod {\n if (!methodNameOrSignature.includes('(')) {\n const methods = appSpec.methods.filter((m) => m.name === methodNameOrSignature)\n if (methods.length === 0) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n if (methods.length > 1) {\n throw new Error(\n `Received a call to method ${methodNameOrSignature} in contract ${\n appSpec.name\n }, but this resolved to multiple methods; please pass in an ABI signature instead: ${appSpec.methods\n .map((m) => getArc56MethodSignature(m))\n .join(', ')}`,\n )\n }\n return arc56MethodToABIMethod(methods[0], appSpec)\n } else {\n const method = appSpec.methods.find((m) => getArc56MethodSignature(m) === methodNameOrSignature)\n if (!method) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n return arc56MethodToABIMethod(method, appSpec)\n }\n}\n\nexport function arc56MethodToABIMethod(method: Arc56Method, appSpec: Arc56Contract): ABIMethod {\n if (typeof method.name !== 'string' || typeof method.returns !== 'object' || !Array.isArray(method.args)) {\n throw new Error('Invalid ABIMethod parameters')\n }\n\n const args = method.args.map(({ type, name, desc, struct, defaultValue }) => {\n const convertedDefaultValue: ABIDefaultValue | undefined = defaultValue\n ? {\n data: defaultValue.data,\n source: defaultValue.source as DefaultValueSource,\n type: defaultValue.type ? (isAVMType(defaultValue.type) ? defaultValue.type : ABIType.from(defaultValue.type)) : undefined,\n }\n : undefined\n\n if (argTypeIsTransaction(type as ABIMethodArgType) || argTypeIsReference(type as ABIMethodArgType)) {\n return {\n type: type as ABIMethodArgType,\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n if (struct) {\n return {\n type: ABIStructType.fromStruct(struct, appSpec.structs),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n return {\n type: ABIType.from(type),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n })\n\n const returns = {\n type:\n method.returns.type === ('void' as const)\n ? ('void' as const)\n : method.returns.struct\n ? ABIStructType.fromStruct(method.returns.struct, appSpec.structs)\n : ABIType.from(method.returns.type),\n desc: method.returns.desc,\n }\n\n return new ABIMethod({\n name: method.name,\n description: method.desc,\n args,\n returns,\n events: method.events,\n readonly: method.readonly,\n })\n}\n\nexport function argTypeIsTransaction(type: ABIMethodArgType): type is ABITransactionType {\n return (\n typeof type === 'string' &&\n (type === ABITransactionType.Txn ||\n type === ABITransactionType.Payment ||\n type === ABITransactionType.KeyRegistration ||\n type === ABITransactionType.AssetConfig ||\n type === ABITransactionType.AssetTransfer ||\n type === ABITransactionType.AssetFreeze ||\n type === ABITransactionType.AppCall)\n )\n}\n\nexport function argTypeIsReference(type: ABIMethodArgType): type is ABIReferenceType {\n return (\n typeof type === 'string' &&\n (type === ABIReferenceType.Account || type === ABIReferenceType.Application || type === ABIReferenceType.Asset)\n )\n}\n\nexport function argTypeIsAbiType(type: ABIMethodArgType): type is ABIType {\n return !argTypeIsTransaction(type) && !argTypeIsReference(type)\n}\n\nfunction getArc56MethodSignature(method: Arc56Method): string {\n const args = method.args.map((arg) => arg.type).join(',')\n const returns = method.returns.type\n return `${method.name}(${args})${returns}`\n}\n\nexport function decodeAVMValue(avmType: AVMType, bytes: Uint8Array): ABIValue {\n switch (avmType) {\n case 'AVMString':\n return Buffer.from(bytes).toString('utf-8')\n case 'AVMBytes':\n return bytes\n case 'AVMUint64':\n return ABIType.from('uint64').decode(bytes)\n }\n}\n\nexport function encodeAVMValue(avmType: AVMType, value: ABIValue): Uint8Array {\n switch (avmType) {\n case 'AVMString':\n return ABIType.from('string').encode(value)\n case 'AVMBytes':\n if (typeof value === 'string') return Buffer.from(value, 'utf-8')\n if (typeof value !== 'object' || !(value instanceof Uint8Array))\n throw new Error(`Expected bytes value for AVMBytes, but got ${value}`)\n return value\n case 'AVMUint64':\n return ABIType.from('uint64').encode(value)\n }\n}\n\nexport function isAVMType(type: unknown): type is AVMType {\n return typeof type === 'string' && (type === 'AVMString' || type === 'AVMBytes' || type === 'AVMUint64')\n}\n\nexport function getABIDecodedValue(type: AVMType | ABIType | ABIReferenceType, bytes: Uint8Array): ABIValue {\n if (type === ABIReferenceType.Asset || type === ABIReferenceType.Application) {\n return new ABIUintType(64).decode(bytes)\n } else if (type === ABIReferenceType.Account) {\n return new ABIAddressType().decode(bytes)\n } else if (isAVMType(type)) {\n return decodeAVMValue(type, bytes)\n }\n return type.decode(bytes)\n}\n\nexport function getABIEncodedValue(type: AVMType | ABIType, value: ABIValue): Uint8Array {\n return isAVMType(type) ? encodeAVMValue(type, value) : type.encode(value)\n}\n"],"mappings":";;;;AAMA,IAAY,oEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEF,IAAY,gEAAL;AACL;AACA;AACA;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AAO,GAAG,OAAO,KAAK,GAAG,KAAK,GADd,OAAO,QAAQ;;AAIjC,SAAgB,eAAe,SAAkB,OAA6B;AAC5E,SAAQ,SAAR;EACE,KAAK,YACH,QAAO,OAAO,KAAK,MAAM,CAAC,SAAS,QAAQ;EAC7C,KAAK,WACH,QAAO;EACT,KAAK,YACH,QAAO,QAAQ,KAAK,SAAS,CAAC,OAAO,MAAM;;;AAIjD,SAAgB,eAAe,SAAkB,OAA6B;AAC5E,SAAQ,SAAR;EACE,KAAK,YACH,QAAO,QAAQ,KAAK,SAAS,CAAC,OAAO,MAAM;EAC7C,KAAK;AACH,OAAI,OAAO,UAAU,SAAU,QAAO,OAAO,KAAK,OAAO,QAAQ;AACjE,OAAI,OAAO,UAAU,YAAY,EAAE,iBAAiB,YAClD,OAAM,IAAI,MAAM,8CAA8C,QAAQ;AACxE,UAAO;EACT,KAAK,YACH,QAAO,QAAQ,KAAK,SAAS,CAAC,OAAO,MAAM;;;AAIjD,SAAgB,UAAU,MAAgC;AACxD,QAAO,OAAO,SAAS,aAAa,SAAS,eAAe,SAAS,cAAc,SAAS;;AAG9F,SAAgB,mBAAmB,MAA4C,OAA6B;AAC1G,KAAI,SAAS,iBAAiB,SAAS,SAAS,iBAAiB,YAC/D,QAAO,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM;UAC/B,SAAS,iBAAiB,QACnC,QAAO,IAAI,gBAAgB,CAAC,OAAO,MAAM;UAChC,UAAU,KAAK,CACxB,QAAO,eAAe,MAAM,MAAM;AAEpC,QAAO,KAAK,OAAO,MAAM;;AAG3B,SAAgB,mBAAmB,MAAyB,OAA6B;AACvF,QAAO,UAAU,KAAK,GAAG,eAAe,MAAM,MAAM,GAAG,KAAK,OAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"abi-method.mjs","names":["convertedDefaultValue: ABIDefaultValue | undefined"],"sources":["../../../../packages/abi/src/abi-method.ts"],"sourcesContent":["import sha512 from 'js-sha512'\nimport { ABIAddressType, ABIStructType, ABIType, ABIUintType, parseTupleContent } from './abi-type'\nimport { ABIValue } from './abi-value'\nimport { ARC28Event } from './arc28-event'\nimport { AVMType, Arc56Contract, Arc56Method } from './arc56-contract'\n\nexport enum ABITransactionType {\n Txn = 'txn',\n Payment = 'pay',\n KeyRegistration = 'keyreg',\n AssetConfig = 'acfg',\n AssetTransfer = 'axfer',\n AssetFreeze = 'afrz',\n AppCall = 'appl',\n}\nexport enum ABIReferenceType {\n Account = 'account',\n Application = 'application',\n Asset = 'asset',\n}\nexport type ABIMethodArgType = ABIType | ABITransactionType | ABIReferenceType\nexport type ABIMethodReturnType = ABIType | 'void'\n\nexport type ABIMethodArg = {\n type: ABIMethodArgType\n name?: string\n description?: string\n defaultValue?: ABIDefaultValue\n}\n\nexport type ABIMethodReturn = {\n type: ABIMethodReturnType\n description?: string\n}\n\nexport type ABIDefaultValue = {\n /** Base64 encoded bytes, base64 ARC4 encoded uint64, or UTF-8 method selector */\n data: string\n /** Where the default value is coming from */\n source: DefaultValueSource\n /** How the data is encoded. This is the encoding for the data provided here, not the arg type */\n type?: ABIType | AVMType\n}\n\nexport enum DefaultValueSource {\n Box = 'box',\n Global = 'global',\n Local = 'local',\n Literal = 'literal',\n Method = 'method',\n}\n\n/** Represents an ABI method return value with parsed data. */\nexport type ABIReturn =\n | {\n /** The method that was called. */\n method: ABIMethod\n /** The raw return value as bytes.\n *\n * This is the value from the last app call log with the first 4 bytes (the ABI return prefix) omitted.\n */\n rawReturnValue: Uint8Array\n /** The parsed ABI return value. */\n returnValue: ABIValue\n decodeError: undefined\n }\n | { rawReturnValue?: undefined; returnValue?: undefined; method: ABIMethod; decodeError?: Error }\n\n/** Decoded ARC-56 struct as a struct rather than a tuple. */\nexport type ABIStruct = {\n [key: string]: ABIStruct | ABIValue\n}\n\nexport class ABIMethod {\n readonly name: string\n readonly description?: string\n readonly args: ABIMethodArg[]\n readonly returns: ABIMethodReturn\n readonly events?: ARC28Event[]\n readonly readonly?: boolean\n\n constructor(params: {\n name: string\n description?: string\n args: ABIMethodArg[]\n returns: ABIMethodReturn\n events?: ARC28Event[]\n readonly?: boolean\n }) {\n this.name = params.name\n this.description = params.description\n this.args = params.args\n this.returns = params.returns\n this.events = params.events\n this.readonly = params.readonly\n }\n\n /**\n * Returns the signature of this ABI method.\n * @returns The signature, e.g. `my_method(unit64,string)bytes`\n */\n getSignature(): string {\n const args = this.args\n .map((arg) => {\n if (argTypeIsTransaction(arg.type) || argTypeIsReference(arg.type)) return arg.type\n return arg.type.name\n })\n .join(',')\n const returns = this.returns.type === 'void' ? 'void' : this.returns.type.name\n return `${this.name}(${args})${returns}`\n }\n\n /**\n * Returns the method selector of this ABI method.\n * @returns The 4-byte method selector\n */\n getSelector(): Uint8Array {\n const hash = sha512.sha512_256.array(this.getSignature())\n return new Uint8Array(hash.slice(0, 4))\n }\n\n /**\n * Returns the ABI method object for a given method signature.\n * @param signature The method signature\n * e.g. `my_method(unit64,string)bytes`\n * @returns The `ABIMethod`\n */\n static fromSignature(signature: string): ABIMethod {\n const argsStart = signature.indexOf('(')\n if (argsStart === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n let argsEnd = -1\n let depth = 0\n for (let i = argsStart; i < signature.length; i++) {\n const char = signature[i]\n\n if (char === '(') {\n depth += 1\n } else if (char === ')') {\n if (depth === 0) {\n // unpaired parenthesis\n break\n }\n\n depth -= 1\n if (depth === 0) {\n argsEnd = i\n break\n }\n }\n }\n\n if (argsEnd === -1) {\n throw new Error(`Invalid method signature: ${signature}`)\n }\n\n const name = signature.slice(0, argsStart)\n const args = parseTupleContent(signature.slice(argsStart + 1, argsEnd)).map((n: string) => {\n if (argTypeIsTransaction(n as ABIMethodArgType) || argTypeIsReference(n as ABIMethodArgType)) {\n return { type: n as ABIMethodArgType } satisfies ABIMethodArg\n }\n return { type: ABIType.from(n) } satisfies ABIMethodArg\n })\n const returnType = signature.slice(argsEnd + 1)\n const returns = { type: returnType === 'void' ? ('void' as const) : ABIType.from(returnType) } satisfies ABIMethodReturn\n\n return new ABIMethod({\n name,\n args,\n returns,\n })\n }\n}\n\n/**\n * Returns the ABI method object for a given method name or signature and ARC-56 app spec.\n * @param methodNameOrSignature The method name or method signature to call if an ABI call is being emitted.\n * e.g. `my_method` or `my_method(unit64,string)bytes`\n * @param appSpec The app spec for the app\n * @returns The `ABIMethod`\n */\nexport function getABIMethod(methodNameOrSignature: string, appSpec: Arc56Contract): ABIMethod {\n if (!methodNameOrSignature.includes('(')) {\n const methods = appSpec.methods.filter((m) => m.name === methodNameOrSignature)\n if (methods.length === 0) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n if (methods.length > 1) {\n throw new Error(\n `Received a call to method ${methodNameOrSignature} in contract ${\n appSpec.name\n }, but this resolved to multiple methods; please pass in an ABI signature instead: ${appSpec.methods\n .map((m) => getArc56MethodSignature(m))\n .join(', ')}`,\n )\n }\n return arc56MethodToABIMethod(methods[0], appSpec)\n } else {\n const method = appSpec.methods.find((m) => getArc56MethodSignature(m) === methodNameOrSignature)\n if (!method) throw new Error(`Unable to find method ${methodNameOrSignature} in ${appSpec.name} app.`)\n return arc56MethodToABIMethod(method, appSpec)\n }\n}\n\nexport function arc56MethodToABIMethod(method: Arc56Method, appSpec: Arc56Contract): ABIMethod {\n if (typeof method.name !== 'string' || typeof method.returns !== 'object' || !Array.isArray(method.args)) {\n throw new Error('Invalid ABIMethod parameters')\n }\n\n const args = method.args.map(({ type, name, desc, struct, defaultValue }) => {\n const convertedDefaultValue: ABIDefaultValue | undefined = defaultValue\n ? {\n data: defaultValue.data,\n source: defaultValue.source as DefaultValueSource,\n type: defaultValue.type ? (isAVMType(defaultValue.type) ? defaultValue.type : ABIType.from(defaultValue.type)) : undefined,\n }\n : undefined\n\n if (argTypeIsTransaction(type as ABIMethodArgType) || argTypeIsReference(type as ABIMethodArgType)) {\n return {\n type: type as ABIMethodArgType,\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n if (struct) {\n return {\n type: ABIStructType.fromStruct(struct, appSpec.structs),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n }\n\n return {\n type: ABIType.from(type),\n name,\n description: desc,\n defaultValue: convertedDefaultValue,\n } satisfies ABIMethodArg\n })\n\n const returns = {\n type:\n method.returns.type === ('void' as const)\n ? ('void' as const)\n : method.returns.struct\n ? ABIStructType.fromStruct(method.returns.struct, appSpec.structs)\n : ABIType.from(method.returns.type),\n description: method.returns.desc,\n } satisfies ABIMethodReturn\n\n return new ABIMethod({\n name: method.name,\n description: method.desc,\n args,\n returns,\n events: method.events,\n readonly: method.readonly,\n })\n}\n\nexport function argTypeIsTransaction(type: ABIMethodArgType): type is ABITransactionType {\n return (\n typeof type === 'string' &&\n (type === ABITransactionType.Txn ||\n type === ABITransactionType.Payment ||\n type === ABITransactionType.KeyRegistration ||\n type === ABITransactionType.AssetConfig ||\n type === ABITransactionType.AssetTransfer ||\n type === ABITransactionType.AssetFreeze ||\n type === ABITransactionType.AppCall)\n )\n}\n\nexport function argTypeIsReference(type: ABIMethodArgType): type is ABIReferenceType {\n return (\n typeof type === 'string' &&\n (type === ABIReferenceType.Account || type === ABIReferenceType.Application || type === ABIReferenceType.Asset)\n )\n}\n\nexport function argTypeIsAbiType(type: ABIMethodArgType): type is ABIType {\n return !argTypeIsTransaction(type) && !argTypeIsReference(type)\n}\n\nfunction getArc56MethodSignature(method: Arc56Method): string {\n const args = method.args.map((arg) => arg.type).join(',')\n const returns = method.returns.type\n return `${method.name}(${args})${returns}`\n}\n\nexport function decodeAVMValue(avmType: AVMType, bytes: Uint8Array): ABIValue {\n switch (avmType) {\n case 'AVMString':\n return Buffer.from(bytes).toString('utf-8')\n case 'AVMBytes':\n return bytes\n case 'AVMUint64':\n return ABIType.from('uint64').decode(bytes)\n }\n}\n\nexport function encodeAVMValue(avmType: AVMType, value: ABIValue): Uint8Array {\n switch (avmType) {\n case 'AVMString':\n return ABIType.from('string').encode(value)\n case 'AVMBytes':\n if (typeof value === 'string') return Buffer.from(value, 'utf-8')\n if (typeof value !== 'object' || !(value instanceof Uint8Array))\n throw new Error(`Expected bytes value for AVMBytes, but got ${value}`)\n return value\n case 'AVMUint64':\n return ABIType.from('uint64').encode(value)\n }\n}\n\nexport function isAVMType(type: unknown): type is AVMType {\n return typeof type === 'string' && (type === 'AVMString' || type === 'AVMBytes' || type === 'AVMUint64')\n}\n\nexport function getABIDecodedValue(type: AVMType | ABIType | ABIReferenceType, bytes: Uint8Array): ABIValue {\n if (type === ABIReferenceType.Asset || type === ABIReferenceType.Application) {\n return new ABIUintType(64).decode(bytes)\n } else if (type === ABIReferenceType.Account) {\n return new ABIAddressType().decode(bytes)\n } else if (isAVMType(type)) {\n return decodeAVMValue(type, bytes)\n }\n return type.decode(bytes)\n}\n\nexport function getABIEncodedValue(type: AVMType | ABIType, value: ABIValue): Uint8Array {\n return isAVMType(type) ? encodeAVMValue(type, value) : type.encode(value)\n}\n"],"mappings":";;;;AAMA,IAAY,oEAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;;AAEF,IAAY,gEAAL;AACL;AACA;AACA;;;AAuDF,IAAa,YAAb,MAAa,UAAU;CACrB,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CACT,AAAS;CAET,YAAY,QAOT;AACD,OAAK,OAAO,OAAO;AACnB,OAAK,cAAc,OAAO;AAC1B,OAAK,OAAO,OAAO;AACnB,OAAK,UAAU,OAAO;AACtB,OAAK,SAAS,OAAO;AACrB,OAAK,WAAW,OAAO;;;;;;CAOzB,eAAuB;EACrB,MAAM,OAAO,KAAK,KACf,KAAK,QAAQ;AACZ,OAAI,qBAAqB,IAAI,KAAK,IAAI,mBAAmB,IAAI,KAAK,CAAE,QAAO,IAAI;AAC/E,UAAO,IAAI,KAAK;IAChB,CACD,KAAK,IAAI;AAEZ,SAAO,GAAG,KAAK,KAAK,GAAG,KAAK,GADZ,KAAK,QAAQ,SAAS,SAAS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AQ;AACxE,UAAO;EACT,KAAK,YACH,QAAO,QAAQ,KAAK,SAAS,CAAC,OAAO,MAAM;;;AAIjD,SAAgB,UAAU,MAAgC;AACxD,QAAO,OAAO,SAAS,aAAa,SAAS,eAAe,SAAS,cAAc,SAAS;;AAG9F,SAAgB,mBAAmB,MAA4C,OAA6B;AAC1G,KAAI,SAAS,iBAAiB,SAAS,SAAS,iBAAiB,YAC/D,QAAO,IAAI,YAAY,GAAG,CAAC,OAAO,MAAM;UAC/B,SAAS,iBAAiB,QACnC,QAAO,IAAI,gBAAgB,CAAC,OAAO,MAAM;UAChC,UAAU,KAAK,CACxB,QAAO,eAAe,MAAM,MAAM;AAEpC,QAAO,KAAK,OAAO,MAAM;;AAG3B,SAAgB,mBAAmB,MAAyB,OAA6B;AACvF,QAAO,UAAU,KAAK,GAAG,eAAe,MAAM,MAAM,GAAG,KAAK,OAAO,MAAM"}
|
|
@@ -348,8 +348,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
348
348
|
* @returns The application create transaction
|
|
349
349
|
*/
|
|
350
350
|
appCreate: (params: {
|
|
351
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
351
352
|
sender: SendingAddress;
|
|
352
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
353
353
|
rekeyTo?: ReadableAddress | undefined;
|
|
354
354
|
note?: string | Uint8Array | undefined;
|
|
355
355
|
lease?: string | Uint8Array | undefined;
|
|
@@ -417,7 +417,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
417
417
|
*/
|
|
418
418
|
appUpdate: (params: {
|
|
419
419
|
sender: SendingAddress;
|
|
420
|
-
signer?:
|
|
420
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
421
421
|
rekeyTo?: ReadableAddress | undefined;
|
|
422
422
|
note?: string | Uint8Array | undefined;
|
|
423
423
|
lease?: string | Uint8Array | undefined;
|
|
@@ -568,9 +568,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
568
568
|
* @returns The application ABI method create transaction
|
|
569
569
|
*/
|
|
570
570
|
appCreateMethodCall: (params: {
|
|
571
|
-
|
|
571
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
572
572
|
sender: SendingAddress;
|
|
573
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
574
573
|
rekeyTo?: ReadableAddress | undefined;
|
|
575
574
|
note?: string | Uint8Array | undefined;
|
|
576
575
|
lease?: string | Uint8Array | undefined;
|
|
@@ -580,6 +579,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
580
579
|
validityWindow?: number | bigint | undefined;
|
|
581
580
|
firstValidRound?: bigint | undefined;
|
|
582
581
|
lastValidRound?: bigint | undefined;
|
|
582
|
+
appId?: 0 | undefined;
|
|
583
583
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication | undefined;
|
|
584
584
|
accountReferences?: ReadableAddress[] | undefined;
|
|
585
585
|
appReferences?: bigint[] | undefined;
|
|
@@ -598,8 +598,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
598
598
|
extraProgramPages?: number | undefined;
|
|
599
599
|
method: ABIMethod;
|
|
600
600
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
601
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
601
602
|
sender: SendingAddress;
|
|
602
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
603
603
|
rekeyTo?: ReadableAddress | undefined;
|
|
604
604
|
note?: string | Uint8Array | undefined;
|
|
605
605
|
lease?: string | Uint8Array | undefined;
|
|
@@ -629,7 +629,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
629
629
|
extraProgramPages?: number | undefined;
|
|
630
630
|
}> | AppMethodCall<{
|
|
631
631
|
sender: SendingAddress;
|
|
632
|
-
signer?:
|
|
632
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
633
633
|
rekeyTo?: ReadableAddress | undefined;
|
|
634
634
|
note?: string | Uint8Array | undefined;
|
|
635
635
|
lease?: string | Uint8Array | undefined;
|
|
@@ -702,9 +702,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
702
702
|
* @returns The application ABI method update transaction
|
|
703
703
|
*/
|
|
704
704
|
appUpdateMethodCall: (params: {
|
|
705
|
-
|
|
705
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
706
706
|
sender: SendingAddress;
|
|
707
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
708
707
|
rekeyTo?: ReadableAddress | undefined;
|
|
709
708
|
note?: string | Uint8Array | undefined;
|
|
710
709
|
lease?: string | Uint8Array | undefined;
|
|
@@ -714,6 +713,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
714
713
|
validityWindow?: number | bigint | undefined;
|
|
715
714
|
firstValidRound?: bigint | undefined;
|
|
716
715
|
lastValidRound?: bigint | undefined;
|
|
716
|
+
appId: bigint;
|
|
717
717
|
onComplete?: OnApplicationComplete.UpdateApplication | undefined;
|
|
718
718
|
accountReferences?: ReadableAddress[] | undefined;
|
|
719
719
|
appReferences?: bigint[] | undefined;
|
|
@@ -725,8 +725,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
725
725
|
clearStateProgram: string | Uint8Array;
|
|
726
726
|
method: ABIMethod;
|
|
727
727
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
728
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
728
729
|
sender: SendingAddress;
|
|
729
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
730
730
|
rekeyTo?: ReadableAddress | undefined;
|
|
731
731
|
note?: string | Uint8Array | undefined;
|
|
732
732
|
lease?: string | Uint8Array | undefined;
|
|
@@ -756,7 +756,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
756
756
|
extraProgramPages?: number | undefined;
|
|
757
757
|
}> | AppMethodCall<{
|
|
758
758
|
sender: SendingAddress;
|
|
759
|
-
signer?:
|
|
759
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
760
760
|
rekeyTo?: ReadableAddress | undefined;
|
|
761
761
|
note?: string | Uint8Array | undefined;
|
|
762
762
|
lease?: string | Uint8Array | undefined;
|
|
@@ -827,9 +827,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
827
827
|
* @returns The application ABI method delete transaction
|
|
828
828
|
*/
|
|
829
829
|
appDeleteMethodCall: (params: {
|
|
830
|
-
|
|
830
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
831
831
|
sender: SendingAddress;
|
|
832
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
833
832
|
rekeyTo?: ReadableAddress | undefined;
|
|
834
833
|
note?: string | Uint8Array | undefined;
|
|
835
834
|
lease?: string | Uint8Array | undefined;
|
|
@@ -839,6 +838,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
839
838
|
validityWindow?: number | bigint | undefined;
|
|
840
839
|
firstValidRound?: bigint | undefined;
|
|
841
840
|
lastValidRound?: bigint | undefined;
|
|
841
|
+
appId: bigint;
|
|
842
842
|
onComplete?: OnApplicationComplete.DeleteApplication | undefined;
|
|
843
843
|
accountReferences?: ReadableAddress[] | undefined;
|
|
844
844
|
appReferences?: bigint[] | undefined;
|
|
@@ -848,8 +848,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
848
848
|
rejectVersion?: number | undefined;
|
|
849
849
|
method: ABIMethod;
|
|
850
850
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
851
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
851
852
|
sender: SendingAddress;
|
|
852
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
853
853
|
rekeyTo?: ReadableAddress | undefined;
|
|
854
854
|
note?: string | Uint8Array | undefined;
|
|
855
855
|
lease?: string | Uint8Array | undefined;
|
|
@@ -879,7 +879,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
879
879
|
extraProgramPages?: number | undefined;
|
|
880
880
|
}> | AppMethodCall<{
|
|
881
881
|
sender: SendingAddress;
|
|
882
|
-
signer?:
|
|
882
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
883
883
|
rekeyTo?: ReadableAddress | undefined;
|
|
884
884
|
note?: string | Uint8Array | undefined;
|
|
885
885
|
lease?: string | Uint8Array | undefined;
|
|
@@ -950,9 +950,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
950
950
|
* @returns The application ABI method call transaction
|
|
951
951
|
*/
|
|
952
952
|
appCallMethodCall: (params: {
|
|
953
|
-
|
|
953
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
954
954
|
sender: SendingAddress;
|
|
955
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
956
955
|
rekeyTo?: ReadableAddress | undefined;
|
|
957
956
|
note?: string | Uint8Array | undefined;
|
|
958
957
|
lease?: string | Uint8Array | undefined;
|
|
@@ -962,6 +961,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
962
961
|
validityWindow?: number | bigint | undefined;
|
|
963
962
|
firstValidRound?: bigint | undefined;
|
|
964
963
|
lastValidRound?: bigint | undefined;
|
|
964
|
+
appId: bigint;
|
|
965
965
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.DeleteApplication | undefined;
|
|
966
966
|
accountReferences?: ReadableAddress[] | undefined;
|
|
967
967
|
appReferences?: bigint[] | undefined;
|
|
@@ -971,8 +971,8 @@ declare class AlgorandClientTransactionCreator {
|
|
|
971
971
|
rejectVersion?: number | undefined;
|
|
972
972
|
method: ABIMethod;
|
|
973
973
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
974
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
974
975
|
sender: SendingAddress;
|
|
975
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
976
976
|
rekeyTo?: ReadableAddress | undefined;
|
|
977
977
|
note?: string | Uint8Array | undefined;
|
|
978
978
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1002,7 +1002,7 @@ declare class AlgorandClientTransactionCreator {
|
|
|
1002
1002
|
extraProgramPages?: number | undefined;
|
|
1003
1003
|
}> | AppMethodCall<{
|
|
1004
1004
|
sender: SendingAddress;
|
|
1005
|
-
signer?:
|
|
1005
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1006
1006
|
rekeyTo?: ReadableAddress | undefined;
|
|
1007
1007
|
note?: string | Uint8Array | undefined;
|
|
1008
1008
|
lease?: string | Uint8Array | undefined;
|
|
@@ -479,8 +479,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
479
479
|
* @returns The result of the app create transaction and the transaction that was sent
|
|
480
480
|
*/
|
|
481
481
|
appCreate: (params: {
|
|
482
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
482
483
|
sender: SendingAddress;
|
|
483
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
484
484
|
rekeyTo?: ReadableAddress | undefined;
|
|
485
485
|
note?: string | Uint8Array | undefined;
|
|
486
486
|
lease?: string | Uint8Array | undefined;
|
|
@@ -555,7 +555,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
555
555
|
*/
|
|
556
556
|
appUpdate: (params: {
|
|
557
557
|
sender: SendingAddress;
|
|
558
|
-
signer?:
|
|
558
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
559
559
|
rekeyTo?: ReadableAddress | undefined;
|
|
560
560
|
note?: string | Uint8Array | undefined;
|
|
561
561
|
lease?: string | Uint8Array | undefined;
|
|
@@ -752,9 +752,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
752
752
|
* @returns The result of the application ABI method create transaction and the transaction that was sent
|
|
753
753
|
*/
|
|
754
754
|
appCreateMethodCall: (params: {
|
|
755
|
-
|
|
755
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
756
756
|
sender: SendingAddress;
|
|
757
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
758
757
|
rekeyTo?: ReadableAddress | undefined;
|
|
759
758
|
note?: string | Uint8Array | undefined;
|
|
760
759
|
lease?: string | Uint8Array | undefined;
|
|
@@ -764,6 +763,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
764
763
|
validityWindow?: number | bigint | undefined;
|
|
765
764
|
firstValidRound?: bigint | undefined;
|
|
766
765
|
lastValidRound?: bigint | undefined;
|
|
766
|
+
appId?: 0 | undefined;
|
|
767
767
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication | undefined;
|
|
768
768
|
accountReferences?: ReadableAddress[] | undefined;
|
|
769
769
|
appReferences?: bigint[] | undefined;
|
|
@@ -782,8 +782,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
782
782
|
extraProgramPages?: number | undefined;
|
|
783
783
|
method: ABIMethod;
|
|
784
784
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
785
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
785
786
|
sender: SendingAddress;
|
|
786
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
787
787
|
rekeyTo?: ReadableAddress | undefined;
|
|
788
788
|
note?: string | Uint8Array | undefined;
|
|
789
789
|
lease?: string | Uint8Array | undefined;
|
|
@@ -813,7 +813,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
813
813
|
extraProgramPages?: number | undefined;
|
|
814
814
|
}> | AppMethodCall<{
|
|
815
815
|
sender: SendingAddress;
|
|
816
|
-
signer?:
|
|
816
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
817
817
|
rekeyTo?: ReadableAddress | undefined;
|
|
818
818
|
note?: string | Uint8Array | undefined;
|
|
819
819
|
lease?: string | Uint8Array | undefined;
|
|
@@ -893,9 +893,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
893
893
|
* @returns The result of the application ABI method update transaction and the transaction that was sent
|
|
894
894
|
*/
|
|
895
895
|
appUpdateMethodCall: (params: {
|
|
896
|
-
|
|
896
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
897
897
|
sender: SendingAddress;
|
|
898
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
899
898
|
rekeyTo?: ReadableAddress | undefined;
|
|
900
899
|
note?: string | Uint8Array | undefined;
|
|
901
900
|
lease?: string | Uint8Array | undefined;
|
|
@@ -905,6 +904,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
905
904
|
validityWindow?: number | bigint | undefined;
|
|
906
905
|
firstValidRound?: bigint | undefined;
|
|
907
906
|
lastValidRound?: bigint | undefined;
|
|
907
|
+
appId: bigint;
|
|
908
908
|
onComplete?: OnApplicationComplete.UpdateApplication | undefined;
|
|
909
909
|
accountReferences?: ReadableAddress[] | undefined;
|
|
910
910
|
appReferences?: bigint[] | undefined;
|
|
@@ -916,8 +916,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
916
916
|
clearStateProgram: string | Uint8Array;
|
|
917
917
|
method: ABIMethod;
|
|
918
918
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
919
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
919
920
|
sender: SendingAddress;
|
|
920
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
921
921
|
rekeyTo?: ReadableAddress | undefined;
|
|
922
922
|
note?: string | Uint8Array | undefined;
|
|
923
923
|
lease?: string | Uint8Array | undefined;
|
|
@@ -947,7 +947,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
947
947
|
extraProgramPages?: number | undefined;
|
|
948
948
|
}> | AppMethodCall<{
|
|
949
949
|
sender: SendingAddress;
|
|
950
|
-
signer?:
|
|
950
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
951
951
|
rekeyTo?: ReadableAddress | undefined;
|
|
952
952
|
note?: string | Uint8Array | undefined;
|
|
953
953
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1025,9 +1025,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
1025
1025
|
* @returns The result of the application ABI method delete transaction and the transaction that was sent
|
|
1026
1026
|
*/
|
|
1027
1027
|
appDeleteMethodCall: (params: {
|
|
1028
|
-
|
|
1028
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1029
1029
|
sender: SendingAddress;
|
|
1030
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
1031
1030
|
rekeyTo?: ReadableAddress | undefined;
|
|
1032
1031
|
note?: string | Uint8Array | undefined;
|
|
1033
1032
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1037,6 +1036,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
1037
1036
|
validityWindow?: number | bigint | undefined;
|
|
1038
1037
|
firstValidRound?: bigint | undefined;
|
|
1039
1038
|
lastValidRound?: bigint | undefined;
|
|
1039
|
+
appId: bigint;
|
|
1040
1040
|
onComplete?: OnApplicationComplete.DeleteApplication | undefined;
|
|
1041
1041
|
accountReferences?: ReadableAddress[] | undefined;
|
|
1042
1042
|
appReferences?: bigint[] | undefined;
|
|
@@ -1046,8 +1046,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
1046
1046
|
rejectVersion?: number | undefined;
|
|
1047
1047
|
method: ABIMethod;
|
|
1048
1048
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
1049
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1049
1050
|
sender: SendingAddress;
|
|
1050
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
1051
1051
|
rekeyTo?: ReadableAddress | undefined;
|
|
1052
1052
|
note?: string | Uint8Array | undefined;
|
|
1053
1053
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1077,7 +1077,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
1077
1077
|
extraProgramPages?: number | undefined;
|
|
1078
1078
|
}> | AppMethodCall<{
|
|
1079
1079
|
sender: SendingAddress;
|
|
1080
|
-
signer?:
|
|
1080
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1081
1081
|
rekeyTo?: ReadableAddress | undefined;
|
|
1082
1082
|
note?: string | Uint8Array | undefined;
|
|
1083
1083
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1155,9 +1155,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
1155
1155
|
* @returns The result of the application ABI method call transaction and the transaction that was sent
|
|
1156
1156
|
*/
|
|
1157
1157
|
appCallMethodCall: (params: {
|
|
1158
|
-
|
|
1158
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1159
1159
|
sender: SendingAddress;
|
|
1160
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
1161
1160
|
rekeyTo?: ReadableAddress | undefined;
|
|
1162
1161
|
note?: string | Uint8Array | undefined;
|
|
1163
1162
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1167,6 +1166,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
1167
1166
|
validityWindow?: number | bigint | undefined;
|
|
1168
1167
|
firstValidRound?: bigint | undefined;
|
|
1169
1168
|
lastValidRound?: bigint | undefined;
|
|
1169
|
+
appId: bigint;
|
|
1170
1170
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.DeleteApplication | undefined;
|
|
1171
1171
|
accountReferences?: ReadableAddress[] | undefined;
|
|
1172
1172
|
appReferences?: bigint[] | undefined;
|
|
@@ -1176,8 +1176,8 @@ declare class AlgorandClientTransactionSender {
|
|
|
1176
1176
|
rejectVersion?: number | undefined;
|
|
1177
1177
|
method: ABIMethod;
|
|
1178
1178
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
1179
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1179
1180
|
sender: SendingAddress;
|
|
1180
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
1181
1181
|
rekeyTo?: ReadableAddress | undefined;
|
|
1182
1182
|
note?: string | Uint8Array | undefined;
|
|
1183
1183
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1207,7 +1207,7 @@ declare class AlgorandClientTransactionSender {
|
|
|
1207
1207
|
extraProgramPages?: number | undefined;
|
|
1208
1208
|
}> | AppMethodCall<{
|
|
1209
1209
|
sender: SendingAddress;
|
|
1210
|
-
signer?:
|
|
1210
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1211
1211
|
rekeyTo?: ReadableAddress | undefined;
|
|
1212
1212
|
note?: string | Uint8Array | undefined;
|
|
1213
1213
|
lease?: string | Uint8Array | undefined;
|
package/types/app-client.d.ts
CHANGED
|
@@ -386,7 +386,8 @@ declare class AppClient {
|
|
|
386
386
|
* @returns The parameters which can be used to create a fund app account payment transaction
|
|
387
387
|
*/
|
|
388
388
|
fundAppAccount: (params: {
|
|
389
|
-
signer?:
|
|
389
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
390
|
+
amount: AlgoAmount;
|
|
390
391
|
rekeyTo?: ReadableAddress | undefined;
|
|
391
392
|
note?: string | Uint8Array | undefined;
|
|
392
393
|
lease?: string | Uint8Array | undefined;
|
|
@@ -396,7 +397,6 @@ declare class AppClient {
|
|
|
396
397
|
validityWindow?: number | bigint | undefined;
|
|
397
398
|
firstValidRound?: bigint | undefined;
|
|
398
399
|
lastValidRound?: bigint | undefined;
|
|
399
|
-
amount: AlgoAmount;
|
|
400
400
|
closeRemainderTo?: ReadableAddress | undefined;
|
|
401
401
|
maxRoundsToWaitForConfirmation?: number | undefined;
|
|
402
402
|
suppressLog?: boolean | undefined;
|
|
@@ -405,8 +405,9 @@ declare class AppClient {
|
|
|
405
405
|
sender?: ReadableAddress | undefined;
|
|
406
406
|
}) => {
|
|
407
407
|
sender: Address;
|
|
408
|
-
signer:
|
|
408
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
409
409
|
receiver: Address;
|
|
410
|
+
amount: AlgoAmount;
|
|
410
411
|
rekeyTo?: ReadableAddress | undefined;
|
|
411
412
|
note?: string | Uint8Array | undefined;
|
|
412
413
|
lease?: string | Uint8Array | undefined;
|
|
@@ -416,7 +417,6 @@ declare class AppClient {
|
|
|
416
417
|
validityWindow?: number | bigint | undefined;
|
|
417
418
|
firstValidRound?: bigint | undefined;
|
|
418
419
|
lastValidRound?: bigint | undefined;
|
|
419
|
-
amount: AlgoAmount;
|
|
420
420
|
closeRemainderTo?: ReadableAddress | undefined;
|
|
421
421
|
maxRoundsToWaitForConfirmation?: number | undefined;
|
|
422
422
|
suppressLog?: boolean | undefined;
|
|
@@ -429,7 +429,7 @@ declare class AppClient {
|
|
|
429
429
|
* @returns The parameters which can be used to create an update ABI method call
|
|
430
430
|
*/
|
|
431
431
|
update: (params: {
|
|
432
|
-
signer?:
|
|
432
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
433
433
|
rekeyTo?: ReadableAddress | undefined;
|
|
434
434
|
note?: string | Uint8Array | undefined;
|
|
435
435
|
lease?: string | Uint8Array | undefined;
|
|
@@ -456,7 +456,7 @@ declare class AppClient {
|
|
|
456
456
|
clearStateProgram: Uint8Array;
|
|
457
457
|
compiledApproval?: CompiledTeal | undefined;
|
|
458
458
|
compiledClear?: CompiledTeal | undefined;
|
|
459
|
-
signer?:
|
|
459
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
460
460
|
rekeyTo?: ReadableAddress | undefined;
|
|
461
461
|
note?: string | Uint8Array | undefined;
|
|
462
462
|
lease?: string | Uint8Array | undefined;
|
|
@@ -485,12 +485,12 @@ declare class AppClient {
|
|
|
485
485
|
} & {
|
|
486
486
|
appId: bigint;
|
|
487
487
|
sender: Address;
|
|
488
|
-
signer:
|
|
488
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
489
489
|
method: ABIMethod;
|
|
490
490
|
onComplete: OnApplicationComplete.UpdateApplication;
|
|
491
491
|
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
492
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
492
493
|
sender: SendingAddress;
|
|
493
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
494
494
|
rekeyTo?: ReadableAddress | undefined;
|
|
495
495
|
note?: string | Uint8Array | undefined;
|
|
496
496
|
lease?: string | Uint8Array | undefined;
|
|
@@ -520,7 +520,7 @@ declare class AppClient {
|
|
|
520
520
|
extraProgramPages?: number | undefined;
|
|
521
521
|
}> | AppMethodCall<{
|
|
522
522
|
sender: SendingAddress;
|
|
523
|
-
signer?:
|
|
523
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
524
524
|
rekeyTo?: ReadableAddress | undefined;
|
|
525
525
|
note?: string | Uint8Array | undefined;
|
|
526
526
|
lease?: string | Uint8Array | undefined;
|
|
@@ -549,7 +549,7 @@ declare class AppClient {
|
|
|
549
549
|
* @returns The parameters which can be used to create an opt-in ABI method call
|
|
550
550
|
*/
|
|
551
551
|
optIn: (params: {
|
|
552
|
-
signer?:
|
|
552
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
553
553
|
rekeyTo?: ReadableAddress | undefined;
|
|
554
554
|
note?: string | Uint8Array | undefined;
|
|
555
555
|
lease?: string | Uint8Array | undefined;
|
|
@@ -570,9 +570,8 @@ declare class AppClient {
|
|
|
570
570
|
method: string;
|
|
571
571
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
572
572
|
}) => Promise<{
|
|
573
|
-
|
|
573
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
574
574
|
sender: SendingAddress;
|
|
575
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
576
575
|
rekeyTo?: ReadableAddress | undefined;
|
|
577
576
|
note?: string | Uint8Array | undefined;
|
|
578
577
|
lease?: string | Uint8Array | undefined;
|
|
@@ -582,6 +581,7 @@ declare class AppClient {
|
|
|
582
581
|
validityWindow?: number | bigint | undefined;
|
|
583
582
|
firstValidRound?: bigint | undefined;
|
|
584
583
|
lastValidRound?: bigint | undefined;
|
|
584
|
+
appId: bigint;
|
|
585
585
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.DeleteApplication | undefined;
|
|
586
586
|
accountReferences?: ReadableAddress[] | undefined;
|
|
587
587
|
appReferences?: bigint[] | undefined;
|
|
@@ -591,8 +591,8 @@ declare class AppClient {
|
|
|
591
591
|
rejectVersion?: number | undefined;
|
|
592
592
|
method: ABIMethod;
|
|
593
593
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
594
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
594
595
|
sender: SendingAddress;
|
|
595
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
596
596
|
rekeyTo?: ReadableAddress | undefined;
|
|
597
597
|
note?: string | Uint8Array | undefined;
|
|
598
598
|
lease?: string | Uint8Array | undefined;
|
|
@@ -622,7 +622,7 @@ declare class AppClient {
|
|
|
622
622
|
extraProgramPages?: number | undefined;
|
|
623
623
|
}> | AppMethodCall<{
|
|
624
624
|
sender: SendingAddress;
|
|
625
|
-
signer?:
|
|
625
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
626
626
|
rekeyTo?: ReadableAddress | undefined;
|
|
627
627
|
note?: string | Uint8Array | undefined;
|
|
628
628
|
lease?: string | Uint8Array | undefined;
|
|
@@ -651,7 +651,7 @@ declare class AppClient {
|
|
|
651
651
|
* @returns The parameters which can be used to create a delete ABI method call
|
|
652
652
|
*/
|
|
653
653
|
delete: (params: {
|
|
654
|
-
signer?:
|
|
654
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
655
655
|
rekeyTo?: ReadableAddress | undefined;
|
|
656
656
|
note?: string | Uint8Array | undefined;
|
|
657
657
|
lease?: string | Uint8Array | undefined;
|
|
@@ -672,9 +672,8 @@ declare class AppClient {
|
|
|
672
672
|
method: string;
|
|
673
673
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
674
674
|
}) => Promise<{
|
|
675
|
-
|
|
675
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
676
676
|
sender: SendingAddress;
|
|
677
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
678
677
|
rekeyTo?: ReadableAddress | undefined;
|
|
679
678
|
note?: string | Uint8Array | undefined;
|
|
680
679
|
lease?: string | Uint8Array | undefined;
|
|
@@ -684,6 +683,7 @@ declare class AppClient {
|
|
|
684
683
|
validityWindow?: number | bigint | undefined;
|
|
685
684
|
firstValidRound?: bigint | undefined;
|
|
686
685
|
lastValidRound?: bigint | undefined;
|
|
686
|
+
appId: bigint;
|
|
687
687
|
onComplete?: OnApplicationComplete.DeleteApplication | undefined;
|
|
688
688
|
accountReferences?: ReadableAddress[] | undefined;
|
|
689
689
|
appReferences?: bigint[] | undefined;
|
|
@@ -693,8 +693,8 @@ declare class AppClient {
|
|
|
693
693
|
rejectVersion?: number | undefined;
|
|
694
694
|
method: ABIMethod;
|
|
695
695
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
696
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
696
697
|
sender: SendingAddress;
|
|
697
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
698
698
|
rekeyTo?: ReadableAddress | undefined;
|
|
699
699
|
note?: string | Uint8Array | undefined;
|
|
700
700
|
lease?: string | Uint8Array | undefined;
|
|
@@ -724,7 +724,7 @@ declare class AppClient {
|
|
|
724
724
|
extraProgramPages?: number | undefined;
|
|
725
725
|
}> | AppMethodCall<{
|
|
726
726
|
sender: SendingAddress;
|
|
727
|
-
signer?:
|
|
727
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
728
728
|
rekeyTo?: ReadableAddress | undefined;
|
|
729
729
|
note?: string | Uint8Array | undefined;
|
|
730
730
|
lease?: string | Uint8Array | undefined;
|
|
@@ -752,7 +752,7 @@ declare class AppClient {
|
|
|
752
752
|
* @returns The parameters which can be used to create a close out ABI method call
|
|
753
753
|
*/
|
|
754
754
|
closeOut: (params: {
|
|
755
|
-
signer?:
|
|
755
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
756
756
|
rekeyTo?: ReadableAddress | undefined;
|
|
757
757
|
note?: string | Uint8Array | undefined;
|
|
758
758
|
lease?: string | Uint8Array | undefined;
|
|
@@ -773,9 +773,8 @@ declare class AppClient {
|
|
|
773
773
|
method: string;
|
|
774
774
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
775
775
|
}) => Promise<{
|
|
776
|
-
|
|
776
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
777
777
|
sender: SendingAddress;
|
|
778
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
779
778
|
rekeyTo?: ReadableAddress | undefined;
|
|
780
779
|
note?: string | Uint8Array | undefined;
|
|
781
780
|
lease?: string | Uint8Array | undefined;
|
|
@@ -785,6 +784,7 @@ declare class AppClient {
|
|
|
785
784
|
validityWindow?: number | bigint | undefined;
|
|
786
785
|
firstValidRound?: bigint | undefined;
|
|
787
786
|
lastValidRound?: bigint | undefined;
|
|
787
|
+
appId: bigint;
|
|
788
788
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.DeleteApplication | undefined;
|
|
789
789
|
accountReferences?: ReadableAddress[] | undefined;
|
|
790
790
|
appReferences?: bigint[] | undefined;
|
|
@@ -794,8 +794,8 @@ declare class AppClient {
|
|
|
794
794
|
rejectVersion?: number | undefined;
|
|
795
795
|
method: ABIMethod;
|
|
796
796
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
797
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
797
798
|
sender: SendingAddress;
|
|
798
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
799
799
|
rekeyTo?: ReadableAddress | undefined;
|
|
800
800
|
note?: string | Uint8Array | undefined;
|
|
801
801
|
lease?: string | Uint8Array | undefined;
|
|
@@ -825,7 +825,7 @@ declare class AppClient {
|
|
|
825
825
|
extraProgramPages?: number | undefined;
|
|
826
826
|
}> | AppMethodCall<{
|
|
827
827
|
sender: SendingAddress;
|
|
828
|
-
signer?:
|
|
828
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
829
829
|
rekeyTo?: ReadableAddress | undefined;
|
|
830
830
|
note?: string | Uint8Array | undefined;
|
|
831
831
|
lease?: string | Uint8Array | undefined;
|
|
@@ -853,7 +853,7 @@ declare class AppClient {
|
|
|
853
853
|
* @returns The parameters which can be used to create an ABI method call
|
|
854
854
|
*/
|
|
855
855
|
call: (params: {
|
|
856
|
-
signer?:
|
|
856
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
857
857
|
rekeyTo?: ReadableAddress | undefined;
|
|
858
858
|
note?: string | Uint8Array | undefined;
|
|
859
859
|
lease?: string | Uint8Array | undefined;
|
|
@@ -874,9 +874,8 @@ declare class AppClient {
|
|
|
874
874
|
method: string;
|
|
875
875
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
876
876
|
} & CallOnComplete) => Promise<{
|
|
877
|
-
|
|
877
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
878
878
|
sender: SendingAddress;
|
|
879
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
880
879
|
rekeyTo?: ReadableAddress | undefined;
|
|
881
880
|
note?: string | Uint8Array | undefined;
|
|
882
881
|
lease?: string | Uint8Array | undefined;
|
|
@@ -886,6 +885,7 @@ declare class AppClient {
|
|
|
886
885
|
validityWindow?: number | bigint | undefined;
|
|
887
886
|
firstValidRound?: bigint | undefined;
|
|
888
887
|
lastValidRound?: bigint | undefined;
|
|
888
|
+
appId: bigint;
|
|
889
889
|
onComplete?: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.DeleteApplication | undefined;
|
|
890
890
|
accountReferences?: ReadableAddress[] | undefined;
|
|
891
891
|
appReferences?: bigint[] | undefined;
|
|
@@ -895,8 +895,8 @@ declare class AppClient {
|
|
|
895
895
|
rejectVersion?: number | undefined;
|
|
896
896
|
method: ABIMethod;
|
|
897
897
|
args?: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
898
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
898
899
|
sender: SendingAddress;
|
|
899
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
900
900
|
rekeyTo?: ReadableAddress | undefined;
|
|
901
901
|
note?: string | Uint8Array | undefined;
|
|
902
902
|
lease?: string | Uint8Array | undefined;
|
|
@@ -926,7 +926,7 @@ declare class AppClient {
|
|
|
926
926
|
extraProgramPages?: number | undefined;
|
|
927
927
|
}> | AppMethodCall<{
|
|
928
928
|
sender: SendingAddress;
|
|
929
|
-
signer?:
|
|
929
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
930
930
|
rekeyTo?: ReadableAddress | undefined;
|
|
931
931
|
note?: string | Uint8Array | undefined;
|
|
932
932
|
lease?: string | Uint8Array | undefined;
|
|
@@ -953,7 +953,7 @@ declare class AppClient {
|
|
|
953
953
|
/** Interact with bare (raw) call parameters */bare: {
|
|
954
954
|
/** Return params for an update call, including deploy-time TEAL template replacements and compilation if provided */
|
|
955
955
|
update: (params?: ({
|
|
956
|
-
signer?:
|
|
956
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
957
957
|
rekeyTo?: ReadableAddress | undefined;
|
|
958
958
|
note?: string | Uint8Array | undefined;
|
|
959
959
|
lease?: string | Uint8Array | undefined;
|
|
@@ -973,7 +973,7 @@ declare class AppClient {
|
|
|
973
973
|
sender?: ReadableAddress | undefined;
|
|
974
974
|
} & AppClientCompilationParams) | undefined) => Promise<{
|
|
975
975
|
sender: SendingAddress;
|
|
976
|
-
signer?:
|
|
976
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
977
977
|
rekeyTo?: ReadableAddress | undefined;
|
|
978
978
|
note?: string | Uint8Array | undefined;
|
|
979
979
|
lease?: string | Uint8Array | undefined;
|
|
@@ -997,7 +997,7 @@ declare class AppClient {
|
|
|
997
997
|
}>;
|
|
998
998
|
/** Return params for an opt-in call */
|
|
999
999
|
optIn: (params?: {
|
|
1000
|
-
signer?:
|
|
1000
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1001
1001
|
rekeyTo?: ReadableAddress | undefined;
|
|
1002
1002
|
note?: string | Uint8Array | undefined;
|
|
1003
1003
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1018,7 +1018,7 @@ declare class AppClient {
|
|
|
1018
1018
|
} | undefined) => AppCallParams;
|
|
1019
1019
|
/** Return params for a delete call */
|
|
1020
1020
|
delete: (params?: {
|
|
1021
|
-
signer?:
|
|
1021
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1022
1022
|
rekeyTo?: ReadableAddress | undefined;
|
|
1023
1023
|
note?: string | Uint8Array | undefined;
|
|
1024
1024
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1039,7 +1039,7 @@ declare class AppClient {
|
|
|
1039
1039
|
} | undefined) => AppDeleteParams;
|
|
1040
1040
|
/** Return params for a clear state call */
|
|
1041
1041
|
clearState: (params?: {
|
|
1042
|
-
signer?:
|
|
1042
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1043
1043
|
rekeyTo?: ReadableAddress | undefined;
|
|
1044
1044
|
note?: string | Uint8Array | undefined;
|
|
1045
1045
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1060,7 +1060,7 @@ declare class AppClient {
|
|
|
1060
1060
|
} | undefined) => AppCallParams;
|
|
1061
1061
|
/** Return params for a close out call */
|
|
1062
1062
|
closeOut: (params?: {
|
|
1063
|
-
signer?:
|
|
1063
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1064
1064
|
rekeyTo?: ReadableAddress | undefined;
|
|
1065
1065
|
note?: string | Uint8Array | undefined;
|
|
1066
1066
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1081,7 +1081,7 @@ declare class AppClient {
|
|
|
1081
1081
|
} | undefined) => AppCallParams;
|
|
1082
1082
|
/** Return params for a call (defaults to no-op) */
|
|
1083
1083
|
call: (params?: ({
|
|
1084
|
-
signer?:
|
|
1084
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1085
1085
|
rekeyTo?: ReadableAddress | undefined;
|
|
1086
1086
|
note?: string | Uint8Array | undefined;
|
|
1087
1087
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1109,7 +1109,8 @@ declare class AppClient {
|
|
|
1109
1109
|
* @returns A transaction which can be used to fund the app account
|
|
1110
1110
|
*/
|
|
1111
1111
|
fundAppAccount: (params: {
|
|
1112
|
-
signer?:
|
|
1112
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1113
|
+
amount: AlgoAmount;
|
|
1113
1114
|
rekeyTo?: ReadableAddress | undefined;
|
|
1114
1115
|
note?: string | Uint8Array | undefined;
|
|
1115
1116
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1119,7 +1120,6 @@ declare class AppClient {
|
|
|
1119
1120
|
validityWindow?: number | bigint | undefined;
|
|
1120
1121
|
firstValidRound?: bigint | undefined;
|
|
1121
1122
|
lastValidRound?: bigint | undefined;
|
|
1122
|
-
amount: AlgoAmount;
|
|
1123
1123
|
closeRemainderTo?: ReadableAddress | undefined;
|
|
1124
1124
|
maxRoundsToWaitForConfirmation?: number | undefined;
|
|
1125
1125
|
suppressLog?: boolean | undefined;
|
|
@@ -1133,7 +1133,7 @@ declare class AppClient {
|
|
|
1133
1133
|
* @returns The transactions which can be used to create an update ABI method call
|
|
1134
1134
|
*/
|
|
1135
1135
|
update: (params: {
|
|
1136
|
-
signer?:
|
|
1136
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1137
1137
|
rekeyTo?: ReadableAddress | undefined;
|
|
1138
1138
|
note?: string | Uint8Array | undefined;
|
|
1139
1139
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1164,7 +1164,7 @@ declare class AppClient {
|
|
|
1164
1164
|
* @returns The transactions which can be used to create an opt-in ABI method call
|
|
1165
1165
|
*/
|
|
1166
1166
|
optIn: (params: {
|
|
1167
|
-
signer?:
|
|
1167
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1168
1168
|
rekeyTo?: ReadableAddress | undefined;
|
|
1169
1169
|
note?: string | Uint8Array | undefined;
|
|
1170
1170
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1195,7 +1195,7 @@ declare class AppClient {
|
|
|
1195
1195
|
* @returns The transactions which can be used to create a delete ABI method call
|
|
1196
1196
|
*/
|
|
1197
1197
|
delete: (params: {
|
|
1198
|
-
signer?:
|
|
1198
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1199
1199
|
rekeyTo?: ReadableAddress | undefined;
|
|
1200
1200
|
note?: string | Uint8Array | undefined;
|
|
1201
1201
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1226,7 +1226,7 @@ declare class AppClient {
|
|
|
1226
1226
|
* @returns The transactions which can be used to create a close out ABI method call
|
|
1227
1227
|
*/
|
|
1228
1228
|
closeOut: (params: {
|
|
1229
|
-
signer?:
|
|
1229
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1230
1230
|
rekeyTo?: ReadableAddress | undefined;
|
|
1231
1231
|
note?: string | Uint8Array | undefined;
|
|
1232
1232
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1257,7 +1257,7 @@ declare class AppClient {
|
|
|
1257
1257
|
* @returns The transactions which can be used to create an ABI method call
|
|
1258
1258
|
*/
|
|
1259
1259
|
call: (params: {
|
|
1260
|
-
signer?:
|
|
1260
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1261
1261
|
rekeyTo?: ReadableAddress | undefined;
|
|
1262
1262
|
note?: string | Uint8Array | undefined;
|
|
1263
1263
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1286,7 +1286,7 @@ declare class AppClient {
|
|
|
1286
1286
|
/** Interact with bare (raw) call transactions */bare: {
|
|
1287
1287
|
/** Returns a transaction for an update call, including deploy-time TEAL template replacements and compilation if provided */
|
|
1288
1288
|
update: (params?: ({
|
|
1289
|
-
signer?:
|
|
1289
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1290
1290
|
rekeyTo?: ReadableAddress | undefined;
|
|
1291
1291
|
note?: string | Uint8Array | undefined;
|
|
1292
1292
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1307,7 +1307,7 @@ declare class AppClient {
|
|
|
1307
1307
|
} & AppClientCompilationParams) | undefined) => Promise<Transaction>;
|
|
1308
1308
|
/** Returns a transaction for an opt-in call */
|
|
1309
1309
|
optIn: (params?: {
|
|
1310
|
-
signer?:
|
|
1310
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1311
1311
|
rekeyTo?: ReadableAddress | undefined;
|
|
1312
1312
|
note?: string | Uint8Array | undefined;
|
|
1313
1313
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1328,7 +1328,7 @@ declare class AppClient {
|
|
|
1328
1328
|
} | undefined) => Promise<Transaction>;
|
|
1329
1329
|
/** Returns a transaction for a delete call */
|
|
1330
1330
|
delete: (params?: {
|
|
1331
|
-
signer?:
|
|
1331
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1332
1332
|
rekeyTo?: ReadableAddress | undefined;
|
|
1333
1333
|
note?: string | Uint8Array | undefined;
|
|
1334
1334
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1349,7 +1349,7 @@ declare class AppClient {
|
|
|
1349
1349
|
} | undefined) => Promise<Transaction>;
|
|
1350
1350
|
/** Returns a transaction for a clear state call */
|
|
1351
1351
|
clearState: (params?: {
|
|
1352
|
-
signer?:
|
|
1352
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1353
1353
|
rekeyTo?: ReadableAddress | undefined;
|
|
1354
1354
|
note?: string | Uint8Array | undefined;
|
|
1355
1355
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1370,7 +1370,7 @@ declare class AppClient {
|
|
|
1370
1370
|
} | undefined) => Promise<Transaction>;
|
|
1371
1371
|
/** Returns a transaction for a close out call */
|
|
1372
1372
|
closeOut: (params?: {
|
|
1373
|
-
signer?:
|
|
1373
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1374
1374
|
rekeyTo?: ReadableAddress | undefined;
|
|
1375
1375
|
note?: string | Uint8Array | undefined;
|
|
1376
1376
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1391,7 +1391,7 @@ declare class AppClient {
|
|
|
1391
1391
|
} | undefined) => Promise<Transaction>;
|
|
1392
1392
|
/** Returns a transaction for a call (defaults to no-op) */
|
|
1393
1393
|
call: (params?: ({
|
|
1394
|
-
signer?:
|
|
1394
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1395
1395
|
rekeyTo?: ReadableAddress | undefined;
|
|
1396
1396
|
note?: string | Uint8Array | undefined;
|
|
1397
1397
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1419,7 +1419,8 @@ declare class AppClient {
|
|
|
1419
1419
|
* @returns The result of send the fund app account payment transaction
|
|
1420
1420
|
*/
|
|
1421
1421
|
fundAppAccount: (params: {
|
|
1422
|
-
signer?:
|
|
1422
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1423
|
+
amount: AlgoAmount;
|
|
1423
1424
|
rekeyTo?: ReadableAddress | undefined;
|
|
1424
1425
|
note?: string | Uint8Array | undefined;
|
|
1425
1426
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1429,7 +1430,6 @@ declare class AppClient {
|
|
|
1429
1430
|
validityWindow?: number | bigint | undefined;
|
|
1430
1431
|
firstValidRound?: bigint | undefined;
|
|
1431
1432
|
lastValidRound?: bigint | undefined;
|
|
1432
|
-
amount: AlgoAmount;
|
|
1433
1433
|
closeRemainderTo?: ReadableAddress | undefined;
|
|
1434
1434
|
maxRoundsToWaitForConfirmation?: number | undefined;
|
|
1435
1435
|
suppressLog?: boolean | undefined;
|
|
@@ -1451,7 +1451,7 @@ declare class AppClient {
|
|
|
1451
1451
|
* @returns The result of sending the update ABI method call
|
|
1452
1452
|
*/
|
|
1453
1453
|
update: (params: {
|
|
1454
|
-
signer?:
|
|
1454
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1455
1455
|
rekeyTo?: ReadableAddress | undefined;
|
|
1456
1456
|
note?: string | Uint8Array | undefined;
|
|
1457
1457
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1474,8 +1474,8 @@ declare class AppClient {
|
|
|
1474
1474
|
} & AppClientCompilationParams & SendParams) => Promise<{
|
|
1475
1475
|
compiledApproval?: CompiledTeal | undefined;
|
|
1476
1476
|
compiledClear?: CompiledTeal | undefined;
|
|
1477
|
-
transactions: Transaction[];
|
|
1478
1477
|
confirmations: PendingTransactionResponse[];
|
|
1478
|
+
transactions: Transaction[];
|
|
1479
1479
|
groupId: string | undefined;
|
|
1480
1480
|
txIds: string[];
|
|
1481
1481
|
returns?: ABIReturn[] | undefined;
|
|
@@ -1489,7 +1489,7 @@ declare class AppClient {
|
|
|
1489
1489
|
* @returns The result of sending the opt-in ABI method call
|
|
1490
1490
|
*/
|
|
1491
1491
|
optIn: (params: {
|
|
1492
|
-
signer?:
|
|
1492
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1493
1493
|
rekeyTo?: ReadableAddress | undefined;
|
|
1494
1494
|
note?: string | Uint8Array | undefined;
|
|
1495
1495
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1525,7 +1525,7 @@ declare class AppClient {
|
|
|
1525
1525
|
* @returns The result of sending the delete ABI method call
|
|
1526
1526
|
*/
|
|
1527
1527
|
delete: (params: {
|
|
1528
|
-
signer?:
|
|
1528
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1529
1529
|
rekeyTo?: ReadableAddress | undefined;
|
|
1530
1530
|
note?: string | Uint8Array | undefined;
|
|
1531
1531
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1561,7 +1561,7 @@ declare class AppClient {
|
|
|
1561
1561
|
* @returns The result of sending the close out ABI method call
|
|
1562
1562
|
*/
|
|
1563
1563
|
closeOut: (params: {
|
|
1564
|
-
signer?:
|
|
1564
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1565
1565
|
rekeyTo?: ReadableAddress | undefined;
|
|
1566
1566
|
note?: string | Uint8Array | undefined;
|
|
1567
1567
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1597,7 +1597,7 @@ declare class AppClient {
|
|
|
1597
1597
|
* @returns The result of sending the ABI method call
|
|
1598
1598
|
*/
|
|
1599
1599
|
call: (params: {
|
|
1600
|
-
signer?:
|
|
1600
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1601
1601
|
rekeyTo?: ReadableAddress | undefined;
|
|
1602
1602
|
note?: string | Uint8Array | undefined;
|
|
1603
1603
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1631,7 +1631,7 @@ declare class AppClient {
|
|
|
1631
1631
|
/** Interact with bare (raw) calls */bare: {
|
|
1632
1632
|
/** Signs and sends an update call, including deploy-time TEAL template replacements and compilation if provided */
|
|
1633
1633
|
update: (params?: ({
|
|
1634
|
-
signer?:
|
|
1634
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1635
1635
|
rekeyTo?: ReadableAddress | undefined;
|
|
1636
1636
|
note?: string | Uint8Array | undefined;
|
|
1637
1637
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1663,7 +1663,7 @@ declare class AppClient {
|
|
|
1663
1663
|
}>;
|
|
1664
1664
|
/** Signs and sends an opt-in call */
|
|
1665
1665
|
optIn: (params?: ({
|
|
1666
|
-
signer?:
|
|
1666
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1667
1667
|
rekeyTo?: ReadableAddress | undefined;
|
|
1668
1668
|
note?: string | Uint8Array | undefined;
|
|
1669
1669
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1693,7 +1693,7 @@ declare class AppClient {
|
|
|
1693
1693
|
}>;
|
|
1694
1694
|
/** Signs and sends a delete call */
|
|
1695
1695
|
delete: (params?: ({
|
|
1696
|
-
signer?:
|
|
1696
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1697
1697
|
rekeyTo?: ReadableAddress | undefined;
|
|
1698
1698
|
note?: string | Uint8Array | undefined;
|
|
1699
1699
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1723,7 +1723,7 @@ declare class AppClient {
|
|
|
1723
1723
|
}>;
|
|
1724
1724
|
/** Signs and sends a clear state call */
|
|
1725
1725
|
clearState: (params?: ({
|
|
1726
|
-
signer?:
|
|
1726
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1727
1727
|
rekeyTo?: ReadableAddress | undefined;
|
|
1728
1728
|
note?: string | Uint8Array | undefined;
|
|
1729
1729
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1753,7 +1753,7 @@ declare class AppClient {
|
|
|
1753
1753
|
}>;
|
|
1754
1754
|
/** Signs and sends a close out call */
|
|
1755
1755
|
closeOut: (params?: ({
|
|
1756
|
-
signer?:
|
|
1756
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1757
1757
|
rekeyTo?: ReadableAddress | undefined;
|
|
1758
1758
|
note?: string | Uint8Array | undefined;
|
|
1759
1759
|
lease?: string | Uint8Array | undefined;
|
|
@@ -1783,7 +1783,7 @@ declare class AppClient {
|
|
|
1783
1783
|
}>;
|
|
1784
1784
|
/** Signs and sends a call (defaults to no-op) */
|
|
1785
1785
|
call: (params?: ({
|
|
1786
|
-
signer?:
|
|
1786
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
1787
1787
|
rekeyTo?: ReadableAddress | undefined;
|
|
1788
1788
|
note?: string | Uint8Array | undefined;
|
|
1789
1789
|
lease?: string | Uint8Array | undefined;
|
package/types/app-factory.d.ts
CHANGED
|
@@ -171,7 +171,7 @@ declare class AppFactory {
|
|
|
171
171
|
get params(): {
|
|
172
172
|
/** Return params for a create ABI call, including deploy-time TEAL template replacements and compilation if provided */
|
|
173
173
|
create: (params: {
|
|
174
|
-
signer?:
|
|
174
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
175
175
|
rekeyTo?: ReadableAddress | undefined;
|
|
176
176
|
note?: string | Uint8Array | undefined;
|
|
177
177
|
lease?: string | Uint8Array | undefined;
|
|
@@ -219,7 +219,7 @@ declare class AppFactory {
|
|
|
219
219
|
};
|
|
220
220
|
approvalProgram: Uint8Array;
|
|
221
221
|
clearStateProgram: Uint8Array;
|
|
222
|
-
signer?:
|
|
222
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
223
223
|
rekeyTo?: ReadableAddress | undefined;
|
|
224
224
|
note?: string | Uint8Array | undefined;
|
|
225
225
|
lease?: string | Uint8Array | undefined;
|
|
@@ -244,11 +244,11 @@ declare class AppFactory {
|
|
|
244
244
|
extraProgramPages?: number | undefined;
|
|
245
245
|
} & {
|
|
246
246
|
sender: Address;
|
|
247
|
-
signer:
|
|
247
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
248
248
|
method: ABIMethod;
|
|
249
249
|
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
250
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
250
251
|
sender: SendingAddress;
|
|
251
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
252
252
|
rekeyTo?: ReadableAddress | undefined;
|
|
253
253
|
note?: string | Uint8Array | undefined;
|
|
254
254
|
lease?: string | Uint8Array | undefined;
|
|
@@ -278,7 +278,7 @@ declare class AppFactory {
|
|
|
278
278
|
extraProgramPages?: number | undefined;
|
|
279
279
|
}> | AppMethodCall<{
|
|
280
280
|
sender: SendingAddress;
|
|
281
|
-
signer?:
|
|
281
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
282
282
|
rekeyTo?: ReadableAddress | undefined;
|
|
283
283
|
note?: string | Uint8Array | undefined;
|
|
284
284
|
lease?: string | Uint8Array | undefined;
|
|
@@ -304,7 +304,7 @@ declare class AppFactory {
|
|
|
304
304
|
}>;
|
|
305
305
|
/** Return params for a deployment update ABI call */
|
|
306
306
|
deployUpdate: (params: {
|
|
307
|
-
signer?:
|
|
307
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
308
308
|
rekeyTo?: ReadableAddress | undefined;
|
|
309
309
|
note?: string | Uint8Array | undefined;
|
|
310
310
|
lease?: string | Uint8Array | undefined;
|
|
@@ -325,7 +325,7 @@ declare class AppFactory {
|
|
|
325
325
|
method: string;
|
|
326
326
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
327
327
|
}) => {
|
|
328
|
-
signer?:
|
|
328
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
329
329
|
rekeyTo?: ReadableAddress | undefined;
|
|
330
330
|
note?: string | Uint8Array | undefined;
|
|
331
331
|
lease?: string | Uint8Array | undefined;
|
|
@@ -347,11 +347,11 @@ declare class AppFactory {
|
|
|
347
347
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
348
348
|
} & {
|
|
349
349
|
sender: Address;
|
|
350
|
-
signer:
|
|
350
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
351
351
|
method: ABIMethod;
|
|
352
352
|
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
353
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
353
354
|
sender: SendingAddress;
|
|
354
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
355
355
|
rekeyTo?: ReadableAddress | undefined;
|
|
356
356
|
note?: string | Uint8Array | undefined;
|
|
357
357
|
lease?: string | Uint8Array | undefined;
|
|
@@ -381,7 +381,7 @@ declare class AppFactory {
|
|
|
381
381
|
extraProgramPages?: number | undefined;
|
|
382
382
|
}> | AppMethodCall<{
|
|
383
383
|
sender: SendingAddress;
|
|
384
|
-
signer?:
|
|
384
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
385
385
|
rekeyTo?: ReadableAddress | undefined;
|
|
386
386
|
note?: string | Uint8Array | undefined;
|
|
387
387
|
lease?: string | Uint8Array | undefined;
|
|
@@ -407,7 +407,7 @@ declare class AppFactory {
|
|
|
407
407
|
};
|
|
408
408
|
/** Return params for a deployment delete ABI call */
|
|
409
409
|
deployDelete: (params: {
|
|
410
|
-
signer?:
|
|
410
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
411
411
|
rekeyTo?: ReadableAddress | undefined;
|
|
412
412
|
note?: string | Uint8Array | undefined;
|
|
413
413
|
lease?: string | Uint8Array | undefined;
|
|
@@ -428,7 +428,7 @@ declare class AppFactory {
|
|
|
428
428
|
method: string;
|
|
429
429
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
430
430
|
}) => {
|
|
431
|
-
signer?:
|
|
431
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
432
432
|
rekeyTo?: ReadableAddress | undefined;
|
|
433
433
|
note?: string | Uint8Array | undefined;
|
|
434
434
|
lease?: string | Uint8Array | undefined;
|
|
@@ -450,11 +450,11 @@ declare class AppFactory {
|
|
|
450
450
|
args?: (ABIValue | AppMethodCallTransactionArgument | undefined)[] | undefined;
|
|
451
451
|
} & {
|
|
452
452
|
sender: Address;
|
|
453
|
-
signer:
|
|
453
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
454
454
|
method: ABIMethod;
|
|
455
455
|
args: (Transaction | Promise<Transaction> | ABIValue | TransactionWithSigner | AppMethodCall<{
|
|
456
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
456
457
|
sender: SendingAddress;
|
|
457
|
-
signer?: TransactionSigner | AddressWithTransactionSigner | undefined;
|
|
458
458
|
rekeyTo?: ReadableAddress | undefined;
|
|
459
459
|
note?: string | Uint8Array | undefined;
|
|
460
460
|
lease?: string | Uint8Array | undefined;
|
|
@@ -484,7 +484,7 @@ declare class AppFactory {
|
|
|
484
484
|
extraProgramPages?: number | undefined;
|
|
485
485
|
}> | AppMethodCall<{
|
|
486
486
|
sender: SendingAddress;
|
|
487
|
-
signer?:
|
|
487
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
488
488
|
rekeyTo?: ReadableAddress | undefined;
|
|
489
489
|
note?: string | Uint8Array | undefined;
|
|
490
490
|
lease?: string | Uint8Array | undefined;
|
|
@@ -511,7 +511,7 @@ declare class AppFactory {
|
|
|
511
511
|
bare: {
|
|
512
512
|
/** Return params for a create bare call, including deploy-time TEAL template replacements and compilation if provided */
|
|
513
513
|
create: (params?: {
|
|
514
|
-
signer?:
|
|
514
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
515
515
|
rekeyTo?: ReadableAddress | undefined;
|
|
516
516
|
note?: string | Uint8Array | undefined;
|
|
517
517
|
lease?: string | Uint8Array | undefined;
|
|
@@ -560,7 +560,7 @@ declare class AppFactory {
|
|
|
560
560
|
/** The number of byte slices saved in local state. */
|
|
561
561
|
localByteSlices: number;
|
|
562
562
|
};
|
|
563
|
-
signer?:
|
|
563
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
564
564
|
rekeyTo?: ReadableAddress | undefined;
|
|
565
565
|
note?: string | Uint8Array | undefined;
|
|
566
566
|
lease?: string | Uint8Array | undefined;
|
|
@@ -584,12 +584,12 @@ declare class AppFactory {
|
|
|
584
584
|
extraProgramPages?: number | undefined;
|
|
585
585
|
} & {
|
|
586
586
|
sender: Address;
|
|
587
|
-
signer:
|
|
587
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
588
588
|
onComplete: OnApplicationComplete.NoOp | OnApplicationComplete.OptIn | OnApplicationComplete.CloseOut | OnApplicationComplete.UpdateApplication | OnApplicationComplete.DeleteApplication;
|
|
589
589
|
}>;
|
|
590
590
|
/** Return params for a deployment update bare call */
|
|
591
591
|
deployUpdate: (params?: {
|
|
592
|
-
signer?:
|
|
592
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
593
593
|
rekeyTo?: ReadableAddress | undefined;
|
|
594
594
|
note?: string | Uint8Array | undefined;
|
|
595
595
|
lease?: string | Uint8Array | undefined;
|
|
@@ -608,7 +608,7 @@ declare class AppFactory {
|
|
|
608
608
|
rejectVersion?: number | undefined;
|
|
609
609
|
sender?: ReadableAddress | undefined;
|
|
610
610
|
} | undefined) => {
|
|
611
|
-
signer?:
|
|
611
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
612
612
|
rekeyTo?: ReadableAddress | undefined;
|
|
613
613
|
note?: string | Uint8Array | undefined;
|
|
614
614
|
lease?: string | Uint8Array | undefined;
|
|
@@ -628,12 +628,12 @@ declare class AppFactory {
|
|
|
628
628
|
sender?: ReadableAddress | undefined;
|
|
629
629
|
} & {
|
|
630
630
|
sender: Address;
|
|
631
|
-
signer:
|
|
631
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
632
632
|
onComplete: OnApplicationComplete.UpdateApplication;
|
|
633
633
|
};
|
|
634
634
|
/** Return params for a deployment delete bare call */
|
|
635
635
|
deployDelete: (params?: {
|
|
636
|
-
signer?:
|
|
636
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
637
637
|
rekeyTo?: ReadableAddress | undefined;
|
|
638
638
|
note?: string | Uint8Array | undefined;
|
|
639
639
|
lease?: string | Uint8Array | undefined;
|
|
@@ -652,7 +652,7 @@ declare class AppFactory {
|
|
|
652
652
|
rejectVersion?: number | undefined;
|
|
653
653
|
sender?: ReadableAddress | undefined;
|
|
654
654
|
} | undefined) => {
|
|
655
|
-
signer?:
|
|
655
|
+
signer?: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
656
656
|
rekeyTo?: ReadableAddress | undefined;
|
|
657
657
|
note?: string | Uint8Array | undefined;
|
|
658
658
|
lease?: string | Uint8Array | undefined;
|
|
@@ -672,7 +672,7 @@ declare class AppFactory {
|
|
|
672
672
|
sender?: ReadableAddress | undefined;
|
|
673
673
|
} & {
|
|
674
674
|
sender: Address;
|
|
675
|
-
signer:
|
|
675
|
+
signer: AddressWithTransactionSigner | TransactionSigner | undefined;
|
|
676
676
|
onComplete: OnApplicationComplete.DeleteApplication;
|
|
677
677
|
};
|
|
678
678
|
};
|