@klgd/unisat-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.3.2 • Public • Published

UniSat Wallet SDK

安装

npm i @klgd/unisat-sdk

使用

// Using ES6 modules with Babel or TypeScript
import { Wallet, AddressType, NetworkType } from '@klgd/unisat-sdk';

// Using CommonJS modules
const { Wallet, AddressType, NetworkType } = require('@klgd/unisat-sdk');

const WIF = '';
const wallet = new Wallet(WIF, AddressType.P2TR, NetworkType.MAINNET);

设置代理

某些情况下,需要使用到代理,这里用到 cross-fetch https-proxy-agent 两个包

安装

npm i https-proxy-agent@^6 cross-fetch

使用

// import before @klgd/unisat-sdk
global.fetch = null;
// Using ES6 modules
import 'cross-fetch/polyfill';

// Using CommonJS modules
require('cross-fetch/polyfill');

// Using ES6 modules
import { HttpsProxyAgent } from 'https-proxy-agent';

// Using CommonJS modules
const { HttpsProxyAgent } = require("https-proxy-agent")

global.agent = new HttpsProxyAgent('代理地址');

浏览器端使用


Readme

Keywords

none

Package Sidebar

Install

npm i @klgd/unisat-sdk

Weekly Downloads

0

Version

1.3.2

License

ISC

Unpacked Size

332 kB

Total Files

50

Last publish

Collaborators

  • klgd