-
Notifications
You must be signed in to change notification settings - Fork 0
/
.experiment_juno.ts
36 lines (27 loc) · 941 Bytes
/
.experiment_juno.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
36
import 'dotenv/config'
import { StargateClient} from '@cosmjs/stargate'
import { decodeTxsInBlock } from './src/blockchains/decodeTxs'
import { processTxsJuno } from './src/blockchains/juno/processTXs'
import { TelegramBot } from './src/telegram/telegram'
const heights = [
13552076,
]
const junoRpcEndpoint = process.env.RPC_ENDPOINT_JUNO!
const {
sendServiceInformation,
} = TelegramBot
app()
async function app() {
TelegramBot.run()
const junoQueryClient = await StargateClient.connect(junoRpcEndpoint)
for (const height of heights) {
const block = await junoQueryClient.getBlock(height)
const decodedTxs = await decodeTxsInBlock(block)
const telegramMsgs = await processTxsJuno(decodedTxs, junoQueryClient)
for (const msg of telegramMsgs) {
await sendServiceInformation(msg)
console.log(msg)
}
}
process.exit()
}