Skip to content

Commit

Permalink
wip(feat): add oob notes reissuance
Browse files Browse the repository at this point in the history
  • Loading branch information
oleonardolima committed Feb 19, 2024
1 parent 713abec commit 10d1b76
Show file tree
Hide file tree
Showing 10 changed files with 932 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"@kobalte/core": "^0.9.8",
"@kobalte/tailwindcss": "^0.5.0",
"@modular-forms/solid": "^0.18.1",
"@mutinywallet/mutiny-wasm": "0.5.9",
"@mutinywallet/waila-wasm": "^0.2.6",
"@mutinywallet/mutiny-wasm": "file:../mutiny-node/mutiny-wasm/pkg",
"@mutinywallet/waila-wasm": "file:../bitcoin-waila/waila-wasm/pkg",
"@solid-primitives/upload": "^0.0.111",
"@solidjs/meta": "^0.29.1",
"@solidjs/router": "^0.9.0",
Expand Down
27 changes: 15 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/components/AmountEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const AmountEditable: ParentComponent<{
activeMethod?: MethodChoice;
methods?: MethodChoice[];
setChosenMethod?: (method: MethodChoice) => void;
isFederation?: boolean;
}> = (props) => {
const [state, _actions] = useMegaStore();
const [mode, setMode] = createSignal<"fiat" | "sats">("sats");
Expand Down
64 changes: 64 additions & 0 deletions src/i18n/en/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default {
fee: "Fee",
send: "Send",
receive: "Receive",
reissue: "Reissue",
dangit: "Dangit",
back: "Back",
coming_soon: "(coming soon)",
Expand Down Expand Up @@ -115,6 +116,69 @@ export default {
remember_choice: "Remember my choice next time",
what_for: "What's this for?"
},
reissue: {
reissue_bitcoin: "Receive Bitcoin",
reissue_ecash: "Reissue Ecash",
edit: "Edit",
checking: "Checking",
choose_format: "Choose format",
payment_received: "Payment Received",
payment_initiated: "Payment Initiated",
receive_add_the_sender: "Add the sender for your records",
keep_mutiny_open: "Keep Mutiny open to complete the payment.",
choose_payment_format: "Choose payment format",
unified_label: "Unified",
unified_caption:
"Combines a bitcoin address and a lightning invoice. Sender chooses payment method.",
lightning_label: "Lightning invoice",
lightning_caption:
"Ideal for small transactions. Usually lower fees than on-chain.",
onchain_label: "Bitcoin address",
onchain_caption:
"On-chain, just like Satoshi did it. Ideal for very large transactions.",
unified_setup_fee:
"A lightning setup fee of {{amount}} SATS will be charged if paid over lightning.",
lightning_setup_fee:
"A lightning setup fee of {{amount}} SATS will be charged for this reissue.",
amount: "Amount",
fee: "+ Fee",
total: "Total",
spendable: "Spendable",
channel_size: "Channel size",
channel_reserve: "- Channel reserve",
error_under_min_lightning:
"Defaulting to On-chain. Amount is too small for your initial Lightning reissue.",
error_creating_unified:
"Defaulting to On-chain. Something went wrong when creating the unified address",
error_creating_address:
"Something went wrong when creating the on-chain address",
amount_editable: {
receive_too_small:
"A lightning setup fee might be deducted from the requested amount.",
setup_fee_lightning:
"A lightning setup fee will be charged if paid over lightning.",
too_big_for_beta:
"That's a lot of sats. You do know Mutiny Wallet is still in beta, yeah?",
more_than_21m: "There are only 21 million bitcoin.",
set_amount: "Set amount",
max: "MAX",
fix_amounts: {
ten_k: "10k",
one_hundred_k: "100k",
one_million: "1m"
},
del: "DEL",
balance: "Balance"
},
integrated_qr: {
onchain: "On-chain",
lightning: "Lightning",
unified: "Unified",
gift: "Lightning Gift"
},
remember_choice: "Remember my choice next time",
what_for: "What's this for?"
},
send: {
search: {
placeholder: "Name, address, invoice",
Expand Down
8 changes: 5 additions & 3 deletions src/logic/waila.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type ParsedParams = {
lightning_address?: string;
nostr_wallet_auth?: string;
fedimint_invite?: string;
fedimint_oob_notes?: string;
is_lnurl_auth?: boolean;
contact_id?: string;
};
Expand All @@ -40,8 +41,8 @@ export function toParsedParams(
const network = !params.network
? ourNetwork
: params.network === "testnet" && ourNetwork === "signet"
? "signet"
: params.network;
? "signet"
: params.network;

if (network !== ourNetwork) {
return {
Expand All @@ -67,7 +68,8 @@ export function toParsedParams(
lightning_address: params.lightning_address,
nostr_wallet_auth: params.nostr_wallet_auth,
is_lnurl_auth: params.is_lnurl_auth,
fedimint_invite: params.fedimint_invite_code
fedimint_invite: params.fedimint_invite_code,
fedimint_oob_notes: params.fedimint_oob_notes
}
};
}
2 changes: 2 additions & 0 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
Main,
NotFound,
Receive,
Reissue,
Scanner,
Search,
Send,
Expand Down Expand Up @@ -100,6 +101,7 @@ export function Router() {
<Route path="/feedback" component={Feedback} />
<Route path="/gift" component={GiftReceive} />
<Route path="/receive" component={Receive} />
<Route path="/reissue" component={Reissue} />
<Route path="/scanner" component={Scanner} />
<Route path="/send" component={Send} />
<Route path="/swap" component={Swap} />
Expand Down
Loading

0 comments on commit 10d1b76

Please sign in to comment.