@vela-ventures/aosync-sdk-react 1.0.28 → 1.0.30
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 +5 -1
- package/dist/walletContext.js +22 -1
- package/package.json +2 -2
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataItem } from "arconnect";
|
|
1
|
+
import { DataItem, UserTokensResult } from "arconnect";
|
|
2
2
|
import Transaction from "arweave/web/lib/transaction";
|
|
3
3
|
export interface AOSyncSDKContext {
|
|
4
4
|
isConnected: boolean;
|
|
@@ -8,6 +8,10 @@ export interface AOSyncSDKContext {
|
|
|
8
8
|
getAllAddresses: () => Promise<string[]>;
|
|
9
9
|
getAddress: () => Promise<string | undefined>;
|
|
10
10
|
sendAR: (recipient: string, quantity: string) => Promise<any>;
|
|
11
|
+
getWalletNames: () => Promise<{
|
|
12
|
+
[addr: string]: string;
|
|
13
|
+
}>;
|
|
14
|
+
userTokens: () => Promise<UserTokensResult>;
|
|
11
15
|
signAOMessage: (dataItem: DataItem) => Promise<string>;
|
|
12
16
|
sign: (transaction: Transaction) => Promise<Transaction>;
|
|
13
17
|
}
|
package/dist/walletContext.js
CHANGED
|
@@ -37,7 +37,8 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
|
|
|
37
37
|
}, []);
|
|
38
38
|
useEffect(() => {
|
|
39
39
|
const handleStorageChange = (event) => {
|
|
40
|
-
if (event.key === "aosync-session-active" &&
|
|
40
|
+
if (event.key === "aosync-session-active" &&
|
|
41
|
+
event.storageArea === sessionStorage) {
|
|
41
42
|
const newValue = event.newValue ? JSON.parse(event.newValue) : false;
|
|
42
43
|
setIsSessionActive(newValue);
|
|
43
44
|
}
|
|
@@ -145,6 +146,24 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
|
|
|
145
146
|
throw error;
|
|
146
147
|
}
|
|
147
148
|
});
|
|
149
|
+
const getWalletNames = () => __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
try {
|
|
151
|
+
return yield walletRef.current.getWalletNames();
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
console.error("Error getting wallet names:", error);
|
|
155
|
+
throw error;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
const userTokens = () => __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
try {
|
|
160
|
+
return yield walletRef.current.userTokens();
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
console.error("Error getting user tokens:", error);
|
|
164
|
+
throw error;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
148
167
|
return (React.createElement(AOSyncContext.Provider, { value: {
|
|
149
168
|
isConnected,
|
|
150
169
|
isSessionActive,
|
|
@@ -152,6 +171,8 @@ export function AOSyncProvider({ gatewayConfig = { host: "arweave.net", port: 44
|
|
|
152
171
|
disconnect,
|
|
153
172
|
getAddress,
|
|
154
173
|
getAllAddresses,
|
|
174
|
+
getWalletNames,
|
|
175
|
+
userTokens,
|
|
155
176
|
sendAR,
|
|
156
177
|
signAOMessage,
|
|
157
178
|
sign,
|
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.30",
|
|
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.30"
|
|
69
69
|
}
|
|
70
70
|
}
|