@zilliqa-js/util
Advanced tools
Comparing version 0.6.3 to 0.7.0
"use strict"; | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +17,0 @@ /** |
"use strict"; | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +17,0 @@ var tslib_1 = require("tslib"); |
"use strict"; | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -3,0 +17,0 @@ var tslib_1 = require("tslib"); |
import BN from 'bn.js'; | ||
import Long from 'long'; | ||
export declare const isAddress: (address: string) => boolean; | ||
export declare const isBech32: (raw: string) => boolean; | ||
export declare const isBech32: (raw: string, testnet?: boolean) => boolean; | ||
export declare const isBase58: (raw: string) => boolean; | ||
@@ -6,0 +6,0 @@ export declare const isPrivateKey: (privateKey: string) => boolean; |
"use strict"; | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -9,4 +23,7 @@ var tslib_1 = require("tslib"); | ||
}; | ||
exports.isBech32 = function (raw) { | ||
return !!raw.match(/^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/); | ||
exports.isBech32 = function (raw, testnet) { | ||
if (testnet === void 0) { testnet = false; } | ||
return testnet | ||
? !!raw.match(/^tzil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/) | ||
: !!raw.match(/^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/); | ||
}; | ||
@@ -13,0 +30,0 @@ exports.isBase58 = function (raw) { |
{ | ||
"name": "@zilliqa-js/util", | ||
"version": "0.6.3", | ||
"version": "0.7.0", | ||
"description": "Utilities for working with Zillia.", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
}, | ||
"gitHead": "62d971bd2b54591a4be12a82fefcc8df82e23abe" | ||
"gitHead": "4adf20d9183e36c73a2f6cfbad107a93bc03975d" | ||
} |
@@ -18,2 +18,6 @@ # @zilliqa-js/util | ||
### `PRESETS` | ||
Commonly used variables such as DEVNET_URL. See [source](./src/presets.ts) for more info. | ||
## Functions | ||
@@ -20,0 +24,0 @@ |
@@ -0,1 +1,16 @@ | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
/** | ||
@@ -2,0 +17,0 @@ * intToHexArray |
@@ -0,1 +1,16 @@ | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
import * as bytes from './bytes'; | ||
@@ -2,0 +17,0 @@ import * as validation from './validation'; |
@@ -0,1 +1,16 @@ | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
/** | ||
@@ -2,0 +17,0 @@ * Adapted from https://github.com/ethjs/ethjs-unit/blob/master/src/index.js |
@@ -0,1 +1,16 @@ | ||
// This file is part of Zilliqa-Javascript-Library. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
import BN from 'bn.js'; | ||
@@ -8,4 +23,6 @@ import Long from 'long'; | ||
export const isBech32 = (raw: string) => { | ||
return !!raw.match(/^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/); | ||
export const isBech32 = (raw: string, testnet: boolean = false) => { | ||
return testnet | ||
? !!raw.match(/^tzil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/) | ||
: !!raw.match(/^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}/); | ||
}; | ||
@@ -12,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
1436174
1861
36
10032
257
6