New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@consensys/on-ramp-sdk

Package Overview
Dependencies
Maintainers
15
Versions
223
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@consensys/on-ramp-sdk

## Getting started

  • 2.0.7
  • latest
  • npm
  • Socket score

Version published
Maintainers
15
Created
Source

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

  1. Open the tsconfig.json file in the SDK project.
  2. Modify the module and moduleResolution properties as follows:
    {
      "compilerOptions": {
        "module": "esnext",
        "moduleResolution": "node"
        // other configurations
      }
    }
    
  1. In the SDK project directory, run the following command to create a symbolic link:

    yarn link
    
  2. In the Portfolio project directory, link the SDK by running:

    yarn link @consensys/on-ramp-sdk
    
  3. Remove the cache to ensure the changes take effect:

    rm -rf node_modules/.cache
    

3. Install Dependencies

  1. In the Portfolio project directory, install the necessary packages:
    yarn install
    

4. Update Vite Configuration

  1. Open the vite.config.js file in the Portfolio project.
  2. Add the following configuration to exclude the SDK from dependency optimization:
    export default {
      // other configurations
      optimizeDeps: {
        exclude: ['@consensys/on-ramp-sdk'],
      },
    }
    

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

FAQs

Package last updated on 18 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc