Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod 0.4.34 #707

Merged
merged 8 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ Prereleased tags will be created for master.

#### Release

##### Android

First bump up the `versionCode` and `versionName` in `./andriod/app/build.gradle`. The `versionCode` must always go up by one when making a release. The `versionName` can mimic `package.json` with an extra build number like `0.4.3-1` to make it easier to keep things looking like they are in sync when android only releases go out.

Publish a new tag like `0.4.3-1` in order to trigger a signed release version running in mainnet mode.

##### iOS

In `ios/App/App.xcodeproj/project.pbxproj` bump `MARKETING_VERSION` and then do whatever needs to be done in testflight to get it released.

### Creating keys for the first time

1. Generate a new signing key
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.mutinywallet.mutinywallet"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 33
versionName "0.4.32"
versionCode 34
versionName "0.4.33"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.4.32;
MARKETING_VERSION = 1.4.34;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -383,7 +383,7 @@
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.finance";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.4.32;
MARKETING_VERSION = 1.4.34;
PRODUCT_BUNDLE_IDENTIFIER = com.mutinywallet.mutiny;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mutiny-wallet",
"version": "0.4.32",
"version": "0.4.34",
"license": "MIT",
"packageManager": "[email protected]",
"scripts": {
Expand Down Expand Up @@ -57,7 +57,7 @@
"@kobalte/core": "^0.9.8",
"@kobalte/tailwindcss": "^0.5.0",
"@modular-forms/solid": "^0.18.1",
"@mutinywallet/mutiny-wasm": "0.4.32",
"@mutinywallet/mutiny-wasm": "0.4.34",
"@mutinywallet/waila-wasm": "^0.2.4",
"@solid-primitives/upload": "^0.0.111",
"@solid-primitives/websocket": "^1.2.0",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

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

4 changes: 1 addition & 3 deletions src/components/AmountEditable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ import { useI18n } from "~/i18n/context";
import { Network } from "~/logic/mutinyWalletSetup";
import { useMegaStore } from "~/state/megaStore";
import { DIALOG_CONTENT, DIALOG_POSITIONER } from "~/styles/dialogs";
import { fiatToSats, satsToFiat } from "~/utils";

import { Currency } from "./ChooseCurrency";
import { Currency, fiatToSats, satsToFiat } from "~/utils";

// Checks the users locale to determine if decimals should be a "." or a ","
const decimalDigitDivider = Number(1.0)
Expand Down
133 changes: 26 additions & 107 deletions src/components/ChooseCurrency.tsx
Original file line number Diff line number Diff line change
@@ -1,119 +1,37 @@
import { createForm } from "@modular-forms/solid";
import { createSignal, Show } from "solid-js";
import { createSignal, For, Show } from "solid-js";
import { useNavigate } from "solid-start";

import {
Button,
ExternalLink,
InfoBox,
NiceP,
SelectField,
VStack
} from "~/components";
import { Button, ExternalLink, InfoBox, NiceP, VStack } from "~/components";
import { useI18n } from "~/i18n/context";
import { useMegaStore } from "~/state/megaStore";
import { eify, timeout } from "~/utils";

export interface Currency {
value: string;
label: string;
hasSymbol?: string;
maxFractionalDigits: number;
}
import {
BTC_OPTION,
Currency,
eify,
FIAT_OPTIONS,
timeout,
USD_OPTION
} from "~/utils";

type ChooseCurrencyForm = {
fiatCurrency: string;
};

/**
* FIAT_OPTIONS is an array of possible currencies
* All available currencies can be found here https://api.coingecko.com/api/v3/simple/supported_vs_currencies
* @Currency
* @param {string} label - should be in the format {Name} {ISO code}
* @param {string} values - are uppercase ISO 4217 currency code
* @param {string?} hasSymbol - if the currency has a symbol it should be represented as a string
* @param {number} maxFractionalDigits - the standard fractional units used by the currency should be set with maxFractionalDigits
*
* Bitcoin is represented as:
* {
* label: "bitcoin BTC",
* value: "BTC",
* hasSymbol: "₿",
* maxFractionalDigits: 8
* }
*/

export const FIAT_OPTIONS: Currency[] = [
{
label: "Bitcoin BTC",
value: "BTC",
hasSymbol: "₿",
maxFractionalDigits: 8
},
{
label: "United States Dollar USD",
value: "USD",
hasSymbol: "$",
maxFractionalDigits: 2
},
{ label: "Swiss Franc CHF", value: "CHF", maxFractionalDigits: 2 },
{
label: "Chinese Yuan CNY",
value: "CNY",
hasSymbol: "¥",
maxFractionalDigits: 2
},
{
label: "Euro EUR",
value: "EUR",
hasSymbol: "€",
maxFractionalDigits: 2
},
{
label: "Brazilian Real BRL",
value: "BRL",
hasSymbol: "R$",
maxFractionalDigits: 2
},
{
label: "British Pound GBP",
value: "GBP",
hasSymbol: "₤",
maxFractionalDigits: 2
},
{
label: "Australia Dollar AUD",
value: "AUD",
hasSymbol: "$",
maxFractionalDigits: 2
},
{
label: "Japanese Yen JPY",
value: "JPY",
hasSymbol: "¥",
maxFractionalDigits: 0
},
{
label: "Korean Won KRW",
value: "KRW",
hasSymbol: "₩",
maxFractionalDigits: 0
},
{ label: "Kuwaiti Dinar KWD", value: "KWD", maxFractionalDigits: 3 }
].sort((a, b) => (a.value > b.value ? 1 : b.value > a.value ? -1 : 0));

export const USD_INDEX = FIAT_OPTIONS.findIndex((fo) => fo.value === "USD");
export const BTC_INDEX = FIAT_OPTIONS.findIndex((fo) => fo.value === "BTC");
const COMBINED_OPTIONS: Currency[] = [USD_OPTION, BTC_OPTION, ...FIAT_OPTIONS];

export function ChooseCurrency() {
const i18n = useI18n();
const [error, setError] = createSignal<Error>();
const [state, actions] = useMegaStore();
const [_state, actions] = useMegaStore();
const [loading, setLoading] = createSignal(false);
const navigate = useNavigate();

function findCurrencyByValue(value: string) {
return FIAT_OPTIONS.find((currency) => currency.value === value);
return (
COMBINED_OPTIONS.find((currency) => currency.value === value) ??
USD_OPTION
);
}

const [_chooseCurrencyForm, { Form, Field }] =
Expand All @@ -135,7 +53,7 @@ export function ChooseCurrency() {
const handleFormSubmit = async (f: ChooseCurrencyForm) => {
setLoading(true);
try {
actions.saveFiat(findCurrencyByValue(f.fiatCurrency) || state.fiat);
actions.saveFiat(findCurrencyByValue(f.fiatCurrency));

await timeout(1000);
navigate("/");
Expand All @@ -157,16 +75,17 @@ export function ChooseCurrency() {
<VStack>
<Field name="fiatCurrency">
{(field, props) => (
<SelectField
<select
{...props}
value={field.value}
error={field.error}
placeholder={state.fiat.label}
options={FIAT_OPTIONS}
label={i18n.t(
"settings.currency.select_currency_label"
)}
/>
class="w-full rounded-lg bg-m-grey-750 py-2 pl-4 pr-12 text-base font-normal text-white"
>
<For each={COMBINED_OPTIONS}>
{({ value, label }) => (
<option value={value}>{label}</option>
)}
</For>
</select>
)}
</Field>
<Show when={error()}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/PendingNwc.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { NwcProfile } from "@mutinywallet/mutiny-wasm";
import {
createEffect,
createResource,
Expand Down Expand Up @@ -42,10 +41,11 @@ export function PendingNwc() {
const [error, setError] = createSignal<Error>();

async function fetchPendingRequests() {
const profiles: NwcProfile[] =
await state.mutiny_wallet?.get_nwc_profiles();
const profiles = await state.mutiny_wallet?.get_nwc_profiles();
if (!profiles) return [];

const pending = await state.mutiny_wallet?.get_pending_nwc_invoices();
if (!pending) return [];

const pendingItems: PendingItem[] = [];

Expand Down
3 changes: 3 additions & 0 deletions src/components/SetupErrorDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ export function SetupErrorDisplay(props: { initialError: Error }) {
<NiceP>
{i18n.t("error.on_boot.loading_failed.description")}
</NiceP>
<Button onClick={() => window.location.reload()}>
Reload
</Button>
<NiceP>
{i18n.t(
"error.on_boot.loading_failed.repair_options"
Expand Down
17 changes: 9 additions & 8 deletions src/components/TagEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@ import { createOptions, Select } from "@thisbeyond/solid-select";

import "~/styles/solid-select.css";

import { TagItem, TagKind } from "@mutinywallet/mutiny-wasm";
import { createMemo, createSignal, onMount } from "solid-js";

import { useMegaStore } from "~/state/megaStore";
import { MutinyTagItem, sortByLastUsed } from "~/utils";
import { sortByLastUsed } from "~/utils";

const createLabelValue = (label: string): Partial<MutinyTagItem> => {
return { name: label, kind: "Contact" };
const createLabelValue = (label: string): Partial<TagItem> => {
return { name: label, kind: TagKind.Contact };
};

export function TagEditor(props: {
selectedValues: Partial<MutinyTagItem>[];
setSelectedValues: (value: Partial<MutinyTagItem>[]) => void;
selectedValues: Partial<TagItem>[];
setSelectedValues: (value: Partial<TagItem>[]) => void;
placeholder: string;
autoFillTag?: string | undefined;
}) {
const [_state, actions] = useMegaStore();
const [availableTags, setAvailableTags] = createSignal<MutinyTagItem[]>([]);
const [availableTags, setAvailableTags] = createSignal<TagItem[]>([]);

onMount(async () => {
const tags = await actions.listTags();
if (tags) {
setAvailableTags(
tags
.filter((tag) => tag.kind === "Contact")
.filter((tag) => tag.kind === TagKind.Contact)
.sort(sortByLastUsed)
);
if (props.autoFillTag && availableTags()) {
Expand All @@ -51,7 +52,7 @@ export function TagEditor(props: {
});
});

const onChange = (selected: MutinyTagItem[]) => {
const onChange = (selected: TagItem[]) => {
props.setSelectedValues(selected);

const lastValue = selected[selected.length - 1];
Expand Down
7 changes: 4 additions & 3 deletions src/components/layout/Misc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
Checkbox as KCheckbox,
Separator
} from "@kobalte/core";
import { TagItem, TagKind } from "@mutinywallet/mutiny-wasm";
import {
createResource,
createSignal,
Expand All @@ -27,7 +28,7 @@ import {
} from "~/components";
import { useI18n } from "~/i18n/context";
import { useMegaStore } from "~/state/megaStore";
import { generateGradient, MutinyTagItem } from "~/utils";
import { generateGradient } from "~/utils";

export const SmallHeader: ParentComponent<{ class?: string }> = (props) => {
return (
Expand Down Expand Up @@ -268,15 +269,15 @@ export const TinyText: ParentComponent = (props) => {

export const TinyButton: ParentComponent<{
onClick: () => void;
tag?: MutinyTagItem;
tag?: TagItem;
}> = (props) => {
// TODO: don't need to run this if it's not a contact
const [gradient] = createResource(async () => {
return generateGradient(props.tag?.name || "?");
});

const bg = () =>
props.tag?.name && props.tag?.kind === "Contact"
props.tag?.name && props.tag?.kind === TagKind.Contact
? gradient()
: "rgb(255 255 255 / 0.1)";

Expand Down
Loading
Loading