module Glueby::Internal::RPC

Public Instance Methods

client() click to toggle source
# File lib/glueby/internal/rpc.rb, line 6
def client
  @rpc ||= Tapyrus::RPC::TapyrusCoreClient.new(@config)
end
configure(config) click to toggle source
# File lib/glueby/internal/rpc.rb, line 10
def configure(config)
  @config = config
end
perform_as(wallet) { |client| ... } click to toggle source

Perform RPC call on the specific wallet. This method needs block, and pass a client as as block argument. You can call RPCs on the wallet using the client object. See an example below. @param [string] wallet name on Tapyrus Core Wallet @return [Object] The return object of the block

## Example “`ruby perform_as('mywallet') do |client|

client.getbalance

end “`

# File lib/glueby/internal/rpc.rb, line 26
def perform_as(wallet)
  before = client.config[:wallet]
  client.config[:wallet] = wallet
  yield(client)
ensure
  client.config[:wallet] = before
end