Skip to main content

Ronin Waypoint Web Utilities SDK

Overview

The Ronin Waypoint offers various utilities to assist dapp developers in building applications with ease and convenience.

  • The Ronin Waypoint Web Utilities SDK provides a simple way to integrate the Onramp service into your games / dapps through the @sky-mavis/waypoint/deposit package.
deposit-pop-updeposit-pop-up

Features

Fiat Onramp Service: Allow users to purchase cryptocurrencies directly within your games / dApps using fiat currencies via different payment methods such as card, bank transfer and other local payment methods...through the Ronin Waypoint service

Prerequisites

Permission to use the Sky Mavis Account service. For more information, see Setup and configuration.

Installation

To install the SDK, use the following command:

npm install @sky-mavis/waypoint
# or
yarn add @sky-mavis/waypoint
# or
pnpm add @sky-mavis/waypoint

Usage

Onramp service

The @sky-mavis/waypoint/deposit package simplifies the integration of the Onramp service, allowing users to buy cryptocurrencies using traditional payment methods like credit cards and bank transfers.

Initialize an instance from the Deposit class

import { Deposit } from '@sky-mavis/waypoint/deposit';

const deposit = new Deposit({
clientId: '<client_id>'
});

Parameters for the Deposit class include:

FieldRequired?Description
clientIdRequiredThe client ID from the Developer Console. For more information, see Waypoint service settings.
redirectUriOptionalEquivalent to the REDIRECT URI configured in Waypoint service settings. Default is window.location.origin.
themeOptionalThe theme of the deposit modal. Available values are light and dark.

Open the deposit pop-up

To open the deposit pop-up, call the start method:

deposit.start();

The start method also accepts an object with the following parameters to pre-fill the user's information:

FieldRequired?Description
walletAddressOptionalThe Ronin wallet address of the customer.
fiatAmountOptionalThe initial amount of fiat currency you want the customer to buy cryptocurrency.
fiatCurrencyOptionalThe code of the fiat currency you want the customer to buy cryptocurrency, e.g. USD, EUR, VND etc. For more information, see Fiat Currency Coverage.
cryptoCurrencyOptionalThe code of the cryptocurrency you want the customer to buy, e.g RON, SLP, AXS etc. For more information, see Crypto Currency Coverage.
emailOptionalThe email that will be used to identify your customer and their order.
warning

In the Ramp provider, when a user enters their wallet address manually, the address must include the ronin: prefix. For example, ronin:1234567890abcdef1234567890abcdef12345678.

The start method returns a Promise that resolves with an object containing the transaction details.

FieldDescription
providerThe provider used for the transaction.
transactionHashThe hash of the transaction.
fiatCurrencyThe fiat currency used in the transaction.
cryptoCurrencyThe cryptocurrency used in the transaction.
fiatAmountThe amount of fiat currency involved in the transaction.
cryptoAmountThe amount of cryptocurrency involved in the transaction.

If the transaction is failed or cancelled, the Promise will reject with an object containing the error details.

FieldDescription
codeThe error code indicating the type of error.
messageThe reason for the error or cancellation.

The deposit error codes are as follows:

CodeDescription
4001The user has closed the deposit pop-up.
-32603The deposit transaction has failed.

Sample code

Here is an example of how to implement Onramp service in your application:

Step 1: Initialize an instance from the Deposit class
import { Deposit } from '@sky-mavis/waypoint/deposit';

export const deposit = new Deposit({
clientId: '4d24b378-aa36-4952-8faa-bda63c9a4932',
})
Step 2: Open the deposit pop-up
Live Editor
function StartDeposit() {
  const [result, setResult] = useState(null);

  const handleDeposit = async () => {
    try {
      const result = await deposit.start({
        fiatCurrency: 'USD',
        cryptoCurrency: 'RON',
        fiatAmount: 100
      });
      setResult(result);
    } catch (error) {
      alert(error);
    }
  };

  return (
    <LayoutBox>
      <Button label='Deposit with Ronin Waypoint' onClick={handleDeposit} />
      {result && (
        <span>{`You have deposited ${result.cryptoAmount} ${result.cryptoCurrency} to your Wallet`}</span>
      )}
    </LayoutBox>
  );
}
Result
Loading...

Coverage and reference

Onramp Service

Crypto Currency Coverage

The cryptocurrencies we support for our onramp service are as follows
CryptocurrencyCode
RoninRON
Axie Infinity ShardAXS
Smooth Love PotionSLP
USD CoinUSDC
Ronin Wrapped EtherWETH
PIXELPIXEL
BANANABANANA
ApeirosAPRS

Fiat Currency Coverage

The fiat currencies we support for our onramp service are as follows
Currency NameCurrency Code
US DollarUSD
British PoundGBP
Indian RupeeINR
EuroEUR
Swiss FrancCHF
Swedish KronaSEK
Polish ZlotyPLN
Norwegian KroneNOK
Danish KroneDKK
New Zealand DollarNZD
Mexican PesoMXN
Canadian DollarCAD
Australian DollarAUD
Argentine PesoARS
Brazilian RealBRL
Chilean PesoCLP
Costa Rican ColonCRC
Dominican PesoDOP
Indonesian RupiahIDR
Israeli ShekelILS
Japanese YenJPY
South Korean WonKRW
Malaysian RinggitMYR
Paraguayan GuaraniPYG
Peruvian SolPEN
Philippine PesoPHP
Singapore DollarSGD
Fiji DollarFJD
ForintHUF
Kenyan ShillingKES
Moldovan LeuMDL
Bermudian DollarBMD
Falkland Islands PoundFKP
Czech KorunaCZK
Iceland KronaISK
Romanian LeuRON
KwanzaAOA
Belize DollarBZD
Brunei DollarBND
Comoro FrancKMF
Djibouti FrancDJF
East Caribbean DollarXCD
LariGEL
QuetzalGTQ
LempiraHNL
Hong Kong DollarHKD
TengeKZT
SomKGS
Malagasy AriaryMGA
KwachaMWK
OuguiyaMRU
Rial OmaniOMR
KinaPGK
Rwanda FrancRWF
DobraSTN
Seychelles RupeeSCR
Solomon Islands DollarSBD
Surinam DollarSRD
LilangeniSZL
SomoniTJS
Pa’angaTOP
Turkmenistan New ManatTMT
Peso UruguayoUYU
Colombian PesoCOP
Taiwanese DollarTWD
Ghanaian CediGHS
UAE DirhamAED
Cambodian RielKHR
Serbian DinarRSD
Bahraini DinarBHD
Macedonian DenarMKD
Kuwaiti DinarKWD
Armenian DramAMD
Netherlands Antilles GuilderANG
Azerbaijani ManatAZN
Bahamian DollarBSD
Cayman Islands DollarKYD
Cape Verdean EscudoCVE
BH Convertible MarkBAM
Jordanian DinarJOD
Trinidad & Tobago DollarTTD
Panamanian BalboaPAB
Algerian DinarDZD
Bulgarian LevBGN
Egyptian PoundEGP
Sri Lankan RupeeLKR
Nigerian NairaNGN
Thai BahtTHB
Turkish LiraTRY
Vietnamese DongVND
South African RandZAR
Botswana PulaBWP
Mozambican MeticalMZN
Lao KipLAK