Module: Digitalbits
- Includes:
- DSL
- Defined in:
- lib/digitalbits/dsl.rb,
lib/digitalbits/asset.rb,
lib/digitalbits/price.rb,
lib/digitalbits/convert.rb,
lib/digitalbits/version.rb,
lib/digitalbits/key_pair.rb,
lib/digitalbits/networks.rb,
lib/digitalbits/operation.rb,
lib/digitalbits/ledger_key.rb,
lib/digitalbits/signer_key.rb,
lib/digitalbits/thresholds.rb,
lib/digitalbits/transaction.rb,
lib/digitalbits/util/strkey.rb,
lib/digitalbits/account_flags.rb,
lib/digitalbits/muxed_account.rb,
lib/digitalbits/transaction_v0.rb,
lib/digitalbits/claim_predicate.rb,
lib/digitalbits/trust_line_flags.rb,
lib/digitalbits/transaction_builder.rb,
lib/digitalbits/fee_bump_transaction.rb,
lib/digitalbits/transaction_envelope.rb,
lib/digitalbits/path_payment_strict_receive_result.rb
Defined Under Namespace
Modules: Concerns, Convert, DSL, Networks, Util Classes: AccountFlags, Asset, ClaimPredicate, FeeBumpTransaction, KeyPair, LedgerKey, MuxedAccount, Operation, PathPaymentStrictReceiveResult, Price, SignerKey, Thresholds, Transaction, TransactionBuilder, TransactionEnvelope, TransactionV0, TrustLineFlags
Constant Summary collapse
- ONE =
1_0000000- Deprecation =
ActiveSupport::Deprecation.new("next release", "digitalbits-base")
- VERSION =
"0.27.2"
Class Method Summary collapse
-
.current_network ⇒ Object
Returns the passphrase for the network currently active per-thread with a fallback to
Digitalbits.default_network. -
.current_network_id ⇒ Object
Returns the id for the currently configured network, suitable for use in generating a signature base string or making the root account’s keypair.
-
.on_network(passphrase, &block) ⇒ Object
Executes the provided block in the context of the provided network.
Methods included from DSL
Asset, ClaimPredicate, Claimant, KeyPair, SignerKey
Class Method Details
.current_network ⇒ Object
Returns the passphrase for the network currently active per-thread with a fallback to Digitalbits.default_network
25 26 27 |
# File 'lib/digitalbits/networks.rb', line 25 def self.current_network network.presence || default_network end |
.current_network_id ⇒ Object
Returns the id for the currently configured network, suitable for use in generating a signature base string or making the root account’s keypair.
31 32 33 |
# File 'lib/digitalbits/networks.rb', line 31 def self.current_network_id Digest::SHA256.digest(current_network) end |
.on_network(passphrase, &block) ⇒ Object
Executes the provided block in the context of the provided network.
36 37 38 39 40 41 42 |
# File 'lib/digitalbits/networks.rb', line 36 def self.on_network(passphrase, &block) old = network self.network = passphrase block.call ensure self.network = old end |