Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gmx-io/gmx-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Aug 5, 2023
2 parents 0c04eab + 024108e commit 26626be
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 205 deletions.
9 changes: 4 additions & 5 deletions src/config/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export const RPC_PROVIDERS = {
[ARBITRUM]: ["https://arb1.arbitrum.io/rpc"],
[ARBITRUM_GOERLI]: [
"https://goerli-rollup.arbitrum.io/rpc",
// "https://arb-goerli.g.alchemy.com/v2/cZfd99JyN42V9Clbs_gOvA3GSBZH1-1j",
// "https://endpoints.omniatech.io/v1/arbitrum/goerli/public",
// "https://arbitrum-goerli.public.blastapi.io",
],
Expand Down Expand Up @@ -303,16 +302,16 @@ export function getFallbackRpcUrl(chainId: number): string | undefined {

export function getAlchemyHttpUrl() {
if (ALCHEMY_WHITELISTED_DOMAINS.includes(window.location.host)) {
return "https://arb-mainnet.g.alchemy.com/v2/ha7CFsr1bx5ZItuR6VZBbhKozcKDY4LZ";
return "https://arb-mainnet.g.alchemy.com/v2/fAf753tOLwc9yIbUYU0Eyn9zxBs9RZqz";
}
return "https://arb-mainnet.g.alchemy.com/v2/EmVYwUw0N2tXOuG0SZfe5Z04rzBsCbr2";
return "https://arb-mainnet.g.alchemy.com/v2/hxBqIr-vfpJ105JPYLei_ibbJLe66k46";
}

export function getAlchemyWsUrl() {
if (ALCHEMY_WHITELISTED_DOMAINS.includes(window.location.host)) {
return "wss://arb-mainnet.g.alchemy.com/v2/ha7CFsr1bx5ZItuR6VZBbhKozcKDY4LZ";
return "wss://arb-mainnet.g.alchemy.com/v2/fAf753tOLwc9yIbUYU0Eyn9zxBs9RZqz";
}
return "wss://arb-mainnet.g.alchemy.com/v2/EmVYwUw0N2tXOuG0SZfe5Z04rzBsCbr2";
return "wss://arb-mainnet.g.alchemy.com/v2/hxBqIr-vfpJ105JPYLei_ibbJLe66k46";
}

export function getExplorerUrl(chainId) {
Expand Down
23 changes: 3 additions & 20 deletions src/lib/rpc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ export function isWebsocketProvider(provider: any): provider is WebSocketProvide

const WS_PROVIDERS_CACHE: { [chainId: number]: WebSocketProvider | JsonRpcProvider | undefined } = {};
const WS_LAST_BLOCK_UPDATED_AT: { [chainId: number]: number } = {};
const WS_MAX_BLOCK_UPDATE_DELAY = 1000 * 5;
const WS_HEALTH_CHECK_INTERVAL = 1000;
const WS_KEEP_ALIVE_INTERVAL = 5 * 60_000;

export function useWsProvider(active: boolean, chainId: number) {
const [provider, setProvider] = useState<WebSocketProvider | JsonRpcProvider>();
Expand All @@ -119,10 +118,6 @@ export function useWsProvider(active: boolean, chainId: number) {
return;
}

newProvider.on("block", () => {
WS_LAST_BLOCK_UPDATED_AT[chainId] = Date.now();
});

if (isWebsocketProvider(newProvider)) {
newProvider._websocket.onclose = () => {
// eslint-disable-next-line no-console
Expand All @@ -136,21 +131,9 @@ export function useWsProvider(active: boolean, chainId: number) {

function healthCheck() {
setTimeout(() => {
const lastBlockUpdatedAt = WS_LAST_BLOCK_UPDATED_AT[chainId];

if (
!lastBlockUpdatedAt ||
Number.isNaN(lastBlockUpdatedAt) ||
Date.now() - lastBlockUpdatedAt > WS_MAX_BLOCK_UPDATE_DELAY
) {
// eslint-disable-next-line no-console
console.log(`ws provider health check failed for chain ${chainId}, reconnecting...`);
setNeedToReconnect(true);
return;
}

// setNeedToReconnect(true);
healthCheck();
}, WS_HEALTH_CHECK_INTERVAL);
}, WS_KEEP_ALIVE_INTERVAL);
}

healthCheck();
Expand Down
20 changes: 0 additions & 20 deletions src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1688,10 +1688,6 @@ msgstr "Gebühren"
msgid "Fees and Price Impact"
msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#~ msgid "Fees are high"
#~ msgstr ""

#: src/components/Exchange/ConfirmationBox.js
msgid "Fees are high to swap from {0} to {1}."
msgstr "Der Wechsel von {0} zu {1} ist mit hohen Gebühren verbunden."
Expand Down Expand Up @@ -3181,10 +3177,6 @@ msgstr "Bezahlen"
msgid "Pay Amount"
msgstr "Betrag bezahlen"

#: src/components/Glp/GlpSwap.js
#~ msgid "Pay:"
#~ msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#: src/components/Synthetics/PositionEditor/PositionEditor.tsx
msgid "Pending {0} approval"
Expand Down Expand Up @@ -3499,10 +3491,6 @@ msgstr ""
msgid "Receive"
msgstr "Empfangen"

#: src/components/Synthetics/TradeBox/TradeBox.tsx
#~ msgid "Receive:"
#~ msgstr ""

#: src/pages/BeginAccountTransfer/BeginAccountTransfer.js
#: src/pages/NftWallet/NftWallet.js
msgid "Receiver Address"
Expand Down Expand Up @@ -4254,10 +4242,6 @@ msgstr "Der erhöhte APR ergibt sich aus den von dir gestaketen Multiplikatorpun
msgid "The Gambit protocol is in beta, please read the <0>staking details</0>before participating."
msgstr "Das Gambit-Protokoll befindet sich in der Beta-Phase, bitte lese die <0>Details zum Staking</0>, bevor du teilnimmst."

#: src/App/App.js
#~ msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed."
#~ msgstr ""

#: src/App/App.js
msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed. Only applicable to GMX V2."
msgstr ""
Expand All @@ -4282,10 +4266,6 @@ msgstr "Die esGMX-Tokens können jederzeit gestaket oder gevested werden."
msgid "The mark price has changed, consider increasing your Allowed Slippage by clicking on the \"...\" icon next to your address."
msgstr "Der Mark-Preis hat sich geändert. Erhöhe dein zulässiges Slippage, indem du auf das Symbol \"...\" neben deiner Adresse klickst."

#: src/domain/synthetics/fees/utils/executionFee.ts
#~ msgid "The network cost to send transactions is high at the moment, please check the \"Execution Fee\" value before proceeding."
#~ msgstr ""

#: src/domain/synthetics/fees/utils/executionFee.ts
msgid "The network cost to send transactions is high at the moment, please check the \"Max Execution Fee\" value before proceeding."
msgstr ""
Expand Down
20 changes: 0 additions & 20 deletions src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1688,10 +1688,6 @@ msgstr "Fees"
msgid "Fees and Price Impact"
msgstr "Fees and Price Impact"

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#~ msgid "Fees are high"
#~ msgstr "Fees are high"

#: src/components/Exchange/ConfirmationBox.js
msgid "Fees are high to swap from {0} to {1}."
msgstr "Fees are high to swap from {0} to {1}."
Expand Down Expand Up @@ -3181,10 +3177,6 @@ msgstr "Pay"
msgid "Pay Amount"
msgstr "Pay Amount"

#: src/components/Glp/GlpSwap.js
#~ msgid "Pay:"
#~ msgstr "Pay:"

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#: src/components/Synthetics/PositionEditor/PositionEditor.tsx
msgid "Pending {0} approval"
Expand Down Expand Up @@ -3499,10 +3491,6 @@ msgstr "Rebates on V2"
msgid "Receive"
msgstr "Receive"

#: src/components/Synthetics/TradeBox/TradeBox.tsx
#~ msgid "Receive:"
#~ msgstr "Receive:"

#: src/pages/BeginAccountTransfer/BeginAccountTransfer.js
#: src/pages/NftWallet/NftWallet.js
msgid "Receiver Address"
Expand Down Expand Up @@ -4254,10 +4242,6 @@ msgstr "The Boosted APR is from your staked Multiplier Points."
msgid "The Gambit protocol is in beta, please read the <0>staking details</0>before participating."
msgstr "The Gambit protocol is in beta, please read the <0>staking details</0>before participating."

#: src/App/App.js
#~ msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed."
#~ msgstr "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed."

#: src/App/App.js
msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed. Only applicable to GMX V2."
msgstr "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed. Only applicable to GMX V2."
Expand All @@ -4282,10 +4266,6 @@ msgstr "The esGMX tokens can be staked or vested at any time."
msgid "The mark price has changed, consider increasing your Allowed Slippage by clicking on the \"...\" icon next to your address."
msgstr "The mark price has changed, consider increasing your Allowed Slippage by clicking on the \"...\" icon next to your address."

#: src/domain/synthetics/fees/utils/executionFee.ts
#~ msgid "The network cost to send transactions is high at the moment, please check the \"Execution Fee\" value before proceeding."
#~ msgstr "The network cost to send transactions is high at the moment, please check the \"Execution Fee\" value before proceeding."

#: src/domain/synthetics/fees/utils/executionFee.ts
msgid "The network cost to send transactions is high at the moment, please check the \"Max Execution Fee\" value before proceeding."
msgstr "The network cost to send transactions is high at the moment, please check the \"Max Execution Fee\" value before proceeding."
Expand Down
20 changes: 0 additions & 20 deletions src/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1688,10 +1688,6 @@ msgstr "Comisiones"
msgid "Fees and Price Impact"
msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#~ msgid "Fees are high"
#~ msgstr ""

#: src/components/Exchange/ConfirmationBox.js
msgid "Fees are high to swap from {0} to {1}."
msgstr "Las comisiones son altas para intercambiar de {0} a {1}."
Expand Down Expand Up @@ -3181,10 +3177,6 @@ msgstr "Pagar"
msgid "Pay Amount"
msgstr "Importe a pagar"

#: src/components/Glp/GlpSwap.js
#~ msgid "Pay:"
#~ msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#: src/components/Synthetics/PositionEditor/PositionEditor.tsx
msgid "Pending {0} approval"
Expand Down Expand Up @@ -3499,10 +3491,6 @@ msgstr ""
msgid "Receive"
msgstr "Recibir"

#: src/components/Synthetics/TradeBox/TradeBox.tsx
#~ msgid "Receive:"
#~ msgstr ""

#: src/pages/BeginAccountTransfer/BeginAccountTransfer.js
#: src/pages/NftWallet/NftWallet.js
msgid "Receiver Address"
Expand Down Expand Up @@ -4254,10 +4242,6 @@ msgstr "El APR aumentado es de sus Puntos Multiplicadores stakeados."
msgid "The Gambit protocol is in beta, please read the <0>staking details</0>before participating."
msgstr "El protocolo Gambit se encuentra en beta, por favor lea los <0>detalles de staking</0>antes de participar."

#: src/App/App.js
#~ msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed."
#~ msgstr ""

#: src/App/App.js
msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed. Only applicable to GMX V2."
msgstr ""
Expand All @@ -4282,10 +4266,6 @@ msgstr "Los tokens esGMX pueden ser stakeados o adquiridos en cualquier momento.
msgid "The mark price has changed, consider increasing your Allowed Slippage by clicking on the \"...\" icon next to your address."
msgstr "El precio de referencia ha cambiado, considera incrementar el deslizamiento permitido haciendo clic en el icono \"...\" al lado de tu dirección."

#: src/domain/synthetics/fees/utils/executionFee.ts
#~ msgid "The network cost to send transactions is high at the moment, please check the \"Execution Fee\" value before proceeding."
#~ msgstr ""

#: src/domain/synthetics/fees/utils/executionFee.ts
msgid "The network cost to send transactions is high at the moment, please check the \"Max Execution Fee\" value before proceeding."
msgstr ""
Expand Down
20 changes: 0 additions & 20 deletions src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1688,10 +1688,6 @@ msgstr "FRAIS"
msgid "Fees and Price Impact"
msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#~ msgid "Fees are high"
#~ msgstr ""

#: src/components/Exchange/ConfirmationBox.js
msgid "Fees are high to swap from {0} to {1}."
msgstr "Les frais sont élevés pour changer de {0} vers {1}."
Expand Down Expand Up @@ -3181,10 +3177,6 @@ msgstr "Payer"
msgid "Pay Amount"
msgstr "Somme à payer"

#: src/components/Glp/GlpSwap.js
#~ msgid "Pay:"
#~ msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#: src/components/Synthetics/PositionEditor/PositionEditor.tsx
msgid "Pending {0} approval"
Expand Down Expand Up @@ -3499,10 +3491,6 @@ msgstr ""
msgid "Receive"
msgstr "Recevoir"

#: src/components/Synthetics/TradeBox/TradeBox.tsx
#~ msgid "Receive:"
#~ msgstr ""

#: src/pages/BeginAccountTransfer/BeginAccountTransfer.js
#: src/pages/NftWallet/NftWallet.js
msgid "Receiver Address"
Expand Down Expand Up @@ -4254,10 +4242,6 @@ msgstr "Le Taux de Rendement Annuel boosté provient de vos points multiplicateu
msgid "The Gambit protocol is in beta, please read the <0>staking details</0>before participating."
msgstr ""

#: src/App/App.js
#~ msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed."
#~ msgstr ""

#: src/App/App.js
msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed. Only applicable to GMX V2."
msgstr ""
Expand All @@ -4282,10 +4266,6 @@ msgstr "Les tokens esGMX peuvent être échangés ou acquis à tout moment."
msgid "The mark price has changed, consider increasing your Allowed Slippage by clicking on the \"...\" icon next to your address."
msgstr "Le prix du marché a changé, envisagez d'augmenter votre marge autorisée en cliquant sur l'icône \"...\" à côté de votre adresse."

#: src/domain/synthetics/fees/utils/executionFee.ts
#~ msgid "The network cost to send transactions is high at the moment, please check the \"Execution Fee\" value before proceeding."
#~ msgstr ""

#: src/domain/synthetics/fees/utils/executionFee.ts
msgid "The network cost to send transactions is high at the moment, please check the \"Max Execution Fee\" value before proceeding."
msgstr ""
Expand Down
20 changes: 0 additions & 20 deletions src/locales/ja/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1688,10 +1688,6 @@ msgstr "手数料"
msgid "Fees and Price Impact"
msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#~ msgid "Fees are high"
#~ msgstr ""

#: src/components/Exchange/ConfirmationBox.js
msgid "Fees are high to swap from {0} to {1}."
msgstr "{0} を {1}にスワップするには手数料が高額です"
Expand Down Expand Up @@ -3181,10 +3177,6 @@ msgstr "支払い"
msgid "Pay Amount"
msgstr "支払い額"

#: src/components/Glp/GlpSwap.js
#~ msgid "Pay:"
#~ msgstr ""

#: src/components/Synthetics/ConfirmationBox/ConfirmationBox.tsx
#: src/components/Synthetics/PositionEditor/PositionEditor.tsx
msgid "Pending {0} approval"
Expand Down Expand Up @@ -3499,10 +3491,6 @@ msgstr ""
msgid "Receive"
msgstr "受け取る"

#: src/components/Synthetics/TradeBox/TradeBox.tsx
#~ msgid "Receive:"
#~ msgstr ""

#: src/pages/BeginAccountTransfer/BeginAccountTransfer.js
#: src/pages/NftWallet/NftWallet.js
msgid "Receiver Address"
Expand Down Expand Up @@ -4254,10 +4242,6 @@ msgstr "APRブーストはステーク済マルチプライヤーポイントに
msgid "The Gambit protocol is in beta, please read the <0>staking details</0>before participating."
msgstr "Gambitプロトコルはベータ版であり、参加する前に<0>ステーキングの詳細</0>を読んでください。"

#: src/App/App.js
#~ msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed."
#~ msgstr ""

#: src/App/App.js
msgid "The Max Execution Fee is set to a higher value to handle potential increases in gas price during order execution. Any excess execution fee will be refunded to your account when the order is executed. Only applicable to GMX V2."
msgstr ""
Expand All @@ -4282,10 +4266,6 @@ msgstr "esGMXトークンはいつでもステークまたはべスティング
msgid "The mark price has changed, consider increasing your Allowed Slippage by clicking on the \"...\" icon next to your address."
msgstr "マーク価格が変化したため、アドレスの横に表示されている\"...\"アイコンをクリックして最大許容スリッページを増やすことを検討してください。"

#: src/domain/synthetics/fees/utils/executionFee.ts
#~ msgid "The network cost to send transactions is high at the moment, please check the \"Execution Fee\" value before proceeding."
#~ msgstr ""

#: src/domain/synthetics/fees/utils/executionFee.ts
msgid "The network cost to send transactions is high at the moment, please check the \"Max Execution Fee\" value before proceeding."
msgstr ""
Expand Down
Loading

0 comments on commit 26626be

Please sign in to comment.