mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
feat(ESM): Converted code base to ESM format, away from CommonJS
This commit is contained in:
@@ -31,8 +31,8 @@ Here are two YouTube walk-through videos to help you get started:
|
|||||||
|
|
||||||
- Instantiate the library in your code:
|
- Instantiate the library in your code:
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
const BCHJS = require("@psf/bch-js")
|
import BCHJS from "@psf/bch-js"
|
||||||
let bchjs = new BCHJS() // Defaults to BCHN network.
|
let bchjs = new BCHJS() // Defaults to BCHN network.
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -51,8 +51,8 @@ rate limits when interacting with the back end server. See [this article](https:
|
|||||||
- Implicitly: bch-js will detect your JWT token if you set the `BCHJSTOKEN` environment variable.
|
- Implicitly: bch-js will detect your JWT token if you set the `BCHJSTOKEN` environment variable.
|
||||||
- Explicitly: You can directly feed in the JWT token with the `apiToken` property when instantiating the library. Here is an example:
|
- Explicitly: You can directly feed in the JWT token with the `apiToken` property when instantiating the library. Here is an example:
|
||||||
|
|
||||||
```
|
```javascript
|
||||||
const BCHJS = require("@psf/bch-js")
|
import BCHJS from "@psf/bch-js"
|
||||||
let bchjs = new BCHJS({
|
let bchjs = new BCHJS({
|
||||||
restURL: 'https://bchn.fullstack.cash/v5/',
|
restURL: 'https://bchn.fullstack.cash/v5/',
|
||||||
apiToken: 'eyJhbGciO...' // Your JWT token here.
|
apiToken: 'eyJhbGciO...' // Your JWT token here.
|
||||||
|
|||||||
Generated
+483
@@ -36,6 +36,8 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"apidoc": "0.50.5",
|
"apidoc": "0.50.5",
|
||||||
|
"assert": "^2.1.0",
|
||||||
|
"c8": "^10.1.3",
|
||||||
"chai": "4.1.2",
|
"chai": "4.1.2",
|
||||||
"husky": "4.3.8",
|
"husky": "4.3.8",
|
||||||
"lodash.clonedeep": "4.5.0",
|
"lodash.clonedeep": "4.5.0",
|
||||||
@@ -313,6 +315,16 @@
|
|||||||
"node": ">=6.9.0"
|
"node": ">=6.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@bcoe/v8-coverage": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@chris.troutner/bip32-utils": {
|
"node_modules/@chris.troutner/bip32-utils": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/@chris.troutner/bip32-utils/-/bip32-utils-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/@chris.troutner/bip32-utils/-/bip32-utils-1.0.5.tgz",
|
||||||
@@ -789,6 +801,109 @@
|
|||||||
"js-yaml": "bin/js-yaml.js"
|
"js-yaml": "bin/js-yaml.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@isaacs/cliui": {
|
||||||
|
"version": "8.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||||
|
"integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^5.1.2",
|
||||||
|
"string-width-cjs": "npm:string-width@^4.2.0",
|
||||||
|
"strip-ansi": "^7.0.1",
|
||||||
|
"strip-ansi-cjs": "npm:strip-ansi@^6.0.1",
|
||||||
|
"wrap-ansi": "^8.1.0",
|
||||||
|
"wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@isaacs/cliui/node_modules/ansi-regex": {
|
||||||
|
"version": "6.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
|
||||||
|
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@isaacs/cliui/node_modules/ansi-styles": {
|
||||||
|
"version": "6.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
|
||||||
|
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@isaacs/cliui/node_modules/emoji-regex": {
|
||||||
|
"version": "9.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
|
||||||
|
"integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@isaacs/cliui/node_modules/string-width": {
|
||||||
|
"version": "5.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
|
||||||
|
"integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"eastasianwidth": "^0.2.0",
|
||||||
|
"emoji-regex": "^9.2.2",
|
||||||
|
"strip-ansi": "^7.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@isaacs/cliui/node_modules/strip-ansi": {
|
||||||
|
"version": "7.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz",
|
||||||
|
"integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@isaacs/cliui/node_modules/wrap-ansi": {
|
||||||
|
"version": "8.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
|
||||||
|
"integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^6.1.0",
|
||||||
|
"string-width": "^5.0.1",
|
||||||
|
"strip-ansi": "^7.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@istanbuljs/load-nyc-config": {
|
"node_modules/@istanbuljs/load-nyc-config": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz",
|
||||||
@@ -1209,6 +1324,17 @@
|
|||||||
"@octokit/openapi-types": "^18.0.0"
|
"@octokit/openapi-types": "^18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@pkgjs/parseargs": {
|
||||||
|
"version": "0.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
||||||
|
"integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@pnpm/config.env-replace": {
|
"node_modules/@pnpm/config.env-replace": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz",
|
||||||
@@ -1560,6 +1686,13 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/istanbul-lib-coverage": {
|
||||||
|
"version": "2.0.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
|
||||||
|
"integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/json-schema": {
|
"node_modules/@types/json-schema": {
|
||||||
"version": "7.0.15",
|
"version": "7.0.15",
|
||||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||||
@@ -2231,6 +2364,20 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/assert": {
|
||||||
|
"version": "2.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/assert/-/assert-2.1.0.tgz",
|
||||||
|
"integrity": "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind": "^1.0.2",
|
||||||
|
"is-nan": "^1.3.2",
|
||||||
|
"object-is": "^1.1.5",
|
||||||
|
"object.assign": "^4.1.4",
|
||||||
|
"util": "^0.12.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/assertion-error": {
|
"node_modules/assertion-error": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
|
||||||
@@ -2636,6 +2783,176 @@
|
|||||||
"integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==",
|
"integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/c8": {
|
||||||
|
"version": "10.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz",
|
||||||
|
"integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@bcoe/v8-coverage": "^1.0.1",
|
||||||
|
"@istanbuljs/schema": "^0.1.3",
|
||||||
|
"find-up": "^5.0.0",
|
||||||
|
"foreground-child": "^3.1.1",
|
||||||
|
"istanbul-lib-coverage": "^3.2.0",
|
||||||
|
"istanbul-lib-report": "^3.0.1",
|
||||||
|
"istanbul-reports": "^3.1.6",
|
||||||
|
"test-exclude": "^7.0.1",
|
||||||
|
"v8-to-istanbul": "^9.0.0",
|
||||||
|
"yargs": "^17.7.2",
|
||||||
|
"yargs-parser": "^21.1.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"c8": "bin/c8.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"monocart-coverage-reports": "^2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"monocart-coverage-reports": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/brace-expansion": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"balanced-match": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/cliui": {
|
||||||
|
"version": "8.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||||
|
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"string-width": "^4.2.0",
|
||||||
|
"strip-ansi": "^6.0.1",
|
||||||
|
"wrap-ansi": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/foreground-child": {
|
||||||
|
"version": "3.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz",
|
||||||
|
"integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"cross-spawn": "^7.0.6",
|
||||||
|
"signal-exit": "^4.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/glob": {
|
||||||
|
"version": "10.4.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
|
||||||
|
"integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"foreground-child": "^3.1.0",
|
||||||
|
"jackspeak": "^3.1.2",
|
||||||
|
"minimatch": "^9.0.4",
|
||||||
|
"minipass": "^7.1.2",
|
||||||
|
"package-json-from-dist": "^1.0.0",
|
||||||
|
"path-scurry": "^1.11.1"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"glob": "dist/esm/bin.mjs"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/minimatch": {
|
||||||
|
"version": "9.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||||
|
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"brace-expansion": "^2.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/signal-exit": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/test-exclude": {
|
||||||
|
"version": "7.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.1.tgz",
|
||||||
|
"integrity": "sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@istanbuljs/schema": "^0.1.2",
|
||||||
|
"glob": "^10.4.1",
|
||||||
|
"minimatch": "^9.0.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/yargs": {
|
||||||
|
"version": "17.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||||
|
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"cliui": "^8.0.1",
|
||||||
|
"escalade": "^3.1.1",
|
||||||
|
"get-caller-file": "^2.0.5",
|
||||||
|
"require-directory": "^2.1.1",
|
||||||
|
"string-width": "^4.2.3",
|
||||||
|
"y18n": "^5.0.5",
|
||||||
|
"yargs-parser": "^21.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/c8/node_modules/yargs-parser": {
|
||||||
|
"version": "21.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
|
||||||
|
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/caching-transform": {
|
"node_modules/caching-transform": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz",
|
||||||
@@ -3722,6 +4039,13 @@
|
|||||||
"safe-buffer": "~5.1.0"
|
"safe-buffer": "~5.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/eastasianwidth": {
|
||||||
|
"version": "0.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
|
||||||
|
"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/ecashaddrjs": {
|
"node_modules/ecashaddrjs": {
|
||||||
"version": "1.0.7",
|
"version": "1.0.7",
|
||||||
"resolved": "https://registry.npmjs.org/ecashaddrjs/-/ecashaddrjs-1.0.7.tgz",
|
"resolved": "https://registry.npmjs.org/ecashaddrjs/-/ecashaddrjs-1.0.7.tgz",
|
||||||
@@ -6568,6 +6892,23 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-nan": {
|
||||||
|
"version": "1.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz",
|
||||||
|
"integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"call-bind": "^1.0.0",
|
||||||
|
"define-properties": "^1.1.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/is-negative-zero": {
|
"node_modules/is-negative-zero": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz",
|
||||||
@@ -7015,6 +7356,22 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jackspeak": {
|
||||||
|
"version": "3.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz",
|
||||||
|
"integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BlueOak-1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"@isaacs/cliui": "^8.0.2"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@pkgjs/parseargs": "^0.11.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/java-properties": {
|
"node_modules/java-properties": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/java-properties/-/java-properties-1.0.2.tgz",
|
||||||
@@ -7852,6 +8209,16 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/minipass": {
|
||||||
|
"version": "7.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
|
||||||
|
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/mocha": {
|
"node_modules/mocha": {
|
||||||
"version": "9.2.1",
|
"version": "9.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz",
|
||||||
@@ -11345,6 +11712,13 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/package-json-from-dist": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BlueOak-1.0.0"
|
||||||
|
},
|
||||||
"node_modules/parent-module": {
|
"node_modules/parent-module": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
|
||||||
@@ -11412,6 +11786,30 @@
|
|||||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/path-scurry": {
|
||||||
|
"version": "1.11.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",
|
||||||
|
"integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BlueOak-1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"lru-cache": "^10.2.0",
|
||||||
|
"minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16 || 14 >=14.18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/isaacs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/path-scurry/node_modules/lru-cache": {
|
||||||
|
"version": "10.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz",
|
||||||
|
"integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/path-to-regexp": {
|
"node_modules/path-to-regexp": {
|
||||||
"version": "6.3.0",
|
"version": "6.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
|
||||||
@@ -13435,6 +13833,22 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/string-width-cjs": {
|
||||||
|
"name": "string-width",
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/string.prototype.matchall": {
|
"node_modules/string.prototype.matchall": {
|
||||||
"version": "4.0.12",
|
"version": "4.0.12",
|
||||||
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz",
|
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz",
|
||||||
@@ -13532,6 +13946,20 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/strip-ansi-cjs": {
|
||||||
|
"name": "strip-ansi",
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/strip-bom": {
|
"node_modules/strip-bom": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
|
||||||
@@ -14303,6 +14731,20 @@
|
|||||||
"requires-port": "^1.0.0"
|
"requires-port": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/util": {
|
||||||
|
"version": "0.12.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz",
|
||||||
|
"integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"inherits": "^2.0.3",
|
||||||
|
"is-arguments": "^1.0.4",
|
||||||
|
"is-generator-function": "^1.0.7",
|
||||||
|
"is-typed-array": "^1.1.3",
|
||||||
|
"which-typed-array": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/util-deprecate": {
|
"node_modules/util-deprecate": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||||
@@ -14326,6 +14768,28 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/v8-to-istanbul": {
|
||||||
|
"version": "9.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
|
||||||
|
"integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@jridgewell/trace-mapping": "^0.3.12",
|
||||||
|
"@types/istanbul-lib-coverage": "^2.0.1",
|
||||||
|
"convert-source-map": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/v8-to-istanbul/node_modules/convert-source-map": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/validate-npm-package-license": {
|
"node_modules/validate-npm-package-license": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
|
||||||
@@ -14771,6 +15235,25 @@
|
|||||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/wrap-ansi-cjs": {
|
||||||
|
"name": "wrap-ansi",
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-styles": "^4.0.0",
|
||||||
|
"string-width": "^4.1.0",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/wrappy": {
|
"node_modules/wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
|||||||
+5
-11
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@psf/bch-js",
|
"name": "@psf/bch-js",
|
||||||
"version": "6.0.0",
|
"version": "6.0.0",
|
||||||
|
"type": "module",
|
||||||
"description": "A JavaScript library for working with Bitcoin Cash, eCash, and SLP Tokens",
|
"description": "A JavaScript library for working with Bitcoin Cash, eCash, and SLP Tokens",
|
||||||
"author": "Chris Troutner <chris.troutner@gmail.com>",
|
"author": "Chris Troutner <chris.troutner@gmail.com>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -9,7 +10,7 @@
|
|||||||
],
|
],
|
||||||
"main": "src/bch-js",
|
"main": "src/bch-js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "nyc mocha --trace-warnings --unhandled-rejections=strict --timeout 30000 test/unit/",
|
"test": "c8 mocha --trace-warnings --unhandled-rejections=strict --timeout 30000 test/unit/",
|
||||||
"test:integration": "npm run test:integration:bchn",
|
"test:integration": "npm run test:integration:bchn",
|
||||||
"test:integration:nft": "export RESTURL=https://bchn.fullstack.cash/v5/ && export IS_USING_FREE_TIER=true && mocha --timeout 30000 -g '#nft1' test/integration/chains/bchn/slp.js",
|
"test:integration:nft": "export RESTURL=https://bchn.fullstack.cash/v5/ && export IS_USING_FREE_TIER=true && mocha --timeout 30000 -g '#nft1' test/integration/chains/bchn/slp.js",
|
||||||
"test:integration:abc": "export RESTURL=https://abc.fullstack.cash/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/abc/",
|
"test:integration:abc": "export RESTURL=https://abc.fullstack.cash/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/abc/",
|
||||||
@@ -21,10 +22,6 @@
|
|||||||
"test:integration:decatur:bchn": "export RESTURL=http://192.168.2.127:3000/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/",
|
"test:integration:decatur:bchn": "export RESTURL=http://192.168.2.127:3000/v5/ && mocha --timeout 30000 test/integration/ && mocha --timeout 30000 test/integration/chains/bchn/",
|
||||||
"test:integration:decatur:abc": "export RESTURL=http://192.168.2.142:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/",
|
"test:integration:decatur:abc": "export RESTURL=http://192.168.2.142:3000/v5/ && mocha --timeout 30000 test/integration && mocha --timeout 30000 test/integration/chains/abc/",
|
||||||
"test:integration:temp:bchn": "export RESTURL=http://157.90.174.219:3000/v5/ && mocha --timeout 30000 test/integration/",
|
"test:integration:temp:bchn": "export RESTURL=http://157.90.174.219:3000/v5/ && mocha --timeout 30000 test/integration/",
|
||||||
"test:temp": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 -g '#Encryption' test/integration/",
|
|
||||||
"test:temp2": "mocha --timeout=30000 -g '#TransactionLib' test/unit/",
|
|
||||||
"test:temp3": "export RESTURL=https://bchn.fullstack.cash/v5/ && mocha --timeout 30000 -g '#DSProof' test/integration/chains/",
|
|
||||||
"test:temp4": "export RESTURL=http://localhost:3000/v5/ && mocha --timeout 30000 -g '#decodeOpReturn' test/integration/",
|
|
||||||
"coverage": "nyc --reporter=html mocha --timeout 25000 test/unit/",
|
"coverage": "nyc --reporter=html mocha --timeout 25000 test/unit/",
|
||||||
"docs": "./node_modules/.bin/apidoc -i src/ -o docs",
|
"docs": "./node_modules/.bin/apidoc -i src/ -o docs",
|
||||||
"lint": "standard --env mocha --fix"
|
"lint": "standard --env mocha --fix"
|
||||||
@@ -63,6 +60,8 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"apidoc": "0.50.5",
|
"apidoc": "0.50.5",
|
||||||
|
"assert": "2.1.0",
|
||||||
|
"c8": "10.1.3",
|
||||||
"chai": "4.1.2",
|
"chai": "4.1.2",
|
||||||
"husky": "4.3.8",
|
"husky": "4.3.8",
|
||||||
"lodash.clonedeep": "4.5.0",
|
"lodash.clonedeep": "4.5.0",
|
||||||
@@ -70,15 +69,10 @@
|
|||||||
"nyc": "15.1.0",
|
"nyc": "15.1.0",
|
||||||
"semantic-release": "19.0.5",
|
"semantic-release": "19.0.5",
|
||||||
"sinon": "9.2.2",
|
"sinon": "9.2.2",
|
||||||
"standard": "^16.0.4"
|
"standard": "16.0.4"
|
||||||
},
|
},
|
||||||
"apidoc": {
|
"apidoc": {
|
||||||
"title": "bch-js",
|
"title": "bch-js",
|
||||||
"url": "bchjs."
|
"url": "bchjs."
|
||||||
},
|
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "npm run lint"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
// const axios = require("axios")
|
// import axios from "axios"
|
||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const cashaddr = require('ecashaddrjs')
|
import cashaddr from 'ecashaddrjs'
|
||||||
const coininfo = require('@psf/coininfo')
|
import coininfo from '@psf/coininfo'
|
||||||
|
|
||||||
class Address {
|
class Address {
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
@@ -871,4 +871,4 @@ class Address {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Address
|
export default Address
|
||||||
|
|||||||
+26
-26
@@ -7,36 +7,36 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// bch-api mainnet.
|
// bch-api mainnet.
|
||||||
const DEFAULT_REST_API = 'https://api.fullstack.cash/v5/'
|
|
||||||
// const DEFAULT_REST_API = "http://localhost:3000/v5/"
|
// const DEFAULT_REST_API = "http://localhost:3000/v5/"
|
||||||
|
|
||||||
// local deps
|
// local deps
|
||||||
const BitcoinCash = require('./bitcoincash')
|
import BitcoinCash from './bitcoincash.js'
|
||||||
const Crypto = require('./crypto')
|
import Crypto from './crypto.js'
|
||||||
const Util = require('./util')
|
import Util from './util.js'
|
||||||
const Blockchain = require('./blockchain')
|
import Blockchain from './blockchain.js'
|
||||||
const Control = require('./control')
|
import Control from './control.js'
|
||||||
const Generating = require('./generating')
|
import Generating from './generating.js'
|
||||||
const Mining = require('./mining')
|
import Mining from './mining.js'
|
||||||
const RawTransactions = require('./raw-transactions')
|
import RawTransactions from './raw-transactions.js'
|
||||||
const Mnemonic = require('./mnemonic')
|
import Mnemonic from './mnemonic.js'
|
||||||
const Address = require('./address')
|
import Address from './address.js'
|
||||||
const HDNode = require('./hdnode')
|
import HDNode from './hdnode.js'
|
||||||
const TransactionBuilder = require('./transaction-builder')
|
import TransactionBuilder from './transaction-builder.js'
|
||||||
const ECPair = require('./ecpair')
|
import ECPair from './ecpair.js'
|
||||||
const Script = require('./script')
|
import Script from './script.js'
|
||||||
const Price = require('./price')
|
import Price from './price.js'
|
||||||
const Schnorr = require('./schnorr')
|
import Schnorr from './schnorr.js'
|
||||||
const SLP = require('./slp/slp')
|
import SLP from './slp/slp.js'
|
||||||
const Encryption = require('./encryption')
|
import Encryption from './encryption.js'
|
||||||
const Utxo = require('./utxo')
|
import Utxo from './utxo.js'
|
||||||
const Transaction = require('./transaction')
|
import Transaction from './transaction.js'
|
||||||
const DSProof = require('./dsproof')
|
import DSProof from './dsproof.js'
|
||||||
const Ecash = require('./ecash')
|
import Ecash from './ecash.js'
|
||||||
|
|
||||||
// Indexers
|
// Indexers
|
||||||
const Electrumx = require('./electrumx')
|
import Electrumx from './electrumx.js'
|
||||||
const PsfSlpIndexer = require('./psf-slp-indexer')
|
import PsfSlpIndexer from './psf-slp-indexer.js'
|
||||||
|
const DEFAULT_REST_API = 'https://api.fullstack.cash/v5/'
|
||||||
|
|
||||||
class BCHJS {
|
class BCHJS {
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
@@ -120,4 +120,4 @@ class BCHJS {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BCHJS
|
export default BCHJS
|
||||||
|
|||||||
+10
-11
@@ -1,13 +1,12 @@
|
|||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const sb = require('satoshi-bitcoin')
|
import sb from 'satoshi-bitcoin'
|
||||||
const bitcoinMessage = require('bitcoinjs-message')
|
import bitcoinMessage from 'bitcoinjs-message'
|
||||||
const bs58 = require('bs58')
|
import bs58 from 'bs58'
|
||||||
const bip21 = require('@psf/bip21')
|
import bip21 from '@psf/bip21'
|
||||||
const coininfo = require('@psf/coininfo')
|
import coininfo from '@psf/coininfo'
|
||||||
const bip38 = require('bip38')
|
import bip38 from 'bip38'
|
||||||
const wif = require('wif')
|
import wif from 'wif'
|
||||||
|
import { Buffer } from 'safe-buffer'
|
||||||
const Buffer = require('safe-buffer').Buffer
|
|
||||||
|
|
||||||
class BitcoinCash {
|
class BitcoinCash {
|
||||||
constructor (address) {
|
constructor (address) {
|
||||||
@@ -519,4 +518,4 @@ class BitcoinCash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BitcoinCash
|
export default BitcoinCash
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
- Add blockhash functionality back into getTxOutProof
|
- Add blockhash functionality back into getTxOutProof
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -833,4 +833,4 @@ class Blockchain {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Blockchain
|
export default Blockchain
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
API endpoints for basic control and information of the full node.
|
API endpoints for basic control and information of the full node.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this // Global reference to the instance of this class.
|
// let _this // Global reference to the instance of this class.
|
||||||
|
|
||||||
@@ -115,4 +115,4 @@ class Control {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Control
|
export default Control
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
const randomBytes = require('randombytes')
|
import randomBytes from 'randombytes'
|
||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
|
|
||||||
class Crypto {
|
class Crypto {
|
||||||
/**
|
/**
|
||||||
@@ -135,4 +135,4 @@ class Crypto {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Crypto
|
export default Crypto
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
let _this
|
let _this
|
||||||
|
|
||||||
@@ -78,4 +78,4 @@ class DSProof {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = DSProof
|
export default DSProof
|
||||||
|
|||||||
+1
-1
@@ -44,4 +44,4 @@ class eCash {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = eCash
|
export default eCash
|
||||||
|
|||||||
+3
-3
@@ -1,5 +1,5 @@
|
|||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const coininfo = require('@psf/coininfo')
|
import coininfo from '@psf/coininfo'
|
||||||
|
|
||||||
class ECPair {
|
class ECPair {
|
||||||
static setAddress (address) {
|
static setAddress (address) {
|
||||||
@@ -166,4 +166,4 @@ class ECPair {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ECPair
|
export default ECPair
|
||||||
|
|||||||
+3
-3
@@ -3,10 +3,10 @@
|
|||||||
by FullStack.cash
|
by FullStack.cash
|
||||||
*/
|
*/
|
||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// Local libraries.
|
// Local libraries.
|
||||||
const Blockchain = require('./blockchain')
|
import Blockchain from './blockchain.js'
|
||||||
// const Address = require('./address')
|
// const Address = require('./address')
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
@@ -727,4 +727,4 @@ class ElectrumX {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ElectrumX
|
export default ElectrumX
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
This library contains useful functions that deal with encryption.
|
This library contains useful functions that deal with encryption.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
let _this
|
let _this
|
||||||
|
|
||||||
@@ -73,4 +73,4 @@ class Encryption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Encryption
|
export default Encryption
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -41,4 +41,4 @@ class Generating {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Generating
|
export default Generating
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const coininfo = require('@psf/coininfo')
|
import coininfo from '@psf/coininfo'
|
||||||
const bip32utils = require('@chris.troutner/bip32-utils')
|
import bip32utils from '@chris.troutner/bip32-utils'
|
||||||
const bchaddrjs = require('bchaddrjs-slp')
|
import bchaddrjs from 'bchaddrjs-slp'
|
||||||
|
|
||||||
class HDNode {
|
class HDNode {
|
||||||
constructor (address) {
|
constructor (address) {
|
||||||
@@ -637,4 +637,4 @@ class HDNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = HDNode
|
export default HDNode
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -80,4 +80,4 @@ class Mining {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Mining
|
export default Mining
|
||||||
|
|||||||
+6
-6
@@ -1,11 +1,11 @@
|
|||||||
/* eslint no-prototype-builtins: "off" */
|
/* eslint no-prototype-builtins: "off" */
|
||||||
/* eslint node/no-callback-literal: "off" */
|
/* eslint node/no-callback-literal: "off" */
|
||||||
|
|
||||||
const BIP39 = require('bip39')
|
import BIP39 from 'bip39'
|
||||||
const randomBytes = require('randombytes')
|
import randomBytes from 'randombytes'
|
||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const Buffer = require('safe-buffer').Buffer
|
import { Buffer } from 'safe-buffer'
|
||||||
const wif = require('wif')
|
import wif from 'wif'
|
||||||
|
|
||||||
class Mnemonic {
|
class Mnemonic {
|
||||||
constructor (address) {
|
constructor (address) {
|
||||||
@@ -338,7 +338,7 @@ class Mnemonic {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Mnemonic
|
export default Mnemonic
|
||||||
|
|
||||||
// The following code is from: https://raw.githubusercontent.com/iancoleman/bip39/7ff86d4c983f1e8c80b87b31acfd69fcf98c1b82/src/js/levenshtein.js
|
// The following code is from: https://raw.githubusercontent.com/iancoleman/bip39/7ff86d4c983f1e8c80b87b31acfd69fcf98c1b82/src/js/levenshtein.js
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -268,4 +268,4 @@ class Price {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Price
|
export default Price
|
||||||
|
|||||||
@@ -7,11 +7,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
const RawTransaction = require('./raw-transactions')
|
import RawTransaction from './raw-transactions.js'
|
||||||
const SlpUtils = require('./slp/utils')
|
import SlpUtils from './slp/utils.js'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -539,4 +539,4 @@ class PsfSlpIndexer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = PsfSlpIndexer
|
export default PsfSlpIndexer
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -498,4 +498,4 @@ class RawTransactions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RawTransactions
|
export default RawTransactions
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const schnorr = require('bip-schnorr')
|
import schnorr from 'bip-schnorr'
|
||||||
|
|
||||||
class Schnorr {
|
class Schnorr {
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
@@ -509,4 +509,4 @@ class Schnorr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Schnorr
|
export default Schnorr
|
||||||
|
|||||||
+5
-3
@@ -1,5 +1,7 @@
|
|||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const opcodes = require('@psf/bitcoincash-ops')
|
/* eslint-disable */
|
||||||
|
import opcodes from '@psf/bitcoincash-ops' with { type: 'json' }
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
class Script {
|
class Script {
|
||||||
constructor () {
|
constructor () {
|
||||||
@@ -240,4 +242,4 @@ class Script {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Script
|
export default Script
|
||||||
|
|||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
const BCHJSAddress = require('../address')
|
import BCHJSAddress from '../address.js'
|
||||||
|
|
||||||
|
import bchaddrjs from 'bchaddrjs-slp'
|
||||||
// const bchAddress = new BCHJSAddress()
|
// const bchAddress = new BCHJSAddress()
|
||||||
let bchAddress
|
let bchAddress
|
||||||
|
|
||||||
const bchaddrjs = require('bchaddrjs-slp')
|
|
||||||
|
|
||||||
class Address extends BCHJSAddress {
|
class Address extends BCHJSAddress {
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
super(config)
|
super(config)
|
||||||
@@ -661,4 +661,4 @@ class Address extends BCHJSAddress {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Address
|
export default Address
|
||||||
|
|||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
// const BCHJS = require("../bch-js")
|
// import BCHJS from "../bch-js.js"
|
||||||
// const bchjs = new BCHJS()
|
// const bchjs = new BCHJS()
|
||||||
|
|
||||||
const BCHJSECPair = require('../ecpair')
|
import BCHJSECPair from '../ecpair.js'
|
||||||
|
|
||||||
const bchaddrjs = require('bchaddrjs-slp')
|
import bchaddrjs from 'bchaddrjs-slp'
|
||||||
|
|
||||||
class ECPair extends BCHJSECPair {
|
class ECPair extends BCHJSECPair {
|
||||||
/*
|
/*
|
||||||
@@ -31,4 +31,4 @@ class ECPair extends BCHJSECPair {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ECPair
|
export default ECPair
|
||||||
|
|||||||
+6
-6
@@ -9,18 +9,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
// const axios = require('axios')
|
// import axios from 'axios'
|
||||||
|
|
||||||
// Local libraries.
|
// Local libraries.
|
||||||
const Address = require('./address')
|
import Address from './address.js'
|
||||||
|
|
||||||
// const BigNumber = require('bignumber.js')
|
// import BigNumber from 'bignumber.js'
|
||||||
const slpMdm = require('slp-mdm')
|
import slpMdm from 'slp-mdm'
|
||||||
|
import TransactionBuilder from '../transaction-builder.js'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
// const addy = new Address()
|
// const addy = new Address()
|
||||||
let addy
|
let addy
|
||||||
const TransactionBuilder = require('../transaction-builder')
|
|
||||||
|
|
||||||
class Nft1 {
|
class Nft1 {
|
||||||
constructor (config) {
|
constructor (config) {
|
||||||
@@ -421,4 +421,4 @@ class Nft1 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Nft1
|
export default Nft1
|
||||||
|
|||||||
+8
-8
@@ -7,13 +7,13 @@
|
|||||||
|
|
||||||
// imports
|
// imports
|
||||||
// require deps
|
// require deps
|
||||||
// const BCHJS = require("../bch-js")
|
// import BCHJS from "../bch-js.js"
|
||||||
const Address = require('./address')
|
import Address from './address.js'
|
||||||
const ECPair = require('./ecpair')
|
import ECPair from './ecpair.js'
|
||||||
// const HDNode = require("./hdnode")
|
// import HDNode from "./hdnode.js"
|
||||||
const TokenType1 = require('./tokentype1')
|
import TokenType1 from './tokentype1.js'
|
||||||
const NFT1 = require('./nft1')
|
import NFT1 from './nft1.js'
|
||||||
const Utils = require('./utils')
|
import Utils from './utils.js'
|
||||||
|
|
||||||
// SLP is a superset of BITBOX
|
// SLP is a superset of BITBOX
|
||||||
class SLP {
|
class SLP {
|
||||||
@@ -46,4 +46,4 @@ class SLP {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = SLP
|
export default SLP
|
||||||
|
|||||||
@@ -2,19 +2,19 @@
|
|||||||
This library handles the OP_RETURN of SLP TokenType1 transactions.
|
This library handles the OP_RETURN of SLP TokenType1 transactions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// const BCHJS = require("../bch-js")
|
// import BCHJS from "../bch-js.js"
|
||||||
// const bchjs = new BCHJS()
|
// const bchjs = new BCHJS()
|
||||||
|
|
||||||
const Address = require('./address')
|
import Address from './address.js'
|
||||||
const Script = require('../script')
|
import Script from '../script.js'
|
||||||
|
|
||||||
const BigNumber = require('bignumber.js')
|
import BigNumber from 'bignumber.js'
|
||||||
const slpMdm = require('slp-mdm')
|
import slpMdm from 'slp-mdm'
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
import TransactionBuilder from '../transaction-builder.js'
|
||||||
|
|
||||||
// const addy = new Address()
|
// const addy = new Address()
|
||||||
let addy
|
let addy
|
||||||
const TransactionBuilder = require('../transaction-builder')
|
|
||||||
|
|
||||||
let _this // local global
|
let _this // local global
|
||||||
|
|
||||||
@@ -483,4 +483,4 @@ class TokenType1 {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = TokenType1
|
export default TokenType1
|
||||||
|
|||||||
+4
-4
@@ -1,11 +1,11 @@
|
|||||||
/* eslint-disable no-useless-catch */
|
/* eslint-disable no-useless-catch */
|
||||||
|
|
||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
const slpParser = require('slp-parser')
|
import slpParser from 'slp-parser'
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
const Util = require('../util')
|
import Util from '../util.js'
|
||||||
|
|
||||||
let _this
|
let _this
|
||||||
|
|
||||||
@@ -184,4 +184,4 @@ class Utils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Utils
|
export default Utils
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
const coininfo = require('@psf/coininfo')
|
import coininfo from '@psf/coininfo'
|
||||||
const bip66 = require('bip66')
|
import bip66 from 'bip66'
|
||||||
const bip68 = require('bc-bip68')
|
import bip68 from 'bc-bip68'
|
||||||
|
|
||||||
class TransactionBuilder {
|
class TransactionBuilder {
|
||||||
static setAddress (address) {
|
static setAddress (address) {
|
||||||
@@ -163,4 +163,4 @@ class TransactionBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = TransactionBuilder
|
export default TransactionBuilder
|
||||||
|
|||||||
+5
-5
@@ -6,10 +6,10 @@
|
|||||||
// const BigNumber = require('bignumber.js')
|
// const BigNumber = require('bignumber.js')
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
const RawTransaction = require('./raw-transactions')
|
import RawTransaction from './raw-transactions.js'
|
||||||
const SlpUtils = require('./slp/utils')
|
import SlpUtils from './slp/utils.js'
|
||||||
const Blockchain = require('./blockchain')
|
import Blockchain from './blockchain.js'
|
||||||
const PsfSlpIndexer = require('./psf-slp-indexer')
|
import PsfSlpIndexer from './psf-slp-indexer.js'
|
||||||
|
|
||||||
class Transaction {
|
class Transaction {
|
||||||
constructor (config = {}) {
|
constructor (config = {}) {
|
||||||
@@ -77,4 +77,4 @@ class Transaction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Transaction
|
export default Transaction
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
|
|
||||||
// let _this
|
// let _this
|
||||||
|
|
||||||
@@ -305,4 +305,4 @@ class Util {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Util
|
export default Util
|
||||||
|
|||||||
+6
-6
@@ -6,11 +6,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
const Electrumx = require('./electrumx')
|
import Electrumx from './electrumx.js'
|
||||||
const Slp = require('./slp/slp')
|
import Slp from './slp/slp.js'
|
||||||
const PsfSlpIndexer = require('./psf-slp-indexer')
|
import PsfSlpIndexer from './psf-slp-indexer.js'
|
||||||
const BigNumber = require('bignumber.js')
|
import BigNumber from 'bignumber.js'
|
||||||
const Blockchain = require('./blockchain')
|
import Blockchain from './blockchain.js'
|
||||||
|
|
||||||
class UTXO {
|
class UTXO {
|
||||||
constructor (config = {}) {
|
constructor (config = {}) {
|
||||||
@@ -420,4 +420,4 @@ class UTXO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = UTXO
|
export default UTXO
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
A Mocha test file for running end-to-end (e2e) tests.
|
A Mocha test file for running end-to-end (e2e) tests.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// const mocha = require("mocha")
|
// import mocha from "mocha"
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
const sendToken = require('./send-token/send-token')
|
import sendToken from './send-token/send-token.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
describe('#end-to-end tests', () => {
|
describe('#end-to-end tests', () => {
|
||||||
describe('#send-tokens', () => {
|
describe('#send-tokens', () => {
|
||||||
|
|||||||
@@ -3,12 +3,18 @@
|
|||||||
IPFS is working.
|
IPFS is working.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
process.env.IPFS_API = 'http://localhost:5001'
|
import { fileURLToPath } from 'url'
|
||||||
|
import { dirname } from 'path'
|
||||||
// process.env.IPFS_API = `https://ipfs-api.fullstack.cash`
|
// process.env.IPFS_API = `https://ipfs-api.fullstack.cash`
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js')
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
|
|
||||||
|
process.env.IPFS_API = 'http://localhost:5001'
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
|
const __dirname = dirname(__filename)
|
||||||
|
|
||||||
describe('#IPFS', () => {
|
describe('#IPFS', () => {
|
||||||
it('should upload a file to the server', async () => {
|
it('should upload a file to the server', async () => {
|
||||||
const path = `${__dirname.toString()}/ipfs-e2e.js`
|
const path = `${__dirname.toString()}/ipfs-e2e.js`
|
||||||
|
|||||||
@@ -12,13 +12,14 @@
|
|||||||
mocha --timeout=30000 anonymous-rate-limits.js
|
mocha --timeout=30000 anonymous-rate-limits.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
// const RESTURL = `http://localhost:3000/v5/`
|
||||||
|
|
||||||
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
// const RESTURL = `https://abc.fullstack.cash/v5/`
|
// const RESTURL = `https://abc.fullstack.cash/v5/`
|
||||||
const RESTURL = 'https://bchn.fullstack.cash/v5/'
|
const RESTURL = 'https://bchn.fullstack.cash/v5/'
|
||||||
// const RESTURL = `http://localhost:3000/v5/`
|
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL })
|
const bchjs = new BCHJS({ restURL: RESTURL })
|
||||||
|
|
||||||
describe('#anonymous rate limits', () => {
|
describe('#anonymous rate limits', () => {
|
||||||
|
|||||||
@@ -7,11 +7,12 @@
|
|||||||
- Update the PRO_PASS value with a current PRO_PASSES string used by bch-api.
|
- Update the PRO_PASS value with a current PRO_PASSES string used by bch-api.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
const PRO_PASS = 'testpassword'
|
const PRO_PASS = 'testpassword'
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({
|
const bchjs = new BCHJS({
|
||||||
// restURL: `https://bchn.fullstack.cash/v5/`,
|
// restURL: `https://bchn.fullstack.cash/v5/`,
|
||||||
restURL: 'https://abc.fullstack.cash/v5/',
|
restURL: 'https://abc.fullstack.cash/v5/',
|
||||||
|
|||||||
@@ -11,12 +11,13 @@
|
|||||||
- Update the JWT_TOKEN value with a current free-level JWT token.
|
- Update the JWT_TOKEN value with a current free-level JWT token.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
const JWT_TOKEN =
|
const JWT_TOKEN =
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlODhhY2YyMDIyMWMxMDAxMmFkOTQwMSIsImVtYWlsIjoiZGVtb0BkZW1vLmNvbSIsImFwaUxldmVsIjoxMCwicmF0ZUxpbWl0IjozLCJpYXQiOjE2MDQ4NTQ2OTEsImV4cCI6MTYwNzQ0NjY5MX0.iwse0z0KDKHx9graCxcOwj6lSlfKQAb1zLhmjvygvts'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlODhhY2YyMDIyMWMxMDAxMmFkOTQwMSIsImVtYWlsIjoiZGVtb0BkZW1vLmNvbSIsImFwaUxldmVsIjoxMCwicmF0ZUxpbWl0IjozLCJpYXQiOjE2MDQ4NTQ2OTEsImV4cCI6MTYwNzQ0NjY5MX0.iwse0z0KDKHx9graCxcOwj6lSlfKQAb1zLhmjvygvts'
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({
|
const bchjs = new BCHJS({
|
||||||
restURL: 'https://api.fullstack.cash/v5/',
|
restURL: 'https://api.fullstack.cash/v5/',
|
||||||
// restURL: `http://localhost:3000/v5/`,
|
// restURL: `http://localhost:3000/v5/`,
|
||||||
|
|||||||
@@ -11,12 +11,13 @@
|
|||||||
- Update the JWT_TOKEN value with a paid tier JWT token.
|
- Update the JWT_TOKEN value with a paid tier JWT token.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
const JWT_TOKEN =
|
const JWT_TOKEN =
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlODhhY2JmMDIyMWMxMDAxMmFkOTNmZiIsImVtYWlsIjoiY2hyaXMudHJvdXRuZXJAZ21haWwuY29tIiwiYXBpTGV2ZWwiOjQwLCJyYXRlTGltaXQiOjMsImlhdCI6MTYwMzIyNzEwNCwiZXhwIjoxNjA1ODE5MTA0fQ.CV36grzdD36Ht3BwZGHG4XU40CVDzMRw9Ars1x1r27M'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlODhhY2JmMDIyMWMxMDAxMmFkOTNmZiIsImVtYWlsIjoiY2hyaXMudHJvdXRuZXJAZ21haWwuY29tIiwiYXBpTGV2ZWwiOjQwLCJyYXRlTGltaXQiOjMsImlhdCI6MTYwMzIyNzEwNCwiZXhwIjoxNjA1ODE5MTA0fQ.CV36grzdD36Ht3BwZGHG4XU40CVDzMRw9Ars1x1r27M'
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({
|
const bchjs = new BCHJS({
|
||||||
// restURL: `https://bchn.fullstack.cash/v5/`,
|
// restURL: `https://bchn.fullstack.cash/v5/`,
|
||||||
restURL: 'https:/abc.fullstack.cash/v5/',
|
restURL: 'https:/abc.fullstack.cash/v5/',
|
||||||
|
|||||||
@@ -7,12 +7,13 @@
|
|||||||
- Update the JWT_TOKEN value with a current indexer-level JWT token.
|
- Update the JWT_TOKEN value with a current indexer-level JWT token.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
const JWT_TOKEN =
|
const JWT_TOKEN =
|
||||||
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlODhhY2JmMDIyMWMxMDAxMmFkOTNmZiIsImVtYWlsIjoiY2hyaXMudHJvdXRuZXJAZ21haWwuY29tIiwiYXBpTGV2ZWwiOjQwLCJyYXRlTGltaXQiOjMsImlhdCI6MTYwMzIyNzEwNCwiZXhwIjoxNjA1ODE5MTA0fQ.CV36grzdD36Ht3BwZGHG4XU40CVDzMRw9Ars1x1r27M'
|
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVlODhhY2JmMDIyMWMxMDAxMmFkOTNmZiIsImVtYWlsIjoiY2hyaXMudHJvdXRuZXJAZ21haWwuY29tIiwiYXBpTGV2ZWwiOjQwLCJyYXRlTGltaXQiOjMsImlhdCI6MTYwMzIyNzEwNCwiZXhwIjoxNjA1ODE5MTA0fQ.CV36grzdD36Ht3BwZGHG4XU40CVDzMRw9Ars1x1r27M'
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({
|
const bchjs = new BCHJS({
|
||||||
// restURL: `https://bchn.fullstack.cash/v5/`,
|
// restURL: `https://bchn.fullstack.cash/v5/`,
|
||||||
restURL: 'https://abc.fullstack.cash/v5/',
|
restURL: 'https://abc.fullstack.cash/v5/',
|
||||||
|
|||||||
@@ -18,17 +18,23 @@ const RECV_ADDR2 = 'bchtest:qz6yw0kqgfkknfy6jh2jvlfnkzmre3lt2u0pgcckdk'
|
|||||||
const SATOSHIS_TO_SEND = 1000
|
const SATOSHIS_TO_SEND = 1000
|
||||||
|
|
||||||
// Instantiate BITBOX.
|
// Instantiate BITBOX.
|
||||||
const bitboxLib = '../../../lib/BITBOX'
|
// Note: Dynamic require with variable - use dynamic import in ESM
|
||||||
const BITBOXSDK = require(bitboxLib)
|
const bitboxLib = '../../../lib/BITBOX.js'
|
||||||
const BITBOX = new BITBOXSDK({ restURL: 'https://trest.bitcoin.com/v2/' })
|
let BITBOXSDK, BITBOX, walletInfo
|
||||||
// const BITBOX = new BITBOXSDK({ restURL: "http://localhost:3000/v2/" })
|
|
||||||
|
|
||||||
// const util = require('util')
|
|
||||||
|
|
||||||
// Open the wallet generated with create-wallet.
|
// Open the wallet generated with create-wallet.
|
||||||
let walletInfo = {}
|
let SEND_ADDR, SEND_MNEMONIC
|
||||||
|
|
||||||
|
// Load dependencies asynchronously
|
||||||
|
async function loadDependencies () {
|
||||||
|
BITBOXSDK = (await import(bitboxLib)).default
|
||||||
|
BITBOX = new BITBOXSDK({ restURL: 'https://trest.bitcoin.com/v2/' })
|
||||||
|
// const BITBOX = new BITBOXSDK({ restURL: "http://localhost:3000/v2/" })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
walletInfo = require('./wallet.json')
|
/* eslint-disable */
|
||||||
|
walletInfo = (await import('./wallet.json', { with: { type: 'json' } })).default
|
||||||
|
/* eslint-enable */
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(
|
console.log(
|
||||||
'Could not open wallet.json. Generate a wallet with create-wallet first.'
|
'Could not open wallet.json. Generate a wallet with create-wallet first.'
|
||||||
@@ -36,8 +42,9 @@ try {
|
|||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const SEND_ADDR = walletInfo.cashAddress
|
SEND_ADDR = walletInfo.cashAddress
|
||||||
const SEND_MNEMONIC = walletInfo.mnemonic
|
SEND_MNEMONIC = walletInfo.mnemonic
|
||||||
|
}
|
||||||
|
|
||||||
async function testSend () {
|
async function testSend () {
|
||||||
try {
|
try {
|
||||||
@@ -57,7 +64,10 @@ async function testSend () {
|
|||||||
console.log('Error in testSend: ', err)
|
console.log('Error in testSend: ', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Load dependencies then run test
|
||||||
|
loadDependencies().then(() => {
|
||||||
testSend()
|
testSend()
|
||||||
|
})
|
||||||
|
|
||||||
// Build a TX hex with the largest UTXO.
|
// Build a TX hex with the largest UTXO.
|
||||||
async function buildTx1 (recAddr) {
|
async function buildTx1 (recAddr) {
|
||||||
|
|||||||
@@ -17,17 +17,23 @@ const RECV_ADDR1 = 'bchtest:qzfn2mly05t6fjsh5kjj0dqq0jjtct27ng089dgg05'
|
|||||||
const SATOSHIS_TO_SEND = 1000
|
const SATOSHIS_TO_SEND = 1000
|
||||||
|
|
||||||
// Instantiate BITBOX.
|
// Instantiate BITBOX.
|
||||||
const bitboxLib = '../../../lib/BITBOX'
|
// Note: Dynamic require with variable - use dynamic import in ESM
|
||||||
const BITBOXSDK = require(bitboxLib)
|
const bitboxLib = '../../../lib/BITBOX.js'
|
||||||
const BITBOX = new BITBOXSDK({ restURL: 'https://trest.bitcoin.com/v2/' })
|
let BITBOXSDK, BITBOX, walletInfo
|
||||||
// const BITBOX = new BITBOXSDK({ restURL: "http://localhost:3000/v2/" })
|
|
||||||
|
|
||||||
// const util = require('util')
|
|
||||||
|
|
||||||
// Open the wallet generated with create-wallet.
|
// Open the wallet generated with create-wallet.
|
||||||
let walletInfo = {}
|
let SEND_ADDR, SEND_MNEMONIC
|
||||||
|
|
||||||
|
// Load dependencies asynchronously
|
||||||
|
async function loadDependencies () {
|
||||||
|
BITBOXSDK = (await import(bitboxLib)).default
|
||||||
|
BITBOX = new BITBOXSDK({ restURL: 'https://trest.bitcoin.com/v2/' })
|
||||||
|
// const BITBOX = new BITBOXSDK({ restURL: "http://localhost:3000/v2/" })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
walletInfo = require('./wallet.json')
|
/* eslint-disable */
|
||||||
|
walletInfo = (await import('./wallet.json', { with: { type: 'json' } })).default
|
||||||
|
/* eslint-enable */
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(
|
console.log(
|
||||||
'Could not open wallet.json. Generate a wallet with create-wallet first.'
|
'Could not open wallet.json. Generate a wallet with create-wallet first.'
|
||||||
@@ -35,8 +41,9 @@ try {
|
|||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const SEND_ADDR = walletInfo.cashAddress
|
SEND_ADDR = walletInfo.cashAddress
|
||||||
const SEND_MNEMONIC = walletInfo.mnemonic
|
SEND_MNEMONIC = walletInfo.mnemonic
|
||||||
|
}
|
||||||
|
|
||||||
async function testSend () {
|
async function testSend () {
|
||||||
try {
|
try {
|
||||||
@@ -54,7 +61,10 @@ async function testSend () {
|
|||||||
console.log('Error in testSend: ', err)
|
console.log('Error in testSend: ', err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Load dependencies then run test
|
||||||
|
loadDependencies().then(() => {
|
||||||
testSend()
|
testSend()
|
||||||
|
})
|
||||||
|
|
||||||
// Build a TX hex with the largest UTXO.
|
// Build a TX hex with the largest UTXO.
|
||||||
async function buildTx1 (recAddr) {
|
async function buildTx1 (recAddr) {
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
|
||||||
|
import lib from '../util/e2e-util.js'
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
@@ -21,8 +23,6 @@ util.inspect.defaultOptions = {
|
|||||||
const WALLET1 = '../wallet1.json'
|
const WALLET1 = '../wallet1.json'
|
||||||
const WALLET2 = '../wallet2.json'
|
const WALLET2 = '../wallet2.json'
|
||||||
|
|
||||||
const lib = require('../util/e2e-util')
|
|
||||||
|
|
||||||
// The main test function.
|
// The main test function.
|
||||||
// Sends a token and reports on how long it takes to show up in SLPDB production.
|
// Sends a token and reports on how long it takes to show up in SLPDB production.
|
||||||
async function sendTokenTest () {
|
async function sendTokenTest () {
|
||||||
@@ -95,6 +95,6 @@ function sleep (ms) {
|
|||||||
return new Promise(resolve => setTimeout(resolve, ms))
|
return new Promise(resolve => setTimeout(resolve, ms))
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
sendTokenTest
|
sendTokenTest
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
tests.
|
tests.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
openWallet,
|
openWallet,
|
||||||
sendToken,
|
sendToken,
|
||||||
getTestTokenBalance,
|
getTestTokenBalance,
|
||||||
threeDecimals
|
threeDecimals
|
||||||
}
|
}
|
||||||
|
|
||||||
const SLPSDK = require('../../../lib/SLP')
|
import SLPSDK from '../../../lib/SLP.js'
|
||||||
const slpsdk = new SLPSDK()
|
const slpsdk = new SLPSDK()
|
||||||
|
|
||||||
const testTokenId =
|
const testTokenId =
|
||||||
@@ -20,7 +20,11 @@ const testTokenId =
|
|||||||
// token balance.
|
// token balance.
|
||||||
async function openWallet (filename) {
|
async function openWallet (filename) {
|
||||||
try {
|
try {
|
||||||
const walletInfo = require(filename)
|
// Note: Dynamic imports for JSON files - use createRequire or import with assert
|
||||||
|
// For ESM, we need to handle dynamic JSON imports differently
|
||||||
|
/* eslint-disable */
|
||||||
|
const walletInfo = await import(filename, { with: { type: 'json' } }).then(m => m.default)
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
// const walletBalance = await getBalance(walletInfo)
|
// const walletBalance = await getBalance(walletInfo)
|
||||||
// const walletBalance = await slpsdk.Utils.balancesForAddress(
|
// const walletBalance = await slpsdk.Utils.balancesForAddress(
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
- Start a local copy of bch-api
|
- Start a local copy of bch-api
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const BCHJS = require('../../../src/bch-js.js')
|
import BCHJS from '../../../src/bch-js.js'
|
||||||
const bchjs = new BCHJS({
|
const bchjs = new BCHJS({
|
||||||
restURL: 'http://localhost:3000/v5/'
|
restURL: 'http://localhost:3000/v5/'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
of an e2e test to be properly tested.
|
of an e2e test to be properly tested.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const BCHJS = require('../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
const bchjs = new BCHJS()
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Global npm libraries
|
// Global npm libraries
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
describe('#psf-slp-indexer', () => {
|
describe('#psf-slp-indexer', () => {
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
TODO
|
TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({ restURL: process.env.RESTURL })
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
const bchjs = new BCHJS({ restURL: process.env.RESTURL })
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
Integration tests for the utxo.js library.
|
Integration tests for the utxo.js library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#UTXO', () => {
|
describe('#UTXO', () => {
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
Integration tests for bchjs dsproof library.
|
Integration tests for bchjs dsproof library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#DSProof', () => {
|
describe('#DSProof', () => {
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Global npm libraries
|
// Global npm libraries
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
// Local libraries
|
// Local libraries
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
describe('#psf-slp-indexer', () => {
|
describe('#psf-slp-indexer', () => {
|
||||||
|
|||||||
@@ -5,13 +5,13 @@
|
|||||||
TODO
|
TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
const bchjs = new BCHJS()
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
These tests are specific to the ABC chain.
|
These tests are specific to the ABC chain.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
let bchjs
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
let bchjs
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
Integration tests for the transaction.js library.
|
Integration tests for the transaction.js library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#Transaction', () => {
|
describe('#Transaction', () => {
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
rest.bitcoin.com.
|
rest.bitcoin.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
const bchjs = new BCHJS()
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,9 +2,10 @@
|
|||||||
Integration tests for the utxo.js library.
|
Integration tests for the utxo.js library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
// const bchjs = new BCHJS({ restURL: 'http://192.168.2.129:3000/v5/' })
|
// const bchjs = new BCHJS({ restURL: 'http://192.168.2.129:3000/v5/' })
|
||||||
|
|
||||||
|
|||||||
@@ -7,20 +7,20 @@
|
|||||||
of an e2e test to be properly tested.
|
of an e2e test to be properly tested.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||||
|
|
||||||
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
|
||||||
|
// Inspect utility used for debugging.
|
||||||
|
import util from 'util'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
|
|
||||||
const RESTURL = process.env.RESTURL
|
const RESTURL = process.env.RESTURL
|
||||||
? process.env.RESTURL
|
? process.env.RESTURL
|
||||||
: 'https://testnet3.fullstack.cash/v5/'
|
: 'https://testnet3.fullstack.cash/v5/'
|
||||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
|
||||||
const util = require('util')
|
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
Integration tests for bchjs control library.
|
Integration tests for bchjs control library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
|
||||||
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
|
|
||||||
const RESTURL = process.env.RESTURL
|
const RESTURL = process.env.RESTURL
|
||||||
? process.env.RESTURL
|
? process.env.RESTURL
|
||||||
: 'https://testnet3.fullstack.cash/v5/'
|
: 'https://testnet3.fullstack.cash/v5/'
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||||
|
|
||||||
describe('#control', () => {
|
describe('#control', () => {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
import sinon from 'sinon'
|
||||||
|
import util from 'util'
|
||||||
|
|
||||||
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
const sinon = require('sinon')
|
|
||||||
const util = require('util')
|
|
||||||
|
|
||||||
const RESTURL = process.env.RESTURL
|
const RESTURL = process.env.RESTURL
|
||||||
? process.env.RESTURL
|
? process.env.RESTURL
|
||||||
: 'https://testnet3.fullstack.cash/v5/'
|
: 'https://testnet3.fullstack.cash/v5/'
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||||
|
|
||||||
describe('#ElectrumX', () => {
|
describe('#ElectrumX', () => {
|
||||||
|
|||||||
@@ -5,20 +5,20 @@
|
|||||||
TODO
|
TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||||
|
|
||||||
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
|
||||||
|
// Inspect utility used for debugging.
|
||||||
|
import util from 'util'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
|
|
||||||
const RESTURL = process.env.RESTURL
|
const RESTURL = process.env.RESTURL
|
||||||
? process.env.RESTURL
|
? process.env.RESTURL
|
||||||
: 'https://testnet3.fullstack.cash/v5/'
|
: 'https://testnet3.fullstack.cash/v5/'
|
||||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
|
||||||
const util = require('util')
|
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
Integration tests for the bchjs covering SLP tokens.
|
Integration tests for the bchjs covering SLP tokens.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||||
|
|
||||||
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
|
||||||
|
// Inspect utility used for debugging.
|
||||||
|
import util from 'util'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
|
|
||||||
const RESTURL = process.env.RESTURL
|
const RESTURL = process.env.RESTURL
|
||||||
? process.env.RESTURL
|
? process.env.RESTURL
|
||||||
: 'https://testnet3.fullstack.cash/v5/'
|
: 'https://testnet3.fullstack.cash/v5/'
|
||||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
|
||||||
const util = require('util')
|
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
rest.bitcoin.com.
|
rest.bitcoin.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
||||||
|
|
||||||
|
import BCHJS from '../../../../src/bch-js.js'
|
||||||
|
|
||||||
|
// Inspect utility used for debugging.
|
||||||
|
import util from 'util'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
|
|
||||||
const RESTURL = process.env.RESTURL
|
const RESTURL = process.env.RESTURL
|
||||||
? process.env.RESTURL
|
? process.env.RESTURL
|
||||||
: 'https://testnet3.fullstack.cash/v5/'
|
: 'https://testnet3.fullstack.cash/v5/'
|
||||||
// if (process.env.RESTURL) RESTURL = process.env.RESTURL
|
|
||||||
|
|
||||||
const BCHJS = require('../../../../src/bch-js')
|
|
||||||
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
// const bchjs = new BCHJS({ restURL: `https://testnet.bchjs.cash/v5/` })
|
||||||
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
const bchjs = new BCHJS({ restURL: RESTURL, apiToken: process.env.BCHJSTOKEN })
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
|
||||||
const util = require('util')
|
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
Integration tests for bchjs control library.
|
Integration tests for bchjs control library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
const BCHJS = require('../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#control', () => {
|
describe('#control', () => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
import sinon from 'sinon'
|
||||||
const sinon = require('sinon')
|
|
||||||
|
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
const assert = chai.assert
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#ElectrumX', () => {
|
describe('#ElectrumX', () => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#price', () => {
|
describe('#price', () => {
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
TODO
|
TODO
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const BCHJS = require('../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
const bchjs = new BCHJS()
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
Integration tests for the bchjs covering SLP tokens.
|
Integration tests for the bchjs covering SLP tokens.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
const assert = chai.assert
|
|
||||||
|
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
let bchjs
|
|
||||||
|
|
||||||
// Inspect utility used for debugging.
|
// Inspect utility used for debugging.
|
||||||
const util = require('util')
|
import util from 'util'
|
||||||
|
const assert = chai.assert
|
||||||
|
let bchjs
|
||||||
util.inspect.defaultOptions = {
|
util.inspect.defaultOptions = {
|
||||||
showHidden: true,
|
showHidden: true,
|
||||||
colors: true,
|
colors: true,
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
Integration tests for the transaction.js library.
|
Integration tests for the transaction.js library.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
const { assert } = chai
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#Transaction', () => {
|
describe('#Transaction', () => {
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
// Public npm libraries.
|
// Public npm libraries.
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const Bitcoin = require('@psf/bitcoincashjs-lib')
|
// import { assert } from 'chai'
|
||||||
|
import Bitcoin from '@psf/bitcoincashjs-lib'
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
const fixtures = require('./fixtures/address.json')
|
/* eslint-disable */
|
||||||
|
import fixtures from './fixtures/address.json' with { type: 'json' }
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
function flatten (arrays) {
|
function flatten (arrays) {
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
const fixtures = require('./fixtures/bitcoincash.json')
|
/* eslint-disable */
|
||||||
|
import fixtures from './fixtures/bitcoincash.json' with { type: 'json' }
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
// const bchjs = new BCHJS()
|
// const bchjs = new BCHJS()
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const assert2 = require('chai').assert
|
import chai from 'chai'
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const bchjs = new BCHJS()
|
import sinon from 'sinon'
|
||||||
const sinon = require('sinon')
|
|
||||||
|
|
||||||
const mockData = require('./fixtures/blockchain-mock')
|
import mockData from './fixtures/blockchain-mock.js'
|
||||||
|
const { assert: assert2 } = chai
|
||||||
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#Blockchain', () => {
|
describe('#Blockchain', () => {
|
||||||
describe('#getBestBlockHash', () => {
|
describe('#getBestBlockHash', () => {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
import sinon from 'sinon'
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
const sinon = require('sinon')
|
|
||||||
|
|
||||||
describe('#Control', () => {
|
describe('#Control', () => {
|
||||||
let sandbox
|
let sandbox
|
||||||
|
|||||||
+6
-4
@@ -1,8 +1,10 @@
|
|||||||
const fixtures = require('./fixtures/crypto.json')
|
/* eslint-disable */
|
||||||
const assert = require('assert')
|
import fixtures from './fixtures/crypto.json' with { type: 'json' }
|
||||||
const BCHJS = require('../../src/bch-js')
|
/* eslint-enable */
|
||||||
|
import assert from 'assert'
|
||||||
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
const Buffer = require('safe-buffer').Buffer
|
import { Buffer } from 'safe-buffer'
|
||||||
|
|
||||||
describe('#Crypto', () => {
|
describe('#Crypto', () => {
|
||||||
describe('#sha256', () => {
|
describe('#sha256', () => {
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const sinon = require('sinon')
|
import sinon from 'sinon'
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const mockData = require('./fixtures/dsproof-mock')
|
import mockData from './fixtures/dsproof-mock.js'
|
||||||
|
const { assert } = chai
|
||||||
|
|
||||||
let bchjs
|
let bchjs
|
||||||
const txid = 'ee0df780b58f6f24467605b2589c44c3a50fc849fb8f91b89669a4ae0d86bc7e'
|
const txid = 'ee0df780b58f6f24467605b2589c44c3a50fc849fb8f91b89669a4ae0d86bc7e'
|
||||||
|
|||||||
+3
-2
@@ -3,8 +3,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Global npm libraries
|
// Global npm libraries
|
||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const Ecash = require('../../src/ecash')
|
import Ecash from '../../src/ecash.js'
|
||||||
|
const { assert } = chai
|
||||||
const uut = new Ecash()
|
const uut = new Ecash()
|
||||||
|
|
||||||
describe('#eCash', () => {
|
describe('#eCash', () => {
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
// Public npm libraries.
|
// Public npm libraries.
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const Buffer = require('safe-buffer').Buffer
|
import { Buffer } from 'safe-buffer'
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
const fixtures = require('./fixtures/ecpair.json')
|
/* eslint-disable */
|
||||||
|
import fixtures from './fixtures/ecpair.json' with { type: 'json' }
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
// const bchjs = new BCHJS()
|
// const bchjs = new BCHJS()
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
import axios from 'axios'
|
||||||
|
import sinon from 'sinon'
|
||||||
|
|
||||||
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
|
||||||
|
import mockData from './fixtures/electrumx-mock.js'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
const axios = require('axios')
|
|
||||||
const sinon = require('sinon')
|
|
||||||
|
|
||||||
const BCHJS = require('../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
const mockData = require('./fixtures/electrumx-mock')
|
|
||||||
|
|
||||||
describe('#ElectrumX', () => {
|
describe('#ElectrumX', () => {
|
||||||
let sandbox
|
let sandbox
|
||||||
beforeEach(() => (sandbox = sinon.createSandbox()))
|
beforeEach(() => (sandbox = sinon.createSandbox()))
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const sinon = require('sinon')
|
import sinon from 'sinon'
|
||||||
|
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
|
||||||
|
import mockData from './fixtures/encryption-mock.js'
|
||||||
|
const { assert } = chai
|
||||||
// const bchjs = new BCHJS()
|
// const bchjs = new BCHJS()
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
const mockData = require('./fixtures/encryption-mock')
|
|
||||||
|
|
||||||
describe('#Encryption', () => {
|
describe('#Encryption', () => {
|
||||||
let sandbox
|
let sandbox
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ const utxo = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
balance,
|
balance,
|
||||||
utxo
|
utxo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Mock data used for unit testing.
|
Mock data used for unit testing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
details: {
|
details: {
|
||||||
hash: '000000001c6aeec19265e9cc3ded8ba5ef5e63fae7747f30bf9c02c7bc8883f0',
|
hash: '000000001c6aeec19265e9cc3ded8ba5ef5e63fae7747f30bf9c02c7bc8883f0',
|
||||||
size: 216,
|
size: 216,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
Mock data used for unit testing.
|
Mock data used for unit testing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
bestBlockHash:
|
bestBlockHash:
|
||||||
'0000000000000000008e1f65f875703872544aa888c7ca6587f055f8f5fbd4bf',
|
'0000000000000000008e1f65f875703872544aa888c7ca6587f055f8f5fbd4bf',
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ const dsproof = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
dsproof
|
dsproof
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ const txHistoryWithUnconfirmed = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
utxo,
|
utxo,
|
||||||
utxos,
|
utxos,
|
||||||
balance,
|
balance,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const failureMock = {
|
|||||||
publicKey: 'not found'
|
publicKey: 'not found'
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
successMock,
|
successMock,
|
||||||
failureMock
|
failureMock
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ const paidFileData = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
uploadData,
|
uploadData,
|
||||||
paymentInfo,
|
paymentInfo,
|
||||||
mockNewFileModel,
|
mockNewFileModel,
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const tx = {
|
|||||||
'0200000001ac1e2e38764f9b81f3ff4317b4bd1a381dbdf311277a736f375d4ce217d3095f010000006a473044022000dd11c41a472f2e54348db996e60864d489429f12d1e044d49ff600b880c9590220715a926404bb0e2731a3795afb341ec1dad3f84ead7d27cd31fcc59abb14738c4121038476128287ac37c7a3cf7e8625fd5f024db1bc3d8e37395abe7bf42fda78d0d9ffffffff02e8030000000000001976a9142fe2c4c5ef359bb2fe1a849f891cecffbcfb4f7788acb0b40000000000001976a9142dbf5e1804c39a497b908c876097d63210c8490288ac00000000'
|
'0200000001ac1e2e38764f9b81f3ff4317b4bd1a381dbdf311277a736f375d4ce217d3095f010000006a473044022000dd11c41a472f2e54348db996e60864d489429f12d1e044d49ff600b880c9590220715a926404bb0e2731a3795afb341ec1dad3f84ead7d27cd31fcc59abb14738c4121038476128287ac37c7a3cf7e8625fd5f024db1bc3d8e37395abe7bf42fda78d0d9ffffffff02e8030000000000001976a9142fe2c4c5ef359bb2fe1a849f891cecffbcfb4f7788acb0b40000000000001976a9142dbf5e1804c39a497b908c876097d63210c8490288ac00000000'
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
balance,
|
balance,
|
||||||
utxo,
|
utxo,
|
||||||
tx
|
tx
|
||||||
|
|||||||
@@ -209,6 +209,6 @@ const mockRates = {
|
|||||||
ZWL: '80215.03'
|
ZWL: '80215.03'
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
mockRates
|
mockRates
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ const tokenMedia01 = {
|
|||||||
ps002Compatible: true
|
ps002Compatible: true
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
tokenStats,
|
tokenStats,
|
||||||
txData,
|
txData,
|
||||||
balance,
|
balance,
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ const mockGetInputAddrsOutput = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
mockTx,
|
mockTx,
|
||||||
mockParentTx1,
|
mockParentTx1,
|
||||||
mockGetInputAddrsOutput
|
mockGetInputAddrsOutput
|
||||||
|
|||||||
@@ -1411,7 +1411,7 @@ mock503Error.response = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
mockList,
|
mockList,
|
||||||
mockToken,
|
mockToken,
|
||||||
mockTokens,
|
mockTokens,
|
||||||
|
|||||||
@@ -769,7 +769,7 @@ const genesisTestOpReturn03 = {
|
|||||||
qty: '100000000000000000'
|
qty: '100000000000000000'
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
nonSlpTxDetails,
|
nonSlpTxDetails,
|
||||||
slpTxDetails,
|
slpTxDetails,
|
||||||
mockOpReturnData01,
|
mockOpReturnData01,
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ const noUtxoErr = {
|
|||||||
'Key not found in database [bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7]'
|
'Key not found in database [bitcoincash:qp3sn6vlwz28ntmf3wmyra7jqttfx7z6zgtkygjhc7]'
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
mockUtxoData,
|
mockUtxoData,
|
||||||
mockHydratedUtxos,
|
mockHydratedUtxos,
|
||||||
mockTwoHydratedAddrs,
|
mockTwoHydratedAddrs,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
const sinon = require('sinon')
|
import sinon from 'sinon'
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
// const bchjs = new BCHJS()
|
// const bchjs = new BCHJS()
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
|
|||||||
+7
-5
@@ -1,13 +1,15 @@
|
|||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const Buffer = require('safe-buffer').Buffer
|
import { Buffer } from 'safe-buffer'
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
const fixtures = require('./fixtures/hdnode.json')
|
/* eslint-disable */
|
||||||
// const slpFixtures = require('./fixtures/slp/address.json')
|
import fixtures from './fixtures/hdnode.json' with { type: 'json' }
|
||||||
|
/* eslint-enable */
|
||||||
|
// import slpFixtures from './fixtures/slp/address.json' with { type: 'json' }
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
describe('#HDNode', () => {
|
describe('#HDNode', () => {
|
||||||
|
|||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
const sinon = require('sinon')
|
import sinon from 'sinon'
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
describe('#Mining', () => {
|
describe('#Mining', () => {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
const fixtures = require('./fixtures/mnemonic.json')
|
/* eslint-disable */
|
||||||
const assert = require('assert')
|
import fixtures from './fixtures/mnemonic.json' with { type: 'json' }
|
||||||
const BCHJS = require('../../src/bch-js')
|
/* eslint-enable */
|
||||||
|
import assert from 'assert'
|
||||||
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
describe('#Mnemonic', () => {
|
describe('#Mnemonic', () => {
|
||||||
|
|||||||
+5
-4
@@ -1,8 +1,9 @@
|
|||||||
const assert = require('chai').assert
|
import chai from 'chai'
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
const sinon = require('sinon')
|
import sinon from 'sinon'
|
||||||
|
|
||||||
const mockDataLib = require('./fixtures/price-mocks')
|
import mockDataLib from './fixtures/price-mocks.js'
|
||||||
|
const { assert } = chai
|
||||||
let mockData
|
let mockData
|
||||||
|
|
||||||
describe('#price', () => {
|
describe('#price', () => {
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
const chai = require('chai')
|
import chai from 'chai'
|
||||||
|
import axios from 'axios'
|
||||||
|
import sinon from 'sinon'
|
||||||
|
|
||||||
|
import BCHJS from '../../src/bch-js.js'
|
||||||
|
|
||||||
|
import mockData from './fixtures/psf-slp-indexer-mock.js'
|
||||||
const assert = chai.assert
|
const assert = chai.assert
|
||||||
const axios = require('axios')
|
|
||||||
const sinon = require('sinon')
|
|
||||||
|
|
||||||
const BCHJS = require('../../src/bch-js')
|
|
||||||
const bchjs = new BCHJS()
|
const bchjs = new BCHJS()
|
||||||
|
|
||||||
const mockData = require('./fixtures/psf-slp-indexer-mock')
|
|
||||||
|
|
||||||
describe('#PsfSlpIndexer', () => {
|
describe('#PsfSlpIndexer', () => {
|
||||||
let sandbox
|
let sandbox
|
||||||
beforeEach(() => (sandbox = sinon.createSandbox()))
|
beforeEach(() => (sandbox = sinon.createSandbox()))
|
||||||
|
|||||||
@@ -3,22 +3,23 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const assert2 = require('chai').assert
|
import chai from 'chai'
|
||||||
const axios = require('axios')
|
import axios from 'axios'
|
||||||
const sinon = require('sinon')
|
import sinon from 'sinon'
|
||||||
// const nock = require("nock") // HTTP mocking
|
// import nock from "nock" // HTTP mocking
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
// const bchjs = new BCHJS()
|
|
||||||
let bchjs
|
|
||||||
|
|
||||||
// Used for debugging
|
// Used for debugging
|
||||||
// const util = require("util")
|
// const util = require("util")
|
||||||
// util.inspect.defaultOptions = { depth: 1 }
|
// util.inspect.defaultOptions = { depth: 1 }
|
||||||
|
|
||||||
const mockData = require('./fixtures/rawtransaction-mock')
|
import mockData from './fixtures/rawtransaction-mock.js'
|
||||||
|
const { assert: assert2 } = chai
|
||||||
|
// const bchjs = new BCHJS()
|
||||||
|
let bchjs
|
||||||
|
|
||||||
describe('#RawTransactions', () => {
|
describe('#RawTransactions', () => {
|
||||||
let sandbox
|
let sandbox
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
// Public npm libraries
|
// Public npm libraries
|
||||||
const assert = require('assert')
|
import assert from 'assert'
|
||||||
const Buffer = require('safe-buffer').Buffer
|
import { Buffer } from 'safe-buffer'
|
||||||
|
|
||||||
// Mocks
|
// Mocks
|
||||||
const fixtures = require('./fixtures/script.json')
|
/* eslint-disable */
|
||||||
|
import fixtures from './fixtures/script.json' with { type: 'json' }
|
||||||
|
/* eslint-enable */
|
||||||
|
|
||||||
// Unit under test (uut)
|
// Unit under test (uut)
|
||||||
const BCHJS = require('../../src/bch-js')
|
import BCHJS from '../../src/bch-js.js'
|
||||||
let bchjs
|
let bchjs
|
||||||
|
|
||||||
describe('#Script', () => {
|
describe('#Script', () => {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user