Skip to content

Commit

Permalink
uri encoded link
Browse files Browse the repository at this point in the history
  • Loading branch information
galekseev committed Jan 16, 2025
1 parent 350b2de commit 99ba98d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/gen_qr_lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@ class DropSettings {
pathTestQr = './src/test_qr';
pathZip = './src/gendata';

constructor (flagSaveQr, flagSaveLink, codeCounts, codeAmounts, version, chainId, flagNoVersionUpdate = false) {
constructor (
flagSaveQr, // Saves QR codes with encoded links to files

Check failure on line 19 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before '// Saves QR co...'
flagSaveLink, // Saves generated links to json file

Check failure on line 20 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before '// Saves gener...'
codeCounts, // Number of codes to generate for each amount

Check failure on line 21 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before '// Number of c...'

Check failure on line 21 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed
codeAmounts, // Amounts to generate codes

Check failure on line 22 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before '// Amounts to ...'
version, // Version of the drop (can be included in the link)

Check failure on line 23 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before '// Version of ...'
chainId, // The chain to use the QR code on (can be included in the link)

Check failure on line 24 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before '// The chain t...'
flagNoVersionUpdate = false, // If true, the version file will not be updated (used for testing)
) {
this.flagSaveQr = flagSaveQr;
this.flagSaveLink = flagSaveLink;
this.flagNoDeploy = flagNoVersionUpdate;
Expand All @@ -25,6 +33,7 @@ class DropSettings {
this.chainId = chainId;
this.fileLinks = `./src/gendata/${version}-qr-links.json`;
this.prefix = `https://app.1inch.io/#/${chainId}/qr?`;
this.enc_prefix = "https://wallet.1inch.io/app/w3browser?link=";

Check failure on line 36 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Identifier 'enc_prefix' is not in camel case

Check failure on line 36 in src/gen_qr_lib.js

View workflow job for this annotation

GitHub Actions / lint

Strings must use singlequote
}
}

Expand Down Expand Up @@ -158,6 +167,7 @@ async function main (settings) {
for (let i = 0; i < amounts.length; i++) {
info.push({
url: urls[i],
encUrl: settings.enc_prefix ? (settings.enc_prefix + encodeURIComponent(urls[i])) : undefined,
amount: amounts[i].toString(),
index: indices[i],
});
Expand Down

0 comments on commit 99ba98d

Please sign in to comment.