cardano_wallet 0.3.12 → 0.3.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tests.yml +3 -3
- data/.rubocop.yml +1 -0
- data/Rakefile +1 -0
- data/lib/cardano_wallet/byron.rb +35 -0
- data/lib/cardano_wallet/shelley.rb +70 -2
- 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: 45b919d141b81daa489e6f718a8b61054f2b189d6fe541488d10171144b0217b
|
4
|
+
data.tar.gz: 5987eeea91e123379a648fc44a6feed0a87223987a2b1a4989f36c8975e26a1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0dd7b9d3f29876effa91026ca884a8d955d44dfceda38ee9210fbbab583ba89002e288e6b656fecd74c983b6e6a76c56710d5b8911a76249f6ad9755805d6f82
|
7
|
+
data.tar.gz: e1eb83d8e47a102d99942f8f7d9c37b399430a3bc908acbbf6c6c4dd9a0d1ccdde2a0060b935cb79c8ccd8191dba42bab81bdeae6b0bfc95e008e951823f9df2
|
data/.github/workflows/tests.yml
CHANGED
@@ -33,7 +33,7 @@ jobs:
|
|
33
33
|
echo "Node: $NODE"
|
34
34
|
NODE_CONFIG_PATH=`pwd`/configs docker-compose up --detach
|
35
35
|
docker run --rm inputoutput/cardano-wallet:$WALLET version
|
36
|
-
docker run --rm inputoutput/cardano-node:$NODE version
|
36
|
+
docker run --rm inputoutput/cardano-node:$NODE cli version
|
37
37
|
ls ~/node-db-nightly-docker
|
38
38
|
|
39
39
|
- name: Run all tests except nighlty
|
@@ -45,5 +45,5 @@ jobs:
|
|
45
45
|
CI: true
|
46
46
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
47
47
|
NETWORK: testnet
|
48
|
-
WALLET: dev-master
|
49
|
-
NODE: 1.
|
48
|
+
WALLET: dev-master
|
49
|
+
NODE: alonzo-purple-1.0.1
|
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
@@ -31,6 +31,7 @@ task :get_latest_configs, [:env] do |_, args|
|
|
31
31
|
mk_dir(path)
|
32
32
|
wget("#{base_url}/#{env}-config.json", "#{path}/#{env}-config.json")
|
33
33
|
wget("#{base_url}/#{env}-byron-genesis.json", "#{path}/#{env}-byron-genesis.json")
|
34
|
+
wget("#{base_url}/#{env}-alonzo-genesis.json", "#{path}/#{env}-alonzo-genesis.json")
|
34
35
|
wget("#{base_url}/#{env}-shelley-genesis.json", "#{path}/#{env}-shelley-genesis.json")
|
35
36
|
wget("#{base_url}/#{env}-topology.json", "#{path}/#{env}-topology.json")
|
36
37
|
end
|
data/lib/cardano_wallet/byron.rb
CHANGED
@@ -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)
|
@@ -103,8 +103,9 @@ module CardanoWallet
|
|
103
103
|
end
|
104
104
|
|
105
105
|
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/getWalletKey
|
106
|
-
def get_public_key(wid, role, index)
|
107
|
-
|
106
|
+
def get_public_key(wid, role, index, query = {})
|
107
|
+
query_formatted = query.empty? ? '' : Utils.to_query(query)
|
108
|
+
self.class.get("/wallets/#{wid}/keys/#{role}/#{index}#{query_formatted}")
|
108
109
|
end
|
109
110
|
|
110
111
|
# @see https://input-output-hk.github.io/cardano-wallet/api/#operation/postAccountKey
|
@@ -258,6 +259,73 @@ module CardanoWallet
|
|
258
259
|
# API for Transactions
|
259
260
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#tag/Transactions
|
260
261
|
class Transactions < Base
|
262
|
+
# Balance transaction
|
263
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/balanceTransaction
|
264
|
+
# @param wid [String] source wallet id
|
265
|
+
# @param payload [Hash] payload object
|
266
|
+
def balance(wid, payload)
|
267
|
+
self.class.post("/wallets/#{wid}/transactions-balance",
|
268
|
+
body: payload.to_json,
|
269
|
+
headers: { 'Content-Type' => 'application/json' })
|
270
|
+
end
|
271
|
+
|
272
|
+
# Decode transaction
|
273
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/decodeTransaction
|
274
|
+
# @param wid [String] source wallet id
|
275
|
+
# @param transaction [String] CBOR base64|base16 encoded transaction
|
276
|
+
def decode(wid, transaction)
|
277
|
+
payload = {}
|
278
|
+
payload[:transaction] = transaction
|
279
|
+
self.class.post("/wallets/#{wid}/transactions-decode",
|
280
|
+
body: payload.to_json,
|
281
|
+
headers: { 'Content-Type' => 'application/json' })
|
282
|
+
end
|
283
|
+
|
284
|
+
# Construct transaction
|
285
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/constructTransaction
|
286
|
+
# @param wid [String] source wallet id
|
287
|
+
# @param payments [Array of Hashes] full payments payload with assets
|
288
|
+
# @param withdrawal [String or Array] 'self' or mnemonic sentence
|
289
|
+
# @param metadata [Hash] special metadata JSON subset format (cf: https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/postTransaction)
|
290
|
+
# @param mint [Array of Hashes] mint object
|
291
|
+
# @param delegations [Array of Hashes] delegations object
|
292
|
+
# @param validity_interval [Hash] validity_interval object
|
293
|
+
def construct(wid,
|
294
|
+
payments = nil,
|
295
|
+
withdrawal = nil,
|
296
|
+
metadata = nil,
|
297
|
+
delegations = nil,
|
298
|
+
mint = nil,
|
299
|
+
validity_interval = nil)
|
300
|
+
payload = {}
|
301
|
+
payload[:payments] = payments if payments
|
302
|
+
payload[:withdrawal] = withdrawal if withdrawal
|
303
|
+
payload[:metadata] = metadata if metadata
|
304
|
+
payload[:mint] = mint if mint
|
305
|
+
payload[:delegations] = delegations if delegations
|
306
|
+
payload[:validity_interval] = validity_interval if validity_interval
|
307
|
+
|
308
|
+
self.class.post("/wallets/#{wid}/transactions-construct",
|
309
|
+
body: payload.to_json,
|
310
|
+
headers: { 'Content-Type' => 'application/json' })
|
311
|
+
end
|
312
|
+
|
313
|
+
# Sign transaction
|
314
|
+
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/signTransaction
|
315
|
+
# @param wid [String] source wallet id
|
316
|
+
# @param passphrase [String] wallet's passphrase
|
317
|
+
# @param passphrase [String] CBOR transaction data
|
318
|
+
def sign(wid, passphrase, transaction)
|
319
|
+
payload = {
|
320
|
+
'passphrase' => passphrase,
|
321
|
+
'transaction' => transaction
|
322
|
+
}
|
323
|
+
|
324
|
+
self.class.post("/wallets/#{wid}/transactions-sign",
|
325
|
+
body: payload.to_json,
|
326
|
+
headers: { 'Content-Type' => 'application/json' })
|
327
|
+
end
|
328
|
+
|
261
329
|
# Get tx by id
|
262
330
|
# @see https://input-output-hk.github.io/cardano-wallet/api/edge/#operation/getTransaction
|
263
331
|
def get(wid, tx_id)
|
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.17
|
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-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|