Class: Chain::TransactionFeed::ClientModule

Inherits:
ClientModule show all
Defined in:
lib/chain/transaction_feed.rb

Instance Attribute Summary

Attributes inherited from ClientModule

#client

Instance Method Summary collapse

Methods inherited from ClientModule

#initialize

Constructor Details

This class inherits a constructor from Chain::ClientModule

Instance Method Details

#create(opts) ⇒ TransactionFeed

Returns Newly created transaction feed.

Parameters:

  • opts (Hash)

    Parameters for creating a Transaction Feed.

Options Hash (opts):

  • alias (String)

    A unique alias for the transaction feed.

  • filter (String)

    A valid filter string for the ‘/list-transactions` endpoint. The transaction feed will be composed of future transactions that match the filter.

Returns:



89
90
91
92
# File 'lib/chain/transaction_feed.rb', line 89

def create(opts)
  opts = {client_token: SecureRandom.uuid()}.merge(opts)
  TransactionFeed.new(client.conn.request('create-transaction-feed', opts), client.conn)
end

#delete(opts) ⇒ void

This method returns an undefined value.

Parameters:

  • opts (Hash)

Options Hash (opts):

  • :id (String)

    ID of the transaction feed. You must provide either :id or :alias.

  • :alias (String)

    ID of the transaction feed. You must provide either :id or :alias.



107
108
109
110
# File 'lib/chain/transaction_feed.rb', line 107

def delete(opts)
  client.conn.request('delete-transaction-feed', opts)
  nil
end

#get(opts) ⇒ TransactionFeed

Get single transaction feed given an id/alias.

Parameters:

  • opts (Hash)

    Parameters to get single Transaction Feed.

Options Hash (opts):

  • id (String)

    The unique ID of a transaction feed. Either ‘id` or `alias` is required.

  • alias (String)

    The unique alias of a transaction feed. Either ‘id` or `alias` is required.

Returns:



99
100
101
# File 'lib/chain/transaction_feed.rb', line 99

def get(opts)
  TransactionFeed.new(client.conn.request('get-transaction-feed', opts), client.conn)
end

#queryQuery

List all transaction feeds

Returns:



114
115
116
# File 'lib/chain/transaction_feed.rb', line 114

def query
  Query.new(client)
end