Method: Stellar::Operation.set_options

Defined in:
lib/stellar/operation.rb

.set_options(set: [], clear: [], home_domain: nil, signer: nil, inflation_dest: nil, source_account: nil, **attributes) ⇒ Stellar::Operation

Set Options operation builder.

Parameters:

  • source_account (KeyPair, nil) (defaults to: nil)

    the source account for the operation

  • home_domain (String, nil\) (defaults to: nil)

    the home domain of the account

  • signer (Signer, nil) (defaults to: nil)

    add, remove or adjust weight of the co-signer

  • set (Array<AccountFlags>) (defaults to: [])

    flags to set

  • clear (Array<AccountFlags>) (defaults to: [])

    flags to clear

  • inflation_dest (KeyPair, nil) (defaults to: nil)

    the inflation destination of the account

Returns:

Raises:

  • (ArgumentError)


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/stellar/operation.rb', line 71

def set_options(set: [], clear: [], home_domain: nil, signer: nil, inflation_dest: nil, source_account: nil, **attributes)
  raise ArgumentError, "Bad inflation_dest" if inflation_dest && !inflation_dest.is_a?(KeyPair)

  op = SetOptionsOp.new(
    set_flags: Stellar::AccountFlags.make_mask(set),
    clear_flags: Stellar::AccountFlags.make_mask(clear),
    master_weight: attributes[:master_weight],
    low_threshold: attributes[:low_threshold],
    med_threshold: attributes[:med_threshold],
    high_threshold: attributes[:high_threshold],
    signer: signer,
    home_domain: home_domain,
    inflation_dest: inflation_dest&.
  )

  make(source_account: , body: [:set_options, op])
end