import * as algosdk from 'algosdk'; import { AlgorandTransactionOptions, AlgorandTxAction, AlgorandTxActionRaw, AlgorandTxActionSdkEncoded } from './models/transactionModels'; import { AlgorandAddress, AlgorandChainTransactionParamsStruct, AlgorandRawTransactionMultisigStruct, AlgorandRawTransactionStruct, AlgorandTxHeaderParams } from './models'; /** Helper class to ensure transaction actions properties are set correctly * Algorand supports these actions: * 1) Payment, * 2) Key Registration, * 3) Asset Configuration, // Asset creation also comes under this category * 4) Asset Freeze, * 5) Asset Transfer. * Helper class has the same variables initialised as the Algorand Transaction Builder Class * All the transaction types listed above have relevant variables initialised from the Algorand Transaction Builder Class * https://github.com/algorand/js-algorand-sdk/blob/develop/src/transaction.js */ export declare class AlgorandActionHelper { private _rawAction; /** Creates a new Action from a raw action (or Algrorand action replacing hexstrings for Uint8Arrays) * .action property returns action with Uint8Arrays converted to hexstrings * .raw property returns action which includes Uint8Arrays (used by chain) */ constructor(params: AlgorandTxAction | AlgorandTxActionRaw | AlgorandTxActionSdkEncoded | AlgorandRawTransactionStruct | AlgorandRawTransactionMultisigStruct | algosdk.Transaction); /** applies rules for input params, converts to raw values if needed */ private validateAndApplyParams; /** Action properties including raw data */ get raw(): AlgorandTxActionRaw; /** Action properties with addresses converted to hexstrings (from Uint8Arrays) */ get action(): AlgorandTxAction; /** Action properties formatted to send to algosdk - includes hexstring addresses and UInt8Array note */ get actionEncodedForSdk(): AlgorandTxActionSdkEncoded; /** Action properties with all UInt8Array fields converted to hex strings */ private actionToRaw; /** Convert Action encoded for algo sdk to raw - */ private actionEncodedForSdkToRaw; /** Convert raw, compressed format to our decompressed raw format */ private actionRawCompressedToRaw; /** Always returns 'none' for Algorand chain */ get contract(): string; /** Transaction-specific properties - required for sending action to the chain */ get transactionHeaderParams(): AlgorandTxHeaderParams; /** Action properties - excludes 'suggestedParams' fields (e.g. genesisID) */ get paramsOnly(): { appApprovalProgram?: string; appClearProgram?: string; appArgs?: (string | number | Uint8Array)[]; group?: string; lease?: string; note?: string; selectionKey?: string; tag?: string; voteKey?: string; to?: string; from?: string; amount?: number; name?: string; closeRemainderTo?: string; voteFirst?: number; voteLast?: number; voteKeyDilution?: number; assetIndex?: number; assetTotal?: number; assetDecimals?: number; assetDefaultFrozen?: boolean; assetManager?: string; assetReserve?: string; assetFreeze?: string; assetClawback?: string; assetUnitName?: string; assetName?: string; assetURL?: string; assetMetadataHash?: string | Uint8Array; freezeAccount?: string; freezeState?: boolean; assetRevocationTarget?: string; type?: string; decimals?: number; appIndex?: number; appOnComplete?: number; appLocalInts?: number; appLocalByteSlices?: number; appGlobalInts?: number; appGlobalByteSlices?: number; appAccounts?: string[]; appForeignApps?: number[]; appForeignAssets?: number[]; reKeyTo?: string; }; /** Action properties - excludes 'suggestedParams' fields (e.g. genesisID) * Selected fields encoded (e.g. note) as required by algo sdk */ get paramsOnlySdkEncoded(): any; /** Encode selected fields required by algo sdk */ private encodeFieldsForSdk; /** Adds the latest transaction header fields (firstRound, etc.) from chain * Applies any that are not already provided in the action */ applyCurrentTxHeaderParamsWhereNeeded(chainTxParams: AlgorandChainTransactionParamsStruct, transactionOptions?: AlgorandTransactionOptions): void; /** Remove fields from object that are undefined, null, or empty */ private deleteEmptyFields; /** whether action is the native chain 'raw' format */ private isAlgorandTxAction; /** whether action is the native chain 'raw' format */ private isAlgorandTxActionRaw; /** whether action is the native chain 'raw' and compressed format (get_obj_for_encoding) as defined here - https://github.com/algorand/js-algorand-sdk/blob/a5309ee57dddbf6f9db5f95dc8a82eb1ae03c326/src/transaction.js#L154 */ private isAlgorandTxActionRawCompressed; /** whether action is encoded for the algo sdk (from is string and note is UInt8Array) */ private isAlgorandTxActionEncodedForSdk; /** Accepts encoded or unencoded AppArgs array * Converts to encoded AppArgs - array of Uint8Array */ private encodeAppArgsToRaw; /** Accepts encoded AppArgs - array of Uint8Array * Converts to unencoded AppArgs - array of hex encoded strings (with '0x' prefix) */ private decodeRawAppArgsToReadable; /** Returns the 'from' or 'snd' address for the transaction */ get from(): AlgorandAddress; }