-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support multiple environment (#366)
* feat: Support multi environment * refactor: Clean env variables
- Loading branch information
Showing
29 changed files
with
318 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
NEXT_PUBLIC_DEFAULT_CHAIN_ID="dev.gnoswap" | ||
NEXT_PUBLIC_API_URL="https://dev.api.gnoswap.io/v1" | ||
NEXT_PUBLIC_PACKAGE_ROUTER_PATH="gno.land/r/demo/router" | ||
NEXT_PUBLIC_PACKAGE_POOL_PATH="gno.land/r/demo/pool" | ||
NEXT_PUBLIC_PACKAGE_POSITION_PATH="gno.land/r/demo/position" | ||
NEXT_PUBLIC_PACKAGE_STAKER_PATH="gno.land/r/demo/staker" | ||
NEXT_PUBLIC_PACKAGE_NFT_PATH="gno.land/r/demo/gnft" | ||
NEXT_PUBLIC_GOVERNANCE_PATH="gno.land/r/demo/gov" | ||
NEXT_PUBLIC_WRAPPED_GNOT_PATH="gno.land/r/demo/wugnot" | ||
NEXT_PUBLIC_GNOS_PATH="gno.land/r/demo/gns" | ||
NEXT_PUBLIC_PACKAGE_ROUTER_ADDRESS="g1pjtpgjpsn4hjfv2n4mpz8cczdn32jkpsqwxuav" | ||
NEXT_PUBLIC_PACKAGE_POOL_ADDRESS="g15z32w7txv6lw259xzhzzmwtwmcjjc0m6dqzh6f" | ||
NEXT_PUBLIC_PACKAGE_POSITION_ADDRESS="g10wwa53xgu4397kvzz7akxar9370zjdpwux5th9" | ||
NEXT_PUBLIC_PACKAGE_STAKER_ADDRESS="g1puv9dz470prjshjm9qyg25dyfvrgph2kvjph68" | ||
NEXT_PUBLIC_PACKAGE_GOVERNANCE_ADDRESS="g1kmat25auuqf0h5qvd4q7s707r8let5sky4tr76" | ||
NEXT_PUBLIC_CHAINS="" | ||
NEXT_PUBLIC_DEFAULT_CHAIN_ID="" | ||
NEXT_PUBLIC_API_URL="" | ||
NEXT_PUBLIC_ROUTER_API_URL="" | ||
NEXT_PUBLIC_DEV_CHAIN_ID="" | ||
NEXT_PUBLIC_DEV_API_URL="" | ||
NEXT_PUBLIC_DEV_ROUTER_API_URL="" | ||
NEXT_PUBLIC_PACKAGE_GNOSWAP_CONST_PATH="" | ||
NEXT_PUBLIC_PACKAGE_ROUTER_PATH="" | ||
NEXT_PUBLIC_PACKAGE_POOL_PATH="" | ||
NEXT_PUBLIC_PACKAGE_POSITION_PATH="" | ||
NEXT_PUBLIC_PACKAGE_STAKER_PATH="" | ||
NEXT_PUBLIC_PACKAGE_NFT_PATH="" | ||
NEXT_PUBLIC_GOVERNANCE_PATH="" | ||
NEXT_PUBLIC_WRAPPED_GNOT_PATH="" | ||
NEXT_PUBLIC_GNS_TOKEN_PATH="" | ||
NEXT_PUBLIC_PACKAGE_ROUTER_ADDRESS="" | ||
NEXT_PUBLIC_PACKAGE_POOL_ADDRESS="" | ||
NEXT_PUBLIC_PACKAGE_POSITION_ADDRESS="" | ||
NEXT_PUBLIC_PACKAGE_STAKER_ADDRESS="" | ||
NEXT_PUBLIC_PACKAGE_GOVERNANCE_ADDRESS="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
NEXT_PUBLIC_CHAINS="dev.gnoswap" | ||
NEXT_PUBLIC_DEFAULT_CHAIN_ID="dev.gnoswap" | ||
NEXT_PUBLIC_API_URL="https://dev.api.gnoswap.io/v1" | ||
NEXT_PUBLIC_ROUTER_API_URL="https://dev.route.gnoswap.io" | ||
NEXT_PUBLIC_DEV_CHAIN_ID="dev.gnoswap" | ||
NEXT_PUBLIC_DEV_API_URL="https://dev.api.gnoswap.io/v1" | ||
NEXT_PUBLIC_DEV_ROUTER_API_URL="https://dev.route.gnoswap.io" | ||
NEXT_PUBLIC_PACKAGE_GNOSWAP_CONST_PATH="gno.land/r/demo/gnoswap/consts" | ||
NEXT_PUBLIC_PACKAGE_ROUTER_PATH="gno.land/r/demo/router" | ||
NEXT_PUBLIC_PACKAGE_POOL_PATH="gno.land/r/demo/pool" | ||
NEXT_PUBLIC_PACKAGE_POSITION_PATH="gno.land/r/demo/position" | ||
NEXT_PUBLIC_PACKAGE_STAKER_PATH="gno.land/r/demo/staker" | ||
NEXT_PUBLIC_PACKAGE_NFT_PATH="gno.land/r/demo/gnft" | ||
NEXT_PUBLIC_GOVERNANCE_PATH="gno.land/r/demo/gov" | ||
NEXT_PUBLIC_WRAPPED_GNOT_PATH="gno.land/r/demo/wugnot" | ||
NEXT_PUBLIC_GNS_TOKEN_PATH="gno.land/r/demo/gns" | ||
NEXT_PUBLIC_PACKAGE_ROUTER_ADDRESS="g1pjtpgjpsn4hjfv2n4mpz8cczdn32jkpsqwxuav" | ||
NEXT_PUBLIC_PACKAGE_POOL_ADDRESS="g15z32w7txv6lw259xzhzzmwtwmcjjc0m6dqzh6f" | ||
NEXT_PUBLIC_PACKAGE_POSITION_ADDRESS="g10wwa53xgu4397kvzz7akxar9370zjdpwux5th9" | ||
NEXT_PUBLIC_PACKAGE_STAKER_ADDRESS="g1puv9dz470prjshjm9qyg25dyfvrgph2kvjph68" | ||
NEXT_PUBLIC_PACKAGE_GOVERNANCE_ADDRESS="g1kmat25auuqf0h5qvd4q7s707r8let5sky4tr76" | ||
NEXT_PUBLIC_WRAPPED_GNOT_PATH="gno.land/r/demo/wugnot" | ||
NEXT_PUBLIC_GNS_TOKEN_PATH="gno.land/r/demo/gns" | ||
NEXT_PUBLIC_PACKAGE_GOVERNANCE_ADDRESS="g1kmat25auuqf0h5qvd4q7s707r8let5sky4tr76" |
72 changes: 0 additions & 72 deletions
72
packages/web/src/common/clients/wallet-client/transaction-messages/common.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
packages/web/src/common/clients/wallet-client/transaction-messages/pool.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
packages/web/src/common/clients/wallet-client/transaction-messages/position.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
packages/web/src/common/clients/wallet-client/transaction-messages/staker.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ages/web/src/components/earn/earn-my-positions-no-liquidity/EarnMyPositionNoLiquidity.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
export const DEFAULT_NETWORK_ID = "dev.gnoswap"; | ||
export const DEFAULT_NETWORK_ID = "portal-loop"; | ||
|
||
export const PATH = ["/earn"]; | ||
// 10SECOND/60SECOND is the specific time for data refetching cycles. `useGetPositionsByAddress` will refetch after these specific time | ||
export const PATH_10SECOND = ["/earn/pool/[pool-path]/remove", "/tokens/[token-path]"]; | ||
export const PATH_60SECOND = ["/wallet", "/earn/pool/[pool-path]/stake", "/earn/pool/[pool-path]/unstake", "/earn/pool/[pool-path]"]; | ||
export const PATH_10SECOND = [ | ||
"/earn/pool/[pool-path]/remove", | ||
"/tokens/[token-path]", | ||
]; | ||
export const PATH_60SECOND = [ | ||
"/wallet", | ||
"/earn/pool/[pool-path]/stake", | ||
"/earn/pool/[pool-path]/unstake", | ||
"/earn/pool/[pool-path]", | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const ENV_VARIABLES = { | ||
CHAINS: process.env.NEXT_PUBLIC_CHAINS?.split(",") || [], | ||
DEFAULT_CHAIN_ID: process.env.NEXT_PUBLIC_DEFAULT_CHAIN_ID || "", | ||
API_URL: process.env.NEXT_PUBLIC_API_URL || "", | ||
ROUTER_API_URL: process.env.NEXT_PUBLIC_ROUTER_API_URL || "", | ||
DEV_CHAIN_ID: process.env.NEXT_PUBLIC_DEV_CHAIN_ID || "", | ||
DEV_API_URL: process.env.NEXT_PUBLIC_DEV_API_URL || "", | ||
DEV_ROUTER_API_URL: process.env.NEXT_PUBLIC_DEV_ROUTER_API_URL || "", | ||
PACKAGE_GNOSWAP_CONST_PATH: | ||
process.env.NEXT_PUBLIC_PACKAGE_GNOSWAP_CONST_PATH || "", | ||
PACKAGE_ROUTER_PATH: process.env.NEXT_PUBLIC_PACKAGE_ROUTER_PATH || "", | ||
PACKAGE_POOL_PATH: process.env.NEXT_PUBLIC_PACKAGE_POOL_PATH || "", | ||
PACKAGE_POSITION_PATH: process.env.NEXT_PUBLIC_PACKAGE_POSITION_PATH || "", | ||
PACKAGE_STAKER_PATH: process.env.NEXT_PUBLIC_PACKAGE_STAKER_PATH || "", | ||
PACKAGE_NFT_PATH: process.env.NEXT_PUBLIC_PACKAGE_NFT_PATH || "", | ||
GOVERNANCE_PATH: process.env.NEXT_PUBLIC_GOVERNANCE_PATH || "", | ||
WRAPPED_GNOT_PATH: process.env.NEXT_PUBLIC_WRAPPED_GNOT_PATH || "", | ||
GNS_TOKEN_PATH: process.env.NEXT_PUBLIC_GNS_TOKEN_PATH || "", | ||
PACKAGE_ROUTER_ADDRESS: process.env.NEXT_PUBLIC_PACKAGE_ROUTER_ADDRESS || "", | ||
PACKAGE_POOL_ADDRESS: process.env.NEXT_PUBLIC_PACKAGE_POOL_ADDRESS || "", | ||
PACKAGE_POSITION_ADDRESS: | ||
process.env.NEXT_PUBLIC_PACKAGE_POSITION_ADDRESS || "", | ||
PACKAGE_STAKER_ADDRESS: process.env.NEXT_PUBLIC_PACKAGE_STAKER_ADDRESS || "", | ||
PACKAGE_GOVERNANCE_ADDRESS: | ||
process.env.NEXT_PUBLIC_PACKAGE_GOVERNANCE_ADDRESS || "", | ||
}; | ||
|
||
const currentEnvVariables = ENV_VARIABLES; | ||
|
||
export const CHAINS = currentEnvVariables.CHAINS; | ||
export const DEFAULT_CHAIN_ID = currentEnvVariables.DEFAULT_CHAIN_ID; | ||
export const API_URL = currentEnvVariables.API_URL; | ||
export const ROUTER_API_URL = currentEnvVariables.ROUTER_API_URL; | ||
export const DEV_CHAIN_ID = currentEnvVariables.DEV_CHAIN_ID; | ||
export const DEV_API_URL = currentEnvVariables.DEV_API_URL; | ||
export const DEV_ROUTER_API_URL = currentEnvVariables.DEV_ROUTER_API_URL; | ||
export const PACKAGE_GNOSWAP_CONST_PATH = | ||
currentEnvVariables.PACKAGE_GNOSWAP_CONST_PATH; | ||
export const PACKAGE_ROUTER_PATH = currentEnvVariables.PACKAGE_ROUTER_PATH; | ||
export const PACKAGE_POOL_PATH = currentEnvVariables.PACKAGE_POOL_PATH; | ||
export const PACKAGE_POSITION_PATH = currentEnvVariables.PACKAGE_POSITION_PATH; | ||
export const PACKAGE_STAKER_PATH = currentEnvVariables.PACKAGE_STAKER_PATH; | ||
export const PACKAGE_NFT_PATH = currentEnvVariables.PACKAGE_NFT_PATH; | ||
export const GOVERNANCE_PATH = currentEnvVariables.GOVERNANCE_PATH; | ||
export const WRAPPED_GNOT_PATH = currentEnvVariables.WRAPPED_GNOT_PATH; | ||
export const GNS_TOKEN_PATH = currentEnvVariables.GNS_TOKEN_PATH; | ||
export const PACKAGE_ROUTER_ADDRESS = | ||
currentEnvVariables.PACKAGE_ROUTER_ADDRESS; | ||
export const PACKAGE_POOL_ADDRESS = currentEnvVariables.PACKAGE_POOL_ADDRESS; | ||
export const PACKAGE_POSITION_ADDRESS = | ||
currentEnvVariables.PACKAGE_POSITION_ADDRESS; | ||
export const PACKAGE_STAKER_ADDRESS = | ||
currentEnvVariables.PACKAGE_STAKER_ADDRESS; | ||
export const PACKAGE_GOVERNANCE_ADDRESS = | ||
currentEnvVariables.PACKAGE_GOVERNANCE_ADDRESS; |
Oops, something went wrong.