@wyrebot/connector-grammy
v0.1.0-alpha.0
Published
grammY adapter for forwarding privacy-safe Telegram contract-call events into Wyre.
Maintainers
Readme
@wyrebot/connector-grammy
grammY adapter for forwarding privacy-safe Telegram contract-call events into Wyre.
Use this when your bot already runs on grammY and you want to plug Wyre into the normal middleware chain.
Install
npm install @wyrebot/connector-grammy@next grammyRequired Env Values
WYRE_CONNECTOR_API_BASE_URL=...
WYRE_CONNECTOR_TOKEN=...
WYRE_CONNECTOR_INSTANCE_ID=...Important: load those env values before calling createGrammyConnectorFromEnv(). For example:
node --env-file=.env dist/index.jsExample
import { Bot, type Context } from 'grammy';
import { createGrammyConnectorFromEnv } from '@wyrebot/connector-grammy';
const bot = new Bot<Context>(process.env.TELEGRAM_BOT_TOKEN!);
const connector = createGrammyConnectorFromEnv<Context>(process.env);
bot.use(connector.createMiddleware());What It Handles
- maps a grammY context into the shared Telegram message shape
- ignores unsupported updates
- checks messages locally for supported Solana contract addresses
- forwards only the approved hosted payload to Wyre
Need A Working Reference?
The Wyre repo also includes a small reference app at apps/example-grammy.
