Files
memestream/transaction.ts
T
2024-04-09 13:04:05 +10:00

39 lines
1.1 KiB
TypeScript

import base58 from "bs58";
import "dotenv/config"
import * as helpers from "@solana-developers/helpers";
import * as web3 from "@solana/web3.js";
const emoKey = helpers.getKeypairFromEnvironment("EMO");
const emoAddr = new web3.PublicKey(emoKey.publicKey);
const payer = emoKey
const connection = new web3.Connection(web3.clusterApiUrl("devnet"));
const PING_PROGRAM_ADDRESS = new web3.PublicKey('ChT1B39WKLS8qUrkLvFDXMhEJ4F1XZzwUNHUt4AU9aVa')
const PING_PROGRAM_DATA_ADDRESS = new web3.PublicKey('Ah9K7dQ8EHaZqcAsgBW8w37yN2eAy3koFmUn4x3CJtod')
const transaction = new web3.Transaction()
const programId = new web3.PublicKey(PING_PROGRAM_ADDRESS)
const pingProgramDataId = new web3.PublicKey(PING_PROGRAM_DATA_ADDRESS)
// const instruction = new web3.TransactionInstruction({
// keys: [
// {
// pubkey: pingProgramDataId,
// isSigner: false,
// isWritable: true
// },
// ],
// programId
// });
// transaction.add(instruction)
// const signature = await web3.sendAndConfirmTransaction(
// connection,
// transaction,
// [payer]
// )
// console.log(`✅ Transaction completed! Signature is ${signature}`)