Class: PochetteWeb::HomeController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PochetteWeb::HomeController
- Defined in:
- app/controllers/pochette_web/home_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
10 11 |
# File 'app/controllers/pochette_web/home_controller.rb', line 10 def index end |
#make_multisig ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/controllers/pochette_web/home_controller.rb', line 26 def make_multisig public_keys = params[:xpubs].collect do |x| MoneyTree::Node.from_bip32(x).node_for_path(params[:path]).public_key.key end address, _ = Bitcoin.pubkeys_to_p2sh_multisig_address(params[:signers].to_i, *public_keys) render json: address end |
#trezor_transaction_builder ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/pochette_web/home_controller.rb', line 13 def trezor_transaction_builder t = Pochette::TrezorTransactionBuilder.new( bip32_addresses: params.require(:bip32_addresses), outputs: params.require(:outputs), utxo_blacklist: params[:utxo_blacklist], change_address: params[:change_address].presence, fee_per_kb: params[:fee_per_kb].presence && params[:fee_per_kb].to_i, spend_all: params[:spend_all] ) render json: ( t.valid? ? t.as_hash : t.errors ) end |