From 98332316e196af5e61e514e2ce1c03937235020f Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Thu, 7 Dec 2023 09:39:40 -0800 Subject: [PATCH 1/2] Add envs for coinflow --- packages/web/.env/.env.dev | 4 +++- packages/web/.env/.env.prod | 4 +++- packages/web/.env/.env.stage | 4 +++- .../components/coinflow-onramp-modal/CoinflowOnrampModal.tsx | 5 +++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/web/.env/.env.dev b/packages/web/.env/.env.dev index 816510e28bb..aebb64ed871 100644 --- a/packages/web/.env/.env.dev +++ b/packages/web/.env/.env.dev @@ -48,4 +48,6 @@ VITE_STRIPE_CLIENT_PUBLISHABLE_KEY= # Stage optimizely key VITE_OPTIMIZELY_KEY=MX4fYBgANQetvmBXGpuxzF -VITE_USE_HASH_ROUTING=false \ No newline at end of file +VITE_USE_HASH_ROUTING=false + +VITE_COINFLOW_MERCHANT_ID=audius \ No newline at end of file diff --git a/packages/web/.env/.env.prod b/packages/web/.env/.env.prod index a718b8ab537..7211626a01d 100644 --- a/packages/web/.env/.env.prod +++ b/packages/web/.env/.env.prod @@ -88,4 +88,6 @@ VITE_OTEL_TRACING_ENABLED=true VITE_STRIPE_CLIENT_PUBLISHABLE_KEY=pk_live_51LPsGuCJOWtpH6AEKshlCs3L8QhAfevNvhev8K9a0u92O5ku83KRjLIqCdxgf3NhitdtmMGlw0Wjf33NjZJjZUBz006A3IoSiQ -VITE_USE_HASH_ROUTING=false \ No newline at end of file +VITE_USE_HASH_ROUTING=false + +VITE_COINFLOW_MERCHANT_ID=tikilabs \ No newline at end of file diff --git a/packages/web/.env/.env.stage b/packages/web/.env/.env.stage index ad75800c411..9b18b735f6f 100644 --- a/packages/web/.env/.env.stage +++ b/packages/web/.env/.env.stage @@ -77,4 +77,6 @@ VITE_OTEL_TRACING_ENABLED=true VITE_STRIPE_CLIENT_PUBLISHABLE_KEY=pk_test_51LPsGuCJOWtpH6AEZT3Wf2U2xmLZQrEV56yha7HEVTEyhYYVrWCdknml3t4gkSe9Nagd1o9Royy8zL3XEAmRzeHS00xAKTfgpi -VITE_USE_HASH_ROUTING=false \ No newline at end of file +VITE_USE_HASH_ROUTING=false + +VITE_COINFLOW_MERCHANT_ID=audius \ No newline at end of file diff --git a/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx b/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx index dec34382676..0b1d7cc6a79 100644 --- a/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx +++ b/packages/web/src/components/coinflow-onramp-modal/CoinflowOnrampModal.tsx @@ -15,7 +15,8 @@ import ModalDrawer from 'pages/audio-rewards-page/components/modals/ModalDrawer' import styles from './CoinflowOnrampModal.module.css' -const MERCHANT_ID = 'audius' +const MERCHANT_ID = process.env.VITE_COINFLOW_MERCHANT_ID +const IS_PRODUCTION = process.env.VITE_ENVIRONMENT === 'production' type CoinflowAdapter = { wallet: CoinflowSolanaPurchaseProps['wallet'] @@ -103,7 +104,7 @@ export const CoinflowOnrampModal = () => { wallet={adapter.wallet} connection={adapter.connection} merchantId={MERCHANT_ID} - env='sandbox' + env={IS_PRODUCTION ? 'prod' : 'sandbox'} blockchain='solana' amount={amount} /> From 10c785eaa9e3ad8aae87022ffa49540ec5b821bf Mon Sep 17 00:00:00 2001 From: Raymond Jacobson Date: Thu, 7 Dec 2023 10:07:26 -0800 Subject: [PATCH 2/2] Switch deps --- package-lock.json | 71 +++++++++++++++++------------------- packages/common/package.json | 1 - packages/web/package.json | 1 + 3 files changed, 34 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7fc9a3b3446..e5f1ae397e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3269,6 +3269,38 @@ "node": ">= 12" } }, + "node_modules/@coinflowlabs/react": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@coinflowlabs/react/-/react-2.7.0.tgz", + "integrity": "sha512-8YiHS1257O5AMheQTK106I4r6Ql0lvbb/t+mk1ksUXkuYmrwfnDkFjawMGhZFGsbYRvObhqGO9BTCidWNUYRRQ==", + "dependencies": { + "bn.js": "^5.2.1", + "bs58": "^5.0.0", + "socket.io-client": "^4.7.2" + }, + "peerDependencies": { + "@solana/web3.js": ">=1.54.0", + "react": ">=16" + }, + "peerDependenciesMeta": { + "@solana/web3.js": { + "optional": true + } + } + }, + "node_modules/@coinflowlabs/react/node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + }, + "node_modules/@coinflowlabs/react/node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dependencies": { + "base-x": "^4.0.0" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -119392,7 +119424,6 @@ "@audius/fixed-decimal": "*", "@audius/sdk": "*", "@audius/trpc-server": "*", - "@coinflowlabs/react": "2.7.0", "@fingerprintjs/fingerprintjs-pro": "3.5.6", "@jup-ag/api": "6.0.6", "@metaplex-foundation/mpl-token-metadata": "2.5.2", @@ -119448,30 +119479,6 @@ "redux-saga": "1.1.3" } }, - "packages/common/node_modules/@coinflowlabs/react": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@coinflowlabs/react/-/react-2.7.0.tgz", - "integrity": "sha512-8YiHS1257O5AMheQTK106I4r6Ql0lvbb/t+mk1ksUXkuYmrwfnDkFjawMGhZFGsbYRvObhqGO9BTCidWNUYRRQ==", - "dependencies": { - "bn.js": "^5.2.1", - "bs58": "^5.0.0", - "socket.io-client": "^4.7.2" - }, - "peerDependencies": { - "@solana/web3.js": ">=1.54.0", - "react": ">=16" - }, - "peerDependenciesMeta": { - "@solana/web3.js": { - "optional": true - } - } - }, - "packages/common/node_modules/@coinflowlabs/react/node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" - }, "packages/common/node_modules/@humanwhocodes/config-array": { "version": "0.9.5", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", @@ -119507,19 +119514,6 @@ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, - "packages/common/node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" - }, - "packages/common/node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", - "dependencies": { - "base-x": "^4.0.0" - } - }, "packages/common/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -152012,6 +152006,7 @@ "@audius/stems": "*", "@audius/trpc-server": "*", "@coinbase/cbpay-js": "1.2.0", + "@coinflowlabs/react": "2.7.0", "@emotion/css": "^11.11.2", "@emotion/styled": "^11.11.0", "@fingerprintjs/fingerprintjs-pro": "3.5.6", diff --git a/packages/common/package.json b/packages/common/package.json index 3f2b71b9195..be533565811 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -33,7 +33,6 @@ "@audius/fixed-decimal": "*", "@audius/sdk": "*", "@audius/trpc-server": "*", - "@coinflowlabs/react": "2.7.0", "@fingerprintjs/fingerprintjs-pro": "3.5.6", "@jup-ag/api": "6.0.6", "@metaplex-foundation/mpl-token-metadata": "2.5.2", diff --git a/packages/web/package.json b/packages/web/package.json index c1368e347ec..b1dd3bdb64a 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -58,6 +58,7 @@ "@audius/stems": "*", "@audius/trpc-server": "*", "@coinbase/cbpay-js": "1.2.0", + "@coinflowlabs/react": "2.7.0", "@emotion/css": "^11.11.2", "@emotion/styled": "^11.11.0", "@fingerprintjs/fingerprintjs-pro": "3.5.6",