cardano_wallet 0.2.4 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 138963a69580ac035ec96fe4d0aa0b312ad9896c202e84079a2bb017fba537d2
4
- data.tar.gz: 3e5131b4d9fac94536f4002827d233d0054d2e648bb1e8846e3ed751a0432e3a
3
+ metadata.gz: f9ad05abba294de18063a3e1e381ce3e06e95644f4209526eba555f9a2504dae
4
+ data.tar.gz: 24ee6eeb1fd928c07df71c9e2875fae4b150c6ac564ecfd1775001f1d712468b
5
5
  SHA512:
6
- metadata.gz: 8ab66b2b2d66b6c80d2c0972ca2c3605c7d0bbafb3bff4af9fce72dba96adebc471d01410a7fad3900999d5cb6138c3e2d1078527e0d3fc73d9cabb370739489
7
- data.tar.gz: 12d5479650d0e9b5af8c766709ae6ff9e3ade893d58dbfe5e211286d3346ec4f7ec156322b5d513fce84b93c826893f905bfc45f915786ff78b51960bedece64
6
+ metadata.gz: a94ebe1b3dc75ed9da0c3a7da543e607c3228baa1f9f127f09cd8d3f50e37f54dca7c2c6e84176f8ae4f0c8e0933e5c38b6dc536efddc98b5a2b34e5db7c4adf
7
+ data.tar.gz: '042836808eb65faf1a67f5508dd7ea12fd4b82c61cd6e7d9da8f4cb728fd45e6d9bf96ef1ea1afeedba8fdb56d9e53ff16a49dd08987edf678bd64aeb657708c'
@@ -14,12 +14,7 @@ jobs:
14
14
  - name: Set up cardano-wallet
15
15
  run: NODE_CONFIG_PATH=`pwd`/spec/testnet docker-compose -f docker-compose-shelley.yml up --detach
16
16
  - name: Set up Ruby
17
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
18
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
19
- # uses: ruby/setup-ruby@v1
20
- uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
21
- with:
22
- ruby-version: 2.6
17
+ uses: ruby/setup-ruby@v1
23
18
  - name: Install dependencies
24
19
  run: bundle install
25
20
  - name: Wait until node is synced
@@ -23,12 +23,7 @@ jobs:
23
23
  - name: Set up cardano-wallet
24
24
  run: NODE_CONFIG_PATH=`pwd`/spec/testnet docker-compose -f docker-compose-shelley.yml up --detach
25
25
  - name: Set up Ruby
26
- # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
27
- # change this to (see https://github.com/ruby/setup-ruby#versioning):
28
- # uses: ruby/setup-ruby@v1
29
- uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
30
- with:
31
- ruby-version: 2.6
26
+ uses: ruby/setup-ruby@v1
32
27
  - name: Install dependencies
33
28
  run: bundle install
34
29
  - name: Run all tests except nighlty
@@ -0,0 +1 @@
1
+ ruby-2.7.1
@@ -95,8 +95,7 @@ module CardanoWallet
95
95
 
96
96
  self.class.post("/wallets/#{wid}/signatures/#{role}/#{index}",
97
97
  :body => payload.to_json,
98
- :headers => { 'Content-Type' => 'application/json',
99
- 'Accept' => 'application/octet-stream'} )
98
+ :headers => { 'Content-Type' => 'application/json' } )
100
99
  end
101
100
 
102
101
  # @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getWalletKey
@@ -109,6 +108,25 @@ module CardanoWallet
109
108
  self.class.get("/addresses/#{address_id}")
110
109
  end
111
110
 
111
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postAnyAddress
112
+ def post_address(payload)
113
+ CardanoWallet::Utils.verify_param_is_hash!(payload)
114
+ self.class.post("/addresses",
115
+ :body => payload.to_json,
116
+ :headers => { 'Content-Type' => 'application/json',
117
+ 'Accept' => 'application/json'} )
118
+ end
119
+
120
+ # Current SMASH health
121
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getCurrentSmashHealth
122
+ #
123
+ # @example
124
+ # smash_health({url: "https://smash.cardano-mainnet.iohk.io/"})
125
+ def smash_health(q = {})
126
+ q.empty? ? query = '' : query = CardanoWallet::Utils.to_query(q)
127
+ self.class.get("/smash/health#{query}")
128
+ end
129
+
112
130
  end
113
131
 
114
132
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Proxy
@@ -202,7 +202,7 @@ module CardanoWallet
202
202
  # random(wid, {action: "join", pool: "poolid"})
203
203
  # random(wid, {action: "quit"})
204
204
  def random_deleg(wid, deleg_action)
205
- payments_formatted = Utils.verify_param_is_hash!(deleg_action)
205
+ Utils.verify_param_is_hash!(deleg_action)
206
206
  self.class.post("/wallets/#{wid}/coin-selections/random",
207
207
  :body => {:delegation_action => deleg_action}.to_json,
208
208
  :headers => { 'Content-Type' => 'application/json' })
@@ -239,16 +239,18 @@ module CardanoWallet
239
239
  # @param payments [Array of Hashes] addres, amount pair
240
240
  # @param withdrawal [String or Array] 'self' or mnemonic sentence
241
241
  # @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
242
+ # @param ttl [Int] transaction's time-to-live in seconds
242
243
  #
243
244
  # @example
244
- # create(wid, passphrase, [{addr1: 1000000}, {addr2: 1000000}], 'self', {"1": "abc"})
245
- def create(wid, passphrase, payments, withdrawal = nil, metadata = nil)
245
+ # create(wid, passphrase, [{addr1: 1000000}, {addr2: 1000000}], 'self', {"1": "abc"}, ttl = 10)
246
+ def create(wid, passphrase, payments, withdrawal = nil, metadata = nil, ttl = nil)
246
247
  payments_formatted = Utils.format_payments(payments)
247
248
  payload = { :payments => payments_formatted,
248
249
  :passphrase => passphrase
249
250
  }
250
251
  payload[:withdrawal] = withdrawal if withdrawal
251
252
  payload[:metadata] = metadata if metadata
253
+ payload[:time_to_live] = { quantity: ttl, unit: "second" } if ttl
252
254
 
253
255
  self.class.post("/wallets/#{wid}/transactions",
254
256
  :body => payload.to_json,
@@ -259,13 +261,14 @@ module CardanoWallet
259
261
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransactionFee
260
262
  #
261
263
  # @example
262
- # payment_fees(wid, [{addr1: 1000000}, {addr2: 1000000}], {"1": "abc"})
263
- def payment_fees(wid, payments, withdrawal = nil, metadata = nil)
264
+ # payment_fees(wid, [{addr1: 1000000}, {addr2: 1000000}], {"1": "abc"}, ttl = 10)
265
+ def payment_fees(wid, payments, withdrawal = nil, metadata = nil, ttl = nil)
264
266
  payments_formatted = Utils.format_payments(payments)
265
267
  payload = { :payments => payments_formatted }
266
268
 
267
269
  payload[:withdrawal] = withdrawal if withdrawal
268
270
  payload[:metadata] = metadata if metadata
271
+ payload[:time_to_live] = { quantity: ttl, unit: "second" } if ttl
269
272
 
270
273
  self.class.post("/wallets/#{wid}/payment-fees",
271
274
  :body => payload.to_json,
@@ -286,6 +289,24 @@ module CardanoWallet
286
289
  super
287
290
  end
288
291
 
292
+ # Stake pools maintenance actions
293
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postMaintenanceAction
294
+ #
295
+ # @example
296
+ # maintenance_action({ "maintenance_action": "gc_stake_pools" })
297
+ def trigger_maintenance_actions(action = {})
298
+ Utils.verify_param_is_hash!(action)
299
+ self.class.post("/stake-pools/maintenance-actions",
300
+ :body => action.to_json,
301
+ :headers => { 'Content-Type' => 'application/json' } )
302
+ end
303
+
304
+ # Metdata GC Status
305
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getMaintenanceActions
306
+ def view_maintenance_actions
307
+ self.class.get("/stake-pools/maintenance-actions")
308
+ end
309
+
289
310
  # List all stake pools
290
311
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/listStakePools
291
312
  def list(stake = {})
@@ -1,3 +1,3 @@
1
1
  module CardanoWallet
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.9"
3
3
  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.2.4
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Stachyra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-23 00:00:00.000000000 Z
11
+ date: 2020-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -107,6 +107,7 @@ files:
107
107
  - ".gitignore"
108
108
  - ".rakeTasks"
109
109
  - ".rspec"
110
+ - ".ruby-version"
110
111
  - CODE_OF_CONDUCT.md
111
112
  - Gemfile
112
113
  - LICENSE.txt
@@ -147,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  - !ruby/object:Gem::Version
148
149
  version: '0'
149
150
  requirements: []
150
- rubygems_version: 3.1.2
151
+ rubygems_version: 3.1.4
151
152
  signing_key:
152
153
  specification_version: 4
153
154
  summary: Ruby wrapper over cardano-wallet.