Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Helpers Abstract

Hierarchy

Index

Constructors

Methods

  • buildAddTransaction(secretHash: string, amount: number): PartialTransactionBody
  • Get the tx data for Atomex Contract AdditionalFunds call

    Parameters

    • secretHash: string

      secretHash to identify swap

    • amount: number

    Returns PartialTransactionBody

    contract address and tx data that can be used to make a contract call

  • buildInitiateTransaction(initiateParameters: InitiateParameters): PartialTransactionBody
  • Get the tx data for Atomex Contract Initiate Swap call

    Parameters

    • initiateParameters: InitiateParameters

    Returns PartialTransactionBody

    contract address and tx data that can be used to make a contract call

  • buildRedeemTransaction(secret: string, hashedSecret: string): PartialTransactionBody
  • Get the tx data for Atomex Contract Redeem Swap call

    Parameters

    • secret: string

      secret that can used to verify and redeem the funds

    • hashedSecret: string

    Returns PartialTransactionBody

    contract address and tx data that can be used to make a contract call

  • buildRefundTransaction(secretHash: string): PartialTransactionBody
  • Get the tx data for Atomex Contract Refund Swap call

    Parameters

    • secretHash: string

      secretHash to identify swap

    Returns PartialTransactionBody

    contract address and tx data that can be used to make a contract call

  • encodePublicKey(publicKey: string): string
  • Encodes Public Key in a form compliant with Atomex

    Parameters

    • publicKey: string

      public key

    Returns string

    encoded public key

  • encodeSignature(signature: string): string
  • Encodes Signature in a form compliant with Atomex

    Parameters

    • signature: string

      signature to encode

    Returns string

    encoded signature

  • estimateInitiateFees(source: string): Promise<number>
  • Estimates Initiate fees for a Swap

    Parameters

    • source: string

      the initiator address

    Returns Promise<number>

    the initiate fees for Swap

  • estimateRedeemFees(recipient: string): Promise<RedeemFees>
  • Estimates Miner Fee and Reward for Redeem to be used in a Swap

    Parameters

    • recipient: string

      the counter-party address

    Returns Promise<RedeemFees>

    the minerFee and the rewardForRedeem

  • getAuthMessage(message: string, address?: string): AuthMessage
  • Get the details needed for getAuthToken request

    remarks

    the msgToSign value needs to be signed before being used for Auth

    Parameters

    • message: string

      message to include for the Atomex Authentication message

    • Optional address: string

      required for Tezos blockchain, in order to determine the EC algorithm

    Returns AuthMessage

    details required for Atomex Auth

  • isValidAddress(address: string): boolean
  • Check validity of an account address

    Parameters

    • address: string

      account address

    Returns boolean

    true if valid, else false

  • validateInitiateTransaction(blockHeight: number, txID: string, secretHash: string, receivingAddress: string, amount: number, payoff: number, minRefundTimestamp: number, minConfirmations: number): Promise<SwapTransactionStatus>
  • Validate the Swap Details on chain using the tx detail from Atomex [does not check tx status, use status provided by atomex]

    Parameters

    • blockHeight: number

      block height of the block where the tx is present

    • txID: string

      operation/tx hash to identify blockchain transaction

    • secretHash: string
    • receivingAddress: string
    • amount: number
    • payoff: number
    • minRefundTimestamp: number
    • minConfirmations: number

    Returns Promise<SwapTransactionStatus>

    status of tx, current no. of confirms and est. next block generation timestamp. No. of confirmations and block timestamp is only returned when status:Included

Generated using TypeDoc