Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Helpers

Hierarchy

Index

Methods

Abstract buildAddTransaction

  • 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

Abstract buildInitiateTransaction

Abstract buildRedeemTransaction

  • 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

Abstract buildRefundTransaction

  • 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

Abstract encodePublicKey

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

    Parameters

    • publicKey: string

      public key

    Returns string

    encoded public key

Abstract encodeSignature

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

    Parameters

    • signature: string

      signature to encode

    Returns string

    encoded signature

Abstract estimateInitiateFees

  • 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

Abstract estimateRedeemFees

  • 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

Abstract getAuthMessage

  • getAuthMessage(message: string, address?: undefined | 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: undefined | string

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

    Returns AuthMessage

    details required for Atomex Auth

Abstract isValidAddress

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

    Parameters

    • address: string

      account address

    Returns boolean

    true if valid, else false

Abstract validateInitiateTransaction

  • validateInitiateTransaction(blockHeight: number, txID: string, secretHash: string, receivingAddress: string, netAmount: 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
    • netAmount: 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