From d3d6c2c24d63487e6fc4d4ac79b251c0d6d62bee Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Mon, 21 Jul 2025 15:15:39 +0530 Subject: [PATCH] Remove explicit any --- .env.example | 6 +++--- README.md | 1 - src/app/api/registry/route.ts | 10 +++------- src/app/page.tsx | 3 ++- src/components/PaymentModal.tsx | 14 ++++++++++++-- src/components/URLForm.tsx | 3 ++- src/services/laconicTransfer.ts | 4 ++-- src/services/solana.ts | 2 +- src/types/index.ts | 6 ++++-- 9 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.env.example b/.env.example index 81378e1..6da1355 100644 --- a/.env.example +++ b/.env.example @@ -16,9 +16,9 @@ NEXT_PUBLIC_EXAMPLE_URL=https://git.vdb.to/cerc-io/test-progressive-web-app # Server-side environment variables # Laconic Registry Configuration -REGISTRY_CHAIN_ID= -REGISTRY_GQL_ENDPOINT= -REGISTRY_RPC_ENDPOINT= +REGISTRY_CHAIN_ID=laconic-mainnet +REGISTRY_RPC_ENDPOINT=https://laconicd-mainnet-1.laconic.com +REGISTRY_GQL_ENDPOINT=https://laconicd-mainnet-1.laconic.com/graphql REGISTRY_BOND_ID= REGISTRY_AUTHORITY= REGISTRY_USER_KEY= diff --git a/README.md b/README.md index ea62391..e34a499 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,6 @@ Server-side: - `REGISTRY_USER_KEY` - The private key for Laconic Registry transactions (also used for LNT transfers) - `APP_NAME` - The name of the application (used in record creation, defaults to "gor-deploy") - `DEPLOYER_LRN` - The LRN of the deployer -- `LACONIC_TRANSFER_AMOUNT` - The amount of LNT to transfer (e.g., "1000000alnt") ## Installation diff --git a/src/app/api/registry/route.ts b/src/app/api/registry/route.ts index 413f0b4..6e5f5d5 100644 --- a/src/app/api/registry/route.ts +++ b/src/app/api/registry/route.ts @@ -107,10 +107,10 @@ const fetchLatestCommitHash = async (repoUrl: string, provider: string): Promise // Registry transaction retry helper export const registryTransactionWithRetry = async ( - txFn: () => Promise, + txFn: () => Promise, maxRetries = 3, delay = 1000 -): Promise => { +): Promise => { let lastError; for (let attempt = 0; attempt < maxRetries; attempt++) { @@ -161,7 +161,7 @@ export async function POST(request: NextRequest) { // Verify Solana payment console.log('Step 0: Verifying Solana token payment...'); - const paymentAmount = parseInt(process.env.NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT || '400000000'); + const paymentAmount = parseInt(process.env.NEXT_PUBLIC_MIN_SOLANA_PAYMENT_AMOUNT!); const tokenAmount = new BN(paymentAmount); const solanaPaymentResult = await verifyUnusedSolanaPayment(connection, txHash, tokenAmount); @@ -202,10 +202,6 @@ export async function POST(request: NextRequest) { 'REGISTRY_AUTHORITY', 'REGISTRY_USER_KEY', // This is the same as the prefilled account for LNT transfers 'DEPLOYER_LRN', - // LNT transfer variables - 'LACONIC_TRANSFER_AMOUNT', - // Solana specific variables - 'NEXT_PUBLIC_SOLANA_RPC_URL', 'NEXT_PUBLIC_SOLANA_TOKEN_MINT_ADDRESS', 'NEXT_PUBLIC_SOLANA_TOKEN_RECIPIENT_ADDRESS' ]; diff --git a/src/app/page.tsx b/src/app/page.tsx index 682709b..0f1e461 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -54,6 +54,7 @@ export default function Home() { try { // Create the Laconic Registry record (payment verification is done in the API) const result = await createApplicationDeploymentRequest(url, hash, solanaWalletState.publicKey); + if (result.status === 'success') { setRecordId(result.id); if (result.applicationRecordId) { @@ -110,7 +111,7 @@ export default function Home() {

Payment method: - GOR (Solana) + {process.env.NEXT_PUBLIC_SOLANA_TOKEN_SYMBOL} (Solana)