diff --git a/Gemfile b/Gemfile index 0e35ff8..e4f3163 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' -gem 'cardano_wallet', '~> 0.3.14' +gem 'cardano_wallet', '~> 0.3.15' # gem 'cardano_wallet', path: "~/wb/cardano_wallet" gem 'sys-proctable', '~> 1.2.3' gem 'docopt', '~> 0.6.1' diff --git a/Gemfile.lock b/Gemfile.lock index 22964d0..54ffe33 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,7 +12,7 @@ GEM rack-test (>= 0.6.3) regexp_parser (~> 1.5) xpath (~> 3.2) - cardano_wallet (0.3.14) + cardano_wallet (0.3.15) httparty (~> 0.18.0) chartkick (3.4.0) codecov (0.2.9) @@ -29,7 +29,7 @@ GEM json2table (1.0.7) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2021.0704) + mime-types-data (3.2021.0901) mini_mime (1.0.2) mini_portile2 (2.6.1) multi_xml (0.6.0) @@ -81,7 +81,7 @@ PLATFORMS DEPENDENCIES bip_mnemonic (~> 0.0.4) capybara - cardano_wallet (~> 0.3.14) + cardano_wallet (~> 0.3.15) chartkick (~> 3.4.0) codecov (~> 0.2.8) docopt (~> 0.6.1) diff --git a/app.rb b/app.rb index 93dd313..af2664a 100644 --- a/app.rb +++ b/app.rb @@ -859,6 +859,28 @@ # TRANSACTIONS SHELLEY +get "/balance-tx-shelley" do + wallets = @cw.shelley.wallets.list + handle_api_err wallets, session + + erb :form_tx_new_balance, {:locals => { :wallets => wallets } } +end + +post "/sign-balanced-tx-shelley" do + wid = params[:wid] + begin + payload = JSON.parse(params[:payload].strip) + rescue + session[:error] = "Make sure the 'payload' has correct JSON format." + redirect '/balance-tx-shelley' + end + r = @cw.shelley.transactions.balance(wid, + payload) + handle_api_err r, session + + erb :form_tx_new_sign, {:locals => { :tx => r, :wid => wid } } +end + get "/construct-tx-shelley" do wallets = @cw.shelley.wallets.list handle_api_err wallets, session @@ -868,7 +890,7 @@ post "/sign-tx-shelley" do wid = params[:wid] - + if params[:payments_check] case params[:payments_mode] when 'single_output', 'multi_output' diff --git a/helpers/app_helpers.rb b/helpers/app_helpers.rb index dc47127..1cd4f11 100644 --- a/helpers/app_helpers.rb +++ b/helpers/app_helpers.rb @@ -3,7 +3,7 @@ module Helpers module App def version - 'v2021-08-27' + 'v2021-09-29' end def is_connected?(w) diff --git a/views/form_tx_new_balance.erb b/views/form_tx_new_balance.erb new file mode 100644 index 0000000..06b2f45 --- /dev/null +++ b/views/form_tx_new_balance.erb @@ -0,0 +1,79 @@ +<% + # wallets = wallets + url_path = request.env['PATH_INFO'].to_s + shelley_ep = "/sign-balanced-tx-shelley" + byron_ep = "/sign-balanced-tx-byron" + wid = params[:wid] if params[:wid] +%> + +