zano_web3 1.3.0 → 2.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.
@@ -0,0 +1,2 @@
1
+ import zanoWallet from "./src/zanoWallet";
2
+ export default zanoWallet;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
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 zanoWallet_1 = __importDefault(require("./src/zanoWallet"));
7
+ exports.default = zanoWallet_1.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zano_web3",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,10 +21,12 @@
21
21
  "author": "",
22
22
  "license": "ISC",
23
23
  "devDependencies": {
24
+ "@types/react": "^18.3.3",
24
25
  "@types/uuid": "^10.0.0",
25
26
  "typescript": "^5.5.4"
26
27
  },
27
28
  "dependencies": {
29
+ "react": "^18.3.1",
28
30
  "uuid": "^10.0.0"
29
31
  },
30
32
  "bugs": {
package/src/hooks.ts ADDED
@@ -0,0 +1,18 @@
1
+ import ZanoWallet, { ZanoWalletParams } from './zanoWallet';
2
+ import { useEffect, useState } from 'react';
3
+
4
+ function useZanoWallet(params: ZanoWalletParams) {
5
+ const [zanoWallet, setZanoWallet] = useState<ZanoWallet | null>(null);
6
+
7
+ useEffect(() => {
8
+ if (typeof window === 'undefined') {
9
+ return;
10
+ }
11
+
12
+ setZanoWallet(new ZanoWallet(params));
13
+ }, []);
14
+
15
+ return zanoWallet;
16
+ }
17
+
18
+ export { useZanoWallet };
package/src/zanoWallet.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { v4 as uuidv4 } from 'uuid';
2
2
 
3
- interface ZanoWalletParams {
3
+ export interface ZanoWalletParams {
4
4
  authPath: string;
5
5
  useLocalStorage?: boolean; // default: true
6
6
  aliasRequired?: boolean;
File without changes
File without changes