From fb6820bb3201e7b615149a28a098cf53c919d6d6 Mon Sep 17 00:00:00 2001 From: Jonathan Gan Date: Fri, 19 Jul 2024 08:00:04 -0400 Subject: [PATCH] Fix types for build --- package.json | 2 +- src/pages/api/sign/create.ts | 4 ++-- src/pages/api/sign/validate.ts | 4 ++-- src/types.ts | 3 ++- yarn.lock | 30 +++++++----------------------- 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index d7897d0..163e76b 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,6 @@ "eslint-config-next": "13.1.1", "postcss": "^8.4.21", "tailwindcss": "^3.2.4", - "typescript": "4.9.4" + "typescript": "^5.5.3" } } diff --git a/src/pages/api/sign/create.ts b/src/pages/api/sign/create.ts index a322679..613cdfa 100644 --- a/src/pages/api/sign/create.ts +++ b/src/pages/api/sign/create.ts @@ -30,7 +30,7 @@ export default async function handler( const { publicKeyStr, privateKey, inputMint, outputMint, amount, slippageBps } = req.body; if (!privateKey || !inputMint || !outputMint || !amount || !slippageBps || !publicKeyStr) { - res.status(400).send({ message: 'Missing required fields' }); + // res.status(400).send( 'Missing required fields'); return; } @@ -74,6 +74,6 @@ export default async function handler( res.status(200).json({ tx: txBase64 }); } catch (error: any) { console.error('Error executing swap:', error); - res.status(500).send({ message: 'Error executing swap', error: error.message }); + // res.status(500).send({ message: 'Error executing swap', error: error.message }); } } diff --git a/src/pages/api/sign/validate.ts b/src/pages/api/sign/validate.ts index 53e78e8..7e2e0a8 100644 --- a/src/pages/api/sign/validate.ts +++ b/src/pages/api/sign/validate.ts @@ -1,5 +1,5 @@ import { Transaction } from "@solana/web3.js"; -import { MEMO_PROGRAM_ID, NONCE } from "@utils/globals"; +import { MEMO_PROGRAM_ID } from "@utils/globals"; import { NextApiRequest, NextApiResponse } from "next"; export type SignValidateData = { @@ -21,7 +21,7 @@ export default async function handler( const tx = Transaction.from(Buffer.from(signedTx, "base64")); // Ideally this would be retrieved from a DB for each publicKey - const nonce = NONCE; + const nonce = ""; try { const inx = tx.instructions[0]; diff --git a/src/types.ts b/src/types.ts index 336ce12..7846e6a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1 +1,2 @@ -export {} +export declare function getDataEnumEncoder(data: any): string; + diff --git a/yarn.lock b/yarn.lock index 13448e8..4f1525f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8691,7 +8691,7 @@ strict-uri-encode@^2.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8709,15 +8709,6 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -8817,7 +8808,7 @@ stringify-object@3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -8831,13 +8822,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: dependencies: ansi-regex "^4.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^7.0.1: version "7.1.0" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" @@ -9239,16 +9223,16 @@ typescript-collections@^1.3.3: resolved "https://registry.yarnpkg.com/typescript-collections/-/typescript-collections-1.3.3.tgz#62d50d93c018c094d425eabee649f00ec5cc0fea" integrity sha512-7sI4e/bZijOzyURng88oOFZCISQPTHozfE2sUu5AviFYk5QV7fYGb6YiDl+vKjF/pICA354JImBImL9XJWUvdQ== -typescript@4.9.4: - version "4.9.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" - integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== - typescript@^4.6.2: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typescript@^5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.3.tgz#e1b0a3c394190838a0b168e771b0ad56a0af0faa" + integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ== + ua-parser-js@^1.0.37: version "1.0.38" resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-1.0.38.tgz#66bb0c4c0e322fe48edfe6d446df6042e62f25e2"