update to 0.4.0

This commit is contained in:
Paul Miller
2023-07-08 17:33:59 -05:00
parent 1f31ca4c3a
commit 3b6975a0d9
4 changed files with 29 additions and 14 deletions

View File

@@ -12,4 +12,5 @@ VITE_ESPLORA="https://mutinynet.com/api"
VITE_LSP="https://signet-lsp.mutinywallet.com"
VITE_RGS="https://rgs.mutinynet.com/snapshot/"
VITE_SELFHOSTED="true"
VITE_AUTH="https://auth-staging.mutinywallet.com"
VITE_AUTH="https://auth-staging.mutinywallet.com"
VITE_SUBSCRIPTIONS="https://subscriptions-staging.mutinywallet.com"

View File

@@ -1,6 +1,6 @@
{
"name": "mutiny-wallet",
"version": "0.3.16",
"version": "0.4.0",
"license": "MIT",
"packageManager": "pnpm@8.3.1",
"scripts": {
@@ -38,7 +38,7 @@
"@kobalte/core": "^0.9.8",
"@kobalte/tailwindcss": "^0.5.0",
"@modular-forms/solid": "^0.13.2",
"@mutinywallet/mutiny-wasm": "0.3.16",
"@mutinywallet/mutiny-wasm": "0.4.0",
"@mutinywallet/waila-wasm": "^0.2.1",
"@solid-primitives/upload": "^0.0.111",
"@solidjs/meta": "^0.28.5",

8
pnpm-lock.yaml generated
View File

@@ -15,8 +15,8 @@ dependencies:
specifier: ^0.13.2
version: 0.13.2(solid-js@1.7.7)
'@mutinywallet/mutiny-wasm':
specifier: 0.3.16
version: 0.3.16
specifier: 0.4.0
version: 0.4.0
'@mutinywallet/waila-wasm':
specifier: ^0.2.1
version: 0.2.1
@@ -1872,8 +1872,8 @@ packages:
solid-js: 1.7.7
dev: false
/@mutinywallet/mutiny-wasm@0.3.16:
resolution: {integrity: sha512-x+u+1y5YTD9i1MJy0JbHhSQhB3y5Z52e7etSC09SIFOhIwWqCp1Px+jGj9pBjfZmFWE8sGR2Ro3LBHWs6tyldA==}
/@mutinywallet/mutiny-wasm@0.4.0:
resolution: {integrity: sha512-N9eedF+iuF5a+S4MoP7Gt59by29QcWkgnd9pzMjp9ISDXy3cz8k6yjWYZn2X5jzv5azcWyD1xTuBZ/s32iT+Vw==}
dev: false
/@mutinywallet/waila-wasm@0.2.1:

View File

@@ -11,6 +11,7 @@ export type MutinyWalletSettingStrings = {
rgs?: string;
lsp?: string;
auth?: string;
subscriptions?: string;
};
export function getExistingSettings(): MutinyWalletSettingStrings {
@@ -28,17 +29,23 @@ export function getExistingSettings(): MutinyWalletSettingStrings {
const lsp =
localStorage.getItem("MUTINY_SETTINGS_lsp") || import.meta.env.VITE_LSP;
const auth =
localStorage.getItem("MUTINY_SETTINGS_auth") || import.meta.env.VITE_AUTH;
localStorage.getItem("MUTINY_SETTINGS_auth") ||
import.meta.env.VITE_AUTH;
const subscriptions =
localStorage.getItem("MUTINY_SETTINGS_subscriptions") ||
import.meta.env.VITE_SUBSCRIPTIONS;
return { network, proxy, esplora, rgs, lsp, auth };
return { network, proxy, esplora, rgs, lsp, auth, subscriptions };
}
export async function setAndGetMutinySettings(
settings?: MutinyWalletSettingStrings
): Promise<MutinyWalletSettingStrings> {
let { network, proxy, esplora, rgs, lsp, auth } = settings || {};
let { network, proxy, esplora, rgs, lsp, auth, subscriptions } =
settings || {};
const existingSettings = getExistingSettings();
try {
network = network || existingSettings.network;
proxy = proxy || existingSettings.proxy;
@@ -46,6 +53,7 @@ export async function setAndGetMutinySettings(
rgs = rgs || existingSettings.rgs;
lsp = lsp || existingSettings.lsp;
auth = auth || existingSettings.auth;
subscriptions = subscriptions || existingSettings.subscriptions;
if (!network || !proxy || !esplora) {
throw new Error(
@@ -64,8 +72,13 @@ export async function setAndGetMutinySettings(
rgs && localStorage.setItem("MUTINY_SETTINGS_rgs", rgs);
lsp && localStorage.setItem("MUTINY_SETTINGS_lsp", lsp);
auth && localStorage.setItem("MUTINY_SETTINGS_auth", auth);
subscriptions &&
localStorage.setItem(
"MUTINY_SETTINGS_subscriptions",
subscriptions
);
return { network, proxy, esplora, rgs, lsp, auth };
return { network, proxy, esplora, rgs, lsp, auth, subscriptions };
} catch (error) {
console.error(error);
throw error;
@@ -113,9 +126,8 @@ export async function setupMutinyWallet(
await initWaila();
console.log("Starting setup...");
const { network, proxy, esplora, rgs, lsp, auth } = await setAndGetMutinySettings(
settings
);
const { network, proxy, esplora, rgs, lsp, auth, subscriptions } =
await setAndGetMutinySettings(settings);
console.log("Initializing Mutiny Manager");
console.log("Using network", network);
console.log("Using proxy", proxy);
@@ -123,6 +135,7 @@ export async function setupMutinyWallet(
console.log("Using rgs address", rgs);
console.log("Using lsp address", lsp);
console.log("Using auth address", auth);
console.log("Using subscriptions address", subscriptions);
const mutinyWallet = await new MutinyWallet(
// Password
"",
@@ -134,6 +147,7 @@ export async function setupMutinyWallet(
rgs,
lsp,
auth,
subscriptions,
// Do not connect peers
undefined
);