@gibs/bridge-indexer 1.13.0 → 1.13.1

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.
Files changed (2) hide show
  1. package/llms.txt +82 -0
  2. package/package.json +5 -4
package/llms.txt ADDED
@@ -0,0 +1,82 @@
1
+ # @gibs/bridge-indexer
2
+
3
+ > A reader for the Gibs Finance bridge indexer. It gives you the transfer
4
+ > archive, delivery receipts and live crossing status as data. It only
5
+ > reads. It never signs, broadcasts or renders.
6
+
7
+ ## Install
8
+
9
+ - Run `npm install @gibs/bridge-indexer viem`.
10
+ - The package is ESM only. Use `import`, not `require`.
11
+ - It needs Node 20 or later.
12
+ - viem is a peer dependency. The range is `>=2.37.0 <3`.
13
+ - Version note: 1.13.0 is the first version on npm.
14
+ - The package ships `schema.graphql`, a snapshot of the indexer schema.
15
+
16
+ ## Entry points
17
+
18
+ - `@gibs/bridge-indexer`: everything below.
19
+ - `@gibs/bridge-indexer/endpoint`: `setIndexerEndpoint`, `indexerEndpoint`, `indexerClient`, `DEFAULT_INDEXER_ENDPOINT`.
20
+ - `@gibs/bridge-indexer/transfers`: `fetchBridgeTransactions`, `buildBridgeFilter`, `fetchDeliveredMessageHashes`.
21
+ - `@gibs/bridge-indexer/bridge-status`: the status names (`SUBMITTED` to `DELIVERED`).
22
+ - `@gibs/bridge-indexer/live-status`: `liveBridgeStatusStageOne`, `liveBridgeStatusStageTwo`.
23
+ - `@gibs/bridge-indexer/graphql`: generated GraphQL types.
24
+
25
+ ## Endpoint
26
+
27
+ The default endpoint is `https://next-indexer.gibs.finance`. Importing the
28
+ package has no side effects. The client is created on first use. Call
29
+ `setIndexerEndpoint` before the first query to read another indexer.
30
+
31
+ ```ts
32
+ import { DEFAULT_INDEXER_ENDPOINT, indexerEndpoint, setIndexerEndpoint } from '@gibs/bridge-indexer'
33
+
34
+ setIndexerEndpoint('http://localhost:42069/graphql')
35
+ const inForce: string = indexerEndpoint()
36
+ const fallback: string = DEFAULT_INDEXER_ENDPOINT
37
+ ```
38
+
39
+ The indexer serves GraphQL at `/` and `/graphql`. `GET /version` returns the
40
+ indexer version, the schema name and the git commit.
41
+ Production `https://indexer.gibs.finance` can lag the schema. If a query
42
+ fails there with an unknown field, use the next indexer.
43
+
44
+ ## Read a wallet's transfers
45
+
46
+ ```ts
47
+ import { fetchBridgeTransactions } from '@gibs/bridge-indexer'
48
+
49
+ const controller = new AbortController()
50
+ const page = await fetchBridgeTransactions(
51
+ {
52
+ address: '0x0000000000000000000000000000000000000001',
53
+ filterMode: 'all',
54
+ limit: 10,
55
+ },
56
+ controller,
57
+ )
58
+ if (page) {
59
+ page.totalCount
60
+ }
61
+ ```
62
+
63
+ `filterMode` is `'pending'` (the default), `'completed'` or `'all'`. A
64
+ transaction hash, message id or message hash in `hash` overrides the address.
65
+
66
+ ## Rules you must not break
67
+
68
+ - Known production defects. A batched re-index will fix them. Until then, work around them.
69
+ - Five relations are always `null`. Do not read them: `AMBBridge.validatorContract`, `Omnibridge.ambBridge`, `Omnibridge.validatorContract`, `UserRequest.destinationAMBBridge`, `UserRequest.destinationOmnibridge`.
70
+ - The join from a request to its `Completion` or `Delivery` works in one direction only. Query `Completion` or `Delivery` by `messageHash`.
71
+ - A message for a native pathway records the ERC-20 omnibridge, not the native one.
72
+ - Read `delivered` (a boolean on the request). Do not read `delivery`. The `delivery` relation can be `null` for a request that landed.
73
+ - Hex filters are lowercase. A checksummed address in a `where` clause matches nothing. Lowercase every address and hash first.
74
+ - `FeeUpdate.fee` is a rate scaled by `1e18`. `10n ** 18n` is one hundred percent.
75
+ - `UserRequest.feeAmount` is the fee actually taken, in base units of the origin token. `null` means no fee log was seen.
76
+ - `BigInt` fields arrive as decimal strings.
77
+
78
+ ## Links
79
+
80
+ - [README](https://github.com/gibsfinance/bridge/blob/staging/packages/bridge-indexer/README.md)
81
+ - [Indexer GraphQL](https://next-indexer.gibs.finance/graphql)
82
+ - [Gibs Finance llms.txt](https://next.gibs.finance/llms.txt): the whole platform.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gibs/bridge-indexer",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Reads a Gibs Finance bridge indexer: transfer archive, delivery receipts, and live crossing status.",
5
5
  "keywords": [
6
6
  "ethereum",
@@ -63,6 +63,7 @@
63
63
  "files": [
64
64
  "dist",
65
65
  "schema.graphql",
66
+ "llms.txt",
66
67
  "!dist/tsconfig.tsbuildinfo",
67
68
  "!dist/**/*.test-d.*",
68
69
  "!dist/test-utils",
@@ -78,9 +79,9 @@
78
79
  "test:watch": "vitest"
79
80
  },
80
81
  "dependencies": {
81
- "@gibs/bridge-client": "^1.13.0",
82
- "@gibs/bridge-sdk": "^1.13.0",
83
- "@gibs/common": "^1.13.0",
82
+ "@gibs/bridge-client": "^1.13.1",
83
+ "@gibs/bridge-sdk": "^1.13.1",
84
+ "@gibs/common": "^1.13.1",
84
85
  "graphql": "^16.11.0",
85
86
  "graphql-request": "^7.2.0",
86
87
  "lodash-es": "^4.17.21"