-
Notifications
You must be signed in to change notification settings - Fork 44
/
01_get_funded.rb
38 lines (33 loc) · 1.04 KB
/
01_get_funded.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require "stellar-sdk"
require "stellar-horizon"
# Reference an account from a secret seed
account = Stellar::Account.from_seed("SBXH4SEH32PENMMB66P4TY6LXUIFMRVFUMX2LJC3P2STHICBJLNQJOH5")
# Further options
#
# Make a random account
#
# account = Stellar::Account.random()
#
# Reference an account (unauthenticated) from an address
#
# account = Stellar::Account.from_address("gjgPNE2GpySt5iYZaFFo1svCJ4gbHwXxUy8DDqeYTDK6UzsPTs")
#
# Reference an account (unauthenticated) from a federation name
#
# account = Stellar::Federation.lookup("nullstyle*stellarfed.org")
# account = Stellar::Federation.lookup("nullstyle@gmail.com*stellarfed.org")
#
# create a connection to the stellar network
client = Stellar::Horizon::Client.default_testnet
# Further options
#
# Connect to the live network (when it is created)
#
# client = Stellar::Horizon::Client.default
#
# Connect to a specific horizon host
#
# client = Stellar::Horizon::Client.new(host: "127.0.0.1")
# Get our friendly friendbot to
# fund your new account
client.friendbot(account) # => #<OK>