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, weight) ⇒ Object

Parameters:

  • keypair (Stellar::Keypair)

    Account keypair

  • cosigner_keypair (Stellar::Keypair)

    Cosigner account keypair

  • weight (Integer)

    Cosigner weight, default: 1



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

param :keypair

Class Method Details

.call(keypair, cosigner, weight) ⇒ Object

Executes an operation.

Parameters:

  • keypair (Stellar::Keypair)

    Account keypair

  • cosigner_keypair (Stellar::Keypair)

    Cosigner account keypair

  • weight (Integer)

    Cosigner weight, default: 1



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

Instance Method Details

#callObject

Executes an operation



23
24
25
26
27
28
29
# File 'lib/mobius/client/blockchain/add_cosigner.rb', line 23

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