@README.md
Cloudflare Worker that redirects sblr.to/<slug> to Zapper bundle URLs. Contract addresses are dynamically sourced from
the sablier npm package — no hardcoded URLs.
src/index.ts— Worker entry point. Routes requests through the redirect map.src/redirects.ts— Generates theRecord<string, string>redirect map at module load time using thesablierSDK.
The slug format is {protocol}-{version} where dots are replaced with dashes (e.g., lockup-v3-0).
Zapper bundle URLs support a maximum of 20 addresses. This is enforced via MAX_ADDRESSES in src/redirects.ts.
- Lockup v2.0+, Flow: One contract per chain (
SablierLockup/SablierFlow). Deployments are sorted byCHAIN_PRIORITY(ranked by DeFi TVL / ecosystem significance) and capped at 20. When a new chain is added to the SDK, also add it toCHAIN_PRIORITY— chains not in the list sort last. - Lockup v1.x: Multiple contracts per chain (
SablierV2LockupLinear,SablierV2LockupDynamic,SablierV2LockupTranched). To stay under 20, these versions are restricted to 6 chains viaV1_CHAIN_IDS: Ethereum, Base, BSC, Arbitrum, Polygon, Optimism.
If you add a new Lockup v1.x chain to V1_CHAIN_IDS, verify the total address count stays at or below 20. If you add a
new chain to CHAIN_PRIORITY, place it according to its relative TVL / ecosystem significance.
Only user-facing streaming contracts are included in bundle URLs. Do not include helpers, NFT descriptors, batch contracts, or comptrollers — those are not relevant to Zapper portfolio tracking.
- Add a new entry to
LOCKUP_VERSIONSorFLOW_VERSIONSinsrc/redirects.ts. - Set
contractsto the user-facing contract name(s) from the version's manifest in thesablierSDK (check~/sablier/sdk/src/evm/releases/{protocol}/{version}/manifest.ts). - Run
bun run devand verify the redirect withcurl -I http://localhost:8787/<slug>. - Deploy with
bun run deploy.
No code changes needed. Update the sablier package and redeploy:
bun update sablier
bun run deploybun install
bun run dev
curl -I http://localhost:8787/lockup-v3-0 # Expect 301
curl -I http://localhost:8787/nonexistent # Expect 404Wrangler is installed as a local dev dependency — always run it through bun:
bun run deploy # alias for: bun wrangler deploy
bun wrangler <command> # run any wrangler commandDo not use a globally installed wrangler — the local version in devDependencies ensures consistency.
Wrangler must be authenticated before deploying. If running in a non-interactive environment, set the
CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID environment variables. Otherwise:
bun wrangler loginThe Sablier Cloudflare account ID is b29fcc290093d5e96dde439d303315ae.
bun update sablier # pull latest contract deployments from the SDK
bun run deploy # build & deploy to CloudflareTo preview changes locally first:
bun run dev # start local dev server
curl -I http://localhost:8787/lockup-v3-0 # verify redirectsDocs: https://build.zapper.xyz/docs/api/supported-chains
Zapper supports 56 chains as of April 2026:
Abstract, Apechain, Arbitrum, Arbitrum Nova, Astar, Avalanche, Base, Berachain, Bitcoin, Blast, BNB Chain, Bob, Celo, Core, Cyber, Degen, Ethereum, Flow, Fraxtal, Gnosis, HyperEVM, Hyperliquid, ImmutableX, Ink, Lens, Linea, Mantle, MegaETH, Metis, Mode, Monad, Moonbeam, Morph, opBNB, Optimism, Polygon, Polygon zkEVM, Redstone, Ronin, Rootstock, Scroll, Shape, Solana, Soneium, Sonic, Story, Superseed, Taiko, Tempo, Unichain, World Chain, XAI, Zero, ZKsync, Zora.
Contracts on these chains are excluded from bundle URLs since Zapper cannot track them:
| Chain | Chain ID |
|---|---|
| Chiliz | 88888 |
| Denergy | 369369 |
| Lightlink | 1890 |
| Sei | 1329 |
| Sophon | 50104 |
| Tangle | 5845 |
| XDC Network | 50 |
When a new Sablier chain deployment is added, check whether Zapper supports it before expecting it to appear in bundle URLs.
Ronin is supported by Zapper but excluded from this Worker because Sablier has no v2+ deployments on Ronin. Only Sablier Legacy supports Ronin.
- Runtime: Cloudflare Workers
- Language: TypeScript
- Package manager: bun
- Formatter/linter: Biome
- Deployment:
wrangler deploy