From c047204305c02881a85ec5b5e3087adeb313156c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Thu, 31 Oct 2024 14:45:11 +0000 Subject: [PATCH] [ENG-5120] Permissions support for sats-connect (#171) * Add disconnect events * Update example app to handle disconnection events * wip * WIP * Use new connect method * wip * update core version * update provider-config pkg * fix type error * update import --------- Co-authored-by: Mahmoud Aboelenein --- example/.eslintrc.cjs | 2 +- example/package-lock.json | 22 ++- example/package.json | 3 +- example/src/App.tsx | 151 +++++++++++++++--- .../src/components/AddressDisplay/index.tsx | 6 +- example/src/components/EtchRunes/index.tsx | 8 +- .../src/components/GetRunesBalance/index.tsx | 4 +- .../src/components/wallet/GetPermissions.tsx | 60 +++++++ package-lock.json | 82 ++++------ package.json | 4 +- 10 files changed, 261 insertions(+), 81 deletions(-) create mode 100644 example/src/components/wallet/GetPermissions.tsx diff --git a/example/.eslintrc.cjs b/example/.eslintrc.cjs index 62786bc..a44ec22 100644 --- a/example/.eslintrc.cjs +++ b/example/.eslintrc.cjs @@ -18,7 +18,7 @@ module.exports = { project: ['./tsconfig.app.json', './tsconfig.node.json'], tsconfigRootDir: __dirname, }, - plugins: ['react-refresh', 'prettier'], + plugins: ['react-refresh'], rules: { 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }], }, diff --git a/example/package-lock.json b/example/package-lock.json index 0cf7715..5443dab 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -1,12 +1,12 @@ { "name": "dapp-cookie-cutter", - "version": "0.1.0", + "version": "0.2.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dapp-cookie-cutter", - "version": "0.1.0", + "version": "0.2.0", "dependencies": { "@mantine/core": "^7.11.2", "@mantine/hooks": "^7.11.2", @@ -29,6 +29,7 @@ "@typescript-eslint/parser": "^7.13.1", "@vitejs/plugin-react": "^4.3.1", "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", "postcss": "^8.4.40", @@ -45,8 +46,8 @@ "version": "2.8.3", "license": "ISC", "dependencies": { - "@sats-connect/core": "0.3.1", - "@sats-connect/make-default-provider-config": "0.0.9", + "@sats-connect/core": "0.4.0-6eb2eb5", + "@sats-connect/make-default-provider-config": "0.0.10", "@sats-connect/ui": "0.0.7" }, "devDependencies": { @@ -3231,6 +3232,19 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "license": "MIT", + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "node_modules/eslint-plugin-react": { "version": "7.34.3", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.3.tgz", diff --git a/example/package.json b/example/package.json index a26f996..efd352d 100644 --- a/example/package.json +++ b/example/package.json @@ -1,7 +1,7 @@ { "name": "dapp-cookie-cutter", "private": false, - "version": "0.1.0", + "version": "0.2.0", "type": "module", "repository": { "type": "git", @@ -37,6 +37,7 @@ "@typescript-eslint/parser": "^7.13.1", "@vitejs/plugin-react": "^4.3.1", "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-react-refresh": "^0.4.7", "postcss": "^8.4.40", diff --git a/example/src/App.tsx b/example/src/App.tsx index 55b1161..d473b3c 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,7 +1,7 @@ import { Container, createTheme, MantineProvider, Stack } from '@mantine/core'; import '@mantine/core/styles.css'; import { QueryClient, QueryClientProvider, useQueryClient } from '@tanstack/react-query'; -import { createContext, useCallback, useContext, useEffect, useMemo } from 'react'; +import { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { createBrowserRouter, createRoutesFromElements, @@ -9,8 +9,14 @@ import { Outlet, Route, RouterProvider, + useNavigate, } from 'react-router-dom'; -import Wallet, { AddressPurpose, BitcoinNetworkType, type Address } from 'sats-connect'; +import Wallet, { + AddressPurpose, + BitcoinNetworkType, + RpcErrorCode, + type Address, +} from 'sats-connect'; import { Button, ConnectButtonsContainer, Header, Logo } from './App.styles'; import { GetAccounts } from './components/bitcoin/GetAccounts'; import { GetBtcBalance } from './components/bitcoin/GetBtcBalance'; @@ -30,16 +36,19 @@ import { SendSip10 } from './components/stacks/SendSip10'; import { SendStx } from './components/stacks/SendStx'; import { SignTransaction } from './components/stacks/SignTransaction.tsx'; import TransferRunes from './components/transferRunes/index.tsx'; +import { GetPermissions } from './components/wallet/GetPermissions.tsx'; import { WalletType } from './components/wallet/WalletType'; import { useLocalStorage } from './hooks'; import { CollapseDesktop } from './layouts/CollapseDesktop'; const ConnectionContext = createContext<{ + accountId: string | null; network: BitcoinNetworkType; btcAddressInfo: Address[]; stxAddressInfo: Address[]; onDisconnect: () => void; }>({ + accountId: null, network: BitcoinNetworkType.Mainnet, btcAddressInfo: [], stxAddressInfo: [], @@ -52,37 +61,66 @@ const useConnectionContext = () => useContext(ConnectionContext); const whiteListedPaths = ['/mobile-universal-link']; -function AppWithProviders({ children }: React.PropsWithChildren<{}>) { +function AppWithProviders({ children }: React.PropsWithChildren) { const queryClient = useQueryClient(); + const navigate = useNavigate(); const [network, setNetwork] = useLocalStorage( 'network', BitcoinNetworkType.Mainnet, ); - const [btcAddressInfo, setBtcAddressInfo] = useLocalStorage('btc-addresses', []); - const [stxAddressInfo, setStxAddressInfo] = useLocalStorage('stx-addresses', []); + const [accountId, setAccountId] = useState(null); + const [btcAddressInfo, setBtcAddressInfo] = useState([]); + const [stxAddressInfo, setStxAddressInfo] = useState([]); + const [isLoading, setIsLoading] = useState(true); const isConnected = btcAddressInfo.length + stxAddressInfo.length > 0; const isWhiteListedPath = whiteListedPaths.includes(window.location.pathname); const clearAppData = useCallback(() => { + setAccountId(null); setBtcAddressInfo([]); setStxAddressInfo([]); queryClient.clear(); - }, [queryClient, setBtcAddressInfo, setStxAddressInfo]); + }, [queryClient, setBtcAddressInfo, setStxAddressInfo, setAccountId]); const onDisconnect = useCallback(() => { (async () => { await Wallet.disconnect(); clearAppData(); })().catch(console.error); - }, [queryClient, setBtcAddressInfo, setStxAddressInfo]); + }, [clearAppData]); useEffect(() => { - if (btcAddressInfo.length < 1) return; - const removeListenerAccountChange = Wallet.addListener('accountChange', (ev) => { console.log('The account has changed.', ev); + + // Attempt to get the new account details. + (async () => { + const res = await Wallet.request('wallet_getAccount', undefined); + + if (res.status === 'error' && res.error.code === (RpcErrorCode.ACCESS_DENIED as number)) { + // The app doesn't have permission to read from this account. Clear + // state and redirect to home page, where the user is prompted to + // connect. + clearAppData(); + navigate('/'); + return; + } + + if (res.status === 'error') { + console.error('Received unexpected error while getting account details.'); + console.error(res); + return; + } + + const btcAddresses = res.result.addresses.filter((a) => + [AddressPurpose.Ordinals, AddressPurpose.Payment].includes(a.purpose), + ); + setBtcAddressInfo(btcAddresses); + setStxAddressInfo(res.result.addresses.filter((a) => a.purpose === AddressPurpose.Stacks)); + setAccountId(res.result.id); + })().catch(console.error); }); const removeListenerDisconnect = Wallet.addListener('disconnect', (ev) => { @@ -94,9 +132,43 @@ function AppWithProviders({ children }: React.PropsWithChildren<{}>) { removeListenerAccountChange(); removeListenerDisconnect(); }; - }, [btcAddressInfo]); + }, [clearAppData, navigate]); + + // On initial load, check if the app has the perms it needs and load necessary + // data. + useEffect(() => { + (async function () { + const res = await Wallet.request('wallet_getAccount', undefined); + + if (res.status === 'error' && res.error.code === (RpcErrorCode.ACCESS_DENIED as number)) { + // The app doesn't have permission to read from this account. Clear + // state and redirect to home page, where the user is prompted to + // connect. + clearAppData(); + navigate('/'); + setIsLoading(false); + return; + } + + if (res.status === 'error') { + console.error('Received unexpected error while getting account details.'); + console.error(res); + setIsLoading(false); + return; + } + + const btcAddresses = res.result.addresses.filter((a) => + [AddressPurpose.Ordinals, AddressPurpose.Payment].includes(a.purpose), + ); + setBtcAddressInfo(btcAddresses); + setStxAddressInfo(res.result.addresses.filter((a) => a.purpose === AddressPurpose.Stacks)); + setAccountId(res.result.id); + + setIsLoading(false); + })().catch(console.error); + }, [clearAppData, navigate]); - const onConnectLegacy = useCallback(() => { + const handleLegacyConnectWithGetAccounts = useCallback(() => { (async () => { const response = await Wallet.request('getAccounts', { purposes: [AddressPurpose.Payment, AddressPurpose.Ordinals, AddressPurpose.Stacks], @@ -109,7 +181,7 @@ function AppWithProviders({ children }: React.PropsWithChildren<{}>) { })().catch(console.error); }, [setBtcAddressInfo, setStxAddressInfo]); - const onConnect = useCallback(() => { + const handleLegacyConnectWithRequestPermissions = useCallback(() => { (async () => { const res = await Wallet.request('wallet_requestPermissions', undefined); if (res.status === 'error') { @@ -138,11 +210,33 @@ function AppWithProviders({ children }: React.PropsWithChildren<{}>) { })().catch(console.error); }, [setBtcAddressInfo, setStxAddressInfo]); + const handleConnect = useCallback(() => { + (async () => { + const res = await Wallet.request('wallet_connect', { + message: 'Cool app wants to know your addresses!', + addresses: [AddressPurpose.Payment, AddressPurpose.Ordinals, AddressPurpose.Stacks], + }); + if (res.status === 'error') { + console.error('Error connecting to wallet, details in terminal.'); + console.error(res); + return; + } + const btcAddresses = res.result.addresses.filter((a) => + [AddressPurpose.Ordinals, AddressPurpose.Payment].includes(a.purpose), + ); + setBtcAddressInfo(btcAddresses); + setStxAddressInfo(res.result.addresses.filter((a) => a.purpose === AddressPurpose.Stacks)); + setAccountId(res.result.id); + })().catch(console.error); + }, [setBtcAddressInfo, setStxAddressInfo]); + const connectionContextValue = useMemo( - () => ({ network, btcAddressInfo, stxAddressInfo, onDisconnect }), - [network, btcAddressInfo, stxAddressInfo, onDisconnect], + () => ({ network, btcAddressInfo, stxAddressInfo, onDisconnect, accountId }), + [network, btcAddressInfo, stxAddressInfo, onDisconnect, accountId], ); + if (isLoading) return
Loading...
; + if (!isConnected && !isWhiteListedPath) { return ( @@ -151,8 +245,13 @@ function AppWithProviders({ children }: React.PropsWithChildren<{}>) {

Click the button to connect your wallet

- - + + +
@@ -168,29 +267,39 @@ function AppWithProviders({ children }: React.PropsWithChildren<{}>) { // TODO move to pages or routes.tsx const WalletMethods = () => { - const { network, btcAddressInfo, stxAddressInfo, onDisconnect } = useConnectionContext(); + const { network, btcAddressInfo, stxAddressInfo, onDisconnect, accountId } = + useConnectionContext(); + + if (!accountId) return
Error: no account ID set.
; + return ( <>
+ ); }; const BitcoinMethods = () => { - const { network, btcAddressInfo, onDisconnect } = useConnectionContext(); + const { network, btcAddressInfo, onDisconnect, accountId } = useConnectionContext(); + + if (!accountId) return
Error: no account ID set.
; + return ( <> { }; const StacksMethods = () => { - const { network, stxAddressInfo, onDisconnect } = useConnectionContext(); + const { network, stxAddressInfo, onDisconnect, accountId } = useConnectionContext(); + + if (!accountId) return
Error: no account ID set.
; + return ( <> void; } -export const AddressDisplay = ({ network, addresses, onDisconnect }: Props) => { +export const AddressDisplay = ({ accountId, network, addresses, onDisconnect }: Props) => { return (

Connected Addresses - ({network})

+
+

Account: {accountId}

+
{addresses.map((address) => (

{address.purpose}

diff --git a/example/src/components/EtchRunes/index.tsx b/example/src/components/EtchRunes/index.tsx index 8254a10..8a2fa84 100644 --- a/example/src/components/EtchRunes/index.tsx +++ b/example/src/components/EtchRunes/index.tsx @@ -52,8 +52,8 @@ export const EtchRunes = ({ addresses, network }: Props) => { terms: amount || mintCap ? { - amount: amount || undefined, - cap: mintCap || undefined, + amount: amount || '', + cap: mintCap || '', } : undefined, isMintable: true, @@ -101,8 +101,8 @@ export const EtchRunes = ({ addresses, network }: Props) => { terms: amount || mintCap ? { - amount: amount || undefined, - cap: mintCap || undefined, + amount: amount || '', + cap: mintCap || '', } : undefined, feeRate: +feeRate, diff --git a/example/src/components/GetRunesBalance/index.tsx b/example/src/components/GetRunesBalance/index.tsx index dbbfd97..030152a 100644 --- a/example/src/components/GetRunesBalance/index.tsx +++ b/example/src/components/GetRunesBalance/index.tsx @@ -1,9 +1,9 @@ import { useCallback, useState } from 'react'; -import Wallet, { GetRunesBalanceResult } from 'sats-connect'; +import Wallet, { RunesGetBalanceResult } from 'sats-connect'; import { Button, Card } from '../../App.styles'; export const GetRunesBalance = () => { - const [balances, setBalances] = useState([]); + const [balances, setBalances] = useState([]); const getBalance = useCallback(() => { (async () => { diff --git a/example/src/components/wallet/GetPermissions.tsx b/example/src/components/wallet/GetPermissions.tsx new file mode 100644 index 0000000..d658c83 --- /dev/null +++ b/example/src/components/wallet/GetPermissions.tsx @@ -0,0 +1,60 @@ +import { useQuery } from '@tanstack/react-query'; +import Wallet from 'sats-connect'; +import styled from 'styled-components'; +import { Button, Card } from '../../App.styles'; + +const ErrorMessage = styled.div({ + color: 'red', +}); + +export function GetPermissions() { + const { refetch, error, data, isFetching, isError, isSuccess } = useQuery({ + queryKey: ['wallet_getCurrentPermissions'], + queryFn: async () => { + const res = await Wallet.request('wallet_getCurrentPermissions', undefined); + if (res.status === 'error') { + throw new Error('Error getting permissions.', { cause: res.error }); + } + return res.result; + }, + retry: false, + enabled: false, + }); + + return ( + +

Get current permissions

+ + + + {(() => { + if (isFetching) { + return

Loading...

; + } + + if (isError) { + console.error(error); + console.error(error.cause); + return Error. Check console for details.; + } + + if (isSuccess) { + return ( +
+

Permissions:

+
+                {JSON.stringify(data, null, 2)}
+              
+
+ ); + } + })()} +
+ ); +} diff --git a/package-lock.json b/package-lock.json index 5a4f4dd..9ffae24 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "2.8.3", "license": "ISC", "dependencies": { - "@sats-connect/core": "0.3.1", - "@sats-connect/make-default-provider-config": "0.0.9", + "@sats-connect/core": "0.4.0-6eb2eb5", + "@sats-connect/make-default-provider-config": "0.0.10", "@sats-connect/ui": "0.0.7" }, "devDependencies": { @@ -1444,7 +1444,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -1461,8 +1460,7 @@ "type": "individual", "url": "https://paulmillr.com/funding/" } - ], - "license": "MIT" + ] }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -1718,27 +1716,27 @@ ] }, "node_modules/@sats-connect/core": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@sats-connect/core/-/core-0.3.1.tgz", - "integrity": "sha512-xMOEYUdEcJn8skWmlJLzcJXW7LK0z/8x2oUoly4yWnohZp9ynoZqTYlAe3QtVq72aUjVaX0kzbdB58GUKsixCg==", + "version": "0.4.0-6eb2eb5", + "resolved": "https://registry.npmjs.org/@sats-connect/core/-/core-0.4.0-6eb2eb5.tgz", + "integrity": "sha512-ukeuG6q5U7JtLZzhe9bzxF2eqbEp9tK/PMsSRwK09heW5e7MLMJG8z4PkFhLyVuVHCKTESGI6+TeHG5V0Aug7g==", "dependencies": { - "axios": "1.7.4", + "axios": "1.7.7", "bitcoin-address-validation": "2.2.3", "buffer": "6.0.3", "jsontokens": "4.0.1", - "valibot": "0.33.2" + "valibot": "0.42.1" } }, "node_modules/@sats-connect/make-default-provider-config": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/@sats-connect/make-default-provider-config/-/make-default-provider-config-0.0.9.tgz", - "integrity": "sha512-7aNHrexYif5e4817YfMINgvUy1G8sKZJxwOSQ23kq4YTYze4wh+rsgJCl5oF1//sL3EXwheDVCn5NJe8tUH1rA==", + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/@sats-connect/make-default-provider-config/-/make-default-provider-config-0.0.10.tgz", + "integrity": "sha512-BBot3Ofa2J7OwXprgYPD4C8dppX4nnPxj4FXWq1H7fDsvwJmW4sAnfmnAIzwmyWZJOR2uZqtTkXAA08sVkoN5g==", "dependencies": { "@sats-connect/ui": "^0.0.6", "bowser": "^2.11.0" }, "peerDependencies": { - "@sats-connect/core": "^0.3.0", + "@sats-connect/core": "*", "typescript": "^5.0.0" } }, @@ -1996,14 +1994,12 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", - "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", - "license": "MIT", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -2133,7 +2129,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/base58-js/-/base58-js-1.0.5.tgz", "integrity": "sha512-LkkAPP8Zu+c0SVNRTRVDyMfKVORThX+rCViget00xdgLRrKkClCTz1T7cIrpr69ShwV5XJuuoZvMvJ43yURwkA==", - "license": "MIT", "engines": { "node": ">= 8" } @@ -2155,14 +2150,12 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "MIT" + ] }, "node_modules/bech32": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", - "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", - "license": "MIT" + "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, "node_modules/binary-extensions": { "version": "2.3.0", @@ -2180,7 +2173,6 @@ "version": "2.2.3", "resolved": "https://registry.npmjs.org/bitcoin-address-validation/-/bitcoin-address-validation-2.2.3.tgz", "integrity": "sha512-1uGCGl26Ye8JG5qcExtFLQfuib6qEZWNDo1ZlLlwp/z7ygUFby3IxolgEfgMGaC+LG9csbVASLcH8fRLv7DIOg==", - "license": "MIT", "dependencies": { "base58-js": "^1.0.0", "bech32": "^2.0.0", @@ -2287,7 +2279,6 @@ "url": "https://feross.org/support" } ], - "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -2567,7 +2558,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -2679,7 +2669,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -2957,7 +2946,6 @@ "url": "https://github.com/sponsors/RubenVerborgh" } ], - "license": "MIT", "engines": { "node": ">=4.0" }, @@ -2996,10 +2984,9 @@ } }, "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "license": "MIT", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3219,8 +3206,7 @@ "type": "consulting", "url": "https://feross.org/support" } - ], - "license": "BSD-3-Clause" + ] }, "node_modules/ignore": { "version": "5.3.1", @@ -4151,7 +4137,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/jsontokens/-/jsontokens-4.0.1.tgz", "integrity": "sha512-+MO415LEN6M+3FGsRz4wU20g7N2JA+2j9d9+pGaNJHviG4L8N0qzavGyENw6fJqsq9CcrHOIL6iWX5yeTZ86+Q==", - "license": "MIT", "dependencies": { "@noble/hashes": "^1.1.2", "@noble/secp256k1": "^1.6.3", @@ -4630,7 +4615,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", "engines": { "node": ">= 0.6" } @@ -4639,7 +4623,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", "dependencies": { "mime-db": "1.52.0" }, @@ -5116,8 +5099,7 @@ "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/punycode": { "version": "2.3.1", @@ -5368,8 +5350,7 @@ "node_modules/sha256-uint8array": { "version": "0.10.7", "resolved": "https://registry.npmjs.org/sha256-uint8array/-/sha256-uint8array-0.10.7.tgz", - "integrity": "sha512-1Q6JQU4tX9NqsDGodej6pkrUVQVNapLZnvkwIhddH/JqzBZF1fSaxSWNY6sziXBE8aEa2twtGkXUrwzGeZCMpQ==", - "license": "MIT" + "integrity": "sha512-1Q6JQU4tX9NqsDGodej6pkrUVQVNapLZnvkwIhddH/JqzBZF1fSaxSWNY6sziXBE8aEa2twtGkXUrwzGeZCMpQ==" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -6043,10 +6024,17 @@ } }, "node_modules/valibot": { - "version": "0.33.2", - "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.33.2.tgz", - "integrity": "sha512-ZpFWuI+bs5+PP66q4zVFn4e4t/s5jmMw5iPBZmGUoi8iQqXyU9YY/BLCAyk62Z/bNS8qdUNBEyx52952qdqW3w==", - "license": "MIT" + "version": "0.42.1", + "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.42.1.tgz", + "integrity": "sha512-3keXV29Ar5b//Hqi4MbSdV7lfVp6zuYLZuA9V1PvQUsXqogr+u5lvLPLk3A4f74VUXDnf/JfWMN6sB+koJ/FFw==", + "peerDependencies": { + "typescript": ">=5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } }, "node_modules/walker": { "version": "1.0.8", diff --git a/package.json b/package.json index 38daf41..ed355d8 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ ] }, "dependencies": { - "@sats-connect/core": "0.3.1", - "@sats-connect/make-default-provider-config": "0.0.9", + "@sats-connect/core": "0.4.0-6eb2eb5", + "@sats-connect/make-default-provider-config": "0.0.10", "@sats-connect/ui": "0.0.7" }, "devDependencies": {