@liberfi.io/wallet-connector 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -87,6 +87,8 @@ declare function useAuth(): AuthContextValue;
|
|
|
87
87
|
|
|
88
88
|
declare function useAuthCallback<T extends (...args: any[]) => any>(callback: T, deps?: DependencyList): T;
|
|
89
89
|
|
|
90
|
+
declare function useWallet(chain: Chain): WalletAdapter | undefined;
|
|
91
|
+
|
|
90
92
|
interface WalletConnectorContextValue {
|
|
91
93
|
/**
|
|
92
94
|
* detecting: is detecting connected wallets
|
|
@@ -126,6 +128,6 @@ declare global {
|
|
|
126
128
|
};
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
|
-
declare const _default: "0.1.
|
|
131
|
+
declare const _default: "0.1.4";
|
|
130
132
|
|
|
131
|
-
export { AuthProvider, type AuthProviderProps, type AuthenticatedUser, type Eip1193Provider, type EvmWalletAdapter, type WalletAdapter, WalletConnectorProvider, type WalletConnectorProviderProps, useAuth, useAuthCallback, useWalletConnector, useWallets, _default as version };
|
|
133
|
+
export { AuthProvider, type AuthProviderProps, type AuthenticatedUser, type Eip1193Provider, type EvmWalletAdapter, type WalletAdapter, WalletConnectorProvider, type WalletConnectorProviderProps, useAuth, useAuthCallback, useWallet, useWalletConnector, useWallets, _default as version };
|
package/dist/index.d.ts
CHANGED
|
@@ -87,6 +87,8 @@ declare function useAuth(): AuthContextValue;
|
|
|
87
87
|
|
|
88
88
|
declare function useAuthCallback<T extends (...args: any[]) => any>(callback: T, deps?: DependencyList): T;
|
|
89
89
|
|
|
90
|
+
declare function useWallet(chain: Chain): WalletAdapter | undefined;
|
|
91
|
+
|
|
90
92
|
interface WalletConnectorContextValue {
|
|
91
93
|
/**
|
|
92
94
|
* detecting: is detecting connected wallets
|
|
@@ -126,6 +128,6 @@ declare global {
|
|
|
126
128
|
};
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
|
-
declare const _default: "0.1.
|
|
131
|
+
declare const _default: "0.1.4";
|
|
130
132
|
|
|
131
|
-
export { AuthProvider, type AuthProviderProps, type AuthenticatedUser, type Eip1193Provider, type EvmWalletAdapter, type WalletAdapter, WalletConnectorProvider, type WalletConnectorProviderProps, useAuth, useAuthCallback, useWalletConnector, useWallets, _default as version };
|
|
133
|
+
export { AuthProvider, type AuthProviderProps, type AuthenticatedUser, type Eip1193Provider, type EvmWalletAdapter, type WalletAdapter, WalletConnectorProvider, type WalletConnectorProviderProps, useAuth, useAuthCallback, useWallet, useWalletConnector, useWallets, _default as version };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var
|
|
1
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var r=react.createContext({});function a(){let t=react.useContext(r);if(!t)throw new Error("useAuth must be used within a AuthProvider");return t}function E(t,e){let{status:o,signIn:i}=a(),u=react.useRef(o);return u.current=o,react.useCallback(async(...c)=>{if(u.current!=="authenticated"){i();return}return t(...c)},[...e||[],i,t])}var n=react.createContext({});function s(){let t=react.useContext(n);if(!t)throw new Error("useWalletConnector must be used within a WalletConnectorProvider");return t}function l(){let{wallets:t}=s();return t}function D(t){return l().find(o=>o.chain===t)}function X({children:t,...e}){return jsxRuntime.jsx(r.Provider,{value:e,children:t})}function tt({children:t,...e}){return jsxRuntime.jsx(n.Provider,{value:e,children:t})}typeof window<"u"&&(window.__LIBERFI_VERSION__=window.__LIBERFI_VERSION__||{},window.__LIBERFI_VERSION__["@liberfi.io/wallet-connector"]="0.1.4");var W="0.1.4";exports.AuthProvider=X;exports.WalletConnectorProvider=tt;exports.useAuth=a;exports.useAuthCallback=E;exports.useWallet=D;exports.useWalletConnector=s;exports.useWallets=l;exports.version=W;//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/AuthContext.ts","../src/hooks/useAuth.ts","../src/hooks/useAuthCallback.ts","../src/providers/WalletConnectorContext.ts","../src/hooks/useWalletConnector.ts","../src/hooks/useWallets.ts","../src/providers/AuthProvider.tsx","../src/providers/WalletConnectorProvider.tsx","../src/version.ts"],"names":["AuthContext","createContext","useAuth","context","useContext","useAuthCallback","callback","deps","status","signIn","statusRef","useRef","useCallback","args","WalletConnectorContext","useWalletConnector","useWallets","wallets","AuthProvider","children","value","jsx","WalletConnectorProvider","version_default"],"mappings":"gFAgBO,IAAMA,CAAAA,CAAcC,mBAAAA,CACzB,EACF,CAAA,CCfO,SAASC,
|
|
1
|
+
{"version":3,"sources":["../src/providers/AuthContext.ts","../src/hooks/useAuth.ts","../src/hooks/useAuthCallback.ts","../src/providers/WalletConnectorContext.ts","../src/hooks/useWalletConnector.ts","../src/hooks/useWallets.ts","../src/hooks/useWallet.ts","../src/providers/AuthProvider.tsx","../src/providers/WalletConnectorProvider.tsx","../src/version.ts"],"names":["AuthContext","createContext","useAuth","context","useContext","useAuthCallback","callback","deps","status","signIn","statusRef","useRef","useCallback","args","WalletConnectorContext","useWalletConnector","useWallets","wallets","useWallet","chain","wallet","AuthProvider","children","value","jsx","WalletConnectorProvider","version_default"],"mappings":"gFAgBO,IAAMA,CAAAA,CAAcC,mBAAAA,CACzB,EACF,CAAA,CCfO,SAASC,GAAU,CACxB,IAAMC,EAAUC,gBAAAA,CAAWJ,CAAW,CAAA,CACtC,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,4CAA4C,CAAA,CAE9D,OAAOA,CACT,CCLO,SAASE,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACG,CACH,GAAM,CAAE,MAAA,CAAAC,CAAAA,CAAQ,MAAA,CAAAC,CAAO,CAAA,CAAIP,CAAAA,GAIrBQ,CAAAA,CAAYC,YAAAA,CAAeH,CAAM,CAAA,CACvC,OAAAE,EAAU,OAAA,CAAUF,CAAAA,CAETI,iBAAAA,CACT,MAAA,GAAUC,CAAAA,GAA4D,CACpE,GAAIH,CAAAA,CAAU,OAAA,GAAY,eAAA,CAAiB,CACzCD,CAAAA,EAAO,CACP,MACF,CACA,OAAOH,CAAAA,CAAS,GAAGO,CAAI,CACzB,EACA,CAAC,GAAIN,GAAQ,EAAC,CAAIE,EAAQH,CAAQ,CACpC,CAGF,CCFO,IAAMQ,EACXb,mBAAAA,CAA2C,EAAiC,CAAA,CCnBvE,SAASc,CAAAA,EAAqB,CACnC,IAAMZ,CAAAA,CAAUC,iBAAWU,CAAsB,CAAA,CACjD,GAAI,CAACX,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,kEACF,EAEF,OAAOA,CACT,CCTO,SAASa,CAAAA,EAAa,CAC3B,GAAM,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIF,CAAAA,GACpB,OAAOE,CACT,CCNO,SAASC,CAAAA,CAAUC,EAAc,CAEtC,OADgBH,CAAAA,EAAW,CACZ,IAAA,CAAMI,CAAAA,EAAWA,EAAO,KAAA,GAAUD,CAAK,CACxD,CCDO,SAASE,CAAAA,CAAa,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAsB,CACtE,OAAOC,cAAAA,CAACxB,CAAAA,CAAY,SAAZ,CAAqB,KAAA,CAAOuB,CAAAA,CAAQ,QAAA,CAAAD,CAAAA,CAAS,CACvD,CCEO,SAASG,EAAAA,CAAwB,CACtC,SAAAH,CAAAA,CACA,GAAGC,CACL,CAAA,CAAiC,CAC/B,OACEC,eAACV,CAAAA,CAAuB,QAAA,CAAvB,CAAgC,KAAA,CAAOS,CAAAA,CACrC,SAAAD,CAAAA,CACH,CAEJ,CCXI,OAAO,MAAA,CAAW,GAAA,GACpB,OAAO,mBAAA,CAAsB,MAAA,CAAO,mBAAA,EAAuB,EAAC,CAC5D,MAAA,CAAO,oBAAoB,8BAA8B,CAAA,CAAI,OAAA,CAAA,CAG/D,IAAOI,CAAAA,CAAQ","file":"index.js","sourcesContent":["import { createContext } from \"react\";\nimport { AuthenticatedUser } from \"../types\";\n\nexport interface AuthContextValue {\n /** authenticated user profile */\n user: AuthenticatedUser | null;\n /** authentication status */\n status: \"unauthenticated\" | \"authenticating\" | \"authenticated\";\n /** sign in to the IdP */\n signIn: () => void | Promise<void>;\n /** sign out from the IdP */\n signOut: () => void | Promise<void>;\n /** refresh the access token */\n refreshAccessToken: () => void | Promise<void>;\n}\n\nexport const AuthContext = createContext<AuthContextValue>(\n {} as AuthContextValue,\n);\n","import { useContext } from \"react\";\nimport { AuthContext } from \"../providers/AuthContext\";\n\nexport function useAuth() {\n const context = useContext(AuthContext);\n if (!context) {\n throw new Error(\"useAuth must be used within a AuthProvider\");\n }\n return context;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { DependencyList, useCallback, useRef } from \"react\";\nimport { useAuth } from \"./useAuth\";\n\nexport function useAuthCallback<T extends (...args: any[]) => any>(\n callback: T,\n deps?: DependencyList,\n): T {\n const { status, signIn } = useAuth();\n\n // statusRef will be updated to the latest on each render\n // avoid callback rebuild on status changes\n const statusRef = useRef<string>(status);\n statusRef.current = status;\n\n const cb = useCallback(\n async (...args: Parameters<T>): Promise<ReturnType<T> | undefined> => {\n if (statusRef.current !== \"authenticated\") {\n signIn();\n return;\n }\n return callback(...args);\n },\n [...(deps || []), signIn, callback],\n );\n\n return cb as T;\n}\n","import { createContext } from \"react\";\nimport { WalletAdapter } from \"../types\";\n\nexport interface WalletConnectorContextValue {\n /**\n * detecting: is detecting connected wallets\n * connecting: is connecting to the first wallet\n * connected: is connected to at least one wallet\n * disconnecting: is disconnecting from the last connected wallet\n * disconnected: is disconnected from all wallets\n */\n status:\n | \"detecting\"\n | \"connecting\"\n | \"connected\"\n | \"disconnecting\"\n | \"disconnected\";\n // all wallets that can be used to take onchain actions when connected\n wallets: Array<WalletAdapter>;\n // if no wallets are connected, connect one or multiple wallets\n connect: () => Promise<void>;\n // disconnect all wallets\n disconnect: () => Promise<void>;\n}\n\nexport const WalletConnectorContext =\n createContext<WalletConnectorContextValue>({} as WalletConnectorContextValue);\n","import { useContext } from \"react\";\nimport { WalletConnectorContext } from \"../providers/WalletConnectorContext\";\n\n/**\n * use wallet connector hook\n * @returns wallet connector\n */\nexport function useWalletConnector() {\n const context = useContext(WalletConnectorContext);\n if (!context) {\n throw new Error(\n \"useWalletConnector must be used within a WalletConnectorProvider\",\n );\n }\n return context;\n}\n","import { useWalletConnector } from \"./useWalletConnector\";\n\n/**\n * use wallets hook\n * @returns all wallets that can be used to take onchain actions\n */\nexport function useWallets() {\n const { wallets } = useWalletConnector();\n return wallets;\n}\n","import { Chain } from \"@liberfi.io/types\";\nimport { useWallets } from \"./useWallets\";\n\nexport function useWallet(chain: Chain) {\n const wallets = useWallets();\n return wallets.find((wallet) => wallet.chain === chain);\n}\n","import { PropsWithChildren } from \"react\";\nimport { AuthContext, AuthContextValue } from \"./AuthContext\";\n\nexport type AuthProviderProps = PropsWithChildren<AuthContextValue>;\n\nexport function AuthProvider({ children, ...value }: AuthProviderProps) {\n return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;\n}\n","import { PropsWithChildren } from \"react\";\nimport {\n WalletConnectorContext,\n WalletConnectorContextValue,\n} from \"./WalletConnectorContext\";\n\nexport type WalletConnectorProviderProps =\n PropsWithChildren<WalletConnectorContextValue>;\n\nexport function WalletConnectorProvider({\n children,\n ...value\n}: WalletConnectorProviderProps) {\n return (\n <WalletConnectorContext.Provider value={value}>\n {children}\n </WalletConnectorContext.Provider>\n );\n}\n","declare global {\n interface Window {\n __LIBERFI_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif (typeof window !== \"undefined\") {\n window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};\n window.__LIBERFI_VERSION__[\"@liberfi.io/wallet-connector\"] = \"0.1.4\";\n}\n\nexport default \"0.1.4\";\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {createContext,useContext,useRef,useCallback}from'react';import {jsx}from'react/jsx-runtime';var
|
|
1
|
+
import {createContext,useContext,useRef,useCallback}from'react';import {jsx}from'react/jsx-runtime';var r=createContext({});function a(){let t=useContext(r);if(!t)throw new Error("useAuth must be used within a AuthProvider");return t}function E(t,e){let{status:o,signIn:i}=a(),u=useRef(o);return u.current=o,useCallback(async(...c)=>{if(u.current!=="authenticated"){i();return}return t(...c)},[...e||[],i,t])}var n=createContext({});function s(){let t=useContext(n);if(!t)throw new Error("useWalletConnector must be used within a WalletConnectorProvider");return t}function l(){let{wallets:t}=s();return t}function D(t){return l().find(o=>o.chain===t)}function X({children:t,...e}){return jsx(r.Provider,{value:e,children:t})}function tt({children:t,...e}){return jsx(n.Provider,{value:e,children:t})}typeof window<"u"&&(window.__LIBERFI_VERSION__=window.__LIBERFI_VERSION__||{},window.__LIBERFI_VERSION__["@liberfi.io/wallet-connector"]="0.1.4");var W="0.1.4";export{X as AuthProvider,tt as WalletConnectorProvider,a as useAuth,E as useAuthCallback,D as useWallet,s as useWalletConnector,l as useWallets,W as version};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/providers/AuthContext.ts","../src/hooks/useAuth.ts","../src/hooks/useAuthCallback.ts","../src/providers/WalletConnectorContext.ts","../src/hooks/useWalletConnector.ts","../src/hooks/useWallets.ts","../src/providers/AuthProvider.tsx","../src/providers/WalletConnectorProvider.tsx","../src/version.ts"],"names":["AuthContext","createContext","useAuth","context","useContext","useAuthCallback","callback","deps","status","signIn","statusRef","useRef","useCallback","args","WalletConnectorContext","useWalletConnector","useWallets","wallets","AuthProvider","children","value","jsx","WalletConnectorProvider","version_default"],"mappings":"oGAgBO,IAAMA,CAAAA,CAAcC,aAAAA,CACzB,EACF,CAAA,CCfO,SAASC,
|
|
1
|
+
{"version":3,"sources":["../src/providers/AuthContext.ts","../src/hooks/useAuth.ts","../src/hooks/useAuthCallback.ts","../src/providers/WalletConnectorContext.ts","../src/hooks/useWalletConnector.ts","../src/hooks/useWallets.ts","../src/hooks/useWallet.ts","../src/providers/AuthProvider.tsx","../src/providers/WalletConnectorProvider.tsx","../src/version.ts"],"names":["AuthContext","createContext","useAuth","context","useContext","useAuthCallback","callback","deps","status","signIn","statusRef","useRef","useCallback","args","WalletConnectorContext","useWalletConnector","useWallets","wallets","useWallet","chain","wallet","AuthProvider","children","value","jsx","WalletConnectorProvider","version_default"],"mappings":"oGAgBO,IAAMA,CAAAA,CAAcC,aAAAA,CACzB,EACF,CAAA,CCfO,SAASC,GAAU,CACxB,IAAMC,EAAUC,UAAAA,CAAWJ,CAAW,CAAA,CACtC,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,4CAA4C,CAAA,CAE9D,OAAOA,CACT,CCLO,SAASE,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACG,CACH,GAAM,CAAE,MAAA,CAAAC,CAAAA,CAAQ,MAAA,CAAAC,CAAO,CAAA,CAAIP,CAAAA,GAIrBQ,CAAAA,CAAYC,MAAAA,CAAeH,CAAM,CAAA,CACvC,OAAAE,EAAU,OAAA,CAAUF,CAAAA,CAETI,WAAAA,CACT,MAAA,GAAUC,CAAAA,GAA4D,CACpE,GAAIH,CAAAA,CAAU,OAAA,GAAY,eAAA,CAAiB,CACzCD,CAAAA,EAAO,CACP,MACF,CACA,OAAOH,CAAAA,CAAS,GAAGO,CAAI,CACzB,EACA,CAAC,GAAIN,GAAQ,EAAC,CAAIE,EAAQH,CAAQ,CACpC,CAGF,CCFO,IAAMQ,EACXb,aAAAA,CAA2C,EAAiC,CAAA,CCnBvE,SAASc,CAAAA,EAAqB,CACnC,IAAMZ,CAAAA,CAAUC,WAAWU,CAAsB,CAAA,CACjD,GAAI,CAACX,CAAAA,CACH,MAAM,IAAI,KAAA,CACR,kEACF,EAEF,OAAOA,CACT,CCTO,SAASa,CAAAA,EAAa,CAC3B,GAAM,CAAE,OAAA,CAAAC,CAAQ,CAAA,CAAIF,CAAAA,GACpB,OAAOE,CACT,CCNO,SAASC,CAAAA,CAAUC,EAAc,CAEtC,OADgBH,CAAAA,EAAW,CACZ,IAAA,CAAMI,CAAAA,EAAWA,EAAO,KAAA,GAAUD,CAAK,CACxD,CCDO,SAASE,CAAAA,CAAa,CAAE,QAAA,CAAAC,CAAAA,CAAU,GAAGC,CAAM,CAAA,CAAsB,CACtE,OAAOC,GAAAA,CAACxB,CAAAA,CAAY,SAAZ,CAAqB,KAAA,CAAOuB,CAAAA,CAAQ,QAAA,CAAAD,CAAAA,CAAS,CACvD,CCEO,SAASG,EAAAA,CAAwB,CACtC,SAAAH,CAAAA,CACA,GAAGC,CACL,CAAA,CAAiC,CAC/B,OACEC,IAACV,CAAAA,CAAuB,QAAA,CAAvB,CAAgC,KAAA,CAAOS,CAAAA,CACrC,SAAAD,CAAAA,CACH,CAEJ,CCXI,OAAO,MAAA,CAAW,GAAA,GACpB,OAAO,mBAAA,CAAsB,MAAA,CAAO,mBAAA,EAAuB,EAAC,CAC5D,MAAA,CAAO,oBAAoB,8BAA8B,CAAA,CAAI,OAAA,CAAA,CAG/D,IAAOI,CAAAA,CAAQ","file":"index.mjs","sourcesContent":["import { createContext } from \"react\";\nimport { AuthenticatedUser } from \"../types\";\n\nexport interface AuthContextValue {\n /** authenticated user profile */\n user: AuthenticatedUser | null;\n /** authentication status */\n status: \"unauthenticated\" | \"authenticating\" | \"authenticated\";\n /** sign in to the IdP */\n signIn: () => void | Promise<void>;\n /** sign out from the IdP */\n signOut: () => void | Promise<void>;\n /** refresh the access token */\n refreshAccessToken: () => void | Promise<void>;\n}\n\nexport const AuthContext = createContext<AuthContextValue>(\n {} as AuthContextValue,\n);\n","import { useContext } from \"react\";\nimport { AuthContext } from \"../providers/AuthContext\";\n\nexport function useAuth() {\n const context = useContext(AuthContext);\n if (!context) {\n throw new Error(\"useAuth must be used within a AuthProvider\");\n }\n return context;\n}\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { DependencyList, useCallback, useRef } from \"react\";\nimport { useAuth } from \"./useAuth\";\n\nexport function useAuthCallback<T extends (...args: any[]) => any>(\n callback: T,\n deps?: DependencyList,\n): T {\n const { status, signIn } = useAuth();\n\n // statusRef will be updated to the latest on each render\n // avoid callback rebuild on status changes\n const statusRef = useRef<string>(status);\n statusRef.current = status;\n\n const cb = useCallback(\n async (...args: Parameters<T>): Promise<ReturnType<T> | undefined> => {\n if (statusRef.current !== \"authenticated\") {\n signIn();\n return;\n }\n return callback(...args);\n },\n [...(deps || []), signIn, callback],\n );\n\n return cb as T;\n}\n","import { createContext } from \"react\";\nimport { WalletAdapter } from \"../types\";\n\nexport interface WalletConnectorContextValue {\n /**\n * detecting: is detecting connected wallets\n * connecting: is connecting to the first wallet\n * connected: is connected to at least one wallet\n * disconnecting: is disconnecting from the last connected wallet\n * disconnected: is disconnected from all wallets\n */\n status:\n | \"detecting\"\n | \"connecting\"\n | \"connected\"\n | \"disconnecting\"\n | \"disconnected\";\n // all wallets that can be used to take onchain actions when connected\n wallets: Array<WalletAdapter>;\n // if no wallets are connected, connect one or multiple wallets\n connect: () => Promise<void>;\n // disconnect all wallets\n disconnect: () => Promise<void>;\n}\n\nexport const WalletConnectorContext =\n createContext<WalletConnectorContextValue>({} as WalletConnectorContextValue);\n","import { useContext } from \"react\";\nimport { WalletConnectorContext } from \"../providers/WalletConnectorContext\";\n\n/**\n * use wallet connector hook\n * @returns wallet connector\n */\nexport function useWalletConnector() {\n const context = useContext(WalletConnectorContext);\n if (!context) {\n throw new Error(\n \"useWalletConnector must be used within a WalletConnectorProvider\",\n );\n }\n return context;\n}\n","import { useWalletConnector } from \"./useWalletConnector\";\n\n/**\n * use wallets hook\n * @returns all wallets that can be used to take onchain actions\n */\nexport function useWallets() {\n const { wallets } = useWalletConnector();\n return wallets;\n}\n","import { Chain } from \"@liberfi.io/types\";\nimport { useWallets } from \"./useWallets\";\n\nexport function useWallet(chain: Chain) {\n const wallets = useWallets();\n return wallets.find((wallet) => wallet.chain === chain);\n}\n","import { PropsWithChildren } from \"react\";\nimport { AuthContext, AuthContextValue } from \"./AuthContext\";\n\nexport type AuthProviderProps = PropsWithChildren<AuthContextValue>;\n\nexport function AuthProvider({ children, ...value }: AuthProviderProps) {\n return <AuthContext.Provider value={value}>{children}</AuthContext.Provider>;\n}\n","import { PropsWithChildren } from \"react\";\nimport {\n WalletConnectorContext,\n WalletConnectorContextValue,\n} from \"./WalletConnectorContext\";\n\nexport type WalletConnectorProviderProps =\n PropsWithChildren<WalletConnectorContextValue>;\n\nexport function WalletConnectorProvider({\n children,\n ...value\n}: WalletConnectorProviderProps) {\n return (\n <WalletConnectorContext.Provider value={value}>\n {children}\n </WalletConnectorContext.Provider>\n );\n}\n","declare global {\n interface Window {\n __LIBERFI_VERSION__?: {\n [key: string]: string;\n };\n }\n}\nif (typeof window !== \"undefined\") {\n window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};\n window.__LIBERFI_VERSION__[\"@liberfi.io/wallet-connector\"] = \"0.1.4\";\n}\n\nexport default \"0.1.4\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liberfi.io/wallet-connector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Base Wallet Connector for Liberfi React SDK",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"react": "^19.1.1",
|
|
18
18
|
"react-dom": "^19.1.1",
|
|
19
|
-
"@liberfi.io/types": "0.1.
|
|
19
|
+
"@liberfi.io/types": "0.1.11"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/react": "^19.1.13",
|