@vela-ventures/aosync-sdk-react 1.0.29 → 1.0.31
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/dist/types.d.ts +2 -0
- package/dist/walletContext.js +14 -8
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import WalletClient from "@vela-ventures/ao-sync-sdk";
|
|
1
2
|
import { DataItem, UserTokensResult } from "arconnect";
|
|
2
3
|
import Transaction from "arweave/web/lib/transaction";
|
|
3
4
|
export interface AOSyncSDKContext {
|
|
@@ -11,6 +12,7 @@ export interface AOSyncSDKContext {
|
|
|
11
12
|
getWalletNames: () => Promise<{
|
|
12
13
|
[addr: string]: string;
|
|
13
14
|
}>;
|
|
15
|
+
getWallets: () => ReturnType<WalletClient['getWallets']>;
|
|
14
16
|
userTokens: () => Promise<UserTokensResult>;
|
|
15
17
|
signAOMessage: (dataItem: DataItem) => Promise<string>;
|
|
16
18
|
sign: (transaction: Transaction) => Promise<Transaction>;
|
package/dist/walletContext.js
CHANGED
|
@@ -36,16 +36,12 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
|
|
|
36
36
|
};
|
|
37
37
|
}, []);
|
|
38
38
|
useEffect(() => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
event.storageArea === sessionStorage) {
|
|
42
|
-
const newValue = event.newValue ? JSON.parse(event.newValue) : false;
|
|
43
|
-
setIsSessionActive(newValue);
|
|
44
|
-
}
|
|
39
|
+
const handleSessionChange = (event) => {
|
|
40
|
+
setIsSessionActive(event.detail.isActive);
|
|
45
41
|
};
|
|
46
|
-
window.addEventListener("
|
|
42
|
+
window.addEventListener("aosync-session-change", handleSessionChange);
|
|
47
43
|
return () => {
|
|
48
|
-
window.removeEventListener("
|
|
44
|
+
window.removeEventListener("aosync-session-change", handleSessionChange);
|
|
49
45
|
};
|
|
50
46
|
}, []);
|
|
51
47
|
const connect = () => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -155,6 +151,15 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
|
|
|
155
151
|
throw error;
|
|
156
152
|
}
|
|
157
153
|
});
|
|
154
|
+
const getWallets = () => __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
try {
|
|
156
|
+
return yield walletRef.current.getWallets();
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error("Error getting wallets:", error);
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
});
|
|
158
163
|
const userTokens = () => __awaiter(this, void 0, void 0, function* () {
|
|
159
164
|
try {
|
|
160
165
|
return yield walletRef.current.userTokens();
|
|
@@ -172,6 +177,7 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
|
|
|
172
177
|
getAddress,
|
|
173
178
|
getAllAddresses,
|
|
174
179
|
getWalletNames,
|
|
180
|
+
getWallets,
|
|
175
181
|
userTokens,
|
|
176
182
|
sendAR,
|
|
177
183
|
signAOMessage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vela-ventures/aosync-sdk-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
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.
|
|
68
|
+
"@vela-ventures/ao-sync-sdk": "^1.1.31"
|
|
69
69
|
}
|
|
70
70
|
}
|