Class: RippleRest::AccountSettings

Inherits:
RestObject show all
Defined in:
lib/ripple-rest/generated-schemas.rb,
lib/ripple-rest/schemas.rb,
lib/ripple-rest/generated-schemas.rb

Overview

An object

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RestObject

#initialize, #to_hash

Constructor Details

This class inherits a constructor from RippleRest::RestObject

Instance Attribute Details

#accountString<RippleAddress>

The Ripple address of the account in question

Returns:

  • (String<RippleAddress>)


4
5
6
# File 'lib/ripple-rest/schemas.rb', line 4

def 
  @account
end

#disallow_xrpBoolean

If set to true incoming XRP payments will be allowed

Returns:

  • (Boolean)


216
# File 'lib/ripple-rest/generated-schemas.rb', line 216

property :disallow_xrp, :Boolean

#email_hashString<Hash128>

The MD5 128-bit hash of the account owner’s email address

Returns:

  • (String<Hash128>)


191
# File 'lib/ripple-rest/generated-schemas.rb', line 191

property :email_hash, :Hash128

#hashString<Hash256>

If this object was returned by a historical query this value will be the hash of the transaction that modified these settings. The transaction hash is used throughout the Ripple Protocol to uniquely identify a particular transaction

Returns:

  • (String<Hash256>)


236
# File 'lib/ripple-rest/generated-schemas.rb', line 236

property :hash, :Hash256

#ledgerString

The string representation of the index number of the ledger containing these account settings or, in the case of historical queries, of the transaction that modified these settings

Returns:

  • (String)

    “^[0-9]$”+



231
# File 'lib/ripple-rest/generated-schemas.rb', line 231

property :ledger, [:String, "^[0-9]+$"]

#message_keyString

An optional public key, represented as hex, that can be set to allow others to send encrypted messages to the account owner

Returns:

  • (String)

    “^([0-9a-fA-F]{2}){0,33}$”



196
# File 'lib/ripple-rest/generated-schemas.rb', line 196

property :message_key, [:String, "^([0-9a-fA-F]{2}){0,33}$"]

#regular_keyString<RippleAddress>

The hash of an optional additional public key that can be used for signing and verifying transactions

Returns:

  • (String<RippleAddress>)


181
# File 'lib/ripple-rest/generated-schemas.rb', line 181

property :regular_key, :RippleAddress

#require_authorizationBoolean

If set to true incoming trustlines will only be validated if this account first creates a trustline to the counterparty with the authorized flag set to true. This may be used by gateways to prevent accounts unknown to them from holding currencies they issue

Returns:

  • (Boolean)


211
# File 'lib/ripple-rest/generated-schemas.rb', line 211

property :require_authorization, :Boolean

#require_destination_tagBoolean

If set to true incoming payments will only be validated if they include a destination_tag. This may be used primarily by gateways that operate exclusively with hosted wallets

Returns:

  • (Boolean)


206
# File 'lib/ripple-rest/generated-schemas.rb', line 206

property :require_destination_tag, :Boolean

#transaction_sequenceString<UINT32>

A string representation of the last sequence number of a validated transaction created by this account

Returns:

  • (String<UINT32>)


221
# File 'lib/ripple-rest/generated-schemas.rb', line 221

property :transaction_sequence, :UINT32

#transfer_rateFloat

A number representation of the rate charged each time a holder of currency issued by this account transfers it. By default the rate is 100. A rate of 101 is a 1% charge on top of the amount being transferred. Up to nine decimal places are supported

Returns:

  • (Float)


201
# File 'lib/ripple-rest/generated-schemas.rb', line 201

property :transfer_rate, :Float

#trustline_countString<UINT32>

The number of trustlines owned by this account. This value does not include incoming trustlines where this account has not explicitly reciprocated trust

Returns:

  • (String<UINT32>)


226
# File 'lib/ripple-rest/generated-schemas.rb', line 226

property :trustline_count, :UINT32

#urlURI

The domain associated with this account. The ripple.txt file can be looked up to verify this information

Returns:

  • (URI)


186
# File 'lib/ripple-rest/generated-schemas.rb', line 186

property :url, :URL

Instance Method Details

#savevoid

This method returns an undefined value.

Save the account settings

Raises:

  • (ArgumentError)

    if secret is missing from the Account object

  • (RippleRestError)

    if RippleRest server returns an error

  • (ProtocolError)

    if protocol is wrong or network is down



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ripple-rest/schemas.rb', line 11

def save
  raise ArgumentError.new("Account is missing.") unless 
  
  .require_secret
  
  hash = {}
  hash["settings"] = to_hash
  hash["secret"] = .secret
  
  RippleRest.post "v1/accounts/#{.address}/settings", hash
end