@gibs/bridge-client 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 +55 -0
  2. package/package.json +5 -4
package/llms.txt ADDED
@@ -0,0 +1,55 @@
1
+ # @gibs/bridge-client
2
+
3
+ > Browser-side endpoints, cached viem public clients, token metadata reads
4
+ > and chain logo URLs for a Gibs Finance bridge interface. It has no
5
+ > framework dependency. It sits between `@gibs/bridge-sdk` (which prices and
6
+ > builds transfers) and an application that renders them.
7
+
8
+ ## Install
9
+
10
+ - Run `npm install @gibs/bridge-client viem`.
11
+ - The package is ESM only. Use `import`, not `require`.
12
+ - It needs Node 20 or later, or a modern browser.
13
+ - viem is a peer dependency. The range is `>=2.37.0 <3`.
14
+ - Version note: 1.12.0 and older on npm are broken. Use 1.13.0 or later.
15
+ - `@gibs/bridge-sdk` is a dependency and it reaches TON code. A browser bundle needs a global `Buffer`. Set `globalThis.Buffer` (from the `buffer` package) before you import this package.
16
+
17
+ ## Entry points
18
+
19
+ - `@gibs/bridge-client/client`: `clientFromChain(chainId)`, a cached viem public client per chain.
20
+ - `@gibs/bridge-client/endpoints`: per-chain RPC endpoint lists with storage and subscription.
21
+ - `@gibs/bridge-client/networks`: the supported viem chains.
22
+ - `@gibs/bridge-client/image`: chain logo URLs.
23
+ - `@gibs/bridge-client/token-metadata`: token metadata reads and caching.
24
+ - `@gibs/bridge-client/chain-read`: allowance reads.
25
+ - `@gibs/bridge-client/cache`: the `Cache` class.
26
+
27
+ ## Example
28
+
29
+ ```ts
30
+ import { clientFromChain } from '@gibs/bridge-client/client'
31
+ import { chainLogoUrl } from '@gibs/bridge-client/image'
32
+ import { isSupportedEvmChain } from '@gibs/bridge-client/networks'
33
+
34
+ const pulsechain = 369
35
+
36
+ if (isSupportedEvmChain(pulsechain)) {
37
+ const client = clientFromChain(pulsechain)
38
+ const blockNumber = await client.getBlockNumber()
39
+ console.log(blockNumber, chainLogoUrl({ chainId: pulsechain, displayPx: 32 }))
40
+ }
41
+ ```
42
+
43
+ ## Rules
44
+
45
+ - Check `isSupportedEvmChain(chainId)` first. `clientFromChain` throws for a chain outside the supported list.
46
+ - `clientFromChain` takes a chain id number. It is not the same function as `clientFromChain` in `@gibs/common`, which takes a viem chain and a list of URLs.
47
+ - The client reads its URLs from the endpoint table. An empty entry for a chain falls back to the chain defaults.
48
+ - A chain logo can come from gib.show or from Relay's CDN. Use `chainLogoUrl`. Do not build the URL yourself.
49
+ - This package reads. It never signs or broadcasts.
50
+
51
+ ## Links
52
+
53
+ - [README](https://github.com/gibsfinance/bridge/blob/staging/packages/bridge-client/README.md)
54
+ - [@gibs/bridge-sdk llms.txt](https://github.com/gibsfinance/bridge/blob/staging/packages/bridge-sdk/llms.txt)
55
+ - [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-client",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Browser-side endpoints, clients, and caching for a Gibs Finance bridge interface.",
5
5
  "keywords": [
6
6
  "ethereum",
@@ -74,7 +74,8 @@
74
74
  "!dist/tsconfig.tsbuildinfo",
75
75
  "!dist/**/*.test-d.*",
76
76
  "!dist/test-utils",
77
- "LICENSE"
77
+ "LICENSE",
78
+ "llms.txt"
78
79
  ],
79
80
  "scripts": {
80
81
  "prepublishOnly": "npx tsc",
@@ -83,8 +84,8 @@
83
84
  "test:watch": "vitest"
84
85
  },
85
86
  "dependencies": {
86
- "@gibs/bridge-sdk": "^1.13.0",
87
- "@gibs/common": "^1.13.0",
87
+ "@gibs/bridge-sdk": "^1.13.1",
88
+ "@gibs/common": "^1.13.1",
88
89
  "lodash-es": "^4.17.21"
89
90
  },
90
91
  "peerDependencies": {