diff --git a/cspell-zksync.txt b/cspell-zksync.txt index 19519ec56..ff46c027c 100644 --- a/cspell-zksync.txt +++ b/cspell-zksync.txt @@ -41,8 +41,6 @@ Alef Zcon Paypal Numio -banxa -keriat // Used libraries numberish diff --git a/firebase.json b/firebase.json index ba47b73c7..22ebe9c50 100644 --- a/firebase.json +++ b/firebase.json @@ -21,10 +21,6 @@ "**/node_modules/**" ], "rewrites": [ - { - "source": "/api/banxaAuth", - "function": "banxaAuth" - }, { "source": "/api/moonpaySign", "function": "moonpaySign" @@ -111,10 +107,6 @@ "**/node_modules/**" ], "rewrites": [ - { - "source": "/api/banxaAuth", - "function": "banxaAuth" - }, { "source": "/api/moonpaySign", "function": "moonpaySign" diff --git a/functions/package.json b/functions/package.json index bed0008bd..2237338af 100644 --- a/functions/package.json +++ b/functions/package.json @@ -5,7 +5,6 @@ "zksync", "firebase", "moonpay", - "banxa", "defi", "payment gateway", "cryptopayments", diff --git a/functions/src/functions/banxa.auth.ts b/functions/src/functions/banxa.auth.ts deleted file mode 100644 index 1168d7ad8..000000000 --- a/functions/src/functions/banxa.auth.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as functions from "firebase-functions"; -import { createHmac, BinaryLike } from "crypto"; - -type Network = "mainnet"; - -/** - * The Banxa API implements an HMAC authentication strategy which requires the payload of the message to be hashed. - * The hashing of the payload needs to be correct, otherwise, the API request will be rejected. - * - * @link https://docs.banxa.com/docs/step-3-authentication#signature - * - * @param {functions.Request} request - * @param {functions.Response} response - * @return void - */ -export function banxaAuthFunction(request: functions.Request, response: functions.Response): void { - if (!request.headers["content-type"].includes("application/json")) { - throw new functions.https.HttpsError("unavailable", "Expected application/json"); - } - const data: { nonce?: string; dataToSign?: BinaryLike; ethNetwork?: string } = request.body; - if (!data?.nonce || !data?.dataToSign) { - throw new functions.https.HttpsError("invalid-argument", "Requested nonce or/and dataToSign are invalid"); - } - - const banxaConfig: Record | undefined = - functions.config().providers.banxa; - - if (!banxaConfig) { - throw new functions.https.HttpsError("failed-precondition", "Banxa config is missing"); - } - - if (!data.ethNetwork || !banxaConfig[data.ethNetwork]) { - throw new functions.https.HttpsError("invalid-argument", `Requested network ${data.ethNetwork} is not supported`); - } - - const apiKey = banxaConfig[data.ethNetwork].api_key; - const secretKey = banxaConfig[data.ethNetwork].secret_key; - - if (!apiKey || !secretKey) { - throw new functions.https.HttpsError("failed-precondition", "Banxa config is invalid"); - } - - const localSignature = createHmac("SHA256", secretKey).update(data.dataToSign).digest("hex"); - - const responseData = { - bearer: `${apiKey}:${localSignature}:${data.nonce}`, - nonce: data.nonce, - }; - - response.status(200); - response.send(responseData); -} diff --git a/functions/src/index.ts b/functions/src/index.ts index 544f29ff3..c12ae2787 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -1,15 +1,8 @@ import { handlerHelper } from "./helpers/handlerHelper.js"; import { moonpaySignFunction } from "./functions/moonpay.sign.js"; -import { banxaAuthFunction } from "./functions/banxa.auth.js"; import { sentryTunnelFunction } from "./functions/sentry.tunnel.js"; import { mixpanelTunnelFunction } from "./functions/mixpanel.tunnel.js"; -/** - * Banxa Authentication server-side lambda - * @function banxa_auth - */ -export const banxaAuth = handlerHelper(banxaAuthFunction); - /** * Moonpay URL signing server-side lambda * @function moonpay_sing @@ -22,9 +15,8 @@ export const moonpaySign = handlerHelper(moonpaySignFunction); */ export const mixpanelTunnel = handlerHelper(mixpanelTunnelFunction); - /** * Sentry tunneling to deal with cross-site-blockers * @function sentry_tunnel */ -export const sentryTunnel = handlerHelper(sentryTunnelFunction); \ No newline at end of file +export const sentryTunnel = handlerHelper(sentryTunnelFunction); diff --git a/nuxt.config.ts b/nuxt.config.ts index 2c4a0c900..2f61b71f7 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -251,7 +251,6 @@ const config = { proxy: isLocalhost ? { "/api/moonpaySign": `${functionsBaseUrl}moonpaySign`, - "/api/banxaAuth": `${functionsBaseUrl}banxaAuth`, "/tunnel/mixpanel": `${functionsBaseUrl}mixpanelTunnel`, "/tunnel/sentry": `${functionsBaseUrl}sentryTunnel`, } diff --git a/src/components/TopUpProviders.vue b/src/components/TopUpProviders.vue index 47bfc5d40..e766ccfc8 100644 --- a/src/components/TopUpProviders.vue +++ b/src/components/TopUpProviders.vue @@ -1,40 +1,14 @@ \ No newline at end of file + diff --git a/src/components/TopUpProviders/Banxa.vue b/src/components/TopUpProviders/Banxa.vue deleted file mode 100644 index 5828eca5a..000000000 --- a/src/components/TopUpProviders/Banxa.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - - - diff --git a/src/components/TopUpProviders/Orbiter.vue b/src/components/TopUpProviders/Orbiter.vue deleted file mode 100644 index a46f81f36..000000000 --- a/src/components/TopUpProviders/Orbiter.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - diff --git a/src/components/TransferProviders.vue b/src/components/TransferProviders.vue index 3abf920f1..319129b84 100644 --- a/src/components/TransferProviders.vue +++ b/src/components/TransferProviders.vue @@ -1,32 +1,20 @@ \ No newline at end of file + diff --git a/src/components/TransferProviders/Banxa.vue b/src/components/TransferProviders/Banxa.vue deleted file mode 100644 index 289ec82db..000000000 --- a/src/components/TransferProviders/Banxa.vue +++ /dev/null @@ -1,89 +0,0 @@ - - - - - diff --git a/src/pages/account/top-up.vue b/src/pages/account/top-up.vue index a56405932..356d97038 100644 --- a/src/pages/account/top-up.vue +++ b/src/pages/account/top-up.vue @@ -19,7 +19,7 @@ You can buy crypto directly on zkSync lite with your credit card, just go through KYC process of our partners and enter your wallet address - +
@@ -56,7 +56,7 @@
You can bridge your assets from other networks & exchanges using one of our supported bridges
- +
diff --git a/src/pages/account/transfer.vue b/src/pages/account/transfer.vue index a69d65dfe..e19e4cdbe 100644 --- a/src/pages/account/transfer.vue +++ b/src/pages/account/transfer.vue @@ -15,19 +15,6 @@ -
-
-
or
-
-
-
-

Sell Crypto for Fiat

-
- You can sell your assets on the zkSync lite network with our partners, and get a payout to your bank account. - Just finish the KYC process -
- -