From 3b6975a0d9b5ee65afb8f805547c4ead28e08b89 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Sat, 8 Jul 2023 17:33:59 -0500 Subject: [PATCH] update to 0.4.0 --- .env.example | 3 ++- package.json | 4 ++-- pnpm-lock.yaml | 8 ++++---- src/logic/mutinyWalletSetup.ts | 28 +++++++++++++++++++++------- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/.env.example b/.env.example index 98ebb9b..e61b8e9 100644 --- a/.env.example +++ b/.env.example @@ -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" \ No newline at end of file +VITE_AUTH="https://auth-staging.mutinywallet.com" +VITE_SUBSCRIPTIONS="https://subscriptions-staging.mutinywallet.com" \ No newline at end of file diff --git a/package.json b/package.json index 927129a..034e0cc 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b5e658..90850a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -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: diff --git a/src/logic/mutinyWalletSetup.ts b/src/logic/mutinyWalletSetup.ts index 76beeca..b5f1252 100644 --- a/src/logic/mutinyWalletSetup.ts +++ b/src/logic/mutinyWalletSetup.ts @@ -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 { - 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 );