Class: Mobius::Client::Blockchain::AddCosigner

Inherits:
Object
  • Object
show all
Extended by:
Dry::Initializer
Defined in:
lib/mobius/client/blockchain/add_cosigner.rb

Overview

Adds account as cosigner to other account.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(keypair, cosigner, cosigner_weight: , master_weight: ) ⇒ Object



12
# File 'lib/mobius/client/blockchain/add_cosigner.rb', line 12

param :keypair

Class Method Details

.call(keypair, cosigner, cosigner_weight: , master_weight: ) ⇒ Object

Executes an operation.



# File 'lib/mobius/client/blockchain/add_cosigner.rb', line 17


Instance Method Details

#callObject

Executes an operation



26
27
28
29
30
31
32
# File 'lib/mobius/client/blockchain/add_cosigner.rb', line 26

def call
  client.horizon.transactions._post(
    tx: tx.to_envelope(keypair).to_xdr(:base64)
  )
rescue Faraday::ResourceNotFound
  raise Mobius::Client::Error::AccountMissing
end