1.0.1 • Published 3 years ago

istring-lib v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

简介

Istring Nodejs Lib

详情请访问官方网站https://www.istring.com

使用方案请参参考 test 文件案例

资料

使用

API_KEY (长度为 18)和 PLATFORM_PUBLIC_KEY 由平台提供

istring_private.pem 为本地私钥地址

npm i --save istring-lib
const Istring = require('istring-lib');

const API_KEY = 'XXXXXXXXXXXXXXXXXX';
const PLATFORM_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----\nXXXXXXXXXXXX\n-----END PUBLIC KEY-----\n';
const CHAR_ENCODE_UTF_8 = 'utf8';

const privatePath = path.join(__dirname, '../pem/istring_private.pem');

const main = async function () {
  const istring = new Istring({
    apiKey: API_KEY,
    platformPublicKey: PLATFORM_PUBLIC_KEY,
    charEncode: CHAR_ENCODE_UTF_8,
    privatePath,
  });
  // 创建地址
  const res = await istring.createAddress('ETH', 1);
};

main();