@wyrebot/connector-core
v0.1.0-alpha.0
Published
Framework-agnostic Wyre connector helpers for Telegram message inspection, privacy-safe payload building, and delivery queues.
Downloads
46
Maintainers
Readme
@wyrebot/connector-core
Framework-agnostic Wyre connector helpers.
Use this package if you want the low-level building blocks for:
- checking Telegram-style messages for supported Solana contract addresses
- turning accepted messages into Wyre's hosted ingest payload
- building the outgoing HTTP request
- sending immediately or through a retry queue
Most users should start with @wyrebot/connector-node or @wyrebot/connector-grammy instead.
Install
npm install @wyrebot/connector-core@next @wyrebot/contracts@nextImportant Setup Note
loadConnectorConfig() reads from whatever env object you pass in. It does not auto-load a .env file for you.
That means you should either:
- load env values in your own runtime first, or
- start Node with
--env-file=.env
Example
import {
buildHostedIngestHttpRequest,
buildHostedIngestRequest,
inspectTelegramMessage,
loadConnectorConfig
} from '@wyrebot/connector-core';
const config = loadConnectorConfig(process.env);
const inspected = inspectTelegramMessage({
observedAt: new Date().toISOString(),
sourceGroup: {
platformChatId: '-100123',
chatType: 'supergroup',
title: 'Alpha Hunters',
username: 'alphahunters'
},
sender: {
platformUserId: '99887766',
username: 'coincaller',
displayName: 'Coin Caller',
isBot: false
},
message: {
platformMessageId: '4812',
sentAt: new Date().toISOString(),
text: 'buy So11111111111111111111111111111111111111112 now'
}
});
if (inspected) {
const payload = buildHostedIngestRequest(inspected, {
connectorInstanceId: config.connectorInstanceId
});
const request = buildHostedIngestHttpRequest(config, payload);
console.log(request.url);
}Notes
- The supported public API is the root export only.
- Raw Telegram text is inspected locally but is not allowed in the outbound hosted payload.
