@apibara/plugin-sqlite 2.0.0-beta.38 → 2.0.0-beta.40

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/index.cjs CHANGED
@@ -159,10 +159,10 @@ function getState(props) {
159
159
  let cursor;
160
160
  let filter;
161
161
  if (storedCursor?.order_key) {
162
- cursor = {
162
+ cursor = protocol.normalizeCursor({
163
163
  orderKey: BigInt(storedCursor.order_key),
164
- uniqueKey: storedCursor.unique_key
165
- };
164
+ uniqueKey: storedCursor.unique_key ? storedCursor.unique_key : null
165
+ });
166
166
  }
167
167
  if (storedFilter) {
168
168
  filter = deserialize(storedFilter.filter);
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useIndexerContext } from '@apibara/indexer';
2
2
  import { defineIndexerPlugin } from '@apibara/indexer/plugins';
3
- import { isCursor } from '@apibara/protocol';
3
+ import { normalizeCursor, isCursor } from '@apibara/protocol';
4
4
  import { generateIndexerId } from '@apibara/indexer/internal';
5
5
  import { useInternalContext } from '@apibara/indexer/internal/plugins';
6
6
 
@@ -157,10 +157,10 @@ function getState(props) {
157
157
  let cursor;
158
158
  let filter;
159
159
  if (storedCursor?.order_key) {
160
- cursor = {
160
+ cursor = normalizeCursor({
161
161
  orderKey: BigInt(storedCursor.order_key),
162
- uniqueKey: storedCursor.unique_key
163
- };
162
+ uniqueKey: storedCursor.unique_key ? storedCursor.unique_key : null
163
+ });
164
164
  }
165
165
  if (storedFilter) {
166
166
  filter = deserialize(storedFilter.filter);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apibara/plugin-sqlite",
3
- "version": "2.0.0-beta.38",
3
+ "version": "2.0.0-beta.40",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -35,7 +35,7 @@
35
35
  "better-sqlite3": "^9.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@apibara/indexer": "2.0.0-beta.39",
39
- "@apibara/protocol": "2.0.0-beta.39"
38
+ "@apibara/indexer": "2.0.0-beta.40",
39
+ "@apibara/protocol": "2.0.0-beta.40"
40
40
  }
41
41
  }
@@ -1,4 +1,4 @@
1
- import type { Cursor } from "@apibara/protocol";
1
+ import { type Cursor, normalizeCursor } from "@apibara/protocol";
2
2
  import type { Database } from "better-sqlite3";
3
3
 
4
4
  import { assertInTransaction, deserialize, serialize } from "./utils";
@@ -57,10 +57,10 @@ export function getState<TFilter>(props: {
57
57
  let filter: TFilter | undefined;
58
58
 
59
59
  if (storedCursor?.order_key) {
60
- cursor = {
60
+ cursor = normalizeCursor({
61
61
  orderKey: BigInt(storedCursor.order_key),
62
- uniqueKey: storedCursor.unique_key as `0x${string}`,
63
- };
62
+ uniqueKey: storedCursor.unique_key ? storedCursor.unique_key : null,
63
+ });
64
64
  }
65
65
 
66
66
  if (storedFilter) {