Skip to content

Commit

Permalink
[DEV-1974] Added Monero
Browse files Browse the repository at this point in the history
  • Loading branch information
davidleomay committed Nov 20, 2023
1 parent aef8544 commit b7ab7d3
Show file tree
Hide file tree
Showing 4 changed files with 34 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
}
13 changes: 11 additions & 2 deletions app/env/Environment.dev.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
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=",
Expand Down
13 changes: 11 additions & 2 deletions app/env/Environment.prd.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
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=",
Expand Down
13 changes: 11 additions & 2 deletions app/env/Environment.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
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=",
Expand Down

0 comments on commit b7ab7d3

Please sign in to comment.