Class: Mobius::Client::Auth::Challenge
- Inherits:
-
Object
- Object
- Mobius::Client::Auth::Challenge
- Extended by:
- Dry::Initializer
- Defined in:
- lib/mobius/client/auth/challenge.rb
Overview
Generates challenge transaction on developer’s side.
Class Method Summary collapse
-
.call(seed, expire_in = Mobius::Client.challenge_expires_in) ⇒ String
Generates challenge transaction signed by developers private key.
Instance Method Summary collapse
-
#call ⇒ String
Base64-encoded transaction envelope.
- #initialize(seed, expire_in = Mobius::Client.challenge_expires_in) ⇒ Object constructor
Constructor Details
#initialize(seed, expire_in = Mobius::Client.challenge_expires_in) ⇒ Object
10 |
# File 'lib/mobius/client/auth/challenge.rb', line 10 param :seed |
Class Method Details
.call(seed, expire_in = Mobius::Client.challenge_expires_in) ⇒ String
Generates challenge transaction signed by developers private key. Minimum valid time bound is set to current time. Maximum valid time bound is set to ‘expire_in` seconds from now.
|
# File 'lib/mobius/client/auth/challenge.rb', line 13
|
Instance Method Details
#call ⇒ String
Returns base64-encoded transaction envelope.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mobius/client/auth/challenge.rb', line 22 def call payment = Stellar::Transaction.payment( source_account: keypair, account: Stellar::KeyPair.random, destination: keypair, sequence: random_sequence, amount: micro_xlm, memo: memo ) payment.time_bounds = build_time_bounds(expire_in) payment.to_envelope(keypair).to_xdr(:base64) end |