+
diff --git a/src/stores/serializer.js b/src/stores/serializer.js
new file mode 100644
index 0000000..1f0a71f
--- /dev/null
+++ b/src/stores/serializer.js
@@ -0,0 +1,13 @@
+export default {
+ serialize: (state) => {
+ try {
+ return JSON.stringify(state, (_, v) => (typeof v === 'bigint' ? v.toString() : v))
+ } catch (e) {
+ console.error(`failure serializing state`, e)
+ }
+ },
+ deserialize: (serialized) => {
+ // TODO: deserialize bigints properly
+ return JSON.parse(serialized)
+ }
+}
\ No newline at end of file
diff --git a/src/utils/ids.js b/src/utils/ids.js
index c43ad13..7924ab2 100644
--- a/src/utils/ids.js
+++ b/src/utils/ids.js
@@ -30,3 +30,8 @@ export function slotId(requestId, slotIdx) {
const encoding = coder.encode([types], [values])
return keccak256(encoding)
}
+
+// Generate a random string id
+export function generateUniqueId() {
+ return Math.random().toString(36).substr(2, 9);
+}
\ No newline at end of file