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

Parameters:

  • keypair (Stellar::Keypair)

    Account keypair

  • cosigner_keypair (Stellar::Keypair)

    Cosigner account keypair

  • cosigner_weight (Integer) (defaults to: )

    Cosigner weight, default: 1

  • master_weight (Integer) (defaults to: )

    Master key weight, default: 10



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.

Parameters:

  • keypair (Stellar::Keypair)

    Account keypair

  • cosigner_keypair (Stellar::Keypair)

    Cosigner account keypair

  • cosigner_weight (Integer) (defaults to: )

    Cosigner weight, default: 1

  • master_weight (Integer) (defaults to: )

    Master key weight, default: 10



# 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