Sha256: 6c5e5c1f1e291d157aa227b382139a86fd85e5b1e56052cd6e4e8db67d77a6bb

Contents?: true

Size: 555 Bytes

Versions: 5

Compression:

Stored size: 555 Bytes

Contents

#!/usr/bin/env ruby


require 'stellar-base'
require 'faraday'
require 'faraday_middleware'

$server = Faraday.new(url: "http://localhost:39132") do |conn|
  conn.response :json
  conn.adapter Faraday.default_adapter
end

master      = Stellar::KeyPair.master
destination = Stellar::KeyPair.random

tx = Stellar::Transaction.create_account({
  account:     master,
  destination: destination,
  sequence:    1,
  starting_balance:  50 * Stellar::ONE
})

b64    = tx.to_envelope(master).to_xdr(:base64)

result = $server.get('tx', blob: b64)
p result.body

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
open-core-0.3.0 examples/create_account.rb
stellar-base-0.3.0 examples/create_account.rb
stellar-base-0.2.0 examples/create_account.rb
stellar-base-0.1.4 examples/create_account.rb
stellar-base-0.1.3 examples/create_account.rb