Class: Solana::Ruby::Kit::Rpc::Client
- Inherits:
-
Object
- Object
- Solana::Ruby::Kit::Rpc::Client
- Extended by:
- T::Sig
- Includes:
- Api::GetAccountInfo, Api::GetBalance, Api::GetBlockHeight, Api::GetEpochInfo, Api::GetLatestBlockhash, Api::GetMinimumBalanceForRentExemption, Api::GetMultipleAccounts, Api::GetProgramAccounts, Api::GetSignatureStatuses, Api::GetSlot, Api::GetTokenAccountBalance, Api::GetTokenAccountsByOwner, Api::GetTransaction, Api::GetVoteAccounts, Api::IsBlockhashValid, Api::RequestAirdrop, Api::SendTransaction, Api::SimulateTransaction
- Defined in:
- lib/solana/ruby/kit/rpc/client.rb
Overview
Solana JSON-RPC client. Mirrors TypeScript’s Rpc object created by ‘createSolanaRpc(url)`.
Includes every API method as a mixin so the class surface exactly matches the TypeScript package’s method set. The transport accessor provides sub-modules with the HTTP connection.
Constant Summary
Constants included from Api::GetAccountInfo
Api::GetAccountInfo::SUPPORTED_ENCODINGS
Instance Attribute Summary collapse
-
#transport ⇒ Object
readonly
Returns the value of attribute transport.
Instance Method Summary collapse
-
#initialize(cluster_url, headers: {}, timeout: Transport::DEFAULT_TIMEOUT, open_timeout: Transport::DEFAULT_OPEN_TIMEOUT) ⇒ Client
constructor
A new instance of Client.
Methods included from Api::SimulateTransaction
Methods included from Api::GetVoteAccounts
Methods included from Api::GetEpochInfo
Methods included from Api::GetTokenAccountsByOwner
Methods included from Api::GetTokenAccountBalance
Methods included from Api::GetTransaction
Methods included from Api::GetProgramAccounts
Methods included from Api::GetMultipleAccounts
Methods included from Api::GetMinimumBalanceForRentExemption
#get_minimum_balance_for_rent_exemption
Methods included from Api::IsBlockhashValid
Methods included from Api::RequestAirdrop
Methods included from Api::SendTransaction
Methods included from Api::GetSignatureStatuses
Methods included from Api::GetBlockHeight
Methods included from Api::GetAccountInfo
Methods included from Api::GetLatestBlockhash
Methods included from Api::GetBalance
Methods included from Api::GetSlot
Constructor Details
#initialize(cluster_url, headers: {}, timeout: Transport::DEFAULT_TIMEOUT, open_timeout: Transport::DEFAULT_OPEN_TIMEOUT) ⇒ Client
Returns a new instance of Client.
74 75 76 77 78 79 80 |
# File 'lib/solana/ruby/kit/rpc/client.rb', line 74 def initialize(cluster_url, headers: {}, timeout: Transport::DEFAULT_TIMEOUT, open_timeout: Transport::DEFAULT_OPEN_TIMEOUT) url = cluster_url.respond_to?(:url) ? cluster_url.url : cluster_url.to_s @transport = T.let( Transport.new(url: url, headers: headers, timeout: timeout, open_timeout: open_timeout), Transport ) end |
Instance Attribute Details
#transport ⇒ Object (readonly)
Returns the value of attribute transport.
61 62 63 |
# File 'lib/solana/ruby/kit/rpc/client.rb', line 61 def transport @transport end |