graz 0.0.43-alpha.0 → 0.0.43
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 +20 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -970,6 +970,25 @@ declare const useQuerySmart: <TData, TError>(address?: string, queryMsg?: Record
|
|
|
970
970
|
*/
|
|
971
971
|
declare const useQueryRaw: <TError>(address?: string, key?: string) => UseQueryResult<Uint8Array | null, TError>;
|
|
972
972
|
|
|
973
|
+
/**
|
|
974
|
+
* graz hook to retrieve current active {@link WalletType}
|
|
975
|
+
*
|
|
976
|
+
* @example
|
|
977
|
+
* ```ts
|
|
978
|
+
* import { useActiveWalletType } from "graz";
|
|
979
|
+
* const { walletType } = useActiveWalletType();
|
|
980
|
+
* ```
|
|
981
|
+
*/
|
|
982
|
+
declare const useActiveWalletType: () => {
|
|
983
|
+
walletType: WalletType;
|
|
984
|
+
isCosmostation: boolean;
|
|
985
|
+
isCosmostationMobile: boolean;
|
|
986
|
+
isKeplr: boolean;
|
|
987
|
+
isKeplrMobile: boolean;
|
|
988
|
+
isLeap: boolean;
|
|
989
|
+
isLeapMobile: boolean;
|
|
990
|
+
isWalletConnect: boolean;
|
|
991
|
+
};
|
|
973
992
|
/**
|
|
974
993
|
* graz query hook to check whether given {@link WalletType} or default configured wallet is supported
|
|
975
994
|
*
|
|
@@ -1020,4 +1039,4 @@ declare const useGrazEvents: () => null;
|
|
|
1020
1039
|
*/
|
|
1021
1040
|
declare const GrazEvents: FC;
|
|
1022
1041
|
|
|
1023
|
-
export { AccountData, ChainInfoWithPath, ConfigureGrazArgs, ConnectArgs, ConnectResult, Connector, CreateClientArgs, CreateQueryClient, CreateSigningClientArgs, Dictionary, ExecuteContractArgs, ExecuteContractMutationArgs, GetWalletConnectParams, GrazAdapter, GrazChain, GrazEvents, GrazProvider, GrazProviderProps, InstantiateContractArgs, InstantiateContractMutationArgs, Maybe, ReconnectArgs, SendIbcTokensArgs, SendTokensArgs, SuggestChainAndConnectArgs, UseAccountArgs, UseConnectChainArgs, UseExecuteContractArgs, UseInstantiateContractArgs, UseQueryClient, UseSuggestChainAndConnectArgs, UseSuggestChainArgs, WALLET_TYPES, Wallet, WalletType, checkWallet, clearRecentChain, configureGraz, connect, createClients, createQueryClient, createSigningClients, defineChain, defineChainInfo, defineChains, disconnect, executeContract, getActiveChainCurrency, getAvailableWallets, getBalanceStaked, getBalances, getCosmostation, getKeplr, getLeap, getQueryRaw, getQuerySmart, getRecentChain, getWCCosmostation, getWCKeplr, getWCLeap, getWallet, getWalletConnect, instantiateContract, mainnetChains, mainnetChainsArray, reconnect, sendIbcTokens, sendTokens, suggestChain, suggestChainAndConnect, testnetChains, testnetChainsArray, useAccount, useActiveChain, useActiveChainCurrency, useActiveChainValidators, useBalance, useBalanceStaked, useBalances, useCheckWallet, useClients, useConnect, useDisconnect, useExecuteContract, useGrazEvents, useInstantiateContract, useOfflineSigners, useQueryClient, useQueryRaw, useQuerySmart, useRecentChain, useSendIbcTokens, useSendTokens, useSigners, useSigningClients, useSuggestChain, useSuggestChainAndConnect };
|
|
1042
|
+
export { AccountData, ChainInfoWithPath, ConfigureGrazArgs, ConnectArgs, ConnectResult, Connector, CreateClientArgs, CreateQueryClient, CreateSigningClientArgs, Dictionary, ExecuteContractArgs, ExecuteContractMutationArgs, GetWalletConnectParams, GrazAdapter, GrazChain, GrazEvents, GrazProvider, GrazProviderProps, InstantiateContractArgs, InstantiateContractMutationArgs, Maybe, ReconnectArgs, SendIbcTokensArgs, SendTokensArgs, SuggestChainAndConnectArgs, UseAccountArgs, UseConnectChainArgs, UseExecuteContractArgs, UseInstantiateContractArgs, UseQueryClient, UseSuggestChainAndConnectArgs, UseSuggestChainArgs, WALLET_TYPES, Wallet, WalletType, checkWallet, clearRecentChain, configureGraz, connect, createClients, createQueryClient, createSigningClients, defineChain, defineChainInfo, defineChains, disconnect, executeContract, getActiveChainCurrency, getAvailableWallets, getBalanceStaked, getBalances, getCosmostation, getKeplr, getLeap, getQueryRaw, getQuerySmart, getRecentChain, getWCCosmostation, getWCKeplr, getWCLeap, getWallet, getWalletConnect, instantiateContract, mainnetChains, mainnetChainsArray, reconnect, sendIbcTokens, sendTokens, suggestChain, suggestChainAndConnect, testnetChains, testnetChainsArray, useAccount, useActiveChain, useActiveChainCurrency, useActiveChainValidators, useActiveWalletType, useBalance, useBalanceStaked, useBalances, useCheckWallet, useClients, useConnect, useDisconnect, useExecuteContract, useGrazEvents, useInstantiateContract, useOfflineSigners, useQueryClient, useQueryRaw, useQuerySmart, useRecentChain, useSendIbcTokens, useSendTokens, useSigners, useSigningClients, useSuggestChain, useSuggestChainAndConnect };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var un=Object.create;var ae=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var pn=Object.getOwnPropertyNames;var mn=Object.getPrototypeOf,gn=Object.prototype.hasOwnProperty;var fn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dn=(t,e)=>{for(var n in e)ae(t,n,{get:e[n],enumerable:!0})},it=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pn(e))!gn.call(t,o)&&o!==n&&ae(t,o,{get:()=>e[o],enumerable:!(r=ln(e,o))||r.enumerable});return t};var ct=(t,e,n)=>(n=t!=null?un(mn(t)):{},it(e||!t||!t.__esModule?ae(n,"default",{value:t,enumerable:!0}):n,t)),hn=t=>it(ae({},"__esModule",{value:!0}),t);var xt=fn((To,St)=>{St.exports=w;var v=null;try{v=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function w(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}w.prototype.__isLong__;Object.defineProperty(w.prototype,"__isLong__",{value:!0});function j(t){return(t&&t.__isLong__)===!0}w.isLong=j;var pt={},mt={};function P(t,e){var n,r,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(r=mt[t],r)?r:(n=S(t,(t|0)<0?-1:0,!0),o&&(mt[t]=n),n)):(t|=0,(o=-128<=t&&t<128)&&(r=pt[t],r)?r:(n=S(t,t<0?-1:0,!1),o&&(pt[t]=n),n))}w.fromInt=P;function _(t,e){if(isNaN(t))return e?q:F;if(e){if(t<0)return q;if(t>=ht)return wt}else{if(t<=-ft)return D;if(t+1>=ft)return Ct}return t<0?_(-t,e).neg():S(t%Z|0,t/Z|0,e)}w.fromNumber=_;function S(t,e,n){return new w(t,e,n)}w.fromBits=S;var ue=Math.pow;function De(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return F;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return De(t.substring(1),e,n).neg();for(var o=_(ue(n,8)),s=F,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),u=parseInt(t.substring(i,i+a),n);if(a<8){var f=_(ue(n,a));s=s.mul(f).add(_(u))}else s=s.mul(o),s=s.add(_(u))}return s.unsigned=e,s}w.fromString=De;function O(t,e){return typeof t=="number"?_(t,e):typeof t=="string"?De(t,e):S(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}w.fromValue=O;var gt=65536,Sn=1<<24,Z=gt*gt,ht=Z*Z,ft=ht/2,dt=P(Sn),F=P(0);w.ZERO=F;var q=P(0,!0);w.UZERO=q;var $=P(1);w.ONE=$;var yt=P(1,!0);w.UONE=yt;var Te=P(-1);w.NEG_ONE=Te;var Ct=S(-1,2147483647,!1);w.MAX_VALUE=Ct;var wt=S(-1,-1,!0);w.MAX_UNSIGNED_VALUE=wt;var D=S(0,-2147483648,!1);w.MIN_VALUE=D;var c=w.prototype;c.toInt=function(){return this.unsigned?this.low>>>0:this.low};c.toNumber=function(){return this.unsigned?(this.high>>>0)*Z+(this.low>>>0):this.high*Z+(this.low>>>0)};c.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(D)){var n=_(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=_(ue(e,6),this.unsigned),i=this,a="";;){var u=i.div(s),f=i.sub(u.mul(s)).toInt()>>>0,d=f.toString(e);if(i=u,i.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}};c.getHighBits=function(){return this.high};c.getHighBitsUnsigned=function(){return this.high>>>0};c.getLowBits=function(){return this.low};c.getLowBitsUnsigned=function(){return this.low>>>0};c.getNumBitsAbs=function(){if(this.isNegative())return this.eq(D)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,n=31;n>0&&!(e&1<<n);n--);return this.high!=0?n+33:n+1};c.isZero=function(){return this.high===0&&this.low===0};c.eqz=c.isZero;c.isNegative=function(){return!this.unsigned&&this.high<0};c.isPositive=function(){return this.unsigned||this.high>=0};c.isOdd=function(){return(this.low&1)===1};c.isEven=function(){return(this.low&1)===0};c.equals=function(e){return j(e)||(e=O(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};c.eq=c.equals;c.notEquals=function(e){return!this.eq(e)};c.neq=c.notEquals;c.ne=c.notEquals;c.lessThan=function(e){return this.comp(e)<0};c.lt=c.lessThan;c.lessThanOrEqual=function(e){return this.comp(e)<=0};c.lte=c.lessThanOrEqual;c.le=c.lessThanOrEqual;c.greaterThan=function(e){return this.comp(e)>0};c.gt=c.greaterThan;c.greaterThanOrEqual=function(e){return this.comp(e)>=0};c.gte=c.greaterThanOrEqual;c.ge=c.greaterThanOrEqual;c.compare=function(e){if(j(e)||(e=O(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};c.comp=c.compare;c.negate=function(){return!this.unsigned&&this.eq(D)?D:this.not().add($)};c.neg=c.negate;c.add=function(e){j(e)||(e=O(e));var n=this.high>>>16,r=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,u=e.low>>>16,f=e.low&65535,d=0,A=0,C=0,E=0;return E+=s+f,C+=E>>>16,E&=65535,C+=o+u,A+=C>>>16,C&=65535,A+=r+a,d+=A>>>16,A&=65535,d+=n+i,d&=65535,S(C<<16|E,d<<16|A,this.unsigned)};c.subtract=function(e){return j(e)||(e=O(e)),this.add(e.neg())};c.sub=c.subtract;c.multiply=function(e){if(this.isZero())return F;if(j(e)||(e=O(e)),v){var n=v.mul(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(e.isZero())return F;if(this.eq(D))return e.isOdd()?D:F;if(e.eq(D))return this.isOdd()?D:F;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(dt)&&e.lt(dt))return _(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,u=e.high&65535,f=e.low>>>16,d=e.low&65535,A=0,C=0,E=0,k=0;return k+=i*d,E+=k>>>16,k&=65535,E+=s*d,C+=E>>>16,E&=65535,E+=i*f,C+=E>>>16,E&=65535,C+=o*d,A+=C>>>16,C&=65535,C+=s*f,A+=C>>>16,C&=65535,C+=i*u,A+=C>>>16,C&=65535,A+=r*d+o*f+s*u+i*a,A&=65535,S(E<<16|k,A<<16|C,this.unsigned)};c.mul=c.multiply;c.divide=function(e){if(j(e)||(e=O(e)),e.isZero())throw Error("division by zero");if(v){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?v.div_u:v.div_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?q:F;var r,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return q;if(e.gt(this.shru(1)))return yt;s=q}else{if(this.eq(D)){if(e.eq($)||e.eq(Te))return D;if(e.eq(D))return $;var i=this.shr(1);return r=i.div(e).shl(1),r.eq(F)?e.isNegative()?$:Te:(o=this.sub(e.mul(r)),s=r.add(o.div(e)),s)}else if(e.eq(D))return this.unsigned?q:F;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=F}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:ue(2,a-48),f=_(r),d=f.mul(e);d.isNegative()||d.gt(o);)r-=u,f=_(r,this.unsigned),d=f.mul(e);f.isZero()&&(f=$),s=s.add(f),o=o.sub(d)}return s};c.div=c.divide;c.modulo=function(e){if(j(e)||(e=O(e)),v){var n=(this.unsigned?v.rem_u:v.rem_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};c.mod=c.modulo;c.rem=c.modulo;c.not=function(){return S(~this.low,~this.high,this.unsigned)};c.and=function(e){return j(e)||(e=O(e)),S(this.low&e.low,this.high&e.high,this.unsigned)};c.or=function(e){return j(e)||(e=O(e)),S(this.low|e.low,this.high|e.high,this.unsigned)};c.xor=function(e){return j(e)||(e=O(e)),S(this.low^e.low,this.high^e.high,this.unsigned)};c.shiftLeft=function(e){return j(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):S(0,this.low<<e-32,this.unsigned)};c.shl=c.shiftLeft;c.shiftRight=function(e){return j(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):S(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};c.shr=c.shiftRight;c.shiftRightUnsigned=function(e){if(j(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return S(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?S(n,0,this.unsigned):S(n>>>e-32,0,this.unsigned)};c.shru=c.shiftRightUnsigned;c.shr_u=c.shiftRightUnsigned;c.toSigned=function(){return this.unsigned?S(this.low,this.high,!1):this};c.toUnsigned=function(){return this.unsigned?this:S(this.low,this.high,!0)};c.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};c.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};c.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};w.fromBytes=function(e,n,r){return r?w.fromBytesLE(e,n):w.fromBytesBE(e,n)};w.fromBytesLE=function(e,n){return new w(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)};w.fromBytesBE=function(e,n){return new w(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}});var ho={};dn(ho,{GrazEvents:()=>et,GrazProvider:()=>fo,WALLET_TYPES:()=>xe,WalletType:()=>Se,checkWallet:()=>z,clearRecentChain:()=>ve,configureGraz:()=>Oe,connect:()=>X,createClients:()=>oe,createQueryClient:()=>Ee,createSigningClients:()=>re,defineChain:()=>Pn,defineChainInfo:()=>Gn,defineChains:()=>Ye,disconnect:()=>ge,executeContract:()=>Ue,getActiveChainCurrency:()=>_e,getAvailableWallets:()=>xn,getBalanceStaked:()=>Be,getBalances:()=>ke,getCosmostation:()=>me,getKeplr:()=>le,getLeap:()=>pe,getQueryRaw:()=>qe,getQuerySmart:()=>Me,getRecentChain:()=>An,getWCCosmostation:()=>_t,getWCKeplr:()=>jt,getWCLeap:()=>vt,getWallet:()=>Y,getWalletConnect:()=>K,instantiateContract:()=>Re,mainnetChains:()=>Ln,mainnetChainsArray:()=>zn,reconnect:()=>B,sendIbcTokens:()=>We,sendTokens:()=>Ne,suggestChain:()=>fe,suggestChainAndConnect:()=>Fe,testnetChains:()=>Kn,testnetChainsArray:()=>Qn,useAccount:()=>W,useActiveChain:()=>Xn,useActiveChainCurrency:()=>Jn,useActiveChainValidators:()=>eo,useBalance:()=>Hn,useBalanceStaked:()=>Yn,useBalances:()=>tn,useCheckWallet:()=>se,useClients:()=>ro,useConnect:()=>Vn,useDisconnect:()=>$n,useExecuteContract:()=>lo,useGrazEvents:()=>sn,useInstantiateContract:()=>uo,useOfflineSigners:()=>nn,useQueryClient:()=>io,useQueryRaw:()=>mo,useQuerySmart:()=>po,useRecentChain:()=>to,useSendIbcTokens:()=>ao,useSendTokens:()=>co,useSigners:()=>Zn,useSigningClients:()=>so,useSuggestChain:()=>no,useSuggestChainAndConnect:()=>oo});module.exports=hn(ho);var Ft=require("@cosmjs/stargate");var M="graz-reconnect-session";var Ae=require("zustand"),at=require("zustand/middleware"),H=require("zustand/middleware");var Se=(a=>(a.KEPLR="keplr",a.LEAP="leap",a.COSMOSTATION="cosmostation",a.WALLETCONNECT="walletconnect",a.WC_KEPLR_MOBILE="wc_keplr_mobile",a.WC_LEAP_MOBILE="wc_leap_mobile",a.WC_COSMOSTATION_MOBILE="wc_cosmostation_mobile",a))(Se||{}),xe=["keplr","leap","cosmostation","walletconnect","wc_keplr_mobile","wc_leap_mobile","wc_cosmostation_mobile"];var yn={recentChain:null,defaultChain:null,defaultSigningClient:"stargate",walletType:"keplr",walletConnect:{options:null,web3Modal:null},_notFoundFn:()=>null,_onReconnectFailed:()=>null,_reconnect:!1,_reconnectConnector:null},ne={account:null,activeChain:null,balances:null,clients:null,offlineSigner:null,offlineSignerAmino:null,offlineSignerAuto:null,signingClients:null,status:"disconnected",wcSignClient:null},Cn={name:"graz-session",version:1,partialize:t=>({account:t.account,activeChain:t.activeChain}),storage:(0,at.createJSONStorage)(()=>sessionStorage)},wn={name:"graz-internal",partialize:t=>({recentChain:t.recentChain,_reconnect:t._reconnect,_reconnectConnector:t._reconnectConnector}),version:1},m=(0,Ae.create)((0,H.subscribeWithSelector)((0,H.persist)(()=>ne,Cn))),y=(0,Ae.create)((0,H.subscribeWithSelector)((0,H.persist)(()=>yn,wn)));var be=require("@cosmjs/cosmwasm-stargate"),Ie=require("@cosmjs/stargate"),lt=require("@cosmjs/tendermint-rpc");var ut=require("@cosmjs/stargate"),V=require("@cosmjs/utils");var Ee=(...t)=>{let{tendermint:e}=m.getState().clients,n=new ut.QueryClient(e),r=t.map(o=>o(n));for(let o of r){(0,V.assert)((0,V.isNonNullObject)(o),"Extension must be a non-null object");for(let[s,i]of Object.entries(o)){(0,V.assert)((0,V.isNonNullObject)(i),`Module must be a non-null object. Found type ${typeof i} for module "${s}".`);let a=n[s]||{};n[s]={...a,...i}}}return n};var oe=async({rpc:t,rpcHeaders:e})=>{let n={url:t,headers:{...e||{}}},[r,o,s]=await Promise.all([be.SigningCosmWasmClient.connect(n),Ie.SigningStargateClient.connect(n),lt.Tendermint34Client.connect(t)]);return{cosmWasm:r,stargate:o,tendermint:s}},re=async t=>{let{rpc:e,rpcHeaders:n,offlineSignerAuto:r,cosmWasmSignerOptions:o={},stargateSignerOptions:s={}}=t,i={url:e,headers:{...n||{}}},[a,u]=await Promise.all([be.SigningCosmWasmClient.connectWithSigner(i,r,o),Ie.SigningStargateClient.connectWithSigner(i,r,s)]);return{cosmWasm:a,stargate:u}};var bt=require("@cosmjs/encoding"),It=require("@walletconnect/sign-client"),Tt=require("@walletconnect/utils"),Dt=ct(xt());var G=()=>typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1,At=()=>G()&&navigator.userAgent.toLowerCase().includes("android"),Et=()=>G()&&(navigator.userAgent.toLowerCase().includes("iphone")||navigator.userAgent.toLowerCase().includes("ipad"));var je=(t,e,n=new Error("Promise timed out"))=>{let r=new Promise((o,s)=>{setTimeout(()=>{s(n)},e)});return Promise.race([t,r])};var z=(t=y.getState().walletType)=>{try{return Y(t),!0}catch{return!1}},L=()=>{window.sessionStorage.removeItem(M),m.setState(ne)},le=()=>{if(typeof window.keplr<"u"){let t=window.keplr;return Object.assign(t,{subscription:r=>(window.addEventListener("keplr_keystorechange",()=>{L(),r()}),()=>{window.removeEventListener("keplr_keystorechange",()=>{L(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.keplr is not defined")},pe=()=>{if(typeof window.leap<"u"){let t=window.leap;return Object.assign(t,{subscription:r=>(window.addEventListener("leap_keystorechange",()=>{L(),r()}),()=>{window.removeEventListener("leap_keystorechange",()=>{L(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.leap is not defined")},me=()=>{if(typeof window.cosmostation.providers.keplr<"u"){let t=window.cosmostation.providers.keplr;return Object.assign(t,{subscription:r=>(window.cosmostation.cosmos.on("accountChanged",()=>{L(),r()}),()=>{window.cosmostation.cosmos.off("accountChanged",()=>{L(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.cosmostation.providers.keplr is not defined")},K=t=>{var nt,ot,rt;if(!((rt=(ot=(nt=y.getState().walletConnect)==null?void 0:nt.options)==null?void 0:ot.projectId)!=null&&rt.trim()))throw new Error("walletConnect.options.projectId is not defined");let e=(t==null?void 0:t.encoding)||"base64",n=p=>{if(!t)return;let{appUrl:l,formatNativeUrl:g}=t;if(G()){if(At())if(!p)window.open(l.mobile.android,"_self","noreferrer noopener");else{let h=g(l.mobile.android,p,"android");window.open(h,"_self","noreferrer noopener")}if(Et())if(!p)window.open(l.mobile.ios,"_self","noreferrer noopener");else{let h=g(l.mobile.ios,p,"ios");window.open(h,"_self","noreferrer noopener")}}},r=()=>{let{wcSignClient:p}=m.getState();if(!p)throw new Error("walletConnect.signClient is not defined");L(),y.setState({_reconnect:!1,_reconnectConnector:null,recentChain:null})},o=async p=>{let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");if(!p)throw new Error("No wallet connect session");await l.disconnect({topic:p,reason:(0,Tt.getSdkError)("USER_DISCONNECTED")}),await a(l),r()},s=p=>{var l,g;try{let{wcSignClient:h}=m.getState();if(!h)throw new Error("walletConnect.signClient is not defined");let x=h.session.getAll().at(-1);if(!x)return;let b=(g=(l=h.session.getAll().at(-1))==null?void 0:l.namespaces.cosmos)==null?void 0:g.accounts.find(I=>I.startsWith(`cosmos:${p}`));if(!(x.expiry*1e3>Date.now()+1e3))throw o(x.topic),new Error("invalid session");if(!b)try{let I=h.find({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!I.length)throw new Error("no session");return I.at(-1)}catch(I){if(!I.message.toLowerCase().includes("no matching key"))throw I}return x}catch(h){if(!h.message.toLowerCase().includes("no matching key"))throw h}},i=p=>{try{return s(p)}catch{return}},a=async p=>{try{let l=p.core.pairing.pairings.getAll({active:!1});if(!l.length)return;await Promise.all(l.map(async g=>{await p.core.pairing.pairings.delete(g.topic,{code:7001,message:"clear pairing"})}))}catch(l){if(!l.message.toLowerCase().includes("no matching key"))throw l}},u=async()=>{let{walletConnect:p}=y.getState();if(!(p!=null&&p.options))throw new Error("walletConnect.options is not defined");let{wcSignClient:l}=m.getState();if(l)return m.setState({wcSignClient:l}),l;let g=await It.SignClient.init(p.options);return m.setState({wcSignClient:g}),g},f=p=>{let{wcSignClient:l}=m.getState();if(l)return l.events.on("session_delete",g=>{r()}),l.events.on("session_expire",g=>{r()}),l.events.on("session_event",g=>{var h,x;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((x=m.getState().account)==null?void 0:x.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()}),()=>{l.events.off("session_delete",g=>{r()}),l.events.off("session_expire",g=>{r()}),l.events.off("session_event",g=>{var h,x;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((x=m.getState().account)==null?void 0:x.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()})}},d=async p=>{var ie;let{wcSignClient:l}=m.getState();if(!l)throw new Error("enable walletConnect.signClient is not defined");let{walletConnect:g}=y.getState();if(!((ie=g==null?void 0:g.options)!=null&&ie.projectId))throw new Error("walletConnect.options.projectId is not defined");let{Web3Modal:h}=await import("@web3modal/standalone"),x=new h({projectId:g.options.projectId,walletConnectVersion:2,enableExplorer:!1,explorerRecommendedWalletIds:"NONE",...g.web3Modal}),{account:b,activeChain:N}=m.getState(),I=i(p);if((N==null?void 0:N.chainId)!==p&&!I||!b){let{uri:T,approval:ce}=await l.connect({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!T)throw new Error("No wallet connect uri");t?n(T):await x.openModal({uri:T});try{await je((async()=>{await ce()})(),4e4,new Error("Modal approval timeout"))}catch(st){if(x.closeModal(),!st.message.toLowerCase().includes("no matching key"))return Promise.reject(st)}return t||x.closeModal(),Promise.resolve()}try{await je((async()=>{let T=await C(p);m.setState({account:T})})(),1e4,new Error("Connection timeout"))}catch(T){if(o(I==null?void 0:I.topic),!T.message.toLowerCase().includes("no matching key"))throw T}},A=async p=>{var x;let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");let g=(x=s(p))==null?void 0:x.topic;if(!g)throw new Error("No wallet connect session");n();let h=await l.request({topic:g,chainId:`cosmos:${p}`,request:{method:"cosmos_getAccounts",params:{}}});if(!h[0])throw new Error("No wallet connect account");return{address:h[0].address,algo:h[0].algo,pubkey:new Uint8Array(Buffer.from(h[0].pubkey,e))}},C=async p=>{let{address:l,algo:g,pubkey:h}=await A(p);return{address:(0,bt.fromBech32)(l).data,algo:g,bech32Address:l,name:"",pubKey:h,isKeystone:!1,isNanoLedger:!1}},E=async(...p)=>{var T,ce;let[l,g,h]=p,{account:x,wcSignClient:b}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!x)throw new Error("account is not defined");let N=(T=s(l))==null?void 0:T.topic;if(!N)throw new Error("No wallet connect session");if(!h.bodyBytes)throw new Error("No bodyBytes");if(!h.authInfoBytes)throw new Error("No authInfoBytes");let I={topic:N,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:{...h,bodyBytes:Buffer.from(h.bodyBytes).toString(e),authInfoBytes:Buffer.from(h.authInfoBytes).toString(e),accountNumber:(ce=h.accountNumber)==null?void 0:ce.toString()}}}};return n(),await b.request(I)},k=async(...p)=>{let[l,g,h]=p,{signature:x,signed:b}=await E(l,g,h);return{signed:{chainId:b.chainId,accountNumber:Dt.default.fromString(b.accountNumber,!1),authInfoBytes:new Uint8Array(Buffer.from(b.authInfoBytes,e)),bodyBytes:new Uint8Array(Buffer.from(b.bodyBytes,e))},signature:x}},Ce=async(...p)=>{var T;let[l,g,h,x]=p,{wcSignClient:b}=m.getState(),{account:N}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!N)throw new Error("account is not defined");let I=(T=s(l))==null?void 0:T.topic;if(!I)throw new Error("No wallet connect session");return n(),await b.request({topic:I,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:h}}})},te=async(...p)=>{let[l,g,h,x]=p;return await Ce(l,g,h)},we=p=>({getAccounts:async()=>[await A(p)],signDirect:(l,g)=>k(p,l,g)}),U=p=>({getAccounts:async()=>[await A(p)],signAmino:(l,g)=>te(p,l,g)});return{enable:d,experimentalSuggestChain:async(...p)=>{await Promise.reject(new Error("WalletConnect does not support experimentalSuggestChain"))},getKey:C,getOfflineSigner:p=>({getAccounts:async()=>[await A(p)],signDirect:(l,g)=>k(p,l,g),signAmino:(l,g)=>te(p,l,g)}),getOfflineSignerAuto:async p=>(await C(p)).isNanoLedger?U(p):we(p),getOfflineSignerOnlyAmino:U,signAmino:te,signDirect:k,subscription:f,init:u}},jt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!G())throw new Error("WalletConnect Keplr mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"keplrwallet://",android:"intent://"}},walletType:"wc_keplr_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return K(t)},vt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!G())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"leapcosmos://",android:"intent://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return K(t)},_t=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!G())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"hex",appUrl:{mobile:{ios:"cosmostation://",android:"cosmostation://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>`${o.replaceAll("/","").replaceAll(":","")}://wc?${s}`};return K(t)},Y=(t=y.getState().walletType)=>{switch(t){case"keplr":return le();case"leap":return pe();case"cosmostation":return me();case"walletconnect":return K();case"wc_keplr_mobile":return jt();case"wc_leap_mobile":return vt();case"wc_cosmostation_mobile":return _t();default:throw new Error("Unknown wallet type")}},xn=()=>Object.fromEntries(xe.map(t=>[t,z(t)]));var X=async t=>{var e;try{let{defaultChain:n,recentChain:r,walletType:o}=y.getState(),s=(t==null?void 0:t.walletType)||o;if(!z(s))throw new Error(`${s} is not available`);let a=Y(s),u=(t==null?void 0:t.chain)||r||n;if(!u)throw new Error("No last known connected chain, connect action requires chain info");m.setState(U=>{let tt=y.getState()._reconnect||!!y.getState()._reconnectConnector||!!u;return U.activeChain&&U.activeChain.chainId!==u.chainId?{status:"connecting"}:tt?{status:"reconnecting"}:{status:"connecting"}});let{account:f,activeChain:d}=m.getState();if(await((e=a.init)==null?void 0:e.call(a)),!f||(d==null?void 0:d.chainId)!==u.chainId){await a.enable(u.chainId);let U=await a.getKey(u.chainId);m.setState({account:U})}let A=a.getOfflineSigner(u.chainId),C=a.getOfflineSignerOnlyAmino(u.chainId),E=await a.getOfflineSignerAuto(u.chainId),k=u.gas?Ft.GasPrice.fromString(`${u.gas.price}${u.gas.denom}`):void 0,[Ce,te]=await Promise.all([oe(u),re({...u,offlineSignerAuto:E,cosmWasmSignerOptions:{gasPrice:k,...(t==null?void 0:t.signerOpts)||{}}})]);y.setState({recentChain:u,walletType:s,_reconnect:!!(t!=null&&t.autoReconnect),_reconnectConnector:s}),m.setState({activeChain:u,clients:Ce,offlineSigner:A,offlineSignerAmino:C,offlineSignerAuto:E,signingClients:te,status:"connected"}),typeof window<"u"&&window.sessionStorage.setItem(M,"Active");let{account:we}=m.getState();return{account:we,walletType:s,chain:u}}catch(n){throw console.error("connect ",n),m.getState().account===null&&m.setState({status:"disconnected"}),m.getState().account&&m.getState().activeChain&&m.setState({status:"connected"}),n}},ge=async(t=!1)=>(typeof window<"u"&&window.sessionStorage.removeItem(M),m.setState(ne),y.setState(e=>({_reconnect:!1,_reconnectConnector:null,recentChain:t?null:e.recentChain})),Promise.resolve()),B=async t=>{var o;let{recentChain:e,_reconnectConnector:n,_reconnect:r}=y.getState();try{let s=z(n||void 0);if(e&&s&&n)return await X({chain:e,walletType:n,autoReconnect:r})}catch(s){(o=t==null?void 0:t.onError)==null||o.call(t,s),ge()}};var ve=()=>{y.setState({recentChain:null})},_e=t=>{let{activeChain:e}=m.getState();return e==null?void 0:e.currencies.find(n=>n.coinMinimalDenom===t)},An=()=>y.getState().recentChain,fe=async t=>(await Y().experimentalSuggestChain(t),t),Fe=async({chainInfo:t,rpcHeaders:e,gas:n,path:r,...o})=>{let s=await fe(t);return{...await X({chain:{chainId:t.chainId,currencies:t.currencies,rest:t.rest,rpc:t.rpc,rpcHeaders:e,gas:n,path:r},...o}),chain:s}};var Oe=(t={})=>(y.setState(e=>({defaultChain:t.defaultChain||e.defaultChain,defaultSigningClient:t.defaultSigningClient||e.defaultSigningClient,walletConnect:t.walletConnect||e.walletConnect,walletType:t.defaultWallet||e.walletType,_notFoundFn:t.onNotFound||e._notFoundFn,_onReconnectFailed:t.onReconnectFailed||e._onReconnectFailed,_reconnect:t.autoReconnect===void 0?!0:t.autoReconnect||e._reconnect})),t);var ke=async t=>{let{activeChain:e,signingClients:n}=m.getState();if(!e||!n)throw new Error("No connected account detected");let{defaultSigningClient:r}=y.getState();return await Promise.all(e.currencies.map(async s=>{let i=s.coinMinimalDenom.startsWith("cw20:");return n[r].getBalance(t,i?s.coinMinimalDenom.replace("cw20:",""):s.coinMinimalDenom)}))},Be=async t=>{let{clients:e}=m.getState();if(!(e!=null&&e.stargate))throw new Error("Stargate client is not ready");return e.stargate.getBalanceStaked(t)},Ne=async({senderAddress:t,recipientAddress:e,amount:n,fee:r,memo:o})=>{let{defaultSigningClient:s}=y.getState(),{signingClients:i}=m.getState();if(!i)throw new Error("No connected account detected");if(!t)throw new Error("senderAddress is not defined");return i[s].sendTokens(t,e,n,r,o)},We=async({senderAddress:t,recipientAddress:e,transferAmount:n,sourcePort:r,sourceChannel:o,timeoutHeight:s,timeoutTimestamp:i,fee:a,memo:u})=>{let{signingClients:f}=m.getState();if(!(f!=null&&f.stargate))throw new Error("Stargate signing client is not ready");if(!t)throw new Error("senderAddress is not defined");return f.stargate.sendIbcTokens(t,e,n,r,o,s,i,a,u)},Re=async({senderAddress:t,msg:e,fee:n,options:r,label:o,codeId:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.instantiate(t,s,e,o,n,r)},Ue=async({senderAddress:t,msg:e,fee:n,contractAddress:r,funds:o,memo:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.execute(t,r,e,n,s,o)},Me=async(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");return await n.cosmWasm.queryContractSmart(t,e)},qe=(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");let r=new TextEncoder().encode(e);return n.cosmWasm.queryContractRaw(t,r)};var kt=require("@keplr-wallet/cosmos"),Bt={coinDenom:"axl",coinMinimalDenom:"uaxl",coinDecimals:6,coinGeckoId:"axelar-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png"},En={coinDenom:"usdc",coinMinimalDenom:"uusdc",coinDecimals:6,coinGeckoId:"usd-coin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdc.png"},bn={coinDenom:"dai",coinMinimalDenom:"dai-wei",coinDecimals:18,coinGeckoId:"dai",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/dai.png"},In={coinDenom:"usdt",coinMinimalDenom:"uusdt",coinDecimals:6,coinGeckoId:"tether",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdt.png"},Tn={coinDenom:"weth-wei",coinMinimalDenom:"weth",coinDecimals:18,coinGeckoId:"weth",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png"},Dn={coinDenom:"wbtc-satoshi",coinMinimalDenom:"wbtc",coinDecimals:8,coinGeckoId:"wrapped-bitcoin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/wbtc.png"},Ot=[Bt,En,bn,In,Tn,Dn],Pe={rpc:"https://rpc.axelar.strange.love",rest:"https://api.axelar.strange.love",chainId:"axelar-dojo-1",chainName:"Axelar",stakeCurrency:Bt,bip44:{coinType:118},bech32Config:kt.Bech32Address.defaultBech32Config("axelar"),currencies:Ot,feeCurrencies:Ot};var Wt=require("@keplr-wallet/cosmos"),Rt={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Nt=[Rt],Ge={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:Rt,bip44:{coinType:118},bech32Config:Wt.Bech32Address.defaultBech32Config("cosmos"),currencies:Nt,feeCurrencies:Nt};var Mt=require("@keplr-wallet/cosmos"),qt={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},jn={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},vn={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},_n={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},Fn={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},On={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},kn={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},Bn={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},Nn={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},Wn={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},Rn={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},Ut=[qt,jn,vn,_n,Fn,On,kn,Bn,Nn,Wn,Rn],Le={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:qt,bip44:{coinType:118},bech32Config:Mt.Bech32Address.defaultBech32Config("juno"),currencies:Ut,feeCurrencies:Ut};var Gt=require("@keplr-wallet/cosmos"),Lt={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Un={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},Pt=[Lt,Un],ze={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:Lt,bip44:{coinType:118},bech32Config:Gt.Bech32Address.defaultBech32Config("osmo"),currencies:Pt,feeCurrencies:Pt};var Kt=require("@keplr-wallet/cosmos"),Qt={coinDenom:"somm",coinMinimalDenom:"usomm",coinDecimals:6,coinGeckoId:"sommelier",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/sommelier/images/somm.png"},zt=[Qt],Ke={rpc:"https://rpc.sommelier.strange.love",rest:"https://api.sommelier.strange.love",chainId:"sommelier-3",chainName:"Sommelier",stakeCurrency:Qt,bip44:{coinType:118},bech32Config:Kt.Bech32Address.defaultBech32Config("somm"),currencies:zt,feeCurrencies:zt};var Vt=require("@keplr-wallet/cosmos"),$t={coinDenom:"CRE",coinMinimalDenom:"ucre",coinDecimals:6,coinGeckoId:"crescent",coinImageUrl:"https://raw.githubusercontent.com/crescent-network/asset/main/images/coin/CRE.png"},Ht=[$t],Qe={rpc:"https://testnet-endpoint.crescent.network/rpc/crescent",rest:"https://testnet-endpoint.crescent.network/api/crescent",chainId:"mooncat-1-1",chainName:"Crescent Testnet",bip44:{coinType:118},bech32Config:Vt.Bech32Address.defaultBech32Config("CRE"),currencies:Ht,feeCurrencies:Ht,stakeCurrency:$t,coinType:118};var Zt=require("@keplr-wallet/cosmos"),He={coinDenom:"junox",coinMinimalDenom:"ujunox",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},Mn=[He],Ve={rpc:"https://rpc.uni.junonetwork.io",rest:"https://api.uni.junonetwork.io",chainId:"uni-5",chainName:"Juno Testnet",stakeCurrency:He,bip44:{coinType:118},bech32Config:Zt.Bech32Address.defaultBech32Config("juno"),currencies:Mn,feeCurrencies:[He],coinType:118};var Yt=require("@keplr-wallet/cosmos"),$e={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://dhj8dql1kzq2v.cloudfront.net/white/osmo.png"},qn=[$e],Ze={rpc:"https://testnet-rpc.osmosis.zone",rest:"https://testnet-rest.osmosis.zone",chainId:"osmo-test-4",chainName:"Osmosis Testnet",stakeCurrency:$e,bip44:{coinType:118},bech32Config:Yt.Bech32Address.defaultBech32Config("osmo"),currencies:qn,feeCurrencies:[$e],coinType:118};var Ye=t=>t,Pn=t=>t,Gn=t=>t,Ln=Ye({axelar:Pe,cosmoshub:Ge,juno:Le,osmosis:ze,sommelier:Ke}),zn=[Pe,Ge,Le,ze,Ke],Kn=Ye({crescent:Qe,juno:Ve,osmosis:Ze}),Qn=[Qe,Ve,Ze];var Q=require("@tanstack/react-query"),Jt=require("react"),en=require("zustand/shallow");var Xt=require("@tanstack/react-query");var se=t=>{let n=["USE_CHECK_WALLET",y(o=>t||o.walletType)];return(0,Xt.useQuery)(n,({queryKey:[,o]})=>z(o))};var W=({onConnect:t,onDisconnect:e}={})=>{let n=m(o=>o.account),r=m(o=>o.status);return(0,Jt.useEffect)(()=>m.subscribe(o=>o.status,(o,s)=>{if(o==="connected"){let{account:i,activeChain:a}=m.getState(),{walletType:u}=y.getState();t==null||t({account:i,chain:a,walletType:u,isReconnect:s==="reconnecting"})}o==="disconnected"&&(e==null||e())}),[t,e]),{data:n,isConnected:!!n,isConnecting:r==="connecting",isDisconnected:r==="disconnected",isReconnecting:r==="reconnecting",isLoading:r==="connecting"||r==="reconnecting",reconnect:B,status:r}},tn=t=>{let{data:e}=W(),n=t||(e==null?void 0:e.bech32Address);return(0,Q.useQuery)(["USE_BALANCES",n],({queryKey:[,s]})=>ke(s),{enabled:!!n,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!1})},Hn=(t,e)=>{let{data:n}=tn(e);return(0,Q.useQuery)(["USE_BALANCE",n,t,e],({queryKey:[,s]})=>s==null?void 0:s.find(i=>i.denom===t),{enabled:!!n})},Vn=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,Q.useMutation)(["USE_CONNECT",t,e,n],X,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:e,onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=se();return{connect:i=>o.mutate(i),connectAsync:i=>o.mutateAsync(i),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status}},$n=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,Q.useMutation)(["USE_DISCONNECT",t,e,n],ge,{onError:s=>Promise.resolve(t==null?void 0:t(s,void 0)),onMutate:e,onSuccess:()=>Promise.resolve(n==null?void 0:n(void 0))});return{disconnect:s=>o.mutate(s),disconnectAsync:s=>o.mutateAsync(s),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,status:o.status}},nn=()=>m(t=>({signer:t.offlineSigner,signerAmino:t.offlineSignerAmino,signerAuto:t.offlineSignerAuto}),en.shallow),Zn=()=>nn(),Yn=t=>{let{data:e}=W(),n=t||(e==null?void 0:e.bech32Address);return(0,Q.useQuery)(["USE_BALANCE_STAKED",n],({queryKey:[,s]})=>Be(n),{enabled:!!n})};var J=require("@tanstack/react-query");var Xn=()=>m(t=>t.activeChain),Jn=t=>(0,J.useQuery)(["USE_ACTIVE_CHAIN_CURRENCY",t],({queryKey:[,r]})=>_e(r)),eo=(t,e="BOND_STATUS_BONDED")=>(0,J.useQuery)(["USE_ACTIVE_CHAIN_VALIDATORS",t,e],({queryKey:[,o,s]})=>o.staking.validators(s),{enabled:typeof t<"u"}),to=()=>({data:y(e=>e.recentChain),clear:ve}),no=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,J.useMutation)(["USE_SUGGEST_CHAIN",t,e,n],fe,{onError:(s,i)=>Promise.resolve(t==null?void 0:t(s,i)),onMutate:e,onSuccess:s=>Promise.resolve(n==null?void 0:n(s))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,suggest:o.mutate,suggestAsync:o.mutateAsync,status:o.status}},oo=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,J.useMutation)(["USE_SUGGEST_CHAIN_AND_CONNECT",t,e,n],Fe,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:i=>e==null?void 0:e(i),onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=se();return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status,suggestAndConnect:o.mutate,suggestAndConnectAsync:o.mutateAsync}};var Xe=require("@tanstack/react-query");var ro=t=>{let e=m(o=>o.clients);return(0,Xe.useQuery)(["USE_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?oe(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({clients:o})},initialData:e})},so=t=>{let e=m(o=>o.signingClients);return(0,Xe.useQuery)(["USE_SIGNING_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?re(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({signingClients:o})},initialData:e})};var on=require("@tanstack/react-query");var io=(...t)=>{let e=["USE_QUERY_CLIENT",...t];return(0,on.useQuery)(e,({queryKey:[,...r]})=>Ee(...t),{refetchOnMount:!1,refetchOnWindowFocus:!1})};var R=require("@tanstack/react-query");var co=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=W(),o=r==null?void 0:r.bech32Address,i=(0,R.useMutation)(["USE_SEND_TOKENS",t,e,n,o],a=>Ne({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendTokens:i.mutate,sendTokensAsync:i.mutateAsync,status:i.status}},ao=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=W(),o=r==null?void 0:r.bech32Address,i=(0,R.useMutation)(["USE_SEND_IBC_TOKENS",t,e,n,o],a=>We({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendIbcTokens:i.mutate,sendIbcTokensAsync:i.mutateAsync,status:i.status}},uo=({codeId:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=W(),s=o==null?void 0:o.bech32Address,u=(0,R.useMutation)(["USE_INSTANTIATE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,codeId:t};return Re(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,instantiateContract:u.mutate,instantiateContractAsync:u.mutateAsync,status:u.status}},lo=({contractAddress:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=W(),s=o==null?void 0:o.bech32Address,u=(0,R.useMutation)(["USE_EXECUTE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,contractAddress:t,memo:f.memo??"",funds:f.funds??[]};return Ue(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,executeContract:u.mutate,executeContractAsync:u.mutateAsync,status:u.status}},po=(t,e)=>(0,R.useQuery)(["USE_QUERY_SMART",t,e],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or queryMsg undefined");return Me(t,e)},{enabled:!!t&&!!e}),mo=(t,e)=>(0,R.useQuery)(["USE_QUERY_RAW",e,t],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or key undefined");return qe(t,e)},{enabled:!!t&&!!e});var ye=require("@tanstack/react-query"),cn=require("@tanstack/react-query-devtools");var de=require("react"),he=require("react/jsx-runtime"),rn=({children:t})=>{let[e,n]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{n(!0)},[]),(0,he.jsx)(he.Fragment,{children:e?t:null})};var Je=require("react");var sn=()=>{let t=typeof window<"u"&&window.sessionStorage.getItem(M)==="Active",{_reconnect:e,_onReconnectFailed:n,_reconnectConnector:r}=y(),{activeChain:o,wcSignClient:s}=m();return(0,Je.useEffect)(()=>{r&&(t&&o?B({onError:n}):!t&&e&&B({onError:n}))},[]),(0,Je.useEffect)(()=>{var i,a,u,f,d,A,C,E;r&&(r==="cosmostation"&&((a=(i=me()).subscription)==null||a.call(i,()=>{B({onError:n})})),r==="keplr"&&((f=(u=le()).subscription)==null||f.call(u,()=>{B({onError:n})})),r==="leap"&&((A=(d=pe()).subscription)==null||A.call(d,()=>{B({onError:n})})),r==="walletconnect"&&s&&((E=(C=K()).subscription)==null||E.call(C,()=>{B({onError:n})})))},[r,s]),null},et=()=>(sn(),null);var ee=require("react/jsx-runtime"),go=new ye.QueryClient({}),fo=({children:t,grazOptions:e,debug:n,...r})=>(e&&Oe(e),(0,ee.jsxs)(ye.QueryClientProvider,{client:go,...r,children:[(0,ee.jsxs)(rn,{children:[(0,ee.jsx)(et,{}),t]}),n?(0,ee.jsx)(cn.ReactQueryDevtools,{initialIsOpen:!1,position:"bottom-right"}):null]},"graz-provider"));0&&(module.exports={GrazEvents,GrazProvider,WALLET_TYPES,WalletType,checkWallet,clearRecentChain,configureGraz,connect,createClients,createQueryClient,createSigningClients,defineChain,defineChainInfo,defineChains,disconnect,executeContract,getActiveChainCurrency,getAvailableWallets,getBalanceStaked,getBalances,getCosmostation,getKeplr,getLeap,getQueryRaw,getQuerySmart,getRecentChain,getWCCosmostation,getWCKeplr,getWCLeap,getWallet,getWalletConnect,instantiateContract,mainnetChains,mainnetChainsArray,reconnect,sendIbcTokens,sendTokens,suggestChain,suggestChainAndConnect,testnetChains,testnetChainsArray,useAccount,useActiveChain,useActiveChainCurrency,useActiveChainValidators,useBalance,useBalanceStaked,useBalances,useCheckWallet,useClients,useConnect,useDisconnect,useExecuteContract,useGrazEvents,useInstantiateContract,useOfflineSigners,useQueryClient,useQueryRaw,useQuerySmart,useRecentChain,useSendIbcTokens,useSendTokens,useSigners,useSigningClients,useSuggestChain,useSuggestChainAndConnect});
|
|
1
|
+
"use strict";var ln=Object.create;var ae=Object.defineProperty;var pn=Object.getOwnPropertyDescriptor;var mn=Object.getOwnPropertyNames;var gn=Object.getPrototypeOf,fn=Object.prototype.hasOwnProperty;var dn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hn=(t,e)=>{for(var n in e)ae(t,n,{get:e[n],enumerable:!0})},it=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mn(e))!fn.call(t,o)&&o!==n&&ae(t,o,{get:()=>e[o],enumerable:!(r=pn(e,o))||r.enumerable});return t};var ct=(t,e,n)=>(n=t!=null?ln(gn(t)):{},it(e||!t||!t.__esModule?ae(n,"default",{value:t,enumerable:!0}):n,t)),yn=t=>it(ae({},"__esModule",{value:!0}),t);var At=dn((Do,St)=>{St.exports=w;var v=null;try{v=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function w(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}w.prototype.__isLong__;Object.defineProperty(w.prototype,"__isLong__",{value:!0});function D(t){return(t&&t.__isLong__)===!0}w.isLong=D;var pt={},mt={};function P(t,e){var n,r,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(r=mt[t],r)?r:(n=S(t,(t|0)<0?-1:0,!0),o&&(mt[t]=n),n)):(t|=0,(o=-128<=t&&t<128)&&(r=pt[t],r)?r:(n=S(t,t<0?-1:0,!1),o&&(pt[t]=n),n))}w.fromInt=P;function j(t,e){if(isNaN(t))return e?q:O;if(e){if(t<0)return q;if(t>=ht)return wt}else{if(t<=-ft)return _;if(t+1>=ft)return Ct}return t<0?j(-t,e).neg():S(t%Z|0,t/Z|0,e)}w.fromNumber=j;function S(t,e,n){return new w(t,e,n)}w.fromBits=S;var ue=Math.pow;function _e(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return O;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return _e(t.substring(1),e,n).neg();for(var o=j(ue(n,8)),s=O,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),u=parseInt(t.substring(i,i+a),n);if(a<8){var f=j(ue(n,a));s=s.mul(f).add(j(u))}else s=s.mul(o),s=s.add(j(u))}return s.unsigned=e,s}w.fromString=_e;function F(t,e){return typeof t=="number"?j(t,e):typeof t=="string"?_e(t,e):S(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}w.fromValue=F;var gt=65536,An=1<<24,Z=gt*gt,ht=Z*Z,ft=ht/2,dt=P(An),O=P(0);w.ZERO=O;var q=P(0,!0);w.UZERO=q;var $=P(1);w.ONE=$;var yt=P(1,!0);w.UONE=yt;var Te=P(-1);w.NEG_ONE=Te;var Ct=S(-1,2147483647,!1);w.MAX_VALUE=Ct;var wt=S(-1,-1,!0);w.MAX_UNSIGNED_VALUE=wt;var _=S(0,-2147483648,!1);w.MIN_VALUE=_;var c=w.prototype;c.toInt=function(){return this.unsigned?this.low>>>0:this.low};c.toNumber=function(){return this.unsigned?(this.high>>>0)*Z+(this.low>>>0):this.high*Z+(this.low>>>0)};c.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(_)){var n=j(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=j(ue(e,6),this.unsigned),i=this,a="";;){var u=i.div(s),f=i.sub(u.mul(s)).toInt()>>>0,d=f.toString(e);if(i=u,i.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}};c.getHighBits=function(){return this.high};c.getHighBitsUnsigned=function(){return this.high>>>0};c.getLowBits=function(){return this.low};c.getLowBitsUnsigned=function(){return this.low>>>0};c.getNumBitsAbs=function(){if(this.isNegative())return this.eq(_)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,n=31;n>0&&!(e&1<<n);n--);return this.high!=0?n+33:n+1};c.isZero=function(){return this.high===0&&this.low===0};c.eqz=c.isZero;c.isNegative=function(){return!this.unsigned&&this.high<0};c.isPositive=function(){return this.unsigned||this.high>=0};c.isOdd=function(){return(this.low&1)===1};c.isEven=function(){return(this.low&1)===0};c.equals=function(e){return D(e)||(e=F(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};c.eq=c.equals;c.notEquals=function(e){return!this.eq(e)};c.neq=c.notEquals;c.ne=c.notEquals;c.lessThan=function(e){return this.comp(e)<0};c.lt=c.lessThan;c.lessThanOrEqual=function(e){return this.comp(e)<=0};c.lte=c.lessThanOrEqual;c.le=c.lessThanOrEqual;c.greaterThan=function(e){return this.comp(e)>0};c.gt=c.greaterThan;c.greaterThanOrEqual=function(e){return this.comp(e)>=0};c.gte=c.greaterThanOrEqual;c.ge=c.greaterThanOrEqual;c.compare=function(e){if(D(e)||(e=F(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};c.comp=c.compare;c.negate=function(){return!this.unsigned&&this.eq(_)?_:this.not().add($)};c.neg=c.negate;c.add=function(e){D(e)||(e=F(e));var n=this.high>>>16,r=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,u=e.low>>>16,f=e.low&65535,d=0,x=0,C=0,E=0;return E+=s+f,C+=E>>>16,E&=65535,C+=o+u,x+=C>>>16,C&=65535,x+=r+a,d+=x>>>16,x&=65535,d+=n+i,d&=65535,S(C<<16|E,d<<16|x,this.unsigned)};c.subtract=function(e){return D(e)||(e=F(e)),this.add(e.neg())};c.sub=c.subtract;c.multiply=function(e){if(this.isZero())return O;if(D(e)||(e=F(e)),v){var n=v.mul(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(e.isZero())return O;if(this.eq(_))return e.isOdd()?_:O;if(e.eq(_))return this.isOdd()?_:O;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(dt)&&e.lt(dt))return j(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,u=e.high&65535,f=e.low>>>16,d=e.low&65535,x=0,C=0,E=0,k=0;return k+=i*d,E+=k>>>16,k&=65535,E+=s*d,C+=E>>>16,E&=65535,E+=i*f,C+=E>>>16,E&=65535,C+=o*d,x+=C>>>16,C&=65535,C+=s*f,x+=C>>>16,C&=65535,C+=i*u,x+=C>>>16,C&=65535,x+=r*d+o*f+s*u+i*a,x&=65535,S(E<<16|k,x<<16|C,this.unsigned)};c.mul=c.multiply;c.divide=function(e){if(D(e)||(e=F(e)),e.isZero())throw Error("division by zero");if(v){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?v.div_u:v.div_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?q:O;var r,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return q;if(e.gt(this.shru(1)))return yt;s=q}else{if(this.eq(_)){if(e.eq($)||e.eq(Te))return _;if(e.eq(_))return $;var i=this.shr(1);return r=i.div(e).shl(1),r.eq(O)?e.isNegative()?$:Te:(o=this.sub(e.mul(r)),s=r.add(o.div(e)),s)}else if(e.eq(_))return this.unsigned?q:O;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=O}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:ue(2,a-48),f=j(r),d=f.mul(e);d.isNegative()||d.gt(o);)r-=u,f=j(r,this.unsigned),d=f.mul(e);f.isZero()&&(f=$),s=s.add(f),o=o.sub(d)}return s};c.div=c.divide;c.modulo=function(e){if(D(e)||(e=F(e)),v){var n=(this.unsigned?v.rem_u:v.rem_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};c.mod=c.modulo;c.rem=c.modulo;c.not=function(){return S(~this.low,~this.high,this.unsigned)};c.and=function(e){return D(e)||(e=F(e)),S(this.low&e.low,this.high&e.high,this.unsigned)};c.or=function(e){return D(e)||(e=F(e)),S(this.low|e.low,this.high|e.high,this.unsigned)};c.xor=function(e){return D(e)||(e=F(e)),S(this.low^e.low,this.high^e.high,this.unsigned)};c.shiftLeft=function(e){return D(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):S(0,this.low<<e-32,this.unsigned)};c.shl=c.shiftLeft;c.shiftRight=function(e){return D(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):S(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};c.shr=c.shiftRight;c.shiftRightUnsigned=function(e){if(D(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return S(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?S(n,0,this.unsigned):S(n>>>e-32,0,this.unsigned)};c.shru=c.shiftRightUnsigned;c.shr_u=c.shiftRightUnsigned;c.toSigned=function(){return this.unsigned?S(this.low,this.high,!1):this};c.toUnsigned=function(){return this.unsigned?this:S(this.low,this.high,!0)};c.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};c.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};c.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};w.fromBytes=function(e,n,r){return r?w.fromBytesLE(e,n):w.fromBytesBE(e,n)};w.fromBytesLE=function(e,n){return new w(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)};w.fromBytesBE=function(e,n){return new w(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}});var Co={};hn(Co,{GrazEvents:()=>et,GrazProvider:()=>yo,WALLET_TYPES:()=>Ae,WalletType:()=>Se,checkWallet:()=>z,clearRecentChain:()=>ve,configureGraz:()=>Fe,connect:()=>X,createClients:()=>oe,createQueryClient:()=>Ee,createSigningClients:()=>re,defineChain:()=>Gn,defineChainInfo:()=>Ln,defineChains:()=>Ye,disconnect:()=>ge,executeContract:()=>Re,getActiveChainCurrency:()=>je,getAvailableWallets:()=>xn,getBalanceStaked:()=>Be,getBalances:()=>ke,getCosmostation:()=>me,getKeplr:()=>le,getLeap:()=>pe,getQueryRaw:()=>qe,getQuerySmart:()=>Ue,getRecentChain:()=>En,getWCCosmostation:()=>jt,getWCKeplr:()=>Dt,getWCLeap:()=>vt,getWallet:()=>Y,getWalletConnect:()=>K,instantiateContract:()=>Me,mainnetChains:()=>zn,mainnetChainsArray:()=>Kn,reconnect:()=>B,sendIbcTokens:()=>We,sendTokens:()=>Ne,suggestChain:()=>fe,suggestChainAndConnect:()=>Oe,testnetChains:()=>Qn,testnetChainsArray:()=>Hn,useAccount:()=>W,useActiveChain:()=>eo,useActiveChainCurrency:()=>to,useActiveChainValidators:()=>no,useActiveWalletType:()=>Vn,useBalance:()=>$n,useBalanceStaked:()=>Jn,useBalances:()=>nn,useCheckWallet:()=>se,useClients:()=>io,useConnect:()=>Zn,useDisconnect:()=>Yn,useExecuteContract:()=>mo,useGrazEvents:()=>cn,useInstantiateContract:()=>po,useOfflineSigners:()=>on,useQueryClient:()=>ao,useQueryRaw:()=>fo,useQuerySmart:()=>go,useRecentChain:()=>oo,useSendIbcTokens:()=>lo,useSendTokens:()=>uo,useSigners:()=>Xn,useSigningClients:()=>co,useSuggestChain:()=>ro,useSuggestChainAndConnect:()=>so});module.exports=yn(Co);var Ot=require("@cosmjs/stargate");var U="graz-reconnect-session";var xe=require("zustand"),at=require("zustand/middleware"),H=require("zustand/middleware");var Se=(a=>(a.KEPLR="keplr",a.LEAP="leap",a.COSMOSTATION="cosmostation",a.WALLETCONNECT="walletconnect",a.WC_KEPLR_MOBILE="wc_keplr_mobile",a.WC_LEAP_MOBILE="wc_leap_mobile",a.WC_COSMOSTATION_MOBILE="wc_cosmostation_mobile",a))(Se||{}),Ae=["keplr","leap","cosmostation","walletconnect","wc_keplr_mobile","wc_leap_mobile","wc_cosmostation_mobile"];var Cn={recentChain:null,defaultChain:null,defaultSigningClient:"stargate",walletType:"keplr",walletConnect:{options:null,web3Modal:null},_notFoundFn:()=>null,_onReconnectFailed:()=>null,_reconnect:!1,_reconnectConnector:null},ne={account:null,activeChain:null,balances:null,clients:null,offlineSigner:null,offlineSignerAmino:null,offlineSignerAuto:null,signingClients:null,status:"disconnected",wcSignClient:null},wn={name:"graz-session",version:1,partialize:t=>({account:t.account,activeChain:t.activeChain}),storage:(0,at.createJSONStorage)(()=>sessionStorage)},Sn={name:"graz-internal",partialize:t=>({recentChain:t.recentChain,_reconnect:t._reconnect,_reconnectConnector:t._reconnectConnector}),version:1},m=(0,xe.create)((0,H.subscribeWithSelector)((0,H.persist)(()=>ne,wn))),y=(0,xe.create)((0,H.subscribeWithSelector)((0,H.persist)(()=>Cn,Sn)));var be=require("@cosmjs/cosmwasm-stargate"),Ie=require("@cosmjs/stargate"),lt=require("@cosmjs/tendermint-rpc");var ut=require("@cosmjs/stargate"),V=require("@cosmjs/utils");var Ee=(...t)=>{let{tendermint:e}=m.getState().clients,n=new ut.QueryClient(e),r=t.map(o=>o(n));for(let o of r){(0,V.assert)((0,V.isNonNullObject)(o),"Extension must be a non-null object");for(let[s,i]of Object.entries(o)){(0,V.assert)((0,V.isNonNullObject)(i),`Module must be a non-null object. Found type ${typeof i} for module "${s}".`);let a=n[s]||{};n[s]={...a,...i}}}return n};var oe=async({rpc:t,rpcHeaders:e})=>{let n={url:t,headers:{...e||{}}},[r,o,s]=await Promise.all([be.SigningCosmWasmClient.connect(n),Ie.SigningStargateClient.connect(n),lt.Tendermint34Client.connect(t)]);return{cosmWasm:r,stargate:o,tendermint:s}},re=async t=>{let{rpc:e,rpcHeaders:n,offlineSignerAuto:r,cosmWasmSignerOptions:o={},stargateSignerOptions:s={}}=t,i={url:e,headers:{...n||{}}},[a,u]=await Promise.all([be.SigningCosmWasmClient.connectWithSigner(i,r,o),Ie.SigningStargateClient.connectWithSigner(i,r,s)]);return{cosmWasm:a,stargate:u}};var bt=require("@cosmjs/encoding"),It=require("@walletconnect/sign-client"),Tt=require("@walletconnect/utils"),_t=ct(At());var G=()=>typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1,xt=()=>G()&&navigator.userAgent.toLowerCase().includes("android"),Et=()=>G()&&(navigator.userAgent.toLowerCase().includes("iphone")||navigator.userAgent.toLowerCase().includes("ipad"));var De=(t,e,n=new Error("Promise timed out"))=>{let r=new Promise((o,s)=>{setTimeout(()=>{s(n)},e)});return Promise.race([t,r])};var z=(t=y.getState().walletType)=>{try{return Y(t),!0}catch{return!1}},L=()=>{window.sessionStorage.removeItem(U),m.setState(ne)},le=()=>{if(typeof window.keplr<"u"){let t=window.keplr;return Object.assign(t,{subscription:r=>(window.addEventListener("keplr_keystorechange",()=>{L(),r()}),()=>{window.removeEventListener("keplr_keystorechange",()=>{L(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.keplr is not defined")},pe=()=>{if(typeof window.leap<"u"){let t=window.leap;return Object.assign(t,{subscription:r=>(window.addEventListener("leap_keystorechange",()=>{L(),r()}),()=>{window.removeEventListener("leap_keystorechange",()=>{L(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.leap is not defined")},me=()=>{if(typeof window.cosmostation.providers.keplr<"u"){let t=window.cosmostation.providers.keplr;return Object.assign(t,{subscription:r=>(window.cosmostation.cosmos.on("accountChanged",()=>{L(),r()}),()=>{window.cosmostation.cosmos.off("accountChanged",()=>{L(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.cosmostation.providers.keplr is not defined")},K=t=>{var nt,ot,rt;if(!((rt=(ot=(nt=y.getState().walletConnect)==null?void 0:nt.options)==null?void 0:ot.projectId)!=null&&rt.trim()))throw new Error("walletConnect.options.projectId is not defined");let e=(t==null?void 0:t.encoding)||"base64",n=p=>{if(!t)return;let{appUrl:l,formatNativeUrl:g}=t;if(G()){if(xt())if(!p)window.open(l.mobile.android,"_self","noreferrer noopener");else{let h=g(l.mobile.android,p,"android");window.open(h,"_self","noreferrer noopener")}if(Et())if(!p)window.open(l.mobile.ios,"_self","noreferrer noopener");else{let h=g(l.mobile.ios,p,"ios");window.open(h,"_self","noreferrer noopener")}}},r=()=>{let{wcSignClient:p}=m.getState();if(!p)throw new Error("walletConnect.signClient is not defined");L(),y.setState({_reconnect:!1,_reconnectConnector:null,recentChain:null})},o=async p=>{let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");if(!p)throw new Error("No wallet connect session");await l.disconnect({topic:p,reason:(0,Tt.getSdkError)("USER_DISCONNECTED")}),await a(l),r()},s=p=>{var l,g;try{let{wcSignClient:h}=m.getState();if(!h)throw new Error("walletConnect.signClient is not defined");let A=h.session.getAll().at(-1);if(!A)return;let b=(g=(l=h.session.getAll().at(-1))==null?void 0:l.namespaces.cosmos)==null?void 0:g.accounts.find(I=>I.startsWith(`cosmos:${p}`));if(!(A.expiry*1e3>Date.now()+1e3))throw o(A.topic),new Error("invalid session");if(!b)try{let I=h.find({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!I.length)throw new Error("no session");return I.at(-1)}catch(I){if(!I.message.toLowerCase().includes("no matching key"))throw I}return A}catch(h){if(!h.message.toLowerCase().includes("no matching key"))throw h}},i=p=>{try{return s(p)}catch{return}},a=async p=>{try{let l=p.core.pairing.pairings.getAll({active:!1});if(!l.length)return;await Promise.all(l.map(async g=>{await p.core.pairing.pairings.delete(g.topic,{code:7001,message:"clear pairing"})}))}catch(l){if(!l.message.toLowerCase().includes("no matching key"))throw l}},u=async()=>{let{walletConnect:p}=y.getState();if(!(p!=null&&p.options))throw new Error("walletConnect.options is not defined");let{wcSignClient:l}=m.getState();if(l)return m.setState({wcSignClient:l}),l;let g=await It.SignClient.init(p.options);return m.setState({wcSignClient:g}),g},f=p=>{let{wcSignClient:l}=m.getState();if(l)return l.events.on("session_delete",g=>{r()}),l.events.on("session_expire",g=>{r()}),l.events.on("session_event",g=>{var h,A;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((A=m.getState().account)==null?void 0:A.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()}),()=>{l.events.off("session_delete",g=>{r()}),l.events.off("session_expire",g=>{r()}),l.events.off("session_event",g=>{var h,A;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((A=m.getState().account)==null?void 0:A.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()})}},d=async p=>{var ie;let{wcSignClient:l}=m.getState();if(!l)throw new Error("enable walletConnect.signClient is not defined");let{walletConnect:g}=y.getState();if(!((ie=g==null?void 0:g.options)!=null&&ie.projectId))throw new Error("walletConnect.options.projectId is not defined");let{Web3Modal:h}=await import("@web3modal/standalone"),A=new h({projectId:g.options.projectId,walletConnectVersion:2,enableExplorer:!1,explorerRecommendedWalletIds:"NONE",...g.web3Modal}),{account:b,activeChain:N}=m.getState(),I=i(p);if((N==null?void 0:N.chainId)!==p&&!I||!b){let{uri:T,approval:ce}=await l.connect({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!T)throw new Error("No wallet connect uri");t?n(T):await A.openModal({uri:T});try{await De((async()=>{await ce()})(),4e4,new Error("Modal approval timeout"))}catch(st){if(A.closeModal(),!st.message.toLowerCase().includes("no matching key"))return Promise.reject(st)}return t||A.closeModal(),Promise.resolve()}try{await De((async()=>{let T=await C(p);m.setState({account:T})})(),1e4,new Error("Connection timeout"))}catch(T){if(o(I==null?void 0:I.topic),!T.message.toLowerCase().includes("no matching key"))throw T}},x=async p=>{var A;let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");let g=(A=s(p))==null?void 0:A.topic;if(!g)throw new Error("No wallet connect session");n();let h=await l.request({topic:g,chainId:`cosmos:${p}`,request:{method:"cosmos_getAccounts",params:{}}});if(!h[0])throw new Error("No wallet connect account");return{address:h[0].address,algo:h[0].algo,pubkey:new Uint8Array(Buffer.from(h[0].pubkey,e))}},C=async p=>{let{address:l,algo:g,pubkey:h}=await x(p);return{address:(0,bt.fromBech32)(l).data,algo:g,bech32Address:l,name:"",pubKey:h,isKeystone:!1,isNanoLedger:!1}},E=async(...p)=>{var T,ce;let[l,g,h]=p,{account:A,wcSignClient:b}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!A)throw new Error("account is not defined");let N=(T=s(l))==null?void 0:T.topic;if(!N)throw new Error("No wallet connect session");if(!h.bodyBytes)throw new Error("No bodyBytes");if(!h.authInfoBytes)throw new Error("No authInfoBytes");let I={topic:N,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:{...h,bodyBytes:Buffer.from(h.bodyBytes).toString(e),authInfoBytes:Buffer.from(h.authInfoBytes).toString(e),accountNumber:(ce=h.accountNumber)==null?void 0:ce.toString()}}}};return n(),await b.request(I)},k=async(...p)=>{let[l,g,h]=p,{signature:A,signed:b}=await E(l,g,h);return{signed:{chainId:b.chainId,accountNumber:_t.default.fromString(b.accountNumber,!1),authInfoBytes:new Uint8Array(Buffer.from(b.authInfoBytes,e)),bodyBytes:new Uint8Array(Buffer.from(b.bodyBytes,e))},signature:A}},Ce=async(...p)=>{var T;let[l,g,h,A]=p,{wcSignClient:b}=m.getState(),{account:N}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!N)throw new Error("account is not defined");let I=(T=s(l))==null?void 0:T.topic;if(!I)throw new Error("No wallet connect session");return n(),await b.request({topic:I,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:h}}})},te=async(...p)=>{let[l,g,h,A]=p;return await Ce(l,g,h)},we=p=>({getAccounts:async()=>[await x(p)],signDirect:(l,g)=>k(p,l,g)}),R=p=>({getAccounts:async()=>[await x(p)],signAmino:(l,g)=>te(p,l,g)});return{enable:d,experimentalSuggestChain:async(...p)=>{await Promise.reject(new Error("WalletConnect does not support experimentalSuggestChain"))},getKey:C,getOfflineSigner:p=>({getAccounts:async()=>[await x(p)],signDirect:(l,g)=>k(p,l,g),signAmino:(l,g)=>te(p,l,g)}),getOfflineSignerAuto:async p=>(await C(p)).isNanoLedger?R(p):we(p),getOfflineSignerOnlyAmino:R,signAmino:te,signDirect:k,subscription:f,init:u}},Dt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!G())throw new Error("WalletConnect Keplr mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"keplrwallet://",android:"intent://"}},walletType:"wc_keplr_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return K(t)},vt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!G())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"leapcosmos://",android:"intent://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return K(t)},jt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!G())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"hex",appUrl:{mobile:{ios:"cosmostation://",android:"cosmostation://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>`${o.replaceAll("/","").replaceAll(":","")}://wc?${s}`};return K(t)},Y=(t=y.getState().walletType)=>{switch(t){case"keplr":return le();case"leap":return pe();case"cosmostation":return me();case"walletconnect":return K();case"wc_keplr_mobile":return Dt();case"wc_leap_mobile":return vt();case"wc_cosmostation_mobile":return jt();default:throw new Error("Unknown wallet type")}},xn=()=>Object.fromEntries(Ae.map(t=>[t,z(t)]));var X=async t=>{var e;try{let{defaultChain:n,recentChain:r,walletType:o}=y.getState(),s=(t==null?void 0:t.walletType)||o;if(!z(s))throw new Error(`${s} is not available`);let a=Y(s),u=(t==null?void 0:t.chain)||r||n;if(!u)throw new Error("No last known connected chain, connect action requires chain info");m.setState(R=>{let tt=y.getState()._reconnect||!!y.getState()._reconnectConnector||!!u;return R.activeChain&&R.activeChain.chainId!==u.chainId?{status:"connecting"}:tt?{status:"reconnecting"}:{status:"connecting"}});let{account:f,activeChain:d}=m.getState();if(await((e=a.init)==null?void 0:e.call(a)),!f||(d==null?void 0:d.chainId)!==u.chainId){await a.enable(u.chainId);let R=await a.getKey(u.chainId);m.setState({account:R})}let x=a.getOfflineSigner(u.chainId),C=a.getOfflineSignerOnlyAmino(u.chainId),E=await a.getOfflineSignerAuto(u.chainId),k=u.gas?Ot.GasPrice.fromString(`${u.gas.price}${u.gas.denom}`):void 0,[Ce,te]=await Promise.all([oe(u),re({...u,offlineSignerAuto:E,cosmWasmSignerOptions:{gasPrice:k,...(t==null?void 0:t.signerOpts)||{}}})]);y.setState({recentChain:u,walletType:s,_reconnect:!!(t!=null&&t.autoReconnect),_reconnectConnector:s}),m.setState({activeChain:u,clients:Ce,offlineSigner:x,offlineSignerAmino:C,offlineSignerAuto:E,signingClients:te,status:"connected"}),typeof window<"u"&&window.sessionStorage.setItem(U,"Active");let{account:we}=m.getState();return{account:we,walletType:s,chain:u}}catch(n){throw console.error("connect ",n),m.getState().account===null&&m.setState({status:"disconnected"}),m.getState().account&&m.getState().activeChain&&m.setState({status:"connected"}),n}},ge=async(t=!1)=>(typeof window<"u"&&window.sessionStorage.removeItem(U),m.setState(ne),y.setState(e=>({_reconnect:!1,_reconnectConnector:null,recentChain:t?null:e.recentChain})),Promise.resolve()),B=async t=>{var o;let{recentChain:e,_reconnectConnector:n,_reconnect:r}=y.getState();try{let s=z(n||void 0);if(e&&s&&n)return await X({chain:e,walletType:n,autoReconnect:r})}catch(s){(o=t==null?void 0:t.onError)==null||o.call(t,s),ge()}};var ve=()=>{y.setState({recentChain:null})},je=t=>{let{activeChain:e}=m.getState();return e==null?void 0:e.currencies.find(n=>n.coinMinimalDenom===t)},En=()=>y.getState().recentChain,fe=async t=>(await Y().experimentalSuggestChain(t),t),Oe=async({chainInfo:t,rpcHeaders:e,gas:n,path:r,...o})=>{let s=await fe(t);return{...await X({chain:{chainId:t.chainId,currencies:t.currencies,rest:t.rest,rpc:t.rpc,rpcHeaders:e,gas:n,path:r},...o}),chain:s}};var Fe=(t={})=>(y.setState(e=>({defaultChain:t.defaultChain||e.defaultChain,defaultSigningClient:t.defaultSigningClient||e.defaultSigningClient,walletConnect:t.walletConnect||e.walletConnect,walletType:t.defaultWallet||e.walletType,_notFoundFn:t.onNotFound||e._notFoundFn,_onReconnectFailed:t.onReconnectFailed||e._onReconnectFailed,_reconnect:t.autoReconnect===void 0?!0:t.autoReconnect||e._reconnect})),t);var ke=async t=>{let{activeChain:e,signingClients:n}=m.getState();if(!e||!n)throw new Error("No connected account detected");let{defaultSigningClient:r}=y.getState();return await Promise.all(e.currencies.map(async s=>{let i=s.coinMinimalDenom.startsWith("cw20:");return n[r].getBalance(t,i?s.coinMinimalDenom.replace("cw20:",""):s.coinMinimalDenom)}))},Be=async t=>{let{clients:e}=m.getState();if(!(e!=null&&e.stargate))throw new Error("Stargate client is not ready");return e.stargate.getBalanceStaked(t)},Ne=async({senderAddress:t,recipientAddress:e,amount:n,fee:r,memo:o})=>{let{defaultSigningClient:s}=y.getState(),{signingClients:i}=m.getState();if(!i)throw new Error("No connected account detected");if(!t)throw new Error("senderAddress is not defined");return i[s].sendTokens(t,e,n,r,o)},We=async({senderAddress:t,recipientAddress:e,transferAmount:n,sourcePort:r,sourceChannel:o,timeoutHeight:s,timeoutTimestamp:i,fee:a,memo:u})=>{let{signingClients:f}=m.getState();if(!(f!=null&&f.stargate))throw new Error("Stargate signing client is not ready");if(!t)throw new Error("senderAddress is not defined");return f.stargate.sendIbcTokens(t,e,n,r,o,s,i,a,u)},Me=async({senderAddress:t,msg:e,fee:n,options:r,label:o,codeId:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.instantiate(t,s,e,o,n,r)},Re=async({senderAddress:t,msg:e,fee:n,contractAddress:r,funds:o,memo:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.execute(t,r,e,n,s,o)},Ue=async(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");return await n.cosmWasm.queryContractSmart(t,e)},qe=(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");let r=new TextEncoder().encode(e);return n.cosmWasm.queryContractRaw(t,r)};var kt=require("@keplr-wallet/cosmos"),Bt={coinDenom:"axl",coinMinimalDenom:"uaxl",coinDecimals:6,coinGeckoId:"axelar-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png"},bn={coinDenom:"usdc",coinMinimalDenom:"uusdc",coinDecimals:6,coinGeckoId:"usd-coin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdc.png"},In={coinDenom:"dai",coinMinimalDenom:"dai-wei",coinDecimals:18,coinGeckoId:"dai",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/dai.png"},Tn={coinDenom:"usdt",coinMinimalDenom:"uusdt",coinDecimals:6,coinGeckoId:"tether",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdt.png"},_n={coinDenom:"weth-wei",coinMinimalDenom:"weth",coinDecimals:18,coinGeckoId:"weth",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png"},Dn={coinDenom:"wbtc-satoshi",coinMinimalDenom:"wbtc",coinDecimals:8,coinGeckoId:"wrapped-bitcoin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/wbtc.png"},Ft=[Bt,bn,In,Tn,_n,Dn],Pe={rpc:"https://rpc.axelar.strange.love",rest:"https://api.axelar.strange.love",chainId:"axelar-dojo-1",chainName:"Axelar",stakeCurrency:Bt,bip44:{coinType:118},bech32Config:kt.Bech32Address.defaultBech32Config("axelar"),currencies:Ft,feeCurrencies:Ft};var Wt=require("@keplr-wallet/cosmos"),Mt={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Nt=[Mt],Ge={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:Mt,bip44:{coinType:118},bech32Config:Wt.Bech32Address.defaultBech32Config("cosmos"),currencies:Nt,feeCurrencies:Nt};var Ut=require("@keplr-wallet/cosmos"),qt={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},vn={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},jn={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},On={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},Fn={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},kn={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},Bn={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},Nn={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},Wn={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},Mn={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},Rn={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},Rt=[qt,vn,jn,On,Fn,kn,Bn,Nn,Wn,Mn,Rn],Le={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:qt,bip44:{coinType:118},bech32Config:Ut.Bech32Address.defaultBech32Config("juno"),currencies:Rt,feeCurrencies:Rt};var Gt=require("@keplr-wallet/cosmos"),Lt={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Un={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},Pt=[Lt,Un],ze={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:Lt,bip44:{coinType:118},bech32Config:Gt.Bech32Address.defaultBech32Config("osmo"),currencies:Pt,feeCurrencies:Pt};var Kt=require("@keplr-wallet/cosmos"),Qt={coinDenom:"somm",coinMinimalDenom:"usomm",coinDecimals:6,coinGeckoId:"sommelier",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/sommelier/images/somm.png"},zt=[Qt],Ke={rpc:"https://rpc.sommelier.strange.love",rest:"https://api.sommelier.strange.love",chainId:"sommelier-3",chainName:"Sommelier",stakeCurrency:Qt,bip44:{coinType:118},bech32Config:Kt.Bech32Address.defaultBech32Config("somm"),currencies:zt,feeCurrencies:zt};var Vt=require("@keplr-wallet/cosmos"),$t={coinDenom:"CRE",coinMinimalDenom:"ucre",coinDecimals:6,coinGeckoId:"crescent",coinImageUrl:"https://raw.githubusercontent.com/crescent-network/asset/main/images/coin/CRE.png"},Ht=[$t],Qe={rpc:"https://testnet-endpoint.crescent.network/rpc/crescent",rest:"https://testnet-endpoint.crescent.network/api/crescent",chainId:"mooncat-1-1",chainName:"Crescent Testnet",bip44:{coinType:118},bech32Config:Vt.Bech32Address.defaultBech32Config("CRE"),currencies:Ht,feeCurrencies:Ht,stakeCurrency:$t,coinType:118};var Zt=require("@keplr-wallet/cosmos"),He={coinDenom:"junox",coinMinimalDenom:"ujunox",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},qn=[He],Ve={rpc:"https://rpc.uni.junonetwork.io",rest:"https://api.uni.junonetwork.io",chainId:"uni-5",chainName:"Juno Testnet",stakeCurrency:He,bip44:{coinType:118},bech32Config:Zt.Bech32Address.defaultBech32Config("juno"),currencies:qn,feeCurrencies:[He],coinType:118};var Yt=require("@keplr-wallet/cosmos"),$e={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://dhj8dql1kzq2v.cloudfront.net/white/osmo.png"},Pn=[$e],Ze={rpc:"https://testnet-rpc.osmosis.zone",rest:"https://testnet-rest.osmosis.zone",chainId:"osmo-test-4",chainName:"Osmosis Testnet",stakeCurrency:$e,bip44:{coinType:118},bech32Config:Yt.Bech32Address.defaultBech32Config("osmo"),currencies:Pn,feeCurrencies:[$e],coinType:118};var Ye=t=>t,Gn=t=>t,Ln=t=>t,zn=Ye({axelar:Pe,cosmoshub:Ge,juno:Le,osmosis:ze,sommelier:Ke}),Kn=[Pe,Ge,Le,ze,Ke],Qn=Ye({crescent:Qe,juno:Ve,osmosis:Ze}),Hn=[Qe,Ve,Ze];var Q=require("@tanstack/react-query"),en=require("react"),tn=require("zustand/shallow");var Xt=require("@tanstack/react-query"),Jt=require("zustand/shallow");var Vn=()=>y(t=>({walletType:t.walletType,isCosmostation:t.walletType==="cosmostation",isCosmostationMobile:t.walletType==="wc_cosmostation_mobile",isKeplr:t.walletType==="keplr",isKeplrMobile:t.walletType==="wc_keplr_mobile",isLeap:t.walletType==="leap",isLeapMobile:t.walletType==="wc_leap_mobile",isWalletConnect:t.walletType==="walletconnect"}),Jt.shallow),se=t=>{let n=["USE_CHECK_WALLET",y(o=>t||o.walletType)];return(0,Xt.useQuery)(n,({queryKey:[,o]})=>z(o))};var W=({onConnect:t,onDisconnect:e}={})=>{let n=m(o=>o.account),r=m(o=>o.status);return(0,en.useEffect)(()=>m.subscribe(o=>o.status,(o,s)=>{if(o==="connected"){let{account:i,activeChain:a}=m.getState(),{walletType:u}=y.getState();t==null||t({account:i,chain:a,walletType:u,isReconnect:s==="reconnecting"})}o==="disconnected"&&(e==null||e())}),[t,e]),{data:n,isConnected:!!n,isConnecting:r==="connecting",isDisconnected:r==="disconnected",isReconnecting:r==="reconnecting",isLoading:r==="connecting"||r==="reconnecting",reconnect:B,status:r}},nn=t=>{let{data:e}=W(),n=t||(e==null?void 0:e.bech32Address);return(0,Q.useQuery)(["USE_BALANCES",n],({queryKey:[,s]})=>ke(s),{enabled:!!n,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!1})},$n=(t,e)=>{let{data:n}=nn(e);return(0,Q.useQuery)(["USE_BALANCE",n,t,e],({queryKey:[,s]})=>s==null?void 0:s.find(i=>i.denom===t),{enabled:!!n})},Zn=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,Q.useMutation)(["USE_CONNECT",t,e,n],X,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:e,onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=se();return{connect:i=>o.mutate(i),connectAsync:i=>o.mutateAsync(i),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status}},Yn=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,Q.useMutation)(["USE_DISCONNECT",t,e,n],ge,{onError:s=>Promise.resolve(t==null?void 0:t(s,void 0)),onMutate:e,onSuccess:()=>Promise.resolve(n==null?void 0:n(void 0))});return{disconnect:s=>o.mutate(s),disconnectAsync:s=>o.mutateAsync(s),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,status:o.status}},on=()=>m(t=>({signer:t.offlineSigner,signerAmino:t.offlineSignerAmino,signerAuto:t.offlineSignerAuto}),tn.shallow),Xn=()=>on(),Jn=t=>{let{data:e}=W(),n=t||(e==null?void 0:e.bech32Address);return(0,Q.useQuery)(["USE_BALANCE_STAKED",n],({queryKey:[,s]})=>Be(n),{enabled:!!n})};var J=require("@tanstack/react-query");var eo=()=>m(t=>t.activeChain),to=t=>(0,J.useQuery)(["USE_ACTIVE_CHAIN_CURRENCY",t],({queryKey:[,r]})=>je(r)),no=(t,e="BOND_STATUS_BONDED")=>(0,J.useQuery)(["USE_ACTIVE_CHAIN_VALIDATORS",t,e],({queryKey:[,o,s]})=>o.staking.validators(s),{enabled:typeof t<"u"}),oo=()=>({data:y(e=>e.recentChain),clear:ve}),ro=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,J.useMutation)(["USE_SUGGEST_CHAIN",t,e,n],fe,{onError:(s,i)=>Promise.resolve(t==null?void 0:t(s,i)),onMutate:e,onSuccess:s=>Promise.resolve(n==null?void 0:n(s))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,suggest:o.mutate,suggestAsync:o.mutateAsync,status:o.status}},so=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=(0,J.useMutation)(["USE_SUGGEST_CHAIN_AND_CONNECT",t,e,n],Oe,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:i=>e==null?void 0:e(i),onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=se();return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status,suggestAndConnect:o.mutate,suggestAndConnectAsync:o.mutateAsync}};var Xe=require("@tanstack/react-query");var io=t=>{let e=m(o=>o.clients);return(0,Xe.useQuery)(["USE_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?oe(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({clients:o})},initialData:e})},co=t=>{let e=m(o=>o.signingClients);return(0,Xe.useQuery)(["USE_SIGNING_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?re(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({signingClients:o})},initialData:e})};var rn=require("@tanstack/react-query");var ao=(...t)=>{let e=["USE_QUERY_CLIENT",...t];return(0,rn.useQuery)(e,({queryKey:[,...r]})=>Ee(...t),{refetchOnMount:!1,refetchOnWindowFocus:!1})};var M=require("@tanstack/react-query");var uo=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=W(),o=r==null?void 0:r.bech32Address,i=(0,M.useMutation)(["USE_SEND_TOKENS",t,e,n,o],a=>Ne({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendTokens:i.mutate,sendTokensAsync:i.mutateAsync,status:i.status}},lo=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=W(),o=r==null?void 0:r.bech32Address,i=(0,M.useMutation)(["USE_SEND_IBC_TOKENS",t,e,n,o],a=>We({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendIbcTokens:i.mutate,sendIbcTokensAsync:i.mutateAsync,status:i.status}},po=({codeId:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=W(),s=o==null?void 0:o.bech32Address,u=(0,M.useMutation)(["USE_INSTANTIATE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,codeId:t};return Me(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,instantiateContract:u.mutate,instantiateContractAsync:u.mutateAsync,status:u.status}},mo=({contractAddress:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=W(),s=o==null?void 0:o.bech32Address,u=(0,M.useMutation)(["USE_EXECUTE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,contractAddress:t,memo:f.memo??"",funds:f.funds??[]};return Re(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,executeContract:u.mutate,executeContractAsync:u.mutateAsync,status:u.status}},go=(t,e)=>(0,M.useQuery)(["USE_QUERY_SMART",t,e],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or queryMsg undefined");return Ue(t,e)},{enabled:!!t&&!!e}),fo=(t,e)=>(0,M.useQuery)(["USE_QUERY_RAW",e,t],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or key undefined");return qe(t,e)},{enabled:!!t&&!!e});var ye=require("@tanstack/react-query"),an=require("@tanstack/react-query-devtools");var de=require("react"),he=require("react/jsx-runtime"),sn=({children:t})=>{let[e,n]=(0,de.useState)(!1);return(0,de.useEffect)(()=>{n(!0)},[]),(0,he.jsx)(he.Fragment,{children:e?t:null})};var Je=require("react");var cn=()=>{let t=typeof window<"u"&&window.sessionStorage.getItem(U)==="Active",{_reconnect:e,_onReconnectFailed:n,_reconnectConnector:r}=y(),{activeChain:o,wcSignClient:s}=m();return(0,Je.useEffect)(()=>{r&&(t&&o?B({onError:n}):!t&&e&&B({onError:n}))},[]),(0,Je.useEffect)(()=>{var i,a,u,f,d,x,C,E;r&&(r==="cosmostation"&&((a=(i=me()).subscription)==null||a.call(i,()=>{B({onError:n})})),r==="keplr"&&((f=(u=le()).subscription)==null||f.call(u,()=>{B({onError:n})})),r==="leap"&&((x=(d=pe()).subscription)==null||x.call(d,()=>{B({onError:n})})),r==="walletconnect"&&s&&((E=(C=K()).subscription)==null||E.call(C,()=>{B({onError:n})})))},[r,s]),null},et=()=>(cn(),null);var ee=require("react/jsx-runtime"),ho=new ye.QueryClient({}),yo=({children:t,grazOptions:e,debug:n,...r})=>(e&&Fe(e),(0,ee.jsxs)(ye.QueryClientProvider,{client:ho,...r,children:[(0,ee.jsxs)(sn,{children:[(0,ee.jsx)(et,{}),t]}),n?(0,ee.jsx)(an.ReactQueryDevtools,{initialIsOpen:!1,position:"bottom-right"}):null]},"graz-provider"));0&&(module.exports={GrazEvents,GrazProvider,WALLET_TYPES,WalletType,checkWallet,clearRecentChain,configureGraz,connect,createClients,createQueryClient,createSigningClients,defineChain,defineChainInfo,defineChains,disconnect,executeContract,getActiveChainCurrency,getAvailableWallets,getBalanceStaked,getBalances,getCosmostation,getKeplr,getLeap,getQueryRaw,getQuerySmart,getRecentChain,getWCCosmostation,getWCKeplr,getWCLeap,getWallet,getWalletConnect,instantiateContract,mainnetChains,mainnetChainsArray,reconnect,sendIbcTokens,sendTokens,suggestChain,suggestChainAndConnect,testnetChains,testnetChainsArray,useAccount,useActiveChain,useActiveChainCurrency,useActiveChainValidators,useActiveWalletType,useBalance,useBalanceStaked,useBalances,useCheckWallet,useClients,useConnect,useDisconnect,useExecuteContract,useGrazEvents,useInstantiateContract,useOfflineSigners,useQueryClient,useQueryRaw,useQuerySmart,useRecentChain,useSendIbcTokens,useSendTokens,useSigners,useSigningClients,useSuggestChain,useSuggestChainAndConnect});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Nt,b as Rt,c as R}from"./chunk-HBC2VYPF.mjs";var Ze=Nt((to,$e)=>{$e.exports=w;var v=null;try{v=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function w(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}w.prototype.__isLong__;Object.defineProperty(w.prototype,"__isLong__",{value:!0});function j(t){return(t&&t.__isLong__)===!0}w.isLong=j;var qe={},Pe={};function M(t,e){var n,r,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(r=Pe[t],r)?r:(n=S(t,(t|0)<0?-1:0,!0),o&&(Pe[t]=n),n)):(t|=0,(o=-128<=t&&t<128)&&(r=qe[t],r)?r:(n=S(t,t<0?-1:0,!1),o&&(qe[t]=n),n))}w.fromInt=M;function _(t,e){if(isNaN(t))return e?U:F;if(e){if(t<0)return U;if(t>=Ke)return Ve}else{if(t<=-Le)return D;if(t+1>=Le)return He}return t<0?_(-t,e).neg():S(t%z|0,t/z|0,e)}w.fromNumber=_;function S(t,e,n){return new w(t,e,n)}w.fromBits=S;var te=Math.pow;function ce(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return F;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return ce(t.substring(1),e,n).neg();for(var o=_(te(n,8)),s=F,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),u=parseInt(t.substring(i,i+a),n);if(a<8){var f=_(te(n,a));s=s.mul(f).add(_(u))}else s=s.mul(o),s=s.add(_(u))}return s.unsigned=e,s}w.fromString=ce;function k(t,e){return typeof t=="number"?_(t,e):typeof t=="string"?ce(t,e):S(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}w.fromValue=k;var Ge=65536,zt=1<<24,z=Ge*Ge,Ke=z*z,Le=Ke/2,ze=M(zt),F=M(0);w.ZERO=F;var U=M(0,!0);w.UZERO=U;var L=M(1);w.ONE=L;var Qe=M(1,!0);w.UONE=Qe;var ie=M(-1);w.NEG_ONE=ie;var He=S(-1,2147483647,!1);w.MAX_VALUE=He;var Ve=S(-1,-1,!0);w.MAX_UNSIGNED_VALUE=Ve;var D=S(0,-2147483648,!1);w.MIN_VALUE=D;var c=w.prototype;c.toInt=function(){return this.unsigned?this.low>>>0:this.low};c.toNumber=function(){return this.unsigned?(this.high>>>0)*z+(this.low>>>0):this.high*z+(this.low>>>0)};c.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(D)){var n=_(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=_(te(e,6),this.unsigned),i=this,a="";;){var u=i.div(s),f=i.sub(u.mul(s)).toInt()>>>0,d=f.toString(e);if(i=u,i.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}};c.getHighBits=function(){return this.high};c.getHighBitsUnsigned=function(){return this.high>>>0};c.getLowBits=function(){return this.low};c.getLowBitsUnsigned=function(){return this.low>>>0};c.getNumBitsAbs=function(){if(this.isNegative())return this.eq(D)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,n=31;n>0&&!(e&1<<n);n--);return this.high!=0?n+33:n+1};c.isZero=function(){return this.high===0&&this.low===0};c.eqz=c.isZero;c.isNegative=function(){return!this.unsigned&&this.high<0};c.isPositive=function(){return this.unsigned||this.high>=0};c.isOdd=function(){return(this.low&1)===1};c.isEven=function(){return(this.low&1)===0};c.equals=function(e){return j(e)||(e=k(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};c.eq=c.equals;c.notEquals=function(e){return!this.eq(e)};c.neq=c.notEquals;c.ne=c.notEquals;c.lessThan=function(e){return this.comp(e)<0};c.lt=c.lessThan;c.lessThanOrEqual=function(e){return this.comp(e)<=0};c.lte=c.lessThanOrEqual;c.le=c.lessThanOrEqual;c.greaterThan=function(e){return this.comp(e)>0};c.gt=c.greaterThan;c.greaterThanOrEqual=function(e){return this.comp(e)>=0};c.gte=c.greaterThanOrEqual;c.ge=c.greaterThanOrEqual;c.compare=function(e){if(j(e)||(e=k(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};c.comp=c.compare;c.negate=function(){return!this.unsigned&&this.eq(D)?D:this.not().add(L)};c.neg=c.negate;c.add=function(e){j(e)||(e=k(e));var n=this.high>>>16,r=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,u=e.low>>>16,f=e.low&65535,d=0,A=0,C=0,E=0;return E+=s+f,C+=E>>>16,E&=65535,C+=o+u,A+=C>>>16,C&=65535,A+=r+a,d+=A>>>16,A&=65535,d+=n+i,d&=65535,S(C<<16|E,d<<16|A,this.unsigned)};c.subtract=function(e){return j(e)||(e=k(e)),this.add(e.neg())};c.sub=c.subtract;c.multiply=function(e){if(this.isZero())return F;if(j(e)||(e=k(e)),v){var n=v.mul(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(e.isZero())return F;if(this.eq(D))return e.isOdd()?D:F;if(e.eq(D))return this.isOdd()?D:F;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(ze)&&e.lt(ze))return _(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,u=e.high&65535,f=e.low>>>16,d=e.low&65535,A=0,C=0,E=0,O=0;return O+=i*d,E+=O>>>16,O&=65535,E+=s*d,C+=E>>>16,E&=65535,E+=i*f,C+=E>>>16,E&=65535,C+=o*d,A+=C>>>16,C&=65535,C+=s*f,A+=C>>>16,C&=65535,C+=i*u,A+=C>>>16,C&=65535,A+=r*d+o*f+s*u+i*a,A&=65535,S(E<<16|O,A<<16|C,this.unsigned)};c.mul=c.multiply;c.divide=function(e){if(j(e)||(e=k(e)),e.isZero())throw Error("division by zero");if(v){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?v.div_u:v.div_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?U:F;var r,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return U;if(e.gt(this.shru(1)))return Qe;s=U}else{if(this.eq(D)){if(e.eq(L)||e.eq(ie))return D;if(e.eq(D))return L;var i=this.shr(1);return r=i.div(e).shl(1),r.eq(F)?e.isNegative()?L:ie:(o=this.sub(e.mul(r)),s=r.add(o.div(e)),s)}else if(e.eq(D))return this.unsigned?U:F;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=F}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:te(2,a-48),f=_(r),d=f.mul(e);d.isNegative()||d.gt(o);)r-=u,f=_(r,this.unsigned),d=f.mul(e);f.isZero()&&(f=L),s=s.add(f),o=o.sub(d)}return s};c.div=c.divide;c.modulo=function(e){if(j(e)||(e=k(e)),v){var n=(this.unsigned?v.rem_u:v.rem_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};c.mod=c.modulo;c.rem=c.modulo;c.not=function(){return S(~this.low,~this.high,this.unsigned)};c.and=function(e){return j(e)||(e=k(e)),S(this.low&e.low,this.high&e.high,this.unsigned)};c.or=function(e){return j(e)||(e=k(e)),S(this.low|e.low,this.high|e.high,this.unsigned)};c.xor=function(e){return j(e)||(e=k(e)),S(this.low^e.low,this.high^e.high,this.unsigned)};c.shiftLeft=function(e){return j(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):S(0,this.low<<e-32,this.unsigned)};c.shl=c.shiftLeft;c.shiftRight=function(e){return j(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):S(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};c.shr=c.shiftRight;c.shiftRightUnsigned=function(e){if(j(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return S(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?S(n,0,this.unsigned):S(n>>>e-32,0,this.unsigned)};c.shru=c.shiftRightUnsigned;c.shr_u=c.shiftRightUnsigned;c.toSigned=function(){return this.unsigned?S(this.low,this.high,!1):this};c.toUnsigned=function(){return this.unsigned?this:S(this.low,this.high,!0)};c.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};c.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};c.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};w.fromBytes=function(e,n,r){return r?w.fromBytesLE(e,n):w.fromBytesBE(e,n)};w.fromBytesLE=function(e,n){return new w(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)};w.fromBytesBE=function(e,n){return new w(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}});import{GasPrice as Yt}from"@cosmjs/stargate";import{create as ke}from"zustand";import{createJSONStorage as Ut}from"zustand/middleware";import{persist as Oe,subscribeWithSelector as Be}from"zustand/middleware";var _e=(a=>(a.KEPLR="keplr",a.LEAP="leap",a.COSMOSTATION="cosmostation",a.WALLETCONNECT="walletconnect",a.WC_KEPLR_MOBILE="wc_keplr_mobile",a.WC_LEAP_MOBILE="wc_leap_mobile",a.WC_COSMOSTATION_MOBILE="wc_cosmostation_mobile",a))(_e||{}),Fe=["keplr","leap","cosmostation","walletconnect","wc_keplr_mobile","wc_leap_mobile","wc_cosmostation_mobile"];var Mt={recentChain:null,defaultChain:null,defaultSigningClient:"stargate",walletType:"keplr",walletConnect:{options:null,web3Modal:null},_notFoundFn:()=>null,_onReconnectFailed:()=>null,_reconnect:!1,_reconnectConnector:null},V={account:null,activeChain:null,balances:null,clients:null,offlineSigner:null,offlineSignerAmino:null,offlineSignerAuto:null,signingClients:null,status:"disconnected",wcSignClient:null},qt={name:"graz-session",version:1,partialize:t=>({account:t.account,activeChain:t.activeChain}),storage:Ut(()=>sessionStorage)},Pt={name:"graz-internal",partialize:t=>({recentChain:t.recentChain,_reconnect:t._reconnect,_reconnectConnector:t._reconnectConnector}),version:1},m=ke(Be(Oe(()=>V,qt))),y=ke(Be(Oe(()=>Mt,Pt)));import{SigningCosmWasmClient as Ue}from"@cosmjs/cosmwasm-stargate";import{SigningStargateClient as Me}from"@cosmjs/stargate";import{Tendermint34Client as Lt}from"@cosmjs/tendermint-rpc";import{QueryClient as Gt}from"@cosmjs/stargate";import{assert as We,isNonNullObject as Ne}from"@cosmjs/utils";var Re=(...t)=>{let{tendermint:e}=m.getState().clients,n=new Gt(e),r=t.map(o=>o(n));for(let o of r){We(Ne(o),"Extension must be a non-null object");for(let[s,i]of Object.entries(o)){We(Ne(i),`Module must be a non-null object. Found type ${typeof i} for module "${s}".`);let a=n[s]||{};n[s]={...a,...i}}}return n};var J=async({rpc:t,rpcHeaders:e})=>{let n={url:t,headers:{...e||{}}},[r,o,s]=await Promise.all([Ue.connect(n),Me.connect(n),Lt.connect(t)]);return{cosmWasm:r,stargate:o,tendermint:s}},ee=async t=>{let{rpc:e,rpcHeaders:n,offlineSignerAuto:r,cosmWasmSignerOptions:o={},stargateSignerOptions:s={}}=t,i={url:e,headers:{...n||{}}},[a,u]=await Promise.all([Ue.connectWithSigner(i,r,o),Me.connectWithSigner(i,r,s)]);return{cosmWasm:a,stargate:u}};var Je=Rt(Ze());import{fromBech32 as Kt}from"@cosmjs/encoding";import{SignClient as Qt}from"@walletconnect/sign-client";import{getSdkError as Ht}from"@walletconnect/utils";var q=()=>typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1,Ye=()=>q()&&navigator.userAgent.toLowerCase().includes("android"),Xe=()=>q()&&(navigator.userAgent.toLowerCase().includes("iphone")||navigator.userAgent.toLowerCase().includes("ipad"));var ae=(t,e,n=new Error("Promise timed out"))=>{let r=new Promise((o,s)=>{setTimeout(()=>{s(n)},e)});return Promise.race([t,r])};var K=(t=y.getState().walletType)=>{try{return $(t),!0}catch{return!1}},P=()=>{window.sessionStorage.removeItem(R),m.setState(V)},ue=()=>{if(typeof window.keplr<"u"){let t=window.keplr;return Object.assign(t,{subscription:r=>(window.addEventListener("keplr_keystorechange",()=>{P(),r()}),()=>{window.removeEventListener("keplr_keystorechange",()=>{P(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.keplr is not defined")},le=()=>{if(typeof window.leap<"u"){let t=window.leap;return Object.assign(t,{subscription:r=>(window.addEventListener("leap_keystorechange",()=>{P(),r()}),()=>{window.removeEventListener("leap_keystorechange",()=>{P(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.leap is not defined")},pe=()=>{if(typeof window.cosmostation.providers.keplr<"u"){let t=window.cosmostation.providers.keplr;return Object.assign(t,{subscription:r=>(window.cosmostation.cosmos.on("accountChanged",()=>{P(),r()}),()=>{window.cosmostation.cosmos.off("accountChanged",()=>{P(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.cosmostation.providers.keplr is not defined")},Q=t=>{var Te,De,je;if(!((je=(De=(Te=y.getState().walletConnect)==null?void 0:Te.options)==null?void 0:De.projectId)!=null&&je.trim()))throw new Error("walletConnect.options.projectId is not defined");let e=(t==null?void 0:t.encoding)||"base64",n=p=>{if(!t)return;let{appUrl:l,formatNativeUrl:g}=t;if(q()){if(Ye())if(!p)window.open(l.mobile.android,"_self","noreferrer noopener");else{let h=g(l.mobile.android,p,"android");window.open(h,"_self","noreferrer noopener")}if(Xe())if(!p)window.open(l.mobile.ios,"_self","noreferrer noopener");else{let h=g(l.mobile.ios,p,"ios");window.open(h,"_self","noreferrer noopener")}}},r=()=>{let{wcSignClient:p}=m.getState();if(!p)throw new Error("walletConnect.signClient is not defined");P(),y.setState({_reconnect:!1,_reconnectConnector:null,recentChain:null})},o=async p=>{let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");if(!p)throw new Error("No wallet connect session");await l.disconnect({topic:p,reason:Ht("USER_DISCONNECTED")}),await a(l),r()},s=p=>{var l,g;try{let{wcSignClient:h}=m.getState();if(!h)throw new Error("walletConnect.signClient is not defined");let x=h.session.getAll().at(-1);if(!x)return;let b=(g=(l=h.session.getAll().at(-1))==null?void 0:l.namespaces.cosmos)==null?void 0:g.accounts.find(I=>I.startsWith(`cosmos:${p}`));if(!(x.expiry*1e3>Date.now()+1e3))throw o(x.topic),new Error("invalid session");if(!b)try{let I=h.find({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!I.length)throw new Error("no session");return I.at(-1)}catch(I){if(!I.message.toLowerCase().includes("no matching key"))throw I}return x}catch(h){if(!h.message.toLowerCase().includes("no matching key"))throw h}},i=p=>{try{return s(p)}catch{return}},a=async p=>{try{let l=p.core.pairing.pairings.getAll({active:!1});if(!l.length)return;await Promise.all(l.map(async g=>{await p.core.pairing.pairings.delete(g.topic,{code:7001,message:"clear pairing"})}))}catch(l){if(!l.message.toLowerCase().includes("no matching key"))throw l}},u=async()=>{let{walletConnect:p}=y.getState();if(!(p!=null&&p.options))throw new Error("walletConnect.options is not defined");let{wcSignClient:l}=m.getState();if(l)return m.setState({wcSignClient:l}),l;let g=await Qt.init(p.options);return m.setState({wcSignClient:g}),g},f=p=>{let{wcSignClient:l}=m.getState();if(l)return l.events.on("session_delete",g=>{r()}),l.events.on("session_expire",g=>{r()}),l.events.on("session_event",g=>{var h,x;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((x=m.getState().account)==null?void 0:x.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()}),()=>{l.events.off("session_delete",g=>{r()}),l.events.off("session_expire",g=>{r()}),l.events.off("session_event",g=>{var h,x;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((x=m.getState().account)==null?void 0:x.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()})}},d=async p=>{var Y;let{wcSignClient:l}=m.getState();if(!l)throw new Error("enable walletConnect.signClient is not defined");let{walletConnect:g}=y.getState();if(!((Y=g==null?void 0:g.options)!=null&&Y.projectId))throw new Error("walletConnect.options.projectId is not defined");let{Web3Modal:h}=await import("@web3modal/standalone"),x=new h({projectId:g.options.projectId,walletConnectVersion:2,enableExplorer:!1,explorerRecommendedWalletIds:"NONE",...g.web3Modal}),{account:b,activeChain:B}=m.getState(),I=i(p);if((B==null?void 0:B.chainId)!==p&&!I||!b){let{uri:T,approval:X}=await l.connect({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!T)throw new Error("No wallet connect uri");t?n(T):await x.openModal({uri:T});try{await ae((async()=>{await X()})(),4e4,new Error("Modal approval timeout"))}catch(ve){if(x.closeModal(),!ve.message.toLowerCase().includes("no matching key"))return Promise.reject(ve)}return t||x.closeModal(),Promise.resolve()}try{await ae((async()=>{let T=await C(p);m.setState({account:T})})(),1e4,new Error("Connection timeout"))}catch(T){if(o(I==null?void 0:I.topic),!T.message.toLowerCase().includes("no matching key"))throw T}},A=async p=>{var x;let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");let g=(x=s(p))==null?void 0:x.topic;if(!g)throw new Error("No wallet connect session");n();let h=await l.request({topic:g,chainId:`cosmos:${p}`,request:{method:"cosmos_getAccounts",params:{}}});if(!h[0])throw new Error("No wallet connect account");return{address:h[0].address,algo:h[0].algo,pubkey:new Uint8Array(Buffer.from(h[0].pubkey,e))}},C=async p=>{let{address:l,algo:g,pubkey:h}=await A(p);return{address:Kt(l).data,algo:g,bech32Address:l,name:"",pubKey:h,isKeystone:!1,isNanoLedger:!1}},E=async(...p)=>{var T,X;let[l,g,h]=p,{account:x,wcSignClient:b}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!x)throw new Error("account is not defined");let B=(T=s(l))==null?void 0:T.topic;if(!B)throw new Error("No wallet connect session");if(!h.bodyBytes)throw new Error("No bodyBytes");if(!h.authInfoBytes)throw new Error("No authInfoBytes");let I={topic:B,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:{...h,bodyBytes:Buffer.from(h.bodyBytes).toString(e),authInfoBytes:Buffer.from(h.authInfoBytes).toString(e),accountNumber:(X=h.accountNumber)==null?void 0:X.toString()}}}};return n(),await b.request(I)},O=async(...p)=>{let[l,g,h]=p,{signature:x,signed:b}=await E(l,g,h);return{signed:{chainId:b.chainId,accountNumber:Je.default.fromString(b.accountNumber,!1),authInfoBytes:new Uint8Array(Buffer.from(b.authInfoBytes,e)),bodyBytes:new Uint8Array(Buffer.from(b.bodyBytes,e))},signature:x}},re=async(...p)=>{var T;let[l,g,h,x]=p,{wcSignClient:b}=m.getState(),{account:B}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!B)throw new Error("account is not defined");let I=(T=s(l))==null?void 0:T.topic;if(!I)throw new Error("No wallet connect session");return n(),await b.request({topic:I,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:h}}})},H=async(...p)=>{let[l,g,h,x]=p;return await re(l,g,h)},se=p=>({getAccounts:async()=>[await A(p)],signDirect:(l,g)=>O(p,l,g)}),N=p=>({getAccounts:async()=>[await A(p)],signAmino:(l,g)=>H(p,l,g)});return{enable:d,experimentalSuggestChain:async(...p)=>{await Promise.reject(new Error("WalletConnect does not support experimentalSuggestChain"))},getKey:C,getOfflineSigner:p=>({getAccounts:async()=>[await A(p)],signDirect:(l,g)=>O(p,l,g),signAmino:(l,g)=>H(p,l,g)}),getOfflineSignerAuto:async p=>(await C(p)).isNanoLedger?N(p):se(p),getOfflineSignerOnlyAmino:N,signAmino:H,signDirect:O,subscription:f,init:u}},Vt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Keplr mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"keplrwallet://",android:"intent://"}},walletType:"wc_keplr_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return Q(t)},$t=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"leapcosmos://",android:"intent://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return Q(t)},Zt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"hex",appUrl:{mobile:{ios:"cosmostation://",android:"cosmostation://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>`${o.replaceAll("/","").replaceAll(":","")}://wc?${s}`};return Q(t)},$=(t=y.getState().walletType)=>{switch(t){case"keplr":return ue();case"leap":return le();case"cosmostation":return pe();case"walletconnect":return Q();case"wc_keplr_mobile":return Vt();case"wc_leap_mobile":return $t();case"wc_cosmostation_mobile":return Zt();default:throw new Error("Unknown wallet type")}},mo=()=>Object.fromEntries(Fe.map(t=>[t,K(t)]));var Z=async t=>{var e;try{let{defaultChain:n,recentChain:r,walletType:o}=y.getState(),s=(t==null?void 0:t.walletType)||o;if(!K(s))throw new Error(`${s} is not available`);let a=$(s),u=(t==null?void 0:t.chain)||r||n;if(!u)throw new Error("No last known connected chain, connect action requires chain info");m.setState(N=>{let Ie=y.getState()._reconnect||!!y.getState()._reconnectConnector||!!u;return N.activeChain&&N.activeChain.chainId!==u.chainId?{status:"connecting"}:Ie?{status:"reconnecting"}:{status:"connecting"}});let{account:f,activeChain:d}=m.getState();if(await((e=a.init)==null?void 0:e.call(a)),!f||(d==null?void 0:d.chainId)!==u.chainId){await a.enable(u.chainId);let N=await a.getKey(u.chainId);m.setState({account:N})}let A=a.getOfflineSigner(u.chainId),C=a.getOfflineSignerOnlyAmino(u.chainId),E=await a.getOfflineSignerAuto(u.chainId),O=u.gas?Yt.fromString(`${u.gas.price}${u.gas.denom}`):void 0,[re,H]=await Promise.all([J(u),ee({...u,offlineSignerAuto:E,cosmWasmSignerOptions:{gasPrice:O,...(t==null?void 0:t.signerOpts)||{}}})]);y.setState({recentChain:u,walletType:s,_reconnect:!!(t!=null&&t.autoReconnect),_reconnectConnector:s}),m.setState({activeChain:u,clients:re,offlineSigner:A,offlineSignerAmino:C,offlineSignerAuto:E,signingClients:H,status:"connected"}),typeof window<"u"&&window.sessionStorage.setItem(R,"Active");let{account:se}=m.getState();return{account:se,walletType:s,chain:u}}catch(n){throw console.error("connect ",n),m.getState().account===null&&m.setState({status:"disconnected"}),m.getState().account&&m.getState().activeChain&&m.setState({status:"connected"}),n}},me=async(t=!1)=>(typeof window<"u"&&window.sessionStorage.removeItem(R),m.setState(V),y.setState(e=>({_reconnect:!1,_reconnectConnector:null,recentChain:t?null:e.recentChain})),Promise.resolve()),W=async t=>{var o;let{recentChain:e,_reconnectConnector:n,_reconnect:r}=y.getState();try{let s=K(n||void 0);if(e&&s&&n)return await Z({chain:e,walletType:n,autoReconnect:r})}catch(s){(o=t==null?void 0:t.onError)==null||o.call(t,s),me()}};var et=()=>{y.setState({recentChain:null})},tt=t=>{let{activeChain:e}=m.getState();return e==null?void 0:e.currencies.find(n=>n.coinMinimalDenom===t)},bo=()=>y.getState().recentChain,ge=async t=>(await $().experimentalSuggestChain(t),t),nt=async({chainInfo:t,rpcHeaders:e,gas:n,path:r,...o})=>{let s=await ge(t);return{...await Z({chain:{chainId:t.chainId,currencies:t.currencies,rest:t.rest,rpc:t.rpc,rpcHeaders:e,gas:n,path:r},...o}),chain:s}};var ot=(t={})=>(y.setState(e=>({defaultChain:t.defaultChain||e.defaultChain,defaultSigningClient:t.defaultSigningClient||e.defaultSigningClient,walletConnect:t.walletConnect||e.walletConnect,walletType:t.defaultWallet||e.walletType,_notFoundFn:t.onNotFound||e._notFoundFn,_onReconnectFailed:t.onReconnectFailed||e._onReconnectFailed,_reconnect:t.autoReconnect===void 0?!0:t.autoReconnect||e._reconnect})),t);var rt=async t=>{let{activeChain:e,signingClients:n}=m.getState();if(!e||!n)throw new Error("No connected account detected");let{defaultSigningClient:r}=y.getState();return await Promise.all(e.currencies.map(async s=>{let i=s.coinMinimalDenom.startsWith("cw20:");return n[r].getBalance(t,i?s.coinMinimalDenom.replace("cw20:",""):s.coinMinimalDenom)}))},st=async t=>{let{clients:e}=m.getState();if(!(e!=null&&e.stargate))throw new Error("Stargate client is not ready");return e.stargate.getBalanceStaked(t)},it=async({senderAddress:t,recipientAddress:e,amount:n,fee:r,memo:o})=>{let{defaultSigningClient:s}=y.getState(),{signingClients:i}=m.getState();if(!i)throw new Error("No connected account detected");if(!t)throw new Error("senderAddress is not defined");return i[s].sendTokens(t,e,n,r,o)},ct=async({senderAddress:t,recipientAddress:e,transferAmount:n,sourcePort:r,sourceChannel:o,timeoutHeight:s,timeoutTimestamp:i,fee:a,memo:u})=>{let{signingClients:f}=m.getState();if(!(f!=null&&f.stargate))throw new Error("Stargate signing client is not ready");if(!t)throw new Error("senderAddress is not defined");return f.stargate.sendIbcTokens(t,e,n,r,o,s,i,a,u)},at=async({senderAddress:t,msg:e,fee:n,options:r,label:o,codeId:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.instantiate(t,s,e,o,n,r)},ut=async({senderAddress:t,msg:e,fee:n,contractAddress:r,funds:o,memo:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.execute(t,r,e,n,s,o)},lt=async(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");return await n.cosmWasm.queryContractSmart(t,e)},pt=(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");let r=new TextEncoder().encode(e);return n.cosmWasm.queryContractRaw(t,r)};import{Bech32Address as Xt}from"@keplr-wallet/cosmos";var gt={coinDenom:"axl",coinMinimalDenom:"uaxl",coinDecimals:6,coinGeckoId:"axelar-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png"},Jt={coinDenom:"usdc",coinMinimalDenom:"uusdc",coinDecimals:6,coinGeckoId:"usd-coin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdc.png"},en={coinDenom:"dai",coinMinimalDenom:"dai-wei",coinDecimals:18,coinGeckoId:"dai",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/dai.png"},tn={coinDenom:"usdt",coinMinimalDenom:"uusdt",coinDecimals:6,coinGeckoId:"tether",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdt.png"},nn={coinDenom:"weth-wei",coinMinimalDenom:"weth",coinDecimals:18,coinGeckoId:"weth",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png"},on={coinDenom:"wbtc-satoshi",coinMinimalDenom:"wbtc",coinDecimals:8,coinGeckoId:"wrapped-bitcoin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/wbtc.png"},mt=[gt,Jt,en,tn,nn,on],fe={rpc:"https://rpc.axelar.strange.love",rest:"https://api.axelar.strange.love",chainId:"axelar-dojo-1",chainName:"Axelar",stakeCurrency:gt,bip44:{coinType:118},bech32Config:Xt.defaultBech32Config("axelar"),currencies:mt,feeCurrencies:mt};import{Bech32Address as rn}from"@keplr-wallet/cosmos";var dt={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},ft=[dt],de={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:dt,bip44:{coinType:118},bech32Config:rn.defaultBech32Config("cosmos"),currencies:ft,feeCurrencies:ft};import{Bech32Address as sn}from"@keplr-wallet/cosmos";var yt={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},cn={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},an={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},un={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},ln={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},pn={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},mn={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},gn={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},fn={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},dn={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},hn={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},ht=[yt,cn,an,un,ln,pn,mn,gn,fn,dn,hn],he={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:yt,bip44:{coinType:118},bech32Config:sn.defaultBech32Config("juno"),currencies:ht,feeCurrencies:ht};import{Bech32Address as yn}from"@keplr-wallet/cosmos";var wt={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Cn={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},Ct=[wt,Cn],ye={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:wt,bip44:{coinType:118},bech32Config:yn.defaultBech32Config("osmo"),currencies:Ct,feeCurrencies:Ct};import{Bech32Address as wn}from"@keplr-wallet/cosmos";var xt={coinDenom:"somm",coinMinimalDenom:"usomm",coinDecimals:6,coinGeckoId:"sommelier",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/sommelier/images/somm.png"},St=[xt],Ce={rpc:"https://rpc.sommelier.strange.love",rest:"https://api.sommelier.strange.love",chainId:"sommelier-3",chainName:"Sommelier",stakeCurrency:xt,bip44:{coinType:118},bech32Config:wn.defaultBech32Config("somm"),currencies:St,feeCurrencies:St};import{Bech32Address as Sn}from"@keplr-wallet/cosmos";var Et={coinDenom:"CRE",coinMinimalDenom:"ucre",coinDecimals:6,coinGeckoId:"crescent",coinImageUrl:"https://raw.githubusercontent.com/crescent-network/asset/main/images/coin/CRE.png"},At=[Et],we={rpc:"https://testnet-endpoint.crescent.network/rpc/crescent",rest:"https://testnet-endpoint.crescent.network/api/crescent",chainId:"mooncat-1-1",chainName:"Crescent Testnet",bip44:{coinType:118},bech32Config:Sn.defaultBech32Config("CRE"),currencies:At,feeCurrencies:At,stakeCurrency:Et,coinType:118};import{Bech32Address as xn}from"@keplr-wallet/cosmos";var Se={coinDenom:"junox",coinMinimalDenom:"ujunox",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},An=[Se],xe={rpc:"https://rpc.uni.junonetwork.io",rest:"https://api.uni.junonetwork.io",chainId:"uni-5",chainName:"Juno Testnet",stakeCurrency:Se,bip44:{coinType:118},bech32Config:xn.defaultBech32Config("juno"),currencies:An,feeCurrencies:[Se],coinType:118};import{Bech32Address as En}from"@keplr-wallet/cosmos";var Ae={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://dhj8dql1kzq2v.cloudfront.net/white/osmo.png"},bn=[Ae],Ee={rpc:"https://testnet-rpc.osmosis.zone",rest:"https://testnet-rest.osmosis.zone",chainId:"osmo-test-4",chainName:"Osmosis Testnet",stakeCurrency:Ae,bip44:{coinType:118},bech32Config:En.defaultBech32Config("osmo"),currencies:bn,feeCurrencies:[Ae],coinType:118};var bt=t=>t,tr=t=>t,nr=t=>t,or=bt({axelar:fe,cosmoshub:de,juno:he,osmosis:ye,sommelier:Ce}),rr=[fe,de,he,ye,Ce],sr=bt({crescent:we,juno:xe,osmosis:Ee}),ir=[we,xe,Ee];import{useMutation as It,useQuery as be}from"@tanstack/react-query";import{useEffect as Tn}from"react";import{shallow as Dn}from"zustand/shallow";import{useQuery as In}from"@tanstack/react-query";var ne=t=>{let n=["USE_CHECK_WALLET",y(o=>t||o.walletType)];return In(n,({queryKey:[,o]})=>K(o))};var G=({onConnect:t,onDisconnect:e}={})=>{let n=m(o=>o.account),r=m(o=>o.status);return Tn(()=>m.subscribe(o=>o.status,(o,s)=>{if(o==="connected"){let{account:i,activeChain:a}=m.getState(),{walletType:u}=y.getState();t==null||t({account:i,chain:a,walletType:u,isReconnect:s==="reconnecting"})}o==="disconnected"&&(e==null||e())}),[t,e]),{data:n,isConnected:!!n,isConnecting:r==="connecting",isDisconnected:r==="disconnected",isReconnecting:r==="reconnecting",isLoading:r==="connecting"||r==="reconnecting",reconnect:W,status:r}},jn=t=>{let{data:e}=G(),n=t||(e==null?void 0:e.bech32Address);return be(["USE_BALANCES",n],({queryKey:[,s]})=>rt(s),{enabled:!!n,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!1})},wr=(t,e)=>{let{data:n}=jn(e);return be(["USE_BALANCE",n,t,e],({queryKey:[,s]})=>s==null?void 0:s.find(i=>i.denom===t),{enabled:!!n})},Sr=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=It(["USE_CONNECT",t,e,n],Z,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:e,onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=ne();return{connect:i=>o.mutate(i),connectAsync:i=>o.mutateAsync(i),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status}},xr=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=It(["USE_DISCONNECT",t,e,n],me,{onError:s=>Promise.resolve(t==null?void 0:t(s,void 0)),onMutate:e,onSuccess:()=>Promise.resolve(n==null?void 0:n(void 0))});return{disconnect:s=>o.mutate(s),disconnectAsync:s=>o.mutateAsync(s),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,status:o.status}},vn=()=>m(t=>({signer:t.offlineSigner,signerAmino:t.offlineSignerAmino,signerAuto:t.offlineSignerAuto}),Dn),Ar=()=>vn(),Er=t=>{let{data:e}=G(),n=t||(e==null?void 0:e.bech32Address);return be(["USE_BALANCE_STAKED",n],({queryKey:[,s]})=>st(n),{enabled:!!n})};import{useMutation as Tt,useQuery as Dt}from"@tanstack/react-query";var vr=()=>m(t=>t.activeChain),_r=t=>Dt(["USE_ACTIVE_CHAIN_CURRENCY",t],({queryKey:[,r]})=>tt(r)),Fr=(t,e="BOND_STATUS_BONDED")=>Dt(["USE_ACTIVE_CHAIN_VALIDATORS",t,e],({queryKey:[,o,s]})=>o.staking.validators(s),{enabled:typeof t<"u"}),kr=()=>({data:y(e=>e.recentChain),clear:et}),Or=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=Tt(["USE_SUGGEST_CHAIN",t,e,n],ge,{onError:(s,i)=>Promise.resolve(t==null?void 0:t(s,i)),onMutate:e,onSuccess:s=>Promise.resolve(n==null?void 0:n(s))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,suggest:o.mutate,suggestAsync:o.mutateAsync,status:o.status}},Br=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=Tt(["USE_SUGGEST_CHAIN_AND_CONNECT",t,e,n],nt,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:i=>e==null?void 0:e(i),onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=ne();return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status,suggestAndConnect:o.mutate,suggestAndConnectAsync:o.mutateAsync}};import{useQuery as jt}from"@tanstack/react-query";var qr=t=>{let e=m(o=>o.clients);return jt(["USE_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?J(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({clients:o})},initialData:e})},Pr=t=>{let e=m(o=>o.signingClients);return jt(["USE_SIGNING_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?ee(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({signingClients:o})},initialData:e})};import{useQuery as _n}from"@tanstack/react-query";var Kr=(...t)=>{let e=["USE_QUERY_CLIENT",...t];return _n(e,({queryKey:[,...r]})=>Re(...t),{refetchOnMount:!1,refetchOnWindowFocus:!1})};import{useMutation as oe,useQuery as vt}from"@tanstack/react-query";var Zr=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=G(),o=r==null?void 0:r.bech32Address,i=oe(["USE_SEND_TOKENS",t,e,n,o],a=>it({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendTokens:i.mutate,sendTokensAsync:i.mutateAsync,status:i.status}},Yr=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=G(),o=r==null?void 0:r.bech32Address,i=oe(["USE_SEND_IBC_TOKENS",t,e,n,o],a=>ct({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendIbcTokens:i.mutate,sendIbcTokensAsync:i.mutateAsync,status:i.status}},Xr=({codeId:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=G(),s=o==null?void 0:o.bech32Address,u=oe(["USE_INSTANTIATE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,codeId:t};return at(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,instantiateContract:u.mutate,instantiateContractAsync:u.mutateAsync,status:u.status}},Jr=({contractAddress:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=G(),s=o==null?void 0:o.bech32Address,u=oe(["USE_EXECUTE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,contractAddress:t,memo:f.memo??"",funds:f.funds??[]};return ut(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,executeContract:u.mutate,executeContractAsync:u.mutateAsync,status:u.status}},es=(t,e)=>vt(["USE_QUERY_SMART",t,e],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or queryMsg undefined");return lt(t,e)},{enabled:!!t&&!!e}),ts=(t,e)=>vt(["USE_QUERY_RAW",e,t],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or key undefined");return pt(t,e)},{enabled:!!t&&!!e});import{QueryClient as Nn,QueryClientProvider as Rn}from"@tanstack/react-query";import{ReactQueryDevtools as Un}from"@tanstack/react-query-devtools";import{useEffect as Fn,useState as kn}from"react";import{Fragment as On,jsx as Bn}from"react/jsx-runtime";var _t=({children:t})=>{let[e,n]=kn(!1);return Fn(()=>{n(!0)},[]),Bn(On,{children:e?t:null})};import{useEffect as Ft}from"react";var Wn=()=>{let t=typeof window<"u"&&window.sessionStorage.getItem(R)==="Active",{_reconnect:e,_onReconnectFailed:n,_reconnectConnector:r}=y(),{activeChain:o,wcSignClient:s}=m();return Ft(()=>{r&&(t&&o?W({onError:n}):!t&&e&&W({onError:n}))},[]),Ft(()=>{var i,a,u,f,d,A,C,E;r&&(r==="cosmostation"&&((a=(i=pe()).subscription)==null||a.call(i,()=>{W({onError:n})})),r==="keplr"&&((f=(u=ue()).subscription)==null||f.call(u,()=>{W({onError:n})})),r==="leap"&&((A=(d=le()).subscription)==null||A.call(d,()=>{W({onError:n})})),r==="walletconnect"&&s&&((E=(C=Q()).subscription)==null||E.call(C,()=>{W({onError:n})})))},[r,s]),null},kt=()=>(Wn(),null);import{jsx as Ot,jsxs as Bt}from"react/jsx-runtime";var Mn=new Nn({}),ys=({children:t,grazOptions:e,debug:n,...r})=>(e&&ot(e),Bt(Rn,{client:Mn,...r,children:[Bt(_t,{children:[Ot(kt,{}),t]}),n?Ot(Un,{initialIsOpen:!1,position:"bottom-right"}):null]},"graz-provider"));export{kt as GrazEvents,ys as GrazProvider,Fe as WALLET_TYPES,_e as WalletType,K as checkWallet,et as clearRecentChain,ot as configureGraz,Z as connect,J as createClients,Re as createQueryClient,ee as createSigningClients,tr as defineChain,nr as defineChainInfo,bt as defineChains,me as disconnect,ut as executeContract,tt as getActiveChainCurrency,mo as getAvailableWallets,st as getBalanceStaked,rt as getBalances,pe as getCosmostation,ue as getKeplr,le as getLeap,pt as getQueryRaw,lt as getQuerySmart,bo as getRecentChain,Zt as getWCCosmostation,Vt as getWCKeplr,$t as getWCLeap,$ as getWallet,Q as getWalletConnect,at as instantiateContract,or as mainnetChains,rr as mainnetChainsArray,W as reconnect,ct as sendIbcTokens,it as sendTokens,ge as suggestChain,nt as suggestChainAndConnect,sr as testnetChains,ir as testnetChainsArray,G as useAccount,vr as useActiveChain,_r as useActiveChainCurrency,Fr as useActiveChainValidators,wr as useBalance,Er as useBalanceStaked,jn as useBalances,ne as useCheckWallet,qr as useClients,Sr as useConnect,xr as useDisconnect,Jr as useExecuteContract,Wn as useGrazEvents,Xr as useInstantiateContract,vn as useOfflineSigners,Kr as useQueryClient,ts as useQueryRaw,es as useQuerySmart,kr as useRecentChain,Yr as useSendIbcTokens,Zr as useSendTokens,Ar as useSigners,Pr as useSigningClients,Or as useSuggestChain,Br as useSuggestChainAndConnect};
|
|
1
|
+
import{a as Nt,b as Mt,c as M}from"./chunk-HBC2VYPF.mjs";var Ze=Nt((no,$e)=>{$e.exports=w;var v=null;try{v=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function w(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}w.prototype.__isLong__;Object.defineProperty(w.prototype,"__isLong__",{value:!0});function _(t){return(t&&t.__isLong__)===!0}w.isLong=_;var qe={},Pe={};function U(t,e){var n,r,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(r=Pe[t],r)?r:(n=S(t,(t|0)<0?-1:0,!0),o&&(Pe[t]=n),n)):(t|=0,(o=-128<=t&&t<128)&&(r=qe[t],r)?r:(n=S(t,t<0?-1:0,!1),o&&(qe[t]=n),n))}w.fromInt=U;function j(t,e){if(isNaN(t))return e?R:O;if(e){if(t<0)return R;if(t>=Ke)return Ve}else{if(t<=-Le)return D;if(t+1>=Le)return He}return t<0?j(-t,e).neg():S(t%z|0,t/z|0,e)}w.fromNumber=j;function S(t,e,n){return new w(t,e,n)}w.fromBits=S;var te=Math.pow;function ce(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return O;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||36<n)throw RangeError("radix");var r;if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(r===0)return ce(t.substring(1),e,n).neg();for(var o=j(te(n,8)),s=O,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),u=parseInt(t.substring(i,i+a),n);if(a<8){var f=j(te(n,a));s=s.mul(f).add(j(u))}else s=s.mul(o),s=s.add(j(u))}return s.unsigned=e,s}w.fromString=ce;function F(t,e){return typeof t=="number"?j(t,e):typeof t=="string"?ce(t,e):S(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}w.fromValue=F;var Ge=65536,zt=1<<24,z=Ge*Ge,Ke=z*z,Le=Ke/2,ze=U(zt),O=U(0);w.ZERO=O;var R=U(0,!0);w.UZERO=R;var L=U(1);w.ONE=L;var Qe=U(1,!0);w.UONE=Qe;var ie=U(-1);w.NEG_ONE=ie;var He=S(-1,2147483647,!1);w.MAX_VALUE=He;var Ve=S(-1,-1,!0);w.MAX_UNSIGNED_VALUE=Ve;var D=S(0,-2147483648,!1);w.MIN_VALUE=D;var c=w.prototype;c.toInt=function(){return this.unsigned?this.low>>>0:this.low};c.toNumber=function(){return this.unsigned?(this.high>>>0)*z+(this.low>>>0):this.high*z+(this.low>>>0)};c.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(D)){var n=j(e),r=this.div(n),o=r.mul(n).sub(this);return r.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=j(te(e,6),this.unsigned),i=this,a="";;){var u=i.div(s),f=i.sub(u.mul(s)).toInt()>>>0,d=f.toString(e);if(i=u,i.isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}};c.getHighBits=function(){return this.high};c.getHighBitsUnsigned=function(){return this.high>>>0};c.getLowBits=function(){return this.low};c.getLowBitsUnsigned=function(){return this.low>>>0};c.getNumBitsAbs=function(){if(this.isNegative())return this.eq(D)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,n=31;n>0&&!(e&1<<n);n--);return this.high!=0?n+33:n+1};c.isZero=function(){return this.high===0&&this.low===0};c.eqz=c.isZero;c.isNegative=function(){return!this.unsigned&&this.high<0};c.isPositive=function(){return this.unsigned||this.high>=0};c.isOdd=function(){return(this.low&1)===1};c.isEven=function(){return(this.low&1)===0};c.equals=function(e){return _(e)||(e=F(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};c.eq=c.equals;c.notEquals=function(e){return!this.eq(e)};c.neq=c.notEquals;c.ne=c.notEquals;c.lessThan=function(e){return this.comp(e)<0};c.lt=c.lessThan;c.lessThanOrEqual=function(e){return this.comp(e)<=0};c.lte=c.lessThanOrEqual;c.le=c.lessThanOrEqual;c.greaterThan=function(e){return this.comp(e)>0};c.gt=c.greaterThan;c.greaterThanOrEqual=function(e){return this.comp(e)>=0};c.gte=c.greaterThanOrEqual;c.ge=c.greaterThanOrEqual;c.compare=function(e){if(_(e)||(e=F(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};c.comp=c.compare;c.negate=function(){return!this.unsigned&&this.eq(D)?D:this.not().add(L)};c.neg=c.negate;c.add=function(e){_(e)||(e=F(e));var n=this.high>>>16,r=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,u=e.low>>>16,f=e.low&65535,d=0,x=0,C=0,E=0;return E+=s+f,C+=E>>>16,E&=65535,C+=o+u,x+=C>>>16,C&=65535,x+=r+a,d+=x>>>16,x&=65535,d+=n+i,d&=65535,S(C<<16|E,d<<16|x,this.unsigned)};c.subtract=function(e){return _(e)||(e=F(e)),this.add(e.neg())};c.sub=c.subtract;c.multiply=function(e){if(this.isZero())return O;if(_(e)||(e=F(e)),v){var n=v.mul(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(e.isZero())return O;if(this.eq(D))return e.isOdd()?D:O;if(e.eq(D))return this.isOdd()?D:O;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(ze)&&e.lt(ze))return j(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,u=e.high&65535,f=e.low>>>16,d=e.low&65535,x=0,C=0,E=0,k=0;return k+=i*d,E+=k>>>16,k&=65535,E+=s*d,C+=E>>>16,E&=65535,E+=i*f,C+=E>>>16,E&=65535,C+=o*d,x+=C>>>16,C&=65535,C+=s*f,x+=C>>>16,C&=65535,C+=i*u,x+=C>>>16,C&=65535,x+=r*d+o*f+s*u+i*a,x&=65535,S(E<<16|k,x<<16|C,this.unsigned)};c.mul=c.multiply;c.divide=function(e){if(_(e)||(e=F(e)),e.isZero())throw Error("division by zero");if(v){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?v.div_u:v.div_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?R:O;var r,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return R;if(e.gt(this.shru(1)))return Qe;s=R}else{if(this.eq(D)){if(e.eq(L)||e.eq(ie))return D;if(e.eq(D))return L;var i=this.shr(1);return r=i.div(e).shl(1),r.eq(O)?e.isNegative()?L:ie:(o=this.sub(e.mul(r)),s=r.add(o.div(e)),s)}else if(e.eq(D))return this.unsigned?R:O;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=O}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),u=a<=48?1:te(2,a-48),f=j(r),d=f.mul(e);d.isNegative()||d.gt(o);)r-=u,f=j(r,this.unsigned),d=f.mul(e);f.isZero()&&(f=L),s=s.add(f),o=o.sub(d)}return s};c.div=c.divide;c.modulo=function(e){if(_(e)||(e=F(e)),v){var n=(this.unsigned?v.rem_u:v.rem_s)(this.low,this.high,e.low,e.high);return S(n,v.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};c.mod=c.modulo;c.rem=c.modulo;c.not=function(){return S(~this.low,~this.high,this.unsigned)};c.and=function(e){return _(e)||(e=F(e)),S(this.low&e.low,this.high&e.high,this.unsigned)};c.or=function(e){return _(e)||(e=F(e)),S(this.low|e.low,this.high|e.high,this.unsigned)};c.xor=function(e){return _(e)||(e=F(e)),S(this.low^e.low,this.high^e.high,this.unsigned)};c.shiftLeft=function(e){return _(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):S(0,this.low<<e-32,this.unsigned)};c.shl=c.shiftLeft;c.shiftRight=function(e){return _(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?S(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):S(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};c.shr=c.shiftRight;c.shiftRightUnsigned=function(e){if(_(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return S(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?S(n,0,this.unsigned):S(n>>>e-32,0,this.unsigned)};c.shru=c.shiftRightUnsigned;c.shr_u=c.shiftRightUnsigned;c.toSigned=function(){return this.unsigned?S(this.low,this.high,!1):this};c.toUnsigned=function(){return this.unsigned?this:S(this.low,this.high,!0)};c.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};c.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};c.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]};w.fromBytes=function(e,n,r){return r?w.fromBytesLE(e,n):w.fromBytesBE(e,n)};w.fromBytesLE=function(e,n){return new w(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)};w.fromBytesBE=function(e,n){return new w(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)}});import{GasPrice as Yt}from"@cosmjs/stargate";import{create as Fe}from"zustand";import{createJSONStorage as Rt}from"zustand/middleware";import{persist as ke,subscribeWithSelector as Be}from"zustand/middleware";var je=(a=>(a.KEPLR="keplr",a.LEAP="leap",a.COSMOSTATION="cosmostation",a.WALLETCONNECT="walletconnect",a.WC_KEPLR_MOBILE="wc_keplr_mobile",a.WC_LEAP_MOBILE="wc_leap_mobile",a.WC_COSMOSTATION_MOBILE="wc_cosmostation_mobile",a))(je||{}),Oe=["keplr","leap","cosmostation","walletconnect","wc_keplr_mobile","wc_leap_mobile","wc_cosmostation_mobile"];var Ut={recentChain:null,defaultChain:null,defaultSigningClient:"stargate",walletType:"keplr",walletConnect:{options:null,web3Modal:null},_notFoundFn:()=>null,_onReconnectFailed:()=>null,_reconnect:!1,_reconnectConnector:null},V={account:null,activeChain:null,balances:null,clients:null,offlineSigner:null,offlineSignerAmino:null,offlineSignerAuto:null,signingClients:null,status:"disconnected",wcSignClient:null},qt={name:"graz-session",version:1,partialize:t=>({account:t.account,activeChain:t.activeChain}),storage:Rt(()=>sessionStorage)},Pt={name:"graz-internal",partialize:t=>({recentChain:t.recentChain,_reconnect:t._reconnect,_reconnectConnector:t._reconnectConnector}),version:1},m=Fe(Be(ke(()=>V,qt))),y=Fe(Be(ke(()=>Ut,Pt)));import{SigningCosmWasmClient as Re}from"@cosmjs/cosmwasm-stargate";import{SigningStargateClient as Ue}from"@cosmjs/stargate";import{Tendermint34Client as Lt}from"@cosmjs/tendermint-rpc";import{QueryClient as Gt}from"@cosmjs/stargate";import{assert as We,isNonNullObject as Ne}from"@cosmjs/utils";var Me=(...t)=>{let{tendermint:e}=m.getState().clients,n=new Gt(e),r=t.map(o=>o(n));for(let o of r){We(Ne(o),"Extension must be a non-null object");for(let[s,i]of Object.entries(o)){We(Ne(i),`Module must be a non-null object. Found type ${typeof i} for module "${s}".`);let a=n[s]||{};n[s]={...a,...i}}}return n};var J=async({rpc:t,rpcHeaders:e})=>{let n={url:t,headers:{...e||{}}},[r,o,s]=await Promise.all([Re.connect(n),Ue.connect(n),Lt.connect(t)]);return{cosmWasm:r,stargate:o,tendermint:s}},ee=async t=>{let{rpc:e,rpcHeaders:n,offlineSignerAuto:r,cosmWasmSignerOptions:o={},stargateSignerOptions:s={}}=t,i={url:e,headers:{...n||{}}},[a,u]=await Promise.all([Re.connectWithSigner(i,r,o),Ue.connectWithSigner(i,r,s)]);return{cosmWasm:a,stargate:u}};var Je=Mt(Ze());import{fromBech32 as Kt}from"@cosmjs/encoding";import{SignClient as Qt}from"@walletconnect/sign-client";import{getSdkError as Ht}from"@walletconnect/utils";var q=()=>typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1,Ye=()=>q()&&navigator.userAgent.toLowerCase().includes("android"),Xe=()=>q()&&(navigator.userAgent.toLowerCase().includes("iphone")||navigator.userAgent.toLowerCase().includes("ipad"));var ae=(t,e,n=new Error("Promise timed out"))=>{let r=new Promise((o,s)=>{setTimeout(()=>{s(n)},e)});return Promise.race([t,r])};var K=(t=y.getState().walletType)=>{try{return $(t),!0}catch{return!1}},P=()=>{window.sessionStorage.removeItem(M),m.setState(V)},ue=()=>{if(typeof window.keplr<"u"){let t=window.keplr;return Object.assign(t,{subscription:r=>(window.addEventListener("keplr_keystorechange",()=>{P(),r()}),()=>{window.removeEventListener("keplr_keystorechange",()=>{P(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.keplr is not defined")},le=()=>{if(typeof window.leap<"u"){let t=window.leap;return Object.assign(t,{subscription:r=>(window.addEventListener("leap_keystorechange",()=>{P(),r()}),()=>{window.removeEventListener("leap_keystorechange",()=>{P(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.leap is not defined")},pe=()=>{if(typeof window.cosmostation.providers.keplr<"u"){let t=window.cosmostation.providers.keplr;return Object.assign(t,{subscription:r=>(window.cosmostation.cosmos.on("accountChanged",()=>{P(),r()}),()=>{window.cosmostation.cosmos.off("accountChanged",()=>{P(),r()})})})}throw y.getState()._notFoundFn(),new Error("window.cosmostation.providers.keplr is not defined")},Q=t=>{var Te,De,_e;if(!((_e=(De=(Te=y.getState().walletConnect)==null?void 0:Te.options)==null?void 0:De.projectId)!=null&&_e.trim()))throw new Error("walletConnect.options.projectId is not defined");let e=(t==null?void 0:t.encoding)||"base64",n=p=>{if(!t)return;let{appUrl:l,formatNativeUrl:g}=t;if(q()){if(Ye())if(!p)window.open(l.mobile.android,"_self","noreferrer noopener");else{let h=g(l.mobile.android,p,"android");window.open(h,"_self","noreferrer noopener")}if(Xe())if(!p)window.open(l.mobile.ios,"_self","noreferrer noopener");else{let h=g(l.mobile.ios,p,"ios");window.open(h,"_self","noreferrer noopener")}}},r=()=>{let{wcSignClient:p}=m.getState();if(!p)throw new Error("walletConnect.signClient is not defined");P(),y.setState({_reconnect:!1,_reconnectConnector:null,recentChain:null})},o=async p=>{let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");if(!p)throw new Error("No wallet connect session");await l.disconnect({topic:p,reason:Ht("USER_DISCONNECTED")}),await a(l),r()},s=p=>{var l,g;try{let{wcSignClient:h}=m.getState();if(!h)throw new Error("walletConnect.signClient is not defined");let A=h.session.getAll().at(-1);if(!A)return;let b=(g=(l=h.session.getAll().at(-1))==null?void 0:l.namespaces.cosmos)==null?void 0:g.accounts.find(I=>I.startsWith(`cosmos:${p}`));if(!(A.expiry*1e3>Date.now()+1e3))throw o(A.topic),new Error("invalid session");if(!b)try{let I=h.find({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!I.length)throw new Error("no session");return I.at(-1)}catch(I){if(!I.message.toLowerCase().includes("no matching key"))throw I}return A}catch(h){if(!h.message.toLowerCase().includes("no matching key"))throw h}},i=p=>{try{return s(p)}catch{return}},a=async p=>{try{let l=p.core.pairing.pairings.getAll({active:!1});if(!l.length)return;await Promise.all(l.map(async g=>{await p.core.pairing.pairings.delete(g.topic,{code:7001,message:"clear pairing"})}))}catch(l){if(!l.message.toLowerCase().includes("no matching key"))throw l}},u=async()=>{let{walletConnect:p}=y.getState();if(!(p!=null&&p.options))throw new Error("walletConnect.options is not defined");let{wcSignClient:l}=m.getState();if(l)return m.setState({wcSignClient:l}),l;let g=await Qt.init(p.options);return m.setState({wcSignClient:g}),g},f=p=>{let{wcSignClient:l}=m.getState();if(l)return l.events.on("session_delete",g=>{r()}),l.events.on("session_expire",g=>{r()}),l.events.on("session_event",g=>{var h,A;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((A=m.getState().account)==null?void 0:A.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()}),()=>{l.events.off("session_delete",g=>{r()}),l.events.off("session_expire",g=>{r()}),l.events.off("session_event",g=>{var h,A;if(g.params.event.name==="accountsChanged"&&((h=g.params.event.data)==null?void 0:h[0])!==((A=m.getState().account)==null?void 0:A.bech32Address)){let b=g.params.chainId.split(":")[1];b&&d(b)}else p()})}},d=async p=>{var Y;let{wcSignClient:l}=m.getState();if(!l)throw new Error("enable walletConnect.signClient is not defined");let{walletConnect:g}=y.getState();if(!((Y=g==null?void 0:g.options)!=null&&Y.projectId))throw new Error("walletConnect.options.projectId is not defined");let{Web3Modal:h}=await import("@web3modal/standalone"),A=new h({projectId:g.options.projectId,walletConnectVersion:2,enableExplorer:!1,explorerRecommendedWalletIds:"NONE",...g.web3Modal}),{account:b,activeChain:B}=m.getState(),I=i(p);if((B==null?void 0:B.chainId)!==p&&!I||!b){let{uri:T,approval:X}=await l.connect({requiredNamespaces:{cosmos:{methods:["cosmos_getAccounts","cosmos_signAmino","cosmos_signDirect"],chains:[`cosmos:${p}`],events:["chainChanged","accountsChanged"]}}});if(!T)throw new Error("No wallet connect uri");t?n(T):await A.openModal({uri:T});try{await ae((async()=>{await X()})(),4e4,new Error("Modal approval timeout"))}catch(ve){if(A.closeModal(),!ve.message.toLowerCase().includes("no matching key"))return Promise.reject(ve)}return t||A.closeModal(),Promise.resolve()}try{await ae((async()=>{let T=await C(p);m.setState({account:T})})(),1e4,new Error("Connection timeout"))}catch(T){if(o(I==null?void 0:I.topic),!T.message.toLowerCase().includes("no matching key"))throw T}},x=async p=>{var A;let{wcSignClient:l}=m.getState();if(!l)throw new Error("walletConnect.signClient is not defined");let g=(A=s(p))==null?void 0:A.topic;if(!g)throw new Error("No wallet connect session");n();let h=await l.request({topic:g,chainId:`cosmos:${p}`,request:{method:"cosmos_getAccounts",params:{}}});if(!h[0])throw new Error("No wallet connect account");return{address:h[0].address,algo:h[0].algo,pubkey:new Uint8Array(Buffer.from(h[0].pubkey,e))}},C=async p=>{let{address:l,algo:g,pubkey:h}=await x(p);return{address:Kt(l).data,algo:g,bech32Address:l,name:"",pubKey:h,isKeystone:!1,isNanoLedger:!1}},E=async(...p)=>{var T,X;let[l,g,h]=p,{account:A,wcSignClient:b}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!A)throw new Error("account is not defined");let B=(T=s(l))==null?void 0:T.topic;if(!B)throw new Error("No wallet connect session");if(!h.bodyBytes)throw new Error("No bodyBytes");if(!h.authInfoBytes)throw new Error("No authInfoBytes");let I={topic:B,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:{...h,bodyBytes:Buffer.from(h.bodyBytes).toString(e),authInfoBytes:Buffer.from(h.authInfoBytes).toString(e),accountNumber:(X=h.accountNumber)==null?void 0:X.toString()}}}};return n(),await b.request(I)},k=async(...p)=>{let[l,g,h]=p,{signature:A,signed:b}=await E(l,g,h);return{signed:{chainId:b.chainId,accountNumber:Je.default.fromString(b.accountNumber,!1),authInfoBytes:new Uint8Array(Buffer.from(b.authInfoBytes,e)),bodyBytes:new Uint8Array(Buffer.from(b.bodyBytes,e))},signature:A}},re=async(...p)=>{var T;let[l,g,h,A]=p,{wcSignClient:b}=m.getState(),{account:B}=m.getState();if(!b)throw new Error("walletConnect.signClient is not defined");if(!B)throw new Error("account is not defined");let I=(T=s(l))==null?void 0:T.topic;if(!I)throw new Error("No wallet connect session");return n(),await b.request({topic:I,chainId:`cosmos:${l}`,request:{method:"cosmos_signDirect",params:{signerAddress:g,signDoc:h}}})},H=async(...p)=>{let[l,g,h,A]=p;return await re(l,g,h)},se=p=>({getAccounts:async()=>[await x(p)],signDirect:(l,g)=>k(p,l,g)}),N=p=>({getAccounts:async()=>[await x(p)],signAmino:(l,g)=>H(p,l,g)});return{enable:d,experimentalSuggestChain:async(...p)=>{await Promise.reject(new Error("WalletConnect does not support experimentalSuggestChain"))},getKey:C,getOfflineSigner:p=>({getAccounts:async()=>[await x(p)],signDirect:(l,g)=>k(p,l,g),signAmino:(l,g)=>H(p,l,g)}),getOfflineSignerAuto:async p=>(await C(p)).isNanoLedger?N(p):se(p),getOfflineSignerOnlyAmino:N,signAmino:H,signDirect:k,subscription:f,init:u}},Vt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Keplr mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"keplrwallet://",android:"intent://"}},walletType:"wc_keplr_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=com.chainapsis.keplr;scheme=keplrwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return Q(t)},$t=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"base64",appUrl:{mobile:{ios:"leapcosmos://",android:"intent://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>{let a=o.replaceAll("/","").replaceAll(":",""),u=encodeURIComponent(s);switch(i){case"ios":return`${a}://wcV2?${u}`;case"android":return`${a}://wcV2?${u}#Intent;package=io.leapwallet.cosmos;scheme=leapwallet;end;`;default:return`${a}://wc?uri=${u}`}}};return Q(t)},Zt=()=>{var e,n,r;if(!((r=(n=(e=y.getState().walletConnect)==null?void 0:e.options)==null?void 0:n.projectId)!=null&&r.trim()))throw new Error("walletConnect.options.projectId is not defined");if(!q())throw new Error("WalletConnect Leap mobile is only supported in mobile");let t={encoding:"hex",appUrl:{mobile:{ios:"cosmostation://",android:"cosmostation://"}},walletType:"wc_leap_mobile",formatNativeUrl:(o,s,i)=>`${o.replaceAll("/","").replaceAll(":","")}://wc?${s}`};return Q(t)},$=(t=y.getState().walletType)=>{switch(t){case"keplr":return ue();case"leap":return le();case"cosmostation":return pe();case"walletconnect":return Q();case"wc_keplr_mobile":return Vt();case"wc_leap_mobile":return $t();case"wc_cosmostation_mobile":return Zt();default:throw new Error("Unknown wallet type")}},go=()=>Object.fromEntries(Oe.map(t=>[t,K(t)]));var Z=async t=>{var e;try{let{defaultChain:n,recentChain:r,walletType:o}=y.getState(),s=(t==null?void 0:t.walletType)||o;if(!K(s))throw new Error(`${s} is not available`);let a=$(s),u=(t==null?void 0:t.chain)||r||n;if(!u)throw new Error("No last known connected chain, connect action requires chain info");m.setState(N=>{let Ie=y.getState()._reconnect||!!y.getState()._reconnectConnector||!!u;return N.activeChain&&N.activeChain.chainId!==u.chainId?{status:"connecting"}:Ie?{status:"reconnecting"}:{status:"connecting"}});let{account:f,activeChain:d}=m.getState();if(await((e=a.init)==null?void 0:e.call(a)),!f||(d==null?void 0:d.chainId)!==u.chainId){await a.enable(u.chainId);let N=await a.getKey(u.chainId);m.setState({account:N})}let x=a.getOfflineSigner(u.chainId),C=a.getOfflineSignerOnlyAmino(u.chainId),E=await a.getOfflineSignerAuto(u.chainId),k=u.gas?Yt.fromString(`${u.gas.price}${u.gas.denom}`):void 0,[re,H]=await Promise.all([J(u),ee({...u,offlineSignerAuto:E,cosmWasmSignerOptions:{gasPrice:k,...(t==null?void 0:t.signerOpts)||{}}})]);y.setState({recentChain:u,walletType:s,_reconnect:!!(t!=null&&t.autoReconnect),_reconnectConnector:s}),m.setState({activeChain:u,clients:re,offlineSigner:x,offlineSignerAmino:C,offlineSignerAuto:E,signingClients:H,status:"connected"}),typeof window<"u"&&window.sessionStorage.setItem(M,"Active");let{account:se}=m.getState();return{account:se,walletType:s,chain:u}}catch(n){throw console.error("connect ",n),m.getState().account===null&&m.setState({status:"disconnected"}),m.getState().account&&m.getState().activeChain&&m.setState({status:"connected"}),n}},me=async(t=!1)=>(typeof window<"u"&&window.sessionStorage.removeItem(M),m.setState(V),y.setState(e=>({_reconnect:!1,_reconnectConnector:null,recentChain:t?null:e.recentChain})),Promise.resolve()),W=async t=>{var o;let{recentChain:e,_reconnectConnector:n,_reconnect:r}=y.getState();try{let s=K(n||void 0);if(e&&s&&n)return await Z({chain:e,walletType:n,autoReconnect:r})}catch(s){(o=t==null?void 0:t.onError)==null||o.call(t,s),me()}};var et=()=>{y.setState({recentChain:null})},tt=t=>{let{activeChain:e}=m.getState();return e==null?void 0:e.currencies.find(n=>n.coinMinimalDenom===t)},Io=()=>y.getState().recentChain,ge=async t=>(await $().experimentalSuggestChain(t),t),nt=async({chainInfo:t,rpcHeaders:e,gas:n,path:r,...o})=>{let s=await ge(t);return{...await Z({chain:{chainId:t.chainId,currencies:t.currencies,rest:t.rest,rpc:t.rpc,rpcHeaders:e,gas:n,path:r},...o}),chain:s}};var ot=(t={})=>(y.setState(e=>({defaultChain:t.defaultChain||e.defaultChain,defaultSigningClient:t.defaultSigningClient||e.defaultSigningClient,walletConnect:t.walletConnect||e.walletConnect,walletType:t.defaultWallet||e.walletType,_notFoundFn:t.onNotFound||e._notFoundFn,_onReconnectFailed:t.onReconnectFailed||e._onReconnectFailed,_reconnect:t.autoReconnect===void 0?!0:t.autoReconnect||e._reconnect})),t);var rt=async t=>{let{activeChain:e,signingClients:n}=m.getState();if(!e||!n)throw new Error("No connected account detected");let{defaultSigningClient:r}=y.getState();return await Promise.all(e.currencies.map(async s=>{let i=s.coinMinimalDenom.startsWith("cw20:");return n[r].getBalance(t,i?s.coinMinimalDenom.replace("cw20:",""):s.coinMinimalDenom)}))},st=async t=>{let{clients:e}=m.getState();if(!(e!=null&&e.stargate))throw new Error("Stargate client is not ready");return e.stargate.getBalanceStaked(t)},it=async({senderAddress:t,recipientAddress:e,amount:n,fee:r,memo:o})=>{let{defaultSigningClient:s}=y.getState(),{signingClients:i}=m.getState();if(!i)throw new Error("No connected account detected");if(!t)throw new Error("senderAddress is not defined");return i[s].sendTokens(t,e,n,r,o)},ct=async({senderAddress:t,recipientAddress:e,transferAmount:n,sourcePort:r,sourceChannel:o,timeoutHeight:s,timeoutTimestamp:i,fee:a,memo:u})=>{let{signingClients:f}=m.getState();if(!(f!=null&&f.stargate))throw new Error("Stargate signing client is not ready");if(!t)throw new Error("senderAddress is not defined");return f.stargate.sendIbcTokens(t,e,n,r,o,s,i,a,u)},at=async({senderAddress:t,msg:e,fee:n,options:r,label:o,codeId:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.instantiate(t,s,e,o,n,r)},ut=async({senderAddress:t,msg:e,fee:n,contractAddress:r,funds:o,memo:s})=>{let{signingClients:i}=m.getState();if(!(i!=null&&i.cosmWasm))throw new Error("CosmWasm signing client is not ready");return i.cosmWasm.execute(t,r,e,n,s,o)},lt=async(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");return await n.cosmWasm.queryContractSmart(t,e)},pt=(t,e)=>{let{clients:n}=m.getState();if(!(n!=null&&n.cosmWasm))throw new Error("CosmWasm client is not ready");let r=new TextEncoder().encode(e);return n.cosmWasm.queryContractRaw(t,r)};import{Bech32Address as Xt}from"@keplr-wallet/cosmos";var gt={coinDenom:"axl",coinMinimalDenom:"uaxl",coinDecimals:6,coinGeckoId:"axelar-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/axl.png"},Jt={coinDenom:"usdc",coinMinimalDenom:"uusdc",coinDecimals:6,coinGeckoId:"usd-coin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdc.png"},en={coinDenom:"dai",coinMinimalDenom:"dai-wei",coinDecimals:18,coinGeckoId:"dai",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/dai.png"},tn={coinDenom:"usdt",coinMinimalDenom:"uusdt",coinDecimals:6,coinGeckoId:"tether",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/usdt.png"},nn={coinDenom:"weth-wei",coinMinimalDenom:"weth",coinDecimals:18,coinGeckoId:"weth",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/weth.png"},on={coinDenom:"wbtc-satoshi",coinMinimalDenom:"wbtc",coinDecimals:8,coinGeckoId:"wrapped-bitcoin",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/axelar/images/wbtc.png"},mt=[gt,Jt,en,tn,nn,on],fe={rpc:"https://rpc.axelar.strange.love",rest:"https://api.axelar.strange.love",chainId:"axelar-dojo-1",chainName:"Axelar",stakeCurrency:gt,bip44:{coinType:118},bech32Config:Xt.defaultBech32Config("axelar"),currencies:mt,feeCurrencies:mt};import{Bech32Address as rn}from"@keplr-wallet/cosmos";var dt={coinDenom:"atom",coinMinimalDenom:"uatom",coinDecimals:6,coinGeckoId:"cosmos",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},ft=[dt],de={rpc:"https://rpc.cosmoshub.strange.love",rest:"https://api.cosmoshub.strange.love",chainId:"cosmoshub-4",chainName:"Cosmos Hub",stakeCurrency:dt,bip44:{coinType:118},bech32Config:rn.defaultBech32Config("cosmos"),currencies:ft,feeCurrencies:ft};import{Bech32Address as sn}from"@keplr-wallet/cosmos";var yt={coinDenom:"juno",coinMinimalDenom:"ujuno",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},cn={coinDenom:"neta",coinMinimalDenom:"cw20:juno168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8s4j5awr",coinDecimals:6,coinGeckoId:"neta",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/neta.png"},an={coinDenom:"marble",coinMinimalDenom:"cw20:juno1g2g7ucurum66d42g8k5twk34yegdq8c82858gz0tq2fc75zy7khssgnhjl",coinDecimals:3,coinGeckoId:"marble",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/marble.png"},un={coinDenom:"hope",coinMinimalDenom:"cw20:juno1re3x67ppxap48ygndmrc7har2cnc7tcxtm9nplcas4v0gc3wnmvs3s807z",coinDecimals:6,coinGeckoId:"hope-galaxy",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hope.png"},ln={coinDenom:"rac",coinMinimalDenom:"cw20:juno1r4pzw8f9z0sypct5l9j906d47z998ulwvhvqe5xdwgy8wf84583sxwh0pa",coinDecimals:6,coinGeckoId:"racoon",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/rac.png"},pn={coinDenom:"block",coinMinimalDenom:"cw20:juno1y9rf7ql6ffwkv02hsgd4yruz23pn4w97p75e2slsnkm0mnamhzysvqnxaq",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/block.png"},mn={coinDenom:"dhk",coinMinimalDenom:"cw20:juno1tdjwrqmnztn2j3sj2ln9xnyps5hs48q3ddwjrz7jpv6mskappjys5czd49",coinDecimals:0,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/dhk.png"},gn={coinDenom:"raw",coinMinimalDenom:"cw20:juno15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hes5sn38g",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/raw.png",coinGeckoId:"junoswap-raw-dao"},fn={coinDenom:"asvt",coinMinimalDenom:"cw20:juno17wzaxtfdw5em7lc94yed4ylgjme63eh73lm3lutp2rhcxttyvpwsypjm4w",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/asvt.png"},dn={coinDenom:"hns",coinMinimalDenom:"cw20:juno1ur4jx0sxchdevahep7fwq28yk4tqsrhshdtylz46yka3uf6kky5qllqp4k",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/hns.svg"},hn={coinDenom:"joe",coinMinimalDenom:"cw20:juno1n7n7d5088qlzlj37e9mgmkhx6dfgtvt02hqxq66lcap4dxnzdhwqfmgng3",coinDecimals:6,coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/joe.png"},ht=[yt,cn,an,un,ln,pn,mn,gn,fn,dn,hn],he={rpc:"https://rpc.juno.strange.love",rest:"https://api.juno.strange.love",chainId:"juno-1",chainName:"Juno",stakeCurrency:yt,bip44:{coinType:118},bech32Config:sn.defaultBech32Config("juno"),currencies:ht,feeCurrencies:ht};import{Bech32Address as yn}from"@keplr-wallet/cosmos";var wt={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/cosmoshub/images/atom.png"},Cn={coinDenom:"ion",coinMinimalDenom:"uion",coinDecimals:6,coinGeckoId:"ion",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/osmosis/images/ion.png"},Ct=[wt,Cn],ye={rpc:"https://rpc.osmosis.strange.love",rest:"https://api.osmosis.strange.love",chainId:"osmosis-1",chainName:"Osmosis",stakeCurrency:wt,bip44:{coinType:118},bech32Config:yn.defaultBech32Config("osmo"),currencies:Ct,feeCurrencies:Ct};import{Bech32Address as wn}from"@keplr-wallet/cosmos";var At={coinDenom:"somm",coinMinimalDenom:"usomm",coinDecimals:6,coinGeckoId:"sommelier",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/sommelier/images/somm.png"},St=[At],Ce={rpc:"https://rpc.sommelier.strange.love",rest:"https://api.sommelier.strange.love",chainId:"sommelier-3",chainName:"Sommelier",stakeCurrency:At,bip44:{coinType:118},bech32Config:wn.defaultBech32Config("somm"),currencies:St,feeCurrencies:St};import{Bech32Address as Sn}from"@keplr-wallet/cosmos";var Et={coinDenom:"CRE",coinMinimalDenom:"ucre",coinDecimals:6,coinGeckoId:"crescent",coinImageUrl:"https://raw.githubusercontent.com/crescent-network/asset/main/images/coin/CRE.png"},xt=[Et],we={rpc:"https://testnet-endpoint.crescent.network/rpc/crescent",rest:"https://testnet-endpoint.crescent.network/api/crescent",chainId:"mooncat-1-1",chainName:"Crescent Testnet",bip44:{coinType:118},bech32Config:Sn.defaultBech32Config("CRE"),currencies:xt,feeCurrencies:xt,stakeCurrency:Et,coinType:118};import{Bech32Address as An}from"@keplr-wallet/cosmos";var Se={coinDenom:"junox",coinMinimalDenom:"ujunox",coinDecimals:6,coinGeckoId:"juno-network",coinImageUrl:"https://raw.githubusercontent.com/cosmos/chain-registry/master/juno/images/juno.png"},xn=[Se],Ae={rpc:"https://rpc.uni.junonetwork.io",rest:"https://api.uni.junonetwork.io",chainId:"uni-5",chainName:"Juno Testnet",stakeCurrency:Se,bip44:{coinType:118},bech32Config:An.defaultBech32Config("juno"),currencies:xn,feeCurrencies:[Se],coinType:118};import{Bech32Address as En}from"@keplr-wallet/cosmos";var xe={coinDenom:"osmo",coinMinimalDenom:"uosmo",coinDecimals:6,coinGeckoId:"osmosis",coinImageUrl:"https://dhj8dql1kzq2v.cloudfront.net/white/osmo.png"},bn=[xe],Ee={rpc:"https://testnet-rpc.osmosis.zone",rest:"https://testnet-rest.osmosis.zone",chainId:"osmo-test-4",chainName:"Osmosis Testnet",stakeCurrency:xe,bip44:{coinType:118},bech32Config:En.defaultBech32Config("osmo"),currencies:bn,feeCurrencies:[xe],coinType:118};var bt=t=>t,nr=t=>t,or=t=>t,rr=bt({axelar:fe,cosmoshub:de,juno:he,osmosis:ye,sommelier:Ce}),sr=[fe,de,he,ye,Ce],ir=bt({crescent:we,juno:Ae,osmosis:Ee}),cr=[we,Ae,Ee];import{useMutation as It,useQuery as be}from"@tanstack/react-query";import{useEffect as Dn}from"react";import{shallow as _n}from"zustand/shallow";import{useQuery as In}from"@tanstack/react-query";import{shallow as Tn}from"zustand/shallow";var gr=()=>y(t=>({walletType:t.walletType,isCosmostation:t.walletType==="cosmostation",isCosmostationMobile:t.walletType==="wc_cosmostation_mobile",isKeplr:t.walletType==="keplr",isKeplrMobile:t.walletType==="wc_keplr_mobile",isLeap:t.walletType==="leap",isLeapMobile:t.walletType==="wc_leap_mobile",isWalletConnect:t.walletType==="walletconnect"}),Tn),ne=t=>{let n=["USE_CHECK_WALLET",y(o=>t||o.walletType)];return In(n,({queryKey:[,o]})=>K(o))};var G=({onConnect:t,onDisconnect:e}={})=>{let n=m(o=>o.account),r=m(o=>o.status);return Dn(()=>m.subscribe(o=>o.status,(o,s)=>{if(o==="connected"){let{account:i,activeChain:a}=m.getState(),{walletType:u}=y.getState();t==null||t({account:i,chain:a,walletType:u,isReconnect:s==="reconnecting"})}o==="disconnected"&&(e==null||e())}),[t,e]),{data:n,isConnected:!!n,isConnecting:r==="connecting",isDisconnected:r==="disconnected",isReconnecting:r==="reconnecting",isLoading:r==="connecting"||r==="reconnecting",reconnect:W,status:r}},vn=t=>{let{data:e}=G(),n=t||(e==null?void 0:e.bech32Address);return be(["USE_BALANCES",n],({queryKey:[,s]})=>rt(s),{enabled:!!n,refetchOnMount:!1,refetchOnReconnect:!0,refetchOnWindowFocus:!1})},xr=(t,e)=>{let{data:n}=vn(e);return be(["USE_BALANCE",n,t,e],({queryKey:[,s]})=>s==null?void 0:s.find(i=>i.denom===t),{enabled:!!n})},Er=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=It(["USE_CONNECT",t,e,n],Z,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:e,onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=ne();return{connect:i=>o.mutate(i),connectAsync:i=>o.mutateAsync(i),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status}},br=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=It(["USE_DISCONNECT",t,e,n],me,{onError:s=>Promise.resolve(t==null?void 0:t(s,void 0)),onMutate:e,onSuccess:()=>Promise.resolve(n==null?void 0:n(void 0))});return{disconnect:s=>o.mutate(s),disconnectAsync:s=>o.mutateAsync(s),error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,status:o.status}},jn=()=>m(t=>({signer:t.offlineSigner,signerAmino:t.offlineSignerAmino,signerAuto:t.offlineSignerAuto}),_n),Ir=()=>jn(),Tr=t=>{let{data:e}=G(),n=t||(e==null?void 0:e.bech32Address);return be(["USE_BALANCE_STAKED",n],({queryKey:[,s]})=>st(n),{enabled:!!n})};import{useMutation as Tt,useQuery as Dt}from"@tanstack/react-query";var Fr=()=>m(t=>t.activeChain),kr=t=>Dt(["USE_ACTIVE_CHAIN_CURRENCY",t],({queryKey:[,r]})=>tt(r)),Br=(t,e="BOND_STATUS_BONDED")=>Dt(["USE_ACTIVE_CHAIN_VALIDATORS",t,e],({queryKey:[,o,s]})=>o.staking.validators(s),{enabled:typeof t<"u"}),Wr=()=>({data:y(e=>e.recentChain),clear:et}),Nr=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=Tt(["USE_SUGGEST_CHAIN",t,e,n],ge,{onError:(s,i)=>Promise.resolve(t==null?void 0:t(s,i)),onMutate:e,onSuccess:s=>Promise.resolve(n==null?void 0:n(s))});return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,suggest:o.mutate,suggestAsync:o.mutateAsync,status:o.status}},Mr=({onError:t,onLoading:e,onSuccess:n}={})=>{let o=Tt(["USE_SUGGEST_CHAIN_AND_CONNECT",t,e,n],nt,{onError:(i,a)=>Promise.resolve(t==null?void 0:t(i,a)),onMutate:i=>e==null?void 0:e(i),onSuccess:i=>Promise.resolve(n==null?void 0:n(i))}),{data:s}=ne();return{error:o.error,isLoading:o.isLoading,isSuccess:o.isSuccess,isSupported:!!s,status:o.status,suggestAndConnect:o.mutate,suggestAndConnectAsync:o.mutateAsync}};import{useQuery as _t}from"@tanstack/react-query";var Lr=t=>{let e=m(o=>o.clients);return _t(["USE_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?J(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({clients:o})},initialData:e})},zr=t=>{let e=m(o=>o.signingClients);return _t(["USE_SIGNING_CLIENTS",t,e],({queryKey:[,o,s]})=>o!=null&&o.rpc?ee(o):s,{refetchOnMount:!1,refetchOnWindowFocus:!1,onSuccess:o=>{m.setState({signingClients:o})},initialData:e})};import{useQuery as On}from"@tanstack/react-query";var Vr=(...t)=>{let e=["USE_QUERY_CLIENT",...t];return On(e,({queryKey:[,...r]})=>Me(...t),{refetchOnMount:!1,refetchOnWindowFocus:!1})};import{useMutation as oe,useQuery as vt}from"@tanstack/react-query";var Jr=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=G(),o=r==null?void 0:r.bech32Address,i=oe(["USE_SEND_TOKENS",t,e,n,o],a=>it({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendTokens:i.mutate,sendTokensAsync:i.mutateAsync,status:i.status}},es=({onError:t,onLoading:e,onSuccess:n}={})=>{let{data:r}=G(),o=r==null?void 0:r.bech32Address,i=oe(["USE_SEND_IBC_TOKENS",t,e,n,o],a=>ct({senderAddress:o,...a}),{onError:(a,u)=>Promise.resolve(t==null?void 0:t(a,u)),onMutate:e,onSuccess:a=>Promise.resolve(n==null?void 0:n(a))});return{error:i.error,isLoading:i.isLoading,isSuccess:i.isSuccess,sendIbcTokens:i.mutate,sendIbcTokensAsync:i.mutateAsync,status:i.status}},ts=({codeId:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=G(),s=o==null?void 0:o.bech32Address,u=oe(["USE_INSTANTIATE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,codeId:t};return at(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,instantiateContract:u.mutate,instantiateContractAsync:u.mutateAsync,status:u.status}},ns=({contractAddress:t,onError:e,onLoading:n,onSuccess:r})=>{let{data:o}=G(),s=o==null?void 0:o.bech32Address,u=oe(["USE_EXECUTE_CONTRACT",e,n,r,t,s],f=>{if(!s)throw new Error("senderAddress is undefined");let d={...f,fee:f.fee??"auto",senderAddress:s,contractAddress:t,memo:f.memo??"",funds:f.funds??[]};return ut(d)},{onError:(f,d)=>Promise.resolve(e==null?void 0:e(f,d)),onMutate:n,onSuccess:f=>Promise.resolve(r==null?void 0:r(f))});return{error:u.error,isLoading:u.isLoading,isSuccess:u.isSuccess,executeContract:u.mutate,executeContractAsync:u.mutateAsync,status:u.status}},os=(t,e)=>vt(["USE_QUERY_SMART",t,e],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or queryMsg undefined");return lt(t,e)},{enabled:!!t&&!!e}),rs=(t,e)=>vt(["USE_QUERY_RAW",e,t],({queryKey:[,o]})=>{if(!t||!e)throw new Error("address or key undefined");return pt(t,e)},{enabled:!!t&&!!e});import{QueryClient as Mn,QueryClientProvider as Rn}from"@tanstack/react-query";import{ReactQueryDevtools as Un}from"@tanstack/react-query-devtools";import{useEffect as Fn,useState as kn}from"react";import{Fragment as Bn,jsx as Wn}from"react/jsx-runtime";var jt=({children:t})=>{let[e,n]=kn(!1);return Fn(()=>{n(!0)},[]),Wn(Bn,{children:e?t:null})};import{useEffect as Ot}from"react";var Nn=()=>{let t=typeof window<"u"&&window.sessionStorage.getItem(M)==="Active",{_reconnect:e,_onReconnectFailed:n,_reconnectConnector:r}=y(),{activeChain:o,wcSignClient:s}=m();return Ot(()=>{r&&(t&&o?W({onError:n}):!t&&e&&W({onError:n}))},[]),Ot(()=>{var i,a,u,f,d,x,C,E;r&&(r==="cosmostation"&&((a=(i=pe()).subscription)==null||a.call(i,()=>{W({onError:n})})),r==="keplr"&&((f=(u=ue()).subscription)==null||f.call(u,()=>{W({onError:n})})),r==="leap"&&((x=(d=le()).subscription)==null||x.call(d,()=>{W({onError:n})})),r==="walletconnect"&&s&&((E=(C=Q()).subscription)==null||E.call(C,()=>{W({onError:n})})))},[r,s]),null},Ft=()=>(Nn(),null);import{jsx as kt,jsxs as Bt}from"react/jsx-runtime";var qn=new Mn({}),Ss=({children:t,grazOptions:e,debug:n,...r})=>(e&&ot(e),Bt(Rn,{client:qn,...r,children:[Bt(jt,{children:[kt(Ft,{}),t]}),n?kt(Un,{initialIsOpen:!1,position:"bottom-right"}):null]},"graz-provider"));export{Ft as GrazEvents,Ss as GrazProvider,Oe as WALLET_TYPES,je as WalletType,K as checkWallet,et as clearRecentChain,ot as configureGraz,Z as connect,J as createClients,Me as createQueryClient,ee as createSigningClients,nr as defineChain,or as defineChainInfo,bt as defineChains,me as disconnect,ut as executeContract,tt as getActiveChainCurrency,go as getAvailableWallets,st as getBalanceStaked,rt as getBalances,pe as getCosmostation,ue as getKeplr,le as getLeap,pt as getQueryRaw,lt as getQuerySmart,Io as getRecentChain,Zt as getWCCosmostation,Vt as getWCKeplr,$t as getWCLeap,$ as getWallet,Q as getWalletConnect,at as instantiateContract,rr as mainnetChains,sr as mainnetChainsArray,W as reconnect,ct as sendIbcTokens,it as sendTokens,ge as suggestChain,nt as suggestChainAndConnect,ir as testnetChains,cr as testnetChainsArray,G as useAccount,Fr as useActiveChain,kr as useActiveChainCurrency,Br as useActiveChainValidators,gr as useActiveWalletType,xr as useBalance,Tr as useBalanceStaked,vn as useBalances,ne as useCheckWallet,Lr as useClients,Er as useConnect,br as useDisconnect,ns as useExecuteContract,Nn as useGrazEvents,ts as useInstantiateContract,jn as useOfflineSigners,Vr as useQueryClient,rs as useQueryRaw,os as useQuerySmart,Wr as useRecentChain,es as useSendIbcTokens,Jr as useSendTokens,Ir as useSigners,zr as useSigningClients,Nr as useSuggestChain,Mr as useSuggestChainAndConnect};
|
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.43
|
|
4
|
+
"version": "0.0.43",
|
|
5
5
|
"author": "Griko Nibras <griko@strange.love>",
|
|
6
6
|
"repository": "https://github.com/strangelove-ventures/graz.git",
|
|
7
7
|
"homepage": "https://github.com/strangelove-ventures/graz",
|