stellar-base 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 00b588bb83ab0ec33e7a92e5dfef2284df773fd5
4
- data.tar.gz: 3595b669f01ce541ed9050e76d1657aca9582c2c
3
+ metadata.gz: 0ea78340f6994e3e65e1ff94c06da49d4c7443ec
4
+ data.tar.gz: c7e8b4bec536d169cda2728b576d837cf26fc049
5
5
  SHA512:
6
- metadata.gz: f3b104f6e9339fde162a8612818b40a2951f36d9dc2b679e426cd970ebded35fc6d538590a10300cdd63037c74008217e7de4faa3da500f8fbb085ea2aa5dabd
7
- data.tar.gz: 50d90cf7c604be3f91f37b1ac6c52623502acd2f53828ee4f186bf36eef8dd63f55ea466ce0dfee85eca6374e88db6f7a9690967e130a2ccec37f8bc56ee672f
6
+ metadata.gz: 1df05ce3d1bf317582b8d83b15e0416d3dba1bd90a99293f21c9a86c67f2c477778d5ae9c7d53beca95bebe42ea6d54c1a00eb7bea5ea1fcad13d2e78fdd5b4d
7
+ data.tar.gz: 11258c89a6dede4947fb70809a365b4840495d3a15e60d998a0a53c38bf831b756259ee9bced4bb85767f4e5f26bc613d3ff2b1ac353b7f3ca7e19ee71a3bc40
@@ -20,7 +20,7 @@ tx = Stellar::Transaction.create_account({
20
20
  starting_balance: 50 * Stellar::ONE
21
21
  })
22
22
 
23
- hex = tx.to_envelope(master).to_xdr(:hex)
23
+ b64 = tx.to_envelope(master).to_xdr(:base64)
24
24
 
25
- result = $server.get('tx', blob: hex)
25
+ result = $server.get('tx', blob: b64)
26
26
  p result.body
@@ -27,7 +27,7 @@ tx = Stellar::Transaction.payment({
27
27
  amount: [:native, 20 * Stellar::ONE]
28
28
  })
29
29
 
30
- hex = tx.to_envelope(master).to_xdr(:hex)
30
+ b64 = tx.to_envelope(master).to_xdr(:base64)
31
31
 
32
- result = $server.get('tx', blob: hex)
32
+ result = $server.get('tx', blob: b64)
33
33
  p result.body
@@ -22,8 +22,8 @@ $server = Faraday.new(url: "http://localhost:39132") do |conn|
22
22
  end
23
23
 
24
24
  def submit(key, tx)
25
- hex = tx.to_envelope(key).to_xdr(:hex)
26
- response = $server.get('tx', blob: hex)
25
+ b64 = tx.to_envelope(key).to_xdr(:base64)
26
+ response = $server.get('tx', blob: b64)
27
27
  raw = [response.body["result"]].pack("H*")
28
28
  p response.body
29
29
  end
data/examples/offer.rb CHANGED
@@ -22,8 +22,8 @@ $server = Faraday.new(url: "http://localhost:39132") do |conn|
22
22
  end
23
23
 
24
24
  def submit(key, tx)
25
- hex = tx.to_envelope(key).to_xdr(:hex)
26
- response = $server.get('tx', blob: hex)
25
+ b64 = tx.to_envelope(key).to_xdr(:base64)
26
+ response = $server.get('tx', blob: b64)
27
27
  p response.body
28
28
  end
29
29
 
@@ -67,9 +67,9 @@ submit master, Stellar::Transaction.payment({
67
67
 
68
68
  submit master, Stellar::Transaction.manage_offer({
69
69
  account: destination,
70
- sequence: destination_sequence + 3
71
- taker_gets: [:alphanum4, "USD\x00", usd_gateway],
72
- taker_pays: [:alphanum4, "EUR\x00", eur_gateway],
70
+ sequence: destination_sequence + 3,
71
+ selling: [:alphanum4, "USD\x00", usd_gateway],
72
+ buying: [:alphanum4, "EUR\x00", eur_gateway],
73
73
  amount: 100,
74
74
  price: 2.0,
75
75
  })
@@ -19,5 +19,5 @@ tx2 = Stellar::Transaction.payment({
19
19
  amount: [:native, 20 * Stellar::ONE]
20
20
  })
21
21
 
22
- hex = tx1.merge(tx2).to_envelope(master).to_xdr(:hex)
22
+ hex = tx1.merge(tx2).to_envelope(master).to_xdr(:base64)
23
23
  puts hex
@@ -1,5 +1,5 @@
1
1
  module Stellar
2
2
  module Base
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -131,15 +131,15 @@ module Stellar
131
131
  end
132
132
 
133
133
  def self.manage_offer(attributes={})
134
- taker_pays = Asset.send(*attributes[:taker_pays])
135
- taker_gets = Asset.send(*attributes[:taker_gets])
134
+ buying = Asset.send(*attributes[:buying])
135
+ selling = Asset.send(*attributes[:selling])
136
136
  amount = attributes[:amount]
137
137
  offer_id = attributes[:offer_id] || 0
138
138
  price = Price.from_f(attributes[:price])
139
139
 
140
140
  op = ManageOfferOp.new({
141
- taker_pays: taker_pays,
142
- taker_gets: taker_gets,
141
+ buying: buying,
142
+ selling: selling,
143
143
  amount: amount,
144
144
  price: price,
145
145
  offer_id: offer_id
@@ -151,14 +151,14 @@ module Stellar
151
151
  end
152
152
 
153
153
  def self.create_passive_offer(attributes={})
154
- taker_pays = Asset.send(*attributes[:taker_pays])
155
- taker_gets = Asset.send(*attributes[:taker_gets])
154
+ buying = Asset.send(*attributes[:buying])
155
+ selling = Asset.send(*attributes[:selling])
156
156
  amount = attributes[:amount]
157
157
  price = Price.from_f(attributes[:price])
158
158
 
159
159
  op = CreatePassiveOfferOp.new({
160
- taker_pays: taker_pays,
161
- taker_gets: taker_gets,
160
+ buying: buying,
161
+ selling: selling,
162
162
  amount: amount,
163
163
  price: price,
164
164
  })
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stellar-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Fleckenstein