dotwallet
v0.1.6
Published
A DotWallet helper library
Downloads
37
Maintainers
Readme
dotwallet-node
Documentation
The documentation for the DotWallet API can be found here.
The Node library documentation can be found here.
Versions
dotwallet-node
uses a modified version of Semantic Versioning for all changes. See this document for details.
Supported Node.js Versions
This library supports the following Node.js implementations:
- Node.js 10
- Node.js 12
- Node.js 13
TypeScript is supported for TypeScript version 1.0 and above.
Sample Usage
Check out these code examples in JavaScript and TypeScript to get up and running quickly.
Environment Variables
dotwallet-node
supports credential storage in environment variables. If no credentials are provided when instantiating the Twilio client (e.g., const client = require('dotwallet')();
).
Getting help
If you need help installing or using the library, please check the DotWallet Support Help Center first.
If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo!
Contributing
Bug fixes, docs, and library improvements are always welcome. Please refer to our Contributing Guide for detailed information on how you can contribute.
⚠️ Please be aware that a large share of the files are auto-generated by our backend tool. You are welcome to suggest changes and submit PRs illustrating the changes. However, we'll have to make the changes in the underlying tool. You can find more info about this in the Contributing Guide.
If you're not familiar with the GitHub pull request/contribution process, this is a nice tutorial.
Getting Started
If you want to familiarize yourself with the project, you can start by forking the repository and cloning it in your local development environment. The project requires Node.js to be installed on your machine.
After cloning the repository, install the dependencies by running the following command in the directory of your cloned repository:
npm install --save dotwallet
Use Demo
1.托管账户数据上链 目前支持的最大上链数据大小1M,这个大小限制近期会不断更新。
const DW = require('dotwallet');
const testAppID = '5a192d599b0be66bdb2ef72784acb0f8';
const testAppSecret = 'b71557823ce2b25d07fb186368999181';
const merchant = new DW.DWMerchant(testAppID, testAppSecret);
//显示托管账户地址
const depositAddr = await merchant.DepositAddress();
//使用此接口查询托管账户余额
const balance = await merchant.DepositBalance();
//托管账户数据上链
const opreturn1 = "this is test push chain data.";
const result = await merchant.PushChainData(opreturn1);
2.非托管账户数据上链
const DW = require('dotwallet');
const opreturn1 = "this is test push chain data.";
//打点钱包用户的邮箱地址
const email = "[email protected]";
//签名的回调服务器地址
const signCallBack = "http://192.168.17.218:9876/";
const result = await DW.PushChainData(email, signCallBack, opreturn1);