@consensys/native-ramps-sdk

中文文档
2.1.7发布于 2025/12/18ISCTypeScriptCommonJS近 30 天下载 4046

Getting started

此软件包已被标记为弃用

This package is deprecated. Use @metamask/money-mvmt-sdk instead.

原始使用文档
文档目录9 节
  1. Getting started
  2. Installation
  3. Usage
  4. Version Management
  5. Local Development
  6. Building the SDK
  7. Testing Local Changes in Another Project
  8. Development Workflow
  9. Other Useful Commands

Native Ramps SDK

Getting started

Installation

yarn add @consensys/native-ramps-sdk

or

npm install @consensys/native-ramps-sdk

Usage

import { NativeRampsSdk } from '@consensys/native-ramps-sdk'

// Initialize the SDK
const nativeRampsSdk = new NativeRampsSdk()

// Use the SDK methods

Version Management

To update the SDK version:

  1. Update the version number in package.json:

    {
      "version": "1.0.1"
    }
    
  2. Install dependencies to sync the version:

    npm install
    

The SDK automatically uses the version from package.json for all version-related functionality.

Local Development

For local development and testing of the SDK:

Building the SDK

  1. Install dependencies:

    npm install
    
  2. Build the SDK:

    npm run build
    

    This will:

    • Compile TypeScript files to JavaScript
    • Generate type declarations (.d.ts files)
    • Output everything to the dist/ directory

Testing Local Changes in Another Project

To test your local changes in another project without publishing:

  1. Build the SDK (as shown above)

  2. Copy the entire dist/ folder to your target project's node_modules/@consensys/native-ramps-sdk/ directory:

    # From your target project directory
    cp -r /path/to/native-ramps-sdk/dist/* ./node_modules/@consensys/native-ramps-sdk/dist/
    
  3. Alternatively, you can use npm link for a more seamless development experience:

    # In the SDK directory
    npm link
    
    # In your target project directory
    npm link @consensys/native-ramps-sdk
    

Development Workflow

  1. Make changes to the source code in src/
  2. Run npm run build to compile your changes
  3. Copy the updated dist/ files to your test project or use npm link
  4. Test your changes in the target project
  5. Repeat as needed

Other Useful Commands

  • npm run test - Run tests
  • npm run lint - Check code style
  • npm run prettier - Format code
  • npm run test:watch - Run tests in watch mode

版本与发布记录

@consensys/native-ramps-sdk 共发布 31 个版本,首次发布于 2025/05/20;过去 12 个月发布了 1 个版本。

版本发布日期距今
2.1.7latest2025/12/1810 个月前
2.1.62025/10/291 年前
2.1.52025/10/161.1 年前
2.1.42025/10/161.1 年前
2.1.32025/10/101.1 年前
2.1.22025/10/021.1 年前

关于 @consensys/native-ramps-sdk 的常见问题

@consensys/native-ramps-sdk 是什么?

Getting started注意:该包已被作者标记为弃用——This package is deprecated. Use @metamask/money-mvmt-sdk instead.

如何安装 @consensys/native-ramps-sdk?

在项目目录运行 npm install @consensys/native-ramps-sdk,或使用 pnpm add / yarn add / bun add。

@consensys/native-ramps-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@consensys/native-ramps-sdk 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@consensys/native-ramps-sdk 可以商用吗?

@consensys/native-ramps-sdk 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@consensys/native-ramps-sdk 的下载量有多少?

根据 npm 官方下载统计,@consensys/native-ramps-sdk 在 2026/10/11 – 2026/11/09 这 30 天内被下载 4,046 次,日均约 135 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@consensys/native-ramps-sdk 还在维护吗?

最新版本 2.1.7 发布于 2025/12/18(10 个月前);至今共发布 31 个版本,其中过去 12 个月发布了 1 个;首次发布于 2025/05/20。作者已将其标记为弃用,新项目建议寻找替代方案。