Skip to content

Commit

Permalink
Merge pull request #259 from DFXswiss/develop
Browse files Browse the repository at this point in the history
KYC redirect
  • Loading branch information
davidleomay authored Dec 11, 2023
2 parents 579d96f + ab7bcb2 commit c067fb5
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"files.exclude": {
"node_modules": true
},
"cSpell.words": ["alby", "libphonenumber", "lnurl", "soleproprietorship", "webln"],
"cSpell.words": ["alby", "libphonenumber", "lnurl", "monero", "soleproprietorship", "webln"],
"prettier.printWidth": 120,
"editor.formatOnSave": true
}
14 changes: 12 additions & 2 deletions app/env/Environment.dev.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
const bitcoinAddressFormat = "([13]|bc1)[a-zA-HJ-NP-Z0-9]{25,62}";
const lightningAddressFormat = "(LNURL|LNDHUB)[A-Z0-9]{25,250}|LNNID[A-Z0-9]{66}";
const moneroAddressFormat = "[48][0-9AB][1-9A-HJ-NP-Za-km-z]{93}";
const ethereumAddressFormat = "0x\\w{40}";
const defichainAddressFormat = "[78]\\w{33}|[td]\\w{33}|[td]\\w{41}";

const allAddressFormat = `${bitcoinAddressFormat}|${lightningAddressFormat}|${ethereumAddressFormat}|${defichainAddressFormat}`;
const allAddressFormat = `${bitcoinAddressFormat}|${lightningAddressFormat}|${moneroAddressFormat}|${ethereumAddressFormat}|${defichainAddressFormat}`;

const bitcoinSignatureFormat = ".{87}=";
const lightningSignatureFormat = "[a-z0-9]{104}";
const lightningCustodialSignatureFormat = "[a-z0-9]{140,146}";
const moneroSignatureFormat = "SigV\\d[0-9a-zA-Z]{88}";
const ethereumSignatureFormat = "(0x)?[a-f0-9]{130}";

const allSignatureFormat = `${bitcoinSignatureFormat}|${lightningSignatureFormat}|${lightningCustodialSignatureFormat}|${moneroSignatureFormat}|${ethereumSignatureFormat}`;

export const Environment = {
debug: true,
defaultLanguage: "DE",
addressFormat: new RegExp(`^(${allAddressFormat})$`),
signatureFormat: /^(.{87}=|[a-f0-9]{130}|[a-f0-9x]{132}|[a-z0-9]{104}|[a-z0-9]{140,146})$/,
signatureFormat: new RegExp(`^(${allSignatureFormat})$`),
api: {
baseUrl: "https://dev.api.dfx.swiss/v1",
refUrl: "https://dev.api.dfx.swiss/app?code=",
},
services: "https://dev.services.dfx.swiss",
};
14 changes: 12 additions & 2 deletions app/env/Environment.prd.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
const bitcoinAddressFormat = "([13]|bc1)[a-zA-HJ-NP-Z0-9]{25,62}";
const lightningAddressFormat = "(LNURL|LNDHUB)[A-Z0-9]{25,250}|LNNID[A-Z0-9]{66}";
const moneroAddressFormat = "[48][0-9AB][1-9A-HJ-NP-Za-km-z]{93}";
const ethereumAddressFormat = "0x\\w{40}";
const defichainAddressFormat = "8\\w{33}|d\\w{33}|d\\w{41}";

const allAddressFormat = `${bitcoinAddressFormat}|${lightningAddressFormat}|${ethereumAddressFormat}|${defichainAddressFormat}`;
const allAddressFormat = `${bitcoinAddressFormat}|${lightningAddressFormat}|${moneroAddressFormat}|${ethereumAddressFormat}|${defichainAddressFormat}`;

const bitcoinSignatureFormat = ".{87}=";
const lightningSignatureFormat = "[a-z0-9]{104}";
const lightningCustodialSignatureFormat = "[a-z0-9]{140,146}";
const moneroSignatureFormat = "SigV\\d[0-9a-zA-Z]{88}";
const ethereumSignatureFormat = "(0x)?[a-f0-9]{130}";

const allSignatureFormat = `${bitcoinSignatureFormat}|${lightningSignatureFormat}|${lightningCustodialSignatureFormat}|${moneroSignatureFormat}|${ethereumSignatureFormat}`;

export const Environment = {
defaultLanguage: "DE",
addressFormat: new RegExp(`^(${allAddressFormat})$`),
signatureFormat: /^(.{87}=|[a-f0-9]{130}|[a-f0-9x]{132}|[a-z0-9]{104}|[a-z0-9]{140,146})$/,
signatureFormat: new RegExp(`^(${allSignatureFormat})$`),
api: {
baseUrl: "https://api.dfx.swiss/v1",
refUrl: "https://dfx.swiss/app?code=",
},
services: "https://services.dfx.swiss",
};
14 changes: 12 additions & 2 deletions app/env/Environment.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
const bitcoinAddressFormat = "([13]|bc1)[a-zA-HJ-NP-Z0-9]{25,62}";
const lightningAddressFormat = "(LNURL|LNDHUB)[A-Z0-9]{25,250}|LNNID[A-Z0-9]{66}";
const moneroAddressFormat = "[48][0-9AB][1-9A-HJ-NP-Za-km-z]{93}";
const ethereumAddressFormat = "0x\\w{40}";
const defichainAddressFormat = "[78]\\w{33}|[td]\\w{33}|[td]\\w{41}";

const allAddressFormat = `${bitcoinAddressFormat}|${lightningAddressFormat}|${ethereumAddressFormat}|${defichainAddressFormat}`;
const allAddressFormat = `${bitcoinAddressFormat}|${lightningAddressFormat}|${moneroAddressFormat}|${ethereumAddressFormat}|${defichainAddressFormat}`;

const bitcoinSignatureFormat = ".{87}=";
const lightningSignatureFormat = "[a-z0-9]{104}";
const lightningCustodialSignatureFormat = "[a-z0-9]{140,146}";
const moneroSignatureFormat = "SigV\\d[0-9a-zA-Z]{88}";
const ethereumSignatureFormat = "(0x)?[a-f0-9]{130}";

const allSignatureFormat = `${bitcoinSignatureFormat}|${lightningSignatureFormat}|${lightningCustodialSignatureFormat}|${moneroSignatureFormat}|${ethereumSignatureFormat}`;

export const Environment = {
debug: true,
defaultLanguage: "DE",
addressFormat: new RegExp(`^(${allAddressFormat})$`),
signatureFormat: /^(.{87}=|[a-f0-9]{130}|[a-f0-9x]{132}|[a-z0-9]{104}|[a-z0-9]{140,146})$/,
signatureFormat: new RegExp(`^(${allSignatureFormat})$`),
api: {
baseUrl: "http://localhost:3000/v1",
refUrl: "http://localhost:3000/app?code=",
},
services: "http://localhost:3001",
};
3 changes: 3 additions & 0 deletions app/screens/KycScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { KycData } from "../models/KycData";
import KycDataEdit from "../components/edit/KycDataEdit";
import { ApiError } from "../models/ApiDto";
import Sizes from "../config/Sizes";
import { Environment } from "../env/Environment";

const KycScreen = ({ settings }: { settings?: AppSettings }) => {
const { t } = useTranslation();
Expand Down Expand Up @@ -68,6 +69,8 @@ const KycScreen = ({ settings }: { settings?: AppSettings }) => {
SettingsService.updateSettings({ headless: params?.headless });
if (!params?.code) return onLoadFailed();

openUrl(`${Environment.services}/kyc?code=${params.code}`, false);

setInputParams(params);
nav.navigate(Routes.Kyc, {
code: undefined,
Expand Down

0 comments on commit c067fb5

Please sign in to comment.