@vela-ventures/aosync-sdk-react 1.0.18 → 1.0.21

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.
@@ -13,8 +13,9 @@ import Arweave from "arweave";
13
13
  import WalletClient from "@vela-ventures/ao-sync-sdk";
14
14
  export const AOSyncContext = createContext(undefined);
15
15
  export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 443, protocol: "https" }, muUrl = "https://mu.ao-testnet.xyz", children, appInfo, }) {
16
- const [isConnected, setIsConnected] = useState(false);
16
+ var _a;
17
17
  const walletRef = useRef(new WalletClient());
18
+ const [isConnected, setIsConnected] = useState(!!((_a = walletRef === null || walletRef === void 0 ? void 0 : walletRef.current) === null || _a === void 0 ? void 0 : _a.uid));
18
19
  useEffect(() => {
19
20
  const wallet = walletRef.current;
20
21
  wallet.reconnect();
@@ -107,12 +108,12 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
107
108
  function extractAndHashId(byteArray) {
108
109
  return __awaiter(this, void 0, void 0, function* () {
109
110
  const idBytes = byteArray.slice(2, 2 + 512);
110
- const hashBuffer = yield crypto.subtle.digest('SHA-256', idBytes);
111
+ const hashBuffer = yield crypto.subtle.digest("SHA-256", idBytes);
111
112
  const hashArray = Array.from(new Uint8Array(hashBuffer));
112
113
  const hashBase64 = btoa(String.fromCharCode.apply(null, hashArray))
113
- .replace(/\+/g, '-')
114
- .replace(/\//g, '_')
115
- .replace(/=+$/, '');
114
+ .replace(/\+/g, "-")
115
+ .replace(/\//g, "_")
116
+ .replace(/=+$/, "");
116
117
  return hashBase64;
117
118
  });
118
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vela-ventures/aosync-sdk-react",
3
- "version": "1.0.18",
3
+ "version": "1.0.21",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"
@@ -65,6 +65,6 @@
65
65
  "react": "^17.0.0 || ^18.0.0 || ^19.0.0"
66
66
  },
67
67
  "dependencies": {
68
- "@vela-ventures/ao-sync-sdk": "^1.1.18"
68
+ "@vela-ventures/ao-sync-sdk": "^1.1.21"
69
69
  }
70
70
  }