openchain-nodejs-ts-yxl 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +66 -0
- package/_config.yml +1 -0
- package/doc/SDK_CN.md +2003 -0
- package/example/atp10TokenDemo.js +319 -0
- package/example/exchange.js +184 -0
- package/example/offlineSignatureDemo.js +83 -0
- package/example/submitTransactionDemo.js +92 -0
- package/index.d.ts +186 -0
- package/index.js +9 -0
- package/lib/account/index.js +234 -0
- package/lib/blockchain/block.js +380 -0
- package/lib/blockchain/transaction.js +264 -0
- package/lib/common/ctp.js +5 -0
- package/lib/common/operation/accountSetMetadata.js +55 -0
- package/lib/common/operation/accountSetPrivilege.js +90 -0
- package/lib/common/operation/activateAccount.js +58 -0
- package/lib/common/operation/contractCreate.js +72 -0
- package/lib/common/operation/contractInvokeByAsset.js +75 -0
- package/lib/common/operation/contractInvokeByBU.js +53 -0
- package/lib/common/operation/createLog.js +44 -0
- package/lib/common/operation/ctp10TokenApprove.js +59 -0
- package/lib/common/operation/ctp10TokenAssign.js +59 -0
- package/lib/common/operation/ctp10TokenChangeOwner.js +58 -0
- package/lib/common/operation/ctp10TokenIssue.js +78 -0
- package/lib/common/operation/ctp10TokenTransfer.js +59 -0
- package/lib/common/operation/ctp10TokenTransferFrom.js +60 -0
- package/lib/common/operation/issueAsset.js +35 -0
- package/lib/common/operation/payAsset.js +62 -0
- package/lib/common/operation/payCoin.js +44 -0
- package/lib/common/util.js +880 -0
- package/lib/contract/index.js +212 -0
- package/lib/crypto/protobuf/bundle.json +1643 -0
- package/lib/exception/customErrors.js +56 -0
- package/lib/exception/errors.js +240 -0
- package/lib/exception/index.js +8 -0
- package/lib/operation/account.js +193 -0
- package/lib/operation/asset.js +106 -0
- package/lib/operation/bu.js +52 -0
- package/lib/operation/contract.js +184 -0
- package/lib/operation/ctp10Token.js +394 -0
- package/lib/operation/index.js +30 -0
- package/lib/operation/log.js +47 -0
- package/lib/sdk.js +70 -0
- package/lib/token/asset.js +79 -0
- package/lib/token/ctp10Token.js +301 -0
- package/lib/token/index.js +17 -0
- package/lib/util/index.js +86 -0
- package/openchain-sdk-nodejs.iml +9 -0
- package/package.json +39 -0
- package/test/Ctp10Token.test.js +96 -0
- package/test/account.test.js +132 -0
- package/test/accountActivateOperation.test.js +99 -0
- package/test/accountSetMetadata.test.js +102 -0
- package/test/accountSetPrivilege.test.js +66 -0
- package/test/asset.test.js +63 -0
- package/test/assetIssueOperation.test.js +77 -0
- package/test/assetSendOperation.test.js +103 -0
- package/test/blob.test.js +128 -0
- package/test/block.test.js +165 -0
- package/test/buSendOperation.test.js +64 -0
- package/test/contract.test.js +64 -0
- package/test/contractCreateOperation.test.js +41 -0
- package/test/contractCreateTransaction.test.js +116 -0
- package/test/contractInvokeByAssetOperation.test.js +109 -0
- package/test/contractInvokeByBUOperation.test.js +107 -0
- package/test/ctp10TokenApproveOperation.test.js +98 -0
- package/test/ctp10TokenAssignOperation.test.js +99 -0
- package/test/ctp10TokenChangeOwnerOperation.test.js +98 -0
- package/test/ctp10TokenIssueOperation.test.js +40 -0
- package/test/ctp10TokenIssueOperationTransaction.test.js +106 -0
- package/test/ctp10TokenTransferFromOperation.test.js +101 -0
- package/test/ctp10TokenTransferOperation.test.js +98 -0
- package/test/log.transaction.test.js +103 -0
- package/test/transaction.test.js +166 -0
- package/test/util.test.js +93 -0
package/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
openchain-sdk-nodejs
|
2
|
+
=======
|
3
|
+
|
4
|
+
Let developers can all use openchain blockchain services more easily.
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
10
|
+
[npm registry](https://www.npmjs.com/).
|
11
|
+
|
12
|
+
Before installing, [download and install Node.js](https://nodejs.org/en/download/).
|
13
|
+
Node.js 6.0.0 or higher is required.
|
14
|
+
|
15
|
+
Installation is done using the
|
16
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
17
|
+
|
18
|
+
```bash
|
19
|
+
$ npm install openchain-sdk-nodejs --save
|
20
|
+
```
|
21
|
+
|
22
|
+
|
23
|
+
## Quick Start
|
24
|
+
|
25
|
+
Create openchain-sdk-nodejs instance:
|
26
|
+
|
27
|
+
```js
|
28
|
+
'use strict';
|
29
|
+
|
30
|
+
const OpenChainSDK = require('openchain-sdk-nodejs');
|
31
|
+
|
32
|
+
const sdk = new OpenChainSDK({
|
33
|
+
host: 'https://seed1-node.openchain.cddao.com',
|
34
|
+
});
|
35
|
+
|
36
|
+
```
|
37
|
+
|
38
|
+
Usage:
|
39
|
+
|
40
|
+
```js
|
41
|
+
// Create account
|
42
|
+
sdk.account.create().then(data => {
|
43
|
+
console.log(data);
|
44
|
+
}).catch(err => {
|
45
|
+
console.log(err.message);
|
46
|
+
});
|
47
|
+
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
## Tests
|
52
|
+
|
53
|
+
To run the test suite, first install the dependencies, then run `npm test`:
|
54
|
+
|
55
|
+
```bash
|
56
|
+
$ npm install
|
57
|
+
$ npm test
|
58
|
+
```
|
59
|
+
|
60
|
+
## Docs
|
61
|
+
|
62
|
+
* [Documentation](doc/SDK_CN.md)
|
63
|
+
|
64
|
+
## License
|
65
|
+
|
66
|
+
[MIT](LICENSE)
|
package/_config.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
theme: jekyll-theme-cayman
|