graz 0.0.3 → 0.0.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.ts CHANGED
@@ -18,6 +18,7 @@ declare const defaultChains: {
18
18
  juno: _keplr_wallet_types.ChainInfo;
19
19
  osmosis: _keplr_wallet_types.ChainInfo;
20
20
  };
21
+ declare const defaultChainsArray: _keplr_wallet_types.ChainInfo[];
21
22
 
22
23
  declare function reconnect(): void;
23
24
 
@@ -46,8 +47,8 @@ declare function useAccount({ onConnect, onDisconnect }?: UseAccountArgs): {
46
47
  declare function useBalances(bech32Address?: string): {
47
48
  data: _cosmjs_amino.Coin[] | undefined;
48
49
  error: unknown;
49
- isLoading: boolean;
50
50
  isFetching: boolean;
51
+ isLoading: boolean;
51
52
  isRefetching: boolean;
52
53
  isSuccess: boolean;
53
54
  refetch: <TPageData>(options?: (react_query.RefetchOptions & react_query.RefetchQueryFilters<TPageData>) | undefined) => Promise<react_query.QueryObserverResult<_cosmjs_amino.Coin[], unknown>>;
@@ -92,9 +93,11 @@ declare function useSuggestChain({ onError, onLoading, onSuccess }?: UseSuggestC
92
93
  declare function useCheckKeplr(): boolean;
93
94
 
94
95
  declare function getKeplr(): _keplr_wallet_types.Keplr;
96
+ declare function registerKeplrNotFound(fn: () => void): void;
97
+ declare function unregisterKeplrNotFound(): void;
95
98
 
96
99
  declare function GrazProvider({ children }: {
97
100
  children: ReactNode;
98
101
  }): JSX.Element;
99
102
 
100
- export { GrazChain, GrazProvider, UseAccountArgs, UseConnectChainArgs, UseSuggestChainArgs, defaultChains, defineChains, getKeplr, useAccount, useActiveChain, useBalances, useCheckKeplr, useConnect, useCosmWasmClient, useDisconnect, useSigners, useSuggestChain };
103
+ export { GrazChain, GrazProvider, UseAccountArgs, UseConnectChainArgs, UseSuggestChainArgs, defaultChains, defaultChainsArray, defineChains, getKeplr, registerKeplrNotFound, unregisterKeplrNotFound, useAccount, useActiveChain, useBalances, useCheckKeplr, useConnect, useCosmWasmClient, useDisconnect, useSigners, useSuggestChain };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var R=Object.create;var l=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},w=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of H(t))!J.call(e,n)&&n!==o&&l(e,n,{get:()=>t[n],enumerable:!(c=F(t,n))||c.enumerable});return e};var f=(e,t,o)=>(o=e!=null?R(Q(e)):{},w(t||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),X=e=>w(l({},"__esModule",{value:!0}),e);var we={};V(we,{GrazProvider:()=>Ce,defaultChains:()=>me,defineChains:()=>ae,getKeplr:()=>u,useAccount:()=>N,useActiveChain:()=>fe,useBalances:()=>ue,useCheckKeplr:()=>C,useConnect:()=>le,useCosmWasmClient:()=>pe,useDisconnect:()=>ge,useSigners:()=>he,useSuggestChain:()=>ye});module.exports=X(we);var s=f(require("react"));var k=require("@keplr-wallet/cosmos"),S={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},A=[S],v={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:S,bip44:{coinType:118},bech32Config:k.Bech32Address.defaultBech32Config("cosmos"),currencies:A,feeCurrencies:A};var j=require("@keplr-wallet/cosmos"),b={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},Y={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},Z={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},$={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},ee={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},ne={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},te={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},oe={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},re={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},ie={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},se={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},x=[b,Y,Z,$,ee,ne,te,oe,re,ie,se],D={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:b,bip44:{coinType:118},bech32Config:j.Bech32Address.defaultBech32Config("juno"),currencies:x,feeCurrencies:x};var I=require("@keplr-wallet/cosmos"),G={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},ce={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},z=[G,ce],q={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:G,bip44:{coinType:118},bech32Config:I.Bech32Address.defaultBech32Config("osmo"),currencies:z,feeCurrencies:z};function ae(e){return e}var me={cosmos:v,juno:D,osmosis:q};var K=require("react"),p=require("react-query"),E=f(require("zustand/shallow"));var U=require("@cosmjs/cosmwasm-stargate");var M=f(require("zustand")),g=require("zustand/middleware"),y={account:null,activeChain:null,balances:null,client:null,signer:null,signerAmino:null,signerAuto:null,status:"disconnected",_notFoundFn:()=>null,_reconnect:!1,_supported:!1},r=(0,M.default)((0,g.subscribeWithSelector)((0,g.persist)(()=>({...y}),{name:"graz",partialize:e=>({activeChain:e.activeChain,_reconnect:e._reconnect}),version:1})));function u(){if(typeof window.keplr<"u")return window.keplr;throw r.getState()._notFoundFn(),new Error("Keplr is not defined")}async function d(e){try{let t=u();r.setState(W=>({status:W._reconnect?"reconnecting":"connecting"})),await t.enable(e.chainId);let o=t.getOfflineSigner(e.chainId),c=t.getOfflineSignerOnlyAmino(e.chainId),[n,i,a]=await Promise.all([await t.getKey(e.chainId),await t.getOfflineSignerAuto(e.chainId),await U.SigningCosmWasmClient.connectWithSigner(e.rpc,o)]);return r.setState({account:n,activeChain:e,client:a,signer:o,signerAuto:i,signerAmino:c,status:"connected",_reconnect:!0}),n}catch(t){throw r.getState().account===null&&r.setState({status:"disconnected"}),t}}async function _(){return r.setState({...y}),Promise.resolve()}async function O(e){let{activeChain:t,client:o}=r.getState();if(!t||!o)throw new Error("No connected account detected");return await Promise.all(t.currencies.map(async n=>o.getBalance(e,n.coinMinimalDenom)))}function m(){let{activeChain:e}=r.getState();e&&d(e)}function C(){return r(e=>e._supported)}function N({onConnect:e,onDisconnect:t}={}){let o=r(n=>n.account),c=r(n=>n.status);return(0,K.useEffect)(()=>r.subscribe(n=>n.status,(n,i)=>{if(n==="connected"){let a=r.getState();e==null||e({account:a.account,isReconnect:i==="reconnecting"})}n==="disconnected"&&(t==null||t())}),[e,t]),{data:o,isConnected:c==="connected",isConnecting:c==="connecting",isDisconnected:c==="disconnected",isReconnecting:c==="reconnecting",reconnect:m,status:c}}function ue(e){var i;let t=N(),o=e||((i=t.data)==null?void 0:i.bech32Address),n=(0,p.useQuery)(["WADESTA_USE_BALANCES",o],({queryKey:[,a]})=>O(a),{enabled:Boolean(o)});return{data:n.data,error:n.error,isLoading:n.isLoading,isFetching:n.isFetching,isRefetching:n.isRefetching,isSuccess:n.isSuccess,refetch:n.refetch,status:n.status}}function pe(){return r(e=>e.client)}function le({onError:e,onLoading:t,onSuccess:o}={}){let n=(0,p.useMutation)(["WADESTA_USE_CONNECT",e,t,o],d,{onError:(i,a)=>Promise.resolve(e==null?void 0:e(i,a)),onMutate:t,onSuccess:i=>Promise.resolve(o==null?void 0:o(i))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,isSupported:C(),connect:n.mutate,connectAsync:n.mutateAsync,status:n.status}}function ge({onError:e,onLoading:t,onSuccess:o}={}){let n=(0,p.useMutation)(["WADESTA_USE_DISCONNECT",e,t,o],_,{onError:i=>Promise.resolve(e==null?void 0:e(i,void 0)),onMutate:t,onSuccess:()=>Promise.resolve(o==null?void 0:o(void 0))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,disconnect:n.mutate,disconnectAsync:n.mutateAsync,status:n.status}}function he(){return r(e=>({signer:e.signer,signerAmino:e.signerAmino,signerAuto:e.signerAuto}),E.default)}var B=require("react-query");async function T(e){return await u().experimentalSuggestChain(e),e}function fe(){return r(e=>e.activeChain)}function ye({onError:e,onLoading:t,onSuccess:o}={}){let n=(0,B.useMutation)(["WADESTA_USE_SUGGEST_CHAIN",e,t,o],T,{onError:(i,a)=>Promise.resolve(e==null?void 0:e(i,a)),onMutate:t,onSuccess:i=>Promise.resolve(o==null?void 0:o(i))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,suggest:n.mutate,suggestAsync:n.mutateAsync,status:n.status}}var h=require("react-query");var P=require("react");function L(){return(0,P.useEffect)(()=>{r.setState({_supported:typeof window.keplr<"u"});let{_reconnect:e}=r.getState();return e&&m(),window.addEventListener("focus",m),window.addEventListener("keplr_keystorechange",m),()=>{window.removeEventListener("focus",m),window.removeEventListener("keplr_keystorechange",m)}},[]),null}var de=new h.QueryClient({defaultOptions:{queries:{notifyOnChangeProps:"tracked"}}});function Ce({children:e}){return s.createElement(h.QueryClientProvider,{key:"graz-query-client",client:de},s.createElement(L,null),e)}0&&(module.exports={GrazProvider,defaultChains,defineChains,getKeplr,useAccount,useActiveChain,useBalances,useCheckKeplr,useConnect,useCosmWasmClient,useDisconnect,useSigners,useSuggestChain});
1
+ "use strict";var R=Object.create;var l=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,V=Object.prototype.hasOwnProperty;var X=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},k=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Q(t))!V.call(e,n)&&n!==o&&l(e,n,{get:()=>t[n],enumerable:!(c=H(t,n))||c.enumerable});return e};var d=(e,t,o)=>(o=e!=null?R(J(e)):{},k(t||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),Y=e=>k(l({},"__esModule",{value:!0}),e);var ke={};X(ke,{GrazProvider:()=>ve,defaultChains:()=>ue,defaultChainsArray:()=>pe,defineChains:()=>me,getKeplr:()=>u,registerKeplrNotFound:()=>le,unregisterKeplrNotFound:()=>ge,useAccount:()=>B,useActiveChain:()=>we,useBalances:()=>he,useCheckKeplr:()=>v,useConnect:()=>de,useCosmWasmClient:()=>fe,useDisconnect:()=>ye,useSigners:()=>Ce,useSuggestChain:()=>Ae});module.exports=Y(ke);var i=d(require("react"));var j=require("@keplr-wallet/cosmos"),b={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},x=[b],y={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:b,bip44:{coinType:118},bech32Config:j.Bech32Address.defaultBech32Config("cosmos"),currencies:x,feeCurrencies:x};var I=require("@keplr-wallet/cosmos"),z={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},Z={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},$={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},ee={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},ne={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},te={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},oe={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},re={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},ie={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},se={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},ce={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},D=[z,Z,$,ee,ne,te,oe,re,ie,se,ce],C={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:z,bip44:{coinType:118},bech32Config:I.Bech32Address.defaultBech32Config("juno"),currencies:D,feeCurrencies:D};var q=require("@keplr-wallet/cosmos"),_={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},ae={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},G=[_,ae],w={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:_,bip44:{coinType:118},bech32Config:q.Bech32Address.defaultBech32Config("osmo"),currencies:G,feeCurrencies:G};function me(e){return e}var ue={cosmos:y,juno:C,osmosis:w},pe=[y,C,w];var N=require("react"),p=require("react-query"),E=d(require("zustand/shallow"));var U=require("@cosmjs/cosmwasm-stargate");var M=d(require("zustand")),g=require("zustand/middleware"),A={account:null,activeChain:null,balances:null,client:null,signer:null,signerAmino:null,signerAuto:null,status:"disconnected",_notFoundFn:()=>null,_reconnect:!1,_supported:!1},r=(0,M.default)((0,g.subscribeWithSelector)((0,g.persist)(()=>({...A}),{name:"graz",partialize:e=>({activeChain:e.activeChain,_reconnect:e._reconnect}),version:1})));function u(){if(typeof window.keplr<"u")return window.keplr;throw r.getState()._notFoundFn(),new Error("Keplr is not defined")}function le(e){r.setState({_notFoundFn:e})}function ge(){r.setState({_notFoundFn:()=>null})}async function S(e){try{let t=u();r.setState(f=>{let W=f._reconnect;return f.activeChain&&f.activeChain.chainId!==e.chainId?{status:"connecting"}:W?{status:"reconnecting"}:{status:"connecting"}}),await t.enable(e.chainId);let o=t.getOfflineSigner(e.chainId),c=t.getOfflineSignerOnlyAmino(e.chainId),[n,s,m]=await Promise.all([await t.getKey(e.chainId),await t.getOfflineSignerAuto(e.chainId),await U.SigningCosmWasmClient.connectWithSigner(e.rpc,o)]);return r.setState({account:n,activeChain:e,client:m,signer:o,signerAuto:s,signerAmino:c,status:"connected",_reconnect:!0}),n}catch(t){throw r.getState().account===null&&r.setState({status:"disconnected"}),t}}async function K(){return r.setState(e=>({...A,_supported:e._supported})),Promise.resolve()}async function O(e){let{activeChain:t,client:o}=r.getState();if(!t||!o)throw new Error("No connected account detected");return await Promise.all(t.currencies.map(async n=>o.getBalance(e,n.coinMinimalDenom)))}function a(){let{activeChain:e}=r.getState();e&&S(e)}function v(){return r(e=>e._supported)}function B({onConnect:e,onDisconnect:t}={}){let o=r(n=>n.account),c=r(n=>n.status);return(0,N.useEffect)(()=>r.subscribe(n=>n.status,(n,s)=>{if(n==="connected"){let m=r.getState();e==null||e({account:m.account,isReconnect:s==="reconnecting"})}n==="disconnected"&&(t==null||t())}),[e,t]),{data:o,isConnected:Boolean(o),isConnecting:c==="connecting",isDisconnected:c==="disconnected",isReconnecting:c==="reconnecting",reconnect:a,status:c}}function he(e){let{data:t}=B(),o=e||(t==null?void 0:t.bech32Address),n=(0,p.useQuery)(["WADESTA_USE_BALANCES",o],({queryKey:[,s]})=>O(s),{enabled:Boolean(o)});return{data:n.data,error:n.error,isFetching:n.isFetching,isLoading:n.isLoading,isRefetching:n.isRefetching,isSuccess:n.isSuccess,refetch:n.refetch,status:n.status}}function fe(){return r(e=>e.client)}function de({onError:e,onLoading:t,onSuccess:o}={}){let n=(0,p.useMutation)(["WADESTA_USE_CONNECT",e,t,o],S,{onError:(s,m)=>Promise.resolve(e==null?void 0:e(s,m)),onMutate:t,onSuccess:s=>Promise.resolve(o==null?void 0:o(s))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,isSupported:v(),connect:n.mutate,connectAsync:n.mutateAsync,status:n.status}}function ye({onError:e,onLoading:t,onSuccess:o}={}){let n=(0,p.useMutation)(["WADESTA_USE_DISCONNECT",e,t,o],K,{onError:s=>Promise.resolve(e==null?void 0:e(s,void 0)),onMutate:t,onSuccess:()=>Promise.resolve(o==null?void 0:o(void 0))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,disconnect:n.mutate,disconnectAsync:n.mutateAsync,status:n.status}}function Ce(){return r(e=>({signer:e.signer,signerAmino:e.signerAmino,signerAuto:e.signerAuto}),E.default)}var F=require("react-query");async function T(e){return await u().experimentalSuggestChain(e),e}function we(){return r(e=>e.activeChain)}function Ae({onError:e,onLoading:t,onSuccess:o}={}){let n=(0,F.useMutation)(["WADESTA_USE_SUGGEST_CHAIN",e,t,o],T,{onError:(s,m)=>Promise.resolve(e==null?void 0:e(s,m)),onMutate:t,onSuccess:s=>Promise.resolve(o==null?void 0:o(s))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,suggest:n.mutate,suggestAsync:n.mutateAsync,status:n.status}}var h=require("react-query");var P=require("react");function L(){return(0,P.useEffect)(()=>{r.setState({_supported:typeof window.keplr<"u"});let{_reconnect:e}=r.getState();return e&&a(),window.addEventListener("focus",a),window.addEventListener("keplr_keystorechange",a),()=>{window.removeEventListener("focus",a),window.removeEventListener("keplr_keystorechange",a)}},[]),null}var Se=new h.QueryClient({defaultOptions:{queries:{notifyOnChangeProps:"tracked"}}});function ve({children:e}){return i.createElement(h.QueryClientProvider,{key:"graz-query-client",client:Se},i.createElement(L,null),e)}0&&(module.exports={GrazProvider,defaultChains,defaultChainsArray,defineChains,getKeplr,registerKeplrNotFound,unregisterKeplrNotFound,useAccount,useActiveChain,useBalances,useCheckKeplr,useConnect,useCosmWasmClient,useDisconnect,useSigners,useSuggestChain});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import*as s from"react";import{Bech32Address as I}from"@keplr-wallet/cosmos";var h={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},g=[h],f={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:h,bip44:{coinType:118},bech32Config:I.defaultBech32Config("cosmos"),currencies:g,feeCurrencies:g};import{Bech32Address as G}from"@keplr-wallet/cosmos";var d={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},q={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},M={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},U={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},_={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},O={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},K={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},E={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},N={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},T={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},B={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},y=[d,q,M,U,_,O,K,E,N,T,B],C={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:d,bip44:{coinType:118},bech32Config:G.defaultBech32Config("juno"),currencies:y,feeCurrencies:y};import{Bech32Address as P}from"@keplr-wallet/cosmos";var A={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},L={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},w=[A,L],k={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:A,bip44:{coinType:118},bech32Config:P.defaultBech32Config("osmo"),currencies:w,feeCurrencies:w};function le(e){return e}var ge={cosmos:f,juno:C,osmosis:k};import{useEffect as Q}from"react";import{useMutation as j,useQuery as J}from"react-query";import V from"zustand/shallow";import{SigningCosmWasmClient as H}from"@cosmjs/cosmwasm-stargate";import W from"zustand";import{persist as R,subscribeWithSelector as F}from"zustand/middleware";var p={account:null,activeChain:null,balances:null,client:null,signer:null,signerAmino:null,signerAuto:null,status:"disconnected",_notFoundFn:()=>null,_reconnect:!1,_supported:!1},r=W(F(R(()=>({...p}),{name:"graz",partialize:e=>({activeChain:e.activeChain,_reconnect:e._reconnect}),version:1})));function u(){if(typeof window.keplr<"u")return window.keplr;throw r.getState()._notFoundFn(),new Error("Keplr is not defined")}async function l(e){try{let t=u();r.setState(z=>({status:z._reconnect?"reconnecting":"connecting"})),await t.enable(e.chainId);let o=t.getOfflineSigner(e.chainId),c=t.getOfflineSignerOnlyAmino(e.chainId),[n,i,a]=await Promise.all([await t.getKey(e.chainId),await t.getOfflineSignerAuto(e.chainId),await H.connectWithSigner(e.rpc,o)]);return r.setState({account:n,activeChain:e,client:a,signer:o,signerAuto:i,signerAmino:c,status:"connected",_reconnect:!0}),n}catch(t){throw r.getState().account===null&&r.setState({status:"disconnected"}),t}}async function S(){return r.setState({...p}),Promise.resolve()}async function v(e){let{activeChain:t,client:o}=r.getState();if(!t||!o)throw new Error("No connected account detected");return await Promise.all(t.currencies.map(async n=>o.getBalance(e,n.coinMinimalDenom)))}function m(){let{activeChain:e}=r.getState();e&&l(e)}function x(){return r(e=>e._supported)}function X({onConnect:e,onDisconnect:t}={}){let o=r(n=>n.account),c=r(n=>n.status);return Q(()=>r.subscribe(n=>n.status,(n,i)=>{if(n==="connected"){let a=r.getState();e==null||e({account:a.account,isReconnect:i==="reconnecting"})}n==="disconnected"&&(t==null||t())}),[e,t]),{data:o,isConnected:c==="connected",isConnecting:c==="connecting",isDisconnected:c==="disconnected",isReconnecting:c==="reconnecting",reconnect:m,status:c}}function Me(e){var i;let t=X(),o=e||((i=t.data)==null?void 0:i.bech32Address),n=J(["WADESTA_USE_BALANCES",o],({queryKey:[,a]})=>v(a),{enabled:Boolean(o)});return{data:n.data,error:n.error,isLoading:n.isLoading,isFetching:n.isFetching,isRefetching:n.isRefetching,isSuccess:n.isSuccess,refetch:n.refetch,status:n.status}}function Ue(){return r(e=>e.client)}function _e({onError:e,onLoading:t,onSuccess:o}={}){let n=j(["WADESTA_USE_CONNECT",e,t,o],l,{onError:(i,a)=>Promise.resolve(e==null?void 0:e(i,a)),onMutate:t,onSuccess:i=>Promise.resolve(o==null?void 0:o(i))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,isSupported:x(),connect:n.mutate,connectAsync:n.mutateAsync,status:n.status}}function Oe({onError:e,onLoading:t,onSuccess:o}={}){let n=j(["WADESTA_USE_DISCONNECT",e,t,o],S,{onError:i=>Promise.resolve(e==null?void 0:e(i,void 0)),onMutate:t,onSuccess:()=>Promise.resolve(o==null?void 0:o(void 0))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,disconnect:n.mutate,disconnectAsync:n.mutateAsync,status:n.status}}function Ke(){return r(e=>({signer:e.signer,signerAmino:e.signerAmino,signerAuto:e.signerAuto}),V)}import{useMutation as Y}from"react-query";async function b(e){return await u().experimentalSuggestChain(e),e}function We(){return r(e=>e.activeChain)}function Re({onError:e,onLoading:t,onSuccess:o}={}){let n=Y(["WADESTA_USE_SUGGEST_CHAIN",e,t,o],b,{onError:(i,a)=>Promise.resolve(e==null?void 0:e(i,a)),onMutate:t,onSuccess:i=>Promise.resolve(o==null?void 0:o(i))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,suggest:n.mutate,suggestAsync:n.mutateAsync,status:n.status}}import{QueryClient as $,QueryClientProvider as ee}from"react-query";import{useEffect as Z}from"react";function D(){return Z(()=>{r.setState({_supported:typeof window.keplr<"u"});let{_reconnect:e}=r.getState();return e&&m(),window.addEventListener("focus",m),window.addEventListener("keplr_keystorechange",m),()=>{window.removeEventListener("focus",m),window.removeEventListener("keplr_keystorechange",m)}},[]),null}var ne=new $({defaultOptions:{queries:{notifyOnChangeProps:"tracked"}}});function Ze({children:e}){return s.createElement(ee,{key:"graz-query-client",client:ne},s.createElement(D,null),e)}export{Ze as GrazProvider,ge as defaultChains,le as defineChains,u as getKeplr,X as useAccount,We as useActiveChain,Me as useBalances,x as useCheckKeplr,_e as useConnect,Ue as useCosmWasmClient,Oe as useDisconnect,Ke as useSigners,Re as useSuggestChain};
1
+ import*as i from"react";import{Bech32Address as G}from"@keplr-wallet/cosmos";var C={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},y=[C],l={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:C,bip44:{coinType:118},bech32Config:G.defaultBech32Config("cosmos"),currencies:y,feeCurrencies:y};import{Bech32Address as q}from"@keplr-wallet/cosmos";var A={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},_={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},M={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},U={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},K={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},O={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},N={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},E={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},B={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},T={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},F={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},w=[A,_,M,U,K,O,N,E,B,T,F],g={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:A,bip44:{coinType:118},bech32Config:q.defaultBech32Config("juno"),currencies:w,feeCurrencies:w};import{Bech32Address as P}from"@keplr-wallet/cosmos";var v={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},L={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},S=[v,L],h={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:v,bip44:{coinType:118},bech32Config:P.defaultBech32Config("osmo"),currencies:S,feeCurrencies:S};function he(e){return e}var fe={cosmos:l,juno:g,osmosis:h},de=[l,g,h];import{useEffect as J}from"react";import{useMutation as b,useQuery as V}from"react-query";import X from"zustand/shallow";import{SigningCosmWasmClient as Q}from"@cosmjs/cosmwasm-stargate";import W from"zustand";import{persist as R,subscribeWithSelector as H}from"zustand/middleware";var f={account:null,activeChain:null,balances:null,client:null,signer:null,signerAmino:null,signerAuto:null,status:"disconnected",_notFoundFn:()=>null,_reconnect:!1,_supported:!1},r=W(H(R(()=>({...f}),{name:"graz",partialize:e=>({activeChain:e.activeChain,_reconnect:e._reconnect}),version:1})));function u(){if(typeof window.keplr<"u")return window.keplr;throw r.getState()._notFoundFn(),new Error("Keplr is not defined")}function ve(e){r.setState({_notFoundFn:e})}function ke(){r.setState({_notFoundFn:()=>null})}async function d(e){try{let t=u();r.setState(p=>{let z=p._reconnect;return p.activeChain&&p.activeChain.chainId!==e.chainId?{status:"connecting"}:z?{status:"reconnecting"}:{status:"connecting"}}),await t.enable(e.chainId);let o=t.getOfflineSigner(e.chainId),c=t.getOfflineSignerOnlyAmino(e.chainId),[n,s,m]=await Promise.all([await t.getKey(e.chainId),await t.getOfflineSignerAuto(e.chainId),await Q.connectWithSigner(e.rpc,o)]);return r.setState({account:n,activeChain:e,client:m,signer:o,signerAuto:s,signerAmino:c,status:"connected",_reconnect:!0}),n}catch(t){throw r.getState().account===null&&r.setState({status:"disconnected"}),t}}async function k(){return r.setState(e=>({...f,_supported:e._supported})),Promise.resolve()}async function x(e){let{activeChain:t,client:o}=r.getState();if(!t||!o)throw new Error("No connected account detected");return await Promise.all(t.currencies.map(async n=>o.getBalance(e,n.coinMinimalDenom)))}function a(){let{activeChain:e}=r.getState();e&&d(e)}function j(){return r(e=>e._supported)}function Y({onConnect:e,onDisconnect:t}={}){let o=r(n=>n.account),c=r(n=>n.status);return J(()=>r.subscribe(n=>n.status,(n,s)=>{if(n==="connected"){let m=r.getState();e==null||e({account:m.account,isReconnect:s==="reconnecting"})}n==="disconnected"&&(t==null||t())}),[e,t]),{data:o,isConnected:Boolean(o),isConnecting:c==="connecting",isDisconnected:c==="disconnected",isReconnecting:c==="reconnecting",reconnect:a,status:c}}function Ne(e){let{data:t}=Y(),o=e||(t==null?void 0:t.bech32Address),n=V(["WADESTA_USE_BALANCES",o],({queryKey:[,s]})=>x(s),{enabled:Boolean(o)});return{data:n.data,error:n.error,isFetching:n.isFetching,isLoading:n.isLoading,isRefetching:n.isRefetching,isSuccess:n.isSuccess,refetch:n.refetch,status:n.status}}function Ee(){return r(e=>e.client)}function Be({onError:e,onLoading:t,onSuccess:o}={}){let n=b(["WADESTA_USE_CONNECT",e,t,o],d,{onError:(s,m)=>Promise.resolve(e==null?void 0:e(s,m)),onMutate:t,onSuccess:s=>Promise.resolve(o==null?void 0:o(s))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,isSupported:j(),connect:n.mutate,connectAsync:n.mutateAsync,status:n.status}}function Te({onError:e,onLoading:t,onSuccess:o}={}){let n=b(["WADESTA_USE_DISCONNECT",e,t,o],k,{onError:s=>Promise.resolve(e==null?void 0:e(s,void 0)),onMutate:t,onSuccess:()=>Promise.resolve(o==null?void 0:o(void 0))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,disconnect:n.mutate,disconnectAsync:n.mutateAsync,status:n.status}}function Fe(){return r(e=>({signer:e.signer,signerAmino:e.signerAmino,signerAuto:e.signerAuto}),X)}import{useMutation as Z}from"react-query";async function D(e){return await u().experimentalSuggestChain(e),e}function Je(){return r(e=>e.activeChain)}function Ve({onError:e,onLoading:t,onSuccess:o}={}){let n=Z(["WADESTA_USE_SUGGEST_CHAIN",e,t,o],D,{onError:(s,m)=>Promise.resolve(e==null?void 0:e(s,m)),onMutate:t,onSuccess:s=>Promise.resolve(o==null?void 0:o(s))});return{error:n.error,isLoading:n.isLoading,isSuccess:n.isSuccess,suggest:n.mutate,suggestAsync:n.mutateAsync,status:n.status}}import{QueryClient as ee,QueryClientProvider as ne}from"react-query";import{useEffect as $}from"react";function I(){return $(()=>{r.setState({_supported:typeof window.keplr<"u"});let{_reconnect:e}=r.getState();return e&&a(),window.addEventListener("focus",a),window.addEventListener("keplr_keystorechange",a),()=>{window.removeEventListener("focus",a),window.removeEventListener("keplr_keystorechange",a)}},[]),null}var te=new ee({defaultOptions:{queries:{notifyOnChangeProps:"tracked"}}});function on({children:e}){return i.createElement(ne,{key:"graz-query-client",client:te},i.createElement(I,null),e)}export{on as GrazProvider,fe as defaultChains,de as defaultChainsArray,he as defineChains,u as getKeplr,ve as registerKeplrNotFound,ke as unregisterKeplrNotFound,Y as useAccount,Je as useActiveChain,Ne as useBalances,j as useCheckKeplr,Be as useConnect,Ee as useCosmWasmClient,Te as useDisconnect,Fe as useSigners,Ve as useSuggestChain};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "graz",
3
3
  "description": "React hooks for Cosmos",
4
- "version": "0.0.3",
4
+ "version": "0.0.4",
5
5
  "author": "Griko Nibras <griko@stranvgelove.ventures>",
6
6
  "repository": "https://github.com/strangelove-ventures/graz.git",
7
7
  "homepage": "https://github.com/strangelove-ventures/graz",