Update env variables

This commit is contained in:
Adw8 2025-02-06 14:44:14 +05:30
parent a1fb9f9083
commit aa43f91b03
7 changed files with 30 additions and 30 deletions

View File

@ -1,11 +1,11 @@
# Get key from https://fal.ai # Get key from https://fal.ai
FAL_AI_KEY= FAL_AI_KEY=
NEXT_PUBLIC_MTM_TOKEN_MINT=97RggLo3zV5kFGYW4yoQTxr4Xkz4Vg2WPHzNYXXWpump NEXT_PUBLIC_MTM_MINT_ADDRESS=97RggLo3zV5kFGYW4yoQTxr4Xkz4Vg2WPHzNYXXWpump
NEXT_PUBLIC_PAYMENT_RECEIVER_ADDRESS=FFDx3SdAEeXrp6BTmStB4BDHpctGsaasZq4FFcowRobY NEXT_PUBLIC_MTM_RECIPIENT_MULTISIG_ADDRESS=FFDx3SdAEeXrp6BTmStB4BDHpctGsaasZq4FFcowRobY
NEXT_PUBLIC_SOLANA_RPC_URL=https://skilled-prettiest-seed.solana-mainnet.quiknode.pro/eeecfebd04e345f69f1900cc3483cbbfea02a158 NEXT_PUBLIC_SOLANA_RPC_URL=https://skilled-prettiest-seed.solana-mainnet.quiknode.pro/eeecfebd04e345f69f1900cc3483cbbfea02a158
NEXT_PUBLIC_SOLANA_WEBSOCKET_URL=wss://skilled-prettiest-seed.solana-mainnet.quiknode.pro/eeecfebd04e345f69f1900cc3483cbbfea02a158 NEXT_PUBLIC_SOLANA_WEBSOCKET_URL=wss://skilled-prettiest-seed.solana-mainnet.quiknode.pro/eeecfebd04e345f69f1900cc3483cbbfea02a158
NEXT_PUBLIC_USDC_MINT=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v NEXT_PUBLIC_USDC_MINT_ADDRESS=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
# Generate a key at https://app.pinata.cloud/developers/api-keys # Generate a key at https://app.pinata.cloud/developers/api-keys
PINATA_JWT= PINATA_JWT=
@ -16,11 +16,11 @@ PINATA_GATEWAY=
# Change to your website URL # Change to your website URL
# For development: SITE_URL=http://localhost:3000 # For development: SITE_URL=http://localhost:3000
SITE_URL=https://memes.markto.market SITE_URL=https://memes.markto.market
NEXT_PUBLIC_ACCOUNT_HANDLE= NEXT_PUBLIC_TWITTER_HANDLE=
WSOL_LOCKER_PRIVATE_KEY= WSOL_LOCKER_ACCOUNT_PK=
WSOL_MINT=So11111111111111111111111111111111111111112 WSOL_MINT_ADDRESS=So11111111111111111111111111111111111111112
# Duration in seconds that WSOL will be locked for # Duration in seconds that WSOL will be locked for
CLIFF_TIME=172800 # 48 hours WSOL_LOCK_DURATION_IN_SECONDS=172800 # 48 hours
REWARD_MULTIPLIER=4 REWARD_MULTIPLIER=4

View File

@ -52,7 +52,7 @@ This project is a Solana-based meme generator that allows users to connect their
PINATA_GATEWAY= PINATA_GATEWAY=
# Add the account handle to be set in the tweet # Add the account handle to be set in the tweet
NEXT_PUBLIC_ACCOUNT_HANDLE= NEXT_PUBLIC_TWITTER_HANDLE=
``` ```
- Run the development server: - Run the development server:

View File

@ -3,11 +3,11 @@ import BN from "bn.js";
import fetch from 'node-fetch'; import fetch from 'node-fetch';
import Big from 'big.js'; import Big from 'big.js';
assert(process.env.NEXT_PUBLIC_USDC_MINT, 'USDC_MINT is required'); assert(process.env.NEXT_PUBLIC_USDC_MINT_ADDRESS, 'USDC_MINT_ADDRESS is required');
assert(process.env.NEXT_PUBLIC_MTM_TOKEN_MINT, 'MTM_TOKEN_MINT is required'); assert(process.env.NEXT_PUBLIC_MTM_MINT_ADDRESS, 'MTM_MINT_ADDRESS is required');
const MTM_TOKEN_MINT = process.env.NEXT_PUBLIC_MTM_TOKEN_MINT; const MTM_TOKEN_MINT = process.env.NEXT_PUBLIC_MTM_MINT_ADDRESS;
const USDC_MINT = process.env.NEXT_PUBLIC_USDC_MINT; const USDC_MINT = process.env.NEXT_PUBLIC_USDC_MINT_ADDRESS;
class QuotesService { class QuotesService {
// Stores the MTM amount for 1 USDC // Stores the MTM amount for 1 USDC

View File

@ -22,7 +22,7 @@ export async function POST(req: NextRequest): Promise<NextResponse> {
} }
const isSigVerified = await verifySignatureInTweet(txSignature); const isSigVerified = await verifySignatureInTweet(txSignature);
const isHandleCorrect = handle === process.env.NEXT_PUBLIC_ACCOUNT_HANDLE; const isHandleCorrect = handle === process.env.NEXT_PUBLIC_TWITTER_HANDLE;
// TODO: Verify dynamic page URL in tweet // TODO: Verify dynamic page URL in tweet
const isVerified = isSigVerified && isHandleCorrect; const isVerified = isSigVerified && isHandleCorrect;

View File

@ -95,7 +95,7 @@ const AIServiceCard: React.FC<AIServiceCardProps> = ({
const cid = imageUrl.split("/image/")[1]; const cid = imageUrl.split("/image/")[1];
const memePageUrl = `${baseUrl}memes/${cid}`; const memePageUrl = `${baseUrl}memes/${cid}`;
const tweetText = `Check out this meme that I generated! \n TX Hash: '${transactionSignature}' \n @${process.env.NEXT_PUBLIC_ACCOUNT_HANDLE} \n`; const tweetText = `Check out this meme that I generated! \n TX Hash: '${transactionSignature}' \n @${process.env.NEXT_PUBLIC_TWITTER_HANDLE} \n`;
return `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(memePageUrl)}`; return `https://twitter.com/intent/tweet?text=${encodeURIComponent(tweetText)}&url=${encodeURIComponent(memePageUrl)}`;
}; };

View File

@ -12,11 +12,11 @@ import {
import { WalletType } from './types' import { WalletType } from './types'
assert(process.env.NEXT_PUBLIC_SOLANA_RPC_URL, 'SOLANA_RPC_URL is required'); assert(process.env.NEXT_PUBLIC_SOLANA_RPC_URL, 'SOLANA_RPC_URL is required');
assert(process.env.NEXT_PUBLIC_MTM_TOKEN_MINT, 'MTM_TOKEN_MINT is required'); assert(process.env.NEXT_PUBLIC_MTM_MINT_ADDRESS, 'MTM_MINT_ADDRESS is required');
assert(process.env.NEXT_PUBLIC_PAYMENT_RECEIVER_ADDRESS, 'PAYMENT_RECEIVER_ADDRESS is required'); assert(process.env.NEXT_PUBLIC_MTM_RECIPIENT_MULTISIG_ADDRESS, 'MTM_RECIPIENT_MULTISIG_ADDRESS is required');
const MTM_TOKEN_MINT = process.env.NEXT_PUBLIC_MTM_TOKEN_MINT; const MTM_TOKEN_MINT = process.env.NEXT_PUBLIC_MTM_MINT_ADDRESS;
const PAYMENT_RECEIVER_ADDRESS = process.env.NEXT_PUBLIC_PAYMENT_RECEIVER_ADDRESS; const PAYMENT_RECEIVER_ADDRESS = process.env.NEXT_PUBLIC_MTM_RECIPIENT_MULTISIG_ADDRESS;
const SOLANA_RPC_URL = process.env.NEXT_PUBLIC_SOLANA_RPC_URL; const SOLANA_RPC_URL = process.env.NEXT_PUBLIC_SOLANA_RPC_URL;
const SOLANA_WEBSOCKET_URL = process.env.NEXT_PUBLIC_SOLANA_WEBSOCKET_URL; const SOLANA_WEBSOCKET_URL = process.env.NEXT_PUBLIC_SOLANA_WEBSOCKET_URL;

View File

@ -13,17 +13,17 @@ import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { createVestingPlanV2 } from '../locker-utils'; import { createVestingPlanV2 } from '../locker-utils';
assert(process.env.NEXT_PUBLIC_SOLANA_RPC_URL); assert(process.env.NEXT_PUBLIC_SOLANA_RPC_URL);
assert(process.env.WSOL_LOCKER_PRIVATE_KEY); assert(process.env.WSOL_LOCKER_ACCOUNT_PK);
assert(process.env.WSOL_MINT); assert(process.env.WSOL_MINT_ADDRESS);
const RPC_ENDPOINT= process.env.NEXT_PUBLIC_SOLANA_RPC_URL; const RPC_ENDPOINT= process.env.NEXT_PUBLIC_SOLANA_RPC_URL;
const WSOL_MINT = process.env.WSOL_MINT; const WSOL_MINT_ADDRESS = process.env.WSOL_MINT_ADDRESS;
const WSOL_LOCKER_PRIVATE_KEY = process.env.WSOL_LOCKER_PRIVATE_KEY; const WSOL_LOCKER_ACCOUNT_PK = process.env.WSOL_LOCKER_ACCOUNT_PK;
const userKP = anchor.web3.Keypair.fromSecretKey(bs58.decode(WSOL_LOCKER_PRIVATE_KEY)); const userKP = anchor.web3.Keypair.fromSecretKey(bs58.decode(WSOL_LOCKER_ACCOUNT_PK));
const connection = new Connection(RPC_ENDPOINT); const connection = new Connection(RPC_ENDPOINT);
const token = new PublicKey(WSOL_MINT); const token = new PublicKey(WSOL_MINT_ADDRESS);
const provider = new anchor.AnchorProvider( const provider = new anchor.AnchorProvider(
connection, connection,
@ -85,20 +85,20 @@ export async function extractInfo(transactionSignature: string) {
} }
export async function createRewardLock(authority: string, amount: string) { export async function createRewardLock(authority: string, amount: string) {
const { WSOL_LOCKER_PRIVATE_KEY, CLIFF_TIME, WSOL_MINT, NEXT_PUBLIC_MTM_TOKEN_MINT, REWARD_MULTIPLIER } = process.env; const { WSOL_LOCKER_ACCOUNT_PK, WSOL_LOCK_DURATION_IN_SECONDS, WSOL_MINT_ADDRESS, NEXT_PUBLIC_MTM_MINT_ADDRESS, REWARD_MULTIPLIER } = process.env;
if (!WSOL_LOCKER_PRIVATE_KEY || !CLIFF_TIME || !WSOL_MINT || !NEXT_PUBLIC_MTM_TOKEN_MINT || !REWARD_MULTIPLIER) { if (!WSOL_LOCKER_ACCOUNT_PK || !WSOL_LOCK_DURATION_IN_SECONDS || !WSOL_MINT_ADDRESS || !NEXT_PUBLIC_MTM_MINT_ADDRESS || !REWARD_MULTIPLIER) {
throw new Error('Missing required environment variables'); throw new Error('Missing required environment variables');
} }
const duration = new BN(CLIFF_TIME).add(new BN(Math.floor(Date.now() / 1000))); const duration = new BN(WSOL_LOCK_DURATION_IN_SECONDS).add(new BN(Math.floor(Date.now() / 1000)));
const tokenLockerKeypair = Keypair.fromSecretKey(bs58.decode(WSOL_LOCKER_PRIVATE_KEY)); const tokenLockerKeypair = Keypair.fromSecretKey(bs58.decode(WSOL_LOCKER_ACCOUNT_PK));
const recipientPublicKey = new PublicKey(authority); const recipientPublicKey = new PublicKey(authority);
const url = `https://api.jup.ag/price/v2?ids=${NEXT_PUBLIC_MTM_TOKEN_MINT}&vsToken=${WSOL_MINT}`; const url = `https://api.jup.ag/price/v2?ids=${NEXT_PUBLIC_MTM_MINT_ADDRESS}&vsToken=${WSOL_MINT_ADDRESS}`;
const response = await fetch(url); const response = await fetch(url);
const { data } = await response.json(); const { data } = await response.json();
const priceWSOLFor1MTM = new Big(data[NEXT_PUBLIC_MTM_TOKEN_MINT].price).toFixed(9); const priceWSOLFor1MTM = new Big(data[NEXT_PUBLIC_MTM_MINT_ADDRESS].price).toFixed(9);
const mtmAmount = new Big(amount).div(new Big(10).pow(6)); const mtmAmount = new Big(amount).div(new Big(10).pow(6));
const wsolAmount = new BN(new Big(mtmAmount).times(priceWSOLFor1MTM).times(new Big(10).pow(9)).times(REWARD_MULTIPLIER).toFixed(0)); const wsolAmount = new BN(new Big(mtmAmount).times(priceWSOLFor1MTM).times(new Big(10).pow(9)).times(REWARD_MULTIPLIER).toFixed(0));