Class: Coinbase::FaucetTransaction

Inherits:
Object
  • Object
show all
Defined in:
lib/coinbase/faucet_transaction.rb

Overview

A representation of a transaction from a faucet. a user-controlled Wallet to another address. The fee is assumed to be paid in the native Asset of the Network. Transfers should be created through Wallet#transfer or Address#transfer.

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ FaucetTransaction

Returns a new FaucetTransaction object. Do not use this method directly - instead, use Address#faucet.

Parameters:



11
12
13
# File 'lib/coinbase/faucet_transaction.rb', line 11

def initialize(model)
  @model = model
end

Instance Method Details

#inspectString

Same as to_s.

Returns:

  • (String)

    a String representation of the FaucetTransaction



35
36
37
# File 'lib/coinbase/faucet_transaction.rb', line 35

def inspect
  to_s
end

#to_sString

Returns a String representation of the FaucetTransaction.

Returns:

  • (String)

    a String representation of the FaucetTransaction



29
30
31
# File 'lib/coinbase/faucet_transaction.rb', line 29

def to_s
  "Coinbase::FaucetTransaction{transaction_hash: '#{transaction_hash}', transaction_link: '#{transaction_link}'}"
end

#transaction_hashString

Returns the transaction hash.

Returns:

  • (String)

    The onchain transaction hash



17
18
19
# File 'lib/coinbase/faucet_transaction.rb', line 17

def transaction_hash
  model.transaction_hash
end

Returns the link to the transaction on the blockchain explorer.

Returns:

  • (String)

    The link to the transaction on the blockchain explorer



23
24
25
# File 'lib/coinbase/faucet_transaction.rb', line 23

def transaction_link
  model.transaction_link
end