Options
All
  • Public
  • Public/Protected
  • All
Menu
class

TransactionService

package

Swapable

subpackage

Services

since

v1.0.0

description

Class that describes a service around Symbol transactions.

Hierarchy

  • TransactionService

Index

Constructors

constructor

  • new TransactionService(accountRepository: AccountRepository, chainRepository: ChainRepository, transactionHttp: TransactionRepository, receiptHttp: ReceiptRepository, pageSize: number): TransactionService
  • Constructor for TransactionService objects

    Parameters

    • accountRepository: AccountRepository
    • chainRepository: ChainRepository
    • transactionHttp: TransactionRepository
    • receiptHttp: ReceiptRepository
    • pageSize: number

    Returns TransactionService

Properties

Private accountRepository

accountRepository: AccountRepository
description

The Symbol account repository.

Private chainRepository

chainRepository: ChainRepository
description

The Symbol chain repository.

Private pageSize

pageSize: number

Private receiptHttp

receiptHttp: ReceiptRepository
description

The Symbol receipt repository.

Private transactionHttp

transactionHttp: TransactionRepository
description

The Symbol transaction repository.

Private transactionService

transactionService: LibTransactionService
description

The low-level transaction service (Symbol SDK).

Methods

filterTransactionsWithEnoughConfirmations

  • filterTransactionsWithEnoughConfirmations(transactions: Transaction[], requiredConfirmations: number): Observable<Transaction[]>
  • function

    Swapable.TransactionService.filterTransactionsWithEnoughConfirmations()

    access

    public

    description

    Given an array of transactions, returns only the ones which have a given minimum number of confirmations.

    Parameters

    • transactions: Transaction[]

      List of transactions.

    • requiredConfirmations: number

      Number of confirmations required.

    Returns Observable<Transaction[]>

    Observable <Transaction[]>

getIncomingTransfers

  • getIncomingTransfers(address: Address, requiredConfirmations: number, lastTransactionId?: undefined | string): Observable<TransferTransaction[]>
  • function

    Swapable.TransactionService.getIncomingTransfers()

    access

    public

    description

    Gets the transactions eligible to be processed as incoming transfers.

    Parameters

    • address: Address

      The address that will be read.

    • requiredConfirmations: number

      Number of blocks before a transaction is considered persistent.

    • Optional lastTransactionId: undefined | string

      (Optional) Resource identifier of the last transaction already processed.

    Returns Observable<TransferTransaction[]>

    Observable <TransferTransaction[]> A list of unprocessed incoming transfers.

getOutgoingTransfers

  • getOutgoingTransfers(address: Address, requiredConfirmations: number, lastTransactionId?: undefined | string): Observable<TransferTransaction[]>
  • function

    Swapable.TransactionService.getOutgoingTransfers()

    access

    public

    description

    Gets the transactions eligible to be processed as outgoing transfers.

    Parameters

    • address: Address

      The address that will be read.

    • requiredConfirmations: number

      Number of blocks before a transaction is considered persistent.

    • Optional lastTransactionId: undefined | string

      (Optional) Resource identifier of the last transaction already processed.

    Returns Observable<TransferTransaction[]>

    Observable <TransferTransaction[]> A list of unprocessed outgoing transfers.

getUnprocessedTransactions

  • getUnprocessedTransactions(address: Address, lastTransactionId?: undefined | string): Observable<Transaction[]>
  • function

    Swapable.TransactionService.getUnprocessedTransactions()

    access

    public

    description

    Gets the list of transactions pending to be processed.

    Parameters

    • address: Address

      The address that will be read.

    • Optional lastTransactionId: undefined | string

      (Optional) Resource identifier of the last transaction already processed.

    Returns Observable<Transaction[]>

    Observable <Transaction[]>

resolveTransactionsAliases

  • resolveTransactionsAliases(transactions: Transaction[]): Observable<Transaction[]>
  • function

    Swapable.TransactionService.filterTransactionsWithEnoughConfirmations()

    access

    public

    description

    Given an array of transactions, resolves the aliases behind an announced transaction.

    Parameters

    • transactions: Transaction[]

      List of transactions to resolve.

    Returns Observable<Transaction[]>

    Observable <Transaction[]>

Static filterElligibleIncomingTransfers

  • filterElligibleIncomingTransfers(transactions: Transaction[], recipientAddr: Address): TransferTransaction[]
  • function

    Swapable.TransactionService.filterElligibleIncomingTransfers()

    static
    access

    public

    description

    Given an array of transactions, returns only the ones that represent incoming transfers in relation to an address.

    A transaction is elligible when following conditions are both met:

    • It has the type TRANSFER.
    • The recipient address is the correct address.
    • The message field is not empty.

    Parameters

    • transactions: Transaction[]

      List of transactions that could be eligible incoming transfers.

    • recipientAddr: Address

      The address considered the "recipient".

    Returns TransferTransaction[]

Static filterElligibleOutgoingTransfers

  • filterElligibleOutgoingTransfers(transactions: Transaction[], senderAddress: Address): TransferTransaction[]
  • function

    Swapable.TransactionService.filterElligibleOutgoingTransfers()

    static
    access

    public

    description

    Given an array of transactions, returns only the ones that represent outgoing transfers in relation to an address.

    A transaction is elligible when following conditions are both met:

    • It has the type TRANSFER.
    • The signer address is the correct address.
    • The message field is not empty.

    Parameters

    • transactions: Transaction[]

      List of transactions that could be eligible outgoing transfers.

    • senderAddress: Address

      The address considered the "sender".

    Returns TransferTransaction[]

Static filterTransferTransactions

  • filterTransferTransactions(transactions: Transaction[]): TransferTransaction[]
  • function

    Swapable.TransactionService.filterTransferTransactions()

    static
    access

    public

    description

    Given an array of transactions, returns only the ones with type TRANSFER.

    Parameters

    • transactions: Transaction[]

      List of transactions.

    Returns TransferTransaction[]

Static flattenAggregateTransactions

  • flattenAggregateTransactions(transactions: Transaction[]): Transaction[]
  • function

    Swapable.TransactionService.flattenAggregateTransactions()

    static
    access

    public

    description

    Processes the list of transactions. In case there is an aggregate transaction, it removes the wrapper to return each inner transaction separately.

    Parameters

    • transactions: Transaction[]

      List of transactions.

    Returns Transaction[]

Static getTransactionHash

  • getTransactionHash(transaction: Transaction): string | undefined
  • function

    Swapable.TransactionService.getTransactionHash()

    static
    access

    public

    description

    Gets a transaction's hash. If it is an aggregate transaction, returns the aggregate transaction hash (merkle root hash).

    Parameters

    • transaction: Transaction

      Transaction.

    Returns string | undefined

    string | undefined

Generated using TypeDoc