Skip to main content

@portkey/ramp

Introduction

@portkey/ramp is a basic TypeScript library that integrates multiple on/off-ramp services. This package provides interfaces and basic methods related to the buying and selling services of cryptocurrencies like USDT, allowing for easy integration of on/off-ramp services into your application.
Currently integrated on/off-ramp service providers include Alchemy Pay and Transak.

Installation

npm install @portkey/ramp

initialization

ramp.init({
requestConfig: {
baseURL: "https://....",
socketUrl: "https://....",
headers: {
"Client-Type": "ThirdParty",
Authorization: token,
},
},
});

API

You can call the interface request method in the ramp instance to obtain relevant data:

Instance methodUse case
ramp.service.getRampInfoObtain basic information of on/off-ramp service providers, such as name, appId, availability of buy/sell services, service provider callback URL, icon of the supported payment, etc.
ramp.service.getBuyCryptoDataObtain information about the cryptocurrencies supported by the on-ramp service.
ramp.service.getBuyFiatDataObtain information about the fiat currencies supported by the on-ramp service.
ramp.service.getBuyLimitObtain the minimum purchase limit.
ramp.service.getBuyExchangeObtain the exchange rate between cryptocurrencies and fiat currencies.
ramp.service.getBuyPriceEstimate the quantity of cryptocurrencies to be received after purchase, which may slightly differ from the actual received amount.
ramp.service.getBuyDetailObtain information about on-ramp service providers.
ramp.service.getSellCryptoDataObtain information about the cryptocurrencies supported by the off-ramp service.
ramp.service.getSellFiatDataObtain information about the fiat currencies supported by the off-ramp service.
ramp.service.getSellLimitObtain the minimum selling limit.
ramp.service.getSellExchangeObtain the exchange rate between cryptocurrencies and fiat currencies.
ramp.service.getSellPriceEstimate the quantity of fiat currencies to be received after selling, which may slightly differ from the actual received amount.
ramp.service.getSellDetailObtain information about off-ramp service providers.
ramp.service.getOrderNoObtain the order ID.
ramp.service.sendSellTransactionExecute the sell transaction.