Get Started on EVM
Overview
Ramper's EVM SDK provides an easy wallet solution for developers to integrate into their DApps. Once integrated, your users will be able to log in with a popular OAuth solution and instantly interact with an Ethereum wallet, compatible with ethers.js
Ethers.js compatibility means any chain that works with ethers.js is also compatible with Ramper SDK.
Ramper SDK also provides WalletView component, which provides the DApp with various wallet-related functionalities such as fiat-on-ramp, transaction history and token transfers.
In addition, Ramper's EVM SDK provides native support to connect your DApp with Metamask (more wallet supports coming soon) as well.
See these functions in action at https://example.ramper.xyz/
Install Ramper SDK
Setup ether.js signer
Ramper SDK provides your Dapp an ethers.js Signer object to abstract the wallet operations away from your work scope. It works with any ethers.js-compatible Provider, such as Infura, Alchemy, etc. Unlike Metamask, you do need to set your own Provider up and pass it in to our SDK (see https://docs.ethers.io/v5/api/providers/). This design was to provide maximum control over the DApp infrastructure (e.g. with Metamask you are tied to using Infura, which had various issues)
Install SDK
$ npm i @ramper/ethereumor
$ yarn add @ramper/ethereumUser signup & login
Calling await signIn(walletToUse) launch the log in dialog and return a signInResult when the user successfully logs in or connects an account
Get logged-in user
Send token
The following code demonstrates how to send a token from a wallet belonging to the signed in user or a connected wallet.
Get ethers.js compatible signer
Once you have obtained a Signer, you can use the familiar ethers.js functions to write your DApp. See https://docs.ethers.io/v5/api/signer/ for reference if you aren't already familiar with ethers.js
Both signTransaction and sendTransaction functions are implemented (signMessage coming soon).
Sign out
Users can log out or disconnect their wallet with:
Yup, it really is just that easy!
If there's any feature you would like to see or design patterns you would like for the Ramper team to adopt, come chat with us (see Introduction for ways to reach us).
Boilerplate Example
Our vanilla Javascript SDK is very similar to our ReactJS SDK. Instead of doing an npm i , you can integrate our SDK by importing from our CDN. Afterwards, you just need to interact with the window.ramper global object to gain access to most of the exported methods.
Currently our vanilla JS SDK is in beta preview mode. There are a few minor bugs and refinements needed to reach full parity with our ReactJS SDK so please check back next week for updates. For any SDK design feedback, please contact the Ramper team.
Last updated