Files
2024-07-26 16:00:22 +10:00

23 lines
653 B
JavaScript

import { isWalletConnectSession, getLocal, setLocal, removeLocal } from "@luxwallet/wc-utils";
class SessionStorage {
constructor(storageId = "walletconnect") {
this.storageId = storageId;
}
getSession() {
let session = null;
const json = getLocal(this.storageId);
if (json && isWalletConnectSession(json)) {
session = json;
}
return session;
}
setSession(session) {
setLocal(this.storageId, session);
return session;
}
removeSession() {
removeLocal(this.storageId);
}
}
export default SessionStorage;
//# sourceMappingURL=storage.js.map