module Mobius::Client
Constants
- VERSION
Attributes
asset_code[W]
Asset code used for payments (MOBI by default)
asset_issuer[W]
Asset issuer account
challenge_expires_in[W]
Challenge expires in (seconds, 1d by default)
horizon_client[W]
`Stellar::Client` instance
mobius_host[W]
strict_interval[W]
In strict mode, session must be not older than seconds from now (10 by default)
Public Class Methods
asset_code()
click to toggle source
# File lib/mobius/client.rb, line 69 def asset_code @asset_code ||= "MOBI" end
asset_issuer()
click to toggle source
# File lib/mobius/client.rb, line 76 def asset_issuer return @asset_issuer if @asset_issuer return "GA6HCMBLTZS5VYYBCATRBRZ3BZJMAFUDKYYF6AH6MVCMGWMRDNSWJPIH" if network == :public "GDRWBLJURXUKM4RWDZDTPJNX6XBYFO3PSE4H4GPUL6H6RCUQVKTSD4AT" end
challenge_expires_in()
click to toggle source
# File lib/mobius/client.rb, line 85 def challenge_expires_in @challenge_expires_in ||= 60 * 60 * 24 end
horizon_client()
click to toggle source
# File lib/mobius/client.rb, line 62 def horizon_client @horizon_client ||= network == :test ? Stellar::Client.default_testnet : Stellar::Client.default end
mobius_host()
click to toggle source
Mobius
API host
# File lib/mobius/client.rb, line 44 def mobius_host @mobius_host ||= "https://mobius.network" end
network()
click to toggle source
Stellar network to use (:test || :public). See notes on thread-safety in ruby-stellar-base. Safe to set on startup.
# File lib/mobius/client.rb, line 55 def network @network ||= :test end
network=(value)
click to toggle source
# File lib/mobius/client.rb, line 48 def network=(value) @network = value Stellar.default_network = stellar_network end
on_network() { || ... }
click to toggle source
Runs block on selected Stellar network
# File lib/mobius/client.rb, line 102 def on_network Stellar.on_network(stellar_network) do yield if block_given? end end
stellar_asset()
click to toggle source
Stellar::Asset instance of asset used for payments
# File lib/mobius/client.rb, line 90 def stellar_asset @stellar_asset ||= Stellar::Asset.alphanum4(asset_code, Stellar::KeyPair.from_address(asset_issuer)) end
strict_interval()
click to toggle source
# File lib/mobius/client.rb, line 97 def strict_interval @strict_interval ||= 10 end
to_keypair(subject)
click to toggle source
Converts given argument to Stellar::KeyPair
# File lib/mobius/client.rb, line 109 def to_keypair(subject) Mobius::Client::Blockchain::KeyPairFactory.produce(subject) end
Private Class Methods
stellar_network()
click to toggle source
# File lib/mobius/client.rb, line 115 def stellar_network Mobius::Client.network == :test ? Stellar::Networks::TESTNET : Stellar::Networks::PUBLIC end