File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515# misc
1616.DS_Store
1717.env.local
18+ .env. * .local
1819.env.development.local
1920.env.test.local
2021.env.production.local
Original file line number Diff line number Diff line change 1111 "clean:modules:trash" : " find . -name \" node_modules\" -type d -prune -exec trash {} +" ,
1212 "regen" : " rm -rf pnpm-lock.yaml && pnpm clean:modules && corepack use pnpm@latest" ,
1313 "dev" : " pnpm --filter widget-playground-vite dev" ,
14+ "dev:dev" : " pnpm --filter widget-playground-vite dev:dev" ,
15+ "dev:staging" : " pnpm --filter widget-playground-vite dev:staging" ,
1416 "dev:next" : " pnpm --filter widget-playground-next dev" ,
1517 "release" : " pnpm release:version && pnpm release:build && pnpm standard-version -a -s" ,
1618 "release:alpha" : " pnpm release:version --preid alpha && pnpm release:build && pnpm standard-version -a -s --prerelease alpha --skip.changelog" ,
Original file line number Diff line number Diff line change 11VITE_EVM_WALLET_CONNECT = 5432e3507d41270bee46b7b85bbc2ef8
2+ VITE_API_URL = https://li.quest/v1
Original file line number Diff line number Diff line change 1+ VITE_API_URL = https://develop.li.quest/v1
2+ # Set VITE_API_KEY in .env.dev.local (git-ignored)
Original file line number Diff line number Diff line change 1+ VITE_API_URL = https://staging.li.quest/v1
2+ # Set VITE_API_KEY in .env.staging.local (git-ignored)
Original file line number Diff line number Diff line change 55 "scripts" : {
66 "analyze" : " source-map-explorer 'dist/assets/*.js' --no-border-checks" ,
77 "dev" : " vite" ,
8+ "dev:dev" : " vite --mode dev" ,
9+ "dev:staging" : " vite --mode staging" ,
810 "build" : " tsc && vite build" ,
911 "clean" : " rm -rf dist tsconfig.tsbuildinfo" ,
1012 "preview" : " vite preview" ,
Original file line number Diff line number Diff line change @@ -48,3 +48,14 @@ if (!import.meta.env.VITE_EVM_WALLET_CONNECT) {
4848 'VITE_EVM_WALLET_CONNECT is require in your .env.local file for external wallet management'
4949 )
5050}
51+
52+ if (
53+ import . meta. env . MODE !== 'development' &&
54+ import . meta. env . MODE !== 'production' &&
55+ ! import . meta. env . VITE_API_KEY
56+ ) {
57+ throw new Error (
58+ `VITE_API_KEY is required when running in "${ import . meta. env . MODE } " mode. ` +
59+ `Please set it in your .env.${ import . meta. env . MODE } .local file.`
60+ )
61+ }
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ export const widgetBaseConfig: WidgetConfig = {
5353 // },
5454 // },
5555 integrator : 'li.fi-playground' ,
56+ ...( import . meta. env . VITE_API_KEY && {
57+ apiKey : import . meta. env . VITE_API_KEY ,
58+ } ) ,
5659 // fee: 0.01,
5760 // feeConfig: {
5861 // name: 'DApp fee',
@@ -74,7 +77,7 @@ export const widgetBaseConfig: WidgetConfig = {
7477 // usePartialWalletManagement: true,
7578 // },
7679 sdkConfig : {
77- apiUrl : 'https://li.quest/v1' ,
80+ apiUrl : import . meta . env . VITE_API_URL || 'https://li.quest/v1' ,
7881 preloadChains : false ,
7982 rpcUrls : {
8083 [ ChainId . SOL ] : [
Original file line number Diff line number Diff line change 1+ declare global {
2+ interface ImportMetaEnv {
3+ readonly VITE_API_URL ?: string
4+ readonly VITE_API_KEY ?: string
5+ }
6+
7+ interface ImportMeta {
8+ readonly env : ImportMetaEnv
9+ }
10+ }
11+
12+ export { }
You can’t perform that action at this time.
0 commit comments