@bizjs/chainkit 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +18 -0
  3. package/dist/ChainSdkFactory.d.ts +14 -0
  4. package/dist/ChainSdkFactory.js +42 -0
  5. package/dist/ChainSdkFactory.js.map +1 -0
  6. package/dist/chain-sdks/AptosChain.d.ts +5 -0
  7. package/dist/chain-sdks/AptosChain.js +20 -0
  8. package/dist/chain-sdks/AptosChain.js.map +1 -0
  9. package/dist/chain-sdks/BitcoinChain.d.ts +14 -0
  10. package/dist/chain-sdks/BitcoinChain.js +136 -0
  11. package/dist/chain-sdks/BitcoinChain.js.map +1 -0
  12. package/dist/chain-sdks/CardanoChain.d.ts +6 -0
  13. package/dist/chain-sdks/CardanoChain.js +59 -0
  14. package/dist/chain-sdks/CardanoChain.js.map +1 -0
  15. package/dist/chain-sdks/EVMChain.d.ts +6 -0
  16. package/dist/chain-sdks/EVMChain.js +23 -0
  17. package/dist/chain-sdks/EVMChain.js.map +1 -0
  18. package/dist/chain-sdks/SolanaChain.d.ts +4 -0
  19. package/dist/chain-sdks/SolanaChain.js +16 -0
  20. package/dist/chain-sdks/SolanaChain.js.map +1 -0
  21. package/dist/chain-sdks/StarknetChain.d.ts +11 -0
  22. package/dist/chain-sdks/StarknetChain.js +204 -0
  23. package/dist/chain-sdks/StarknetChain.js.map +1 -0
  24. package/dist/chain-sdks/TVMChain.d.ts +13 -0
  25. package/dist/chain-sdks/TVMChain.js +89 -0
  26. package/dist/chain-sdks/TVMChain.js.map +1 -0
  27. package/dist/constants/index.d.ts +9 -0
  28. package/dist/constants/index.js +14 -0
  29. package/dist/constants/index.js.map +1 -0
  30. package/dist/index.d.ts +9 -0
  31. package/dist/index.js +24 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/tsconfig.tsbuildinfo +1 -0
  34. package/dist/utils/index.d.ts +3 -0
  35. package/dist/utils/index.js +19 -0
  36. package/dist/utils/index.js.map +1 -0
  37. package/package.json +62 -0
@@ -0,0 +1,3 @@
1
+ export declare function toLowerCase(str: string): string;
2
+ export declare function safeParseJSON(jsonStr: string, fallbackVal?: any): any;
3
+ export declare const naclSignDetachedVerify: (msg: Uint8Array, sig: Uint8Array, publicKey: Uint8Array) => boolean;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.naclSignDetachedVerify = void 0;
4
+ exports.toLowerCase = toLowerCase;
5
+ exports.safeParseJSON = safeParseJSON;
6
+ const nacl = require("tweetnacl");
7
+ function toLowerCase(str) {
8
+ return String(str || '').toLowerCase();
9
+ }
10
+ function safeParseJSON(jsonStr, fallbackVal = null) {
11
+ try {
12
+ return JSON.parse(jsonStr);
13
+ }
14
+ catch (ex) {
15
+ return fallbackVal;
16
+ }
17
+ }
18
+ exports.naclSignDetachedVerify = nacl.sign.detached.verify;
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;AAGA,kCAEC;AAED,sCAMC;AAZD,kCAAkC;AAElC,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC,CAAC;AAED,SAAgB,aAAa,CAAC,OAAe,EAAE,WAAW,GAAG,IAAI;IAC/D,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACZ,OAAO,WAAW,CAAC;IACrB,CAAC;AACH,CAAC;AAKY,QAAA,sBAAsB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@bizjs/chainkit",
3
+ "version": "0.0.1",
4
+ "description": "Blockchain business development toolkit",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "sideEffects": false,
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "scripts": {
12
+ "build": "rimraf ./dist && tsc",
13
+ "pub": "npm run build && npm publish",
14
+ "test": "jest --no-watchman",
15
+ "test:cov": "jest --coverage --no-watchman"
16
+ },
17
+ "keywords": [
18
+ "blockchain",
19
+ "evm",
20
+ "ton",
21
+ "bitcoin"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/bizjs/chainkit.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/bizjs/chainkit/issues"
29
+ },
30
+ "author": "hstarorg <hm910705@163.com>",
31
+ "license": "MIT",
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "devDependencies": {
36
+ "@types/jest": "^29.5.14",
37
+ "@types/node": "^22.10.2",
38
+ "jest": "^29.7.0",
39
+ "rimraf": "^5.0.10",
40
+ "ts-jest": "^29.2.5",
41
+ "typescript": "^5.7.2",
42
+ "viem": "^2.21.58"
43
+ },
44
+ "dependencies": {
45
+ "@aptos-labs/ts-sdk": "^1.33.1",
46
+ "@emurgo/cardano-message-signing-nodejs": "^1.1.0",
47
+ "@emurgo/cardano-serialization-lib-nodejs": "^13.2.0",
48
+ "@okxweb3/coin-bitcoin": "1.0.3",
49
+ "@ton/ton": "^15.1.0",
50
+ "@unisat/wallet-sdk": "^1.8.0",
51
+ "bitcoinjs-lib": "^6.1.7",
52
+ "bitcore-lib": "10.0.0",
53
+ "bs58": "^6.0.0",
54
+ "ecpair": "3.0.0-rc.0",
55
+ "starknet": "^6.11.0",
56
+ "tiny-secp256k1": "^2.2.3",
57
+ "tweetnacl": "^1.0.3"
58
+ },
59
+ "peerDependencies": {
60
+ "viem": "^2.21.57"
61
+ }
62
+ }