Skip to content

Commit 7488893

Browse files
authored
Merge pull request #54 from piotr-iohk/add-list-get-tx-for-shared-wallet
add list/get txs for shared wallets
2 parents d80f74a + 36724d0 commit 7488893

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

lib/cardano_wallet/shared.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,23 @@ def submit(wid, transaction)
113113
body: payload.to_json,
114114
headers: { 'Content-Type' => 'application/json' })
115115
end
116+
117+
# Get tx by id
118+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getSharedTransaction
119+
def get(wid, tx_id, query = {})
120+
query_formatted = query.empty? ? '' : Utils.to_query(query)
121+
self.class.get("/shared-wallets/#{wid}/transactions/#{tx_id}#{query_formatted}")
122+
end
123+
124+
# List all wallet's transactions
125+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listSharedTransactions
126+
#
127+
# @example
128+
# list(wid, {start: "2012-09-25T10:15:00Z", order: "descending"})
129+
def list(wid, query = {})
130+
query_formatted = query.empty? ? '' : Utils.to_query(query)
131+
self.class.get("/shared-wallets/#{wid}/transactions#{query_formatted}")
132+
end
116133
end
117134

118135
# API for Addresses

lib/cardano_wallet/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module CardanoWallet
4-
VERSION = '0.3.28'
4+
VERSION = '0.4.0'
55
end

0 commit comments

Comments
 (0)