diff --git a/index.js b/index.js index 9346ea1..48523f4 100755 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ const repl = require("repl") const SLP = require("./lib/SLP").default const clone = require("git-clone") -program.version("1.1.6", "-v, --version") +program.version("1.1.7", "-v, --version") program .command("new ") diff --git a/lib/Address.js b/lib/Address.js index f21be15..afcdda3 100644 --- a/lib/Address.js +++ b/lib/Address.js @@ -51,7 +51,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var BITBOXAddress = require("bitbox-sdk/lib/Address").default; var BITBOXSDK = require("bitbox-sdk/lib/bitbox-sdk").default; var BITBOX = new BITBOXSDK(); -var utils = require("slpjs").slpjs.Utils; +var utils = require("slpjs").Utils; var Address = /** @class */ (function (_super) { __extends(Address, _super); function Address(restURL) { diff --git a/lib/TokenType1.js b/lib/TokenType1.js index 0b5f85d..890833a 100644 --- a/lib/TokenType1.js +++ b/lib/TokenType1.js @@ -38,7 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); // require deps var BITBOXSDK = require("bitbox-sdk/lib/bitbox-sdk").default; var BigNumber = require("bignumber.js"); -var slpjs = require("slpjs").slpjs; +var slpjs = require("slpjs"); // import classes var Address_1 = require("./Address"); var addy = new Address_1.default(); diff --git a/lib/Utils.js b/lib/Utils.js index 3fdb1e7..2a33bc6 100644 --- a/lib/Utils.js +++ b/lib/Utils.js @@ -37,8 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", { value: true }); // require deps var BITBOXSDK = require("bitbox-sdk/lib/bitbox-sdk").default; -var utils = require("slpjs").slpjs.Utils; -var slpjs = require("slpjs").slpjs; +var utils = require("slpjs").Utils; +var slpjs = require("slpjs"); var BigNumber = require("bignumber.js"); var axios_1 = require("axios"); // import classes diff --git a/package-lock.json b/package-lock.json index 39acc93..20e35de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "slp-sdk", - "version": "1.1.6", + "version": "1.1.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -172,9 +172,9 @@ } }, "@types/node": { - "version": "10.12.21", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.21.tgz", - "integrity": "sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==", + "version": "10.12.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.24.tgz", + "integrity": "sha512-GWWbvt+z9G5otRBW8rssOFgRY87J9N/qbhqfjMZ+gUuL6zoL+Hm6gP/8qQBG4jjimqdaNLCehcVapZ/Fs2WjCQ==", "dev": true }, "abbrev": { @@ -1926,9 +1926,9 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, "core-js": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz", - "integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==" + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.4.tgz", + "integrity": "sha512-05qQ5hXShcqGkPZpXEFLIpxayZscVD2kuMBZewxiIPPEagukO4mqgPA9CWhUvFBJfy3ODdK2p9xyHh7FTU9/7A==" }, "core-util-is": { "version": "1.0.2", @@ -2401,9 +2401,9 @@ }, "dependencies": { "acorn": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.7.tgz", - "integrity": "sha512-HNJNgE60C9eOTgn974Tlp3dpLZdUr+SoxxDwPaY9J/kDNOLQTkaDgwBUXAF4SSsrAwD9RpdxuHK/EbuF+W9Ahw==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", + "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", "dev": true }, "acorn-jsx": { @@ -2413,9 +2413,9 @@ "dev": true }, "ajv": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", - "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.0.tgz", + "integrity": "sha512-VsK2jpqRno3Hn+at4NGtBRpR5q3OW7n5INrTKqENDNQJB99DXATQEVHlnoD1BA7Uo/qGO+ijGA/vgSAlxP9E4A==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -4328,9 +4328,9 @@ }, "dependencies": { "ajv": { - "version": "6.8.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.8.1.tgz", - "integrity": "sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ==", + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.0.tgz", + "integrity": "sha512-VsK2jpqRno3Hn+at4NGtBRpR5q3OW7n5INrTKqENDNQJB99DXATQEVHlnoD1BA7Uo/qGO+ijGA/vgSAlxP9E4A==", "dev": true, "requires": { "fast-deep-equal": "^2.0.1", @@ -7971,9 +7971,9 @@ } }, "slpjs": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/slpjs/-/slpjs-0.11.2.tgz", - "integrity": "sha512-HRrJbZaeysjkZEioPDOupcsxd37lE0HgbItcf5fLlKKDTOYH6bltEBIrzhhrkVuPzr9eLzMgngO3LDK9MZf58g==", + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/slpjs/-/slpjs-0.12.2.tgz", + "integrity": "sha512-mmfYth58+oEYvMTk7SdE2cx+6bC22SKyJjkQUfibfvgIQFFaj70F33wn7nGM5qFrqAOM2meMKhd2ommDnxIoaw==", "requires": { "axios": "^0.18.0", "bchaddrjs-slp": "git://github.com/simpleledger/bchaddrjs.git#master", @@ -8484,15 +8484,15 @@ } }, "tape": { - "version": "4.9.2", - "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.2.tgz", - "integrity": "sha512-lPXKRKILZ1kZaUy5ynWKs8ATGSUO7HAFHCFnBam6FaGSqPdOwMWbxXHq4EXFLE8WRTleo/YOMXkaUTRmTB1Fiw==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/tape/-/tape-4.10.0.tgz", + "integrity": "sha512-3PgdF0vcZ1t7HEYbpTXdo58KXi19QCGcZfj07A53M2DH14P2Fw3cB3f9pF7e/Br2z+PQm7xlvhjzHH3D8ti99g==", "requires": { "deep-equal": "~1.0.1", "defined": "~1.0.0", "for-each": "~0.3.3", "function-bind": "~1.1.1", - "glob": "~7.1.2", + "glob": "~7.1.3", "has": "~1.0.3", "inherits": "~2.0.3", "minimist": "~1.2.0", @@ -8697,9 +8697,9 @@ "integrity": "sha512-7uc1O8h1M1g0rArakJdf0uLRSSgFcYexrVoKo+bzJd32gd4gDy2L/Z+8/FjPnU9ydY3pEnVPtr9FyscYY60K1g==" }, "typescript": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.1.tgz", - "integrity": "sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3.tgz", + "integrity": "sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==", "dev": true }, "unc-path-regex": { diff --git a/package.json b/package.json index d275f3a..57236af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "slp-sdk", - "version": "1.1.6", + "version": "1.1.7", "description": "SLP SDK powered by BITBOX", "main": "index.js", "scripts": { @@ -34,7 +34,7 @@ "mkdirp": "^0.5.1", "node-emoji": "^1.8.1", "repl.history": "^0.1.4", - "slpjs": "0.11.2", + "slpjs": "0.12.2", "touch": "^3.1.0" }, "devDependencies": { diff --git a/src/Address.ts b/src/Address.ts index b3989aa..8ec8411 100644 --- a/src/Address.ts +++ b/src/Address.ts @@ -1,7 +1,7 @@ const BITBOXAddress = require("bitbox-sdk/lib/Address").default const BITBOXSDK = require("bitbox-sdk/lib/bitbox-sdk").default const BITBOX = new BITBOXSDK() -const utils = require("slpjs").slpjs.Utils +const utils = require("slpjs").Utils class Address extends BITBOXAddress { restURL: string diff --git a/src/TokenType1.ts b/src/TokenType1.ts index a78aefa..0421e80 100644 --- a/src/TokenType1.ts +++ b/src/TokenType1.ts @@ -1,7 +1,7 @@ // require deps const BITBOXSDK: any = require("bitbox-sdk/lib/bitbox-sdk").default const BigNumber: any = require("bignumber.js") -const slpjs: any = require("slpjs").slpjs +const slpjs: any = require("slpjs") // import interfaces import { ICreateConfig } from "./interfaces/SLPInterfaces" diff --git a/src/Utils.ts b/src/Utils.ts index 0a0555b..30cb7da 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -1,7 +1,7 @@ // require deps const BITBOXSDK = require("bitbox-sdk/lib/bitbox-sdk").default -const utils = require("slpjs").slpjs.Utils -const slpjs = require("slpjs").slpjs +const utils = require("slpjs").Utils +const slpjs = require("slpjs") const BigNumber: any = require("bignumber.js") import axios from "axios" diff --git a/test/Utils.js b/test/Utils.js index 54576a5..ca40c3e 100644 --- a/test/Utils.js +++ b/test/Utils.js @@ -13,7 +13,10 @@ describe("#Utils", () => { "timestamp", "symbol", "name", - "document" + "documentUri", + "documentHash", + "decimals", + "initialTokenQty" ]) } catch (error) { throw error @@ -30,7 +33,10 @@ describe("#Utils", () => { "timestamp", "symbol", "name", - "document" + "documentUri", + "documentHash", + "decimals", + "initialTokenQty" ]) } catch (error) { throw error @@ -39,18 +45,18 @@ describe("#Utils", () => { }) describe("#balancesForAddress", () => { - it(`should fetch all balances for address: simpleledger:qr5agtachyxvrwxu76vzszan5pnvuzy8duhv4lxrsk`, async () => { + it(`should fetch all balances for address: simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9`, async () => { try { const balances = await SLP.Utils.balancesForAddress( - "simpleledger:qr5agtachyxvrwxu76vzszan5pnvuzy8duhv4lxrsk" + "simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9" ) const data = { tokenId: - "968ff0cc4c93864001e03e9524e351250b94ec56150fa4897f65b0b6477d44d4", - balance: "8987", - decimalCount: 9 + "df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb", + balance: "1", + decimalCount: 8 } - assert.deepEqual(balances[0], data) + assert.deepEqual(balances[1], data) } catch (error) { throw error } @@ -58,17 +64,17 @@ describe("#Utils", () => { }) describe("#balance", () => { - it(`should fetch balance of single token for address: simpleledger:qr5agtachyxvrwxu76vzszan5pnvuzy8duhv4lxrsk`, async () => { + it(`should fetch balance of single token for address: simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9`, async () => { try { const balance = await SLP.Utils.balance( - "simpleledger:qr5agtachyxvrwxu76vzszan5pnvuzy8duhv4lxrsk", + "simpleledger:qzv3zz2trz0xgp6a96lu4m6vp2nkwag0kvyucjzqt9", "df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb" ) const data = { tokenId: "df808a41672a0a0ae6475b44f272a107bc9961b90f29dc918d71301f24fe92fb", - balance: "417", + balance: "1", decimalCount: 8 } assert.deepEqual(balance, data)