Skip to content

Commit

Permalink
Merge branch 'main' into feature/addin_unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjavabraz authored Jan 22, 2025
2 parents 3cfc26b + ce01532 commit cd30c4c
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 31 deletions.
1 change: 1 addition & 0 deletions .env.local.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ NODE_ENV=test
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
VUE_APP_FLYOVER_PROVIDER_ID=2
VUE_APP_CSP=https://staging.lps.tekscapital.com
1 change: 1 addition & 0 deletions .github/workflows/deploy_MainNet_UI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
VUE_APP_FLYOVER_PROVIDER_ID=2
VUE_APP_CSP=https://lps.tekscapital.com
npm run-script build
- name: Configure AWS credentials
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_TestNet_UI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
VUE_APP_FLYOVER_PROVIDER_ID=2
VUE_APP_CSP=https://staging.lps.tekscapital.com
npm run-script build
- name: Configure AWS credentials
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_staging_MainNet_UI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=2
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
VUE_APP_FLYOVER_PROVIDER_ID=2
VUE_APP_CSP=https://lps.tekscapital.com
npm run-script build
- name: Configure AWS credentials
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_staging_TestNet_UI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
VUE_APP_FLYOVER_PEGOUT_QUOTE_DIFF_PERCENTAGE=20
VUE_APP_RECAPTCHA_NEW_TOKEN_TIME=30
VUE_APP_FLYOVER_PROVIDER_ID=2
VUE_APP_CSP=https://staging.lps.tekscapital.com
npm run-script build
- name: Configure AWS credentials
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
script-src 'self' 'nonce-${vuetifyNonce}' 'unsafe-eval';
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/;
img-src data: https:;
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/* ;
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} ${envVariables.cspConfiguration} https://api.coingecko.com/ https://*.clarity.ms https://www.clarity.ms/* ;
object-src 'none';
frame-src https://connect.trezor.io https://www.google.com/;
worker-src 'none';
Expand Down
8 changes: 7 additions & 1 deletion src/common/services/XverseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ export default class XverseService extends WalletService {
}
}

getAccountAddresses(): Promise<WalletAddress[]> {
async getAccountAddresses(): Promise<WalletAddress[]> {
// @ts-expect-error method type not provided
const permissions = await Wallet.request('wallet_getCurrentPermissions', undefined);
if (permissions.status !== 'success') {
// @ts-expect-error method type not provided
await Wallet.request('wallet_requestPermissions', undefined);
}
return new Promise<WalletAddress[]>((resolve, reject) => {
const walletAddresses: WalletAddress[] = [];
const payload = {
Expand Down
27 changes: 15 additions & 12 deletions src/common/types/environment-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ export class EnvironmentVariables {

public debugMode: boolean;

public minFeeSatPerByte: {
fast: number;
average: number;
slow: number;
};

public miningSpeedBlock: {
fast: number;
average: number;
slow: number;
};

public burnDustValue: number;

public lbcAddress: string;
Expand All @@ -54,6 +42,20 @@ export class EnvironmentVariables {

public flyoverProviderId: number;

public cspConfiguration: string;

public minFeeSatPerByte: {
fast: number;
average: number;
slow: number;
};

public miningSpeedBlock: {
fast: number;
average: number;
slow: number;
};

// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor(defaultValues: any = {}) {
this.vueAppCoin = process.env.VUE_APP_COIN || defaultValues.vueAppCoin;
Expand Down Expand Up @@ -104,6 +106,7 @@ export class EnvironmentVariables {
|| defaultValues.grecaptchaTime;
this.flyoverProviderId = Number(process.env.VUE_APP_FLYOVER_PROVIDER_ID)
|| defaultValues.flyoverProviderId;
this.cspConfiguration = process.env.VUE_APP_CSP || defaultValues.cspConfiguration;
}

public get chainId(): number {
Expand Down
12 changes: 5 additions & 7 deletions src/common/utils/rlogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,11 @@ export function getRloginInstance(features: Array<Feature>): RLogin {
rpcUrls,
supportedChains,
};
const ledgerFeature = features.find((feature) => feature.name === FeatureNames.WALLET_LEDGER);
if (ledgerFeature?.value === constants.ENABLED
&& ledgerFeature.supportedBrowsers[currentBrowser.toLowerCase() as keyof SupportedBrowsers]) {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
rLoginOptions.providerOptions['custom-ledger'] = customLedgerProviderOptions;
}
// const ledgerFeature = features.find((feature) => feature.name === FeatureNames.WALLET_LEDGER);
// if (ledgerFeature?.value === constants.ENABLED
// && ledgerFeature.supportedBrowsers[currentBrowser.toLowerCase() as keyof SupportedBrowsers]) {
// rLoginOptions.providerOptions['custom-ledger'] = customLedgerProviderOptions;
// }
const trezorFeature = features.find((feature) => feature.name === FeatureNames.WALLET_TREZOR);
if (trezorFeature?.value === constants.ENABLED
&& trezorFeature.supportedBrowsers[currentBrowser.toLowerCase() as keyof SupportedBrowsers]) {
Expand Down
1 change: 1 addition & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const defaultEnvironmentVariables = {
flyoverPegoutDiffPercentage: 2,
flyoverProviderId: 2,
grecaptchaTime: constants.RECAPTCHA_NEW_TOKEN_TIME,
cspConfiguration: 'https://testnet.lps.tekscapital.com https://staging.lps.tekscapital.com',
};

EnvironmentAccessorService.initializeEnvironmentVariables(defaultEnvironmentVariables);
Expand Down

0 comments on commit cd30c4c

Please sign in to comment.