Method: Coinbase::Address#faucet

Defined in:
lib/coinbase/address.rb

#faucet(asset_id: nil) ⇒ Coinbase::FaucetTransaction

Requests funds for the address from the faucet and returns the faucet transaction. This is only supported on testnet networks.

Parameters:

  • asset_id (Symbol) (defaults to: nil)

    The ID of the Asset to transfer to the wallet.

Returns:

Raises:



112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/coinbase/address.rb', line 112

def faucet(asset_id: nil)
  Coinbase.call_api do
    Coinbase::FaucetTransaction.new(
      addresses_api.request_external_faucet_funds(
        network.normalized_id,
        id,
        {
          asset_id: asset_id,
          skip_wait: true
        }.compact
      )
    )
  end
end