From c4c8b7b590acc047d7e40e58de5d555026401139 Mon Sep 17 00:00:00 2001 From: Kami Date: Tue, 5 Dec 2023 04:30:56 +0330 Subject: [PATCH] Update consts.ts --- packages/dapp/src/util/consts.ts | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/packages/dapp/src/util/consts.ts b/packages/dapp/src/util/consts.ts index 4b45bb4..ce57e61 100644 --- a/packages/dapp/src/util/consts.ts +++ b/packages/dapp/src/util/consts.ts @@ -1,30 +1,12 @@ -import { getLatestPackageVersion } from "./getLatestPackageVersion"; - -let SNAP_VERSION = '>=0.1.5'; - -// Example usage -const packageName = '@polkagate/snap'; -getLatestPackageVersion(packageName) - .then((latestVersion) => { - SNAP_VERSION = latestVersion; - console.log(`Latest version of ${packageName}: ${latestVersion}`); - }) - .catch((error) => { - console.error('Failed to get the latest version:', error); - }); - -// const LOCAL_SNAP_ID = 'local:http://localhost:8080'; +const SNAP_VERSION = '>=0.1.5'; +const LOCAL_SNAP_ID = 'local:http://localhost:8080'; const NPM_SNAP_ID = 'npm:@polkagate/snap'; -// export const POLKAMASK_SNAP_IDS = [LOCAL_SNAP_ID, NPM_SNAP_ID] - -export const DEFAULT_SNAP_ORIGIN = - process.env.SNAP_ORIGIN ?? NPM_SNAP_ID; -// process.env.SNAP_ORIGIN ?? LOCAL_SNAP_ID; +export const DEFAULT_SNAP_ORIGIN = process.env.REACT_APP_MODE === 'production' ? NPM_SNAP_ID : LOCAL_SNAP_ID; export const SUPPORTED_SNAPS = { [DEFAULT_SNAP_ORIGIN]: { version: SNAP_VERSION }, // 'npm:@chainsafe/polkadot-snap': {}, }; -export const POLKAMASK_ACCOUNT_META_SOURCE = 'polkamask' \ No newline at end of file +export const POLKAMASK_ACCOUNT_META_SOURCE = 'polkamask'; \ No newline at end of file