cardano_wallet 0.3.14 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +3 -3
- data/Rakefile +2 -3
- data/cardano_wallet.gemspec +1 -0
- data/lib/cardano_wallet/byron.rb +12 -1
- data/lib/cardano_wallet/shelley.rb +37 -3
- data/lib/cardano_wallet/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c7ce08240e2c7224eba31a8a6aa0b7f928630a858be44aaad315a55c959c93b
|
4
|
+
data.tar.gz: 50d698826b6104abba2f5f9aaaa938df83c647497880c181a87737e634431863
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87ae856018a68b179f880aebb094adb6de48cdd20e612fab3dd683d1ab5bfb557aeac4582f5151d6febcf3829dd86cc52766abab310485f27923c919f6f1bbf5
|
7
|
+
data.tar.gz: 990e4bfb52027df1a8a92d63b4521a4ae3cdebda992825271c4a014e4a1e53cdd0fa379e38fe3f11b1e6e85f7e4ddcbe41f983d5512f1f730dfe2154c9fe0fd8
|
data/.github/workflows/tests.yml
CHANGED
@@ -33,7 +33,7 @@ jobs:
|
|
33
33
|
echo "Node: $NODE"
|
34
34
|
NODE_CONFIG_PATH=`pwd`/configs docker-compose up --detach
|
35
35
|
docker run --rm inputoutput/cardano-wallet:$WALLET version
|
36
|
-
docker run --rm inputoutput/cardano-node:$NODE version
|
36
|
+
docker run --rm inputoutput/cardano-node:$NODE cli version
|
37
37
|
ls ~/node-db-nightly-docker
|
38
38
|
|
39
39
|
- name: Run all tests except nighlty
|
@@ -45,5 +45,5 @@ jobs:
|
|
45
45
|
CI: true
|
46
46
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
47
47
|
NETWORK: testnet
|
48
|
-
WALLET: dev-master
|
49
|
-
NODE: 1.
|
48
|
+
WALLET: dev-master
|
49
|
+
NODE: alonzo-purple-1.0.1
|
data/Rakefile
CHANGED
@@ -12,9 +12,7 @@ task default: :spec
|
|
12
12
|
def wget(url, file = nil)
|
13
13
|
file ||= File.basename(url)
|
14
14
|
resp = HTTParty.get(url)
|
15
|
-
File.
|
16
|
-
f.write(resp.body)
|
17
|
-
end
|
15
|
+
File.binwrite(file, resp.body)
|
18
16
|
puts "#{url} -> #{resp.code}"
|
19
17
|
end
|
20
18
|
|
@@ -31,6 +29,7 @@ task :get_latest_configs, [:env] do |_, args|
|
|
31
29
|
mk_dir(path)
|
32
30
|
wget("#{base_url}/#{env}-config.json", "#{path}/#{env}-config.json")
|
33
31
|
wget("#{base_url}/#{env}-byron-genesis.json", "#{path}/#{env}-byron-genesis.json")
|
32
|
+
wget("#{base_url}/#{env}-alonzo-genesis.json", "#{path}/#{env}-alonzo-genesis.json")
|
34
33
|
wget("#{base_url}/#{env}-shelley-genesis.json", "#{path}/#{env}-shelley-genesis.json")
|
35
34
|
wget("#{base_url}/#{env}-topology.json", "#{path}/#{env}-topology.json")
|
36
35
|
end
|
data/cardano_wallet.gemspec
CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.metadata['homepage_uri'] = spec.homepage
|
20
20
|
spec.metadata['source_code_uri'] = spec.homepage
|
21
21
|
spec.metadata['changelog_uri'] = spec.homepage
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
22
23
|
|
23
24
|
# Specify which files should be added to the gem when it is released.
|
24
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
data/lib/cardano_wallet/byron.rb
CHANGED
@@ -233,7 +233,7 @@ module CardanoWallet
|
|
233
233
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signByronTransaction
|
234
234
|
# @param wid [String] source wallet id
|
235
235
|
# @param passphrase [String] wallet's passphrase
|
236
|
-
# @param
|
236
|
+
# @param transaction [String] CBOR transaction data
|
237
237
|
def sign(wid, passphrase, transaction)
|
238
238
|
payload = {
|
239
239
|
'passphrase' => passphrase,
|
@@ -245,6 +245,17 @@ module CardanoWallet
|
|
245
245
|
headers: { 'Content-Type' => 'application/json' })
|
246
246
|
end
|
247
247
|
|
248
|
+
# Submit transaction
|
249
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/submitByronTransaction
|
250
|
+
# @param wid [String] source wallet id
|
251
|
+
# @param transaction [String] CBOR transaction data
|
252
|
+
def submit(wid, transaction)
|
253
|
+
payload = { 'transaction' => transaction }
|
254
|
+
self.class.post("/byron-wallets/#{wid}/transactions-submit",
|
255
|
+
body: payload.to_json,
|
256
|
+
headers: { 'Content-Type' => 'application/json' })
|
257
|
+
end
|
258
|
+
|
248
259
|
# Get tx by id
|
249
260
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getByronTransaction
|
250
261
|
def get(wid, tx_id)
|
@@ -103,8 +103,9 @@ module CardanoWallet
|
|
103
103
|
end
|
104
104
|
|
105
105
|
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getWalletKey
|
106
|
-
def get_public_key(wid, role, index)
|
107
|
-
|
106
|
+
def get_public_key(wid, role, index, query = {})
|
107
|
+
query_formatted = query.empty? ? '' : Utils.to_query(query)
|
108
|
+
self.class.get("/wallets/#{wid}/keys/#{role}/#{index}#{query_formatted}")
|
108
109
|
end
|
109
110
|
|
110
111
|
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postAccountKey
|
@@ -258,6 +259,28 @@ module CardanoWallet
|
|
258
259
|
# API for Transactions
|
259
260
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Transactions
|
260
261
|
class Transactions < Base
|
262
|
+
# Balance transaction
|
263
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/balanceTransaction
|
264
|
+
# @param wid [String] source wallet id
|
265
|
+
# @param payload [Hash] payload object
|
266
|
+
def balance(wid, payload)
|
267
|
+
self.class.post("/wallets/#{wid}/transactions-balance",
|
268
|
+
body: payload.to_json,
|
269
|
+
headers: { 'Content-Type' => 'application/json' })
|
270
|
+
end
|
271
|
+
|
272
|
+
# Decode transaction
|
273
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/decodeTransaction
|
274
|
+
# @param wid [String] source wallet id
|
275
|
+
# @param transaction [String] CBOR base64|base16 encoded transaction
|
276
|
+
def decode(wid, transaction)
|
277
|
+
payload = {}
|
278
|
+
payload[:transaction] = transaction
|
279
|
+
self.class.post("/wallets/#{wid}/transactions-decode",
|
280
|
+
body: payload.to_json,
|
281
|
+
headers: { 'Content-Type' => 'application/json' })
|
282
|
+
end
|
283
|
+
|
261
284
|
# Construct transaction
|
262
285
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructTransaction
|
263
286
|
# @param wid [String] source wallet id
|
@@ -291,7 +314,7 @@ module CardanoWallet
|
|
291
314
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signTransaction
|
292
315
|
# @param wid [String] source wallet id
|
293
316
|
# @param passphrase [String] wallet's passphrase
|
294
|
-
# @param
|
317
|
+
# @param transaction [String] CBOR transaction data
|
295
318
|
def sign(wid, passphrase, transaction)
|
296
319
|
payload = {
|
297
320
|
'passphrase' => passphrase,
|
@@ -303,6 +326,17 @@ module CardanoWallet
|
|
303
326
|
headers: { 'Content-Type' => 'application/json' })
|
304
327
|
end
|
305
328
|
|
329
|
+
# Submit transaction
|
330
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/submitTransaction
|
331
|
+
# @param wid [String] source wallet id
|
332
|
+
# @param transaction [String] CBOR transaction data
|
333
|
+
def submit(wid, transaction)
|
334
|
+
payload = { 'transaction' => transaction }
|
335
|
+
self.class.post("/wallets/#{wid}/transactions-submit",
|
336
|
+
body: payload.to_json,
|
337
|
+
headers: { 'Content-Type' => 'application/json' })
|
338
|
+
end
|
339
|
+
|
306
340
|
# Get tx by id
|
307
341
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getTransaction
|
308
342
|
def get(wid, tx_id)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardano_wallet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Stachyra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -149,6 +149,7 @@ metadata:
|
|
149
149
|
homepage_uri: https://github.com/piotr-iohk/cardano-wallet-rb
|
150
150
|
source_code_uri: https://github.com/piotr-iohk/cardano-wallet-rb
|
151
151
|
changelog_uri: https://github.com/piotr-iohk/cardano-wallet-rb
|
152
|
+
rubygems_mfa_required: 'true'
|
152
153
|
post_install_message:
|
153
154
|
rdoc_options: []
|
154
155
|
require_paths:
|
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
165
|
- !ruby/object:Gem::Version
|
165
166
|
version: '0'
|
166
167
|
requirements: []
|
167
|
-
rubygems_version: 3.2.
|
168
|
+
rubygems_version: 3.2.32
|
168
169
|
signing_key:
|
169
170
|
specification_version: 4
|
170
171
|
summary: Ruby wrapper over cardano-wallet.
|