Module: ItsyBtc

Defined in:
lib/itsy-btc.rb,
lib/itsy-btc/lookup.rb,
lib/itsy-btc/wallet.rb,
lib/itsy-btc/commands.rb,
lib/itsy-btc/wallet_entry.rb,
lib/itsy-btc/commands/command.rb,
lib/itsy-btc/commands/tx_command.rb,
lib/itsy-btc/commands/gen_command.rb,
lib/itsy-btc/commands/help_command.rb,
lib/itsy-btc/commands/init_command.rb,
lib/itsy-btc/commands/list_command.rb,
lib/itsy-btc/commands/push_command.rb,
lib/itsy-btc/commands/sign_command.rb,
lib/itsy-btc/commands/delete_command.rb,
lib/itsy-btc/commands/import_command.rb,
lib/itsy-btc/commands/passwd_command.rb,
lib/itsy-btc/commands/verify_command.rb,
lib/itsy-btc/commands/balance_command.rb,
lib/itsy-btc/commands/comment_command.rb,
lib/itsy-btc/commands/decrypt_command.rb

Defined Under Namespace

Modules: Commands, Lookup Classes: Wallet, WalletEntry

Constant Summary collapse

DEFAULT_WALLET_FILENAME =
"WALLET.itsy"

Class Method Summary collapse

Class Method Details

.blockexplorer_urlObject



20
21
22
23
24
25
26
# File 'lib/itsy-btc.rb', line 20

def blockexplorer_url
  if test_mode?
    "http://blockexplorer.com/testnet"
  else
    "http://blockexplorer.com"
  end
end

.format_value(satoshis) ⇒ Object



16
17
18
# File 'lib/itsy-btc.rb', line 16

def format_value(satoshis)
  (BigDecimal.new(satoshis) / 1e8).to_s("F")
end

.test_mode!Object



32
33
34
35
# File 'lib/itsy-btc.rb', line 32

def test_mode!
  @test_mode = true
  Bitcoin.network = :testnet
end

.test_mode?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/itsy-btc.rb', line 28

def test_mode?
  @test_mode
end