cardano_wallet 0.3.21 → 0.3.24
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 +7 -7
- data/docker-compose.yml +2 -2
- data/lib/cardano_wallet/base.rb +1 -1
- data/lib/cardano_wallet/misc.rb +13 -0
- data/lib/cardano_wallet/shared.rb +50 -0
- data/lib/cardano_wallet/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35cd30306a63c77b58078620e3f2ba87d946d02aab3296f7fc45065fbcf39895
|
4
|
+
data.tar.gz: ac4cb6ce2d4cf45c2ab37d2d202448ef9db48c0329feca3f60f301bfd95dc5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 770fc6e86c6cf4677bd33bcfe2230515bbfd09e62829fce990219e92ff56a5d8f26160d706c60f333c6b8771b37ab0b204f1a477d4180097dba71198fa06e547
|
7
|
+
data.tar.gz: 4bce9526e3daa72f811a6bbc3d16311076c59ce600ff275fdc0b25a3c4484d21e2afe1242910ae9594033d407825bf5f7424b22e7cd7385892bc0abebe9577e3
|
data/.github/workflows/tests.yml
CHANGED
@@ -25,7 +25,7 @@ jobs:
|
|
25
25
|
run: rubocop
|
26
26
|
|
27
27
|
- name: Get recent configs
|
28
|
-
run: bundle exec rake get_latest_configs[
|
28
|
+
run: bundle exec rake get_latest_configs[$NETWORK]
|
29
29
|
|
30
30
|
- name: Set up cardano-wallet and cardano-node
|
31
31
|
run: |
|
@@ -44,6 +44,6 @@ jobs:
|
|
44
44
|
env:
|
45
45
|
CI: true
|
46
46
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
47
|
-
NETWORK:
|
47
|
+
NETWORK: preview
|
48
48
|
WALLET: dev-master
|
49
|
-
NODE:
|
49
|
+
NODE: 1.35.3
|
data/Rakefile
CHANGED
@@ -17,19 +17,19 @@ def wget(url, file = nil)
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def mk_dir(path)
|
20
|
-
|
20
|
+
FileUtils.mkdir_p(path)
|
21
21
|
end
|
22
22
|
|
23
23
|
task :get_latest_configs, [:env] do |_, args|
|
24
24
|
puts "\n >> Get latest configs for '#{args[:env]}'"
|
25
25
|
|
26
|
-
base_url = 'https://
|
26
|
+
base_url = 'https://book.world.dev.cardano.org/environments'
|
27
27
|
env = args[:env]
|
28
28
|
path = File.join(Dir.pwd, 'configs')
|
29
29
|
mk_dir(path)
|
30
|
-
wget("#{base_url}/#{env}
|
31
|
-
wget("#{base_url}/#{env}
|
32
|
-
wget("#{base_url}/#{env}
|
33
|
-
wget("#{base_url}/#{env}
|
34
|
-
wget("#{base_url}/#{env}
|
30
|
+
wget("#{base_url}/#{env}/config.json", "#{path}/config.json")
|
31
|
+
wget("#{base_url}/#{env}/byron-genesis.json", "#{path}/byron-genesis.json")
|
32
|
+
wget("#{base_url}/#{env}/alonzo-genesis.json", "#{path}/alonzo-genesis.json")
|
33
|
+
wget("#{base_url}/#{env}/shelley-genesis.json", "#{path}/shelley-genesis.json")
|
34
|
+
wget("#{base_url}/#{env}/topology.json", "#{path}/topology.json")
|
35
35
|
end
|
data/docker-compose.yml
CHANGED
@@ -7,7 +7,7 @@ services:
|
|
7
7
|
- ~/node-db-nightly-docker:/data
|
8
8
|
- node-ipc:/ipc
|
9
9
|
- ${NODE_CONFIG_PATH}:/config
|
10
|
-
command: run --socket-path /ipc/node.socket --config /config
|
10
|
+
command: run --socket-path /ipc/node.socket --config /config/config.json --topology /config/topology.json --database-path /data
|
11
11
|
restart: on-failure
|
12
12
|
|
13
13
|
cardano-wallet:
|
@@ -18,7 +18,7 @@ services:
|
|
18
18
|
- ${NODE_CONFIG_PATH}:/config
|
19
19
|
ports:
|
20
20
|
- 8090:8090
|
21
|
-
command: serve --testnet /config
|
21
|
+
command: serve --testnet /config/byron-genesis.json --node-socket /ipc/node.socket --database /wallet-db --listen-address 0.0.0.0
|
22
22
|
restart: on-failure
|
23
23
|
|
24
24
|
volumes:
|
data/lib/cardano_wallet/base.rb
CHANGED
@@ -23,7 +23,7 @@ module CardanoWallet
|
|
23
23
|
|
24
24
|
unless opt[:cacert].empty?
|
25
25
|
ENV['SSL_CERT_FILE'] = opt[:cacert]
|
26
|
-
self.class.ssl_ca_file(File.read(ENV
|
26
|
+
self.class.ssl_ca_file(File.read(ENV.fetch('SSL_CERT_FILE', nil)))
|
27
27
|
end
|
28
28
|
self.class.pem(File.read(opt[:pem])) unless opt[:pem].empty?
|
29
29
|
|
data/lib/cardano_wallet/misc.rb
CHANGED
@@ -31,6 +31,19 @@ module CardanoWallet
|
|
31
31
|
def settings
|
32
32
|
Settings.new @opt
|
33
33
|
end
|
34
|
+
|
35
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Node
|
36
|
+
def node
|
37
|
+
Node.new @opt
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Node
|
42
|
+
class Node < Base
|
43
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Node/paths/~1blocks~1latest~1header/get
|
44
|
+
def block_header
|
45
|
+
self.class.get('/blocks/latest/header')
|
46
|
+
end
|
34
47
|
end
|
35
48
|
|
36
49
|
# API for Network
|
@@ -26,6 +26,56 @@ module CardanoWallet
|
|
26
26
|
def addresses
|
27
27
|
Addresses.new @opt
|
28
28
|
end
|
29
|
+
|
30
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Transactions
|
31
|
+
def transactions
|
32
|
+
Transactions.new @opt
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# API for Transactions
|
37
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Transactions
|
38
|
+
class Transactions < Base
|
39
|
+
# Construct transaction
|
40
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructSharedTransaction
|
41
|
+
# @param wid [String] source wallet id
|
42
|
+
# @param payments [Array of Hashes] full payments payload with assets
|
43
|
+
# @param withdrawal [String or Array] 'self' or mnemonic sentence
|
44
|
+
# @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
|
45
|
+
# @param mint [Array of Hashes] mint object
|
46
|
+
# @param delegations [Array of Hashes] delegations object
|
47
|
+
# @param validity_interval [Hash] validity_interval object
|
48
|
+
def construct(wid,
|
49
|
+
payments = nil,
|
50
|
+
withdrawal = nil,
|
51
|
+
metadata = nil,
|
52
|
+
delegations = nil,
|
53
|
+
mint = nil,
|
54
|
+
validity_interval = nil)
|
55
|
+
payload = {}
|
56
|
+
payload[:payments] = payments if payments
|
57
|
+
payload[:withdrawal] = withdrawal if withdrawal
|
58
|
+
payload[:metadata] = metadata if metadata
|
59
|
+
payload[:mint_burn] = mint if mint
|
60
|
+
payload[:delegations] = delegations if delegations
|
61
|
+
payload[:validity_interval] = validity_interval if validity_interval
|
62
|
+
|
63
|
+
self.class.post("/shared-wallets/#{wid}/transactions-construct",
|
64
|
+
body: payload.to_json,
|
65
|
+
headers: { 'Content-Type' => 'application/json' })
|
66
|
+
end
|
67
|
+
|
68
|
+
# Decode transaction
|
69
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/decodeSharedTransaction
|
70
|
+
# @param wid [String] source wallet id
|
71
|
+
# @param transaction [String] CBOR base64|base16 encoded transaction
|
72
|
+
def decode(wid, transaction)
|
73
|
+
payload = {}
|
74
|
+
payload[:transaction] = transaction
|
75
|
+
self.class.post("/shared-wallets/#{wid}/transactions-decode",
|
76
|
+
body: payload.to_json,
|
77
|
+
headers: { 'Content-Type' => 'application/json' })
|
78
|
+
end
|
29
79
|
end
|
30
80
|
|
31
81
|
# API for Addresses
|
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.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Stachyra
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|