Skip to content

Commit a524913

Browse files
annipialexjavabraz
authored andcommitted
fix: hardcoded provider id pass on env variable
1 parent 7e8bae9 commit a524913

File tree

10 files changed

+16
-4
lines changed

10 files changed

+16
-4
lines changed

.env.local.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ VUE_APP_DEBUG_MODE='true'
2929
NODE_ENV=test
3030
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
3131
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
32-
32+
VUE_APP_FLYOVER_PROVIDER_ID=2

.github/workflows/deploy_MainNet_UI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
VUE_APP_LBC_ADDRESS='0xAA9cAf1e3967600578727F975F283446A3Da6612'
5656
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
5757
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
58+
VUE_APP_FLYOVER_PROVIDER_ID=2
5859
npm run-script build
5960
6061
- name: Configure AWS credentials

.github/workflows/deploy_TestNet_UI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300'
5656
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
5757
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
58+
VUE_APP_FLYOVER_PROVIDER_ID=2
5859
npm run-script build
5960
6061
- name: Configure AWS credentials

.github/workflows/deploy_staging_MainNet_UI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
VUE_APP_LBC_ADDRESS='0xAA9cAf1e3967600578727F975F283446A3Da6612'
5656
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
5757
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
58+
VUE_APP_FLYOVER_PROVIDER_ID=2
5859
npm run-script build
5960
6061
- name: Configure AWS credentials

.github/workflows/deploy_staging_TestNet_UI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
VUE_APP_LBC_ADDRESS='0xc2A630c053D12D63d32b025082f6Ba268db18300'
5656
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=20
5757
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
58+
VUE_APP_FLYOVER_PROVIDER_ID=2
5859
npm run-script build
5960
6061
- name: Configure AWS credentials

ENV_VARIABLES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The value of these variables are used in **environment-variables.ts** file.
2323
|VUE_APP_DEBUG_MODE | `false` | enable developer messages for debuging |
2424
|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 |
2525
|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 |
26+
|VUE_APP_FLYOVER_PROVIDER_ID | `1` | Sets up the provider id to be use for flyover status search. |
2627

2728
## Example for .env.local.test file
2829

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
script-src 'self' 'nonce-${vuetifyNonce}' 'unsafe-eval';
4949
script-src-elem 'self' 'unsafe-inline' https://script.hotjar.com https://www.clarity.ms/s/* https://static.hotjar.com https://*.hotjar.com https://*.hotjar.io https://api.coingecko.com/ https://*.clarity.ms https://www.clarity.ms/ https://www.gstatic.com/ https://www.google.com/recaptcha/;
5050
img-src data: https:;
51-
connect-src 'self' 'unsafe-inline' https://www.clarity.ms/s/0.7.16/clarity.js wss://* https://*.hotjar.com https://*.hotjar.io https://www.clarity.ms/s/* wss://*.hotjar.com ${envVariables.vueAppApiBaseUrl} ${envVariables.vueAppRskNodeHost} https://lps.flyover.rif.technology https://lps.tekscapital.com https://staging.lps.tekscapital.com https://api.coingecko.com https://*.clarity.ms https://www.clarity.ms/* ;
51+
connect-src 'self' 'unsafe-inline' https://www.clarity.ms/s/0.7.16/clarity.js wss://* https://*.hotjar.com https://*.hotjar.io https://www.clarity.ms/s/* wss://*.hotjar.com ${envVariables.vueAppApiBaseUrl} ${envVariables.vueAppRskNodeHost} https://lps.tekscapital.com https://testnet.lps.tekscapital.com https://staging.lps.tekscapital.com https://api.coingecko.com/* https://*.clarity.ms https://www.clarity.ms/* ;
5252
object-src 'none';
5353
frame-src https://connect.trezor.io https://www.google.com/;
5454
worker-src 'none';

src/common/types/environment-variables.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export class EnvironmentVariables {
5252

5353
public grecaptchaTime: number;
5454

55+
public flyoverProviderId: number;
56+
5557
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5658
constructor(defaultValues: any = {}) {
5759
this.vueAppCoin = process.env.VUE_APP_COIN || defaultValues.vueAppCoin;
@@ -100,6 +102,8 @@ export class EnvironmentVariables {
100102
.VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE) || defaultValues.flyoverPegoutDiffPercentage;
101103
this.grecaptchaTime = Number(process.env.VUE_APP_RECAPTCHA_NEW_TOKEN_TIME)
102104
|| defaultValues.grecaptchaTime;
105+
this.flyoverProviderId = Number(process.env.VUE_APP_FLYOVER_PROVIDER_ID)
106+
|| defaultValues.flyoverProviderId;
103107
}
104108

105109
public get chainId(): number {

src/main.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const defaultEnvironmentVariables = {
3232
burnDustValue: 2000,
3333
flyoverGetProvidersTimeout: 5000,
3434
flyoverPegoutDiffPercentage: 2,
35+
flyoverProviderId: 2,
3536
grecaptchaTime: constants.RECAPTCHA_NEW_TOKEN_TIME,
3637
};
3738

src/status/store/actions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ export const actions: ActionTree<TxStatus, RootState> = {
8585
if (state.type === TxStatusType.FLYOVER_PEGIN) {
8686
const flyoverService = rootState.flyoverPegin?.flyoverService;
8787
await dispatch(`flyoverPegin/${constants.FLYOVER_PEGIN_INIT}`, null, { root: true });
88-
flyoverService?.useLiquidityProvider(2);
88+
flyoverService?.useLiquidityProvider(EnvironmentAccessorService.getEnvironmentVariables()
89+
.flyoverProviderId);
8990
status = await flyoverService?.getPeginStatus(quoteHash);
9091
}
9192
if (state.type === TxStatusType.FLYOVER_PEGOUT) {
9293
const flyoverService = rootState.flyoverPegout?.flyoverService;
9394
await dispatch(`flyoverPegout/${constants.FLYOVER_PEGOUT_INIT}`, {}, { root: true });
94-
flyoverService?.useLiquidityProvider(2);
95+
flyoverService?.useLiquidityProvider(EnvironmentAccessorService.getEnvironmentVariables()
96+
.flyoverProviderId);
9597
status = await rootState.flyoverPegout?.flyoverService.getPegoutStatus(quoteHash);
9698
}
9799
} catch (e) {

0 commit comments

Comments
 (0)