cardano_wallet 0.3.12 → 0.3.14

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: 3d537fcde82dbf5b749eb610fe65c56650e81d894ae4cebe70597214e8b7c5a9
4
- data.tar.gz: 3f69daffc7168cf217583ea22711dc376117e2f7e22cc94796718f498d410a37
3
+ metadata.gz: db8533e403d0e47ad79f2a1f747ff748da7f23f5cfb7a2f8401f8ce5d7c17bfb
4
+ data.tar.gz: 7fd7466533875ca3414a28ae940eac4c0fee0543114e4b26713bdf1321689b7d
5
5
  SHA512:
6
- metadata.gz: 2aef5a637abe1835ee974da83b945fa6512f1386c45677e27b6d7b523d26900242e7f15f9de70a5246b85309f7df7f59e7ddfb66e5af4e9395a0caa7f2eb279b
7
- data.tar.gz: f36919d5ed2d2c6c7a1859f9c3d27b3217d3adde85fecb76e93d790e632e4064d660f1888ce9cb7eeee885d28d287d361fb27f9a01b55f14c08bd1d62d08da5c
6
+ metadata.gz: d63b186f82b6f5abd16c0e336e6a137ea2607ce911641d5270af80f791e2c83e75e5213ec16af5a5b0ad867700fcc62fd752804320bc0d03fa005ebaaf8e6f5f
7
+ data.tar.gz: e18d2611da373ee8b7c2ad0702405a9d5cf51dc0badd0c744349fabbf2d4644f561d10fbb3a102a4e8a62ced3844ea74f2fbd580c992b836e0fa12fd44482fa6
data/.rubocop.yml CHANGED
@@ -22,3 +22,4 @@ Metrics/CyclomaticComplexity:
22
22
 
23
23
  Metrics/ParameterLists:
24
24
  Max: 10
25
+ MaxOptionalParameters: 10
@@ -210,6 +210,41 @@ module CardanoWallet
210
210
  # Byron transactions
211
211
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postByronTransactionFee
212
212
  class Transactions < Base
213
+ # Construct transaction
214
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructByronTransaction
215
+ # @param wid [String] source wallet id
216
+ # @param payments [Array of Hashes] full payments payload with assets
217
+ # @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
218
+ # @param mint [Array of Hashes] mint object
219
+ # @param validity_interval [Hash] validity_interval object
220
+ def construct(wid, payments = nil, metadata = nil, mint = nil, validity_interval = nil)
221
+ payload = {}
222
+ payload[:payments] = payments if payments
223
+ payload[:metadata] = metadata if metadata
224
+ payload[:mint] = mint if mint
225
+ payload[:validity_interval] = validity_interval if validity_interval
226
+
227
+ self.class.post("/byron-wallets/#{wid}/transactions-construct",
228
+ body: payload.to_json,
229
+ headers: { 'Content-Type' => 'application/json' })
230
+ end
231
+
232
+ # Sign transaction
233
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signByronTransaction
234
+ # @param wid [String] source wallet id
235
+ # @param passphrase [String] wallet's passphrase
236
+ # @param passphrase [String] CBOR transaction data
237
+ def sign(wid, passphrase, transaction)
238
+ payload = {
239
+ 'passphrase' => passphrase,
240
+ 'transaction' => transaction
241
+ }
242
+
243
+ self.class.post("/byron-wallets/#{wid}/transactions-sign",
244
+ body: payload.to_json,
245
+ headers: { 'Content-Type' => 'application/json' })
246
+ end
247
+
213
248
  # Get tx by id
214
249
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getByronTransaction
215
250
  def get(wid, tx_id)
@@ -258,6 +258,51 @@ module CardanoWallet
258
258
  # API for Transactions
259
259
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Transactions
260
260
  class Transactions < Base
261
+ # Construct transaction
262
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructTransaction
263
+ # @param wid [String] source wallet id
264
+ # @param payments [Array of Hashes] full payments payload with assets
265
+ # @param withdrawal [String or Array] 'self' or mnemonic sentence
266
+ # @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
267
+ # @param mint [Array of Hashes] mint object
268
+ # @param delegations [Array of Hashes] delegations object
269
+ # @param validity_interval [Hash] validity_interval object
270
+ def construct(wid,
271
+ payments = nil,
272
+ withdrawal = nil,
273
+ metadata = nil,
274
+ delegations = nil,
275
+ mint = nil,
276
+ validity_interval = nil)
277
+ payload = {}
278
+ payload[:payments] = payments if payments
279
+ payload[:withdrawal] = withdrawal if withdrawal
280
+ payload[:metadata] = metadata if metadata
281
+ payload[:mint] = mint if mint
282
+ payload[:delegations] = delegations if delegations
283
+ payload[:validity_interval] = validity_interval if validity_interval
284
+
285
+ self.class.post("/wallets/#{wid}/transactions-construct",
286
+ body: payload.to_json,
287
+ headers: { 'Content-Type' => 'application/json' })
288
+ end
289
+
290
+ # Sign transaction
291
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signTransaction
292
+ # @param wid [String] source wallet id
293
+ # @param passphrase [String] wallet's passphrase
294
+ # @param passphrase [String] CBOR transaction data
295
+ def sign(wid, passphrase, transaction)
296
+ payload = {
297
+ 'passphrase' => passphrase,
298
+ 'transaction' => transaction
299
+ }
300
+
301
+ self.class.post("/wallets/#{wid}/transactions-sign",
302
+ body: payload.to_json,
303
+ headers: { 'Content-Type' => 'application/json' })
304
+ end
305
+
261
306
  # Get tx by id
262
307
  # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getTransaction
263
308
  def get(wid, tx_id)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CardanoWallet
4
- VERSION = '0.3.12'
4
+ VERSION = '0.3.14'
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.12
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Stachyra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-19 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty