try fix solana rpc
This commit is contained in:
parent
a0c9558e5d
commit
7c9aa26e5d
@ -29,6 +29,7 @@ DEVELOPER_CHAT_ID = os.getenv("DEVELOPER_CHAT_ID")
|
|||||||
FOLLOWED_WALLET = os.getenv("FOLLOWED_WALLET")
|
FOLLOWED_WALLET = os.getenv("FOLLOWED_WALLET")
|
||||||
YOUR_WALLET = os.getenv("YOUR_WALLET")
|
YOUR_WALLET = os.getenv("YOUR_WALLET")
|
||||||
TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")
|
TELEGRAM_BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN")
|
||||||
|
SOLANA_URL = os.getenv("SOLANA_NET_URL")
|
||||||
|
|
||||||
# Initialize Telegram Bot
|
# Initialize Telegram Bot
|
||||||
bot = Bot(token=TELEGRAM_BOT_TOKEN)
|
bot = Bot(token=TELEGRAM_BOT_TOKEN)
|
||||||
@ -178,16 +179,17 @@ async def on_logs(logs):
|
|||||||
await follow_move(move)
|
await follow_move(move)
|
||||||
|
|
||||||
async def subscribe_to_wallet():
|
async def subscribe_to_wallet():
|
||||||
uri = "wss://api.mainnet-beta.solana.com"
|
uri = SOLANA_URL
|
||||||
async with websockets.connect(uri) as websocket:
|
async with websockets.connect(uri) as websocket:
|
||||||
# Correct the `params` format to be an array
|
# Correct the `params` format to be an object
|
||||||
request = {
|
request = {
|
||||||
"jsonrpc": "2.0",
|
"jsonrpc": "2.0",
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"method": "logsSubscribe",
|
"method": "logsSubscribe",
|
||||||
"params": [
|
"params": {
|
||||||
{"mentions": [YOUR_WALLET], "commitment": "confirmed"}
|
"mentions": [YOUR_WALLET],
|
||||||
]
|
"commitment": "confirmed"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await websocket.send(json.dumps(request))
|
await websocket.send(json.dumps(request))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user