diff --git a/.env.local.test b/.env.local.test index 7af79fd0..eeb81b5a 100644 --- a/.env.local.test +++ b/.env.local.test @@ -29,4 +29,4 @@ VUE_APP_DEBUG_MODE='true' NODE_ENV=test VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 - +VUE_APP_FLYOVER_PROVIDER_ID=2 diff --git a/.github/workflows/deploy_MainNet_UI.yml b/.github/workflows/deploy_MainNet_UI.yml index 7c8eba34..fc62cd98 100644 --- a/.github/workflows/deploy_MainNet_UI.yml +++ b/.github/workflows/deploy_MainNet_UI.yml @@ -55,6 +55,7 @@ jobs: VUE_APP_LBC_ADDRESS='0xAA9cAf1e3967600578727F975F283446A3Da6612' VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/.github/workflows/deploy_TestNet_UI.yml b/.github/workflows/deploy_TestNet_UI.yml index 8895cc84..95804c7e 100644 --- a/.github/workflows/deploy_TestNet_UI.yml +++ b/.github/workflows/deploy_TestNet_UI.yml @@ -55,6 +55,7 @@ jobs: VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300' VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/.github/workflows/deploy_staging_MainNet_UI.yml b/.github/workflows/deploy_staging_MainNet_UI.yml index acfe86ef..d3327aca 100644 --- a/.github/workflows/deploy_staging_MainNet_UI.yml +++ b/.github/workflows/deploy_staging_MainNet_UI.yml @@ -55,6 +55,7 @@ jobs: VUE_APP_LBC_ADDRESS='0xAA9cAf1e3967600578727F975F283446A3Da6612' VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2 VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/.github/workflows/deploy_staging_TestNet_UI.yml b/.github/workflows/deploy_staging_TestNet_UI.yml index c33a3b88..b92a88be 100644 --- a/.github/workflows/deploy_staging_TestNet_UI.yml +++ b/.github/workflows/deploy_staging_TestNet_UI.yml @@ -55,6 +55,7 @@ jobs: VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300' VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=20 VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30 + VUE_APP_FLYOVER_PROVIDER_ID=2 npm run-script build - name: Configure AWS credentials diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md index 8db7cf70..3f6bf520 100644 --- a/ENV_VARIABLES.md +++ b/ENV_VARIABLES.md @@ -23,6 +23,7 @@ The value of these variables are used in **environment-variables.ts** file. |VUE_APP_DEBUG_MODE | `false` | enable developer messages for debuging | |VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE | `2` | Defines quote difference percentage to 2% so it requieres the user to review condition only for a difference bigger that this percentage | |VUE_APP_RECAPTCHA_NEW_TOKEN_TIME | `30` | Specifies the time (in seconds) to temporarily disable the flyover between new transactions. This accounts for the time required by Google reCAPTCHA to regenerate a challenge token | +|VUE_APP_FLYOVER_PROVIDER_ID | `1` | Sets up the provider id to be use for flyover status search. | ## Example for .env.local.test file diff --git a/src/common/types/environment-variables.ts b/src/common/types/environment-variables.ts index 3b90cf31..0c191606 100644 --- a/src/common/types/environment-variables.ts +++ b/src/common/types/environment-variables.ts @@ -52,6 +52,8 @@ export class EnvironmentVariables { public grecaptchaTime: number; + public flyoverProviderId: number; + // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(defaultValues: any = {}) { this.vueAppCoin = process.env.VUE_APP_COIN || defaultValues.vueAppCoin; @@ -100,6 +102,8 @@ export class EnvironmentVariables { .VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE) || defaultValues.flyoverPegoutDiffPercentage; this.grecaptchaTime = Number(process.env.VUE_APP_RECAPTCHA_NEW_TOKEN_TIME) || defaultValues.grecaptchaTime; + this.flyoverProviderId = Number(process.env.VUE_APP_FLYOVER_PROVIDER_ID) + || defaultValues.flyoverProviderId; } public get chainId(): number { diff --git a/src/main.ts b/src/main.ts index b945dbf1..49d212ef 100644 --- a/src/main.ts +++ b/src/main.ts @@ -32,6 +32,7 @@ const defaultEnvironmentVariables = { burnDustValue: 2000, flyoverGetProvidersTimeout: 5000, flyoverPegoutDiffPercentage: 2, + flyoverProviderId: 2, grecaptchaTime: constants.RECAPTCHA_NEW_TOKEN_TIME, }; diff --git a/src/status/store/actions.ts b/src/status/store/actions.ts index 90936b33..13957c47 100644 --- a/src/status/store/actions.ts +++ b/src/status/store/actions.ts @@ -85,13 +85,15 @@ export const actions: ActionTree = { if (state.type === TxStatusType.FLYOVER_PEGIN) { const flyoverService = rootState.flyoverPegin?.flyoverService; await dispatch(`flyoverPegin/${constants.FLYOVER_PEGIN_INIT}`, null, { root: true }); - flyoverService?.useLiquidityProvider(2); + flyoverService?.useLiquidityProvider(EnvironmentAccessorService.getEnvironmentVariables() + .flyoverProviderId); status = await flyoverService?.getPeginStatus(quoteHash); } if (state.type === TxStatusType.FLYOVER_PEGOUT) { const flyoverService = rootState.flyoverPegout?.flyoverService; await dispatch(`flyoverPegout/${constants.FLYOVER_PEGOUT_INIT}`, {}, { root: true }); - flyoverService?.useLiquidityProvider(2); + flyoverService?.useLiquidityProvider(EnvironmentAccessorService.getEnvironmentVariables() + .flyoverProviderId); status = await rootState.flyoverPegout?.flyoverService.getPegoutStatus(quoteHash); } } catch (e) {