aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/features/ark.js18
-rw-r--r--src/i18n.js1
2 files changed, 19 insertions, 0 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index 79895be..2b81a1e 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -3495,6 +3495,24 @@ export function arkFeature(ctx) {
if (foreignArkAddr(inv)) { ui.sendError = t('arkForeignServer'); render(); return true; }
boardOwnAddress(inv, { connect: true }).catch(() => {});
}
+ // A BIP-21 URI with an ark= instruction (Noah, Second's wallets, our
+ // own names): same server → pay over Ark, instant and free, with the
+ // URI's amount; another server → the on-chain address, and say why.
+ if (/^bitcoin:/i.test(inv) && arkAvailable() && !wallet.watchOnly) {
+ const dec = parseBip21Uri(inv);
+ const arkAddr = dec && dec.params && dec.params.ark;
+ if (arkAddr && isArkAddress(arkAddr)) {
+ if (foreignArkAddr(arkAddr)) { toast(t('arkForeignBip21'), 4000); return false; }
+ boardOwnAddress(arkAddr, { connect: true }).catch(() => {});
+ const s = ui.send;
+ s.recipients[0].address = arkAddr;
+ const btc = Number(dec.params.amount);
+ if (btc > 0) { s.recipients[0].amount = amountFill(Math.round(btc * 1e8)); s.max = false; }
+ ui.sendError = '';
+ render();
+ return true;
+ }
+ }
// In a Spending wallet an on-chain address means "exit ark to there":
// the offboard happens right in the send flow, no Move money ceremony.
if (ctx.getAccount() === 'spending' && wallet.isOnchainAddress(inv) && arkAvailable()) {
diff --git a/src/i18n.js b/src/i18n.js
index ff67fc1..74219ac 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -860,6 +860,7 @@ const STR = {
arkCmpMin: 'min {n} sats',
arkCmpNote: 'Fees graded by expiry cost more the earlier a coin is renewed or exited. Figures come from each server’s own published info, read just now. Either server pays Lightning invoices and takes Lightning payments to your coinos name.',
arkServerSwitched: 'Ark server switched',
+ arkForeignBip21: 'Their Ark address is on a different Ark server — paying the on-chain address instead.',
arkForeignServer: 'That Ark address belongs to a different Ark server, so it can’t be paid from here directly. Ask for a Lightning invoice, or pay their coinos name or npub — those fall back to Lightning by themselves.',
arkLnFromSavingsTitle: 'Lightning pays from Spending',
arkLnFromSavingsBody: 'Lightning payments leave your Spending balance, not Savings. Spending holds {have}.',