-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.experiment_osmo.ts
35 lines (26 loc) · 944 Bytes
/
.experiment_osmo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import 'dotenv/config'
import { StargateClient} from '@cosmjs/stargate'
import { decodeTxsInBlock } from './src/blockchains/decodeTxs'
import { processTxsOsmosis } from './src/blockchains/osmosis/processTXs'
import { TelegramBot } from './src/telegram/telegram'
const heights = [
13377647,
]
const {
sendServiceInformation,
} = TelegramBot
const osmoRpcEndpoint = process.env.RPC_ENDPOINT_OSMO || 'https://rpc.osmosis.zone'
app()
async function app() {
const osmoQueryClient = await StargateClient.connect(osmoRpcEndpoint)
for (const height of heights) {
const block = await osmoQueryClient.getBlock(height)
const decodedTxs = decodeTxsInBlock(block)
const telegramMsgs = await processTxsOsmosis(decodedTxs, osmoQueryClient)
for (const msg of telegramMsgs) {
await sendServiceInformation(msg)
console.log(msg)
}
}
process.exit()
}