Options
All
  • Public
  • Public/Protected
  • All
Menu

algosdk

Index

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

ABIReturnType: ABIType | "void"
ABIValue: boolean | number | bigint | string | Uint8Array | ABIValue[]
AppClearStateTxn: AppDeleteTxn
AppCloseOutTxn: AppDeleteTxn
AppNoOpTxn: AppDeleteTxn
AppOptInTxn: AppDeleteTxn
MustHaveSuggestedParams<T>: Extract<T, { suggestedParams: SuggestedParams }>

Only accept transaction objects that include suggestedParams as an object

Type parameters

MustHaveSuggestedParamsInline<T>: Extract<T, SuggestedParams>

Only accept transaction objects that include suggestedParams inline instead of being enclosed in its own property

Type parameters

TransactionLike: AnyTransaction | Transaction

Either a valid transaction object or an instance of the Transaction class

TransactionSigner: (txnGroup: Transaction[], indexesToSign: number[]) => Promise<Uint8Array[]>

Type declaration

    • (txnGroup: Transaction[], indexesToSign: number[]): Promise<Uint8Array[]>
    • This type represents a function which can sign transactions from an atomic transaction group.

      Parameters

      • txnGroup: Transaction[]

        The atomic group containing transactions to be signed

      • indexesToSign: number[]

        An array of indexes in the atomic transaction group that should be signed

      Returns Promise<Uint8Array[]>

      A promise which resolves an array of encoded signed transactions. The length of the array will be the same as the length of indexesToSign, and each index i in the array corresponds to the signed transaction from txnGroup[indexesToSign[i]]

Variables

ADDR_BYTE_SIZE: 32 = 32
ALGORAND_MIN_TX_FEE: 1000 = 1000
ERROR_INVALID_MICROALGOS: Error = ...
ERROR_MULTISIG_BAD_SENDER: Error = ...
INVALID_MICROALGOS_ERROR_MSG: "Microalgos should be positive and less than 2^53 - 1." = 'Microalgos should be positive and less than 2^53 - 1.'
LENGTH_ENCODE_BYTE_SIZE: 2 = 2
LogicTemplates: any = LogicTemplatesCommonJSExport.default
MAX_LEN: number = ...
MULTISIG_BAD_SENDER_ERROR_MSG: "The transaction sender address and multisig preimage do not match." = 'The transaction sender address and multisig preimage do not match.'
SINGLE_BOOL_SIZE: 1 = 1
SINGLE_BYTE_SIZE: 1 = 1

Functions

  • algosToMicroalgos(algos: number): number
  • algosToMicroalgos converts algos to microalgos

    Parameters

    • algos: number

      number

    Returns number

    number

  • appendSignMultisigTransaction(multisigTxnBlob: Uint8Array, __namedParameters: MultisigMetadata, sk: Uint8Array): { blob: Uint8Array; txID: string }
  • appendSignMultisigTransaction takes a multisig transaction blob, and appends our signature to it. While we could derive public key preimagery from the partially-signed multisig transaction, we ask the caller to pass it back in, to ensure they know what they are signing.

    Parameters

    • multisigTxnBlob: Uint8Array

      an encoded multisig txn. Supports non-payment txn types.

    • __namedParameters: MultisigMetadata
    • sk: Uint8Array

      Algorand secret key

    Returns { blob: Uint8Array; txID: string }

    object containing txID, and blob representing encoded multisig txn

    • blob: Uint8Array
    • txID: string
  • assignGroupID assigns group id to a given list of unsigned transactions

    Parameters

    • txns: TransactionLike[]

      array of transactions (every element is a dict or Transaction)

    • Optional from: string

      optional sender address specifying which transaction return

    Returns Transaction[]

    possible list of matching transactions

  • bigIntToBytes(bi: number | bigint, size: number): Uint8Array
  • bigIntToBytes converts a BigInt to a big-endian Uint8Array for encoding.

    Parameters

    • bi: number | bigint

      The bigint to convert.

    • size: number

      The size of the resulting byte array.

    Returns Uint8Array

    A byte array containing the big-endian encoding of the input bigint

  • bytesToBigInt(bytes: Uint8Array): bigint
  • bytesToBigInt produces a bigint from a binary representation.

    Parameters

    • bytes: Uint8Array

      The Uint8Array to convert.

    Returns bigint

    The bigint that was encoded in the input data.

  • computeGroupID returns group ID for a group of transactions

    Parameters

    • txns: TransactionLike[]

      array of transactions (every element is a dict or Transaction)

    Returns Buffer

    Buffer

  • createDryrun takes an Algod Client (from algod.AlgodV2Client) and an array of Signed Transactions from (transaction.SignedTransaction) and creates a DryrunRequest object with relevant balances

    Parameters

    Returns Promise<DryrunRequest>

    the DryrunRequest object constructed from the SignedTransactions passed

  • decodeAddress(address: string): Address
  • decodeAddress takes an Algorand address in string form and decodes it into a Uint8Array.

    Parameters

    • address: string

      an Algorand address with checksum.

    Returns Address

    the decoded form of the address's public key and checksum

  • decodeObj(o: ArrayLike<number>): unknown
  • decodeObj takes a Uint8Array and returns its javascript obj

    Parameters

    • o: ArrayLike<number>

      Uint8Array to decode

    Returns unknown

    object

  • decodeSignedTransaction takes a Buffer (from transaction.signTxn) and converts it to an object containing the Transaction (txn), the signature (sig), and the auth-addr field if applicable (sgnr)

    Parameters

    • transactionBuffer: Uint8Array

      the Uint8Array containing a transaction

    Returns SignedTransaction

    containing a Transaction, the signature, and possibly an auth-addr field

  • decodeUint64(data: Uint8Array, decodingMode: "safe"): number
  • decodeUint64(data: Uint8Array, decodingMode: "mixed"): number | bigint
  • decodeUint64(data: Uint8Array, decodingMode: "bigint"): bigint
  • decodeUint64 produces an integer from a binary representation.

    Parameters

    • data: Uint8Array

      An typed array containing the big-endian encoding of an unsigned integer less than 2^64. This array must be at most 8 bytes long.

    • decodingMode: "safe"

      Configure how the integer will be decoded.

      The options are:

      • "safe": The integer will be decoded as a Number, but if it is greater than Number.MAX_SAFE_INTEGER an error will be thrown.
      • "mixed": The integer will be decoded as a Number if it is less than or equal to Number.MAX_SAFE_INTEGER, otherwise it will be decoded as a BigInt.
      • "bigint": The integer will always be decoded as a BigInt.

      Defaults to "safe" if not included.

    Returns number

    The integer that was encoded in the input data. The return type will be determined by the parameter decodingMode.

  • Parameters

    • data: Uint8Array
    • decodingMode: "mixed"

    Returns number | bigint

  • Parameters

    • data: Uint8Array
    • decodingMode: "bigint"

    Returns bigint

  • decodeUnsignedTransaction(transactionBuffer: ArrayLike<number>): Transaction
  • decodeUnsignedTransaction takes a Buffer (as if from encodeUnsignedTransaction) and converts it to a txnBuilder.Transaction object

    Parameters

    • transactionBuffer: ArrayLike<number>

      the Uint8Array containing a transaction

    Returns Transaction

  • encodeAddress(address: Uint8Array): string
  • encodeAddress takes an Algorand address as a Uint8Array and encodes it into a string with checksum.

    Parameters

    • address: Uint8Array

      a raw Algorand address

    Returns string

    the address and checksum encoded as a string.

  • encodeObj(o: Record<string | number | symbol, any>): Uint8Array
  • encodeObj takes a javascript object and returns its msgpack encoding Note that the encoding sorts the fields alphabetically

    Parameters

    • o: Record<string | number | symbol, any>

      js obj

    Returns Uint8Array

    Uint8Array binary representation

  • encodeUint64(num: number | bigint): Uint8Array
  • encodeUint64 converts an integer to its binary representation.

    Parameters

    • num: number | bigint

      The number to convert. This must be an unsigned integer less than 2^64.

    Returns Uint8Array

    An 8-byte typed array containing the big-endian encoding of the input integer.

  • encodeUnsignedTransaction(transactionObject: Transaction): Uint8Array
  • encodeUnsignedTransaction takes a completed txnBuilder.Transaction object, such as from the makeFoo family of transactions, and converts it to a Buffer

    Parameters

    • transactionObject: Transaction

      the completed Transaction object

    Returns Uint8Array

  • generateAccount returns a new Algorand address and its corresponding secret key

    Returns Account

  • getApplicationAddress(appID: number | bigint): string
  • Get the escrow address of an application.

    Parameters

    • appID: number | bigint

      The ID of the application.

    Returns string

    The address corresponding to that application's escrow account.

  • Check if a value conforms to the TransactionWithSigner structure.

    Parameters

    • value: any

      The value to check.

    Returns value is TransactionWithSigner

    True if an only if the value has the structure of a TransactionWithSigner.

  • isValidAddress(address: string): boolean
  • isValidAddress checks if a string is a valid Algorand address.

    Parameters

    • address: string

      an Algorand address with checksum.

    Returns boolean

    true if valid, false otherwise

  • logicSigFromByte(encoded: Uint8Array): LogicSig
  • logicSigFromByte accepts encoded logic sig bytes and attempts to call logicsig.fromByte on it, returning the result

    Parameters

    • encoded: Uint8Array

    Returns LogicSig

  • makeApplicationCallTxnFromObject(options: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; approvalProgram?: Uint8Array; clearProgram?: Uint8Array; extraPages?: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; numGlobalByteSlices?: number; numGlobalInts?: number; numLocalByteSlices?: number; numLocalInts?: number; onComplete: OnApplicationComplete; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Generic function for creating any application call transaction.

    Parameters

    • options: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; approvalProgram?: Uint8Array; clearProgram?: Uint8Array; extraPages?: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; numGlobalByteSlices?: number; numGlobalInts?: number; numLocalByteSlices?: number; numLocalInts?: number; onComplete: OnApplicationComplete; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • Optional approvalProgram?: Uint8Array

        The compiled TEAL that approves a transaction

      • Optional clearProgram?: Uint8Array

        The compiled TEAL program that runs when clearing state

      • Optional extraPages?: number

        Int representing extra pages of memory to rent during an application create transaction.

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional numGlobalByteSlices?: number

        Restricts number of byte slices in global state

      • Optional numGlobalInts?: number

        Restricts number of ints in global state

      • Optional numLocalByteSlices?: number

        Restricts number of byte slices in per-user local state

      • Optional numLocalInts?: number

        Restricts number of ints in per-user local state

      • onComplete: OnApplicationComplete

        What application should do once the program has been run

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationClearStateTxn(from: string, suggestedParams: SuggestedParams, appIndex: number, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string): Transaction
  • Make a transaction that clears a user's state in an application

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • appIndex: number

      the ID of the app to use

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    Returns Transaction

  • makeApplicationClearStateTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationCloseOutTxn(from: string, suggestedParams: SuggestedParams, appIndex: number, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string): Transaction
  • Make a transaction that closes out a user's state in an application

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • appIndex: number

      the ID of the app to use

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    Returns Transaction

  • makeApplicationCloseOutTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationCreateTxn(from: string, suggestedParams: SuggestedParams, onComplete: OnApplicationComplete, approvalProgram: Uint8Array, clearProgram: Uint8Array, numLocalInts: number, numLocalByteSlices: number, numGlobalInts: number, numGlobalByteSlices: number, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string, extraPages?: number): Transaction
  • Make a transaction that will create an application.

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • onComplete: OnApplicationComplete

      algosdk.OnApplicationComplete, what application should do once the program is done being run

    • approvalProgram: Uint8Array

      Uint8Array, the compiled TEAL that approves a transaction

    • clearProgram: Uint8Array

      Uint8Array, the compiled TEAL that runs when clearing state

    • numLocalInts: number

      restricts number of ints in per-user local state

    • numLocalByteSlices: number

      restricts number of byte slices in per-user local state

    • numGlobalInts: number

      restricts number of ints in global state

    • numGlobalByteSlices: number

      restricts number of byte slices in global state

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    • Optional extraPages: number

      integer extra pages of memory to rent on creation of application

    Returns Transaction

  • makeApplicationCreateTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; approvalProgram: Uint8Array; clearProgram: Uint8Array; extraPages?: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; numGlobalByteSlices: number; numGlobalInts: number; numLocalByteSlices: number; numLocalInts: number; onComplete: OnApplicationComplete; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; approvalProgram: Uint8Array; clearProgram: Uint8Array; extraPages?: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; numGlobalByteSlices: number; numGlobalInts: number; numLocalByteSlices: number; numLocalInts: number; onComplete: OnApplicationComplete; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • approvalProgram: Uint8Array

        The compiled TEAL that approves a transaction

      • clearProgram: Uint8Array

        The compiled TEAL program that runs when clearing state

      • Optional extraPages?: number

        Int representing extra pages of memory to rent during an application create transaction.

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • numGlobalByteSlices: number

        Restricts number of byte slices in global state

      • numGlobalInts: number

        Restricts number of ints in global state

      • numLocalByteSlices: number

        Restricts number of byte slices in per-user local state

      • numLocalInts: number

        Restricts number of ints in per-user local state

      • onComplete: OnApplicationComplete

        What application should do once the program has been run

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationDeleteTxn(from: string, suggestedParams: SuggestedParams, appIndex: number, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string): Transaction
  • Make a transaction that deletes an application

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • appIndex: number

      the ID of the app to be deleted

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    Returns Transaction

  • makeApplicationDeleteTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationNoOpTxn(from: string, suggestedParams: SuggestedParams, appIndex: number, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string): Transaction
  • Make a transaction that just calls an application, doing nothing on completion

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • appIndex: number

      the ID of the app to use

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    Returns Transaction

  • makeApplicationNoOpTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationOptInTxn(from: string, suggestedParams: SuggestedParams, appIndex: number, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string): Transaction
  • Make a transaction that opts in to use an application

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • appIndex: number

      the ID of the app to join

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    Returns Transaction

  • makeApplicationOptInTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeApplicationUpdateTxn(from: string, suggestedParams: SuggestedParams, appIndex: number, approvalProgram: Uint8Array, clearProgram: Uint8Array, appArgs?: Uint8Array[], accounts?: string[], foreignApps?: number[], foreignAssets?: number[], note?: Uint8Array, lease?: Uint8Array, rekeyTo?: string): Transaction
  • Make a transaction that changes an application's approval and clear programs

    Parameters

    • from: string

      address of sender

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • appIndex: number

      the ID of the app to be updated

    • approvalProgram: Uint8Array

      Uint8Array, the compiled TEAL that approves a transaction

    • clearProgram: Uint8Array

      Uint8Array, the compiled TEAL that runs when clearing state

    • Optional appArgs: Uint8Array[]

      Array of Uint8Array, any additional arguments to the application

    • Optional accounts: string[]

      Array of Address strings, any additional accounts to supply to the application

    • Optional foreignApps: number[]

      Array of int, any other apps used by the application, identified by index

    • Optional foreignAssets: number[]

      Array of int, any assets used by the application, identified by index

    • Optional note: Uint8Array

      Arbitrary data for sender to store

    • Optional lease: Uint8Array

      Lease a transaction

    • Optional rekeyTo: string

      String representation of the Algorand address that will be used to authorize all future transactions

    Returns Transaction

  • makeApplicationUpdateTxnFromObject(o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; approvalProgram: Uint8Array; clearProgram: Uint8Array; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { accounts?: string[]; appArgs?: Uint8Array[]; appIndex: number; approvalProgram: Uint8Array; clearProgram: Uint8Array; foreignApps?: number[]; foreignAssets?: number[]; from: string; lease?: Uint8Array; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • Optional accounts?: string[]

        Array of Address strings, any additional accounts to supply to the application

      • Optional appArgs?: Uint8Array[]

        Array of Uint8Array, any additional arguments to the application

      • appIndex: number

        A unique application index

      • approvalProgram: Uint8Array

        The compiled TEAL that approves a transaction

      • clearProgram: Uint8Array

        The compiled TEAL program that runs when clearing state

      • Optional foreignApps?: number[]

        Array of int, any other apps used by the application, identified by index

      • Optional foreignAssets?: number[]

        Array of int, any assets used by the application, identified by index

      • from: string

        String representation of Algorand address of sender

      • Optional lease?: Uint8Array

        Lease a transaction. The sender cannot send another txn with that same lease until the last round of original txn has passed

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeAssetConfigTxn(from: string, fee: number, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, assetIndex: number, manager: string, reserve: string, freeze: string, clawback: string, strictEmptyAddressChecking?: boolean, rekeyTo?: string): Transaction
  • makeAssetConfigTxn can be issued by the asset manager to change the manager, reserve, freeze, or clawback you must respecify existing addresses to keep them the same; leaving a field blank is the same as turning that feature off for this asset

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • assetIndex: number

      int asset index uniquely specifying the asset

    • manager: string

      string representation of new asset manager Algorand address

    • reserve: string

      string representation of new reserve Algorand address

    • freeze: string

      string representation of new freeze manager Algorand address

    • clawback: string

      string representation of new revocation manager Algorand address

    • strictEmptyAddressChecking: boolean = true

      boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetConfigTxnWithSuggestedParams(from: string, note: Uint8Array, assetIndex: number, manager: string, reserve: string, freeze: string, clawback: string, suggestedParams: SuggestedParams, strictEmptyAddressChecking?: boolean, rekeyTo?: string): Transaction
  • makeAssetConfigTxnWithSuggestedParams can be issued by the asset manager to change the manager, reserve, freeze, or clawback you must respecify existing addresses to keep them the same; leaving a field blank is the same as turning that feature off for this asset

    Parameters

    • from: string

      string representation of Algorand address of sender

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • assetIndex: number

      int asset index uniquely specifying the asset

    • manager: string

      string representation of new asset manager Algorand address

    • reserve: string

      string representation of new reserve Algorand address

    • freeze: string

      string representation of new freeze manager Algorand address

    • clawback: string

      string representation of new revocation manager Algorand address

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • strictEmptyAddressChecking: boolean = true

      boolean - throw an error if any of manager, reserve, freeze, or clawback are undefined. optional, defaults to true.

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetConfigTxnWithSuggestedParamsFromObject(o: { assetIndex: number; clawback?: string; freeze?: string; from: string; manager?: string; note?: Uint8Array; rekeyTo?: string; reserve?: string; strictEmptyAddressChecking: boolean; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { assetIndex: number; clawback?: string; freeze?: string; from: string; manager?: string; note?: Uint8Array; rekeyTo?: string; reserve?: string; strictEmptyAddressChecking: boolean; suggestedParams: SuggestedParams }
      • assetIndex: number

        Asset index uniquely specifying the asset

      • Optional clawback?: string

        String representation of Algorand address with power to revoke asset holdings

      • Optional freeze?: string

        String representation of Algorand address with power to freeze/unfreeze asset holdings

      • from: string

        String representation of Algorand address of sender

      • Optional manager?: string

        String representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc.

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • Optional reserve?: string

        String representation of Algorand address representing asset reserve

      • strictEmptyAddressChecking: boolean
      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeAssetCreateTxn(from: string, fee: number, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, total: number | bigint, decimals: number, defaultFrozen: boolean, manager: string, reserve: string, freeze: string, clawback: string, unitName: string, assetName: string, assetURL: string, assetMetadataHash?: string | Uint8Array, rekeyTo?: string): Transaction
  • makeAssetCreateTxn takes asset creation arguments and returns a Transaction object for creating that asset

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • total: number | bigint

      integer total supply of the asset

    • decimals: number

      integer number of decimals for asset unit calculation

    • defaultFrozen: boolean

      boolean whether asset accounts should default to being frozen

    • manager: string

      string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc

    • reserve: string

      string representation of Algorand address representing asset reserve

    • freeze: string

      string representation of Algorand address with power to freeze/unfreeze asset holdings

    • clawback: string

      string representation of Algorand address with power to revoke asset holdings

    • unitName: string

      string units name for this asset

    • assetName: string

      string name for this asset

    • assetURL: string

      string URL relating to this asset

    • Optional assetMetadataHash: string | Uint8Array

      Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetCreateTxnWithSuggestedParams(from: string, note: Uint8Array, total: number | bigint, decimals: number, defaultFrozen: boolean, manager: string, reserve: string, freeze: string, clawback: string, unitName: string, assetName: string, assetURL: string, assetMetadataHash: string | Uint8Array, suggestedParams: SuggestedParams, rekeyTo?: string): Transaction
  • makeAssetCreateTxnWithSuggestedParams takes asset creation arguments and returns a Transaction object for creating that asset

    Parameters

    • from: string

      string representation of Algorand address of sender

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • total: number | bigint

      integer total supply of the asset

    • decimals: number

      integer number of decimals for asset unit calculation

    • defaultFrozen: boolean

      boolean whether asset accounts should default to being frozen

    • manager: string

      string representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc

    • reserve: string

      string representation of Algorand address representing asset reserve

    • freeze: string

      string representation of Algorand address with power to freeze/unfreeze asset holdings

    • clawback: string

      string representation of Algorand address with power to revoke asset holdings

    • unitName: string

      string units name for this asset

    • assetName: string

      string name for this asset

    • assetURL: string

      string URL relating to this asset

    • assetMetadataHash: string | Uint8Array

      Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetCreateTxnWithSuggestedParamsFromObject(o: { assetMetadataHash?: string | Uint8Array; assetName?: string; assetURL?: string; clawback?: string; decimals: number; defaultFrozen: boolean; freeze?: string; from: string; manager?: string; note?: Uint8Array; rekeyTo?: string; reserve?: string; suggestedParams: SuggestedParams; total: number | bigint; unitName?: string }): Transaction
  • Parameters

    • o: { assetMetadataHash?: string | Uint8Array; assetName?: string; assetURL?: string; clawback?: string; decimals: number; defaultFrozen: boolean; freeze?: string; from: string; manager?: string; note?: Uint8Array; rekeyTo?: string; reserve?: string; suggestedParams: SuggestedParams; total: number | bigint; unitName?: string }
      • Optional assetMetadataHash?: string | Uint8Array

        Uint8Array or UTF-8 string representation of a hash commitment with respect to the asset. Must be exactly 32 bytes long.

      • Optional assetName?: string

        Name for this asset

      • Optional assetURL?: string

        URL relating to this asset

      • Optional clawback?: string

        String representation of Algorand address with power to revoke asset holdings

      • decimals: number

        Integer number of decimals for asset unit calcuation

      • defaultFrozen: boolean

        Whether asset accounts should default to being frozen

      • Optional freeze?: string

        String representation of Algorand address with power to freeze/unfreeze asset holdings

      • from: string

        String representation of Algorand address of sender

      • Optional manager?: string

        String representation of Algorand address in charge of reserve, freeze, clawback, destruction, etc.

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • Optional reserve?: string

        String representation of Algorand address representing asset reserve

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

      • total: number | bigint

        Total supply of the asset

      • Optional unitName?: string

        Unit name for this asset

    Returns Transaction

  • makeAssetDestroyTxn(from: string, fee: number, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, assetIndex: number, rekeyTo?: string): Transaction
  • makeAssetDestroyTxn will allow the asset's manager to remove this asset from the ledger, so long as all outstanding assets are held by the creator.

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • assetIndex: number

      int asset index uniquely specifying the asset

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetDestroyTxnWithSuggestedParams(from: string, note: Uint8Array, assetIndex: number, suggestedParams: SuggestedParams, rekeyTo?: string): Transaction
  • makeAssetDestroyTxnWithSuggestedParams will allow the asset's manager to remove this asset from the ledger, so long as all outstanding assets are held by the creator.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • assetIndex: number

      int asset index uniquely specifying the asset

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetDestroyTxnWithSuggestedParamsFromObject(o: { assetIndex: number; from: string; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { assetIndex: number; from: string; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • assetIndex: number

        Asset index uniquely specifying the asset

      • from: string

        String representation of Algorand address of sender

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeAssetFreezeTxn(from: string, fee: number, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, assetIndex: number, freezeTarget: string, freezeState: boolean, rekeyTo?: string): Transaction
  • makeAssetFreezeTxn will allow the asset's freeze manager to freeze or un-freeze an account, blocking or allowing asset transfers to and from the targeted account.

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • assetIndex: number

      int asset index uniquely specifying the asset

    • freezeTarget: string

      string representation of Algorand address being frozen or unfrozen

    • freezeState: boolean

      true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetFreezeTxnWithSuggestedParams(from: string, note: Uint8Array, assetIndex: number, freezeTarget: string, freezeState: boolean, suggestedParams: SuggestedParams, rekeyTo?: string): Transaction
  • makeAssetFreezeTxnWithSuggestedParams will allow the asset's freeze manager to freeze or un-freeze an account, blocking or allowing asset transfers to and from the targeted account.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • assetIndex: number

      int asset index uniquely specifying the asset

    • freezeTarget: string

      string representation of Algorand address being frozen or unfrozen

    • freezeState: boolean

      true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetFreezeTxnWithSuggestedParamsFromObject(o: { assetIndex: number; freezeState: boolean; freezeTarget: string; from: string; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { assetIndex: number; freezeState: boolean; freezeTarget: string; from: string; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • assetIndex: number

        Asset index uniquely specifying the asset

      • freezeState: boolean

        true if freezeTarget should be frozen, false if freezeTarget should be allowed to transact

      • freezeTarget: string

        String representation of Algorand address being frozen or unfrozen

      • from: string

        String representation of Algorand address of sender

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeAssetTransferTxn(from: string, to: string, closeRemainderTo: string, revocationTarget: string, fee: number, amount: number | bigint, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, assetIndex: number, rekeyTo?: string): Transaction
  • makeAssetTransferTxn allows for the creation of an asset transfer transaction. Special case: to begin accepting assets, set amount=0 and from=to.

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • to: string

      string representation of Algorand address of asset recipient

    • closeRemainderTo: string

      optional - string representation of Algorand address - if provided, send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings

    • revocationTarget: string

      optional - string representation of Algorand address - if provided, and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • amount: number | bigint

      integer amount of assets to send

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • assetIndex: number

      int asset index uniquely specifying the asset

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetTransferTxnWithSuggestedParams(from: string, to: string, closeRemainderTo: string, revocationTarget: string, amount: number | bigint, note: Uint8Array, assetIndex: number, suggestedParams: SuggestedParams, rekeyTo?: string): Transaction
  • makeAssetTransferTxnWithSuggestedParams allows for the creation of an asset transfer transaction. Special case: to begin accepting assets, set amount=0 and from=to.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • to: string

      string representation of Algorand address of asset recipient

    • closeRemainderTo: string

      optional - string representation of Algorand address - if provided, send all remaining assets after transfer to the "closeRemainderTo" address and close "from"'s asset holdings

    • revocationTarget: string

      optional - string representation of Algorand address - if provided, and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"

    • amount: number | bigint

      integer amount of assets to send

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • assetIndex: number

      int asset index uniquely specifying the asset

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE

      • flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use
    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makeAssetTransferTxnWithSuggestedParamsFromObject(o: { amount: number | bigint; assetIndex: number; closeRemainderTo?: string; from: string; note?: Uint8Array; rekeyTo?: string; revocationTarget?: string; suggestedParams: SuggestedParams; to: string }): Transaction
  • Parameters

    • o: { amount: number | bigint; assetIndex: number; closeRemainderTo?: string; from: string; note?: Uint8Array; rekeyTo?: string; revocationTarget?: string; suggestedParams: SuggestedParams; to: string }
      • amount: number | bigint

        Integer amount to send

      • assetIndex: number

        Asset index uniquely specifying the asset

      • Optional closeRemainderTo?: string

        Close out remaining account balance to this account

      • from: string

        String representation of Algorand address of sender

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • Optional revocationTarget?: string

        String representation of Algorand address – if provided, and if "from" is the asset's revocation manager, then deduct from "revocationTarget" rather than "from"

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

      • to: string

        String representation of Algorand address of recipient

    Returns Transaction

  • makeKeyRegistrationTxn(from: string, fee: number, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, voteKey: string | Uint8Array, selectionKey: string | Uint8Array, voteFirst: number, voteLast: number, voteKeyDilution: number, rekeyTo?: string, nonParticipation?: false, stateProofKey?: string | Uint8Array): Transaction
  • makeKeyRegistrationTxn(from: string, fee: number, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, voteKey: undefined, selectionKey: undefined, voteFirst: undefined, voteLast: undefined, voteKeyDilution: undefined, rekeyTo?: string, nonParticipation?: true, stateProofKey?: undefined): Transaction
  • makeKeyRegistrationTxn takes key registration arguments and returns a Transaction object for that key registration operation

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • voteKey: string | Uint8Array

      voting key. for key deregistration, leave undefined

    • selectionKey: string | Uint8Array

      selection key. for key deregistration, leave undefined

    • voteFirst: number

      first round on which voteKey is valid

    • voteLast: number

      last round on which voteKey is valid

    • voteKeyDilution: number

      integer

    • Optional rekeyTo: string

      rekeyTo address, optional

    • Optional nonParticipation: false

      configure whether the address wants to stop participating. If true, voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.

    • Optional stateProofKey: string | Uint8Array

      state proof key. for key deregistration, leave undefined

    Returns Transaction

  • Parameters

    • from: string
    • fee: number
    • firstRound: number
    • lastRound: number
    • note: Uint8Array
    • genesisHash: string
    • genesisID: string
    • voteKey: undefined
    • selectionKey: undefined
    • voteFirst: undefined
    • voteLast: undefined
    • voteKeyDilution: undefined
    • Optional rekeyTo: string
    • Optional nonParticipation: true
    • Optional stateProofKey: undefined

    Returns Transaction

  • makeKeyRegistrationTxnWithSuggestedParams(from: string, note: Uint8Array, voteKey: string | Uint8Array, selectionKey: string | Uint8Array, voteFirst: number, voteLast: number, voteKeyDilution: number, suggestedParams: SuggestedParams, rekeyTo?: string, nonParticipation?: false, stateProofKey?: string | Uint8Array): Transaction
  • makeKeyRegistrationTxnWithSuggestedParams(from: string, note: Uint8Array, voteKey: undefined, selectionKey: undefined, voteFirst: undefined, voteLast: undefined, voteKeyDilution: undefined, suggestedParams: SuggestedParams, rekeyTo?: string, nonParticipation?: true, stateProofKey?: undefined): Transaction
  • makeKeyRegistrationTxnWithSuggestedParams takes key registration arguments and returns a Transaction object for that key registration operation

    Parameters

    • from: string

      string representation of Algorand address of sender

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • voteKey: string | Uint8Array

      voting key. for key deregistration, leave undefined

    • selectionKey: string | Uint8Array

      selection key. for key deregistration, leave undefined

    • voteFirst: number

      first round on which voteKey is valid

    • voteLast: number

      last round on which voteKey is valid

    • voteKeyDilution: number

      integer

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • Optional rekeyTo: string

      rekeyTo address, optional

    • Optional nonParticipation: false

      configure whether the address wants to stop participating. If true, voteKey, selectionKey, voteFirst, voteLast, and voteKeyDilution must be undefined.

    • Optional stateProofKey: string | Uint8Array

      state proof key. for key deregistration, leave undefined

    Returns Transaction

  • Parameters

    • from: string
    • note: Uint8Array
    • voteKey: undefined
    • selectionKey: undefined
    • voteFirst: undefined
    • voteLast: undefined
    • voteKeyDilution: undefined
    • suggestedParams: SuggestedParams
    • Optional rekeyTo: string
    • Optional nonParticipation: true
    • Optional stateProofKey: undefined

    Returns Transaction

  • makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: { from: string; nonParticipation?: false; note?: Uint8Array; rekeyTo?: string; selectionKey: string | Uint8Array; stateProofKey: string | Uint8Array; suggestedParams: SuggestedParams; voteFirst: number; voteKey: string | Uint8Array; voteKeyDilution: number; voteLast: number }): Transaction
  • makeKeyRegistrationTxnWithSuggestedParamsFromObject(o: { from: string; nonParticipation: true; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }): Transaction
  • Parameters

    • o: { from: string; nonParticipation?: false; note?: Uint8Array; rekeyTo?: string; selectionKey: string | Uint8Array; stateProofKey: string | Uint8Array; suggestedParams: SuggestedParams; voteFirst: number; voteKey: string | Uint8Array; voteKeyDilution: number; voteLast: number }
      • from: string

        String representation of Algorand address of sender

      • Optional nonParticipation?: false
      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • selectionKey: string | Uint8Array

        Selection key bytes. For key deregistration, leave undefined

      • stateProofKey: string | Uint8Array

        State proof key bytes. For key deregistration, leave undefined

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

      • voteFirst: number

        First round on which voteKey is valid

      • voteKey: string | Uint8Array

        Voting key bytes. For key deregistration, leave undefined

      • voteKeyDilution: number

        The dilution fo the 2-level participation key

      • voteLast: number

        Last round on which voteKey is valid

    Returns Transaction

  • Parameters

    • o: { from: string; nonParticipation: true; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams }
      • from: string

        String representation of Algorand address of sender

      • nonParticipation: true
      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

    Returns Transaction

  • makeLogicSig(program: Uint8Array, args?: Uint8Array[]): LogicSig
  • makeLogicSig creates LogicSig object from program and arguments

    deprecated

    Use new LogicSigAccount(...) instead

    Parameters

    • program: Uint8Array

      Program to make LogicSig from

    • Optional args: Uint8Array[]

      Arguments as array of Uint8Array

    Returns LogicSig

    LogicSig object

  • Create a TransactionSigner that can sign transactions for the provided Multisig account.

    Parameters

    • msig: MultisigMetadata

      The Multisig account metadata

    • sks: Uint8Array[]

      An array of private keys belonging to the msig which should sign the transactions.

    Returns TransactionSigner

  • makePaymentTxn(from: string, to: string, fee: number, amount: number | bigint, closeRemainderTo: string, firstRound: number, lastRound: number, note: Uint8Array, genesisHash: string, genesisID: string, rekeyTo?: string): Transaction
  • makePaymentTxn takes payment arguments and returns a Transaction object

    deprecated

    in version 2.0 this will change to use the "WithSuggestedParams" signature.

    Parameters

    • from: string

      string representation of Algorand address of sender

    • to: string

      string representation of Algorand address of recipient

    • fee: number

      integer fee per byte, in microAlgos. for a flat fee, overwrite the fee property on the returned object If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • amount: number | bigint

      integer amount to send, in microAlgos

    • closeRemainderTo: string

      optionally close out remaining account balance to this account, represented as string rep of Algorand address

    • firstRound: number

      integer first protocol round on which this txn is valid

    • lastRound: number

      integer last protocol round on which this txn is valid

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • genesisHash: string

      string specifies hash genesis block of network in use

    • genesisID: string

      string specifies genesis ID of network in use

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makePaymentTxnWithSuggestedParams(from: string, to: string, amount: number | bigint, closeRemainderTo: string, note: Uint8Array, suggestedParams: SuggestedParams, rekeyTo?: string): Transaction
  • makePaymentTxnWithSuggestedParams takes payment arguments and returns a Transaction object

    Parameters

    • from: string

      string representation of Algorand address of sender

    • to: string

      string representation of Algorand address of recipient

    • amount: number | bigint

      integer amount to send, in microAlgos

    • closeRemainderTo: string

      optionally close out remaining account balance to this account, represented as string rep of Algorand address

    • note: Uint8Array

      uint8array of arbitrary data for sender to store

    • suggestedParams: SuggestedParams

      a dict holding common-to-all-txns args: fee - integer fee per byte, in microAlgos. for a flat fee, set flatFee to true flatFee - bool optionally set this to true to specify fee as microalgos-per-txn If true, txn fee may fall below the ALGORAND_MIN_TX_FEE firstRound - integer first protocol round on which this txn is valid lastRound - integer last protocol round on which this txn is valid genesisHash - string specifies hash genesis block of network in use genesisID - string specifies genesis ID of network in use

    • Optional rekeyTo: string

      rekeyTo address, optional

    Returns Transaction

  • makePaymentTxnWithSuggestedParamsFromObject(o: { amount: number | bigint; closeRemainderTo?: string; from: string; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams; to: string }): Transaction
  • Parameters

    • o: { amount: number | bigint; closeRemainderTo?: string; from: string; note?: Uint8Array; rekeyTo?: string; suggestedParams: SuggestedParams; to: string }
      • amount: number | bigint

        Integer amount to send

      • Optional closeRemainderTo?: string

        Close out remaining account balance to this account

      • from: string

        String representation of Algorand address of sender

      • Optional note?: Uint8Array

        Arbitrary data for sender to store

      • Optional rekeyTo?: string

        String representation of the Algorand address that will be used to authorize all future transactions

      • suggestedParams: SuggestedParams

        A dict holding common-to-all-txns arguments

      • to: string

        String representation of Algorand address of recipient

    Returns Transaction

  • masterDerivationKeyToMnemonic(mdk: Uint8Array): string
  • masterDerivationKeyToMnemonic takes a master derivation key and returns the corresponding mnemonic.

    Parameters

    • mdk: Uint8Array

      Uint8Array

    Returns string

    string mnemonic

  • mergeMultisigTransactions(multisigTxnBlobs: Uint8Array[]): Uint8Array
  • mergeMultisigTransactions takes a list of multisig transaction blobs, and merges them.

    Parameters

    • multisigTxnBlobs: Uint8Array[]

      a list of blobs representing encoded multisig txns

    Returns Uint8Array

    typed array msg-pack encoded multisig txn

  • microalgosToAlgos(microalgos: number): number
  • microalgosToAlgos converts microalgos to algos

    Parameters

    • microalgos: number

      number

    Returns number

    number

  • mnemonicFromSeed(seed: Uint8Array): string
  • mnemonicFromSeed converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum. Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.

    Parameters

    • seed: Uint8Array

      32 bytes long seed

    Returns string

    25 words mnemonic

  • mnemonicToMasterDerivationKey(mn: string): Uint8Array
  • mnemonicToMasterDerivationKey takes a mnemonic string and returns the corresponding master derivation key.

    throws

    error if fails to decode the mnemonic

    Parameters

    • mn: string

      25 words Algorand mnemonic

    Returns Uint8Array

    Uint8Array

  • mnemonicToSecretKey(mn: string): Account
  • mnemonicToSecretKey takes a mnemonic string and returns the corresponding Algorand address and its secret key.

    throws

    error if fails to decode the mnemonic

    Parameters

    • mn: string

      25 words Algorand mnemonic

    Returns Account

  • multisigAddress takes multisig metadata (preimage) and returns the corresponding human readable Algorand address.

    Parameters

    Returns string

  • secretKeyToMnemonic(sk: Uint8Array): string
  • secretKeyToMnemonic takes an Algorand secret key and returns the corresponding mnemonic.

    Parameters

    • sk: Uint8Array

      Algorand secret key

    Returns string

    Secret key's associated mnemonic

  • seedFromMnemonic(mnemonic: string): Uint8Array
  • seedFromMnemonic converts a mnemonic generated using this library into the source key used to create it. It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one of the passed words is not found in the words list.

    Parameters

    • mnemonic: string

      25 words mnemonic

    Returns Uint8Array

    32 bytes long seed

  • signBid(bid: BidOptions, sk: Uint8Array): Uint8Array
  • signBid takes an object with the following fields: bidder key, bid amount, max price, bid ID, auctionKey, auction ID, and a secret key and returns a signed blob to be inserted into a transaction Algorand note field.

    Parameters

    • bid: BidOptions

      Algorand Bid

    • sk: Uint8Array

      Algorand secret key

    Returns Uint8Array

    Uint8Array binary signed bid

  • signBytes(bytes: Uint8Array, sk: Uint8Array): Uint8Array
  • signBytes takes arbitrary bytes and a secret key, prepends the bytes with "MX" for domain separation, signs the bytes with the private key, and returns the signature.

    Parameters

    • bytes: Uint8Array

      Uint8array

    • sk: Uint8Array

      Algorand secret key

    Returns Uint8Array

    binary signature

  • signLogicSigTransaction takes a transaction and a LogicSig object and returns a signed transaction.

    throws

    error on failure

    Parameters

    Returns { blob: Uint8Array; txID: string }

    Object containing txID and blob representing signed transaction.

    • blob: Uint8Array
    • txID: string
  • signLogicSigTransactionObject takes a transaction and a LogicSig object and returns a signed transaction.

    Parameters

    Returns { blob: Uint8Array; txID: string }

    Object containing txID and blob representing signed transaction.

    • blob: Uint8Array
    • txID: string
  • signMultisigTransaction takes a raw transaction (see signTransaction), a multisig preimage, a secret key, and returns a multisig transaction, which is a blob representing a transaction and multisignature account preimage. The returned multisig txn can accumulate additional signatures through mergeMultisigTransactions or appendMultisigTransaction.

    Parameters

    • txn: TransactionLike

      object with either payment or key registration fields

    • __namedParameters: MultisigMetadata
    • sk: Uint8Array

      Algorand secret key. The corresponding pk should be in the pre image.

    Returns { blob: Uint8Array; txID: string }

    object containing txID, and blob of partially signed multisig transaction (with multisig preimage information) If the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    • blob: Uint8Array
    • txID: string
  • signTransaction(txn: TransactionLike, sk: Uint8Array): { blob: Uint8Array; txID: string }
  • signTransaction takes an object with either payment or key registration fields and a secret key and returns a signed blob.

    Payment transaction fields: from, to, amount, fee, firstRound, lastRound, genesisHash, note(optional), GenesisID(optional), closeRemainderTo(optional)

    Key registration fields: fee, firstRound, lastRound, voteKey, selectionKey, voteFirst, voteLast, voteKeyDilution, genesisHash, note(optional), GenesisID(optional)

    If flatFee is not set and the final calculated fee is lower than the protocol minimum fee, the fee will be increased to match the minimum.

    Parameters

    • txn: TransactionLike

      object with either payment or key registration fields

    • sk: Uint8Array

      Algorand Secret Key

    Returns { blob: Uint8Array; txID: string }

    object contains the binary signed transaction and its txID

    • blob: Uint8Array
    • txID: string
  • tealSign(sk: Uint8Array, data: Uint8Array | Buffer, contractAddress: string): Uint8Array
  • tealSign creates a signature compatible with ed25519verify opcode from contract address

    Parameters

    • sk: Uint8Array

      uint8array with secret key

    • data: Uint8Array | Buffer

      buffer with data to sign

    • contractAddress: string

      string representation of teal contract address (program hash)

    Returns Uint8Array

  • tealSignFromProgram(sk: Uint8Array, data: Uint8Array | Buffer, program: Uint8Array): Uint8Array
  • tealSignFromProgram creates a signature compatible with ed25519verify opcode from raw program bytes

    Parameters

    • sk: Uint8Array

      uint8array with secret key

    • data: Uint8Array | Buffer

      buffer with data to sign

    • program: Uint8Array

      buffer with teal program

    Returns Uint8Array

  • verifyBytes(bytes: Uint8Array, signature: Uint8Array, addr: string): boolean
  • verifyBytes takes array of bytes, an address, and a signature and verifies if the signature is correct for the public key and the bytes (the bytes should have been signed with "MX" prepended for domain separation).

    Parameters

    • bytes: Uint8Array

      Uint8Array

    • signature: Uint8Array

      binary signature

    • addr: string

      string address

    Returns boolean

    bool

  • waitForConfirmation(client: Algodv2, txid: string, waitRounds: number): Promise<Record<string, any>>
  • Wait until a transaction has been confirmed or rejected by the network, or until 'waitRounds' number of rounds have passed.

    Parameters

    • client: Algodv2

      An Algodv2 client

    • txid: string

      The ID of the transaction to wait for.

    • waitRounds: number

      The maximum number of rounds to wait for.

    Returns Promise<Record<string, any>>

    A promise that, upon success, will resolve to the output of the pendingTransactionInformation call for the confirmed transaction.

Generated using TypeDoc