cardano_wallet 0.3.24 → 0.3.26

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: 35cd30306a63c77b58078620e3f2ba87d946d02aab3296f7fc45065fbcf39895
4
- data.tar.gz: ac4cb6ce2d4cf45c2ab37d2d202448ef9db48c0329feca3f60f301bfd95dc5cc
3
+ metadata.gz: b939ecfaab3cb3b39b87072b84ada64881ca169a40a21537e046a407c7c940b7
4
+ data.tar.gz: 8e208b0afe7adcf2d853955da46a0acb786aae86ce20a5e0eeb31bb8a5d552f7
5
5
  SHA512:
6
- metadata.gz: 770fc6e86c6cf4677bd33bcfe2230515bbfd09e62829fce990219e92ff56a5d8f26160d706c60f333c6b8771b37ab0b204f1a477d4180097dba71198fa06e547
7
- data.tar.gz: 4bce9526e3daa72f811a6bbc3d16311076c59ce600ff275fdc0b25a3c4484d21e2afe1242910ae9594033d407825bf5f7424b22e7cd7385892bc0abebe9577e3
6
+ metadata.gz: 8420ef9068779be1a4b7ea1c23c8f8ad6995781a5b31508830150cea83bb44370d35be2a03f5045a60d7f3dee6e035669ffaeea8b5007f8663f3acf7c520f020
7
+ data.tar.gz: cd653f1463d490e7590dcf99ecd2b19902bee68c02019116363db659238d51c1bfac2ce280a63c29dbcdef6ac0bc2f85595611aa9512f9149907bf18195ac049
@@ -45,13 +45,15 @@ module CardanoWallet
45
45
  # @param mint [Array of Hashes] mint object
46
46
  # @param delegations [Array of Hashes] delegations object
47
47
  # @param validity_interval [Hash] validity_interval object
48
+ # @param encoding [String] output encoding ("base16" or "base64")
48
49
  def construct(wid,
49
50
  payments = nil,
50
51
  withdrawal = nil,
51
52
  metadata = nil,
52
53
  delegations = nil,
53
54
  mint = nil,
54
- validity_interval = nil)
55
+ validity_interval = nil,
56
+ encoding = nil)
55
57
  payload = {}
56
58
  payload[:payments] = payments if payments
57
59
  payload[:withdrawal] = withdrawal if withdrawal
@@ -59,6 +61,7 @@ module CardanoWallet
59
61
  payload[:mint_burn] = mint if mint
60
62
  payload[:delegations] = delegations if delegations
61
63
  payload[:validity_interval] = validity_interval if validity_interval
64
+ payload[:encoding] = encoding if encoding
62
65
 
63
66
  self.class.post("/shared-wallets/#{wid}/transactions-construct",
64
67
  body: payload.to_json,
@@ -76,6 +79,34 @@ module CardanoWallet
76
79
  body: payload.to_json,
77
80
  headers: { 'Content-Type' => 'application/json' })
78
81
  end
82
+
83
+ # Sign transaction
84
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signSharedTransaction
85
+ # @param wid [String] source wallet id
86
+ # @param passphrase [String] wallet's passphrase
87
+ # @param transaction [String] CBOR transaction data
88
+ # @param encoding [String] output encoding ("base16" or "base64")
89
+ def sign(wid, passphrase, transaction, encoding = nil)
90
+ payload = {
91
+ 'passphrase' => passphrase,
92
+ 'transaction' => transaction
93
+ }
94
+ payload[:encoding] = encoding if encoding
95
+ self.class.post("/shared-wallets/#{wid}/transactions-sign",
96
+ body: payload.to_json,
97
+ headers: { 'Content-Type' => 'application/json' })
98
+ end
99
+
100
+ # Submit transaction
101
+ # @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/submitSharedTransaction
102
+ # @param wid [String] source wallet id
103
+ # @param transaction [String] CBOR transaction data
104
+ def submit(wid, transaction)
105
+ payload = { 'transaction' => transaction }
106
+ self.class.post("/shared-wallets/#{wid}/transactions-submit",
107
+ body: payload.to_json,
108
+ headers: { 'Content-Type' => 'application/json' })
109
+ end
79
110
  end
80
111
 
81
112
  # API for Addresses
@@ -313,13 +313,15 @@ module CardanoWallet
313
313
  # @param mint [Array of Hashes] mint object
314
314
  # @param delegations [Array of Hashes] delegations object
315
315
  # @param validity_interval [Hash] validity_interval object
316
+ # @param encoding [String] output encoding ("base16" or "base64")
316
317
  def construct(wid,
317
318
  payments = nil,
318
319
  withdrawal = nil,
319
320
  metadata = nil,
320
321
  delegations = nil,
321
322
  mint = nil,
322
- validity_interval = nil)
323
+ validity_interval = nil,
324
+ encoding = nil)
323
325
  payload = {}
324
326
  payload[:payments] = payments if payments
325
327
  payload[:withdrawal] = withdrawal if withdrawal
@@ -327,6 +329,7 @@ module CardanoWallet
327
329
  payload[:mint_burn] = mint if mint
328
330
  payload[:delegations] = delegations if delegations
329
331
  payload[:validity_interval] = validity_interval if validity_interval
332
+ payload[:encoding] = encoding if encoding
330
333
 
331
334
  self.class.post("/wallets/#{wid}/transactions-construct",
332
335
  body: payload.to_json,
@@ -338,12 +341,13 @@ module CardanoWallet
338
341
  # @param wid [String] source wallet id
339
342
  # @param passphrase [String] wallet's passphrase
340
343
  # @param transaction [String] CBOR transaction data
341
- def sign(wid, passphrase, transaction)
344
+ # @param encoding [String] output encoding ("base16" or "base64")
345
+ def sign(wid, passphrase, transaction, encoding = nil)
342
346
  payload = {
343
347
  'passphrase' => passphrase,
344
348
  'transaction' => transaction
345
349
  }
346
-
350
+ payload[:encoding] = encoding if encoding
347
351
  self.class.post("/wallets/#{wid}/transactions-sign",
348
352
  body: payload.to_json,
349
353
  headers: { 'Content-Type' => 'application/json' })
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CardanoWallet
4
- VERSION = '0.3.24'
4
+ VERSION = '0.3.26'
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.24
4
+ version: 0.3.26
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-08-30 00:00:00.000000000 Z
11
+ date: 2022-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty