On/Off Ramp
Overview
To complete on/off-ramp operations through the Portkey SDK, Portkey currently partners with service provider ACH and we will gradually add more ramp service providers.
What can be done using ACH's on/off-ramp services:
Users can directly use fiat currency to purchase cryptos or sell cryptos directly for fiat.
Cryptocurrencies: Currently, only the ELF token is supported.
Fiat currencies:
- Deposit supports 41 types of fiat currency: AED, ARS, AUD, BGN, BRL, CAD, CHF, CLP, COP, DKK, EUR, GBP, HKD, HRK, HUF, IDR, ILS, INR, JPY, KRW, KZT, MDL, MKD, MXN, MYR, NGN, NOK, NZD, PEN, PHP, PKR, PLN, RON, SEK, SGD, THB, TRY, TWD, USD, VND, ZAR.
- Withdrawal supports 21 types of fiat currency: ARS, AUD, CAD, CLP, COP, EUR, GBP, HKD, IDR, INR, JPY, KRW, LKR, MXN, MYR, PEN, PHP, SGD, THB, USD, UYU.
UI SDK
Ramp Page
Please refer to Ramp for detailed instructions
Reference Example
import {
ConfigProvider,
PortkeyAssetProvider,
Ramp,
} from "@portkey/did-ui-react";
import router from "next/router";
import { Store } from "../../utils";
const myStore = new Store();
ConfigProvider.setGlobalConfig({
storageMethod: myStore,
});
export default function RampPage() {
return (
<div>
<PortkeyAssetProvider originChainId="AELF" pin="111111">
<Ramp
onBack={function (): void {
// do something to show the last page
}}
onShowPreview={function ({ initState, chainId }): void {
// do something to jump to the preview transaction details page
}}
tokenInfo={{
decimals: 8,
chainId: "AELF",
symbol: "ELF",
tokenContractAddress:
"JRmBduh4nXWi1aXgdUsj5gJrzeZb2LxmrAbf7W99faZSvoAaE",
}}
isMainnet={true}
/>
</PortkeyAssetProvider>
</div>
);
}
UI Example
Ramp Preview Page
Please refer to RampPreview for detailed instructions
Reference Example
import { ConfigProvider, IRampPreviewInitState, PortkeyAssetProvider, RampPreview } from '@portkey/did-ui-react';
import { useEffect, useState } from 'react';
function RampPreviewPage() {
return (
<div>
<PortkeyAssetProvider originChainId="AELF" pin="111111">
<RampPreview
initState={{
crypto: string;
network: string;
fiat: string;
country: string;
amount: string;
side: 'BUY' | 'SELL';
}}
chainId={chainId}
portkeyServiceUrl="https://localtest-applesign.portkey.finance"
goBack={function (): void {
// do something to show the last page
}}
/>
</PortkeyAssetProvider>
</div>
);
}