@nullpay/cli 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/onboard.js +1 -17
- package/package.json +1 -1
package/dist/commands/onboard.js
CHANGED
|
@@ -43,7 +43,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
43
43
|
const fs = __importStar(require("fs"));
|
|
44
44
|
const path = __importStar(require("path"));
|
|
45
45
|
const crypto = __importStar(require("crypto"));
|
|
46
|
-
const BACKEND_URL = '
|
|
46
|
+
const BACKEND_URL = process.env.NULLPAY_BACKEND_URL || 'https://nullpay-backend-ib5q4.ondigitalocean.app/api';
|
|
47
47
|
const ALEO_PROGRAM = 'zk_pay_proofs_privacy_v22.aleo';
|
|
48
48
|
const ALEO_MAP_BASE = `https://api.provable.com/v2/testnet/program/${ALEO_PROGRAM}/mapping/salt_to_invoice`;
|
|
49
49
|
const W = 56;
|
|
@@ -172,19 +172,6 @@ async function pollForHash(salt, maxRetries = 60) {
|
|
|
172
172
|
}
|
|
173
173
|
return null;
|
|
174
174
|
}
|
|
175
|
-
function updateGitignore(projectRoot) {
|
|
176
|
-
const filePath = path.join(projectRoot, '.gitignore');
|
|
177
|
-
const entry = 'nullpay.json';
|
|
178
|
-
const note = '# NullPay - contains sensitive salt values';
|
|
179
|
-
if (fs.existsSync(filePath)) {
|
|
180
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
181
|
-
if (!content.includes(entry)) {
|
|
182
|
-
fs.appendFileSync(filePath, `\n${note}\n${entry}\n`);
|
|
183
|
-
}
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
fs.writeFileSync(filePath, `${note}\n${entry}\n`);
|
|
187
|
-
}
|
|
188
175
|
function renderInvoiceCard(inv, index) {
|
|
189
176
|
const typeLabel = inv.type === 'multipay'
|
|
190
177
|
? tag('MULTI-PAY', C.brand)
|
|
@@ -499,7 +486,6 @@ async function onboard() {
|
|
|
499
486
|
invoices: generatedInvoices,
|
|
500
487
|
};
|
|
501
488
|
fs.writeFileSync(outputPath, JSON.stringify(output, null, 2));
|
|
502
|
-
updateGitignore(projectRoot);
|
|
503
489
|
blank();
|
|
504
490
|
blank();
|
|
505
491
|
line(rule('='));
|
|
@@ -516,8 +502,6 @@ async function onboard() {
|
|
|
516
502
|
kv('Merchant', resolvedAddress, C.brandDim);
|
|
517
503
|
kv('Deployed', `${generatedInvoices.length} / ${allInvoices.length} invoices`, C.success.bold);
|
|
518
504
|
blank();
|
|
519
|
-
line(` ${C.gold('!')} ${C.slate('nullpay.json added to .gitignore - keep salts private')}`);
|
|
520
|
-
blank();
|
|
521
505
|
line(rule('-'));
|
|
522
506
|
blank();
|
|
523
507
|
line(` ${C.white.bold('Usage')}`);
|