Get Started on Terra
Good to know: Currently, Ramper's Terra SDK only supports React. A stand-alone version is under consideration.
Overview
Ramper's Terra 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 a Terra wallet.
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 Terra SDK provides native support to connect your DApp with TerraStation and WalletConnect (more wallet supports coming soon) as well.
See these functions in action at https://example.ramper.xyz/
Install Ramper SDK
Setup Terra's wallet provider
Terra's Wallet-Provider SDK provides access to TerraStation and WalletConnect. Ramper's SDK interfaces with Terra's Wallet-Provider to support both native wallets.
Follow these steps before continuing: https://github.com/terra-money/wallet-provider/tree/main/packages/src/@terra-money/wallet-provider
Install SDK
or
User signup & login
Calling await signIn(walletToUse)
will launch the log in dialog and return a signInResult when the user successfully logs in or connects an account.
Get logged in user
Check balance
Once logged in, you can check the current coins and tokens balance:
Send token
The following code demonstrates how to send a token from a wallet belonging to the signed in user or a connected wallet.
Send transaction
The following code demonstrates how to send a transaction from a wallet belonging to the signed in user or a connected wallet.
Post Terra.js message transactions
Similar to terra.js CreateAndSignTx method and wallet-provider's post method, Ramper Connect SDK exposes a method called postTransaction to send custom transactions.
More information on constructing custom transactions can be found here: https://terra-money.github.io/terra.js/
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).
Last updated