Skip to main content

Ruby One Provider

Ruby One SDK is provided through the @rubyone/jssdk package, with the core class being RubyOneProvider. Before diving deep into how to use the Ruby One SDK, we need to grasp two concepts: Provider and EIP-1193.

https://eips.ethereum.org/EIPS/eip-1193

What is a Provider?

In the Ethereum ecosystem, a Provider is an object that facilitates the interaction of an application with the Ethereum blockchain. In other words, a Provider acts as a communication bridge between a DApp and the Ethereum network. It offers a set of methods to read the blockchain state, send transactions, inquire balances, and more.

In JavaScript libraries such as Web3 and Ethers, the Provider serves as a core component, allowing developers to seamlessly interact with the Ethereum network without diving into the intricate details of the underlying implementation.

What is EIP-1193?

EIP stands for Ethereum Improvement Proposal, representing proposals by the Ethereum community to upgrade or enhance the network. EIP-1193 is a pivotal proposal that defines a JavaScript API for DApps to interact with Ethereum wallets. This API is built on an event-driven model, permitting applications to request user accounts, monitor account and network changes, and send transactions.

Specifically, EIP-1193 mainly outlines:

  • Requesting account access: Applications can ask for user account details.
  • Listening to changes: Applications can listen to changes in accounts and the network.
  • Sending transactions: Applications can request to send transactions.
  • Error and event handling: It defines a range of events and error types.

The emergence of EIP-1193 ensures that Ethereum wallets and DApps have a unified and standard way to interact, enhancing the interoperability within the ecosystem.

RubyOneProvider and EIP-1193

As previously mentioned, the RubyOneProvider is a core class provided by the Ruby One SDK. It adheres to the interface defined by EIP-1193, which implies that any DApp that supports EIP-1193 can utilize the RubyOneProvider to communicate with the Ethereum network.

Put differently, by employing the Ruby One SDK and RubyOneProvider, developers can ensure that their DApp is not only compatible with the Ruby One wallet but also with all other Ethereum wallets in the market that support EIP-1193, such as MetaMask.

You can further explore EIP-1193 and the SDK's API through the official Ethereum documentation. However, most of the time, we collaborate with other libraries, such as the upcoming web3-react and ethers, rather than directly using the raw interface of EIP-1193.

Conclusion

In essence, Ruby One's RubyOneProvider furnishes developers with a robust and flexible tool, making it more straightforward for DApp developers to interact with the Ethereum network. With the standardization introduced by EIP-1193, it guarantees broad interoperability and usability, regardless of the wallet choice of users.