• Recreates a Transaction from a base64 encoded string.

    Decodes the string to a buffer, then passes to Transaction.fromBytes. For greater flexibility, this function uses the base Transaction class, but takes an optional type parameter if the type of transaction is known, allowing stronger typeing.

    Type Parameters

    • T extends default

    Parameters

    • transactionBytes: string

      a base64 encoded string

    Returns T

    Transaction

    Example

    const txn1 = base64StringToTransaction(bytesString)
    const txn2 = base64StringToTransaction<TransferTransaction>(bytesString)
    // txn1 type: Transaction
    // txn2 type: TransferTransaction

Generated using TypeDoc