cardano_wallet 0.3.19 → 0.3.22

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f3553eac627012a6c1503cc9a95fe76c17685c4437f0cf2f2ca899c8f16e760
4
- data.tar.gz: adf34dad29c5b8443afd31d88e7b7f1574958826730b1d0beaefa8609f9964da
3
+ metadata.gz: 967e02a8810ca20a7a01deed8b44af1a43a8de7a1a0953956913fd8dfd2e31b5
4
+ data.tar.gz: b45d0e0752acaf5e646cd1d4ef682e7a9ddec640a3d3bf57ba3eb2a9c618ad7a
5
5
  SHA512:
6
- metadata.gz: 46594f10f0e1507601213fa770c92ee3bf7595e0ddc509d6d4a5733e6fd5d22a5a903cb5f613cf5d7bc3508518effc9440c22599331659d0eb4197f1f9b70a05
7
- data.tar.gz: a0d46087763b83c37cffa91b88623faa3981b00eb8b249ebdc05ec3904f54299bf35ecc695a0bc5c46ad37fc05a53c9c3db7385360a168ee89b9ba91335dd66d
6
+ metadata.gz: 3a46e07240647676f8f0e27534c7a7eddd78264b4984ed97cb57e8e3a985234ad7c392e490d83f49958f4fdc9acf65d09db0733772469f61454088dc1ca5fe5b
7
+ data.tar.gz: 34cda842aa952de4d4b3053a9a15dc0dff18a594f8187319a3b47dcf2ddac143b409955d55e30bd7d99e2a94ce551d92c5149d51e9538579451807af8ac9b8a0
@@ -46,4 +46,4 @@ jobs:
46
46
  CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
47
47
  NETWORK: testnet
48
48
  WALLET: dev-master
49
- NODE: alonzo-purple-1.0.1
49
+ NODE: 1.35.0
data/Rakefile CHANGED
@@ -17,7 +17,7 @@ def wget(url, file = nil)
17
17
  end
18
18
 
19
19
  def mk_dir(path)
20
- Dir.mkdir(path) unless File.exist?(path)
20
+ FileUtils.mkdir_p(path)
21
21
  end
22
22
 
23
23
  task :get_latest_configs, [:env] do |_, args|
@@ -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['SSL_CERT_FILE']))
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
 
@@ -26,6 +26,44 @@ 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
29
67
  end
30
68
 
31
69
  # API for Addresses
@@ -137,6 +137,14 @@ module CardanoWallet
137
137
  body: payload.to_json,
138
138
  headers: { 'Content-Type' => 'application/json' })
139
139
  end
140
+
141
+ # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postPolicyId
142
+ def create_policy_id(wid, policy_script_template)
143
+ payload = { policy_script_template: policy_script_template }
144
+ self.class.post("/wallets/#{wid}/policy-id",
145
+ body: payload.to_json,
146
+ headers: { 'Content-Type' => 'application/json' })
147
+ end
140
148
  end
141
149
 
142
150
  # API for Wallets
@@ -354,8 +362,9 @@ module CardanoWallet
354
362
 
355
363
  # Get tx by id
356
364
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getTransaction
357
- def get(wid, tx_id)
358
- self.class.get("/wallets/#{wid}/transactions/#{tx_id}")
365
+ def get(wid, tx_id, query = {})
366
+ query_formatted = query.empty? ? '' : Utils.to_query(query)
367
+ self.class.get("/wallets/#{wid}/transactions/#{tx_id}#{query_formatted}")
359
368
  end
360
369
 
361
370
  # List all wallet's transactions
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CardanoWallet
4
- VERSION = '0.3.19'
4
+ VERSION = '0.3.22'
5
5
  end
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.19
4
+ version: 0.3.22
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-03-30 00:00:00.000000000 Z
11
+ date: 2022-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -165,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  requirements: []
168
- rubygems_version: 3.2.32
168
+ rubygems_version: 3.3.7
169
169
  signing_key:
170
170
  specification_version: 4
171
171
  summary: Ruby wrapper over cardano-wallet.