@chingiz-mardanov/on-ramp-sdk
v0.0.17
Published
## Getting started
Downloads
26
Readme
On-Ramp SDK
Getting started
- Please make sure that there is either a deployed OnRamp API service or you are running it localy. Refer to
Running OnRamp API Locally
section. - Install the SDK package from the archive.
- Import the on ramp sdk with this line of code:
import {OnRampSdk} from '@codefi/on-ramp-sdk'
Note: you might have a different source folder based on where you install it. - Refer to this file for sample usage of the SDK: https://gitlab.com/ConsenSys/codefi/products/metaswap/on-ramp-sdk/-/blob/main/src/OnRampSdkDemo.ts
Running OnRamp API Locally
- Clone the repo from
https://gitlab.com/ConsenSys/codefi/products/metaswap/on-ramp-api/-/tree/develop
- Please make sure to use
develop
branch for more up to date data returned. - Run
npm i
- Add this to the
.env
:TRANSAK_API_KEY=ebbeabce-0dc7-4aed-90b0-dec30f717264
- Run
npm run start
On-Ramp SDK
To facilitate back-end interaction, a SDK can be used.
You can use it like this:
const sdk: IOnRampSdk = await OnRampSdk.getSDK(Environment.Staging, Context.Mobile, {
verbose: true,
maxInstanceCount: 1
})
OnRampSdk.destructInstance(); // Does not actually destroy an instance or garbage collect, only helps keep track of instance count