Skip to content

Commit

Permalink
Merge pull request #95 from piotr-iohk/support-for-utxo-endpoints-sha…
Browse files Browse the repository at this point in the history
…red-wallets

Support for  utxo endpoints for shared wallets
  • Loading branch information
piotr-iohk committed Feb 8, 2023
2 parents 7bc85d4 + 4c964bc commit 37cdc04
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'cardano_wallet', '~> 0.4.0'
gem 'cardano_wallet', '~> 0.4.1'
# gem 'cardano_wallet', path: "~/wb/cardano_wallet"
gem 'sys-proctable', '~> 1.2.3'
gem 'docopt', '~> 0.6.1'
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Expand Up @@ -12,7 +12,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
cardano_wallet (0.4.0)
cardano_wallet (0.4.1)
bip_mnemonic (~> 0.0.4)
httparty (~> 0.18.0)
chartkick (3.4.0)
Expand Down Expand Up @@ -75,7 +75,7 @@ PLATFORMS

DEPENDENCIES
capybara
cardano_wallet (~> 0.4.0)
cardano_wallet (~> 0.4.1)
chartkick (~> 3.4.0)
docopt (~> 0.6.1)
json2table (~> 1.0.7)
Expand Down
13 changes: 13 additions & 0 deletions app.rb
Expand Up @@ -368,6 +368,19 @@
end

# SHARED WALLETS

get "/shared-wallets-utxo" do
utxo = @cw.shared.wallets.utxo params[:wid]
utxo_snapshot = @cw.shared.wallets.utxo_snapshot params[:wid]
wal = @cw.shared.wallets.get params[:wid]
wallets = @cw.shared.wallets.list

erb :utxo_details, { :locals => { :wal => wal,
:utxo => utxo,
:utxo_snapshot => utxo_snapshot,
:wallets => wallets } }
end

get "/shared-get-acc-pub-key" do
wallets = @cw.shared.wallets.list
handle_api_err wallets, session
Expand Down
2 changes: 2 additions & 0 deletions views/shared_wallet.erb
Expand Up @@ -66,6 +66,8 @@
</div>
</div>

<a class="nav-link" href="/shared-wallets-utxo?wid=<%= wal['id'] %>">UTxO</a>

</nav>


Expand Down
3 changes: 2 additions & 1 deletion views/utxo_details.erb
Expand Up @@ -4,6 +4,7 @@

byron_ep = "/byron-wallets"
shelley_ep = "/wallets"
shared_ep = "/shared-wallets"
%>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chartkick/2.3.0/chartkick.min.js" type="text/javascript"></script>
Expand All @@ -14,7 +15,7 @@
| <small><a href="<%= back_to_wallet(url_path, wid) %>">go back to wallet</a></small>
</div>
<div class="list-group-item">
<form action="<%= (url_path.include? "byron") ? byron_ep : shelley_ep %>-utxo" method="GET">
<form action="<%= pick_post_ep(url_path, byron_ep, shelley_ep, shared_ep) %>-utxo" method="GET">
<div class="form-row">
<div class="col">
<select class="form-control" name="wid" id="wid">
Expand Down

0 comments on commit 37cdc04

Please sign in to comment.