@secondlayer/shared 16.0.0 → 17.1.0
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/src/archive/range-digest.d.ts +0 -36
- package/dist/src/archive/semantic-digest-builder.d.ts +0 -36
- package/dist/src/classify/index.js +1 -4
- package/dist/src/classify/index.js.map +3 -3
- package/dist/src/coverage/index.d.ts +0 -36
- package/dist/src/crypto/secondlayer-webhook.js +1 -4
- package/dist/src/crypto/secondlayer-webhook.js.map +3 -3
- package/dist/src/db/index.d.ts +1 -151
- package/dist/src/db/index.js +1 -70
- package/dist/src/db/index.js.map +6 -6
- package/dist/src/db/queries/chain-reorgs.d.ts +0 -36
- package/dist/src/db/queries/chain-reorgs.js +1 -70
- package/dist/src/db/queries/chain-reorgs.js.map +6 -6
- package/dist/src/db/queries/contracts.d.ts +0 -36
- package/dist/src/db/queries/contracts.js.map +2 -2
- package/dist/src/db/queries/instance.d.ts +0 -36
- package/dist/src/db/queries/instance.js +1 -4
- package/dist/src/db/queries/instance.js.map +3 -3
- package/dist/src/db/queries/integrity.d.ts +0 -36
- package/dist/src/db/queries/integrity.js +1 -4
- package/dist/src/db/queries/integrity.js.map +3 -3
- package/dist/src/db/queries/subgraph-gaps.d.ts +0 -36
- package/dist/src/db/queries/subgraph-operations.d.ts +0 -36
- package/dist/src/db/queries/subgraphs.d.ts +0 -36
- package/dist/src/db/queries/sync-scope.d.ts +0 -36
- package/dist/src/db/queries/webhook-replays.d.ts +0 -36
- package/dist/src/db/queries/webhooks.d.ts +0 -36
- package/dist/src/db/schema.d.ts +1 -37
- package/dist/src/db/schema.js.map +2 -2
- package/dist/src/email/index.js +1 -4
- package/dist/src/email/index.js.map +3 -3
- package/dist/src/env.d.ts +2 -8
- package/dist/src/env.js +1 -5
- package/dist/src/env.js.map +3 -3
- package/dist/src/index.d.ts +19 -158
- package/dist/src/index.js +51 -77
- package/dist/src/index.js.map +10 -8
- package/dist/src/insights/index.d.ts +0 -36
- package/dist/src/insights/index.js +1 -4
- package/dist/src/insights/index.js.map +3 -3
- package/dist/src/leader.js +1 -70
- package/dist/src/leader.js.map +6 -6
- package/dist/src/logger.js +1 -4
- package/dist/src/logger.js.map +3 -3
- package/dist/src/node/local-client.d.ts +0 -36
- package/dist/src/node/tx-summary.d.ts +7 -1
- package/dist/src/node/tx-summary.js +17 -5
- package/dist/src/node/tx-summary.js.map +4 -4
- package/dist/src/queue/listener.js +1 -70
- package/dist/src/queue/listener.js.map +6 -6
- package/dist/src/runtime/index.js +1 -2
- package/dist/src/runtime/index.js.map +3 -3
- package/dist/src/schemas/index.js +28 -7
- package/dist/src/schemas/index.js.map +5 -4
- package/dist/src/schemas/webhooks.js +28 -7
- package/dist/src/schemas/webhooks.js.map +5 -4
- package/dist/src/streams-rows/index.d.ts +35 -12
- package/dist/src/streams-rows/index.js +25 -21
- package/dist/src/streams-rows/index.js.map +5 -5
- package/migrations/0206_drop_pox4_calls.ts +32 -0
- package/migrations/0207_bns_buy_listing_price.ts +39 -0
- package/migrations/0208_pox5_calculate_rewards_cycle.ts +31 -0
- package/migrations/0209_chain_reorgs_index_block_hash.ts +51 -0
- package/migrations/0210_mempool_evict_superseded_nonces.ts +71 -0
- package/package.json +1 -1
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/env.ts", "../src/logger.ts", "../src/email/render.ts", "../src/email/send.ts", "../src/email/contact.ts", "../src/email/updates.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { z } from \"zod\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\t/**\n\t * Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.\n\t * Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.\n\t */\n\tSOURCE_DATABASE_URL?: string;\n\t/**\n\t * Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.\n\t * Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.\n\t */\n\tTARGET_DATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tSOURCE_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tTARGET_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tconst named = stacksNetwork();\n\t\tenabledNetworks = named === \"testnet\" ? [\"testnet\"] : [\"mainnet\"];\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\nlet warnedNetworkFallback = false;\n\n/**\n * The Stacks network this process serves, and the only place that decides it:\n * `STACKS_NETWORK`, else the deprecated `NETWORK` (warned once so a deployment\n * that only sets it is not silently re-keyed), else mainnet. Not validated;\n * `instanceNetworkFromEnv` is the strict form.\n */\nexport function stacksNetwork(env: NodeJS.ProcessEnv = process.env): string {\n\tif (env.STACKS_NETWORK) return env.STACKS_NETWORK;\n\tif (env.NETWORK) {\n\t\tif (!warnedNetworkFallback) {\n\t\t\twarnedNetworkFallback = true;\n\t\t\tconsole.warn(\"NETWORK is deprecated: set STACKS_NETWORK instead\");\n\t\t}\n\t\treturn env.NETWORK;\n\t}\n\treturn \"mainnet\";\n}\n\n/**\n * True when `NODE_ENV=production`, read at RUNTIME — the single source of truth\n * for prod-vs-dev branching in this package.\n *\n * Why a helper instead of inlining `process.env.NODE_ENV === \"production\"`:\n * bunup/esbuild constant-folds the dot-access `process.env.NODE_ENV` to its\n * BUILD-time value. `@secondlayer/shared` is consumed by other services as its\n * built `dist`, so an inlined check freezes to a literal in the shipped bundle\n * (e.g. `const isProd = false`) and silently ignores the container's real\n * NODE_ENV. The bracket access below is NOT folded, so it stays a runtime read.\n * Route every prod check through here so the footgun lives in exactly one place.\n */\nexport function isProductionEnv(): boolean {\n\t// biome-ignore lint/complexity/useLiteralKeys: bracket access is deliberate — dot-access gets constant-folded by the bundler, freezing this to a build-time literal in the shipped dist.\n\treturn process.env[\"NODE_ENV\"] === \"production\";\n}\n\ntype EnvMap = NodeJS.ProcessEnv;\n\n/**\n * PoX-
|
|
5
|
+
"import { z } from \"zod\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\t/**\n\t * Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.\n\t * Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.\n\t */\n\tSOURCE_DATABASE_URL?: string;\n\t/**\n\t * Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.\n\t * Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.\n\t */\n\tTARGET_DATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tSOURCE_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tTARGET_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tconst named = stacksNetwork();\n\t\tenabledNetworks = named === \"testnet\" ? [\"testnet\"] : [\"mainnet\"];\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\nlet warnedNetworkFallback = false;\n\n/**\n * The Stacks network this process serves, and the only place that decides it:\n * `STACKS_NETWORK`, else the deprecated `NETWORK` (warned once so a deployment\n * that only sets it is not silently re-keyed), else mainnet. Not validated;\n * `instanceNetworkFromEnv` is the strict form.\n */\nexport function stacksNetwork(env: NodeJS.ProcessEnv = process.env): string {\n\tif (env.STACKS_NETWORK) return env.STACKS_NETWORK;\n\tif (env.NETWORK) {\n\t\tif (!warnedNetworkFallback) {\n\t\t\twarnedNetworkFallback = true;\n\t\t\tconsole.warn(\"NETWORK is deprecated: set STACKS_NETWORK instead\");\n\t\t}\n\t\treturn env.NETWORK;\n\t}\n\treturn \"mainnet\";\n}\n\n/**\n * True when `NODE_ENV=production`, read at RUNTIME — the single source of truth\n * for prod-vs-dev branching in this package.\n *\n * Why a helper instead of inlining `process.env.NODE_ENV === \"production\"`:\n * bunup/esbuild constant-folds the dot-access `process.env.NODE_ENV` to its\n * BUILD-time value. `@secondlayer/shared` is consumed by other services as its\n * built `dist`, so an inlined check freezes to a literal in the shipped bundle\n * (e.g. `const isProd = false`) and silently ignores the container's real\n * NODE_ENV. The bracket access below is NOT folded, so it stays a runtime read.\n * Route every prod check through here so the footgun lives in exactly one place.\n */\nexport function isProductionEnv(): boolean {\n\t// biome-ignore lint/complexity/useLiteralKeys: bracket access is deliberate — dot-access gets constant-folded by the bundler, freezing this to a build-time literal in the shipped dist.\n\treturn process.env[\"NODE_ENV\"] === \"production\";\n}\n\ntype EnvMap = NodeJS.ProcessEnv;\n\n/**\n * PoX-5 print-event decoder is ON by default (mirrors the sBTC policy).\n * No activation gating needed: pox-5 events cannot exist before the Epoch 4.0\n * hard fork (Bitcoin block 960,230), so pre-activation the decoder idles at\n * tip. Opt out with `POX5_DECODER_ENABLED=false`.\n */\nexport function isPox5DecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.POX5_DECODER_ENABLED !== \"false\";\n}\n\n/** Default ON. Opt out with `SBTC_DECODER_ENABLED=false`. */\nexport function isSbtcDecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.SBTC_DECODER_ENABLED !== \"false\";\n}\n\n/** Default OFF. Opt in with `BNS_DECODER_ENABLED=true`. */\nexport function isBnsDecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.BNS_DECODER_ENABLED === \"true\";\n}\n\n// Export for testing\nexport { envSchema };\n",
|
|
6
6
|
"import { getEnv } from \"./env.ts\";\n\ntype LogLevel = \"debug\" | \"info\" | \"warn\" | \"error\";\n\nconst LOG_LEVELS: Record<LogLevel, number> = {\n\tdebug: 0,\n\tinfo: 1,\n\twarn: 2,\n\terror: 3,\n};\n\nclass Logger {\n\tprivate _level?: LogLevel;\n\tprivate _isProduction?: boolean;\n\tprivate _initialized = false;\n\n\tprivate init() {\n\t\tif (this._initialized) return;\n\t\tthis._initialized = true;\n\t\ttry {\n\t\t\tconst env = getEnv();\n\t\t\tthis._level = env.LOG_LEVEL;\n\t\t\tthis._isProduction = env.NODE_ENV === \"production\";\n\t\t} catch {\n\t\t\t// Fallback when env is unavailable (e.g. tests without DATABASE_URL)\n\t\t\tthis._level = \"info\";\n\t\t\tthis._isProduction = false;\n\t\t}\n\t}\n\n\tprivate get level(): LogLevel {\n\t\tthis.init();\n\t\t// biome-ignore lint/style/noNonNullAssertion: value is non-null after preceding check or by construction; TS narrowing limitation\n\t\treturn this._level!;\n\t}\n\n\tprivate get isProduction(): boolean {\n\t\tthis.init();\n\t\t// biome-ignore lint/style/noNonNullAssertion: value is non-null after preceding check or by construction; TS narrowing limitation\n\t\treturn this._isProduction!;\n\t}\n\n\tprivate shouldLog(level: LogLevel): boolean {\n\t\treturn LOG_LEVELS[level] >= LOG_LEVELS[this.level];\n\t}\n\n\tprivate formatMessage(\n\t\tlevel: LogLevel,\n\t\tmessage: string,\n\t\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\t\tmeta?: Record<string, any>,\n\t) {\n\t\tconst timestamp = new Date().toISOString();\n\n\t\tif (this.isProduction) {\n\t\t\t// JSON output for production\n\t\t\treturn JSON.stringify({\n\t\t\t\ttimestamp,\n\t\t\t\tlevel,\n\t\t\t\tmessage,\n\t\t\t\t...meta,\n\t\t\t});\n\t\t}\n\n\t\t// Human-readable output for development\n\t\tconst metaStr = meta ? ` ${JSON.stringify(meta)}` : \"\";\n\t\treturn `[${timestamp}] ${level.toUpperCase()}: ${message}${metaStr}`;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tdebug(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"debug\")) {\n\t\t\tconsole.debug(this.formatMessage(\"debug\", message, meta));\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\tinfo(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"info\")) {\n\t\t\tconsole.info(this.formatMessage(\"info\", message, meta));\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\twarn(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"warn\")) {\n\t\t\tconsole.warn(this.formatMessage(\"warn\", message, meta));\n\t\t}\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: interop boundary or dynamic-shape value where typing adds friction without runtime safety\n\terror(message: string, meta?: Record<string, any>): void {\n\t\tif (this.shouldLog(\"error\")) {\n\t\t\tconsole.error(this.formatMessage(\"error\", message, meta));\n\t\t}\n\t}\n}\n\n// Export singleton instance\nexport const logger: Logger = new Logger();\n",
|
|
7
7
|
"/**\n * The one HTML/text layout every customer email renders through, in the\n * brand's \"Figure\" look: logo + wordmark, a 24px heading, muted prose, the\n * code or facts inside a hairline code figure whose bar names it and carries\n * a status chip, one blue button, and a hairline footer.\n *\n * Table-based HTML with inline styles (most clients strip <style>). The head\n * <style> only adds dark mode for clients that honor `prefers-color-scheme`\n * (Apple Mail, iOS); everyone else gets the light palette, which Gmail\n * inverts on its own. Geist loads where web fonts work, the system stack\n * elsewhere. Callers pass content; every color lives here.\n */\n\nexport interface FactRow {\n\tlabel: string;\n\tvalue: string;\n}\n\nexport interface EmailCta {\n\tlabel: string;\n\turl: string;\n}\n\n/** `alarm` only for failures and stops, `ok` only for success. */\nexport type EmailTone = \"neutral\" | \"ok\" | \"alarm\";\n\nexport interface EmailStatus {\n\ttone: EmailTone;\n\ttext: string;\n}\n\n/**\n * A post on X, drawn as our own card (X's embeds don't render in email):\n * avatar, name, @handle and date, the text, and an optional image. Without\n * `avatarUrl` the avatar is the Secondlayer tile.\n */\nexport interface XPost {\n\turl: string;\n\tauthor: { name: string; handle: string; avatarUrl?: string };\n\ttext: string;\n\t/** ISO date or timestamp; shown as \"Nov 5, 2026\". */\n\tdate: string;\n\timage?: { url: string; alt?: string };\n}\n\nexport interface RenderEmailInput {\n\theading: string;\n\t/** The inbox preview line after the subject. Not shown in the body. */\n\tpreheader?: string;\n\tparagraphs: string[];\n\t/** Someone else's words, quoted (a contact form message). */\n\tquote?: string;\n\t/** A sign-in code, shown as one selectable run of digits in the figure. */\n\tcode?: string;\n\tfacts?: FactRow[];\n\t/** The figure's title bar. Defaults to \"sign-in code\" or \"details\". */\n\tfigure?: string;\n\t/** A chip in the figure bar, or a status line when there is no figure. */\n\tstatus?: EmailStatus;\n\tcta?: EmailCta;\n\t/** Why the reader got this email and how to stop it. */\n\tfootnote?: string;\n\t/**\n\t * Monospace lines shown in the figure, whitespace kept. `mark`, when set,\n\t * has its first occurrence highlighted.\n\t */\n\texcerpt?: { lines: string; mark?: string };\n\t/** Plain text at the right of the figure bar when there is no `status`. */\n\tfigureNote?: string;\n\t/** A launch that lives on X, shown as a post card after the paragraphs. */\n\txPost?: XPost;\n\t/** Adds an \"Unsubscribe\" link to the footer (list emails only). */\n\tunsubscribeUrl?: string;\n}\n\nexport interface RenderedEmail {\n\thtml: string;\n\ttext: string;\n}\n\n// www directly: the apex 307s there, and every image fetch would pay for it.\nconst LOGO_URL = \"https://www.secondlayer.tools/email/logo.png\";\nconst LOGO_WHITE_URL = \"https://www.secondlayer.tools/email/logo-white.png\";\nconst TAGLINE = \"Instant data for apps on Bitcoin\";\n\nconst SANS =\n\t\"Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\nconst MONO =\n\t\"'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\";\n\n// DESIGN.md roles. Light inline; dark via the head <style> classes below.\nconst LIGHT = {\n\tpaper: \"#fbfaf7\",\n\tink: \"#14110d\",\n\tsub: \"#63605c\",\n\tfaint: \"#9d9b97\",\n\tline: \"#e8e6e3\",\n\tpri: \"#1f45e0\",\n\tonPri: \"#fbfaf7\",\n\tok: \"#128a43\",\n\talarm: \"#e3301e\",\n};\n\nconst DARK_STYLE = `\n@media (prefers-color-scheme: dark) {\n .sl-paper { background: #1e1b17 !important; }\n .sl-ink { color: #e8e6e3 !important; }\n .sl-sub { color: #b3b1ad !important; }\n .sl-faint { color: #7c7a76 !important; }\n .sl-line { border-color: #393632 !important; }\n .sl-pri { background: #3a5bff !important; }\n .sl-pri-text { color: #7f96ff !important; }\n .sl-ok { color: #5cc28f !important; }\n .sl-alarm { color: #ff5a47 !important; }\n .sl-dot-neutral { background: #7c7a76 !important; }\n .sl-dot-ok { background: #5cc28f !important; }\n .sl-dot-alarm { background: #ff5a47 !important; }\n}`.trim();\n\nfunction escapeHtml(value: string): string {\n\treturn value\n\t\t.replace(/&/g, \"&\")\n\t\t.replace(/</g, \"<\")\n\t\t.replace(/>/g, \">\")\n\t\t.replace(/\"/g, \""\")\n\t\t.replace(/'/g, \"'\");\n}\n\nconst TONE_COLOR: Record<EmailTone, string> = {\n\tneutral: LIGHT.sub,\n\tok: LIGHT.ok,\n\talarm: LIGHT.alarm,\n};\nconst DOT_COLOR: Record<EmailTone, string> = {\n\tneutral: LIGHT.faint,\n\tok: LIGHT.ok,\n\talarm: LIGHT.alarm,\n};\nconst TONE_CLASS: Record<EmailTone, string> = {\n\tneutral: \"sl-sub\",\n\tok: \"sl-ok\",\n\talarm: \"sl-alarm\",\n};\n\nfunction dot(tone: EmailTone): string {\n\treturn `<span class=\"sl-dot-${tone}\" style=\"display: inline-block; width: 7px; height: 7px; border-radius: 999px; background: ${DOT_COLOR[tone]}; margin-right: 6px; vertical-align: 1px;\"></span>`;\n}\n\nfunction statusChip(status: EmailStatus): string {\n\treturn `<span class=\"sl-line ${TONE_CLASS[status.tone]}\" style=\"display: inline-block; border: 1px solid ${LIGHT.line}; border-radius: 999px; padding: 2px 8px; font-family: ${MONO}; font-size: 12px; line-height: 16px; color: ${TONE_COLOR[status.tone]}; white-space: nowrap;\">${dot(status.tone)}${escapeHtml(status.text)}</span>`;\n}\n\nfunction preheaderHtml(preheader: string | undefined): string {\n\tif (!preheader) return \"\";\n\t// Trailing joiners keep body text from leaking into the preview line.\n\tconst filler = \"͏‌ \".repeat(60);\n\treturn `<div style=\"display: none; max-height: 0; overflow: hidden; mso-hide: all; opacity: 0; color: transparent;\">${escapeHtml(preheader)}${filler}</div>`;\n}\n\nfunction hasFigure(input: RenderEmailInput): boolean {\n\treturn Boolean(input.code || input.facts?.length || input.excerpt);\n}\n\nfunction excerptHtml(excerpt: { lines: string; mark?: string }): string {\n\tlet lines = escapeHtml(excerpt.lines);\n\tif (excerpt.mark) {\n\t\tconst mark = escapeHtml(excerpt.mark);\n\t\tconst at = lines.indexOf(mark);\n\t\tif (at !== -1) {\n\t\t\tlines = `${lines.slice(0, at)}<span style=\"background: #ffd200; color: #14110d; padding: 0 2px;\">${mark}</span>${lines.slice(at + mark.length)}`;\n\t\t}\n\t}\n\treturn `<tr><td colspan=\"2\" style=\"padding: 0;\"><pre class=\"sl-ink\" style=\"margin: 0; padding: 12px 14px; font-family: ${MONO}; font-size: 12.5px; line-height: 20px; white-space: pre; overflow-x: auto; color: ${LIGHT.ink};\">${lines}</pre></td></tr>`;\n}\n\nfunction figureHtml(input: RenderEmailInput): string {\n\tif (!hasFigure(input)) return \"\";\n\tconst title =\n\t\tinput.figure ??\n\t\t(input.code ? \"sign-in code\" : input.excerpt ? \"excerpt\" : \"details\");\n\tconst line = `border-color: ${LIGHT.line}; border-style: solid; border-width: 0`;\n\n\tconst bar = `<tr>\n <td class=\"sl-faint sl-line\" style=\"padding: 8px 14px; ${line}; border-bottom-width: 1px; font-family: ${MONO}; font-size: 12px; line-height: 18px; color: ${LIGHT.faint};\">${escapeHtml(title)}</td>\n <td class=\"sl-line\" align=\"right\" style=\"padding: 8px 14px; ${line}; border-bottom-width: 1px;\">${input.status ? statusChip(input.status) : input.figureNote ? `<span class=\"sl-faint\" style=\"font-family: ${MONO}; font-size: 12px; line-height: 18px; color: ${LIGHT.faint};\">${escapeHtml(input.figureNote)}</span>` : \"\"}</td>\n </tr>`;\n\n\tlet body: string;\n\tif (input.code) {\n\t\tbody = `<tr><td colspan=\"2\" align=\"center\" class=\"sl-ink\" style=\"padding: 24px 14px 8px; font-family: ${MONO}; font-size: 36px; line-height: 40px; font-weight: 500; letter-spacing: 0.3em; color: ${LIGHT.ink}; -webkit-user-select: all; user-select: all;\">${escapeHtml(input.code)}</td></tr>\n <tr><td colspan=\"2\" align=\"center\" class=\"sl-faint\" style=\"padding: 0 14px 16px; font-family: ${MONO}; font-size: 12px; line-height: 18px; color: ${LIGHT.faint};\">tap or double-click to select</td></tr>`;\n\t} else if (input.excerpt && !input.facts?.length) {\n\t\tbody = excerptHtml(input.excerpt);\n\t} else {\n\t\tconst facts = input.facts ?? [];\n\t\tbody = facts\n\t\t\t.map((fact, i) => {\n\t\t\t\tconst top = i === 0 ? 12 : 2;\n\t\t\t\tconst bottom = i === facts.length - 1 ? 12 : 2;\n\t\t\t\tconst cell = `padding: ${top}px 14px ${bottom}px; font-family: ${MONO}; font-size: 13px; line-height: 20px; vertical-align: top;`;\n\t\t\t\treturn `<tr>\n <td class=\"sl-faint\" style=\"${cell} padding-right: 24px; width: 1%; color: ${LIGHT.faint}; white-space: nowrap;\">${escapeHtml(fact.label.toLowerCase())}</td>\n <td class=\"sl-ink\" style=\"${cell} color: ${LIGHT.ink}; word-break: break-word;\">${escapeHtml(fact.value)}</td>\n </tr>`;\n\t\t\t})\n\t\t\t.join(\"\\n \");\n\t}\n\n\treturn `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" class=\"sl-line\" style=\"width: 100%; border: 1px solid ${LIGHT.line}; border-radius: 8px; border-collapse: separate; border-spacing: 0; margin: 8px 0 24px;\">\n ${bar}\n ${body}\n </table>`;\n}\n\nexport function xPostDate(date: string): string {\n\tconst d = new Date(date);\n\tif (Number.isNaN(d.getTime())) return date;\n\treturn d.toLocaleDateString(\"en-US\", {\n\t\tmonth: \"short\",\n\t\tday: \"numeric\",\n\t\tyear: \"numeric\",\n\t\ttimeZone: \"UTC\",\n\t});\n}\n\nfunction xPostHtml(post: XPost): string {\n\tconst avatar = post.author.avatarUrl\n\t\t? `<img src=\"${escapeHtml(post.author.avatarUrl)}\" width=\"36\" height=\"36\" alt=\"\" style=\"display: block; width: 36px; height: 36px; border-radius: 999px; border: 0;\">`\n\t\t: `<div class=\"sl-pri\" style=\"width: 36px; height: 36px; border-radius: 6px; background: ${LIGHT.pri}; text-align: center;\"><img src=\"${LOGO_WHITE_URL}\" width=\"21\" height=\"14\" alt=\"\" style=\"display: inline-block; margin-top: 11px; border: 0;\"></div>`;\n\tconst paragraphs = post.text\n\t\t.split(/\\n{2,}/)\n\t\t.map((p) => {\n\t\t\tconst linked = escapeHtml(p).replace(\n\t\t\t\t/@(\\w{1,15})/g,\n\t\t\t\t`<a href=\"https://x.com/$1\" class=\"sl-pri-text\" style=\"color: ${LIGHT.pri}; text-decoration: none;\">@$1</a>`,\n\t\t\t);\n\t\t\treturn `<p class=\"sl-ink\" style=\"margin: 0 0 10px; font-size: 15px; line-height: 23px; color: ${LIGHT.ink}; white-space: pre-line;\">${linked}</p>`;\n\t\t})\n\t\t.join(\"\");\n\tconst image = post.image\n\t\t? `<tr><td style=\"padding: 4px 14px 14px;\"><a href=\"${escapeHtml(post.url)}\"><img src=\"${escapeHtml(post.image.url)}\" width=\"100%\" alt=\"${escapeHtml(post.image.alt ?? \"\")}\" class=\"sl-line\" style=\"display: block; width: 100%; height: auto; border: 1px solid ${LIGHT.line}; border-radius: 6px; box-sizing: border-box;\"></a></td></tr>`\n\t\t: \"\";\n\treturn `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" class=\"sl-line\" style=\"width: 100%; border: 1px solid ${LIGHT.line}; border-radius: 8px; border-collapse: separate; border-spacing: 0; margin: 8px 0 24px;\">\n <tr><td style=\"padding: 14px 14px 10px;\">\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\"><tr>\n <td style=\"padding-right: 10px; vertical-align: middle;\">${avatar}</td>\n <td style=\"vertical-align: middle;\">\n <div class=\"sl-ink\" style=\"font-size: 14px; line-height: 18px; font-weight: 500; color: ${LIGHT.ink};\">${escapeHtml(post.author.name)}</div>\n <div class=\"sl-faint\" style=\"font-family: ${MONO}; font-size: 12px; line-height: 18px; color: ${LIGHT.faint};\">@${escapeHtml(post.author.handle)} · ${escapeHtml(xPostDate(post.date))}</div>\n </td>\n </tr></table>\n </td></tr>\n <tr><td style=\"padding: 0 14px 4px;\">${paragraphs}</td></tr>\n ${image}\n </table>`;\n}\n\nfunction renderHtml(input: RenderEmailInput): string {\n\tconst figure = hasFigure(input);\n\n\tconst statusLine =\n\t\tinput.status && !figure\n\t\t\t? `<p class=\"${TONE_CLASS[input.status.tone]}\" style=\"margin: 0 0 12px; font-size: 13px; line-height: 20px; color: ${TONE_COLOR[input.status.tone]};\">${dot(input.status.tone)}${escapeHtml(input.status.text)}</p>`\n\t\t\t: \"\";\n\n\tconst paragraphsHtml = input.paragraphs\n\t\t.map(\n\t\t\t(p) =>\n\t\t\t\t`<p class=\"sl-sub\" style=\"margin: 0 0 14px; font-size: 15px; line-height: 24px; color: ${LIGHT.sub};\">${escapeHtml(p)}</p>`,\n\t\t)\n\t\t.join(\"\\n \");\n\n\tconst quoteHtml = input.quote\n\t\t? `<p class=\"sl-ink\" style=\"margin: 0 0 14px; font-size: 15px; line-height: 24px; color: ${LIGHT.ink};\">“${escapeHtml(input.quote)}”</p>`\n\t\t: \"\";\n\n\tconst ctaHtml = input.cta\n\t\t? `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin: 10px 0 0;\"><tr><td class=\"sl-pri\" style=\"background: ${LIGHT.pri}; border-radius: 4px;\"><a href=\"${escapeHtml(input.cta.url)}\" style=\"display: inline-block; padding: 0 18px; height: 42px; line-height: 42px; font-family: ${SANS}; font-size: 15px; font-weight: 500; color: ${LIGHT.onPri}; text-decoration: none;\">${escapeHtml(input.cta.label)}</a></td></tr></table>`\n\t\t: \"\";\n\n\tconst unsubscribeLink = input.unsubscribeUrl\n\t\t? `<a href=\"${escapeHtml(input.unsubscribeUrl)}\" class=\"sl-sub\" style=\"color: ${LIGHT.sub}; text-decoration: underline;\">Unsubscribe</a>`\n\t\t: \"\";\n\tconst footnoteText = input.footnote ? escapeHtml(input.footnote) : \"\";\n\tconst footnoteHtml =\n\t\tfootnoteText || unsubscribeLink\n\t\t\t? `<p class=\"sl-faint\" style=\"margin: 0 0 6px;\">${[footnoteText, unsubscribeLink].filter(Boolean).join(\" \")}</p>`\n\t\t\t: \"\";\n\n\treturn `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"light dark\">\n<meta name=\"supported-color-schemes\" content=\"light dark\">\n<link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?family=Geist:wght@400;500&family=Geist+Mono:wght@400;500&display=swap\">\n<style>\n${DARK_STYLE}\n</style>\n</head>\n<body class=\"sl-paper\" style=\"margin: 0; padding: 0; background: ${LIGHT.paper};\">\n${preheaderHtml(input.preheader)}\n<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" class=\"sl-paper\" style=\"width: 100%; background: ${LIGHT.paper};\">\n <tr>\n <td align=\"center\">\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"width: 100%; max-width: 560px; font-family: ${SANS}; padding: 40px 20px;\">\n <tr>\n <td>\n <table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" style=\"margin: 0 0 32px;\"><tr>\n <td style=\"padding-right: 8px; vertical-align: middle;\"><img src=\"${LOGO_URL}\" width=\"30\" height=\"20\" alt=\"\" style=\"display: block; border: 0;\"></td>\n <td class=\"sl-ink\" style=\"vertical-align: middle; font-size: 15px; font-weight: 500; letter-spacing: -0.01em; color: ${LIGHT.ink};\">secondlayer</td>\n </tr></table>\n ${statusLine}\n <h1 class=\"sl-ink\" style=\"margin: 0 0 14px; font-size: 24px; line-height: 29px; font-weight: 500; letter-spacing: -0.025em; color: ${LIGHT.ink};\">${escapeHtml(input.heading)}</h1>\n ${paragraphsHtml}\n ${quoteHtml}\n ${input.xPost ? xPostHtml(input.xPost) : \"\"}\n ${figureHtml(input)}\n ${ctaHtml}\n <div class=\"sl-line sl-faint\" style=\"margin: 32px 0 0; padding: 16px 0 0; border-top: 1px solid ${LIGHT.line}; font-size: 12px; line-height: 18px; color: ${LIGHT.faint};\">\n ${footnoteHtml}\n <p class=\"sl-faint\" style=\"margin: 0;\"><span class=\"sl-sub\" style=\"color: ${LIGHT.sub}; font-weight: 500;\">Secondlayer</span> · ${TAGLINE}</p>\n </div>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n</table>\n</body>\n</html>`;\n}\n\nfunction renderText(input: RenderEmailInput): string {\n\tconst lines: string[] = [input.heading, \"\"];\n\tfor (const p of input.paragraphs) lines.push(p, \"\");\n\tif (input.quote) lines.push(`\"${input.quote}\"`, \"\");\n\tif (input.xPost) {\n\t\tconst { author, date, text, url } = input.xPost;\n\t\tlines.push(\n\t\t\t`${author.name} (@${author.handle}) · ${xPostDate(date)}`,\n\t\t\ttext,\n\t\t\turl,\n\t\t\t\"\",\n\t\t);\n\t}\n\tif (input.status) lines.push(input.status.text, \"\");\n\tif (input.code) lines.push(`Code: ${input.code}`, \"\");\n\tif (input.facts?.length) {\n\t\tfor (const fact of input.facts) lines.push(`${fact.label}: ${fact.value}`);\n\t\tlines.push(\"\");\n\t}\n\tif (input.excerpt) lines.push(input.excerpt.lines, \"\");\n\tif (input.cta) lines.push(`${input.cta.label}: ${input.cta.url}`, \"\");\n\tlines.push(\"--\");\n\tif (input.footnote) lines.push(input.footnote);\n\tif (input.unsubscribeUrl) lines.push(`Unsubscribe: ${input.unsubscribeUrl}`);\n\tlines.push(`Secondlayer · ${TAGLINE}`);\n\treturn lines.join(\"\\n\");\n}\n\nexport function renderEmail(input: RenderEmailInput): RenderedEmail {\n\treturn { html: renderHtml(input), text: renderText(input) };\n}\n",
|
|
8
8
|
"import { logger } from \"../logger.ts\";\n\n/**\n * The one Resend call every customer email goes through. Never throws when\n * `RESEND_API_KEY` is unset — that's a dev/CI/self-host state, not a send\n * failure — it logs a warning and reports `{ skipped: true }` so a caller\n * can still record its own \"notification sent\" bookkeeping accurately.\n */\n\nexport interface SendEmailInput {\n\tto: string;\n\tsubject: string;\n\thtml: string;\n\ttext: string;\n\t/** Where a reply goes; omitted, replies go to the From address. */\n\treplyTo?: string;\n\t/** Overrides the `EMAIL_FROM` default. */\n\tfrom?: string;\n\t/** Extra message headers, e.g. RFC 8058 `List-Unsubscribe`. */\n\theaders?: Record<string, string>;\n}\n\nexport type SendEmailResult = { skipped: true } | { skipped: false };\n\nexport async function sendEmail(\n\tinput: SendEmailInput,\n): Promise<SendEmailResult> {\n\tconst apiKey = process.env.RESEND_API_KEY;\n\tif (!apiKey) {\n\t\tlogger.warn(\"RESEND_API_KEY unset — skipping email\", {\n\t\t\tsubject: input.subject,\n\t\t});\n\t\treturn { skipped: true };\n\t}\n\n\tconst from =\n\t\tinput.from ??\n\t\tprocess.env.EMAIL_FROM ??\n\t\t\"secondlayer <noreply@secondlayer.tools>\";\n\n\tconst response = await fetch(\"https://api.resend.com/emails\", {\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\tAuthorization: `Bearer ${apiKey}`,\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tfrom,\n\t\t\tto: [input.to],\n\t\t\tsubject: input.subject,\n\t\t\thtml: input.html,\n\t\t\ttext: input.text,\n\t\t\t...(input.replyTo ? { reply_to: [input.replyTo] } : {}),\n\t\t\t...(input.headers && Object.keys(input.headers).length > 0\n\t\t\t\t? { headers: input.headers }\n\t\t\t\t: {}),\n\t\t}),\n\t});\n\n\tif (!response.ok) {\n\t\tconst body = await response.text().catch(() => \"\");\n\t\tthrow new Error(\n\t\t\t`Resend API error (${response.status}): ${body.slice(0, 200)}`,\n\t\t);\n\t}\n\n\treturn { skipped: false };\n}\n",
|
|
9
9
|
"import { logger } from \"../logger.ts\";\nimport { renderEmail } from \"./render.ts\";\nimport { sendEmail } from \"./send.ts\";\n\nexport type ContactVolume =\n\t| \"lt10m\"\n\t| \"10m-100m\"\n\t| \"100m-1b\"\n\t| \"gt1b\"\n\t| \"unsure\";\n\nconst VOLUME_LABELS: Record<ContactVolume, string> = {\n\tlt10m: \"under 10M rows/mo\",\n\t\"10m-100m\": \"10M–100M rows/mo\",\n\t\"100m-1b\": \"100M–1B rows/mo\",\n\tgt1b: \"over 1B rows/mo\",\n\tunsure: \"volume not sure\",\n};\n\nexport interface ContactMessage {\n\tname: string;\n\temail: string;\n\tcompany: string | null;\n\tvolume: ContactVolume | null;\n\tmessage: string;\n\tsource_page: string | null;\n}\n\n/**\n * Emails the operator (`CONTACT_NOTIFY_EMAIL`) about a stored contact\n * request and reports whether the message went out. Used by the route that\n * stores the row and by the worker that retries rows still unnotified.\n */\nexport async function notifyContact(\n\tid: string,\n\trow: ContactMessage,\n): Promise<boolean> {\n\tconst to = process.env.CONTACT_NOTIFY_EMAIL?.trim();\n\tif (!to) {\n\t\tlogger.info(\"contact.notify_skipped\", { id, reason: \"no notify address\" });\n\t\treturn false;\n\t}\n\tconst volumeLabel = row.volume\n\t\t? VOLUME_LABELS[row.volume]\n\t\t: \"volume not given\";\n\tconst reference = `ctc_${id.slice(0, 6)}`;\n\tconst { html, text } = renderEmail({\n\t\theading: \"New contact request\",\n\t\tpreheader: row.message.slice(0, 90),\n\t\tparagraphs: [],\n\t\tquote: row.message,\n\t\tfigure: `contact · ${reference}`,\n\t\tfacts: [\n\t\t\t{ label: \"Name\", value: row.name },\n\t\t\t{ label: \"Email\", value: row.email },\n\t\t\t{ label: \"Company\", value: row.company ?? \"not given\" },\n\t\t\t{ label: \"Volume\", value: volumeLabel },\n\t\t\t{ label: \"From page\", value: row.source_page ?? \"not given\" },\n\t\t\t{ label: \"Reference\", value: reference },\n\t\t],\n\t\tfootnote: `Reply to this email to answer ${row.name.split(/\\s+/)[0]}.`,\n\t});\n\ttry {\n\t\tconst result = await sendEmail({\n\t\t\tto,\n\t\t\treplyTo: row.email,\n\t\t\tsubject: `Contact: ${row.company ?? row.name} · ${volumeLabel}`,\n\t\t\thtml,\n\t\t\ttext,\n\t\t});\n\t\tif (result.skipped) {\n\t\t\tlogger.info(\"contact.notify_skipped\", { id, reason: \"no email key\" });\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch (err) {\n\t\tlogger.error(\"contact.notify_failed\", {\n\t\t\tid,\n\t\t\terror: err instanceof Error ? err.message : String(err),\n\t\t});\n\t\treturn false;\n\t}\n}\n",
|
|
10
10
|
"import { renderEmail } from \"./render.ts\";\n\n/**\n * The email updates list: sender, links and the double opt-in email. Every\n * list email must carry `unsubscribeFor(token)` (footer link plus the\n * RFC 8058 headers Gmail and Yahoo require from bulk senders).\n */\n\nexport const UPDATES_FROM = \"Secondlayer <dev@secondlayer.tools>\";\nexport const UPDATES_SITE_URL = \"https://www.secondlayer.tools\";\nexport const UPDATES_API_URL = \"https://api.secondlayer.tools\";\n\n/** Footer link (a web page that unsubscribes on load) and one-click headers. */\nexport function unsubscribeFor(token: string): {\n\turl: string;\n\theaders: Record<string, string>;\n} {\n\tconst t = encodeURIComponent(token);\n\treturn {\n\t\turl: `${UPDATES_SITE_URL}/updates/unsubscribe?t=${t}`,\n\t\theaders: {\n\t\t\t\"List-Unsubscribe\": `<${UPDATES_API_URL}/api/public/updates/unsubscribe?t=${t}>`,\n\t\t\t\"List-Unsubscribe-Post\": \"List-Unsubscribe=One-Click\",\n\t\t},\n\t};\n}\n\n/**\n * The double opt-in email. No unsubscribe link or headers: the address is\n * not on the list until it confirms.\n */\nexport function confirmEmail(token: string): {\n\tsubject: string;\n\thtml: string;\n\ttext: string;\n} {\n\tconst subject = \"Confirm your secondlayer subscription\";\n\tconst { html, text } = renderEmail({\n\t\theading: \"Confirm your email\",\n\t\tpreheader: \"One click and new posts and launches come to this inbox.\",\n\t\tparagraphs: [\n\t\t\t\"Confirm and we'll email you when we publish a post or ship something new. Nothing else, and every email has a one-click unsubscribe.\",\n\t\t],\n\t\tcta: {\n\t\t\tlabel: \"Confirm subscription\",\n\t\t\turl: `${UPDATES_SITE_URL}/updates/confirm?t=${encodeURIComponent(token)}`,\n\t\t},\n\t\tfootnote:\n\t\t\t\"Someone entered this address at secondlayer.tools/blog. If it wasn't you, ignore this email and you won't hear from us. The link works for 7 days.\",\n\t});\n\treturn { subject, html, text };\n}\n"
|
|
11
11
|
],
|
|
12
|
-
"mappings": ";AAAA;AAGA,IAAM,iBAAiB,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ;AAAA,EACpD,MAAM,WAAW,IACf,MAAM,GAAG,EACT,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,OAAO;AAAA,EAChB,MAAM,QAAQ,CAAC,WAAW,SAAS;AAAA,EACnC,WAAW,KAAK,UAAU;AAAA,IACzB,IAAI,CAAC,MAAM,SAAS,CAAC,GAAG;AAAA,MACvB,MAAM,IAAI,MACT,oBAAoB,sBAAsB,MAAM,KAAK,IAAI,GAC1D;AAAA,IACD;AAAA,EACD;AAAA,EACA,OAAO;AAAA,CACP;AAsBD,IAAM,YAAwC,EAAE,OAAO;AA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AAC,OAI3B;AAAA,EACD,MAAM,UAAU;AAAA,EAChB,QAAQ,MAAM,SAAS,YAAY;AAAA,IAClC,SAAS;AAAA,IACT,WAAW;AAAA,IACX,YAAY;AAAA,MACX;AAAA,IACD;AAAA,IACA,KAAK;AAAA,MACJ,OAAO;AAAA,MACP,KAAK,GAAG,sCAAsC,mBAAmB,KAAK;AAAA,IACvE;AAAA,IACA,UACC;AAAA,EACF,CAAC;AAAA,EACD,OAAO,EAAE,SAAS,MAAM,KAAK;AAAA;",
|
|
13
|
+
"debugId": "93944BF6563C2F0064756E2164756E21",
|
|
14
14
|
"names": []
|
|
15
15
|
}
|
package/dist/src/env.d.ts
CHANGED
|
@@ -43,13 +43,7 @@ declare function stacksNetwork(env?: NodeJS.ProcessEnv): string;
|
|
|
43
43
|
declare function isProductionEnv(): boolean;
|
|
44
44
|
type EnvMap = NodeJS.ProcessEnv;
|
|
45
45
|
/**
|
|
46
|
-
* PoX-
|
|
47
|
-
* public surface, so the decoder that fills `pox4_calls` runs unless explicitly
|
|
48
|
-
* opted out with `POX4_DECODER_ENABLED=false` (mirrors the sBTC decoder policy).
|
|
49
|
-
*/
|
|
50
|
-
declare function isPox4DecoderEnabled(env?: EnvMap): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* PoX-5 print-event decoder is ON by default (mirrors pox-4/sBTC policy).
|
|
46
|
+
* PoX-5 print-event decoder is ON by default (mirrors the sBTC policy).
|
|
53
47
|
* No activation gating needed: pox-5 events cannot exist before the Epoch 4.0
|
|
54
48
|
* hard fork (Bitcoin block 960,230), so pre-activation the decoder idles at
|
|
55
49
|
* tip. Opt out with `POX5_DECODER_ENABLED=false`.
|
|
@@ -59,4 +53,4 @@ declare function isPox5DecoderEnabled(env?: EnvMap): boolean;
|
|
|
59
53
|
declare function isSbtcDecoderEnabled(env?: EnvMap): boolean;
|
|
60
54
|
/** Default OFF. Opt in with `BNS_DECODER_ENABLED=true`. */
|
|
61
55
|
declare function isBnsDecoderEnabled(env?: EnvMap): boolean;
|
|
62
|
-
export { Env, envSchema, getEnv, isBnsDecoderEnabled,
|
|
56
|
+
export { Env, envSchema, getEnv, isBnsDecoderEnabled, isPox5DecoderEnabled, isProductionEnv, isSbtcDecoderEnabled, stacksNetwork };
|
package/dist/src/env.js
CHANGED
|
@@ -58,9 +58,6 @@ function stacksNetwork(env = process.env) {
|
|
|
58
58
|
function isProductionEnv() {
|
|
59
59
|
return process.env["NODE_ENV"] === "production";
|
|
60
60
|
}
|
|
61
|
-
function isPox4DecoderEnabled(env = process.env) {
|
|
62
|
-
return env.POX4_DECODER_ENABLED !== "false";
|
|
63
|
-
}
|
|
64
61
|
function isPox5DecoderEnabled(env = process.env) {
|
|
65
62
|
return env.POX5_DECODER_ENABLED !== "false";
|
|
66
63
|
}
|
|
@@ -74,12 +71,11 @@ export {
|
|
|
74
71
|
envSchema,
|
|
75
72
|
getEnv,
|
|
76
73
|
isBnsDecoderEnabled,
|
|
77
|
-
isPox4DecoderEnabled,
|
|
78
74
|
isPox5DecoderEnabled,
|
|
79
75
|
isProductionEnv,
|
|
80
76
|
isSbtcDecoderEnabled,
|
|
81
77
|
stacksNetwork
|
|
82
78
|
};
|
|
83
79
|
|
|
84
|
-
//# debugId=
|
|
80
|
+
//# debugId=380687AA70E0266D64756E2164756E21
|
|
85
81
|
//# sourceMappingURL=env.js.map
|
package/dist/src/env.js.map
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/env.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { z } from \"zod\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\t/**\n\t * Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.\n\t * Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.\n\t */\n\tSOURCE_DATABASE_URL?: string;\n\t/**\n\t * Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.\n\t * Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.\n\t */\n\tTARGET_DATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tSOURCE_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tTARGET_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tconst named = stacksNetwork();\n\t\tenabledNetworks = named === \"testnet\" ? [\"testnet\"] : [\"mainnet\"];\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\nlet warnedNetworkFallback = false;\n\n/**\n * The Stacks network this process serves, and the only place that decides it:\n * `STACKS_NETWORK`, else the deprecated `NETWORK` (warned once so a deployment\n * that only sets it is not silently re-keyed), else mainnet. Not validated;\n * `instanceNetworkFromEnv` is the strict form.\n */\nexport function stacksNetwork(env: NodeJS.ProcessEnv = process.env): string {\n\tif (env.STACKS_NETWORK) return env.STACKS_NETWORK;\n\tif (env.NETWORK) {\n\t\tif (!warnedNetworkFallback) {\n\t\t\twarnedNetworkFallback = true;\n\t\t\tconsole.warn(\"NETWORK is deprecated: set STACKS_NETWORK instead\");\n\t\t}\n\t\treturn env.NETWORK;\n\t}\n\treturn \"mainnet\";\n}\n\n/**\n * True when `NODE_ENV=production`, read at RUNTIME — the single source of truth\n * for prod-vs-dev branching in this package.\n *\n * Why a helper instead of inlining `process.env.NODE_ENV === \"production\"`:\n * bunup/esbuild constant-folds the dot-access `process.env.NODE_ENV` to its\n * BUILD-time value. `@secondlayer/shared` is consumed by other services as its\n * built `dist`, so an inlined check freezes to a literal in the shipped bundle\n * (e.g. `const isProd = false`) and silently ignores the container's real\n * NODE_ENV. The bracket access below is NOT folded, so it stays a runtime read.\n * Route every prod check through here so the footgun lives in exactly one place.\n */\nexport function isProductionEnv(): boolean {\n\t// biome-ignore lint/complexity/useLiteralKeys: bracket access is deliberate — dot-access gets constant-folded by the bundler, freezing this to a build-time literal in the shipped dist.\n\treturn process.env[\"NODE_ENV\"] === \"production\";\n}\n\ntype EnvMap = NodeJS.ProcessEnv;\n\n/**\n * PoX-
|
|
5
|
+
"import { z } from \"zod\";\n\n// Parse comma-separated networks\nconst networksSchema = z.string().transform((val) => {\n\tconst networks = val\n\t\t.split(\",\")\n\t\t.map((n) => n.trim())\n\t\t.filter(Boolean);\n\tconst valid = [\"mainnet\", \"testnet\"];\n\tfor (const n of networks) {\n\t\tif (!valid.includes(n)) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid network: ${n}. Must be one of: ${valid.join(\", \")}`,\n\t\t\t);\n\t\t}\n\t}\n\treturn networks as (\"mainnet\" | \"testnet\")[];\n});\n\ninterface EnvSchemaOutput {\n\tDATABASE_URL?: string;\n\t/**\n\t * Shared indexer DB (blocks/txs/events). Falls back to DATABASE_URL.\n\t * Set this alongside TARGET_DATABASE_URL to enable dual-DB mode.\n\t */\n\tSOURCE_DATABASE_URL?: string;\n\t/**\n\t * Tenant DB (subgraph schemas + subgraphs table). Falls back to DATABASE_URL.\n\t * Set this alongside SOURCE_DATABASE_URL to enable dual-DB mode.\n\t */\n\tTARGET_DATABASE_URL?: string;\n\tNETWORK?: \"mainnet\" | \"testnet\";\n\tNETWORKS?: (\"mainnet\" | \"testnet\")[];\n\tLOG_LEVEL: \"debug\" | \"info\" | \"warn\" | \"error\";\n\tNODE_ENV: \"development\" | \"production\" | \"test\";\n}\n\n// Cast needed: z.preprocess / z.default create different _input vs _output types\n// that z.ZodType<T> can't represent without explicit input type param\nconst envSchema: z.ZodType<EnvSchemaOutput> = z.object({\n\tDATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tSOURCE_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tTARGET_DATABASE_URL: z.preprocess(\n\t\t(val) => (typeof val === \"string\" && val.length === 0 ? undefined : val),\n\t\tz.string().url().optional(),\n\t),\n\tNETWORK: z.enum([\"mainnet\", \"testnet\"]).optional(),\n\tNETWORKS: networksSchema.optional(),\n\tLOG_LEVEL: z.enum([\"debug\", \"info\", \"warn\", \"error\"]).default(\"info\"),\n\tNODE_ENV: z\n\t\t.enum([\"development\", \"production\", \"test\"])\n\t\t.default(\"development\"),\n}) as unknown as z.ZodType<EnvSchemaOutput>;\n\nexport type Env = EnvSchemaOutput & {\n\tenabledNetworks: (\"mainnet\" | \"testnet\")[];\n};\n\nlet cachedEnv: Env | null = null;\n\nexport function getEnv(): Env {\n\tif (cachedEnv) {\n\t\treturn cachedEnv;\n\t}\n\n\tconst result = envSchema.safeParse(process.env);\n\n\tif (!result.success) {\n\t\tconsole.error(\"❌ Invalid environment configuration:\");\n\t\tconsole.error(z.treeifyError(result.error));\n\t\tthrow new Error(\"Invalid environment configuration\");\n\t}\n\n\t// Compute enabled networks from NETWORKS or NETWORK\n\tlet enabledNetworks: (\"mainnet\" | \"testnet\")[];\n\tif (result.data.NETWORKS && result.data.NETWORKS.length > 0) {\n\t\tenabledNetworks = result.data.NETWORKS;\n\t} else if (result.data.NETWORK) {\n\t\tenabledNetworks = [result.data.NETWORK];\n\t} else {\n\t\tconst named = stacksNetwork();\n\t\tenabledNetworks = named === \"testnet\" ? [\"testnet\"] : [\"mainnet\"];\n\t}\n\n\tcachedEnv = { ...result.data, enabledNetworks };\n\treturn cachedEnv;\n}\n\nlet warnedNetworkFallback = false;\n\n/**\n * The Stacks network this process serves, and the only place that decides it:\n * `STACKS_NETWORK`, else the deprecated `NETWORK` (warned once so a deployment\n * that only sets it is not silently re-keyed), else mainnet. Not validated;\n * `instanceNetworkFromEnv` is the strict form.\n */\nexport function stacksNetwork(env: NodeJS.ProcessEnv = process.env): string {\n\tif (env.STACKS_NETWORK) return env.STACKS_NETWORK;\n\tif (env.NETWORK) {\n\t\tif (!warnedNetworkFallback) {\n\t\t\twarnedNetworkFallback = true;\n\t\t\tconsole.warn(\"NETWORK is deprecated: set STACKS_NETWORK instead\");\n\t\t}\n\t\treturn env.NETWORK;\n\t}\n\treturn \"mainnet\";\n}\n\n/**\n * True when `NODE_ENV=production`, read at RUNTIME — the single source of truth\n * for prod-vs-dev branching in this package.\n *\n * Why a helper instead of inlining `process.env.NODE_ENV === \"production\"`:\n * bunup/esbuild constant-folds the dot-access `process.env.NODE_ENV` to its\n * BUILD-time value. `@secondlayer/shared` is consumed by other services as its\n * built `dist`, so an inlined check freezes to a literal in the shipped bundle\n * (e.g. `const isProd = false`) and silently ignores the container's real\n * NODE_ENV. The bracket access below is NOT folded, so it stays a runtime read.\n * Route every prod check through here so the footgun lives in exactly one place.\n */\nexport function isProductionEnv(): boolean {\n\t// biome-ignore lint/complexity/useLiteralKeys: bracket access is deliberate — dot-access gets constant-folded by the bundler, freezing this to a build-time literal in the shipped dist.\n\treturn process.env[\"NODE_ENV\"] === \"production\";\n}\n\ntype EnvMap = NodeJS.ProcessEnv;\n\n/**\n * PoX-5 print-event decoder is ON by default (mirrors the sBTC policy).\n * No activation gating needed: pox-5 events cannot exist before the Epoch 4.0\n * hard fork (Bitcoin block 960,230), so pre-activation the decoder idles at\n * tip. Opt out with `POX5_DECODER_ENABLED=false`.\n */\nexport function isPox5DecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.POX5_DECODER_ENABLED !== \"false\";\n}\n\n/** Default ON. Opt out with `SBTC_DECODER_ENABLED=false`. */\nexport function isSbtcDecoderEnabled(env: EnvMap = process.env): boolean {\n\treturn env.SBTC_DECODER_ENABLED !== \"false\";\n}\n\n/** Default OFF. Opt in with `BNS_DECODER_ENABLED=true`. */\nexport function is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10
10
|
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -720,41 +720,6 @@ interface ChainReorgsTable {
|
|
|
720
720
|
new_canonical_event_index: number;
|
|
721
721
|
created_at: Generated<Date>;
|
|
722
722
|
}
|
|
723
|
-
type Pox4FunctionName = "stack-stx" | "delegate-stx" | "stack-extend" | "stack-increase" | "revoke-delegate-stx" | "delegate-stack-stx" | "delegate-stack-extend" | "delegate-stack-increase" | "stack-aggregation-commit" | "stack-aggregation-commit-indexed" | "stack-aggregation-increase" | "set-signer-key-authorization";
|
|
724
|
-
interface Pox4CallsTable {
|
|
725
|
-
cursor: string;
|
|
726
|
-
block_height: number;
|
|
727
|
-
block_time: Date;
|
|
728
|
-
burn_block_height: number;
|
|
729
|
-
tx_id: string;
|
|
730
|
-
tx_index: number;
|
|
731
|
-
function_name: Pox4FunctionName;
|
|
732
|
-
caller: string;
|
|
733
|
-
stacker: string | null;
|
|
734
|
-
delegate_to: string | null;
|
|
735
|
-
amount_ustx: string | null;
|
|
736
|
-
lock_period: number | null;
|
|
737
|
-
pox_addr_version: number | null;
|
|
738
|
-
pox_addr_hashbytes: string | null;
|
|
739
|
-
pox_addr_btc: string | null;
|
|
740
|
-
start_cycle: number | null;
|
|
741
|
-
end_cycle: number | null;
|
|
742
|
-
signer_key: string | null;
|
|
743
|
-
signer_signature: string | null;
|
|
744
|
-
auth_id: string | null;
|
|
745
|
-
max_amount: string | null;
|
|
746
|
-
reward_cycle: number | null;
|
|
747
|
-
aggregated_amount_ustx: string | null;
|
|
748
|
-
aggregated_signer_index: number | null;
|
|
749
|
-
auth_period: number | null;
|
|
750
|
-
auth_topic: string | null;
|
|
751
|
-
auth_allowed: boolean | null;
|
|
752
|
-
result_ok: boolean;
|
|
753
|
-
result_raw: string;
|
|
754
|
-
canonical: Generated<boolean>;
|
|
755
|
-
source_cursor: string;
|
|
756
|
-
created_at: Generated<Date>;
|
|
757
|
-
}
|
|
758
723
|
type Pox5EventTopic = "set-bond-admin" | "set-pause-admin" | "pause-rewards" | "setup-bond" | "add-to-allowlist" | "register-for-bond" | "update-bond-registration" | "register-signer" | "stake" | "stake-update" | "announce-l1-early-exit" | "unstake-sbtc" | "unstake" | "calculate-rewards" | "bond-distribution" | "claim-rewards" | "claim-staker-rewards-for-signer" | "grant-signer-key" | "revoke-signer-grant";
|
|
759
724
|
interface Pox5EventsTable {
|
|
760
725
|
cursor: string;
|
|
@@ -1172,7 +1137,6 @@ interface Database {
|
|
|
1172
1137
|
decoded_events: DecodedEventsTable;
|
|
1173
1138
|
decoder_checkpoints: DecoderCheckpointsTable;
|
|
1174
1139
|
chain_reorgs: ChainReorgsTable;
|
|
1175
|
-
pox4_calls: Pox4CallsTable;
|
|
1176
1140
|
pox5_events: Pox5EventsTable;
|
|
1177
1141
|
pox5_cycles: Pox5CyclesTable;
|
|
1178
1142
|
pox5_cycle_signers: Pox5CycleSignersTable;
|
|
@@ -1835,13 +1799,7 @@ declare function getEnv(): Env;
|
|
|
1835
1799
|
declare function stacksNetwork(env?: NodeJS.ProcessEnv): string;
|
|
1836
1800
|
type EnvMap = NodeJS.ProcessEnv;
|
|
1837
1801
|
/**
|
|
1838
|
-
* PoX-
|
|
1839
|
-
* public surface, so the decoder that fills `pox4_calls` runs unless explicitly
|
|
1840
|
-
* opted out with `POX4_DECODER_ENABLED=false` (mirrors the sBTC decoder policy).
|
|
1841
|
-
*/
|
|
1842
|
-
declare function isPox4DecoderEnabled(env?: EnvMap): boolean;
|
|
1843
|
-
/**
|
|
1844
|
-
* PoX-5 print-event decoder is ON by default (mirrors pox-4/sBTC policy).
|
|
1802
|
+
* PoX-5 print-event decoder is ON by default (mirrors the sBTC policy).
|
|
1845
1803
|
* No activation gating needed: pox-5 events cannot exist before the Epoch 4.0
|
|
1846
1804
|
* hard fork (Bitcoin block 960,230), so pre-activation the decoder idles at
|
|
1847
1805
|
* tip. Opt out with `POX5_DECODER_ENABLED=false`.
|
|
@@ -1916,7 +1874,6 @@ declare const SOURCE_READ_COLUMNS: {
|
|
|
1916
1874
|
readonly decoded_events: readonly ["amount", "asset_identifier", "block_height", "canonical", "contract_id", "cursor", "event_index", "event_type", "memo", "payload", "recipient", "sender", "tx_id", "tx_index", "value"]
|
|
1917
1875
|
readonly transactions: readonly ["block_height", "contract_id", "function_args", "function_name", "raw_result", "raw_tx", "sender", "status", "tx_id", "tx_index", "type"]
|
|
1918
1876
|
readonly mempool_transactions: readonly ["contract_id", "function_args", "function_name", "raw_tx", "received_at", "sender", "seq", "tx_id", "type"]
|
|
1919
|
-
readonly pox4_calls: readonly ["aggregated_amount_ustx", "aggregated_signer_index", "amount_ustx", "auth_allowed", "auth_id", "auth_period", "auth_topic", "block_height", "block_time", "burn_block_height", "caller", "canonical", "cursor", "delegate_to", "end_cycle", "function_name", "lock_period", "max_amount", "pox_addr_btc", "pox_addr_hashbytes", "pox_addr_version", "result_ok", "reward_cycle", "signer_key", "signer_signature", "source_cursor", "stacker", "start_cycle", "tx_id", "tx_index"]
|
|
1920
1877
|
readonly pox5_events: readonly ["amount_sats", "amount_ustx", "block_height", "block_time", "bond_index", "canonical", "cursor", "data", "event_index", "first_reward_cycle", "is_l1_lock", "reward_cycle", "signer", "signer_key", "signer_manager", "staker", "topic", "tx_id", "tx_index", "unlock_burn_height", "unlock_cycle"]
|
|
1921
1878
|
readonly sbtc_events: readonly ["amount", "bitcoin_txid", "block_height", "block_time", "burn_hash", "burn_height", "canonical", "cursor", "event_index", "fee", "governance_contract_type", "governance_new_contract", "max_fee", "output_index", "recipient", "recipient_btc_hashbytes", "recipient_btc_version", "request_id", "sender", "signer_address", "signer_aggregate_pubkey", "signer_bitmap", "signer_keys_count", "signer_threshold", "sweep_txid", "topic", "tx_id", "tx_index"]
|
|
1922
1879
|
readonly sbtc_token_events: readonly ["amount", "block_height", "block_time", "canonical", "cursor", "event_index", "event_type", "memo", "recipient", "sender", "tx_id", "tx_index"]
|
|
@@ -2088,117 +2045,6 @@ declare const SOURCE_READ_TYPES: {
|
|
|
2088
2045
|
readonly type: "text"
|
|
2089
2046
|
}
|
|
2090
2047
|
}
|
|
2091
|
-
readonly pox4_calls: {
|
|
2092
|
-
readonly aggregated_amount_ustx: {
|
|
2093
|
-
readonly type: "text"
|
|
2094
|
-
readonly nullable: true
|
|
2095
|
-
}
|
|
2096
|
-
readonly aggregated_signer_index: {
|
|
2097
|
-
readonly type: "int"
|
|
2098
|
-
readonly nullable: true
|
|
2099
|
-
}
|
|
2100
|
-
readonly amount_ustx: {
|
|
2101
|
-
readonly type: "text"
|
|
2102
|
-
readonly nullable: true
|
|
2103
|
-
}
|
|
2104
|
-
readonly auth_allowed: {
|
|
2105
|
-
readonly type: "boolean"
|
|
2106
|
-
readonly nullable: true
|
|
2107
|
-
}
|
|
2108
|
-
readonly auth_id: {
|
|
2109
|
-
readonly type: "text"
|
|
2110
|
-
readonly nullable: true
|
|
2111
|
-
}
|
|
2112
|
-
readonly auth_period: {
|
|
2113
|
-
readonly type: "int"
|
|
2114
|
-
readonly nullable: true
|
|
2115
|
-
}
|
|
2116
|
-
readonly auth_topic: {
|
|
2117
|
-
readonly type: "text"
|
|
2118
|
-
readonly nullable: true
|
|
2119
|
-
}
|
|
2120
|
-
readonly block_height: {
|
|
2121
|
-
readonly type: "int"
|
|
2122
|
-
}
|
|
2123
|
-
readonly block_time: {
|
|
2124
|
-
readonly type: "timestamp"
|
|
2125
|
-
}
|
|
2126
|
-
readonly burn_block_height: {
|
|
2127
|
-
readonly type: "int"
|
|
2128
|
-
}
|
|
2129
|
-
readonly caller: {
|
|
2130
|
-
readonly type: "text"
|
|
2131
|
-
}
|
|
2132
|
-
readonly canonical: {
|
|
2133
|
-
readonly type: "boolean"
|
|
2134
|
-
}
|
|
2135
|
-
readonly cursor: {
|
|
2136
|
-
readonly type: "text"
|
|
2137
|
-
}
|
|
2138
|
-
readonly delegate_to: {
|
|
2139
|
-
readonly type: "text"
|
|
2140
|
-
readonly nullable: true
|
|
2141
|
-
}
|
|
2142
|
-
readonly end_cycle: {
|
|
2143
|
-
readonly type: "int"
|
|
2144
|
-
readonly nullable: true
|
|
2145
|
-
}
|
|
2146
|
-
readonly function_name: {
|
|
2147
|
-
readonly type: "text"
|
|
2148
|
-
}
|
|
2149
|
-
readonly lock_period: {
|
|
2150
|
-
readonly type: "int"
|
|
2151
|
-
readonly nullable: true
|
|
2152
|
-
}
|
|
2153
|
-
readonly max_amount: {
|
|
2154
|
-
readonly type: "text"
|
|
2155
|
-
readonly nullable: true
|
|
2156
|
-
}
|
|
2157
|
-
readonly pox_addr_btc: {
|
|
2158
|
-
readonly type: "text"
|
|
2159
|
-
readonly nullable: true
|
|
2160
|
-
}
|
|
2161
|
-
readonly pox_addr_hashbytes: {
|
|
2162
|
-
readonly type: "text"
|
|
2163
|
-
readonly nullable: true
|
|
2164
|
-
}
|
|
2165
|
-
readonly pox_addr_version: {
|
|
2166
|
-
readonly type: "int"
|
|
2167
|
-
readonly nullable: true
|
|
2168
|
-
}
|
|
2169
|
-
readonly result_ok: {
|
|
2170
|
-
readonly type: "boolean"
|
|
2171
|
-
}
|
|
2172
|
-
readonly reward_cycle: {
|
|
2173
|
-
readonly type: "int"
|
|
2174
|
-
readonly nullable: true
|
|
2175
|
-
}
|
|
2176
|
-
readonly signer_key: {
|
|
2177
|
-
readonly type: "text"
|
|
2178
|
-
readonly nullable: true
|
|
2179
|
-
}
|
|
2180
|
-
readonly signer_signature: {
|
|
2181
|
-
readonly type: "text"
|
|
2182
|
-
readonly nullable: true
|
|
2183
|
-
}
|
|
2184
|
-
readonly source_cursor: {
|
|
2185
|
-
readonly type: "text"
|
|
2186
|
-
}
|
|
2187
|
-
readonly stacker: {
|
|
2188
|
-
readonly type: "text"
|
|
2189
|
-
readonly nullable: true
|
|
2190
|
-
}
|
|
2191
|
-
readonly start_cycle: {
|
|
2192
|
-
readonly type: "int"
|
|
2193
|
-
readonly nullable: true
|
|
2194
|
-
}
|
|
2195
|
-
readonly tx_id: {
|
|
2196
|
-
readonly type: "text"
|
|
2197
|
-
}
|
|
2198
|
-
readonly tx_index: {
|
|
2199
|
-
readonly type: "int"
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
2048
|
readonly pox5_events: {
|
|
2203
2049
|
readonly amount_sats: {
|
|
2204
2050
|
readonly type: "text"
|
|
@@ -2720,7 +2566,6 @@ declare const SOURCE_READ_PKS: {
|
|
|
2720
2566
|
readonly decoded_events: readonly ["cursor"]
|
|
2721
2567
|
readonly transactions: readonly ["tx_id"]
|
|
2722
2568
|
readonly mempool_transactions: readonly ["seq"]
|
|
2723
|
-
readonly pox4_calls: readonly ["cursor"]
|
|
2724
2569
|
readonly pox5_events: readonly ["cursor"]
|
|
2725
2570
|
readonly sbtc_events: readonly ["cursor"]
|
|
2726
2571
|
readonly sbtc_token_events: readonly ["cursor"]
|
|
@@ -2826,7 +2671,6 @@ declare const TABLE_TO_DB: {
|
|
|
2826
2671
|
stage_failures: string
|
|
2827
2672
|
decoded_events: string
|
|
2828
2673
|
decoder_checkpoints: string
|
|
2829
|
-
pox4_calls: string
|
|
2830
2674
|
pox5_events: string
|
|
2831
2675
|
pox5_cycles: string
|
|
2832
2676
|
pox5_cycle_signers: string
|
|
@@ -3164,6 +3008,23 @@ declare function isEmptyRangeCursor(cursor: StreamsCursor): boolean;
|
|
|
3164
3008
|
declare function committedHeight(cursor: string | null | undefined): number | null;
|
|
3165
3009
|
/** Exclusive end of every event that can live in `height`. */
|
|
3166
3010
|
declare function blockEndCursor(height: number): StreamsCursor;
|
|
3011
|
+
/**
|
|
3012
|
+
* Normalize a Bitcoin txid to the stored form: `0x` + 64 lowercase hex.
|
|
3013
|
+
* Explorers show bare hex; the Index stores (and matches) the prefixed form,
|
|
3014
|
+
* so every input boundary (trigger schema, API filters) runs through here.
|
|
3015
|
+
* Returns null when the value isn't a 32-byte hex txid.
|
|
3016
|
+
*/
|
|
3017
|
+
declare function normalizeBtcTxid(value: string): string | null;
|
|
3018
|
+
/** Each era starts at `fromBurnHeight` (inclusive) and runs until the next. */
|
|
3019
|
+
declare const MAINNET_POX_CONTRACT_ERAS: readonly {
|
|
3020
|
+
fromBurnHeight: number
|
|
3021
|
+
contractId: string
|
|
3022
|
+
}[];
|
|
3023
|
+
/** The mainnet PoX contract live at `burnHeight`. */
|
|
3024
|
+
declare function mainnetPoxContractAt(burnHeight: number): string;
|
|
3025
|
+
/** True for a PoX contract on any network (`<deployer>.pox`, `.pox-N`). Wide
|
|
3026
|
+
* on purpose: it only decides whether a filter needs its stx_lock branch. */
|
|
3027
|
+
declare function isPoxContractId(contractId: string): boolean;
|
|
3167
3028
|
declare class Logger {
|
|
3168
3029
|
private _level?;
|
|
3169
3030
|
private _isProduction?;
|
|
@@ -4044,4 +3905,4 @@ declare function publicKeyPemFromPrivate(privateKeyPem: string): string;
|
|
|
4044
3905
|
declare function ed25519KeyId(publicKeyPem: string): string;
|
|
4045
3906
|
declare function signEd25519(payload: string, privateKey: KeyObject): string;
|
|
4046
3907
|
declare function verifyEd25519(payload: string, signatureBase64: string, publicKey: KeyObject): boolean;
|
|
4047
|
-
export { ABI_STATUSES, AbiStatus, Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeyExpiredError, ApiKeyRevokedError, ApiKeyStatus, ApiKeysTable, ApiRequestLogRow, ApiRequestLogTable, ArchiveFetch, ArchiveFetchesTable, AuthenticationError, AuthorizationError, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, CHAIN_TRIGGER_FIELDS, CHAIN_TRIGGER_TYPES, CODE_TO_STATUS, ChainApplyDeliveryOf, ChainApplyEnvelope, ChainApplyEnvelopeOf, ChainEventEnvelope, ChainFtBurnData, ChainFtMintData, ChainFtTransferData, ChainNftBurnData, ChainNftMintData, ChainNftTransferData, ChainPrintEventData, ChainReadCacheTable, ChainReorgOrphanedEntry, ChainReorgRollbackDelivery, ChainReorgRollbackEnvelope, ChainReorgsTable, ChainStxBurnData, ChainStxLockData, ChainStxMintData, ChainStxTransferData, ChainTestDelivery, ChainTxLevelEvent, ChainWebhookDelivery, ChainWebhookEnvelope, CliDeviceLogin, CliDeviceLoginStatus, CliDeviceLoginsTable, CliDeviceProduct, ContactRequest, ContactRequestsTable, Contract, ContractsTable, CoverageSegmentsTable, CreateWebhookRequest, CreateWebhookRequestSchema, CreateWebhookResponse, DB_TO_STREAMS_EVENT_TYPE, DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES, DEFAULT_BTC_CONFIRMATIONS, Database, DatabaseError, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadReason, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, ForbiddenError, GapReason, HealthHour, HealthSnapshotPoint, HostedStackStateTable, INSIGHT_SEVERITIES, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertApiRequestLogRow, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUpdateSubscriber, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, Insight, InsightEvidence, InsightEvidenceSchema, InsightListResponse, InsightListResponseSchema, InsightMutesTable, InsightResourceKind, InsightResourceKindSchema, InsightSchema, InsightSeverity, InsightSeveritySchema, InsightsTable, InstancesTable, KeyRotatedError, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, OBSERVER_JOURNAL_STATUSES, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable,
|
|
3908
|
+
export { ABI_STATUSES, AbiStatus, Account, AccountBalanceAlerts, AccountBalanceAlertsTable, AccountCredits, AccountCreditsTable, AccountSpendCap, AccountSpendCapsTable, AccountsTable, ApiFailedRequest, ApiFailedRequestsTable, ApiKey, ApiKeyExpiredError, ApiKeyRevokedError, ApiKeyStatus, ApiKeysTable, ApiRequestLogRow, ApiRequestLogTable, ArchiveFetch, ArchiveFetchesTable, AuthenticationError, AuthorizationError, Block, BlocksTable, BnsMarketplaceAction, BnsMarketplaceEventsTable, BnsNameEventTopic, BnsNameEventsTable, BnsNamesTable, BnsNamespaceEventStatus, BnsNamespaceEventsTable, BnsNamespacesTable, BurnBlockRewardSlotsTable, BurnBlockRewardsTable, CHAIN_TRIGGER_FIELDS, CHAIN_TRIGGER_TYPES, CODE_TO_STATUS, ChainApplyDeliveryOf, ChainApplyEnvelope, ChainApplyEnvelopeOf, ChainEventEnvelope, ChainFtBurnData, ChainFtMintData, ChainFtTransferData, ChainNftBurnData, ChainNftMintData, ChainNftTransferData, ChainPrintEventData, ChainReadCacheTable, ChainReorgOrphanedEntry, ChainReorgRollbackDelivery, ChainReorgRollbackEnvelope, ChainReorgsTable, ChainStxBurnData, ChainStxLockData, ChainStxMintData, ChainStxTransferData, ChainTestDelivery, ChainTxLevelEvent, ChainWebhookDelivery, ChainWebhookEnvelope, CliDeviceLogin, CliDeviceLoginStatus, CliDeviceLoginsTable, CliDeviceProduct, ContactRequest, ContactRequestsTable, Contract, ContractsTable, CoverageSegmentsTable, CreateWebhookRequest, CreateWebhookRequestSchema, CreateWebhookResponse, DB_TO_STREAMS_EVENT_TYPE, DECODED_EVENT_TYPES2 as DECODED_EVENT_TYPES, DEFAULT_BTC_CONFIRMATIONS, Database, DatabaseError, DbPlane, DbReadRow, DbSplitStatus, DeadLetterEventsTable, DeadReason, DeadRow, DecodedEventType2 as DecodedEventType, DecodedEventsTable, DecoderCheckpointsTable, DeliveryRow, DeploySubgraphRequest, DeploySubgraphRequestSchema, DeploySubgraphResponse, EMPTY_RANGE_EVENT_INDEX_SENTINEL, Env, ErrorCode, ErrorCodes, Event, EventsArchiveTable, EventsTable, FailureClass, FailureUnit, FeedbackTicket, FeedbackTicketsTable, ForbiddenError, GapReason, HealthHour, HealthSnapshotPoint, HostedStackStateTable, INSIGHT_SEVERITIES, IndexColumn, IndexColumnType, IndexPrimaryKey, IndexProgress, IndexProgressTable, InsertAccount, InsertAccountBalanceAlerts, InsertAccountCredits, InsertAccountSpendCap, InsertApiFailedRequest, InsertApiKey, InsertApiRequestLogRow, InsertArchiveFetch, InsertBlock, InsertContactRequest, InsertContract, InsertEvent, InsertFeedbackTicket, InsertIndexProgress, InsertMagicLink, InsertMempoolTransaction, InsertSession, InsertStateWrite, InsertSubgraph, InsertSubgraphGap, InsertSubgraphHealthSnapshot, InsertSubgraphOperation, InsertTransaction, InsertUpdateSubscriber, InsertUsageLedgerRow, InsertVmEvent, InsertWaitlistSignup, InsertWebhook, InsertWebhookDelivery, InsertWebhookOutbox, Insight, InsightEvidence, InsightEvidenceSchema, InsightListResponse, InsightListResponseSchema, InsightMutesTable, InsightResourceKind, InsightResourceKindSchema, InsightSchema, InsightSeverity, InsightSeveritySchema, InsightsTable, InstancesTable, KeyRotatedError, MAINNET_POX_CONTRACT_ERAS, MagicLink, MagicLinksTable, MempoolTransaction, MempoolTransactionsTable, MigrationRole, NativeClock, NotFoundError, NumericAsText, OBSERVER_JOURNAL_STATUSES, OauthClient, OauthClientsTable, OauthCodesTable, OauthGrant, OauthGrantsTable, OauthRefreshRetiredTable, OauthRequestStatus, OauthRequestsTable, OauthTokenKind, OauthTokensTable, ObserverJournalStatus, ObserverJournalTable, OutboxStatus, ParsedCreateWebhookRequest, ParsedReplayWebhookRequest, ParsedUpdateWebhookRequest, PaymentRequiredError, PendingForkBlocksTable, Pox5CycleSignersTable, Pox5CyclesTable, Pox5EventTopic, Pox5EventsTable, ProcessedStripeEventsTable, PushPrefs, PushPrefsTable, PushSentTable, PushSubscription, PushSubscriptionsTable, RUNE_EVENT_TYPES, RateLimitError, ReindexResponse, RepairMode, ReplayResult, ReplayWebhookRequest, ReplayWebhookRequestSchema, RetryState, RotateSecretResponse, RunStatus, RuneApplyDeliveryOf, RuneApplyEnvelope, RuneEventType, SEVERITY_ORDER, SOURCE_READ_COLUMNS, SOURCE_READ_PKS, SOURCE_READ_TYPES, STREAMS_CURSOR_VERSION, STREAMS_DB_EVENT_TYPES, STREAMS_EVENT_TYPES, STREAMS_TO_DB_EVENT_TYPES, SUBGRAPH_STATES, SbtcDepositEvent, SbtcEventTopic, SbtcEventsTable, SbtcSettlementsTable, SbtcTokenEventType, SbtcTokenEventsTable, SbtcWithdrawalEvent, SbtcWithdrawalSweptConfirmedEvent, SecondLayerError, SentinelAccount, SentinelAccountsTable, ServiceHeartbeatsTable, Session, SessionsTable, StageBlockReceiptsTable, StageFailuresTable, StageKind, StageRegistryTable, StageRunsTable, StateWrite, StateWritesArchiveTable, StateWritesTable, StreamsCursor, StreamsCursorFeed, StreamsCursorFeedMismatchError, StreamsDbEventType, StreamsEventType, Subgraph, SubgraphAgentSchema, SubgraphAggregateParams, SubgraphAggregateResponse, SubgraphDetail, SubgraphErrorGroupsTable, SubgraphGap, SubgraphGapEntry, SubgraphGapRange, SubgraphGapsResponse, SubgraphGapsTable, SubgraphHealthSnapshot, SubgraphHealthSnapshotsTable, SubgraphOperation, SubgraphOperationKind, SubgraphOperationStatus, SubgraphOperationsTable, SubgraphProcessingStatsTable, SubgraphQueryParams, SubgraphSpecFormat, SubgraphSpecOptions, SubgraphStatus, SubgraphSummary, SubgraphSyncInfo, SubgraphSyncState, SubgraphVerification, SubgraphViolationsTable, SubgraphsTable, SyncScopesTable, TABLE_TO_DB, TenantSuspendedError, Transaction, TransactionsArchiveTable, TransactionsTable, TriggerEvaluatorState, TriggerEvaluatorStateTable, UpdateAccountBalanceAlerts, UpdateAccountCredits, UpdateAccountSpendCap, UpdateApiKey, UpdateArchiveFetch, UpdateBlock, UpdateContract, UpdateEvent, UpdateIndexProgress, UpdateSendsTable, UpdateSubgraph, UpdateSubgraphOperation, UpdateSubscriber, UpdateSubscribersTable, UpdateTransaction, UpdateUsageLedgerRow, UpdateVmEvent, UpdateWebhook, UpdateWebhookOutbox, UpdateWebhookRequest, UpdateWebhookRequestSchema, UsageLedgerRow, UsageLedgerTable, VM_EVENT_TYPES, VM_NODE_TO_STORED_TYPE2 as VM_NODE_TO_STORED_TYPE, VM_STORED_TO_NODE_TYPE, ValidationError, VersionConflictError, VmEvent, VmEventType, VmEventsArchiveTable, VmEventsTable, VmNodeEventType, WEBHOOK_FORMATS, WEBHOOK_STATUSES, Waitlist, WaitlistSignup, WaitlistSignupsTable, WaitlistsTable, Webhook, WebhookDeliveriesTable, WebhookDelivery, WebhookDeliveryHoursTable, WebhookDetail, WebhookFormat, WebhookFormatSchema, WebhookIncidentAlert, WebhookIncidentAlertsTable, WebhookKind, WebhookOutbox, WebhookOutboxTable, WebhookPauseReason, WebhookReplay, WebhookReplayStatus, WebhookReplaysTable, WebhookStatus, WebhookStatusSchema, WebhookSummary, WebhooksTable, applicationDatabaseUrl, assertDbSplit, blockEndCursor, bucketHourly, closeDb, closeDbOrTimeout, committedHeight, compareStreamsCursor, configuredSourceUrl, configuredTargetUrl, exports_hmac as crypto, decodeFeedCursor, decodeStreamsCursor, decodeTaggedStreamsCursor, describeDbUrl, exports_ed25519 as ed25519, encodeFeedCursor, encodeStreamsCursor, finalizedBurnHeight, formatWebhookSchemaErrors, generateSubgraphAgentSchema, generateSubgraphMarkdown, generateSubgraphOpenApi, generateSubgraphSpec, getDb, getDbSplitStatus, getEnv, getErrorMessage, getMigrationRole, getRawClient, getSourceDb, getTargetDb, isBnsDecoderEnabled, isEmptyRangeCursor, isPox5DecoderEnabled, isPoxContractId, isSbtcDecoderEnabled, jsonb, logger, mainnetPoxContractAt, normalizeBtcTxid, onChainPlane, onControlPlane, parseJsonb, resolveSourceUrl, resolveTargetUrl, setMigrationRole, sql, stacksNetwork, syncState };
|