Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
{test, [
{deps, [
%% Libraries generated with swagger-codegen-erlang from valitydev/swag-wallets
{swag_server_wallet, {git, "https://github.com/valitydev/swag-wallets", {ref, "96add0f"}}},
{swag_client_wallet, {git, "https://github.com/valitydev/swag-wallets", {ref, "5fd60dd"}}},
{swag_server_wallet, {git, "https://github.com/valitydev/swag-wallets", {ref, "6ded7f2"}}},
{swag_client_wallet, {git, "https://github.com/valitydev/swag-wallets", {ref, "1686026"}}},
{meck, "0.9.2"}
]},
{cover_enabled, true},
Expand Down
19 changes: 19 additions & 0 deletions src/wapi_wallet_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,25 @@ prepare('GetWalletAccount' = OperationID, #{'walletID' := WalletID}, Context, _O
end
end,
{ok, #{authorize => Authorize, process => Process}};
prepare('GetWalletCashLimits' = OperationID, #{'partyID' := PartyID, 'walletID' := WalletID}, Context, _Opts) ->
AuthContext = build_auth_context([{wallet, WalletID}], [], Context),
Authorize = fun() ->
Prototypes = [
{operation, build_prototype_for(operation, #{id => OperationID}, AuthContext)},
{wallet, build_prototype_for(wallet, [], AuthContext)}
],
Resolution = wapi_auth:authorize_operation(Prototypes, Context),
{ok, Resolution}
end,
Process = fun() ->
case wapi_wallet_limits:get_wallet_limits(PartyID, WalletID, Context) of
{ok, Limits} ->
wapi_handler_utils:reply_ok(200, Limits);
{error, {wallet, notfound}} ->
wapi_handler_utils:reply_ok(404)
end
end,
{ok, #{authorize => Authorize, process => Process}};
%% Destinations
prepare('ListDestinations' = OperationID, Req0, Context, _Opts) ->
AuthContext = build_auth_context(
Expand Down
Loading
Loading