On-Ramp SDK
Getting started
- Please make sure that there is either a deployed OnRamp API service or you are running it localy.
- Install the SDK package from the archive.
- Import the on ramp sdk with this line of code:
import {OnRampSdk} from '@codefi/on-ramp-sdk'
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,
},
)
Local Development with MetaMask Portfolio
To connect a local instance of the SDK to a local MetaMask Portfolio client, follow these steps:
1. Update SDK Configuration
2. Link SDK to Portfolio
-
In the SDK project directory, run the following command to create a symbolic link:
yarn link
-
In the Portfolio project directory, link the SDK by running:
yarn link @consensys/on-ramp-sdk
-
Remove the cache to ensure the changes take effect:
rm -rf node_modules/.cache
3. Install Dependencies
- In the Portfolio project directory, install the necessary packages:
yarn install
4. Update Vite Configuration
5. Rebuild After SDK Changes
Whenever you make changes to the SDK, remember to rebuild the project to reflect those changes in the Portfolio client:
yarn build