nomadex-client
Version:
Client library to programmatically interact with https://voi.nomadex.app
1,024 lines (1,023 loc) • 60.7 kB
TypeScript
import type { ABIAppCallArg, AppCallTransactionResult, AppCallTransactionResultOfType, AppCompilationResult, AppReference, AppStorageSchema, CoreAppCallArgs, RawAppCallArgs, TealTemplateParams } from '@algorandfoundation/algokit-utils/types/app';
import type { AppClientCallCoreParams, AppClientCompilationParams, AppClientDeployCoreParams, AppDetails, ApplicationClient } from '@algorandfoundation/algokit-utils/types/app-client';
import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec';
import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction';
import type { ABIResult, TransactionWithSigner } from 'algosdk';
import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk';
export declare const APP_SPEC: AppSpec;
/**
* Defines an onCompletionAction of 'no_op'
*/
export type OnCompleteNoOp = {
onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC;
};
/**
* Defines an onCompletionAction of 'opt_in'
*/
export type OnCompleteOptIn = {
onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC;
};
/**
* Defines an onCompletionAction of 'close_out'
*/
export type OnCompleteCloseOut = {
onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC;
};
/**
* Defines an onCompletionAction of 'delete_application'
*/
export type OnCompleteDelApp = {
onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC;
};
/**
* Defines an onCompletionAction of 'update_application'
*/
export type OnCompleteUpdApp = {
onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC;
};
/**
* A state record containing a single unsigned integer
*/
export type IntegerState = {
/**
* Gets the state value as a BigInt.
*/
asBigInt(): bigint;
/**
* Gets the state value as a number.
*/
asNumber(): number;
};
/**
* A state record containing binary data
*/
export type BinaryState = {
/**
* Gets the state value as a Uint8Array
*/
asByteArray(): Uint8Array;
/**
* Gets the state value as a string
*/
asString(): string;
};
export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial<AppCompilationResult> & AppReference;
export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial<AppCompilationResult>;
export type AppClientComposeCallCoreParams = Omit<AppClientCallCoreParams, 'sendParams'> & {
sendParams?: Omit<SendTransactionParams, 'skipSending' | 'atc' | 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources'>;
};
export type AppClientComposeExecuteParams = Pick<SendTransactionParams, 'skipWaiting' | 'maxRoundsToWaitForConfirmation' | 'populateAppCallResources' | 'suppressLog'>;
export type IncludeSchema = {
/**
* Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used.
*/
schema?: Partial<AppStorageSchema>;
};
/**
* Defines the types of available calls and state of the SmartAsset smart contract.
*/
export type SmartAsset = {
/**
* Maps method signatures / names to their argument and return types.
*/
methods: Record<'arc200_name()byte[32]' | 'arc200_name', {
argsObj: {};
argsTuple: [];
returns: Uint8Array;
}> & Record<'arc200_symbol()byte[8]' | 'arc200_symbol', {
argsObj: {};
argsTuple: [];
returns: Uint8Array;
}> & Record<'arc200_decimals()uint8' | 'arc200_decimals', {
argsObj: {};
argsTuple: [];
returns: number;
}> & Record<'arc200_totalSupply()uint256' | 'arc200_totalSupply', {
argsObj: {};
argsTuple: [];
returns: bigint;
}> & Record<'arc200_balanceOf(address)uint256' | 'arc200_balanceOf', {
argsObj: {
owner: string;
};
argsTuple: [owner: string];
returns: bigint;
}> & Record<'arc200_allowance(address,address)uint256' | 'arc200_allowance', {
argsObj: {
owner: string;
spender: string;
};
argsTuple: [owner: string, spender: string];
returns: bigint;
}> & Record<'arc200_transfer(address,uint256)bool' | 'arc200_transfer', {
argsObj: {
to: string;
value: bigint | number;
};
argsTuple: [to: string, value: bigint | number];
returns: boolean;
}> & Record<'arc200_approve(address,uint256)bool' | 'arc200_approve', {
argsObj: {
spender: string;
value: bigint | number;
};
argsTuple: [spender: string, value: bigint | number];
returns: boolean;
}> & Record<'arc200_transferFrom(address,address,uint256)bool' | 'arc200_transferFrom', {
argsObj: {
from: string;
to: string;
value: bigint | number;
};
argsTuple: [from: string, to: string, value: bigint | number];
returns: boolean;
}> & Record<'supportsInterface(byte[4])bool' | 'supportsInterface', {
argsObj: {
interfaceId: Uint8Array;
};
argsTuple: [interfaceId: Uint8Array];
returns: boolean;
}> & Record<'zeroAddress()address' | 'zeroAddress', {
argsObj: {};
argsTuple: [];
returns: string;
}> & Record<'hasBox(address,address)bool' | 'hasBox', {
argsObj: {
owner: string;
spender: string;
};
argsTuple: [owner: string, spender: string];
returns: boolean;
}> & Record<'createBalanceBox(address)bool' | 'createBalanceBox', {
argsObj: {
owner: string;
};
argsTuple: [owner: string];
returns: boolean;
}> & Record<'createAllowanceBox(address,address)bool' | 'createAllowanceBox', {
argsObj: {
owner: string;
spender: string;
};
argsTuple: [owner: string, spender: string];
returns: boolean;
}> & Record<'noop(uint64)void' | 'noop', {
argsObj: {
n: bigint | number;
};
argsTuple: [n: bigint | number];
returns: void;
}> & Record<'updateApplication()void' | 'updateApplication', {
argsObj: {};
argsTuple: [];
returns: void;
}> & Record<'deleteApplication()void' | 'deleteApplication', {
argsObj: {};
argsTuple: [];
returns: void;
}> & Record<'manager()address' | 'manager', {
argsObj: {};
argsTuple: [];
returns: string;
}> & Record<'grant(address)void' | 'grant', {
argsObj: {
manager: string;
};
argsTuple: [manager: string];
returns: void;
}> & Record<'createApplication(address,byte[32],byte[8],uint8,uint256)void' | 'createApplication', {
argsObj: {
manager: string;
name: Uint8Array;
symbol: Uint8Array;
decimals: number;
totalSupply: bigint | number;
};
argsTuple: [manager: string, name: Uint8Array, symbol: Uint8Array, decimals: number, totalSupply: bigint | number];
returns: void;
}> & Record<'bootstrap(pay)void' | 'bootstrap', {
argsObj: {
txn: TransactionToSign | Transaction | Promise<SendTransactionResult>;
};
argsTuple: [txn: TransactionToSign | Transaction | Promise<SendTransactionResult>];
returns: void;
}>;
/**
* Defines the shape of the global and local state of the application.
*/
state: {
global: {
name?: BinaryState;
symbol?: BinaryState;
decimals?: BinaryState;
totalSupply?: BinaryState;
initialized?: BinaryState;
warden?: BinaryState;
};
};
};
/**
* Defines the possible abi call signatures
*/
export type SmartAssetSig = keyof SmartAsset['methods'];
/**
* Defines an object containing all relevant parameters for a single call to the contract. Where TSignature is undefined, a bare call is made
*/
export type TypedCallParams<TSignature extends SmartAssetSig | undefined> = {
method: TSignature;
methodArgs: TSignature extends undefined ? undefined : Array<ABIAppCallArg | undefined>;
} & AppClientCallCoreParams & CoreAppCallArgs;
/**
* Defines the arguments required for a bare call
*/
export type BareCallArgs = Omit<RawAppCallArgs, keyof CoreAppCallArgs>;
/**
* Maps a method signature from the SmartAsset smart contract to the method's arguments in either tuple of struct form
*/
export type MethodArgs<TSignature extends SmartAssetSig> = SmartAsset['methods'][TSignature]['argsObj' | 'argsTuple'];
/**
* Maps a method signature from the SmartAsset smart contract to the method's return type
*/
export type MethodReturn<TSignature extends SmartAssetSig> = SmartAsset['methods'][TSignature]['returns'];
/**
* A factory for available 'create' calls
*/
export type SmartAssetCreateCalls = (typeof SmartAssetCallFactory)['create'];
/**
* Defines supported create methods for this smart contract
*/
export type SmartAssetCreateCallParams = (TypedCallParams<'createApplication(address,byte[32],byte[8],uint8,uint256)void'> & (OnCompleteNoOp));
/**
* A factory for available 'update' calls
*/
export type SmartAssetUpdateCalls = (typeof SmartAssetCallFactory)['update'];
/**
* Defines supported update methods for this smart contract
*/
export type SmartAssetUpdateCallParams = TypedCallParams<'updateApplication()void'>;
/**
* A factory for available 'delete' calls
*/
export type SmartAssetDeleteCalls = (typeof SmartAssetCallFactory)['delete'];
/**
* Defines supported delete methods for this smart contract
*/
export type SmartAssetDeleteCallParams = TypedCallParams<'deleteApplication()void'>;
/**
* Defines arguments required for the deploy method.
*/
export type SmartAssetDeployArgs = {
deployTimeParams?: TealTemplateParams;
/**
* A delegate which takes a create call factory and returns the create call params for this smart contract
*/
createCall?: (callFactory: SmartAssetCreateCalls) => SmartAssetCreateCallParams;
/**
* A delegate which takes a update call factory and returns the update call params for this smart contract
*/
updateCall?: (callFactory: SmartAssetUpdateCalls) => SmartAssetUpdateCallParams;
/**
* A delegate which takes a delete call factory and returns the delete call params for this smart contract
*/
deleteCall?: (callFactory: SmartAssetDeleteCalls) => SmartAssetDeleteCallParams;
};
/**
* Exposes methods for constructing all available smart contract calls
*/
export declare abstract class SmartAssetCallFactory {
/**
* Gets available create call factories
*/
static get create(): {
/**
* Constructs a create call for the SmartAsset smart contract using the createApplication(address,byte[32],byte[8],uint8,uint256)void ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
createApplication(args: MethodArgs<"createApplication(address,byte[32],byte[8],uint8,uint256)void">, params?: AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp)): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
deployTimeParams?: TealTemplateParams;
updatable?: boolean;
deletable?: boolean;
onCompleteAction?: "no_op" | OnApplicationComplete.NoOpOC;
method: "createApplication(address,byte[32],byte[8],uint8,uint256)void";
methodArgs: (string | number | bigint | Uint8Array<ArrayBufferLike>)[];
};
};
/**
* Gets available update call factories
*/
static get update(): {
/**
* Constructs an update call for the SmartAsset smart contract using the updateApplication()void ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
updateApplication(args: MethodArgs<"updateApplication()void">, params?: AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
deployTimeParams?: TealTemplateParams;
updatable?: boolean;
deletable?: boolean;
method: "updateApplication()void";
methodArgs: any[];
};
};
/**
* Gets available delete call factories
*/
static get delete(): {
/**
* Constructs a delete call for the SmartAsset smart contract using the deleteApplication()void ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
deleteApplication(args: MethodArgs<"deleteApplication()void">, params?: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "deleteApplication()void";
methodArgs: any[];
};
};
/**
* Constructs a no op call for the arc200_name()byte[32] ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200Name(args: MethodArgs<'arc200_name()byte[32]'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_name()byte[32]";
methodArgs: any[];
};
/**
* Constructs a no op call for the arc200_symbol()byte[8] ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200Symbol(args: MethodArgs<'arc200_symbol()byte[8]'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_symbol()byte[8]";
methodArgs: any[];
};
/**
* Constructs a no op call for the arc200_decimals()uint8 ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200Decimals(args: MethodArgs<'arc200_decimals()uint8'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_decimals()uint8";
methodArgs: any[];
};
/**
* Constructs a no op call for the arc200_totalSupply()uint256 ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200TotalSupply(args: MethodArgs<'arc200_totalSupply()uint256'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_totalSupply()uint256";
methodArgs: any[];
};
/**
* Constructs a no op call for the arc200_balanceOf(address)uint256 ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200BalanceOf(args: MethodArgs<'arc200_balanceOf(address)uint256'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_balanceOf(address)uint256";
methodArgs: string[];
};
/**
* Constructs a no op call for the arc200_allowance(address,address)uint256 ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200Allowance(args: MethodArgs<'arc200_allowance(address,address)uint256'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_allowance(address,address)uint256";
methodArgs: string[];
};
/**
* Constructs a no op call for the arc200_transfer(address,uint256)bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200Transfer(args: MethodArgs<'arc200_transfer(address,uint256)bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_transfer(address,uint256)bool";
methodArgs: (string | number | bigint)[];
};
/**
* Constructs a no op call for the arc200_approve(address,uint256)bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200Approve(args: MethodArgs<'arc200_approve(address,uint256)bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_approve(address,uint256)bool";
methodArgs: (string | number | bigint)[];
};
/**
* Constructs a no op call for the arc200_transferFrom(address,address,uint256)bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static arc200TransferFrom(args: MethodArgs<'arc200_transferFrom(address,address,uint256)bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "arc200_transferFrom(address,address,uint256)bool";
methodArgs: (string | number | bigint)[];
};
/**
* Constructs a no op call for the supportsInterface(byte[4])bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static supportsInterface(args: MethodArgs<'supportsInterface(byte[4])bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "supportsInterface(byte[4])bool";
methodArgs: Uint8Array<ArrayBufferLike>[];
};
/**
* Constructs a no op call for the zeroAddress()address ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static zeroAddress(args: MethodArgs<'zeroAddress()address'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "zeroAddress()address";
methodArgs: any[];
};
/**
* Constructs a no op call for the hasBox(address,address)bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static hasBox(args: MethodArgs<'hasBox(address,address)bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "hasBox(address,address)bool";
methodArgs: string[];
};
/**
* Constructs a no op call for the createBalanceBox(address)bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static createBalanceBox(args: MethodArgs<'createBalanceBox(address)bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "createBalanceBox(address)bool";
methodArgs: string[];
};
/**
* Constructs a no op call for the createAllowanceBox(address,address)bool ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static createAllowanceBox(args: MethodArgs<'createAllowanceBox(address,address)bool'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "createAllowanceBox(address,address)bool";
methodArgs: string[];
};
/**
* Constructs a no op call for the noop(uint64)void ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static noop(args: MethodArgs<'noop(uint64)void'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "noop(uint64)void";
methodArgs: (number | bigint)[];
};
/**
* Constructs a no op call for the manager()address ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static manager(args: MethodArgs<'manager()address'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "manager()address";
methodArgs: any[];
};
/**
* Constructs a no op call for the grant(address)void ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static grant(args: MethodArgs<'grant(address)void'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "grant(address)void";
methodArgs: string[];
};
/**
* Constructs a no op call for the bootstrap(pay)void ABI method
*
* @param args Any args for the contract call
* @param params Any additional parameters for the call
* @returns A TypedCallParams object for the call
*/
static bootstrap(args: MethodArgs<'bootstrap(pay)void'>, params: AppClientCallCoreParams & CoreAppCallArgs): {
sender?: SendTransactionFrom;
note?: import("@algorandfoundation/algokit-utils/types/transaction").TransactionNote;
sendParams?: SendTransactionParams;
lease?: string | Uint8Array;
boxes?: (import("algosdk").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxReference | import("@algorandfoundation/algokit-utils/types/app").BoxIdentifier)[];
accounts?: (string | import("algosdk").Address)[];
apps?: number[];
assets?: number[];
rekeyTo?: SendTransactionFrom | string;
method: "bootstrap(pay)void";
methodArgs: (Transaction | TransactionToSign | Promise<SendTransactionResult>)[];
};
}
/**
* A client to make calls to the SmartAsset smart contract
*/
export declare class SmartAssetClient {
private algod;
/**
* The underlying `ApplicationClient` for when you want to have more flexibility
*/
readonly appClient: ApplicationClient;
private readonly sender;
/**
* Creates a new instance of `SmartAssetClient`
*
* @param appDetails appDetails The details to identify the app to deploy
* @param algod An algod client instance
*/
constructor(appDetails: AppDetails, algod: Algodv2);
/**
* Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type
*
* @param result The AppCallTransactionResult to be mapped
* @param returnValueFormatter An optional delegate to format the return value if required
* @returns The smart contract response with an updated return value
*/
protected mapReturnValue<TReturn, TResult extends AppCallTransactionResult = AppCallTransactionResult>(result: AppCallTransactionResult, returnValueFormatter?: (value: any) => TReturn): AppCallTransactionResultOfType<TReturn> & TResult;
/**
* Calls the ABI method with the matching signature using an onCompletion code of NO_OP
*
* @param typedCallParams An object containing the method signature, args, and any other relevant parameters
* @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type
* @returns The result of the smart contract call
*/
call<TSignature extends keyof SmartAsset['methods']>(typedCallParams: TypedCallParams<TSignature>, returnValueFormatter?: (value: any) => MethodReturn<TSignature>): Promise<AppCallTransactionResultOfType<MethodReturn<TSignature>> & AppCallTransactionResult>;
/**
* Idempotently deploys the SmartAsset smart contract.
*
* @param params The arguments for the contract calls and any additional parameters for the call
* @returns The deployment result
*/
deploy(params?: SmartAssetDeployArgs & AppClientDeployCoreParams & IncludeSchema): ReturnType<ApplicationClient['deploy']>;
/**
* Gets available create methods
*/
get create(): {
/**
* Creates a new instance of the SmartAsset smart contract using the createApplication(address,byte[32],byte[8],uint8,uint256)void ABI method.
*
* @param args The arguments for the smart contract call
* @param params Any additional parameters for the call
* @returns The create result
*/
createApplication(args: MethodArgs<"createApplication(address,byte[32],byte[8],uint8,uint256)void">, params?: AppClientCallCoreParams & AppClientCompilationParams & IncludeSchema & CoreAppCallArgs & (OnCompleteNoOp)): Promise<AppCallTransactionResultOfType<void> & AppCallTransactionResult & Partial<AppCompilationResult> & AppReference>;
};
/**
* Gets available update methods
*/
get update(): {
/**
* Updates an existing instance of the SmartAsset smart contract using the updateApplication()void ABI method.
*
* @param args The arguments for the smart contract call
* @param params Any additional parameters for the call
* @returns The update result
*/
updateApplication(args: MethodArgs<"updateApplication()void">, params?: AppClientCallCoreParams & AppClientCompilationParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<void> & AppCallTransactionResult & Partial<AppCompilationResult>>;
};
/**
* Gets available delete methods
*/
get delete(): {
/**
* Deletes an existing instance of the SmartAsset smart contract using the deleteApplication()void ABI method.
*
* @param args The arguments for the smart contract call
* @param params Any additional parameters for the call
* @returns The delete result
*/
deleteApplication(args: MethodArgs<"deleteApplication()void">, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<void> & AppCallTransactionResult>;
};
/**
* Makes a clear_state call to an existing instance of the SmartAsset smart contract.
*
* @param args The arguments for the bare call
* @returns The clear_state result
*/
clearState(args?: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResult>;
/**
* Calls the arc200_name()byte[32] ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200Name(args: MethodArgs<'arc200_name()byte[32]'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<Uint8Array<ArrayBufferLike>> & AppCallTransactionResult>;
/**
* Calls the arc200_symbol()byte[8] ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200Symbol(args: MethodArgs<'arc200_symbol()byte[8]'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<Uint8Array<ArrayBufferLike>> & AppCallTransactionResult>;
/**
* Calls the arc200_decimals()uint8 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200Decimals(args: MethodArgs<'arc200_decimals()uint8'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<number> & AppCallTransactionResult>;
/**
* Calls the arc200_totalSupply()uint256 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200TotalSupply(args: MethodArgs<'arc200_totalSupply()uint256'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<bigint> & AppCallTransactionResult>;
/**
* Calls the arc200_balanceOf(address)uint256 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200BalanceOf(args: MethodArgs<'arc200_balanceOf(address)uint256'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<bigint> & AppCallTransactionResult>;
/**
* Calls the arc200_allowance(address,address)uint256 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200Allowance(args: MethodArgs<'arc200_allowance(address,address)uint256'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<bigint> & AppCallTransactionResult>;
/**
* Calls the arc200_transfer(address,uint256)bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200Transfer(args: MethodArgs<'arc200_transfer(address,uint256)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the arc200_approve(address,uint256)bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200Approve(args: MethodArgs<'arc200_approve(address,uint256)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the arc200_transferFrom(address,address,uint256)bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
arc200TransferFrom(args: MethodArgs<'arc200_transferFrom(address,address,uint256)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the supportsInterface(byte[4])bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
supportsInterface(args: MethodArgs<'supportsInterface(byte[4])bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the zeroAddress()address ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
zeroAddress(args: MethodArgs<'zeroAddress()address'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<string> & AppCallTransactionResult>;
/**
* Calls the hasBox(address,address)bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
hasBox(args: MethodArgs<'hasBox(address,address)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the createBalanceBox(address)bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
createBalanceBox(args: MethodArgs<'createBalanceBox(address)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the createAllowanceBox(address,address)bool ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
createAllowanceBox(args: MethodArgs<'createAllowanceBox(address,address)bool'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<boolean> & AppCallTransactionResult>;
/**
* Calls the noop(uint64)void ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
noop(args: MethodArgs<'noop(uint64)void'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<void> & AppCallTransactionResult>;
/**
* Calls the manager()address ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
manager(args: MethodArgs<'manager()address'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<string> & AppCallTransactionResult>;
/**
* Calls the grant(address)void ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
grant(args: MethodArgs<'grant(address)void'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<void> & AppCallTransactionResult>;
/**
* Calls the bootstrap(pay)void ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The result of the call
*/
bootstrap(args: MethodArgs<'bootstrap(pay)void'>, params?: AppClientCallCoreParams & CoreAppCallArgs): Promise<AppCallTransactionResultOfType<void> & AppCallTransactionResult>;
/**
* Extracts a binary state value out of an AppState dictionary
*
* @param state The state dictionary containing the state value
* @param key The key of the state value
* @returns A BinaryState instance containing the state value, or undefined if the key was not found
*/
private static getBinaryState;
/**
* Extracts a integer state value out of an AppState dictionary
*
* @param state The state dictionary containing the state value
* @param key The key of the state value
* @returns An IntegerState instance containing the state value, or undefined if the key was not found
*/
private static getIntegerState;
/**
* Returns the smart contract's global state wrapped in a strongly typed accessor with options to format the stored value
*/
getGlobalState(): Promise<SmartAsset['state']['global']>;
compose(): SmartAssetComposer;
}
export type SmartAssetComposer<TReturns extends [...any[]] = []> = {
/**
* Calls the arc200_name()byte[32] ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
*/
arc200Name(args: MethodArgs<'arc200_name()byte[32]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): SmartAssetComposer<[...TReturns, MethodReturn<'arc200_name()byte[32]'>]>;
/**
* Calls the arc200_symbol()byte[8] ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
*/
arc200Symbol(args: MethodArgs<'arc200_symbol()byte[8]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): SmartAssetComposer<[...TReturns, MethodReturn<'arc200_symbol()byte[8]'>]>;
/**
* Calls the arc200_decimals()uint8 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
*/
arc200Decimals(args: MethodArgs<'arc200_decimals()uint8'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): SmartAssetComposer<[...TReturns, MethodReturn<'arc200_decimals()uint8'>]>;
/**
* Calls the arc200_totalSupply()uint256 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
*/
arc200TotalSupply(args: MethodArgs<'arc200_totalSupply()uint256'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): SmartAssetComposer<[...TReturns, MethodReturn<'arc200_totalSupply()uint256'>]>;
/**
* Calls the arc200_balanceOf(address)uint256 ABI method.
*
* @param args The arguments for the contract call
* @param params Any additional parameters for the call
* @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions
*/
arc200BalanceOf(args: MethodArgs<'arc200_balanceOf(address)uint256'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): SmartAssetComposer<[...TReturns, MethodReturn<'arc200_balanceOf(address)uint256'>]>;