@wormhole-foundation/wormhole-connect 0.3.17 → 0.3.18-beta.1-development

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.
Files changed (119) hide show
  1. package/dist/assets/{ccip-ClzeMJ_j.js → ccip-D0VzrDKe.js} +1 -1
  2. package/dist/assets/cosmos-O8tTKeuk.js +37 -0
  3. package/dist/assets/{cosmwasm-DGW772Mb.js → cosmwasm-C3cFK7BC.js} +3 -3
  4. package/dist/assets/{ens-validation.es6-QG6c_Puy.js → ens-validation.es6-gsmLKNwB.js} +1 -1
  5. package/dist/assets/{evm-naJ7fLYH.js → evm--aNcFZ6S.js} +31 -31
  6. package/dist/assets/{index-C1x31Jxk.js → index-BjIxvQFV.js} +1 -1
  7. package/dist/assets/{index-CRnaWQgW.js → index-ByeOkyS8.js} +1 -1
  8. package/dist/assets/{index-KMQj8MBB.js → index-CV4pfIw7.js} +1 -1
  9. package/dist/assets/index-ClKrV_HJ.js +2 -0
  10. package/dist/assets/index-Dqsfl0un.js +3 -0
  11. package/dist/assets/{index-IW_wClRI.js → index-NBWkKzTR.js} +1 -1
  12. package/dist/assets/{index.es-EmnxJ1lb.js → index.es-ASAVlsFm.js} +2 -2
  13. package/dist/assets/{solana-BZCNALCU.js → solana-Dn94-G2V.js} +2 -2
  14. package/dist/assets/{solanaEmbed.esm-D0yWLEo-.js → solanaEmbed.esm-rqFDr9AX.js} +1 -1
  15. package/dist/assets/{unsignedTransaction-D7VEWy8m.js → unsignedTransaction-B08fN_UW.js} +1 -1
  16. package/dist/main.js +10 -10
  17. package/dist/src/consts/wallet.d.ts.map +1 -1
  18. package/dist/src/utils/transferValidation.d.ts.map +1 -1
  19. package/dist/src/utils/wallet/evm.d.ts.map +1 -1
  20. package/lib/{algorand-CkjY5D1K.mjs → algorand-B9R5kDXf.mjs} +4 -4
  21. package/lib/{algorand-DDnN_ID4.js → algorand-BECExueP.js} +1 -1
  22. package/lib/{aptos-DB0RPcha.js → aptos-BpvpNYii.js} +2 -2
  23. package/lib/{aptos-Z3iITKq8.mjs → aptos-CgVUfeRr.mjs} +4 -4
  24. package/lib/{aptos-6cTTvSk4.mjs → aptos-Co4Dcnws.mjs} +1 -1
  25. package/lib/{aptos-D9ca5jNq.js → aptos-CzYa5HnG.js} +1 -1
  26. package/lib/{browser-AXXShtLO.mjs → browser-B79UewaZ.mjs} +2 -2
  27. package/lib/{browser-BvtYqM0e.js → browser-BnvapQOm.js} +1 -1
  28. package/lib/{ccip-B52yS2oB.mjs → ccip-CCScN0fp.mjs} +1 -1
  29. package/lib/{ccip-Dp5-rp5Q.js → ccip-DkkpA67F.js} +1 -1
  30. package/lib/{chain-D9bp2EtQ.mjs → chain-CkiAdRsF.mjs} +1 -1
  31. package/lib/{chain-CPTe1tkD.js → chain-dkt-tJ8j.js} +1 -1
  32. package/lib/cosmos-BGtn0ce4.js +37 -0
  33. package/lib/{cosmos-BSz_B76G.mjs → cosmos-CgRX0Wxh.mjs} +6 -6
  34. package/lib/{cosmwasm-CaHs2sxc.mjs → cosmwasm-CZJBnOEX.mjs} +6 -6
  35. package/lib/{cosmwasm-Cv8Wo8qx.js → cosmwasm-RnTbX7PN.js} +2 -2
  36. package/lib/{create-QAfMcr9_.js → create-BiAHw2aA.js} +1 -1
  37. package/lib/{create-BoVtddSH.mjs → create-CM-nUvHh.mjs} +1 -1
  38. package/lib/{ens-validation.es6-DfAlPWse.mjs → ens-validation.es6-2EaRqlcZ.mjs} +2 -2
  39. package/lib/{ens-validation.es6-ww_x-SMH.js → ens-validation.es6-Y7MuOU0N.js} +1 -1
  40. package/lib/{evm-DT3j3aq9.mjs → evm-C3NODduF.mjs} +6 -6
  41. package/lib/{evm-CoPf1imE.js → evm-DI8kbdHZ.js} +2 -2
  42. package/lib/{evm-BhVYgjXc.js → evm-DXOSgo1P.js} +29 -29
  43. package/lib/{evm-CBuTwR-T.mjs → evm-HVKpaILW.mjs} +1734 -1717
  44. package/lib/{index-DebiDC3v.mjs → index--a8G4lcW.mjs} +100 -90
  45. package/lib/{index-3Zvo5oFL.mjs → index-0Y0qAS5l.mjs} +4 -4
  46. package/lib/{index-C3Zck5Rw.js → index-8qn1dGJN.js} +1 -1
  47. package/lib/{index-DfM7GTS8.js → index-B4PE2HqL.js} +1 -1
  48. package/lib/{index-B0l5_Q9J.js → index-BJzrTwhK.js} +1 -1
  49. package/lib/{index-BVYQzNvU.mjs → index-BPseHNs4.mjs} +4 -4
  50. package/lib/{index-Qf6KscPe.js → index-BS73cCsm.js} +1 -1
  51. package/lib/{index-B2vcAnwF.mjs → index-Bmf0dJXk.mjs} +5 -5
  52. package/lib/{index-BGdIdofx.js → index-C2RXBAYV.js} +1 -1
  53. package/lib/{index-CZTcbGX2.mjs → index-C8vqaAeA.mjs} +4 -4
  54. package/lib/{index-BuGANYoC.mjs → index-CEYaDz-X.mjs} +1 -1
  55. package/lib/{index-pSA89lvn.js → index-CQ24ekSy.js} +1 -1
  56. package/lib/{index-CZvnNuux.js → index-CSSe0BOU.js} +1 -1
  57. package/lib/{index-Bb-fizMd.mjs → index-CSf329dI.mjs} +5 -5
  58. package/lib/{index-0QeIkLNc.mjs → index-CUpI3flq.mjs} +3 -3
  59. package/lib/{index-CKWTloVb.js → index-CYm8SRbD.js} +1 -1
  60. package/lib/{index-BH2yQPAH.js → index-C_Gyy-qu.js} +1 -1
  61. package/lib/{index-D8KRWXVM.js → index-C_nOcIfa.js} +1 -1
  62. package/lib/{index-1Eo1l_aF.mjs → index-Cf6LTh_3.mjs} +3 -3
  63. package/lib/{index-DApVqEXu.js → index-CjiTP7zj.js} +1 -1
  64. package/lib/{index-CbulvJtP.mjs → index-CjzZno1u.mjs} +72 -72
  65. package/lib/{index-GVnr7WyU.mjs → index-Cm6qfNE2.mjs} +4 -4
  66. package/lib/{index-BkJT27UH.mjs → index-CnDfWZ3N.mjs} +2 -2
  67. package/lib/{index-jbKWljQq.js → index-CrUwXkHx.js} +1 -1
  68. package/lib/{index-gQ5agivz.mjs → index-CtPlLWIc.mjs} +4 -4
  69. package/lib/{index-DvPjni-v.js → index-D2IEwdXM.js} +9 -9
  70. package/lib/{index-Vz6yRzMm.js → index-D3d590ml.js} +1 -1
  71. package/lib/{index-5hwKi82D.mjs → index-D44yXRrW.mjs} +4 -4
  72. package/lib/{index-CHReo22c.js → index-D7vEVSNu.js} +1 -1
  73. package/lib/{index-Bxy33sJ9.js → index-DD8O1gO1.js} +1 -1
  74. package/lib/{index-s1ZuI8l6.js → index-DMTxEDBY.js} +1 -1
  75. package/lib/{index-C4CEddS7.mjs → index-DRnbzgUh.mjs} +6 -6
  76. package/lib/{index-DHpMqzxK.mjs → index-D_DayKXK.mjs} +2 -2
  77. package/lib/{index-D6BOvMee.mjs → index-DabcAHr_.mjs} +4 -4
  78. package/lib/{index-2REgoevm.mjs → index-DkVqkU1n.mjs} +2 -2
  79. package/lib/{index-D7PEJvME.mjs → index-Dk_DxorB.mjs} +5 -5
  80. package/lib/{index-CCGipVdX.js → index-DnS14EZQ.js} +1 -1
  81. package/lib/{index-DAGHPE-U.mjs → index-Dsrx3yAj.mjs} +4 -4
  82. package/lib/{index-BdEy6H3x.mjs → index-Duj1DuCU.mjs} +4 -4
  83. package/lib/{index-TwqQtaM2.js → index-JwYCBrPA.js} +1 -1
  84. package/lib/{index-B6-c6P4Q.js → index-Nro7lr9I.js} +1 -1
  85. package/lib/{index-Bgifa0rO.js → index-UmTItYQP.js} +1 -1
  86. package/lib/{index-COMtOf9F.mjs → index-VNaGZYsT.mjs} +3 -3
  87. package/lib/{index-Bem-zTo9.mjs → index-jZS8RCBJ.mjs} +4 -4
  88. package/lib/index-vhST1GVD.js +1 -0
  89. package/lib/index-yVQrO-w_.js +3 -0
  90. package/lib/{index.es-DY974klV.mjs → index.es-BX3g_fEa.mjs} +4 -4
  91. package/lib/{index.es-Be-95F-D.js → index.es-DW3cpfqa.js} +2 -2
  92. package/lib/index.js +1 -1
  93. package/lib/index.mjs +1 -1
  94. package/lib/{libsodium-wrappers-Cz4RSKFI.js → libsodium-wrappers-DJv6_KfX.js} +1 -1
  95. package/lib/{libsodium-wrappers-DdBVKoIT.mjs → libsodium-wrappers-m9ZOqx0p.mjs} +1 -1
  96. package/lib/{sei-gjedWqjd.js → sei-BOeXaWS0.js} +1 -1
  97. package/lib/{sei-549wQo5R.mjs → sei-DFzWb_82.mjs} +2 -2
  98. package/lib/{solana-BpvtC9Y9.mjs → solana-BweAibG_.mjs} +6 -6
  99. package/lib/{solana-jJHTew4W.js → solana-DFmcWlKj.js} +2 -2
  100. package/lib/{solana-CLvKWwns.mjs → solana-DaSEOOB7.mjs} +3 -3
  101. package/lib/{solana-BTT9n5lW.js → solana-Dv03uKoX.js} +1 -1
  102. package/lib/{solanaEmbed.esm-Bqx3MQQh.mjs → solanaEmbed.esm-BxAUqIpC.mjs} +2 -2
  103. package/lib/{solanaEmbed.esm-D-AOxyK6.js → solanaEmbed.esm-DJ48k1vp.js} +1 -1
  104. package/lib/src/consts/wallet.d.ts.map +1 -1
  105. package/lib/src/utils/transferValidation.d.ts.map +1 -1
  106. package/lib/src/utils/wallet/evm.d.ts.map +1 -1
  107. package/lib/{sui-DYHKoyiY.js → sui-4qNYTJYI.js} +1 -1
  108. package/lib/{sui-DCCGAsfg.mjs → sui-CRlPg_-w.mjs} +1 -1
  109. package/lib/{sui-B-4YWOEj.js → sui-CU34Vo-z.js} +2 -2
  110. package/lib/{sui-DKRldaWr.mjs → sui-DR9_UAz0.mjs} +4 -4
  111. package/lib/{unsignedTransaction-Cs6URPzx.js → unsignedTransaction-oHvwquvT.js} +1 -1
  112. package/lib/{unsignedTransaction-Byv6FNac.mjs → unsignedTransaction-qG9mWtn-.mjs} +2 -2
  113. package/package.json +1 -1
  114. package/dist/assets/cosmos-mS8jzs-K.js +0 -37
  115. package/dist/assets/index-CP2t4FxN.js +0 -3
  116. package/dist/assets/index-CZxcLdx-.js +0 -2
  117. package/lib/cosmos-DQcVb2Ho.js +0 -37
  118. package/lib/index--52-Qo6j.js +0 -3
  119. package/lib/index-DzCniKbo.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__fileDeps=["assets/index-KMQj8MBB.js","assets/create-C0QenCKJ.js","main.js","main.css","assets/chain-CeDrBrSQ.js","assets/ens-validation.es6-QG6c_Puy.js","assets/index-CP2t4FxN.js","assets/index-CRnaWQgW.js","assets/unsignedTransaction-D7VEWy8m.js","assets/index-C1x31Jxk.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
- var hh=Object.defineProperty;var gh=(e,n,t)=>n in e?hh(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var me=(e,n,t)=>(gh(e,typeof n!="symbol"?n+"":n,t),t);import{bd as yp,be as Fi,aw as Ao,av as lc,ax as Sh,b6 as fc,bf as or,o as x,a0 as Ia,U as kh,d as ue,w as hp,V as Ph,X as gp,Y as Rh,Z as vh,bg as Bh,$ as bh,r as Sp,bh as ee,bi as ne,bj as Re,bk as Me,al as ar,am as Oh,bl as Mn,bm as pc,bn as sr,ad as Ah,an as Ih,bo as mc,bp as kp,ap as Th,bq as Sd,b0 as kd,b7 as Ch,aI as Nh,br as wh,ay as Eh,az as _h,aA as Uh,aB as Pd,aC as Jh,aD as Dh,G as j,L as _e,H as Fn,g as Mh,ba as Rn,x as Xo,S as qh,I as Hh,bs as Vh,bt as xo,af as Qh,bu as Wh,bv as Rd,bw as fl,bx as pl,by as ml,bz as Fh,bA as Gh,_ as vd,aG as Lh}from"../main.js";import{b as $h,H as ct,E as Pp,t as at,c as uo,m as Kh,U as sa,s as _u,G as Gi,C as zh,I as Yh,a as Rp,k as Uu,d as yl}from"./ens-validation.es6-QG6c_Puy.js";import{C as Zh,P as Xh}from"./chain-CeDrBrSQ.js";class Qn extends $h{constructor(t,r){super(t,r);me(this,"errorClass","HttpRequestException");me(this,"method",ct.Get);this.type=Pp.HttpRequest,this.method=r?r.method||ct.Get:ct.Get}}var xt;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.EARLY_HINTS=103]="EARLY_HINTS",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(xt||(xt={}));const{Axios:xh,AxiosError:jh,CanceledError:eg,isCancel:ng,CancelToken:tg,VERSION:rg,all:ig,Cancel:og,isAxiosError:ag,spread:sg,toFormData:dg,AxiosHeaders:ug,HttpStatusCode:cg,formToJSON:lg,getAdapter:fg,mergeConfig:pg}=yp,mg=Object.freeze(Object.defineProperty({__proto__:null,Axios:xh,AxiosError:jh,AxiosHeaders:ug,Cancel:og,CancelToken:tg,CanceledError:eg,HttpStatusCode:cg,VERSION:rg,all:ig,default:yp,formToJSON:lg,getAdapter:fg,isAxiosError:ag,isCancel:ng,mergeConfig:pg,spread:sg,toFormData:dg},Symbol.toStringTag,{value:"Module"})),no="Cosmwasm";function hl(e){try{const n=Fi.decodeToBytes(e);return{data:n.bytes,prefix:n.prefix}}catch{}try{return{data:lc.decode(e)}}catch{}try{return{data:fc.decode(e)}}catch{}throw new Error(`Cannot decode: ${e}`)}const Le=class Le{constructor(n){me(this,"platform",no);me(this,"address");me(this,"domain");me(this,"denom");me(this,"denomType");if(Le.instanceof(n)){const t=n;this.address=t.address,this.domain=t.domain,this.denom=t.denom,this.denomType=t.denomType;return}if(typeof n=="string"){if(n.length<=8){this.address=new Uint8Array(0),this.denom=n,this.denomType="native";return}if(n.indexOf("/")!==-1){const t=n.split("/");if(t.length>=3){const{data:r,prefix:o}=hl(t[t.length-2]);this.address=r,this.domain=o,this.denom=t[t.length-1],this.denomType=t.slice(0,t.length-2).join("/")}else{const{data:r}=hl(t[1]);this.address=r,this.denomType=t[0]}}else{if(!Le.isValidAddress(n))throw new Error(`Invalid Cosmwasm address: ${n}`);const{bytes:t,prefix:r}=Fi.decodeToBytes(n);this.address=t,this.domain=r}}else if(n instanceof Uint8Array)this.address=n;else if(Ao.instanceof(n))this.address=n.toUint8Array();else throw new Error(`Invalid Cosmwasm address ${n}`);if(!Le.validAddressLength(this.address))throw new Error("Expected 20 or 32 bytes address")}unwrap(){return this.toString()}toString(){return this.denomType!==void 0?this.denomType==="native"?this.denom:this.denomType==="ibc"?`${this.denomType.toLowerCase()}/${lc.encode(this.address).toUpperCase()}`:`${this.denomType}/${Le.encode(this.domain,this.address)}/${this.denom}`:Le.encode(this.domain,this.address)}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){const n=new Uint8Array(Ao.byteSize);return n.set(this.address,Ao.byteSize-this.address.length),new Ao(n)}static isValidAddress(n){try{const t=Fi.decodeToBytes(n);return Le.validAddressLength(t.bytes)}catch{}return!1}static encode(n,t){return Fi.encode(n,Fi.toWords(t))}static validAddressLength(n){if(n.length!==Le.contractAddressByteSize&&n.length!==Le.accountAddressByteSize)throw new Error(`Invalid Cosmwasm address, expected ${Le.contractAddressByteSize} or ${Le.accountAddressByteSize} bytes but got ${n.length}`);return!0}static instanceof(n){return n.platform===no}equals(n){return Le.instanceof(n)?this.toString()===n.toString():n.equals(this.toUniversalAddress())}};me(Le,"contractAddressByteSize",32),me(Le,"accountAddressByteSize",20);let je=Le;Sh(no,je);const bT=1e6,OT="/cosmwasm.wasm.v1.MsgExecuteContract",AT="/ibc.applications.transfer.v1.MsgTransfer",vp="transfer",IT="send_packet",TT="recv_packet",CT="packet_dst_channel",NT="packet_src_channel",wT="packet_src_port",ET="packet_dst_port",_T="packet_sequence",UT="packet_data",JT=60*60*1e3,Bp=[["Cosmoshub","cosmos"],["Evmos","evmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","osmo"],["Sei","sei"],["Terra","terra"],["Terra2","terra"],["Wormchain","wormhole"],["Xpla","xpla"],["Celestia","celestia"],["Stargaze","stars"],["Dymension","dym"],["Neutron","neutron"],["Seda","seda"],["Provenance","pb"]],bp=or(Bp);or(Bp,[1,[0]]);const Op=[["Mainnet",[["Cosmoshub","uatom"],["Evmos","aevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Terra","luna"],["Terra2","uluna"],["Wormchain","uworm"],["Xpla","uxpla"],["Celestia","utia"],["Dymension","adym"],["Stargaze","ustars"],["Neutron","untrn"],["Provenance","nhash"]]],["Testnet",[["Cosmoshub","uatom"],["Evmos","atevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Terra","luna"],["Terra2","uluna"],["Wormchain","uworm"],["Xpla","uxpla"],["Seda","aseda"]]],["Devnet",[["Cosmoshub","uatom"],["Evmos","atevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Terra","luna"],["Terra2","uluna"],["Wormchain","uworm"],["Xpla","uxpla"]]]],yg=or(Op);or(Op,[[0,2],[1]]);const hg=[["Mainnet",[["Wormchain",{Osmosis:"channel-3",Evmos:"channel-5",Kujira:"channel-9",Stargaze:"channel-12",Injective:"channel-13",Dymension:"channel-15"}],["Osmosis",{Wormchain:"channel-2186"}],["Evmos",{Wormchain:"channel-94"}],["Kujira",{Wormchain:"channel-113"}],["Injective",{Wormchain:"channel-183"}],["Dymension",{Wormchain:"channel-36"}],["Stargaze",{Wormchain:"channel-278"}]]],["Testnet",[["Wormchain",{Cosmoshub:"channel-5",Osmosis:"channel-9"}],["Cosmoshub",{Wormchain:"channel-3086"}],["Osmosis",{Wormchain:"channel-3906"}]]],["Devnet",[["Wormchain",{Cosmoshub:"channel-1",Osmosis:"channel-2"}],["Cosmoshub",{Wormchain:"channel-1"}],["Osmosis",{Wormchain:"channel-1"}]]]],gl=or(hg),gg=["Evmos","Injective"],Sg=[["Mainnet",[["Injective","https://lcd.injective.network"],["Evmos","https://rest.bd.evmos.org:1317"]]],["Testnet",[["Injective","https://k8s.testnet.lcd.injective.network"],["Evmos","https://rest.bd.evmos.dev:1317"]]],["Devnet",[["Injective","https://localhost:1234"],["Evmos","https://localhost:1233"]]]],kg=or(Sg),Pg=[["Mainnet",[["Terra","28.325"],["Terra2","0.015"],["Osmosis","0.025"],["Sei","0.02"],["Cosmoshub","0.025"],["Kujira","0.0051"],["Neutron","0.075"],["Celestia","0.02"],["Stargaze","1.1"],["Injective","700000000"],["Xpla","1147500000000"],["Evmos","25000000000"],["Dymension","5000000000"],["Provenance","2100"]]]],DT=or(Pg);var er={},co={},Te={},Ta={},Rg=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.Decimal=void 0;const qn=Rg(Ia),Sl=100;class Ae{static fromUserInput(n,t){Ae.verifyFractionalDigits(t);const r=n.match(/[^0-9.]/);if(r)throw new Error(`Invalid character at position ${r.index+1}`);let o,h;if(n==="")o="0",h="";else if(n.search(/\./)===-1)o=n,h="";else{const C=n.split(".");switch(C.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!C[1])throw new Error("Fractional part missing");o=C[0],h=C[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(h.length>t)throw new Error("Got more fractional digits than supported");const v=`${o}${h.padEnd(t,"0")}`;return new Ae(v,t)}static fromAtomics(n,t){return Ae.verifyFractionalDigits(t),new Ae(n,t)}static zero(n){return Ae.verifyFractionalDigits(n),new Ae("0",n)}static one(n){return Ae.verifyFractionalDigits(n),new Ae("1"+"0".repeat(n),n)}static verifyFractionalDigits(n){if(!Number.isInteger(n))throw new Error("Fractional digits is not an integer");if(n<0)throw new Error("Fractional digits must not be negative");if(n>Sl)throw new Error(`Fractional digits must not exceed ${Sl}`)}static compare(n,t){if(n.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return n.data.atomics.cmp(new qn.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(n,t){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format. Only non-negative integers in decimal representation supported.");this.data={atomics:new qn.default(n),fractionalDigits:t}}clone(){return new Ae(this.atomics,this.fractionalDigits)}floor(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Ae.fromAtomics(t.mul(n).toString(),this.fractionalDigits)}ceil(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Ae.fromAtomics(t.addn(1).mul(n).toString(),this.fractionalDigits)}toString(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n),r=this.data.atomics.mod(n);if(r.isZero())return t.toString();{const h=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${h}`}}toFloatApproximation(){const n=Number(this.toString());if(Number.isNaN(n))throw new Error("Conversion to number failed");return n}plus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new qn.default(n.atomics));return new Ae(t.toString(),this.fractionalDigits)}minus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.sub(new qn.default(n.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new Ae(t.toString(),this.fractionalDigits)}multiply(n){const t=this.data.atomics.mul(new qn.default(n.toString()));return new Ae(t.toString(),this.fractionalDigits)}equals(n){return Ae.compare(this,n)===0}isLessThan(n){return Ae.compare(this,n)<0}isLessThanOrEqual(n){return Ae.compare(this,n)<=0}isGreaterThan(n){return Ae.compare(this,n)>0}isGreaterThanOrEqual(n){return Ae.compare(this,n)>=0}}Ta.Decimal=Ae;var xn={},vg=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.Uint64=xn.Uint53=xn.Int53=xn.Uint32=void 0;const jo=vg(Ia),Bg=new jo.default("18446744073709551615",10,"be");class zi{static fromBigEndianBytes(n){return zi.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const r=t==="be"?n:Array.from(n).reverse();return new zi(r[0]*2**24+r[1]*2**16+r[2]*2**8+r[3])}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new zi(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<0||n>4294967295)throw new Error("Input not in uint32 range: "+n.toString());this.data=n}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}xn.Uint32=zi;class to{static fromString(n){if(!n.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new to(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<Number.MIN_SAFE_INTEGER||n>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+n.toString());this.data=n}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}xn.Int53=to;class yc{static fromString(n){const t=to.fromString(n);return new yc(t.toNumber())}constructor(n){const t=new to(n);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}toNumber(){return this.data.toNumber()}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}xn.Uint53=yc;class Ir{static fromBytesBigEndian(n){return Ir.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const r=t==="be"?Array.from(n):Array.from(n).reverse();return new Ir(new jo.default(r))}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Ir(new jo.default(n,10,"be"))}static fromNumber(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");let t;try{t=new jo.default(n)}catch{throw new Error("Input is not a safe integer")}return new Ir(t)}constructor(n){if(n.isNeg())throw new Error("Input is negative");if(n.gt(Bg))throw new Error("Input exceeds uint64 range");this.data=n}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toBigInt(){return BigInt(this.toString())}toNumber(){return this.data.toNumber()}}xn.Uint64=Ir;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var n=Ta;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var t=xn;Object.defineProperty(e,"Int53",{enumerable:!0,get:function(){return t.Int53}}),Object.defineProperty(e,"Uint32",{enumerable:!0,get:function(){return t.Uint32}}),Object.defineProperty(e,"Uint53",{enumerable:!0,get:function(){return t.Uint53}}),Object.defineProperty(e,"Uint64",{enumerable:!0,get:function(){return t.Uint64}})})(Te);var st={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.decodeTxRaw=void 0;const Bd=at;function bg(e){const n=Bd.TxRaw.decode(e);return{authInfo:Bd.AuthInfo.decode(n.authInfoBytes),body:Bd.TxBody.decode(n.bodyBytes),signatures:n.signatures}}Ca.decodeTxRaw=bg;var Gr={},zn={},mn={},Ge={},jn={},de={},Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.fromAscii=Lr.toAscii=void 0;function Og(e){const n=t=>t.split("").map(r=>{const o=r.charCodeAt(0);if(o<32||o>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+o);return o});return Uint8Array.from(n(e))}Lr.toAscii=Og;function Ag(e){return(t=>t.map(r=>{if(r<32||r>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+r);return String.fromCharCode(r)}))(Array.from(e)).join("")}Lr.fromAscii=Ag;var $r={},Ig=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),Tg=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Cg=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Ig(n,e,t);return Tg(n,e),n};Object.defineProperty($r,"__esModule",{value:!0});$r.fromBase64=$r.toBase64=void 0;const Ap=Cg(kh);function Ng(e){return Ap.fromByteArray(e)}$r.toBase64=Ng;function wg(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return Ap.toByteArray(e)}$r.fromBase64=wg;var kt={},da="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Ju={};for(var Io=0;Io<da.length;Io++){var bd=da.charAt(Io);if(Ju[bd]!==void 0)throw new TypeError(bd+" is ambiguous");Ju[bd]=Io}function Er(e){var n=e>>25;return(e&33554431)<<5^-(n>>0&1)&996825010^-(n>>1&1)&642813549^-(n>>2&1)&513874426^-(n>>3&1)&1027748829^-(n>>4&1)&705979059}function Ip(e){for(var n=1,t=0;t<e.length;++t){var r=e.charCodeAt(t);if(r<33||r>126)return"Invalid prefix ("+e+")";n=Er(n)^r>>5}for(n=Er(n),t=0;t<e.length;++t){var o=e.charCodeAt(t);n=Er(n)^o&31}return n}function Eg(e,n,t){if(t=t||90,e.length+7+n.length>t)throw new TypeError("Exceeds length limit");e=e.toLowerCase();var r=Ip(e);if(typeof r=="string")throw new Error(r);for(var o=e+"1",h=0;h<n.length;++h){var v=n[h];if(v>>5)throw new Error("Non 5-bit word");r=Er(r)^v,o+=da.charAt(v)}for(h=0;h<6;++h)r=Er(r);for(r^=1,h=0;h<6;++h){var C=r>>(5-h)*5&31;o+=da.charAt(C)}return o}function Tp(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";var t=e.toLowerCase(),r=e.toUpperCase();if(e!==t&&e!==r)return"Mixed-case string "+e;e=t;var o=e.lastIndexOf("1");if(o===-1)return"No separator character for "+e;if(o===0)return"Missing prefix for "+e;var h=e.slice(0,o),v=e.slice(o+1);if(v.length<6)return"Data too short";var C=Ip(h);if(typeof C=="string")return C;for(var w=[],D=0;D<v.length;++D){var J=v.charAt(D),I=Ju[J];if(I===void 0)return"Unknown character "+J;C=Er(C)^I,!(D+6>=v.length)&&w.push(I)}return C!==1?"Invalid checksum for "+e:{prefix:h,words:w}}function _g(){var e=Tp.apply(null,arguments);if(typeof e=="object")return e}function Ug(e){var n=Tp.apply(null,arguments);if(typeof n=="object")return n;throw new Error(n)}function Na(e,n,t,r){for(var o=0,h=0,v=(1<<t)-1,C=[],w=0;w<e.length;++w)for(o=o<<n|e[w],h+=n;h>=t;)h-=t,C.push(o>>h&v);if(r)h>0&&C.push(o<<t-h&v);else{if(h>=n)return"Excess padding";if(o<<t-h&v)return"Non-zero padding"}return C}function Jg(e){var n=Na(e,8,5,!0);if(Array.isArray(n))return n}function Dg(e){var n=Na(e,8,5,!0);if(Array.isArray(n))return n;throw new Error(n)}function Mg(e){var n=Na(e,5,8,!1);if(Array.isArray(n))return n}function qg(e){var n=Na(e,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}var Hg={decodeUnsafe:_g,decode:Ug,encode:Eg,toWordsUnsafe:Jg,toWords:Dg,fromWordsUnsafe:Mg,fromWords:qg},Vg=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),Qg=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Wg=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Vg(n,e,t);return Qg(n,e),n};Object.defineProperty(kt,"__esModule",{value:!0});kt.normalizeBech32=kt.fromBech32=kt.toBech32=void 0;const ua=Wg(Hg);function Cp(e,n,t){return ua.encode(e,ua.toWords(n),t)}kt.toBech32=Cp;function Np(e,n=1/0){const t=ua.decode(e,n);return{prefix:t.prefix,data:new Uint8Array(ua.fromWords(t.words))}}kt.fromBech32=Np;function Fg(e){const{prefix:n,data:t}=Np(e);return Cp(n,t)}kt.normalizeBech32=Fg;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.fromHex=Kr.toHex=void 0;function Gg(e){let n="";for(const t of e)n+=("0"+t.toString(16)).slice(-2);return n}Kr.toHex=Gg;function Lg(e){if(e.length%2!==0)throw new Error("hex string length must be a multiple of 2");const n=new Uint8Array(e.length/2);for(let t=0;t<n.length;t++){const r=2*t,o=e.slice(r,r+2);if(!o.match(/[0-9a-f]{2}/i))throw new Error("hex string contains invalid characters");n[t]=parseInt(o,16)}return n}Kr.fromHex=Lg;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.toRfc3339=zr.fromRfc3339=void 0;const $g=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function pr(e,n=2){return e.toString().padStart(n,"0")}function Kg(e){const n=$g.exec(e);if(!n)throw new Error("Date string is not in RFC3339 format");const t=+n[1],r=+n[2],o=+n[3],h=+n[4],v=+n[5],C=+n[6],w=n[7]?Math.floor(+n[7]*1e3):0;let D,J,I;n[8]==="Z"?(D=1,J=0,I=0):(D=n[8].substring(0,1)==="-"?-1:1,J=+n[8].substring(1,3),I=+n[8].substring(4,6));const g=D*(J*60+I)*60,R=new Date;return R.setUTCFullYear(t,r-1,o),R.setUTCHours(h,v,C,w),new Date(R.getTime()-g*1e3)}zr.fromRfc3339=Kg;function zg(e){const n=e.getUTCFullYear(),t=pr(e.getUTCMonth()+1),r=pr(e.getUTCDate()),o=pr(e.getUTCHours()),h=pr(e.getUTCMinutes()),v=pr(e.getUTCSeconds()),C=pr(e.getUTCMilliseconds(),3);return`${n}-${t}-${r}T${o}:${h}:${v}.${C}Z`}zr.toRfc3339=zg;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.fromUtf8=Yr.toUtf8=void 0;function Yg(e){return new TextEncoder().encode(e)}Yr.toUtf8=Yg;function Zg(e,n=!1){const t=!n;return new TextDecoder("utf-8",{fatal:t}).decode(e)}Yr.fromUtf8=Zg;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toUtf8=e.fromUtf8=e.toRfc3339=e.fromRfc3339=e.toHex=e.fromHex=e.toBech32=e.normalizeBech32=e.fromBech32=e.toBase64=e.fromBase64=e.toAscii=e.fromAscii=void 0;var n=Lr;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var t=$r;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return t.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return t.toBase64}});var r=kt;Object.defineProperty(e,"fromBech32",{enumerable:!0,get:function(){return r.fromBech32}}),Object.defineProperty(e,"normalizeBech32",{enumerable:!0,get:function(){return r.normalizeBech32}}),Object.defineProperty(e,"toBech32",{enumerable:!0,get:function(){return r.toBech32}});var o=Kr;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var h=zr;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return h.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return h.toRfc3339}});var v=Yr;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return v.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return v.toUtf8}})})(de);var en={},Oe={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.arrayContentStartsWith=Zr.arrayContentEquals=void 0;function Xg(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;++t)if(e[t]!==n[t])return!1;return!0}Zr.arrayContentEquals=Xg;function xg(e,n){if(e.length<n.length)return!1;for(let t=0;t<n.length;++t)if(e[t]!==n[t])return!1;return!0}Zr.arrayContentStartsWith=xg;var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.assertDefinedAndNotNull=Pt.assertDefined=Pt.assert=void 0;function jg(e,n){if(!e)throw new Error(n||"condition is not truthy")}Pt.assert=jg;function eS(e,n){if(e===void 0)throw new Error(n??"value is undefined")}Pt.assertDefined=eS;function nS(e,n){if(e==null)throw new Error(n??"value is undefined or null")}Pt.assertDefinedAndNotNull=nS;var wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.sleep=void 0;async function tS(e){return new Promise(n=>setTimeout(n,e))}wa.sleep=tS;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.isDefined=Rt.isUint8Array=Rt.isNonNullObject=void 0;function wp(e){return typeof e=="object"&&e!==null}Rt.isNonNullObject=wp;function rS(e){return!(!wp(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof ue.Buffer<"u"&&typeof ue.Buffer.isBuffer<"u"&&ue.Buffer.isBuffer(e))}Rt.isUint8Array=rS;function iS(e){return e!==void 0}Rt.isDefined=iS;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isUint8Array=e.isNonNullObject=e.isDefined=e.sleep=e.assertDefinedAndNotNull=e.assertDefined=e.assert=e.arrayContentStartsWith=e.arrayContentEquals=void 0;var n=Zr;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return n.arrayContentStartsWith}});var t=Pt;Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return t.assert}}),Object.defineProperty(e,"assertDefined",{enumerable:!0,get:function(){return t.assertDefined}}),Object.defineProperty(e,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return t.assertDefinedAndNotNull}});var r=wa;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return r.sleep}});var o=Rt;Object.defineProperty(e,"isDefined",{enumerable:!0,get:function(){return o.isDefined}}),Object.defineProperty(e,"isNonNullObject",{enumerable:!0,get:function(){return o.isNonNullObject}}),Object.defineProperty(e,"isUint8Array",{enumerable:!0,get:function(){return o.isUint8Array}})})(Oe);var oS=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),aS=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),sS=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&oS(n,e,t);return aS(n,e),n};Object.defineProperty(en,"__esModule",{value:!0});en.pbkdf2Sha512=en.pbkdf2Sha512Noble=en.pbkdf2Sha512NodeCrypto=en.pbkdf2Sha512Subtle=en.getSubtle=en.getNodeCrypto=void 0;const jt=Oe,dS=Ph,uS=gp;async function Ep(){try{const e=await Promise.resolve().then(()=>sS(hp()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}en.getNodeCrypto=Ep;async function _p(){var n,t,r;let e=(n=globalThis==null?void 0:globalThis.crypto)==null?void 0:n.subtle;return e||(e=(r=(t=globalThis==null?void 0:globalThis.crypto)==null?void 0:t.webcrypto)==null?void 0:r.subtle),e}en.getSubtle=_p;async function Up(e,n,t,r,o){return(0,jt.assert)(e,"Argument subtle is falsy"),(0,jt.assert)(typeof e=="object","Argument subtle is not of type object"),(0,jt.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,jt.assert)(typeof e.deriveBits=="function","subtle.deriveBits is not a function"),e.importKey("raw",n,{name:"PBKDF2"},!1,["deriveBits"]).then(h=>e.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:"SHA-512"}},h,o*8).then(v=>new Uint8Array(v)))}en.pbkdf2Sha512Subtle=Up;async function Jp(e,n,t,r,o){return(0,jt.assert)(e,"Argument nodeCrypto is falsy"),(0,jt.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,jt.assert)(typeof e.pbkdf2=="function","nodeCrypto.pbkdf2 is not a function"),new Promise((h,v)=>{e.pbkdf2(n,t,r,o,"sha512",(C,w)=>{C?v(C):h(Uint8Array.from(w))})})}en.pbkdf2Sha512NodeCrypto=Jp;async function Dp(e,n,t,r){return(0,dS.pbkdf2Async)(uS.sha512,e,n,{c:t,dkLen:r})}en.pbkdf2Sha512Noble=Dp;async function cS(e,n,t,r){const o=await _p();if(o)return Up(o,e,n,t,r);{const h=await Ep();return h?Jp(h,e,n,t,r):Dp(e,n,t,r)}}en.pbkdf2Sha512=cS;var _n={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.toRealUint8Array=void 0;function lS(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}Ai.toRealUint8Array=lS;Object.defineProperty(_n,"__esModule",{value:!0});_n.sha512=_n.Sha512=_n.sha256=_n.Sha256=void 0;const fS=Rh,pS=gp,Mp=Ai;class qp{constructor(n){this.blockSize=512/8,this.impl=fS.sha256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Mp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}_n.Sha256=qp;function mS(e){return new qp(e).digest()}_n.sha256=mS;class Hp{constructor(n){this.blockSize=1024/8,this.impl=pS.sha512.create(),n&&this.update(n)}update(n){return this.impl.update((0,Mp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}_n.Sha512=Hp;function yS(e){return new Hp(e).digest()}_n.sha512=yS;Object.defineProperty(jn,"__esModule",{value:!0});jn.Bip39=jn.EnglishMnemonic=jn.mnemonicToEntropy=jn.entropyToMnemonic=void 0;const kl=de,hS=en,gS=_n,hc=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];function Vp(e){return Array.from(e).map(n=>n.toString(2).padStart(8,"0")).join("")}function Qp(e){const t=e.length*8/32,r=(0,gS.sha256)(e);return Vp(r).slice(0,t)}function Wp(e){return parseInt(e,2)}const SS=[16,20,24,28,32],kS=[12,15,18,21,24];function Fp(e){if(SS.indexOf(e.length)===-1)throw new Error("invalid input length");const n=Vp(e),t=Qp(e);return(n+t).match(/(.{11})/g).map(v=>{const C=Wp(v);return hc[C]}).join(" ")}jn.entropyToMnemonic=Fp;const PS="Invalid number of words",RS="Found word that is not in the wordlist",vS="Invalid entropy",BS="Invalid mnemonic checksum";function Du(e){return e.normalize("NFKD")}function gc(e){const n=Du(e).split(" ");if(!kS.includes(n.length))throw new Error(PS);const t=n.map(D=>{const J=hc.indexOf(D);if(J===-1)throw new Error(RS);return J.toString(2).padStart(11,"0")}).join(""),r=Math.floor(t.length/33)*32,o=t.slice(0,r),h=t.slice(r),v=o.match(/(.{1,8})/g).map(Wp);if(v.length<16||v.length>32||v.length%4!==0)throw new Error(vS);const C=Uint8Array.from(v);if(Qp(C)!==h)throw new Error(BS);return C}jn.mnemonicToEntropy=gc;class nr{constructor(n){if(!nr.mnemonicMatcher.test(n))throw new Error("Invalid mnemonic format");const t=n.split(" "),r=[12,15,18,21,24];if(r.indexOf(t.length)===-1)throw new Error(`Invalid word count in mnemonic (allowed: ${r} got: ${t.length})`);for(const o of t)if(nr.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");gc(n),this.data=n}toString(){return this.data}}jn.EnglishMnemonic=nr;nr.wordlist=hc;nr.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class bS{static encode(n){return new nr(Fp(n))}static decode(n){return gc(n.toString())}static async mnemonicToSeed(n,t){const r=(0,kl.toUtf8)(Du(n.toString())),o="mnemonic"+(t?Du(t):""),h=(0,kl.toUtf8)(o);return(0,hS.pbkdf2Sha512)(r,h,2048,64)}}jn.Bip39=bS;var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.Hmac=void 0;class OS{constructor(n,t){const r=new n().blockSize;this.hash=h=>new n().update(h).digest();let o=t;if(o.length>r&&(o=this.hash(o)),o.length<r){const h=new Uint8Array(r-o.length);o=new Uint8Array([...o,...h])}this.oKeyPad=o.map(h=>h^92),this.iKeyPad=o.map(h=>h^54),this.messageHasher=new n,this.blockSize=r,this.update(this.iKeyPad)}update(n){return this.messageHasher.update(n),this}digest(){const n=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...n]))}}lo.Hmac=OS;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.keccak256=Xr.Keccak256=void 0;const AS=vh,IS=Ai;class Gp{constructor(n){this.blockSize=512/8,this.impl=AS.keccak_256.create(),n&&this.update(n)}update(n){return this.impl.update((0,IS.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}Xr.Keccak256=Gp;function TS(e){return new Gp(e).digest()}Xr.keccak256=TS;var nn={},CS=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0});nn.Xchacha20poly1305Ietf=nn.xchacha20NonceLength=nn.Ed25519=nn.Ed25519Keypair=nn.Argon2id=nn.isArgon2idOptions=void 0;const NS=Oe,cn=CS(Bh);function wS(e){return!(!(0,NS.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}nn.isArgon2idOptions=wS;class ES{static async execute(n,t,r){return await cn.default.ready,cn.default.crypto_pwhash(r.outputLength,n,t,r.opsLimit,r.memLimitKib*1024,cn.default.crypto_pwhash_ALG_ARGON2ID13)}}nn.Argon2id=ES;class Ea{static fromLibsodiumPrivkey(n){if(n.length!==64)throw new Error(`Unexpected key length ${n.length}. Must be 64.`);return new Ea(n.slice(0,32),n.slice(32,64))}constructor(n,t){this.privkey=n,this.pubkey=t}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}nn.Ed25519Keypair=Ea;class _S{static async makeKeypair(n){await cn.default.ready;const t=cn.default.crypto_sign_seed_keypair(n);return Ea.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(n,t){return await cn.default.ready,cn.default.crypto_sign_detached(n,t.toLibsodiumPrivkey())}static async verifySignature(n,t,r){return await cn.default.ready,cn.default.crypto_sign_verify_detached(n,t,r)}}nn.Ed25519=_S;nn.xchacha20NonceLength=24;class US{static async encrypt(n,t,r){return await cn.default.ready,cn.default.crypto_aead_xchacha20poly1305_ietf_encrypt(n,null,null,r,t)}static async decrypt(n,t,r){return await cn.default.ready,cn.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,n,null,r,t)}}nn.Xchacha20poly1305Ietf=US;var _a={};Object.defineProperty(_a,"__esModule",{value:!0});_a.Random=void 0;class JS{static getBytes(n){try{const t=typeof window=="object"?window:self,r=typeof t.crypto<"u"?t.crypto:t.msCrypto,o=new Uint8Array(n);return r.getRandomValues(o),o}catch{try{const t=hp();return new Uint8Array([...t.randomBytes(n)])}catch{throw new Error("No secure random number generator found")}}}}_a.Random=JS;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});xr.ripemd160=xr.Ripemd160=void 0;const DS=bh,MS=Ai;class Lp{constructor(n){this.blockSize=512/8,this.impl=DS.ripemd160.create(),n&&this.update(n)}update(n){return this.impl.update((0,MS.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}xr.Ripemd160=Lp;function qS(e){return new Lp(e).digest()}xr.ripemd160=qS;var Ua={},tr={};Object.defineProperty(tr,"__esModule",{value:!0});tr.ExtendedSecp256k1Signature=tr.Secp256k1Signature=void 0;function Tr(e){let n=0;for(const t of e)if(t===0)n++;else break;return e.slice(n)}const To=2;class ro{static fromFixedLength(n){if(n.length!==64)throw new Error(`Got invalid data length: ${n.length}. Expected 2x 32 bytes for the pair (r, s)`);return new ro(Tr(n.slice(0,32)),Tr(n.slice(32,64)))}static fromDer(n){let t=0;if(n[t++]!==48)throw new Error("Prefix 0x30 expected");const r=n[t++];if(n.length-t!==r)throw new Error("Data length mismatch detected");if(n[t++]!==To)throw new Error("INTEGER tag expected");const h=n[t++];if(h>=128)throw new Error("Decoding length values above 127 not supported");const v=n.slice(t,t+h);if(t+=h,n[t++]!==To)throw new Error("INTEGER tag expected");const w=n[t++];if(w>=128)throw new Error("Decoding length values above 127 not supported");const D=n.slice(t,t+w);return t+=w,new ro(Tr(v),Tr(D))}constructor(n,t){if(n.length>32||n.length===0||n[0]===0)throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||t.length===0||t[0]===0)throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:n,s:t}}r(n){if(n===void 0)return this.data.r;{const t=n-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.r])}}s(n){if(n===void 0)return this.data.s;{const t=n-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const n=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,r=n.length,o=t.length,h=new Uint8Array([To,r,...n,To,o,...t]);return new Uint8Array([48,h.length,...h])}}tr.Secp256k1Signature=ro;class Sc extends ro{static fromFixedLength(n){if(n.length!==65)throw new Error(`Got invalid data length ${n.length}. Expected 32 + 32 + 1`);return new Sc(Tr(n.slice(0,32)),Tr(n.slice(32,64)),n[64])}constructor(n,t,r){if(super(n,t),!Number.isInteger(r))throw new Error("The recovery parameter must be an integer.");if(r<0||r>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=r}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}tr.ExtendedSecp256k1Signature=Sc;var $p=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.Secp256k1=void 0;const Co=de,Kp=$p(Ia),HS=$p(Sp()),VS=tr,Jt=new HS.default.ec("secp256k1"),QS=new Kp.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class WS{static async makeKeypair(n){if(n.length!==32)throw new Error("input data is not a valid secp256k1 private key");const t=Jt.keyFromPrivate(n);if(t.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new Kp.default(n).gte(QS))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,Co.fromHex)(t.getPrivate("hex")),pubkey:Uint8Array.from(t.getPublic("array"))}}static async createSignature(n,t){if(n.length===0)throw new Error("Message hash must not be empty");if(n.length>32)throw new Error("Message hash length must not exceed 32 bytes");const r=Jt.keyFromPrivate(t),{r:o,s:h,recoveryParam:v}=r.sign(n,{canonical:!0});if(typeof v!="number")throw new Error("Recovery param missing");return new VS.ExtendedSecp256k1Signature(Uint8Array.from(o.toArray()),Uint8Array.from(h.toArray()),v)}static async verifySignature(n,t,r){if(t.length===0)throw new Error("Message hash must not be empty");if(t.length>32)throw new Error("Message hash length must not exceed 32 bytes");const o=Jt.keyFromPublic(r);try{return o.verify(t,n.toDer())}catch{return!1}}static recoverPubkey(n,t){const r={r:(0,Co.toHex)(n.r()),s:(0,Co.toHex)(n.s())},o=Jt.recoverPubKey(t,r,n.recovery),h=Jt.keyFromPublic(o);return(0,Co.fromHex)(h.getPublic(!1,"hex"))}static compressPubkey(n){switch(n.length){case 33:return n;case 65:return Uint8Array.from(Jt.keyFromPublic(n).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(n){switch(n.length){case 33:return Uint8Array.from(Jt.keyFromPublic(n).getPublic(!1,"array"));case 65:return n;default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(n){switch(n.length){case 64:return n;case 65:return n.slice(0,64);default:throw new Error("Invalid signature length")}}}Ua.Secp256k1=WS;var zp={};(function(e){var n=x&&x.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.pathToString=e.Slip10=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=void 0;const t=de,r=Te,o=n(Ia),h=n(Sp()),v=lo,C=_n;var w;(function(d){d.Secp256k1="Bitcoin seed",d.Ed25519="ed25519 seed"})(w=e.Slip10Curve||(e.Slip10Curve={}));function D(d){switch(d){case w.Ed25519:return w.Ed25519;case w.Secp256k1:return w.Secp256k1;default:throw new Error(`Unknown curve string: '${d}'`)}}e.slip10CurveFromString=D;class J extends r.Uint32{static hardened(s){return new J(s+2**31)}static normal(s){return new J(s)}isHardened(){return this.data>=2**31}}e.Slip10RawIndex=J;const I=new h.default.ec("secp256k1");class g{static derivePath(s,y,E){let _=this.master(s,y);for(const U of E)_=this.child(s,_.privkey,_.chainCode,U);return _}static master(s,y){const E=new v.Hmac(C.Sha512,(0,t.toAscii)(s)).update(y).digest(),_=E.slice(0,32),U=E.slice(32,64);return s!==w.Ed25519&&(this.isZero(_)||this.isGteN(s,_))?this.master(s,E):{chainCode:U,privkey:_}}static child(s,y,E,_){let U;if(_.isHardened()){const H=new Uint8Array([0,...y,..._.toBytesBigEndian()]);U=new v.Hmac(C.Sha512,E).update(H).digest()}else{if(s===w.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const H=new Uint8Array([...g.serializedPoint(s,new o.default(y)),..._.toBytesBigEndian()]);U=new v.Hmac(C.Sha512,E).update(H).digest()}}return this.childImpl(s,y,E,_,U)}static serializedPoint(s,y){switch(s){case w.Secp256k1:return(0,t.fromHex)(I.g.mul(y).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(s,y,E,_,U){const H=U.slice(0,32),i=U.slice(32,64),m=i;if(s===w.Ed25519)return{chainCode:m,privkey:H};const N=this.n(s),V=new o.default(H).add(new o.default(y)).mod(N),u=Uint8Array.from(V.toArray("be",32));if(this.isGteN(s,H)||this.isZero(u)){const l=new v.Hmac(C.Sha512,E).update(new Uint8Array([1,...i,..._.toBytesBigEndian()])).digest();return this.childImpl(s,y,E,_,l)}return{chainCode:m,privkey:u}}static isZero(s){return s.every(y=>y===0)}static isGteN(s,y){return new o.default(y).gte(this.n(s))}static n(s){switch(s){case w.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}e.Slip10=g;function R(d){return d.reduce((s,y)=>{const E=y.isHardened()?`${y.toNumber()-2147483648}'`:y.toString();return s+"/"+E},"m")}e.pathToString=R;function B(d){if(!d.startsWith("m"))throw new Error("Path string must start with 'm'");let s=d.slice(1);const y=new Array;for(;s;){const E=s.match(/^\/([0-9]+)('?)/);if(!E)throw new Error("Syntax error while reading path component");const[_,U,H]=E,i=r.Uint53.fromString(U).toNumber();if(i>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");H?y.push(J.hardened(i)):y.push(J.normal(i)),s=s.slice(_.length)}return y}e.stringToPath=B})(zp);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=e.Slip10=e.pathToString=e.sha512=e.Sha512=e.sha256=e.Sha256=e.Secp256k1Signature=e.ExtendedSecp256k1Signature=e.Secp256k1=e.ripemd160=e.Ripemd160=e.Random=e.Xchacha20poly1305Ietf=e.xchacha20NonceLength=e.isArgon2idOptions=e.Ed25519Keypair=e.Ed25519=e.Argon2id=e.keccak256=e.Keccak256=e.Hmac=e.EnglishMnemonic=e.Bip39=void 0;var n=jn;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return n.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return n.EnglishMnemonic}});var t=lo;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return t.Hmac}});var r=Xr;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return r.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return r.keccak256}});var o=nn;Object.defineProperty(e,"Argon2id",{enumerable:!0,get:function(){return o.Argon2id}}),Object.defineProperty(e,"Ed25519",{enumerable:!0,get:function(){return o.Ed25519}}),Object.defineProperty(e,"Ed25519Keypair",{enumerable:!0,get:function(){return o.Ed25519Keypair}}),Object.defineProperty(e,"isArgon2idOptions",{enumerable:!0,get:function(){return o.isArgon2idOptions}}),Object.defineProperty(e,"xchacha20NonceLength",{enumerable:!0,get:function(){return o.xchacha20NonceLength}}),Object.defineProperty(e,"Xchacha20poly1305Ietf",{enumerable:!0,get:function(){return o.Xchacha20poly1305Ietf}});var h=_a;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return h.Random}});var v=xr;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return v.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return v.ripemd160}});var C=Ua;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return C.Secp256k1}});var w=tr;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return w.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return w.Secp256k1Signature}});var D=_n;Object.defineProperty(e,"Sha256",{enumerable:!0,get:function(){return D.Sha256}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return D.sha256}}),Object.defineProperty(e,"Sha512",{enumerable:!0,get:function(){return D.Sha512}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return D.sha512}});var J=zp;Object.defineProperty(e,"pathToString",{enumerable:!0,get:function(){return J.pathToString}}),Object.defineProperty(e,"Slip10",{enumerable:!0,get:function(){return J.Slip10}}),Object.defineProperty(e,"Slip10Curve",{enumerable:!0,get:function(){return J.Slip10Curve}}),Object.defineProperty(e,"slip10CurveFromString",{enumerable:!0,get:function(){return J.slip10CurveFromString}}),Object.defineProperty(e,"Slip10RawIndex",{enumerable:!0,get:function(){return J.Slip10RawIndex}}),Object.defineProperty(e,"stringToPath",{enumerable:!0,get:function(){return J.stringToPath}})})(Ge);var Fe={},fo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isMultisigThresholdPubkey=e.isSinglePubkey=e.pubkeyType=e.isSecp256k1Pubkey=e.isEd25519Pubkey=void 0;function n(h){return h.type==="tendermint/PubKeyEd25519"}e.isEd25519Pubkey=n;function t(h){return h.type==="tendermint/PubKeySecp256k1"}e.isSecp256k1Pubkey=t,e.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519",multisigThreshold:"tendermint/PubKeyMultisigThreshold"};function r(h){return[e.pubkeyType.ed25519,e.pubkeyType.secp256k1,e.pubkeyType.sr25519].includes(h.type)}e.isSinglePubkey=r;function o(h){return h.type==="tendermint/PubKeyMultisigThreshold"}e.isMultisigThresholdPubkey=o})(fo);Object.defineProperty(Fe,"__esModule",{value:!0});Fe.encodeBech32Pubkey=Fe.encodeAminoPubkey=Fe.decodeBech32Pubkey=Fe.decodeAminoPubkey=Fe.encodeEd25519Pubkey=Fe.encodeSecp256k1Pubkey=void 0;const on=de,FS=Te,Li=Oe,lt=fo;function GS(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:lt.pubkeyType.secp256k1,value:(0,on.toBase64)(e)}}Fe.encodeSecp256k1Pubkey=GS;function LS(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:lt.pubkeyType.ed25519,value:(0,on.toBase64)(e)}}Fe.encodeEd25519Pubkey=LS;const Mu=(0,on.fromHex)("eb5ae98721"),qu=(0,on.fromHex)("1624de6420"),Pl=(0,on.fromHex)("0dfb100520"),ca=(0,on.fromHex)("22c1f7e2");function kc(e){if((0,Li.arrayContentStartsWith)(e,Mu)){const n=e.slice(Mu.length);if(n.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:lt.pubkeyType.secp256k1,value:(0,on.toBase64)(n)}}else if((0,Li.arrayContentStartsWith)(e,qu)){const n=e.slice(qu.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:lt.pubkeyType.ed25519,value:(0,on.toBase64)(n)}}else if((0,Li.arrayContentStartsWith)(e,Pl)){const n=e.slice(Pl.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:lt.pubkeyType.sr25519,value:(0,on.toBase64)(n)}}else{if((0,Li.arrayContentStartsWith)(e,ca))return KS(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,on.toHex)(e.slice(0,5)))}}Fe.decodeAminoPubkey=kc;function $S(e){const{data:n}=(0,on.fromBech32)(e);return kc(n)}Fe.decodeBech32Pubkey=$S;function Rl(e){if(e.length<1)throw new Error("Can't decode varint. EOF");if(e[0]>127)throw new Error("Decoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.Varint implementation from the Go standard library and write some tests.");return[e[0],1]}function KS(e){const n=Array.from(e),t=n.splice(0,ca.length);if(!(0,Li.arrayContentStartsWith)(t,ca))throw new Error("Invalid multisig prefix.");if(n.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[r,o]=Rl(n);n.splice(0,o);const h=[];for(;n.length>0;){if(n.shift()!=18)throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[v,C]=Rl(n);if(n.splice(0,C),n.length<v)throw new Error("Invalid multisig data length.");const w=n.splice(0,v),D=kc(Uint8Array.from(w));h.push(D)}return{type:lt.pubkeyType.multisigThreshold,value:{threshold:r.toString(),pubkeys:h}}}function vl(e){const n=FS.Uint53.fromString(e.toString()).toNumber();if(n>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[n]}function Pc(e){if((0,lt.isMultisigThresholdPubkey)(e)){const n=Array.from(ca);n.push(8),n.push(...vl(e.value.threshold));for(const t of e.value.pubkeys.map(r=>Pc(r)))n.push(18),n.push(...vl(t.length)),n.push(...t);return new Uint8Array(n)}else{if((0,lt.isEd25519Pubkey)(e))return new Uint8Array([...qu,...(0,on.fromBase64)(e.value)]);if((0,lt.isSecp256k1Pubkey)(e))return new Uint8Array([...Mu,...(0,on.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}Fe.encodeAminoPubkey=Pc;function zS(e,n){return(0,on.toBech32)(n,Pc(e))}Fe.encodeBech32Pubkey=zS;Object.defineProperty(mn,"__esModule",{value:!0});mn.pubkeyToAddress=mn.pubkeyToRawAddress=mn.rawSecp256k1PubkeyToRawAddress=mn.rawEd25519PubkeyToRawAddress=void 0;const la=Ge,Hu=de,YS=Fe,Od=fo;function Yp(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,la.sha256)(e).slice(0,20)}mn.rawEd25519PubkeyToRawAddress=Yp;function Zp(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,la.ripemd160)((0,la.sha256)(e))}mn.rawSecp256k1PubkeyToRawAddress=Zp;function Xp(e){if((0,Od.isSecp256k1Pubkey)(e)){const n=(0,Hu.fromBase64)(e.value);return Zp(n)}else if((0,Od.isEd25519Pubkey)(e)){const n=(0,Hu.fromBase64)(e.value);return Yp(n)}else if((0,Od.isMultisigThresholdPubkey)(e)){const n=(0,YS.encodeAminoPubkey)(e);return(0,la.sha256)(n).slice(0,20)}else throw new Error("Unsupported public key type")}mn.pubkeyToRawAddress=Xp;function ZS(e,n){return(0,Hu.toBech32)(n,Xp(e))}mn.pubkeyToAddress=ZS;var et={};Object.defineProperty(et,"__esModule",{value:!0});et.addCoins=et.parseCoins=et.coins=et.coin=void 0;const Vu=Te;function xp(e,n){let t;if(typeof e=="number")try{t=new Vu.Uint53(e).toString()}catch{throw new Error("Given amount is not a safe integer. Consider using a string instead to overcome the limitations of JS numbers.")}else{if(!e.match(/^[0-9]+$/))throw new Error("Invalid unsigned integer string format");t=e.replace(/^0*/,"")||"0"}return{amount:t,denom:n}}et.coin=xp;function XS(e,n){return[xp(e,n)]}et.coins=XS;function xS(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(n=>{const t=n.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/]{2,127})$/);if(!t)throw new Error("Got an invalid coin string");return{amount:t[1].replace(/^0+/,"")||"0",denom:t[2]}})}et.parseCoins=xS;function jS(e,n){if(e.denom!==n.denom)throw new Error("Trying to add two coins with different denoms");return{amount:Vu.Decimal.fromAtomics(e.amount,0).plus(Vu.Decimal.fromAtomics(n.amount,0)).atomics,denom:e.denom}}et.addCoins=jS;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.createMultisigThresholdPubkey=jr.compareArrays=void 0;const Bl=de,ek=Te,bl=mn;function jp(e,n){const t=(0,Bl.toHex)(e),r=(0,Bl.toHex)(n);return t===r?0:t<r?-1:1}jr.compareArrays=jp;function nk(e,n,t=!1){const r=new ek.Uint53(n);if(r.toNumber()>e.length)throw new Error(`Threshold k = ${r.toNumber()} exceeds number of keys n = ${e.length}`);const o=t?e:Array.from(e).sort((h,v)=>{const C=(0,bl.pubkeyToRawAddress)(h),w=(0,bl.pubkeyToRawAddress)(v);return jp(C,w)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:r.toString(),pubkeys:o}}}jr.createMultisigThresholdPubkey=nk;var Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.omitDefault=void 0;function tk(e){switch(typeof e){case"string":return e===""?void 0:e;case"number":return e===0?void 0:e;case"bigint":return e===BigInt(0)?void 0:e;case"boolean":return e||void 0;default:throw new Error(`Got unsupported type '${typeof e}'`)}}Ja.omitDefault=tk;var po={};Object.defineProperty(po,"__esModule",{value:!0});po.makeCosmoshubPath=void 0;const Ii=Ge;function rk(e){return[Ii.Slip10RawIndex.hardened(44),Ii.Slip10RawIndex.hardened(118),Ii.Slip10RawIndex.hardened(0),Ii.Slip10RawIndex.normal(0),Ii.Slip10RawIndex.normal(e)]}po.makeCosmoshubPath=rk;var ei={},Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.decodeSignature=Ut.encodeSecp256k1Signature=void 0;const Qu=de,ik=Fe,ok=fo;function ak(e,n){if(n.length!==64)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:(0,ik.encodeSecp256k1Pubkey)(e),signature:(0,Qu.toBase64)(n)}}Ut.encodeSecp256k1Signature=ak;function sk(e){switch(e.pub_key.type){case ok.pubkeyType.secp256k1:return{pubkey:(0,Qu.fromBase64)(e.pub_key.value),signature:(0,Qu.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}Ut.decodeSignature=sk;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.serializeSignDoc=Un.escapeCharacters=Un.makeSignDoc=Un.sortedJsonStringify=void 0;const dk=de,Ol=Te;function Wu(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(Wu);const n=Object.keys(e).sort(),t={};return n.forEach(r=>{t[r]=Wu(e[r])}),t}function em(e){return JSON.stringify(Wu(e))}Un.sortedJsonStringify=em;function uk(e,n,t,r,o,h,v){return{chain_id:t,account_number:Ol.Uint53.fromString(o.toString()).toString(),sequence:Ol.Uint53.fromString(h.toString()).toString(),fee:n,msgs:e,memo:r||"",...v&&{timeout_height:v.toString()}}}Un.makeSignDoc=uk;function nm(e){const n=/&/g,t=/</g,r=/>/g;return e.replace(n,"\\u0026").replace(t,"\\u003c").replace(r,"\\u003e")}Un.escapeCharacters=nm;function ck(e){const n=nm(em(e));return(0,dk.toUtf8)(n)}Un.serializeSignDoc=ck;var Rc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=Ge,t=de;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function r(v,C){switch(C.algorithm){case"argon2id":{const w=C.params;if(!(0,n.isArgon2idOptions)(w))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(v,e.cosmjsSalt,w)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(v,C,D)])}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.encrypt=o;async function h(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=v.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(v.slice(n.xchacha20NonceLength),C,D)}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.decrypt=h})(Rc);Object.defineProperty(ei,"__esModule",{value:!0});ei.Secp256k1HdWallet=ei.extractKdfConfiguration=void 0;const Sn=Ge,Ti=de,Cr=Oe,lk=mn,fk=po,pk=Ut,mk=Un,Ci=Rc,ea="secp256k1wallet-v1",yk={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function hk(e){return!(!(0,Cr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function gk(e){return e.kdf}function Sk(e){const n=JSON.parse(e);if(!(0,Cr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case ea:return gk(n);default:throw new Error("Unsupported serialization type")}}ei.extractKdfConfiguration=Sk;const Al={bip39Password:"",hdPaths:[(0,fk.makeCosmoshubPath)(0)],prefix:"cosmos"};class Lt{static async fromMnemonic(n,t={}){const r=new Sn.EnglishMnemonic(n),o=await Sn.Bip39.mnemonicToSeed(r,t.bip39Password);return new Lt(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=Sn.Random.getBytes(r),h=Sn.Bip39.encode(o);return Lt.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,Cr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case ea:return Lt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,Cr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case ea:{const h=await(0,Ci.decrypt)((0,Ti.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,Ti.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,Cr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>hk(I)))throw new Error("Account is not in the correct format.");const D=w[0].prefix;if(!w.every(({prefix:I})=>I===D))throw new Error("Accounts do not all have the same prefix");const J=w.map(({hdPath:I})=>(0,Sn.stringToPath)(I));return Lt.fromMnemonic(C,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const r=JSON.parse(n);if(!(0,Cr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,Ci.executeKdf)(t,r.kdf);return Lt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.hdPaths??Al.hdPaths,o=t.prefix??Al.prefix;this.secret=n,this.seed=t.seed,this.accounts=r.map(h=>({hdPath:h,prefix:o}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:r,address:o})=>({algo:t,pubkey:r,address:o}))}async signAmino(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:J})=>J===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:h,pubkey:v}=o,C=(0,Sn.sha256)((0,mk.serializeSignDoc)(t)),w=await Sn.Secp256k1.createSignature(C,h),D=new Uint8Array([...w.r(32),...w.s(32)]);return{signed:t,signature:(0,pk.encodeSecp256k1Signature)(v,D)}}async serialize(n){const t=yk,r=await(0,Ci.executeKdf)(n,t);return this.serializeWithEncryptionKey(r,t)}async serializeWithEncryptionKey(n,t){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:w,prefix:D})=>({hdPath:(0,Sn.pathToString)(w),prefix:D}))},o=(0,Ti.toUtf8)(JSON.stringify(r)),h={algorithm:Ci.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,Ci.encrypt)(o,n,h),C={type:ea,kdf:t,encryption:h,data:(0,Ti.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=Sn.Slip10.derivePath(Sn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await Sn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:Sn.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(n),h=(0,Ti.toBech32)(t,(0,lk.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}ei.Secp256k1HdWallet=Lt;var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.Secp256k1Wallet=void 0;const No=Ge,kk=de,Pk=mn,Rk=Ut,vk=Un;class vc{static async fromKey(n,t="cosmos"){const r=(await No.Secp256k1.makeKeypair(n)).pubkey;return new vc(n,No.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,kk.toBech32)(this.prefix,(0,Pk.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(n,t){if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const r=new No.Sha256((0,vk.serializeSignDoc)(t)).digest(),o=await No.Secp256k1.createSignature(r,this.privkey),h=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:t,signature:(0,Rk.encodeSecp256k1Signature)(this.pubkey,h)}}}Da.Secp256k1Wallet=vc;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.makeStdTx=ni.isStdTx=void 0;function Bk(e){const{memo:n,msg:t,fee:r,signatures:o}=e;return typeof n=="string"&&Array.isArray(t)&&typeof r=="object"&&Array.isArray(o)}ni.isStdTx=Bk;function bk(e,n){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(n)?n:[n]}}ni.makeStdTx=bk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.executeKdf=e.makeStdTx=e.isStdTx=e.serializeSignDoc=e.makeSignDoc=e.encodeSecp256k1Signature=e.decodeSignature=e.Secp256k1Wallet=e.Secp256k1HdWallet=e.extractKdfConfiguration=e.pubkeyType=e.isSinglePubkey=e.isSecp256k1Pubkey=e.isMultisigThresholdPubkey=e.isEd25519Pubkey=e.makeCosmoshubPath=e.omitDefault=e.createMultisigThresholdPubkey=e.encodeSecp256k1Pubkey=e.encodeEd25519Pubkey=e.encodeBech32Pubkey=e.encodeAminoPubkey=e.decodeBech32Pubkey=e.decodeAminoPubkey=e.parseCoins=e.coins=e.coin=e.addCoins=e.rawSecp256k1PubkeyToRawAddress=e.rawEd25519PubkeyToRawAddress=e.pubkeyToRawAddress=e.pubkeyToAddress=void 0;var n=mn;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return n.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return n.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawSecp256k1PubkeyToRawAddress}});var t=et;Object.defineProperty(e,"addCoins",{enumerable:!0,get:function(){return t.addCoins}}),Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return t.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return t.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return t.parseCoins}});var r=Fe;Object.defineProperty(e,"decodeAminoPubkey",{enumerable:!0,get:function(){return r.decodeAminoPubkey}}),Object.defineProperty(e,"decodeBech32Pubkey",{enumerable:!0,get:function(){return r.decodeBech32Pubkey}}),Object.defineProperty(e,"encodeAminoPubkey",{enumerable:!0,get:function(){return r.encodeAminoPubkey}}),Object.defineProperty(e,"encodeBech32Pubkey",{enumerable:!0,get:function(){return r.encodeBech32Pubkey}}),Object.defineProperty(e,"encodeEd25519Pubkey",{enumerable:!0,get:function(){return r.encodeEd25519Pubkey}}),Object.defineProperty(e,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return r.encodeSecp256k1Pubkey}});var o=jr;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var h=Ja;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return h.omitDefault}});var v=po;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return v.makeCosmoshubPath}});var C=fo;Object.defineProperty(e,"isEd25519Pubkey",{enumerable:!0,get:function(){return C.isEd25519Pubkey}}),Object.defineProperty(e,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return C.isMultisigThresholdPubkey}}),Object.defineProperty(e,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return C.isSecp256k1Pubkey}}),Object.defineProperty(e,"isSinglePubkey",{enumerable:!0,get:function(){return C.isSinglePubkey}}),Object.defineProperty(e,"pubkeyType",{enumerable:!0,get:function(){return C.pubkeyType}});var w=ei;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return w.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return w.Secp256k1HdWallet}});var D=Da;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return D.Secp256k1Wallet}});var J=Ut;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return J.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return J.encodeSecp256k1Signature}});var I=Un;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return I.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return I.serializeSignDoc}});var g=ni;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return g.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return g.makeStdTx}});var R=Rc;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return R.executeKdf}})})(zn);var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.makeSignBytes=ot.makeSignDoc=ot.makeAuthInfoBytes=void 0;const Il=Oe,Ok=uo,fa=at;function Ak(e,n){return e.map(({pubkey:t,sequence:r})=>({publicKey:t,modeInfo:{single:{mode:n}},sequence:BigInt(r)}))}function Ik(e,n,t,r,o,h=Ok.SignMode.SIGN_MODE_DIRECT){(0,Il.assert)(r===void 0||typeof r=="string","feeGranter must be undefined or string"),(0,Il.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const v=fa.AuthInfo.fromPartial({signerInfos:Ak(e,h),fee:{amount:[...n],gasLimit:BigInt(t),granter:r,payer:o}});return fa.AuthInfo.encode(v).finish()}ot.makeAuthInfoBytes=Ik;function Tk(e,n,t,r){return{bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:BigInt(r)}}ot.makeSignDoc=Tk;function Ck({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r}){const o=fa.SignDoc.fromPartial({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r});return fa.SignDoc.encode(o).finish()}ot.makeSignBytes=Ck;var Bc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=Ge,t=de;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function r(v,C){switch(C.algorithm){case"argon2id":{const w=C.params;if(!(0,n.isArgon2idOptions)(w))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(v,e.cosmjsSalt,w)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(v,C,D)])}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.encrypt=o;async function h(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=v.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(v.slice(n.xchacha20NonceLength),C,D)}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.decrypt=h})(Bc);Object.defineProperty(Gr,"__esModule",{value:!0});Gr.DirectSecp256k1HdWallet=Gr.extractKdfConfiguration=void 0;const Fu=zn,kn=Ge,Ni=de,Nr=Oe,Nk=ot,wi=Bc,na="directsecp256k1hdwallet-v1",wk={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function Ek(e){return!(!(0,Nr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function _k(e){return e.kdf}function Uk(e){const n=JSON.parse(e);if(!(0,Nr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case na:return _k(n);default:throw new Error("Unsupported serialization type")}}Gr.extractKdfConfiguration=Uk;const Tl={bip39Password:"",hdPaths:[(0,Fu.makeCosmoshubPath)(0)],prefix:"cosmos"};class $t{static async fromMnemonic(n,t={}){const r=new kn.EnglishMnemonic(n),o=await kn.Bip39.mnemonicToSeed(r,t.bip39Password);return new $t(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=kn.Random.getBytes(r),h=kn.Bip39.encode(o);return $t.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,Nr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case na:return $t.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,Nr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case na:{const h=await(0,wi.decrypt)((0,Ni.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,Ni.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,Nr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>Ek(I)))throw new Error("Account is not in the correct format.");const D=w[0].prefix;if(!w.every(({prefix:I})=>I===D))throw new Error("Accounts do not all have the same prefix");const J=w.map(({hdPath:I})=>(0,kn.stringToPath)(I));return $t.fromMnemonic(C,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const r=JSON.parse(n);if(!(0,Nr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,wi.executeKdf)(t,r.kdf);return $t.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.prefix??Tl.prefix,o=t.hdPaths??Tl.hdPaths;this.secret=n,this.seed=t.seed,this.accounts=o.map(h=>({hdPath:h,prefix:r}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:r,address:o})=>({algo:t,pubkey:r,address:o}))}async signDirect(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:g})=>g===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:h,pubkey:v}=o,C=(0,Nk.makeSignBytes)(t),w=(0,kn.sha256)(C),D=await kn.Secp256k1.createSignature(w,h),J=new Uint8Array([...D.r(32),...D.s(32)]),I=(0,Fu.encodeSecp256k1Signature)(v,J);return{signed:t,signature:I}}async serialize(n){const t=wk,r=await(0,wi.executeKdf)(n,t);return this.serializeWithEncryptionKey(r,t)}async serializeWithEncryptionKey(n,t){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:w,prefix:D})=>({hdPath:(0,kn.pathToString)(w),prefix:D}))},o=(0,Ni.toUtf8)(JSON.stringify(r)),h={algorithm:wi.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,wi.encrypt)(o,n,h),C={type:na,kdf:t,encryption:h,data:(0,Ni.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=kn.Slip10.derivePath(kn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await kn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:kn.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(n),h=(0,Ni.toBech32)(t,(0,Fu.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}Gr.DirectSecp256k1HdWallet=$t;var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.DirectSecp256k1Wallet=void 0;const Cl=zn,wo=Ge,Jk=de,Dk=ot;class bc{static async fromKey(n,t="cosmos"){const r=(await wo.Secp256k1.makeKeypair(n)).pubkey;return new bc(n,wo.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,Jk.toBech32)(this.prefix,(0,Cl.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(n,t){const r=(0,Dk.makeSignBytes)(t);if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const o=(0,wo.sha256)(r),h=await wo.Secp256k1.createSignature(o,this.privkey),v=new Uint8Array([...h.r(32),...h.s(32)]),C=(0,Cl.encodeSecp256k1Signature)(this.pubkey,v);return{signed:t,signature:C}}}Ma.DirectSecp256k1Wallet=bc;var qa={};Object.defineProperty(qa,"__esModule",{value:!0});qa.makeCosmoshubPath=void 0;const Ei=Ge;function Mk(e){return[Ei.Slip10RawIndex.hardened(44),Ei.Slip10RawIndex.hardened(118),Ei.Slip10RawIndex.hardened(0),Ei.Slip10RawIndex.normal(0),Ei.Slip10RawIndex.normal(e)]}qa.makeCosmoshubPath=Mk;var nt={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});vt.PrivKey=vt.PubKey=vt.protobufPackage=void 0;const _r=ee,Ur=ne;vt.protobufPackage="cosmos.crypto.ed25519";function Ad(){return{key:new Uint8Array}}vt.PubKey={typeUrl:"/cosmos.crypto.ed25519.PubKey",encode(e,n=_r.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof _r.BinaryReader?e:new _r.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Ad();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Ad();return(0,Ur.isSet)(e.key)&&(n.key=(0,Ur.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Ur.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Ad();return n.key=e.key??new Uint8Array,n}};function Id(){return{key:new Uint8Array}}vt.PrivKey={typeUrl:"/cosmos.crypto.ed25519.PrivKey",encode(e,n=_r.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof _r.BinaryReader?e:new _r.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Id();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Id();return(0,Ur.isSet)(e.key)&&(n.key=(0,Ur.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Ur.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Id();return n.key=e.key??new Uint8Array,n}};var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.LegacyAminoPubKey=ti.protobufPackage=void 0;const _i=Re,Td=ee,qk=ne;ti.protobufPackage="cosmos.crypto.multisig";function Cd(){return{threshold:0,publicKeys:[]}}ti.LegacyAminoPubKey={typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",encode(e,n=Td.BinaryWriter.create()){e.threshold!==0&&n.uint32(8).uint32(e.threshold);for(const t of e.publicKeys)_i.Any.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof Td.BinaryReader?e:new Td.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Cd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.threshold=t.uint32();break;case 2:o.publicKeys.push(_i.Any.decode(t,t.uint32()));break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Cd();return(0,qk.isSet)(e.threshold)&&(n.threshold=Number(e.threshold)),Array.isArray(e==null?void 0:e.publicKeys)&&(n.publicKeys=e.publicKeys.map(t=>_i.Any.fromJSON(t))),n},toJSON(e){const n={};return e.threshold!==void 0&&(n.threshold=Math.round(e.threshold)),e.publicKeys?n.publicKeys=e.publicKeys.map(t=>t?_i.Any.toJSON(t):void 0):n.publicKeys=[],n},fromPartial(e){var t;const n=Cd();return n.threshold=e.threshold??0,n.publicKeys=((t=e.publicKeys)==null?void 0:t.map(r=>_i.Any.fromPartial(r)))||[],n}};var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.PrivKey=Bt.PubKey=Bt.protobufPackage=void 0;const Jr=ee,Dr=ne;Bt.protobufPackage="cosmos.crypto.secp256k1";function Nd(){return{key:new Uint8Array}}Bt.PubKey={typeUrl:"/cosmos.crypto.secp256k1.PubKey",encode(e,n=Jr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Jr.BinaryReader?e:new Jr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Nd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Nd();return(0,Dr.isSet)(e.key)&&(n.key=(0,Dr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Dr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Nd();return n.key=e.key??new Uint8Array,n}};function wd(){return{key:new Uint8Array}}Bt.PrivKey={typeUrl:"/cosmos.crypto.secp256k1.PrivKey",encode(e,n=Jr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Jr.BinaryReader?e:new Jr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=wd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=wd();return(0,Dr.isSet)(e.key)&&(n.key=(0,Dr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Dr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=wd();return n.key=e.key??new Uint8Array,n}};Object.defineProperty(nt,"__esModule",{value:!0});nt.decodeOptionalPubkey=nt.decodePubkey=nt.anyToSinglePubkey=nt.encodePubkey=void 0;const Yi=zn,Nl=de,Hk=Te,Gu=vt,Lu=ti,$u=Bt,Ed=Re;function tm(e){if((0,Yi.isSecp256k1Pubkey)(e)){const n=$u.PubKey.fromPartial({key:(0,Nl.fromBase64)(e.value)});return Ed.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from($u.PubKey.encode(n).finish())})}else if((0,Yi.isEd25519Pubkey)(e)){const n=Gu.PubKey.fromPartial({key:(0,Nl.fromBase64)(e.value)});return Ed.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(Gu.PubKey.encode(n).finish())})}else if((0,Yi.isMultisigThresholdPubkey)(e)){const n=Lu.LegacyAminoPubKey.fromPartial({threshold:Hk.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(tm)});return Ed.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(Lu.LegacyAminoPubKey.encode(n).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}nt.encodePubkey=tm;function Ku(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:n}=$u.PubKey.decode(e.value);return(0,Yi.encodeSecp256k1Pubkey)(n)}case"/cosmos.crypto.ed25519.PubKey":{const{key:n}=Gu.PubKey.decode(e.value);return(0,Yi.encodeEd25519Pubkey)(n)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}nt.anyToSinglePubkey=Ku;function rm(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return Ku(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:n,publicKeys:t}=Lu.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:n.toString(),pubkeys:t.map(Ku)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}nt.decodePubkey=rm;function Vk(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return rm(e);throw new Error(`Pubkey is an Any with type URL '${e.typeUrl}' but an empty value`)}else{if(e.value.length)throw new Error("Pubkey is an Any with an empty type URL but a value set");return null}}nt.decodeOptionalPubkey=Vk;var Bn={},Oc={},Ac={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;const n=Me,t=ee,r=ne;e.protobufPackage="cosmos.bank.v1beta1";function o(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={typeUrl:"/cosmos.bank.v1beta1.Params",encode(I,g=t.BinaryWriter.create()){for(const R of I.sendEnabled)e.SendEnabled.encode(R,g.uint32(10).fork()).ldelim();return I.defaultSendEnabled===!0&&g.uint32(16).bool(I.defaultSendEnabled),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=o();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.sendEnabled.push(e.SendEnabled.decode(R,R.uint32()));break;case 2:d.defaultSendEnabled=R.bool();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=o();return Array.isArray(I==null?void 0:I.sendEnabled)&&(g.sendEnabled=I.sendEnabled.map(R=>e.SendEnabled.fromJSON(R))),(0,r.isSet)(I.defaultSendEnabled)&&(g.defaultSendEnabled=!!I.defaultSendEnabled),g},toJSON(I){const g={};return I.sendEnabled?g.sendEnabled=I.sendEnabled.map(R=>R?e.SendEnabled.toJSON(R):void 0):g.sendEnabled=[],I.defaultSendEnabled!==void 0&&(g.defaultSendEnabled=I.defaultSendEnabled),g},fromPartial(I){var R;const g=o();return g.sendEnabled=((R=I.sendEnabled)==null?void 0:R.map(B=>e.SendEnabled.fromPartial(B)))||[],g.defaultSendEnabled=I.defaultSendEnabled??!1,g}};function h(){return{denom:"",enabled:!1}}e.SendEnabled={typeUrl:"/cosmos.bank.v1beta1.SendEnabled",encode(I,g=t.BinaryWriter.create()){return I.denom!==""&&g.uint32(10).string(I.denom),I.enabled===!0&&g.uint32(16).bool(I.enabled),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=h();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.denom=R.string();break;case 2:d.enabled=R.bool();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=h();return(0,r.isSet)(I.denom)&&(g.denom=String(I.denom)),(0,r.isSet)(I.enabled)&&(g.enabled=!!I.enabled),g},toJSON(I){const g={};return I.denom!==void 0&&(g.denom=I.denom),I.enabled!==void 0&&(g.enabled=I.enabled),g},fromPartial(I){const g=h();return g.denom=I.denom??"",g.enabled=I.enabled??!1,g}};function v(){return{address:"",coins:[]}}e.Input={typeUrl:"/cosmos.bank.v1beta1.Input",encode(I,g=t.BinaryWriter.create()){I.address!==""&&g.uint32(10).string(I.address);for(const R of I.coins)n.Coin.encode(R,g.uint32(18).fork()).ldelim();return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=v();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.address=R.string();break;case 2:d.coins.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=v();return(0,r.isSet)(I.address)&&(g.address=String(I.address)),Array.isArray(I==null?void 0:I.coins)&&(g.coins=I.coins.map(R=>n.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.address!==void 0&&(g.address=I.address),I.coins?g.coins=I.coins.map(R=>R?n.Coin.toJSON(R):void 0):g.coins=[],g},fromPartial(I){var R;const g=v();return g.address=I.address??"",g.coins=((R=I.coins)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],g}};function C(){return{address:"",coins:[]}}e.Output={typeUrl:"/cosmos.bank.v1beta1.Output",encode(I,g=t.BinaryWriter.create()){I.address!==""&&g.uint32(10).string(I.address);for(const R of I.coins)n.Coin.encode(R,g.uint32(18).fork()).ldelim();return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=C();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.address=R.string();break;case 2:d.coins.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=C();return(0,r.isSet)(I.address)&&(g.address=String(I.address)),Array.isArray(I==null?void 0:I.coins)&&(g.coins=I.coins.map(R=>n.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.address!==void 0&&(g.address=I.address),I.coins?g.coins=I.coins.map(R=>R?n.Coin.toJSON(R):void 0):g.coins=[],g},fromPartial(I){var R;const g=C();return g.address=I.address??"",g.coins=((R=I.coins)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],g}};function w(){return{total:[]}}e.Supply={typeUrl:"/cosmos.bank.v1beta1.Supply",encode(I,g=t.BinaryWriter.create()){for(const R of I.total)n.Coin.encode(R,g.uint32(10).fork()).ldelim();return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=w();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.total.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=w();return Array.isArray(I==null?void 0:I.total)&&(g.total=I.total.map(R=>n.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.total?g.total=I.total.map(R=>R?n.Coin.toJSON(R):void 0):g.total=[],g},fromPartial(I){var R;const g=w();return g.total=((R=I.total)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],g}};function D(){return{denom:"",exponent:0,aliases:[]}}e.DenomUnit={typeUrl:"/cosmos.bank.v1beta1.DenomUnit",encode(I,g=t.BinaryWriter.create()){I.denom!==""&&g.uint32(10).string(I.denom),I.exponent!==0&&g.uint32(16).uint32(I.exponent);for(const R of I.aliases)g.uint32(26).string(R);return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=D();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.denom=R.string();break;case 2:d.exponent=R.uint32();break;case 3:d.aliases.push(R.string());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=D();return(0,r.isSet)(I.denom)&&(g.denom=String(I.denom)),(0,r.isSet)(I.exponent)&&(g.exponent=Number(I.exponent)),Array.isArray(I==null?void 0:I.aliases)&&(g.aliases=I.aliases.map(R=>String(R))),g},toJSON(I){const g={};return I.denom!==void 0&&(g.denom=I.denom),I.exponent!==void 0&&(g.exponent=Math.round(I.exponent)),I.aliases?g.aliases=I.aliases.map(R=>R):g.aliases=[],g},fromPartial(I){var R;const g=D();return g.denom=I.denom??"",g.exponent=I.exponent??0,g.aliases=((R=I.aliases)==null?void 0:R.map(B=>B))||[],g}};function J(){return{description:"",denomUnits:[],base:"",display:"",name:"",symbol:"",uri:"",uriHash:""}}e.Metadata={typeUrl:"/cosmos.bank.v1beta1.Metadata",encode(I,g=t.BinaryWriter.create()){I.description!==""&&g.uint32(10).string(I.description);for(const R of I.denomUnits)e.DenomUnit.encode(R,g.uint32(18).fork()).ldelim();return I.base!==""&&g.uint32(26).string(I.base),I.display!==""&&g.uint32(34).string(I.display),I.name!==""&&g.uint32(42).string(I.name),I.symbol!==""&&g.uint32(50).string(I.symbol),I.uri!==""&&g.uint32(58).string(I.uri),I.uriHash!==""&&g.uint32(66).string(I.uriHash),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=J();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.description=R.string();break;case 2:d.denomUnits.push(e.DenomUnit.decode(R,R.uint32()));break;case 3:d.base=R.string();break;case 4:d.display=R.string();break;case 5:d.name=R.string();break;case 6:d.symbol=R.string();break;case 7:d.uri=R.string();break;case 8:d.uriHash=R.string();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=J();return(0,r.isSet)(I.description)&&(g.description=String(I.description)),Array.isArray(I==null?void 0:I.denomUnits)&&(g.denomUnits=I.denomUnits.map(R=>e.DenomUnit.fromJSON(R))),(0,r.isSet)(I.base)&&(g.base=String(I.base)),(0,r.isSet)(I.display)&&(g.display=String(I.display)),(0,r.isSet)(I.name)&&(g.name=String(I.name)),(0,r.isSet)(I.symbol)&&(g.symbol=String(I.symbol)),(0,r.isSet)(I.uri)&&(g.uri=String(I.uri)),(0,r.isSet)(I.uriHash)&&(g.uriHash=String(I.uriHash)),g},toJSON(I){const g={};return I.description!==void 0&&(g.description=I.description),I.denomUnits?g.denomUnits=I.denomUnits.map(R=>R?e.DenomUnit.toJSON(R):void 0):g.denomUnits=[],I.base!==void 0&&(g.base=I.base),I.display!==void 0&&(g.display=I.display),I.name!==void 0&&(g.name=I.name),I.symbol!==void 0&&(g.symbol=I.symbol),I.uri!==void 0&&(g.uri=I.uri),I.uriHash!==void 0&&(g.uriHash=I.uriHash),g},fromPartial(I){var R;const g=J();return g.description=I.description??"",g.denomUnits=((R=I.denomUnits)==null?void 0:R.map(B=>e.DenomUnit.fromPartial(B)))||[],g.base=I.base??"",g.display=I.display??"",g.name=I.name??"",g.symbol=I.symbol??"",g.uri=I.uri??"",g.uriHash=I.uriHash??"",g}}})(Ac);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgSetSendEnabledResponse=e.MsgSetSendEnabled=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;const n=Me,t=Ac,r=ee,o=ne;e.protobufPackage="cosmos.bank.v1beta1";function h(){return{fromAddress:"",toAddress:"",amount:[]}}e.MsgSend={typeUrl:"/cosmos.bank.v1beta1.MsgSend",encode(B,d=r.BinaryWriter.create()){B.fromAddress!==""&&d.uint32(10).string(B.fromAddress),B.toAddress!==""&&d.uint32(18).string(B.toAddress);for(const s of B.amount)n.Coin.encode(s,d.uint32(26).fork()).ldelim();return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=h();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.fromAddress=s.string();break;case 2:E.toAddress=s.string();break;case 3:E.amount.push(n.Coin.decode(s,s.uint32()));break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=h();return(0,o.isSet)(B.fromAddress)&&(d.fromAddress=String(B.fromAddress)),(0,o.isSet)(B.toAddress)&&(d.toAddress=String(B.toAddress)),Array.isArray(B==null?void 0:B.amount)&&(d.amount=B.amount.map(s=>n.Coin.fromJSON(s))),d},toJSON(B){const d={};return B.fromAddress!==void 0&&(d.fromAddress=B.fromAddress),B.toAddress!==void 0&&(d.toAddress=B.toAddress),B.amount?d.amount=B.amount.map(s=>s?n.Coin.toJSON(s):void 0):d.amount=[],d},fromPartial(B){var s;const d=h();return d.fromAddress=B.fromAddress??"",d.toAddress=B.toAddress??"",d.amount=((s=B.amount)==null?void 0:s.map(y=>n.Coin.fromPartial(y)))||[],d}};function v(){return{}}e.MsgSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSendResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=v();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return v()},toJSON(B){return{}},fromPartial(B){return v()}};function C(){return{inputs:[],outputs:[]}}e.MsgMultiSend={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSend",encode(B,d=r.BinaryWriter.create()){for(const s of B.inputs)t.Input.encode(s,d.uint32(10).fork()).ldelim();for(const s of B.outputs)t.Output.encode(s,d.uint32(18).fork()).ldelim();return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=C();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.inputs.push(t.Input.decode(s,s.uint32()));break;case 2:E.outputs.push(t.Output.decode(s,s.uint32()));break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=C();return Array.isArray(B==null?void 0:B.inputs)&&(d.inputs=B.inputs.map(s=>t.Input.fromJSON(s))),Array.isArray(B==null?void 0:B.outputs)&&(d.outputs=B.outputs.map(s=>t.Output.fromJSON(s))),d},toJSON(B){const d={};return B.inputs?d.inputs=B.inputs.map(s=>s?t.Input.toJSON(s):void 0):d.inputs=[],B.outputs?d.outputs=B.outputs.map(s=>s?t.Output.toJSON(s):void 0):d.outputs=[],d},fromPartial(B){var s,y;const d=C();return d.inputs=((s=B.inputs)==null?void 0:s.map(E=>t.Input.fromPartial(E)))||[],d.outputs=((y=B.outputs)==null?void 0:y.map(E=>t.Output.fromPartial(E)))||[],d}};function w(){return{}}e.MsgMultiSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSendResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=w();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return w()},toJSON(B){return{}},fromPartial(B){return w()}};function D(){return{authority:"",params:t.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParams",encode(B,d=r.BinaryWriter.create()){return B.authority!==""&&d.uint32(10).string(B.authority),B.params!==void 0&&t.Params.encode(B.params,d.uint32(18).fork()).ldelim(),d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=D();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.authority=s.string();break;case 2:E.params=t.Params.decode(s,s.uint32());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=D();return(0,o.isSet)(B.authority)&&(d.authority=String(B.authority)),(0,o.isSet)(B.params)&&(d.params=t.Params.fromJSON(B.params)),d},toJSON(B){const d={};return B.authority!==void 0&&(d.authority=B.authority),B.params!==void 0&&(d.params=B.params?t.Params.toJSON(B.params):void 0),d},fromPartial(B){const d=D();return d.authority=B.authority??"",B.params!==void 0&&B.params!==null&&(d.params=t.Params.fromPartial(B.params)),d}};function J(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParamsResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=J();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return J()},toJSON(B){return{}},fromPartial(B){return J()}};function I(){return{authority:"",sendEnabled:[],useDefaultFor:[]}}e.MsgSetSendEnabled={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabled",encode(B,d=r.BinaryWriter.create()){B.authority!==""&&d.uint32(10).string(B.authority);for(const s of B.sendEnabled)t.SendEnabled.encode(s,d.uint32(18).fork()).ldelim();for(const s of B.useDefaultFor)d.uint32(26).string(s);return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=I();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.authority=s.string();break;case 2:E.sendEnabled.push(t.SendEnabled.decode(s,s.uint32()));break;case 3:E.useDefaultFor.push(s.string());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=I();return(0,o.isSet)(B.authority)&&(d.authority=String(B.authority)),Array.isArray(B==null?void 0:B.sendEnabled)&&(d.sendEnabled=B.sendEnabled.map(s=>t.SendEnabled.fromJSON(s))),Array.isArray(B==null?void 0:B.useDefaultFor)&&(d.useDefaultFor=B.useDefaultFor.map(s=>String(s))),d},toJSON(B){const d={};return B.authority!==void 0&&(d.authority=B.authority),B.sendEnabled?d.sendEnabled=B.sendEnabled.map(s=>s?t.SendEnabled.toJSON(s):void 0):d.sendEnabled=[],B.useDefaultFor?d.useDefaultFor=B.useDefaultFor.map(s=>s):d.useDefaultFor=[],d},fromPartial(B){var s,y;const d=I();return d.authority=B.authority??"",d.sendEnabled=((s=B.sendEnabled)==null?void 0:s.map(E=>t.SendEnabled.fromPartial(E)))||[],d.useDefaultFor=((y=B.useDefaultFor)==null?void 0:y.map(E=>E))||[],d}};function g(){return{}}e.MsgSetSendEnabledResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabledResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=g();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return g()},toJSON(B){return{}},fromPartial(B){return g()}};class R{constructor(d){this.rpc=d,this.Send=this.Send.bind(this),this.MultiSend=this.MultiSend.bind(this),this.UpdateParams=this.UpdateParams.bind(this),this.SetSendEnabled=this.SetSendEnabled.bind(this)}Send(d){const s=e.MsgSend.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","Send",s).then(E=>e.MsgSendResponse.decode(new r.BinaryReader(E)))}MultiSend(d){const s=e.MsgMultiSend.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","MultiSend",s).then(E=>e.MsgMultiSendResponse.decode(new r.BinaryReader(E)))}UpdateParams(d){const s=e.MsgUpdateParams.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","UpdateParams",s).then(E=>e.MsgUpdateParamsResponse.decode(new r.BinaryReader(E)))}SetSendEnabled(d){const s=e.MsgSetSendEnabled.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","SetSendEnabled",s).then(E=>e.MsgSetSendEnabledResponse.decode(new r.BinaryReader(E)))}}e.MsgClientImpl=R})(Oc);Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Registry=Bn.isTxBodyEncodeObject=Bn.isPbjsGeneratedType=Bn.isTsProtoGeneratedType=Bn.isTelescopeGeneratedType=void 0;const Qk=Oc,Wk=Me,_d=at,Fk=Re;function im(e){const n=e;return typeof n.fromPartial=="function"&&typeof n.typeUrl=="string"}Bn.isTelescopeGeneratedType=im;function Ic(e){return typeof e.fromPartial=="function"}Bn.isTsProtoGeneratedType=Ic;function Gk(e){return!Ic(e)}Bn.isPbjsGeneratedType=Gk;const wl={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function om(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}Bn.isTxBodyEncodeObject=om;class Lk{constructor(n){const{cosmosCoin:t,cosmosMsgSend:r}=wl;this.types=n?new Map([...n]):new Map([[t,Wk.Coin],[r,Qk.MsgSend]])}register(n,t){this.types.set(n,t)}lookupType(n){return this.types.get(n)}lookupTypeWithError(n){const t=this.lookupType(n);if(!t)throw new Error(`Unregistered type url: ${n}`);return t}encode(n){const{value:t,typeUrl:r}=n;if(om(n))return this.encodeTxBody(t);const o=this.lookupTypeWithError(r),h=im(o)||Ic(o)?o.fromPartial(t):o.create(t);return o.encode(h).finish()}encodeAsAny(n){const t=this.encode(n);return Fk.Any.fromPartial({typeUrl:n.typeUrl,value:t})}encodeTxBody(n){var o;const t=n.messages.map(h=>this.encodeAsAny(h)),r=_d.TxBody.fromPartial({...n,timeoutHeight:BigInt(((o=n.timeoutHeight)==null?void 0:o.toString())??"0"),messages:t});return _d.TxBody.encode(r).finish()}decode({typeUrl:n,value:t}){if(n===wl.cosmosTxBody)return this.decodeTxBody(t);const o=this.lookupTypeWithError(n).decode(t);return Object.entries(o).forEach(([h,v])=>{typeof ue.Buffer<"u"&&typeof ue.Buffer.isBuffer<"u"&&ue.Buffer.isBuffer(v)&&(o[h]=Uint8Array.from(v))}),o}decodeTxBody(n){const t=_d.TxBody.decode(n);return{...t,messages:t.messages.map(({typeUrl:r,value:o})=>{if(!r)throw new Error("Missing type_url in Any");if(!o)throw new Error("Missing value in Any");return this.decode({typeUrl:r,value:o})})}}}Bn.Registry=Lk;var Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.isOfflineDirectSigner=void 0;function $k(e){return e.signDirect!==void 0}Ha.isOfflineDirectSigner=$k;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseCoins=e.coins=e.coin=e.executeKdf=e.makeSignDoc=e.makeSignBytes=e.makeAuthInfoBytes=e.isOfflineDirectSigner=e.Registry=e.isTxBodyEncodeObject=e.isTsProtoGeneratedType=e.isPbjsGeneratedType=e.encodePubkey=e.decodePubkey=e.decodeOptionalPubkey=e.anyToSinglePubkey=e.makeCosmoshubPath=e.DirectSecp256k1Wallet=e.extractKdfConfiguration=e.DirectSecp256k1HdWallet=e.decodeTxRaw=void 0;var n=Ca;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return n.decodeTxRaw}});var t=Gr;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return t.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return t.extractKdfConfiguration}});var r=Ma;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return r.DirectSecp256k1Wallet}});var o=qa;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var h=nt;Object.defineProperty(e,"anyToSinglePubkey",{enumerable:!0,get:function(){return h.anyToSinglePubkey}}),Object.defineProperty(e,"decodeOptionalPubkey",{enumerable:!0,get:function(){return h.decodeOptionalPubkey}}),Object.defineProperty(e,"decodePubkey",{enumerable:!0,get:function(){return h.decodePubkey}}),Object.defineProperty(e,"encodePubkey",{enumerable:!0,get:function(){return h.encodePubkey}});var v=Bn;Object.defineProperty(e,"isPbjsGeneratedType",{enumerable:!0,get:function(){return v.isPbjsGeneratedType}}),Object.defineProperty(e,"isTsProtoGeneratedType",{enumerable:!0,get:function(){return v.isTsProtoGeneratedType}}),Object.defineProperty(e,"isTxBodyEncodeObject",{enumerable:!0,get:function(){return v.isTxBodyEncodeObject}}),Object.defineProperty(e,"Registry",{enumerable:!0,get:function(){return v.Registry}});var C=Ha;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return C.isOfflineDirectSigner}});var w=ot;Object.defineProperty(e,"makeAuthInfoBytes",{enumerable:!0,get:function(){return w.makeAuthInfoBytes}}),Object.defineProperty(e,"makeSignBytes",{enumerable:!0,get:function(){return w.makeSignBytes}}),Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return w.makeSignDoc}});var D=Bc;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return D.executeKdf}});var J=zn;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return J.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return J.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return J.parseCoins}})})(st);var Va={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.ModuleCredential=e.ModuleAccount=e.BaseAccount=e.protobufPackage=void 0;const n=Re,t=ee,r=ne;e.protobufPackage="cosmos.auth.v1beta1";function o(){return{address:"",pubKey:void 0,accountNumber:BigInt(0),sequence:BigInt(0)}}e.BaseAccount={typeUrl:"/cosmos.auth.v1beta1.BaseAccount",encode(w,D=t.BinaryWriter.create()){return w.address!==""&&D.uint32(10).string(w.address),w.pubKey!==void 0&&n.Any.encode(w.pubKey,D.uint32(18).fork()).ldelim(),w.accountNumber!==BigInt(0)&&D.uint32(24).uint64(w.accountNumber),w.sequence!==BigInt(0)&&D.uint32(32).uint64(w.sequence),D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=o();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.address=J.string();break;case 2:g.pubKey=n.Any.decode(J,J.uint32());break;case 3:g.accountNumber=J.uint64();break;case 4:g.sequence=J.uint64();break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=o();return(0,r.isSet)(w.address)&&(D.address=String(w.address)),(0,r.isSet)(w.pubKey)&&(D.pubKey=n.Any.fromJSON(w.pubKey)),(0,r.isSet)(w.accountNumber)&&(D.accountNumber=BigInt(w.accountNumber.toString())),(0,r.isSet)(w.sequence)&&(D.sequence=BigInt(w.sequence.toString())),D},toJSON(w){const D={};return w.address!==void 0&&(D.address=w.address),w.pubKey!==void 0&&(D.pubKey=w.pubKey?n.Any.toJSON(w.pubKey):void 0),w.accountNumber!==void 0&&(D.accountNumber=(w.accountNumber||BigInt(0)).toString()),w.sequence!==void 0&&(D.sequence=(w.sequence||BigInt(0)).toString()),D},fromPartial(w){const D=o();return D.address=w.address??"",w.pubKey!==void 0&&w.pubKey!==null&&(D.pubKey=n.Any.fromPartial(w.pubKey)),w.accountNumber!==void 0&&w.accountNumber!==null&&(D.accountNumber=BigInt(w.accountNumber.toString())),w.sequence!==void 0&&w.sequence!==null&&(D.sequence=BigInt(w.sequence.toString())),D}};function h(){return{baseAccount:void 0,name:"",permissions:[]}}e.ModuleAccount={typeUrl:"/cosmos.auth.v1beta1.ModuleAccount",encode(w,D=t.BinaryWriter.create()){w.baseAccount!==void 0&&e.BaseAccount.encode(w.baseAccount,D.uint32(10).fork()).ldelim(),w.name!==""&&D.uint32(18).string(w.name);for(const J of w.permissions)D.uint32(26).string(J);return D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=h();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.baseAccount=e.BaseAccount.decode(J,J.uint32());break;case 2:g.name=J.string();break;case 3:g.permissions.push(J.string());break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=h();return(0,r.isSet)(w.baseAccount)&&(D.baseAccount=e.BaseAccount.fromJSON(w.baseAccount)),(0,r.isSet)(w.name)&&(D.name=String(w.name)),Array.isArray(w==null?void 0:w.permissions)&&(D.permissions=w.permissions.map(J=>String(J))),D},toJSON(w){const D={};return w.baseAccount!==void 0&&(D.baseAccount=w.baseAccount?e.BaseAccount.toJSON(w.baseAccount):void 0),w.name!==void 0&&(D.name=w.name),w.permissions?D.permissions=w.permissions.map(J=>J):D.permissions=[],D},fromPartial(w){var J;const D=h();return w.baseAccount!==void 0&&w.baseAccount!==null&&(D.baseAccount=e.BaseAccount.fromPartial(w.baseAccount)),D.name=w.name??"",D.permissions=((J=w.permissions)==null?void 0:J.map(I=>I))||[],D}};function v(){return{moduleName:"",derivationKeys:[]}}e.ModuleCredential={typeUrl:"/cosmos.auth.v1beta1.ModuleCredential",encode(w,D=t.BinaryWriter.create()){w.moduleName!==""&&D.uint32(10).string(w.moduleName);for(const J of w.derivationKeys)D.uint32(18).bytes(J);return D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=v();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.moduleName=J.string();break;case 2:g.derivationKeys.push(J.bytes());break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=v();return(0,r.isSet)(w.moduleName)&&(D.moduleName=String(w.moduleName)),Array.isArray(w==null?void 0:w.derivationKeys)&&(D.derivationKeys=w.derivationKeys.map(J=>(0,r.bytesFromBase64)(J))),D},toJSON(w){const D={};return w.moduleName!==void 0&&(D.moduleName=w.moduleName),w.derivationKeys?D.derivationKeys=w.derivationKeys.map(J=>(0,r.base64FromBytes)(J!==void 0?J:new Uint8Array)):D.derivationKeys=[],D},fromPartial(w){var J;const D=v();return D.moduleName=w.moduleName??"",D.derivationKeys=((J=w.derivationKeys)==null?void 0:J.map(I=>I))||[],D}};function C(){return{maxMemoCharacters:BigInt(0),txSigLimit:BigInt(0),txSizeCostPerByte:BigInt(0),sigVerifyCostEd25519:BigInt(0),sigVerifyCostSecp256k1:BigInt(0)}}e.Params={typeUrl:"/cosmos.auth.v1beta1.Params",encode(w,D=t.BinaryWriter.create()){return w.maxMemoCharacters!==BigInt(0)&&D.uint32(8).uint64(w.maxMemoCharacters),w.txSigLimit!==BigInt(0)&&D.uint32(16).uint64(w.txSigLimit),w.txSizeCostPerByte!==BigInt(0)&&D.uint32(24).uint64(w.txSizeCostPerByte),w.sigVerifyCostEd25519!==BigInt(0)&&D.uint32(32).uint64(w.sigVerifyCostEd25519),w.sigVerifyCostSecp256k1!==BigInt(0)&&D.uint32(40).uint64(w.sigVerifyCostSecp256k1),D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=C();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.maxMemoCharacters=J.uint64();break;case 2:g.txSigLimit=J.uint64();break;case 3:g.txSizeCostPerByte=J.uint64();break;case 4:g.sigVerifyCostEd25519=J.uint64();break;case 5:g.sigVerifyCostSecp256k1=J.uint64();break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=C();return(0,r.isSet)(w.maxMemoCharacters)&&(D.maxMemoCharacters=BigInt(w.maxMemoCharacters.toString())),(0,r.isSet)(w.txSigLimit)&&(D.txSigLimit=BigInt(w.txSigLimit.toString())),(0,r.isSet)(w.txSizeCostPerByte)&&(D.txSizeCostPerByte=BigInt(w.txSizeCostPerByte.toString())),(0,r.isSet)(w.sigVerifyCostEd25519)&&(D.sigVerifyCostEd25519=BigInt(w.sigVerifyCostEd25519.toString())),(0,r.isSet)(w.sigVerifyCostSecp256k1)&&(D.sigVerifyCostSecp256k1=BigInt(w.sigVerifyCostSecp256k1.toString())),D},toJSON(w){const D={};return w.maxMemoCharacters!==void 0&&(D.maxMemoCharacters=(w.maxMemoCharacters||BigInt(0)).toString()),w.txSigLimit!==void 0&&(D.txSigLimit=(w.txSigLimit||BigInt(0)).toString()),w.txSizeCostPerByte!==void 0&&(D.txSizeCostPerByte=(w.txSizeCostPerByte||BigInt(0)).toString()),w.sigVerifyCostEd25519!==void 0&&(D.sigVerifyCostEd25519=(w.sigVerifyCostEd25519||BigInt(0)).toString()),w.sigVerifyCostSecp256k1!==void 0&&(D.sigVerifyCostSecp256k1=(w.sigVerifyCostSecp256k1||BigInt(0)).toString()),D},fromPartial(w){const D=C();return w.maxMemoCharacters!==void 0&&w.maxMemoCharacters!==null&&(D.maxMemoCharacters=BigInt(w.maxMemoCharacters.toString())),w.txSigLimit!==void 0&&w.txSigLimit!==null&&(D.txSigLimit=BigInt(w.txSigLimit.toString())),w.txSizeCostPerByte!==void 0&&w.txSizeCostPerByte!==null&&(D.txSizeCostPerByte=BigInt(w.txSizeCostPerByte.toString())),w.sigVerifyCostEd25519!==void 0&&w.sigVerifyCostEd25519!==null&&(D.sigVerifyCostEd25519=BigInt(w.sigVerifyCostEd25519.toString())),w.sigVerifyCostSecp256k1!==void 0&&w.sigVerifyCostSecp256k1!==null&&(D.sigVerifyCostSecp256k1=BigInt(w.sigVerifyCostSecp256k1.toString())),D}}})(Va);var Tc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PermanentLockedAccount=e.PeriodicVestingAccount=e.Period=e.DelayedVestingAccount=e.ContinuousVestingAccount=e.BaseVestingAccount=e.protobufPackage=void 0;const n=Va,t=Me,r=ee,o=ne;e.protobufPackage="cosmos.vesting.v1beta1";function h(){return{baseAccount:void 0,originalVesting:[],delegatedFree:[],delegatedVesting:[],endTime:BigInt(0)}}e.BaseVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.BaseVestingAccount",encode(I,g=r.BinaryWriter.create()){I.baseAccount!==void 0&&n.BaseAccount.encode(I.baseAccount,g.uint32(10).fork()).ldelim();for(const R of I.originalVesting)t.Coin.encode(R,g.uint32(18).fork()).ldelim();for(const R of I.delegatedFree)t.Coin.encode(R,g.uint32(26).fork()).ldelim();for(const R of I.delegatedVesting)t.Coin.encode(R,g.uint32(34).fork()).ldelim();return I.endTime!==BigInt(0)&&g.uint32(40).int64(I.endTime),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=h();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseAccount=n.BaseAccount.decode(R,R.uint32());break;case 2:d.originalVesting.push(t.Coin.decode(R,R.uint32()));break;case 3:d.delegatedFree.push(t.Coin.decode(R,R.uint32()));break;case 4:d.delegatedVesting.push(t.Coin.decode(R,R.uint32()));break;case 5:d.endTime=R.int64();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=h();return(0,o.isSet)(I.baseAccount)&&(g.baseAccount=n.BaseAccount.fromJSON(I.baseAccount)),Array.isArray(I==null?void 0:I.originalVesting)&&(g.originalVesting=I.originalVesting.map(R=>t.Coin.fromJSON(R))),Array.isArray(I==null?void 0:I.delegatedFree)&&(g.delegatedFree=I.delegatedFree.map(R=>t.Coin.fromJSON(R))),Array.isArray(I==null?void 0:I.delegatedVesting)&&(g.delegatedVesting=I.delegatedVesting.map(R=>t.Coin.fromJSON(R))),(0,o.isSet)(I.endTime)&&(g.endTime=BigInt(I.endTime.toString())),g},toJSON(I){const g={};return I.baseAccount!==void 0&&(g.baseAccount=I.baseAccount?n.BaseAccount.toJSON(I.baseAccount):void 0),I.originalVesting?g.originalVesting=I.originalVesting.map(R=>R?t.Coin.toJSON(R):void 0):g.originalVesting=[],I.delegatedFree?g.delegatedFree=I.delegatedFree.map(R=>R?t.Coin.toJSON(R):void 0):g.delegatedFree=[],I.delegatedVesting?g.delegatedVesting=I.delegatedVesting.map(R=>R?t.Coin.toJSON(R):void 0):g.delegatedVesting=[],I.endTime!==void 0&&(g.endTime=(I.endTime||BigInt(0)).toString()),g},fromPartial(I){var R,B,d;const g=h();return I.baseAccount!==void 0&&I.baseAccount!==null&&(g.baseAccount=n.BaseAccount.fromPartial(I.baseAccount)),g.originalVesting=((R=I.originalVesting)==null?void 0:R.map(s=>t.Coin.fromPartial(s)))||[],g.delegatedFree=((B=I.delegatedFree)==null?void 0:B.map(s=>t.Coin.fromPartial(s)))||[],g.delegatedVesting=((d=I.delegatedVesting)==null?void 0:d.map(s=>t.Coin.fromPartial(s)))||[],I.endTime!==void 0&&I.endTime!==null&&(g.endTime=BigInt(I.endTime.toString())),g}};function v(){return{baseVestingAccount:void 0,startTime:BigInt(0)}}e.ContinuousVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.ContinuousVestingAccount",encode(I,g=r.BinaryWriter.create()){return I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),I.startTime!==BigInt(0)&&g.uint32(16).int64(I.startTime),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=v();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;case 2:d.startTime=R.int64();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=v();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),(0,o.isSet)(I.startTime)&&(g.startTime=BigInt(I.startTime.toString())),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),I.startTime!==void 0&&(g.startTime=(I.startTime||BigInt(0)).toString()),g},fromPartial(I){const g=v();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),I.startTime!==void 0&&I.startTime!==null&&(g.startTime=BigInt(I.startTime.toString())),g}};function C(){return{baseVestingAccount:void 0}}e.DelayedVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.DelayedVestingAccount",encode(I,g=r.BinaryWriter.create()){return I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=C();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=C();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),g},fromPartial(I){const g=C();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),g}};function w(){return{length:BigInt(0),amount:[]}}e.Period={typeUrl:"/cosmos.vesting.v1beta1.Period",encode(I,g=r.BinaryWriter.create()){I.length!==BigInt(0)&&g.uint32(8).int64(I.length);for(const R of I.amount)t.Coin.encode(R,g.uint32(18).fork()).ldelim();return g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=w();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.length=R.int64();break;case 2:d.amount.push(t.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=w();return(0,o.isSet)(I.length)&&(g.length=BigInt(I.length.toString())),Array.isArray(I==null?void 0:I.amount)&&(g.amount=I.amount.map(R=>t.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.length!==void 0&&(g.length=(I.length||BigInt(0)).toString()),I.amount?g.amount=I.amount.map(R=>R?t.Coin.toJSON(R):void 0):g.amount=[],g},fromPartial(I){var R;const g=w();return I.length!==void 0&&I.length!==null&&(g.length=BigInt(I.length.toString())),g.amount=((R=I.amount)==null?void 0:R.map(B=>t.Coin.fromPartial(B)))||[],g}};function D(){return{baseVestingAccount:void 0,startTime:BigInt(0),vestingPeriods:[]}}e.PeriodicVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.PeriodicVestingAccount",encode(I,g=r.BinaryWriter.create()){I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),I.startTime!==BigInt(0)&&g.uint32(16).int64(I.startTime);for(const R of I.vestingPeriods)e.Period.encode(R,g.uint32(26).fork()).ldelim();return g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=D();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;case 2:d.startTime=R.int64();break;case 3:d.vestingPeriods.push(e.Period.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=D();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),(0,o.isSet)(I.startTime)&&(g.startTime=BigInt(I.startTime.toString())),Array.isArray(I==null?void 0:I.vestingPeriods)&&(g.vestingPeriods=I.vestingPeriods.map(R=>e.Period.fromJSON(R))),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),I.startTime!==void 0&&(g.startTime=(I.startTime||BigInt(0)).toString()),I.vestingPeriods?g.vestingPeriods=I.vestingPeriods.map(R=>R?e.Period.toJSON(R):void 0):g.vestingPeriods=[],g},fromPartial(I){var R;const g=D();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),I.startTime!==void 0&&I.startTime!==null&&(g.startTime=BigInt(I.startTime.toString())),g.vestingPeriods=((R=I.vestingPeriods)==null?void 0:R.map(B=>e.Period.fromPartial(B)))||[],g}};function J(){return{baseVestingAccount:void 0}}e.PermanentLockedAccount={typeUrl:"/cosmos.vesting.v1beta1.PermanentLockedAccount",encode(I,g=r.BinaryWriter.create()){return I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=J();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=J();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),g},fromPartial(I){const g=J();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),g}}})(Tc);Object.defineProperty(co,"__esModule",{value:!0});co.accountFromAny=void 0;const Kk=Te,zk=st,Ui=Oe,El=Va,Eo=Tc;function _l(e){return Kk.Uint64.fromString(e.toString())}function mr(e){const{address:n,pubKey:t,accountNumber:r,sequence:o}=e,h=(0,zk.decodeOptionalPubkey)(t);return{address:n,pubkey:h,accountNumber:_l(r).toNumber(),sequence:_l(o).toNumber()}}function Yk(e){var r,o,h,v,C,w,D;const{typeUrl:n,value:t}=e;switch(n){case"/cosmos.auth.v1beta1.BaseAccount":return mr(El.BaseAccount.decode(t));case"/cosmos.auth.v1beta1.ModuleAccount":{const J=El.ModuleAccount.decode(t).baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const J=(r=Eo.BaseVestingAccount.decode(t))==null?void 0:r.baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const J=(h=(o=Eo.ContinuousVestingAccount.decode(t))==null?void 0:o.baseVestingAccount)==null?void 0:h.baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const J=(C=(v=Eo.DelayedVestingAccount.decode(t))==null?void 0:v.baseVestingAccount)==null?void 0:C.baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const J=(D=(w=Eo.PeriodicVestingAccount.decode(t))==null?void 0:w.baseVestingAccount)==null?void 0:D.baseAccount;return(0,Ui.assert)(J),mr(J)}default:throw new Error(`Unsupported type: '${n}'`)}}co.accountFromAny=Yk;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.AminoTypes=void 0;class Zk{constructor(n){this.register=n}toAmino({typeUrl:n,value:t}){const r=this.register[n];if(!r)throw new Error(`Type URL '${n}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);return{type:r.aminoType,value:r.toAmino(t)}}fromAmino({type:n,value:t}){const r=Object.entries(this.register).filter(([o,{aminoType:h}])=>h===n);switch(r.length){case 0:throw new Error(`Amino type identifier '${n}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);case 1:{const[o,h]=r[0];return{typeUrl:o,value:h.fromAmino(t)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${n}': '`+r.map(([o,h])=>o).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}mo.AminoTypes=Zk;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.fromTendermintEvent=void 0;const Ul=de;function Xk(e){return{type:e.type,attributes:e.attributes.map(n=>({key:typeof n.key=="string"?n.key:(0,Ul.fromUtf8)(n.key,!0),value:typeof n.value=="string"?n.value:(0,Ul.fromUtf8)(n.value,!0)}))}}yo.fromTendermintEvent=Xk;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});rr.calculateFee=rr.GasPrice=void 0;const am=Te,xk=st;function jk(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Qa{constructor(n,t){this.amount=n,this.denom=t}static fromString(n){const t=n.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!t)throw new Error("Invalid gas price string");const[r,o,h]=t;jk(h);const C=am.Decimal.fromUserInput(o,18);return new Qa(C,h)}toString(){return this.amount.toString()+this.denom}}rr.GasPrice=Qa;function eP(e,n){const t=typeof n=="string"?Qa.fromString(n):n,{denom:r,amount:o}=t,h=o.multiply(new am.Uint53(e)).ceil().toString();return{amount:(0,xk.coins)(h,r),gas:e.toString()}}rr.calculateFee=eP;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.findAttribute=tn.parseRawLog=tn.parseLogs=tn.parseLog=tn.parseEvent=tn.parseAttribute=void 0;const Cc=Oe;function sm(e){if(!(0,Cc.isNonNullObject)(e))throw new Error("Attribute must be a non-null object");const{key:n,value:t}=e;if(typeof n!="string"||!n)throw new Error("Attribute's key must be a non-empty string");if(typeof t!="string"&&typeof t<"u")throw new Error("Attribute's value must be a string or unset");return{key:n,value:t||""}}tn.parseAttribute=sm;function dm(e){if(!(0,Cc.isNonNullObject)(e))throw new Error("Event must be a non-null object");const{type:n,attributes:t}=e;if(typeof n!="string"||n==="")throw new Error("Event type must be a non-empty string");if(!Array.isArray(t))throw new Error("Event's attributes must be an array");return{type:n,attributes:t.map(sm)}}tn.parseEvent=dm;function um(e){if(!(0,Cc.isNonNullObject)(e))throw new Error("Log must be a non-null object");const{msg_index:n,log:t,events:r}=e;if(typeof n!="number")throw new Error("Log's msg_index must be a number");if(typeof t!="string")throw new Error("Log's log must be a string");if(!Array.isArray(r))throw new Error("Log's events must be an array");return{msg_index:n,log:t,events:r.map(dm)}}tn.parseLog=um;function cm(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(um)}tn.parseLogs=cm;function nP(e){if(!e)return[];const n=JSON.parse(e).map(({events:t},r)=>({msg_index:r,events:t,log:""}));return cm(n)}tn.parseRawLog=nP;function tP(e,n,t){var h;const r=e.find(()=>!0),o=(h=r==null?void 0:r.events.find(v=>v.type===n))==null?void 0:h.attributes.find(v=>v.key===t);if(!o)throw new Error(`Could not find attribute '${t}' in first event of type '${n}' in first log.`);return o}tn.findAttribute=tP;var io={},Wa={},lm={},be={};Object.defineProperty(be,"__esModule",{value:!0});be.PageResponse=be.PageRequest=be.protobufPackage=void 0;const Mr=ee,Vn=ne;be.protobufPackage="cosmos.base.query.v1beta1";function Ud(){return{key:new Uint8Array,offset:BigInt(0),limit:BigInt(0),countTotal:!1,reverse:!1}}be.PageRequest={typeUrl:"/cosmos.base.query.v1beta1.PageRequest",encode(e,n=Mr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),e.offset!==BigInt(0)&&n.uint32(16).uint64(e.offset),e.limit!==BigInt(0)&&n.uint32(24).uint64(e.limit),e.countTotal===!0&&n.uint32(32).bool(e.countTotal),e.reverse===!0&&n.uint32(40).bool(e.reverse),n},decode(e,n){const t=e instanceof Mr.BinaryReader?e:new Mr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Ud();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;case 2:o.offset=t.uint64();break;case 3:o.limit=t.uint64();break;case 4:o.countTotal=t.bool();break;case 5:o.reverse=t.bool();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Ud();return(0,Vn.isSet)(e.key)&&(n.key=(0,Vn.bytesFromBase64)(e.key)),(0,Vn.isSet)(e.offset)&&(n.offset=BigInt(e.offset.toString())),(0,Vn.isSet)(e.limit)&&(n.limit=BigInt(e.limit.toString())),(0,Vn.isSet)(e.countTotal)&&(n.countTotal=!!e.countTotal),(0,Vn.isSet)(e.reverse)&&(n.reverse=!!e.reverse),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Vn.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),e.offset!==void 0&&(n.offset=(e.offset||BigInt(0)).toString()),e.limit!==void 0&&(n.limit=(e.limit||BigInt(0)).toString()),e.countTotal!==void 0&&(n.countTotal=e.countTotal),e.reverse!==void 0&&(n.reverse=e.reverse),n},fromPartial(e){const n=Ud();return n.key=e.key??new Uint8Array,e.offset!==void 0&&e.offset!==null&&(n.offset=BigInt(e.offset.toString())),e.limit!==void 0&&e.limit!==null&&(n.limit=BigInt(e.limit.toString())),n.countTotal=e.countTotal??!1,n.reverse=e.reverse??!1,n}};function Jd(){return{nextKey:new Uint8Array,total:BigInt(0)}}be.PageResponse={typeUrl:"/cosmos.base.query.v1beta1.PageResponse",encode(e,n=Mr.BinaryWriter.create()){return e.nextKey.length!==0&&n.uint32(10).bytes(e.nextKey),e.total!==BigInt(0)&&n.uint32(16).uint64(e.total),n},decode(e,n){const t=e instanceof Mr.BinaryReader?e:new Mr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Jd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.nextKey=t.bytes();break;case 2:o.total=t.uint64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Jd();return(0,Vn.isSet)(e.nextKey)&&(n.nextKey=(0,Vn.bytesFromBase64)(e.nextKey)),(0,Vn.isSet)(e.total)&&(n.total=BigInt(e.total.toString())),n},toJSON(e){const n={};return e.nextKey!==void 0&&(n.nextKey=(0,Vn.base64FromBytes)(e.nextKey!==void 0?e.nextKey:new Uint8Array)),e.total!==void 0&&(n.total=(e.total||BigInt(0)).toString()),n},fromPartial(e){const n=Jd();return n.nextKey=e.nextKey??new Uint8Array,e.total!==void 0&&e.total!==null&&(n.total=BigInt(e.total.toString())),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAccountInfoResponse=e.QueryAccountInfoRequest=e.QueryAccountAddressByIDResponse=e.QueryAccountAddressByIDRequest=e.AddressStringToBytesResponse=e.AddressStringToBytesRequest=e.AddressBytesToStringResponse=e.AddressBytesToStringRequest=e.Bech32PrefixResponse=e.Bech32PrefixRequest=e.QueryModuleAccountByNameResponse=e.QueryModuleAccountByNameRequest=e.QueryModuleAccountsResponse=e.QueryModuleAccountsRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryAccountResponse=e.QueryAccountRequest=e.QueryAccountsResponse=e.QueryAccountsRequest=e.protobufPackage=void 0;const n=be,t=Re,r=Va,o=ee,h=ne;e.protobufPackage="cosmos.auth.v1beta1";function v(){return{pagination:void 0}}e.QueryAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsRequest",encode(l,T=o.BinaryWriter.create()){return l.pagination!==void 0&&n.PageRequest.encode(l.pagination,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=v();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.pagination=n.PageRequest.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=v();return(0,h.isSet)(l.pagination)&&(T.pagination=n.PageRequest.fromJSON(l.pagination)),T},toJSON(l){const T={};return l.pagination!==void 0&&(T.pagination=l.pagination?n.PageRequest.toJSON(l.pagination):void 0),T},fromPartial(l){const T=v();return l.pagination!==void 0&&l.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(l.pagination)),T}};function C(){return{accounts:[],pagination:void 0}}e.QueryAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.accounts)t.Any.encode(f,T.uint32(10).fork()).ldelim();return l.pagination!==void 0&&n.PageResponse.encode(l.pagination,T.uint32(18).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=C();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.accounts.push(t.Any.decode(f,f.uint32()));break;case 2:A.pagination=n.PageResponse.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=C();return Array.isArray(l==null?void 0:l.accounts)&&(T.accounts=l.accounts.map(f=>t.Any.fromJSON(f))),(0,h.isSet)(l.pagination)&&(T.pagination=n.PageResponse.fromJSON(l.pagination)),T},toJSON(l){const T={};return l.accounts?T.accounts=l.accounts.map(f=>f?t.Any.toJSON(f):void 0):T.accounts=[],l.pagination!==void 0&&(T.pagination=l.pagination?n.PageResponse.toJSON(l.pagination):void 0),T},fromPartial(l){var f;const T=C();return T.accounts=((f=l.accounts)==null?void 0:f.map(p=>t.Any.fromPartial(p)))||[],l.pagination!==void 0&&l.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(l.pagination)),T}};function w(){return{address:""}}e.QueryAccountRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountRequest",encode(l,T=o.BinaryWriter.create()){return l.address!==""&&T.uint32(10).string(l.address),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=w();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.address=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=w();return(0,h.isSet)(l.address)&&(T.address=String(l.address)),T},toJSON(l){const T={};return l.address!==void 0&&(T.address=l.address),T},fromPartial(l){const T=w();return T.address=l.address??"",T}};function D(){return{account:void 0}}e.QueryAccountResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountResponse",encode(l,T=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=D();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.account=t.Any.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=D();return(0,h.isSet)(l.account)&&(T.account=t.Any.fromJSON(l.account)),T},toJSON(l){const T={};return l.account!==void 0&&(T.account=l.account?t.Any.toJSON(l.account):void 0),T},fromPartial(l){const T=D();return l.account!==void 0&&l.account!==null&&(T.account=t.Any.fromPartial(l.account)),T}};function J(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryParamsRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=J();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return J()},toJSON(l){return{}},fromPartial(l){return J()}};function I(){return{params:r.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryParamsResponse",encode(l,T=o.BinaryWriter.create()){return l.params!==void 0&&r.Params.encode(l.params,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=I();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.params=r.Params.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=I();return(0,h.isSet)(l.params)&&(T.params=r.Params.fromJSON(l.params)),T},toJSON(l){const T={};return l.params!==void 0&&(T.params=l.params?r.Params.toJSON(l.params):void 0),T},fromPartial(l){const T=I();return l.params!==void 0&&l.params!==null&&(T.params=r.Params.fromPartial(l.params)),T}};function g(){return{}}e.QueryModuleAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=g();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return g()},toJSON(l){return{}},fromPartial(l){return g()}};function R(){return{accounts:[]}}e.QueryModuleAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.accounts)t.Any.encode(f,T.uint32(10).fork()).ldelim();return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=R();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.accounts.push(t.Any.decode(f,f.uint32()));break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=R();return Array.isArray(l==null?void 0:l.accounts)&&(T.accounts=l.accounts.map(f=>t.Any.fromJSON(f))),T},toJSON(l){const T={};return l.accounts?T.accounts=l.accounts.map(f=>f?t.Any.toJSON(f):void 0):T.accounts=[],T},fromPartial(l){var f;const T=R();return T.accounts=((f=l.accounts)==null?void 0:f.map(p=>t.Any.fromPartial(p)))||[],T}};function B(){return{name:""}}e.QueryModuleAccountByNameRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest",encode(l,T=o.BinaryWriter.create()){return l.name!==""&&T.uint32(10).string(l.name),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=B();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.name=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=B();return(0,h.isSet)(l.name)&&(T.name=String(l.name)),T},toJSON(l){const T={};return l.name!==void 0&&(T.name=l.name),T},fromPartial(l){const T=B();return T.name=l.name??"",T}};function d(){return{account:void 0}}e.QueryModuleAccountByNameResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse",encode(l,T=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=d();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.account=t.Any.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=d();return(0,h.isSet)(l.account)&&(T.account=t.Any.fromJSON(l.account)),T},toJSON(l){const T={};return l.account!==void 0&&(T.account=l.account?t.Any.toJSON(l.account):void 0),T},fromPartial(l){const T=d();return l.account!==void 0&&l.account!==null&&(T.account=t.Any.fromPartial(l.account)),T}};function s(){return{}}e.Bech32PrefixRequest={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=s();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return s()},toJSON(l){return{}},fromPartial(l){return s()}};function y(){return{bech32Prefix:""}}e.Bech32PrefixResponse={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixResponse",encode(l,T=o.BinaryWriter.create()){return l.bech32Prefix!==""&&T.uint32(10).string(l.bech32Prefix),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=y();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.bech32Prefix=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=y();return(0,h.isSet)(l.bech32Prefix)&&(T.bech32Prefix=String(l.bech32Prefix)),T},toJSON(l){const T={};return l.bech32Prefix!==void 0&&(T.bech32Prefix=l.bech32Prefix),T},fromPartial(l){const T=y();return T.bech32Prefix=l.bech32Prefix??"",T}};function E(){return{addressBytes:new Uint8Array}}e.AddressBytesToStringRequest={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringRequest",encode(l,T=o.BinaryWriter.create()){return l.addressBytes.length!==0&&T.uint32(10).bytes(l.addressBytes),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=E();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressBytes=f.bytes();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=E();return(0,h.isSet)(l.addressBytes)&&(T.addressBytes=(0,h.bytesFromBase64)(l.addressBytes)),T},toJSON(l){const T={};return l.addressBytes!==void 0&&(T.addressBytes=(0,h.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),T},fromPartial(l){const T=E();return T.addressBytes=l.addressBytes??new Uint8Array,T}};function _(){return{addressString:""}}e.AddressBytesToStringResponse={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringResponse",encode(l,T=o.BinaryWriter.create()){return l.addressString!==""&&T.uint32(10).string(l.addressString),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=_();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressString=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=_();return(0,h.isSet)(l.addressString)&&(T.addressString=String(l.addressString)),T},toJSON(l){const T={};return l.addressString!==void 0&&(T.addressString=l.addressString),T},fromPartial(l){const T=_();return T.addressString=l.addressString??"",T}};function U(){return{addressString:""}}e.AddressStringToBytesRequest={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesRequest",encode(l,T=o.BinaryWriter.create()){return l.addressString!==""&&T.uint32(10).string(l.addressString),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=U();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressString=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=U();return(0,h.isSet)(l.addressString)&&(T.addressString=String(l.addressString)),T},toJSON(l){const T={};return l.addressString!==void 0&&(T.addressString=l.addressString),T},fromPartial(l){const T=U();return T.addressString=l.addressString??"",T}};function H(){return{addressBytes:new Uint8Array}}e.AddressStringToBytesResponse={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesResponse",encode(l,T=o.BinaryWriter.create()){return l.addressBytes.length!==0&&T.uint32(10).bytes(l.addressBytes),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=H();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressBytes=f.bytes();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=H();return(0,h.isSet)(l.addressBytes)&&(T.addressBytes=(0,h.bytesFromBase64)(l.addressBytes)),T},toJSON(l){const T={};return l.addressBytes!==void 0&&(T.addressBytes=(0,h.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),T},fromPartial(l){const T=H();return T.addressBytes=l.addressBytes??new Uint8Array,T}};function i(){return{id:BigInt(0),accountId:BigInt(0)}}e.QueryAccountAddressByIDRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest",encode(l,T=o.BinaryWriter.create()){return l.id!==BigInt(0)&&T.uint32(8).int64(l.id),l.accountId!==BigInt(0)&&T.uint32(16).uint64(l.accountId),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=i();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.id=f.int64();break;case 2:A.accountId=f.uint64();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=i();return(0,h.isSet)(l.id)&&(T.id=BigInt(l.id.toString())),(0,h.isSet)(l.accountId)&&(T.accountId=BigInt(l.accountId.toString())),T},toJSON(l){const T={};return l.id!==void 0&&(T.id=(l.id||BigInt(0)).toString()),l.accountId!==void 0&&(T.accountId=(l.accountId||BigInt(0)).toString()),T},fromPartial(l){const T=i();return l.id!==void 0&&l.id!==null&&(T.id=BigInt(l.id.toString())),l.accountId!==void 0&&l.accountId!==null&&(T.accountId=BigInt(l.accountId.toString())),T}};function m(){return{accountAddress:""}}e.QueryAccountAddressByIDResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse",encode(l,T=o.BinaryWriter.create()){return l.accountAddress!==""&&T.uint32(10).string(l.accountAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=m();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.accountAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=m();return(0,h.isSet)(l.accountAddress)&&(T.accountAddress=String(l.accountAddress)),T},toJSON(l){const T={};return l.accountAddress!==void 0&&(T.accountAddress=l.accountAddress),T},fromPartial(l){const T=m();return T.accountAddress=l.accountAddress??"",T}};function N(){return{address:""}}e.QueryAccountInfoRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoRequest",encode(l,T=o.BinaryWriter.create()){return l.address!==""&&T.uint32(10).string(l.address),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=N();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.address=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=N();return(0,h.isSet)(l.address)&&(T.address=String(l.address)),T},toJSON(l){const T={};return l.address!==void 0&&(T.address=l.address),T},fromPartial(l){const T=N();return T.address=l.address??"",T}};function V(){return{info:void 0}}e.QueryAccountInfoResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoResponse",encode(l,T=o.BinaryWriter.create()){return l.info!==void 0&&r.BaseAccount.encode(l.info,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=V();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.info=r.BaseAccount.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=V();return(0,h.isSet)(l.info)&&(T.info=r.BaseAccount.fromJSON(l.info)),T},toJSON(l){const T={};return l.info!==void 0&&(T.info=l.info?r.BaseAccount.toJSON(l.info):void 0),T},fromPartial(l){const T=V();return l.info!==void 0&&l.info!==null&&(T.info=r.BaseAccount.fromPartial(l.info)),T}};class u{constructor(T){this.rpc=T,this.Accounts=this.Accounts.bind(this),this.Account=this.Account.bind(this),this.AccountAddressByID=this.AccountAddressByID.bind(this),this.Params=this.Params.bind(this),this.ModuleAccounts=this.ModuleAccounts.bind(this),this.ModuleAccountByName=this.ModuleAccountByName.bind(this),this.Bech32Prefix=this.Bech32Prefix.bind(this),this.AddressBytesToString=this.AddressBytesToString.bind(this),this.AddressStringToBytes=this.AddressStringToBytes.bind(this),this.AccountInfo=this.AccountInfo.bind(this)}Accounts(T={pagination:n.PageRequest.fromPartial({})}){const f=e.QueryAccountsRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Accounts",f).then(A=>e.QueryAccountsResponse.decode(new o.BinaryReader(A)))}Account(T){const f=e.QueryAccountRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Account",f).then(A=>e.QueryAccountResponse.decode(new o.BinaryReader(A)))}AccountAddressByID(T){const f=e.QueryAccountAddressByIDRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountAddressByID",f).then(A=>e.QueryAccountAddressByIDResponse.decode(new o.BinaryReader(A)))}Params(T={}){const f=e.QueryParamsRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Params",f).then(A=>e.QueryParamsResponse.decode(new o.BinaryReader(A)))}ModuleAccounts(T={}){const f=e.QueryModuleAccountsRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccounts",f).then(A=>e.QueryModuleAccountsResponse.decode(new o.BinaryReader(A)))}ModuleAccountByName(T){const f=e.QueryModuleAccountByNameRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccountByName",f).then(A=>e.QueryModuleAccountByNameResponse.decode(new o.BinaryReader(A)))}Bech32Prefix(T={}){const f=e.Bech32PrefixRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Bech32Prefix",f).then(A=>e.Bech32PrefixResponse.decode(new o.BinaryReader(A)))}AddressBytesToString(T){const f=e.AddressBytesToStringRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressBytesToString",f).then(A=>e.AddressBytesToStringResponse.decode(new o.BinaryReader(A)))}AddressStringToBytes(T){const f=e.AddressStringToBytesRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressStringToBytes",f).then(A=>e.AddressStringToBytesResponse.decode(new o.BinaryReader(A)))}AccountInfo(T){const f=e.QueryAccountInfoRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountInfo",f).then(A=>e.QueryAccountInfoResponse.decode(new o.BinaryReader(A)))}}e.QueryClientImpl=u})(lm);var Ke={},Fa={},ho={},Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.concat=void 0;const rP=ar;function iP(...e){const n=new Array,t=new Array,r=new Set;let o=0;function h(){for(;n.length>0;)n.shift().unsubscribe();t.length=0,r.clear(),o=0}const v={start:C=>{e.forEach(J=>t.push([]));function w(J){for(;;){const I=t[J].shift();if(I===void 0)return;C.next(I)}}function D(){return o>=e.length}if(D()){C.complete();return}e.forEach((J,I)=>{n.push(J.subscribe({next:g=>{I===o?C.next(g):t[I].push(g)},complete:()=>{for(r.add(I);r.has(o);)w(o),o++;D()?C.complete():w(o)},error:g=>{C.error(g),h()}}))})},stop:()=>{h()}};return rP.Stream.create(v)}Ga.concat=iP;var La={};Object.defineProperty(La,"__esModule",{value:!0});La.DefaultValueProducer=void 0;class oP{get value(){return this.internalValue}constructor(n,t){this.callbacks=t,this.internalValue=n}update(n){this.internalValue=n,this.listener&&this.listener.next(n)}error(n){this.listener&&this.listener.error(n)}start(n){this.listener=n,n.next(this.internalValue),this.callbacks&&this.callbacks.onStarted()}stop(){this.callbacks&&this.callbacks.onStop(),this.listener=void 0}}La.DefaultValueProducer=oP;var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.dropDuplicates=void 0;function aP(e){return t=>{const r=new Set;return t.filter(h=>!r.has(e(h))).debug(h=>r.add(e(h)))}}$a.dropDuplicates=aP;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.firstEvent=bt.toListPromise=bt.fromListPromise=void 0;const sP=ar;function dP(e){const n={start:t=>{e.then(r=>{for(const o of r)t.next(o);t.complete()}).catch(r=>t.error(r))},stop:()=>{}};return sP.Stream.create(n)}bt.fromListPromise=dP;async function fm(e,n){return new Promise((t,r)=>{if(n===0){t([]);return}const o=new Array;e.take(n).subscribe({next:h=>{o.push(h),o.length===n&&t(o)},complete:()=>{r(`Stream completed before all events could be collected. Collected ${o.length}, expected ${n}`)},error:h=>r(h)})})}bt.toListPromise=fm;async function uP(e){return(await fm(e,1))[0]}bt.firstEvent=uP;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.lastValue=tt.asArray=tt.countStream=tt.Reducer=void 0;class Ka{constructor(n,t,r){this.stream=n,this.reducer=t,this.state=r,this.completed=new Promise((o,h)=>{const v=this.stream.subscribe({next:C=>{this.state=this.reducer(this.state,C)},complete:()=>{o(),v.unsubscribe()},error:C=>{h(C),v.unsubscribe()}})})}value(){return this.state}async finished(){return this.completed}}tt.Reducer=Ka;function cP(e,n){return e+1}function lP(e){return new Ka(e,cP,0)}tt.countStream=lP;function fP(e,n){return[...e,n]}function pP(e){return new Ka(e,fP,[])}tt.asArray=pP;function mP(e,n){return n}function yP(e){return new Ka(e,mP,void 0)}tt.lastValue=yP;var za={};Object.defineProperty(za,"__esModule",{value:!0});za.ValueAndUpdates=void 0;const hP=ar;class gP{get value(){return this.producer.value}constructor(n){this.producer=n,this.updates=hP.MemoryStream.createWithMemory(this.producer)}async waitFor(n){const t=typeof n=="function"?n:r=>r===n;return new Promise((r,o)=>{const h=this.updates.subscribe({next:v=>{t(v)&&(r(v),setTimeout(()=>h.unsubscribe(),0))},complete:()=>{h.unsubscribe(),o("Update stream completed without expected value")},error:v=>{o(v)}})})}}za.ValueAndUpdates=gP;(function(e){var n=x&&x.__createBinding||(Object.create?function(w,D,J,I){I===void 0&&(I=J);var g=Object.getOwnPropertyDescriptor(D,J);(!g||("get"in g?!D.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return D[J]}}),Object.defineProperty(w,I,g)}:function(w,D,J,I){I===void 0&&(I=J),w[I]=D[J]}),t=x&&x.__exportStar||function(w,D){for(var J in w)J!=="default"&&!Object.prototype.hasOwnProperty.call(D,J)&&n(D,w,J)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueAndUpdates=e.toListPromise=e.fromListPromise=e.firstEvent=e.dropDuplicates=e.DefaultValueProducer=e.concat=void 0;var r=Ga;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return r.concat}});var o=La;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var h=$a;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return h.dropDuplicates}});var v=bt;Object.defineProperty(e,"firstEvent",{enumerable:!0,get:function(){return v.firstEvent}}),Object.defineProperty(e,"fromListPromise",{enumerable:!0,get:function(){return v.fromListPromise}}),Object.defineProperty(e,"toListPromise",{enumerable:!0,get:function(){return v.toListPromise}}),t(tt,e);var C=za;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return C.ValueAndUpdates}})})(ho);Object.defineProperty(Fa,"__esModule",{value:!0});Fa.QueryClient=void 0;const Ft=Oh,Kt=de,SP=ho,xe=Oe;function _o(e,n,t){if(e.type!==n)throw new Error(`Op expected to be ${n}, got "${e.type}`);if(!(0,xe.arrayContentEquals)(t,e.key))throw new Error(`Proven key different than queried key.
1
+ const __vite__fileDeps=["assets/index-CV4pfIw7.js","assets/create-C0QenCKJ.js","main.js","main.css","assets/chain-CeDrBrSQ.js","assets/ens-validation.es6-gsmLKNwB.js","assets/index-Dqsfl0un.js","assets/index-ByeOkyS8.js","assets/unsignedTransaction-B08fN_UW.js","assets/index-BjIxvQFV.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
2
+ var hh=Object.defineProperty;var gh=(e,n,t)=>n in e?hh(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var me=(e,n,t)=>(gh(e,typeof n!="symbol"?n+"":n,t),t);import{bd as yp,be as Fi,aw as Ao,av as lc,ax as Sh,b6 as fc,bf as or,o as x,a0 as Ia,U as kh,d as ue,w as hp,V as Ph,X as gp,Y as Rh,Z as vh,bg as Bh,$ as bh,r as Sp,bh as ee,bi as ne,bj as Re,bk as Me,al as ar,am as Oh,bl as Mn,bm as pc,bn as sr,ad as Ah,an as Ih,bo as mc,bp as kp,ap as Th,bq as Sd,b0 as kd,b7 as Ch,aI as Nh,br as wh,ay as Eh,az as _h,aA as Uh,aB as Pd,aC as Jh,aD as Dh,G as j,L as _e,H as Fn,g as Mh,ba as Rn,x as Xo,S as qh,I as Hh,bs as Vh,bt as xo,af as Qh,bu as Wh,bv as Rd,bw as fl,bx as pl,by as ml,bz as Fh,bA as Gh,_ as vd,aG as Lh}from"../main.js";import{b as $h,H as ct,E as Pp,t as at,c as uo,m as Kh,U as sa,s as _u,G as Gi,C as zh,I as Yh,a as Rp,k as Uu,d as yl}from"./ens-validation.es6-gsmLKNwB.js";import{C as Zh,P as Xh}from"./chain-CeDrBrSQ.js";class Qn extends $h{constructor(t,r){super(t,r);me(this,"errorClass","HttpRequestException");me(this,"method",ct.Get);this.type=Pp.HttpRequest,this.method=r?r.method||ct.Get:ct.Get}}var xt;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.EARLY_HINTS=103]="EARLY_HINTS",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.MOVED_TEMPORARILY=302]="MOVED_TEMPORARILY",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.REQUEST_TOO_LONG=413]="REQUEST_TOO_LONG",e[e.REQUEST_URI_TOO_LONG=414]="REQUEST_URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.IM_A_TEAPOT=418]="IM_A_TEAPOT",e[e.INSUFFICIENT_SPACE_ON_RESOURCE=419]="INSUFFICIENT_SPACE_ON_RESOURCE",e[e.METHOD_FAILURE=420]="METHOD_FAILURE",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(xt||(xt={}));const{Axios:xh,AxiosError:jh,CanceledError:eg,isCancel:ng,CancelToken:tg,VERSION:rg,all:ig,Cancel:og,isAxiosError:ag,spread:sg,toFormData:dg,AxiosHeaders:ug,HttpStatusCode:cg,formToJSON:lg,getAdapter:fg,mergeConfig:pg}=yp,mg=Object.freeze(Object.defineProperty({__proto__:null,Axios:xh,AxiosError:jh,AxiosHeaders:ug,Cancel:og,CancelToken:tg,CanceledError:eg,HttpStatusCode:cg,VERSION:rg,all:ig,default:yp,formToJSON:lg,getAdapter:fg,isAxiosError:ag,isCancel:ng,mergeConfig:pg,spread:sg,toFormData:dg},Symbol.toStringTag,{value:"Module"})),no="Cosmwasm";function hl(e){try{const n=Fi.decodeToBytes(e);return{data:n.bytes,prefix:n.prefix}}catch{}try{return{data:lc.decode(e)}}catch{}try{return{data:fc.decode(e)}}catch{}throw new Error(`Cannot decode: ${e}`)}const Le=class Le{constructor(n){me(this,"platform",no);me(this,"address");me(this,"domain");me(this,"denom");me(this,"denomType");if(Le.instanceof(n)){const t=n;this.address=t.address,this.domain=t.domain,this.denom=t.denom,this.denomType=t.denomType;return}if(typeof n=="string"){if(n.length<=8){this.address=new Uint8Array(0),this.denom=n,this.denomType="native";return}if(n.indexOf("/")!==-1){const t=n.split("/");if(t.length>=3){const{data:r,prefix:o}=hl(t[t.length-2]);this.address=r,this.domain=o,this.denom=t[t.length-1],this.denomType=t.slice(0,t.length-2).join("/")}else{const{data:r}=hl(t[1]);this.address=r,this.denomType=t[0]}}else{if(!Le.isValidAddress(n))throw new Error(`Invalid Cosmwasm address: ${n}`);const{bytes:t,prefix:r}=Fi.decodeToBytes(n);this.address=t,this.domain=r}}else if(n instanceof Uint8Array)this.address=n;else if(Ao.instanceof(n))this.address=n.toUint8Array();else throw new Error(`Invalid Cosmwasm address ${n}`);if(!Le.validAddressLength(this.address))throw new Error("Expected 20 or 32 bytes address")}unwrap(){return this.toString()}toString(){return this.denomType!==void 0?this.denomType==="native"?this.denom:this.denomType==="ibc"?`${this.denomType.toLowerCase()}/${lc.encode(this.address).toUpperCase()}`:`${this.denomType}/${Le.encode(this.domain,this.address)}/${this.denom}`:Le.encode(this.domain,this.address)}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){const n=new Uint8Array(Ao.byteSize);return n.set(this.address,Ao.byteSize-this.address.length),new Ao(n)}static isValidAddress(n){try{const t=Fi.decodeToBytes(n);return Le.validAddressLength(t.bytes)}catch{}return!1}static encode(n,t){return Fi.encode(n,Fi.toWords(t))}static validAddressLength(n){if(n.length!==Le.contractAddressByteSize&&n.length!==Le.accountAddressByteSize)throw new Error(`Invalid Cosmwasm address, expected ${Le.contractAddressByteSize} or ${Le.accountAddressByteSize} bytes but got ${n.length}`);return!0}static instanceof(n){return n.platform===no}equals(n){return Le.instanceof(n)?this.toString()===n.toString():n.equals(this.toUniversalAddress())}};me(Le,"contractAddressByteSize",32),me(Le,"accountAddressByteSize",20);let je=Le;Sh(no,je);const bT=1e6,OT="/cosmwasm.wasm.v1.MsgExecuteContract",AT="/ibc.applications.transfer.v1.MsgTransfer",vp="transfer",IT="send_packet",TT="recv_packet",CT="packet_dst_channel",NT="packet_src_channel",wT="packet_src_port",ET="packet_dst_port",_T="packet_sequence",UT="packet_data",JT=60*60*1e3,Bp=[["Cosmoshub","cosmos"],["Evmos","evmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","osmo"],["Sei","sei"],["Terra","terra"],["Terra2","terra"],["Wormchain","wormhole"],["Xpla","xpla"],["Celestia","celestia"],["Stargaze","stars"],["Dymension","dym"],["Neutron","neutron"],["Seda","seda"],["Provenance","pb"]],bp=or(Bp);or(Bp,[1,[0]]);const Op=[["Mainnet",[["Cosmoshub","uatom"],["Evmos","aevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Terra","luna"],["Terra2","uluna"],["Wormchain","uworm"],["Xpla","uxpla"],["Celestia","utia"],["Dymension","adym"],["Stargaze","ustars"],["Neutron","untrn"],["Provenance","nhash"]]],["Testnet",[["Cosmoshub","uatom"],["Evmos","atevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Terra","luna"],["Terra2","uluna"],["Wormchain","uworm"],["Xpla","uxpla"],["Seda","aseda"]]],["Devnet",[["Cosmoshub","uatom"],["Evmos","atevmos"],["Injective","inj"],["Kujira","kuji"],["Osmosis","uosmo"],["Sei","usei"],["Terra","luna"],["Terra2","uluna"],["Wormchain","uworm"],["Xpla","uxpla"]]]],yg=or(Op);or(Op,[[0,2],[1]]);const hg=[["Mainnet",[["Wormchain",{Osmosis:"channel-3",Evmos:"channel-5",Kujira:"channel-9",Stargaze:"channel-12",Injective:"channel-13",Dymension:"channel-15"}],["Osmosis",{Wormchain:"channel-2186"}],["Evmos",{Wormchain:"channel-94"}],["Kujira",{Wormchain:"channel-113"}],["Injective",{Wormchain:"channel-183"}],["Dymension",{Wormchain:"channel-36"}],["Stargaze",{Wormchain:"channel-278"}]]],["Testnet",[["Wormchain",{Cosmoshub:"channel-5",Osmosis:"channel-9"}],["Cosmoshub",{Wormchain:"channel-3086"}],["Osmosis",{Wormchain:"channel-3906"}]]],["Devnet",[["Wormchain",{Cosmoshub:"channel-1",Osmosis:"channel-2"}],["Cosmoshub",{Wormchain:"channel-1"}],["Osmosis",{Wormchain:"channel-1"}]]]],gl=or(hg),gg=["Evmos","Injective"],Sg=[["Mainnet",[["Injective","https://lcd.injective.network"],["Evmos","https://rest.bd.evmos.org:1317"]]],["Testnet",[["Injective","https://k8s.testnet.lcd.injective.network"],["Evmos","https://rest.bd.evmos.dev:1317"]]],["Devnet",[["Injective","https://localhost:1234"],["Evmos","https://localhost:1233"]]]],kg=or(Sg),Pg=[["Mainnet",[["Terra","28.325"],["Terra2","0.015"],["Osmosis","0.025"],["Sei","0.02"],["Cosmoshub","0.025"],["Kujira","0.0051"],["Neutron","0.075"],["Celestia","0.02"],["Stargaze","1.1"],["Injective","700000000"],["Xpla","1147500000000"],["Evmos","25000000000"],["Dymension","5000000000"],["Provenance","2100"]]]],DT=or(Pg);var er={},co={},Te={},Ta={},Rg=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.Decimal=void 0;const qn=Rg(Ia),Sl=100;class Ae{static fromUserInput(n,t){Ae.verifyFractionalDigits(t);const r=n.match(/[^0-9.]/);if(r)throw new Error(`Invalid character at position ${r.index+1}`);let o,h;if(n==="")o="0",h="";else if(n.search(/\./)===-1)o=n,h="";else{const C=n.split(".");switch(C.length){case 0:case 1:throw new Error("Fewer than two elements in split result. This must not happen here.");case 2:if(!C[1])throw new Error("Fractional part missing");o=C[0],h=C[1].replace(/0+$/,"");break;default:throw new Error("More than one separator found")}}if(h.length>t)throw new Error("Got more fractional digits than supported");const v=`${o}${h.padEnd(t,"0")}`;return new Ae(v,t)}static fromAtomics(n,t){return Ae.verifyFractionalDigits(t),new Ae(n,t)}static zero(n){return Ae.verifyFractionalDigits(n),new Ae("0",n)}static one(n){return Ae.verifyFractionalDigits(n),new Ae("1"+"0".repeat(n),n)}static verifyFractionalDigits(n){if(!Number.isInteger(n))throw new Error("Fractional digits is not an integer");if(n<0)throw new Error("Fractional digits must not be negative");if(n>Sl)throw new Error(`Fractional digits must not exceed ${Sl}`)}static compare(n,t){if(n.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return n.data.atomics.cmp(new qn.default(t.atomics))}get atomics(){return this.data.atomics.toString()}get fractionalDigits(){return this.data.fractionalDigits}constructor(n,t){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format. Only non-negative integers in decimal representation supported.");this.data={atomics:new qn.default(n),fractionalDigits:t}}clone(){return new Ae(this.atomics,this.fractionalDigits)}floor(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Ae.fromAtomics(t.mul(n).toString(),this.fractionalDigits)}ceil(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():Ae.fromAtomics(t.addn(1).mul(n).toString(),this.fractionalDigits)}toString(){const n=new qn.default(10).pow(new qn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n),r=this.data.atomics.mod(n);if(r.isZero())return t.toString();{const h=r.toString().padStart(this.data.fractionalDigits,"0").replace(/0+$/,"");return`${t.toString()}.${h}`}}toFloatApproximation(){const n=Number(this.toString());if(Number.isNaN(n))throw new Error("Conversion to number failed");return n}plus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.add(new qn.default(n.atomics));return new Ae(t.toString(),this.fractionalDigits)}minus(n){if(this.fractionalDigits!==n.fractionalDigits)throw new Error("Fractional digits do not match");const t=this.data.atomics.sub(new qn.default(n.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new Ae(t.toString(),this.fractionalDigits)}multiply(n){const t=this.data.atomics.mul(new qn.default(n.toString()));return new Ae(t.toString(),this.fractionalDigits)}equals(n){return Ae.compare(this,n)===0}isLessThan(n){return Ae.compare(this,n)<0}isLessThanOrEqual(n){return Ae.compare(this,n)<=0}isGreaterThan(n){return Ae.compare(this,n)>0}isGreaterThanOrEqual(n){return Ae.compare(this,n)>=0}}Ta.Decimal=Ae;var xn={},vg=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xn,"__esModule",{value:!0});xn.Uint64=xn.Uint53=xn.Int53=xn.Uint32=void 0;const jo=vg(Ia),Bg=new jo.default("18446744073709551615",10,"be");class zi{static fromBigEndianBytes(n){return zi.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==4)throw new Error("Invalid input length. Expected 4 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const r=t==="be"?n:Array.from(n).reverse();return new zi(r[0]*2**24+r[1]*2**16+r[2]*2**8+r[3])}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new zi(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<0||n>4294967295)throw new Error("Input not in uint32 range: "+n.toString());this.data=n}toBytesBigEndian(){return new Uint8Array([Math.floor(this.data/2**24)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**0)&255])}toBytesLittleEndian(){return new Uint8Array([Math.floor(this.data/2**0)&255,Math.floor(this.data/2**8)&255,Math.floor(this.data/2**16)&255,Math.floor(this.data/2**24)&255])}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}xn.Uint32=zi;class to{static fromString(n){if(!n.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new to(Number.parseInt(n,10))}constructor(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");if(n<Number.MIN_SAFE_INTEGER||n>Number.MAX_SAFE_INTEGER)throw new Error("Input not in int53 range: "+n.toString());this.data=n}toNumber(){return this.data}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}xn.Int53=to;class yc{static fromString(n){const t=to.fromString(n);return new yc(t.toNumber())}constructor(n){const t=new to(n);if(t.toNumber()<0)throw new Error("Input is negative");this.data=t}toNumber(){return this.data.toNumber()}toBigInt(){return BigInt(this.toNumber())}toString(){return this.data.toString()}}xn.Uint53=yc;class Ir{static fromBytesBigEndian(n){return Ir.fromBytes(n)}static fromBytes(n,t="be"){if(n.length!==8)throw new Error("Invalid input length. Expected 8 bytes.");for(let o=0;o<n.length;++o)if(!Number.isInteger(n[o])||n[o]>255||n[o]<0)throw new Error("Invalid value in byte. Found: "+n[o]);const r=t==="be"?Array.from(n):Array.from(n).reverse();return new Ir(new jo.default(r))}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new Ir(new jo.default(n,10,"be"))}static fromNumber(n){if(Number.isNaN(n))throw new Error("Input is not a number");if(!Number.isInteger(n))throw new Error("Input is not an integer");let t;try{t=new jo.default(n)}catch{throw new Error("Input is not a safe integer")}return new Ir(t)}constructor(n){if(n.isNeg())throw new Error("Input is negative");if(n.gt(Bg))throw new Error("Input exceeds uint64 range");this.data=n}toBytesBigEndian(){return Uint8Array.from(this.data.toArray("be",8))}toBytesLittleEndian(){return Uint8Array.from(this.data.toArray("le",8))}toString(){return this.data.toString(10)}toBigInt(){return BigInt(this.toString())}toNumber(){return this.data.toNumber()}}xn.Uint64=Ir;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var n=Ta;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var t=xn;Object.defineProperty(e,"Int53",{enumerable:!0,get:function(){return t.Int53}}),Object.defineProperty(e,"Uint32",{enumerable:!0,get:function(){return t.Uint32}}),Object.defineProperty(e,"Uint53",{enumerable:!0,get:function(){return t.Uint53}}),Object.defineProperty(e,"Uint64",{enumerable:!0,get:function(){return t.Uint64}})})(Te);var st={},Ca={};Object.defineProperty(Ca,"__esModule",{value:!0});Ca.decodeTxRaw=void 0;const Bd=at;function bg(e){const n=Bd.TxRaw.decode(e);return{authInfo:Bd.AuthInfo.decode(n.authInfoBytes),body:Bd.TxBody.decode(n.bodyBytes),signatures:n.signatures}}Ca.decodeTxRaw=bg;var Gr={},zn={},mn={},Ge={},jn={},de={},Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.fromAscii=Lr.toAscii=void 0;function Og(e){const n=t=>t.split("").map(r=>{const o=r.charCodeAt(0);if(o<32||o>126)throw new Error("Cannot encode character that is out of printable ASCII range: "+o);return o});return Uint8Array.from(n(e))}Lr.toAscii=Og;function Ag(e){return(t=>t.map(r=>{if(r<32||r>126)throw new Error("Cannot decode character that is out of printable ASCII range: "+r);return String.fromCharCode(r)}))(Array.from(e)).join("")}Lr.fromAscii=Ag;var $r={},Ig=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),Tg=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Cg=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Ig(n,e,t);return Tg(n,e),n};Object.defineProperty($r,"__esModule",{value:!0});$r.fromBase64=$r.toBase64=void 0;const Ap=Cg(kh);function Ng(e){return Ap.fromByteArray(e)}$r.toBase64=Ng;function wg(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return Ap.toByteArray(e)}$r.fromBase64=wg;var kt={},da="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Ju={};for(var Io=0;Io<da.length;Io++){var bd=da.charAt(Io);if(Ju[bd]!==void 0)throw new TypeError(bd+" is ambiguous");Ju[bd]=Io}function Er(e){var n=e>>25;return(e&33554431)<<5^-(n>>0&1)&996825010^-(n>>1&1)&642813549^-(n>>2&1)&513874426^-(n>>3&1)&1027748829^-(n>>4&1)&705979059}function Ip(e){for(var n=1,t=0;t<e.length;++t){var r=e.charCodeAt(t);if(r<33||r>126)return"Invalid prefix ("+e+")";n=Er(n)^r>>5}for(n=Er(n),t=0;t<e.length;++t){var o=e.charCodeAt(t);n=Er(n)^o&31}return n}function Eg(e,n,t){if(t=t||90,e.length+7+n.length>t)throw new TypeError("Exceeds length limit");e=e.toLowerCase();var r=Ip(e);if(typeof r=="string")throw new Error(r);for(var o=e+"1",h=0;h<n.length;++h){var v=n[h];if(v>>5)throw new Error("Non 5-bit word");r=Er(r)^v,o+=da.charAt(v)}for(h=0;h<6;++h)r=Er(r);for(r^=1,h=0;h<6;++h){var C=r>>(5-h)*5&31;o+=da.charAt(C)}return o}function Tp(e,n){if(n=n||90,e.length<8)return e+" too short";if(e.length>n)return"Exceeds length limit";var t=e.toLowerCase(),r=e.toUpperCase();if(e!==t&&e!==r)return"Mixed-case string "+e;e=t;var o=e.lastIndexOf("1");if(o===-1)return"No separator character for "+e;if(o===0)return"Missing prefix for "+e;var h=e.slice(0,o),v=e.slice(o+1);if(v.length<6)return"Data too short";var C=Ip(h);if(typeof C=="string")return C;for(var w=[],D=0;D<v.length;++D){var J=v.charAt(D),I=Ju[J];if(I===void 0)return"Unknown character "+J;C=Er(C)^I,!(D+6>=v.length)&&w.push(I)}return C!==1?"Invalid checksum for "+e:{prefix:h,words:w}}function _g(){var e=Tp.apply(null,arguments);if(typeof e=="object")return e}function Ug(e){var n=Tp.apply(null,arguments);if(typeof n=="object")return n;throw new Error(n)}function Na(e,n,t,r){for(var o=0,h=0,v=(1<<t)-1,C=[],w=0;w<e.length;++w)for(o=o<<n|e[w],h+=n;h>=t;)h-=t,C.push(o>>h&v);if(r)h>0&&C.push(o<<t-h&v);else{if(h>=n)return"Excess padding";if(o<<t-h&v)return"Non-zero padding"}return C}function Jg(e){var n=Na(e,8,5,!0);if(Array.isArray(n))return n}function Dg(e){var n=Na(e,8,5,!0);if(Array.isArray(n))return n;throw new Error(n)}function Mg(e){var n=Na(e,5,8,!1);if(Array.isArray(n))return n}function qg(e){var n=Na(e,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}var Hg={decodeUnsafe:_g,decode:Ug,encode:Eg,toWordsUnsafe:Jg,toWords:Dg,fromWordsUnsafe:Mg,fromWords:qg},Vg=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),Qg=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Wg=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&Vg(n,e,t);return Qg(n,e),n};Object.defineProperty(kt,"__esModule",{value:!0});kt.normalizeBech32=kt.fromBech32=kt.toBech32=void 0;const ua=Wg(Hg);function Cp(e,n,t){return ua.encode(e,ua.toWords(n),t)}kt.toBech32=Cp;function Np(e,n=1/0){const t=ua.decode(e,n);return{prefix:t.prefix,data:new Uint8Array(ua.fromWords(t.words))}}kt.fromBech32=Np;function Fg(e){const{prefix:n,data:t}=Np(e);return Cp(n,t)}kt.normalizeBech32=Fg;var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.fromHex=Kr.toHex=void 0;function Gg(e){let n="";for(const t of e)n+=("0"+t.toString(16)).slice(-2);return n}Kr.toHex=Gg;function Lg(e){if(e.length%2!==0)throw new Error("hex string length must be a multiple of 2");const n=new Uint8Array(e.length/2);for(let t=0;t<n.length;t++){const r=2*t,o=e.slice(r,r+2);if(!o.match(/[0-9a-f]{2}/i))throw new Error("hex string contains invalid characters");n[t]=parseInt(o,16)}return n}Kr.fromHex=Lg;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.toRfc3339=zr.fromRfc3339=void 0;const $g=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function pr(e,n=2){return e.toString().padStart(n,"0")}function Kg(e){const n=$g.exec(e);if(!n)throw new Error("Date string is not in RFC3339 format");const t=+n[1],r=+n[2],o=+n[3],h=+n[4],v=+n[5],C=+n[6],w=n[7]?Math.floor(+n[7]*1e3):0;let D,J,I;n[8]==="Z"?(D=1,J=0,I=0):(D=n[8].substring(0,1)==="-"?-1:1,J=+n[8].substring(1,3),I=+n[8].substring(4,6));const g=D*(J*60+I)*60,R=new Date;return R.setUTCFullYear(t,r-1,o),R.setUTCHours(h,v,C,w),new Date(R.getTime()-g*1e3)}zr.fromRfc3339=Kg;function zg(e){const n=e.getUTCFullYear(),t=pr(e.getUTCMonth()+1),r=pr(e.getUTCDate()),o=pr(e.getUTCHours()),h=pr(e.getUTCMinutes()),v=pr(e.getUTCSeconds()),C=pr(e.getUTCMilliseconds(),3);return`${n}-${t}-${r}T${o}:${h}:${v}.${C}Z`}zr.toRfc3339=zg;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.fromUtf8=Yr.toUtf8=void 0;function Yg(e){return new TextEncoder().encode(e)}Yr.toUtf8=Yg;function Zg(e,n=!1){const t=!n;return new TextDecoder("utf-8",{fatal:t}).decode(e)}Yr.fromUtf8=Zg;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.toUtf8=e.fromUtf8=e.toRfc3339=e.fromRfc3339=e.toHex=e.fromHex=e.toBech32=e.normalizeBech32=e.fromBech32=e.toBase64=e.fromBase64=e.toAscii=e.fromAscii=void 0;var n=Lr;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var t=$r;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return t.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return t.toBase64}});var r=kt;Object.defineProperty(e,"fromBech32",{enumerable:!0,get:function(){return r.fromBech32}}),Object.defineProperty(e,"normalizeBech32",{enumerable:!0,get:function(){return r.normalizeBech32}}),Object.defineProperty(e,"toBech32",{enumerable:!0,get:function(){return r.toBech32}});var o=Kr;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var h=zr;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return h.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return h.toRfc3339}});var v=Yr;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return v.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return v.toUtf8}})})(de);var en={},Oe={},Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.arrayContentStartsWith=Zr.arrayContentEquals=void 0;function Xg(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;++t)if(e[t]!==n[t])return!1;return!0}Zr.arrayContentEquals=Xg;function xg(e,n){if(e.length<n.length)return!1;for(let t=0;t<n.length;++t)if(e[t]!==n[t])return!1;return!0}Zr.arrayContentStartsWith=xg;var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.assertDefinedAndNotNull=Pt.assertDefined=Pt.assert=void 0;function jg(e,n){if(!e)throw new Error(n||"condition is not truthy")}Pt.assert=jg;function eS(e,n){if(e===void 0)throw new Error(n??"value is undefined")}Pt.assertDefined=eS;function nS(e,n){if(e==null)throw new Error(n??"value is undefined or null")}Pt.assertDefinedAndNotNull=nS;var wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.sleep=void 0;async function tS(e){return new Promise(n=>setTimeout(n,e))}wa.sleep=tS;var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.isDefined=Rt.isUint8Array=Rt.isNonNullObject=void 0;function wp(e){return typeof e=="object"&&e!==null}Rt.isNonNullObject=wp;function rS(e){return!(!wp(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof ue.Buffer<"u"&&typeof ue.Buffer.isBuffer<"u"&&ue.Buffer.isBuffer(e))}Rt.isUint8Array=rS;function iS(e){return e!==void 0}Rt.isDefined=iS;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isUint8Array=e.isNonNullObject=e.isDefined=e.sleep=e.assertDefinedAndNotNull=e.assertDefined=e.assert=e.arrayContentStartsWith=e.arrayContentEquals=void 0;var n=Zr;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return n.arrayContentStartsWith}});var t=Pt;Object.defineProperty(e,"assert",{enumerable:!0,get:function(){return t.assert}}),Object.defineProperty(e,"assertDefined",{enumerable:!0,get:function(){return t.assertDefined}}),Object.defineProperty(e,"assertDefinedAndNotNull",{enumerable:!0,get:function(){return t.assertDefinedAndNotNull}});var r=wa;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return r.sleep}});var o=Rt;Object.defineProperty(e,"isDefined",{enumerable:!0,get:function(){return o.isDefined}}),Object.defineProperty(e,"isNonNullObject",{enumerable:!0,get:function(){return o.isNonNullObject}}),Object.defineProperty(e,"isUint8Array",{enumerable:!0,get:function(){return o.isUint8Array}})})(Oe);var oS=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),aS=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),sS=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&oS(n,e,t);return aS(n,e),n};Object.defineProperty(en,"__esModule",{value:!0});en.pbkdf2Sha512=en.pbkdf2Sha512Noble=en.pbkdf2Sha512NodeCrypto=en.pbkdf2Sha512Subtle=en.getSubtle=en.getNodeCrypto=void 0;const jt=Oe,dS=Ph,uS=gp;async function Ep(){try{const e=await Promise.resolve().then(()=>sS(hp()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}en.getNodeCrypto=Ep;async function _p(){var n,t,r;let e=(n=globalThis==null?void 0:globalThis.crypto)==null?void 0:n.subtle;return e||(e=(r=(t=globalThis==null?void 0:globalThis.crypto)==null?void 0:t.webcrypto)==null?void 0:r.subtle),e}en.getSubtle=_p;async function Up(e,n,t,r,o){return(0,jt.assert)(e,"Argument subtle is falsy"),(0,jt.assert)(typeof e=="object","Argument subtle is not of type object"),(0,jt.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,jt.assert)(typeof e.deriveBits=="function","subtle.deriveBits is not a function"),e.importKey("raw",n,{name:"PBKDF2"},!1,["deriveBits"]).then(h=>e.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:"SHA-512"}},h,o*8).then(v=>new Uint8Array(v)))}en.pbkdf2Sha512Subtle=Up;async function Jp(e,n,t,r,o){return(0,jt.assert)(e,"Argument nodeCrypto is falsy"),(0,jt.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,jt.assert)(typeof e.pbkdf2=="function","nodeCrypto.pbkdf2 is not a function"),new Promise((h,v)=>{e.pbkdf2(n,t,r,o,"sha512",(C,w)=>{C?v(C):h(Uint8Array.from(w))})})}en.pbkdf2Sha512NodeCrypto=Jp;async function Dp(e,n,t,r){return(0,dS.pbkdf2Async)(uS.sha512,e,n,{c:t,dkLen:r})}en.pbkdf2Sha512Noble=Dp;async function cS(e,n,t,r){const o=await _p();if(o)return Up(o,e,n,t,r);{const h=await Ep();return h?Jp(h,e,n,t,r):Dp(e,n,t,r)}}en.pbkdf2Sha512=cS;var _n={},Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.toRealUint8Array=void 0;function lS(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}Ai.toRealUint8Array=lS;Object.defineProperty(_n,"__esModule",{value:!0});_n.sha512=_n.Sha512=_n.sha256=_n.Sha256=void 0;const fS=Rh,pS=gp,Mp=Ai;class qp{constructor(n){this.blockSize=512/8,this.impl=fS.sha256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Mp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}_n.Sha256=qp;function mS(e){return new qp(e).digest()}_n.sha256=mS;class Hp{constructor(n){this.blockSize=1024/8,this.impl=pS.sha512.create(),n&&this.update(n)}update(n){return this.impl.update((0,Mp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}_n.Sha512=Hp;function yS(e){return new Hp(e).digest()}_n.sha512=yS;Object.defineProperty(jn,"__esModule",{value:!0});jn.Bip39=jn.EnglishMnemonic=jn.mnemonicToEntropy=jn.entropyToMnemonic=void 0;const kl=de,hS=en,gS=_n,hc=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];function Vp(e){return Array.from(e).map(n=>n.toString(2).padStart(8,"0")).join("")}function Qp(e){const t=e.length*8/32,r=(0,gS.sha256)(e);return Vp(r).slice(0,t)}function Wp(e){return parseInt(e,2)}const SS=[16,20,24,28,32],kS=[12,15,18,21,24];function Fp(e){if(SS.indexOf(e.length)===-1)throw new Error("invalid input length");const n=Vp(e),t=Qp(e);return(n+t).match(/(.{11})/g).map(v=>{const C=Wp(v);return hc[C]}).join(" ")}jn.entropyToMnemonic=Fp;const PS="Invalid number of words",RS="Found word that is not in the wordlist",vS="Invalid entropy",BS="Invalid mnemonic checksum";function Du(e){return e.normalize("NFKD")}function gc(e){const n=Du(e).split(" ");if(!kS.includes(n.length))throw new Error(PS);const t=n.map(D=>{const J=hc.indexOf(D);if(J===-1)throw new Error(RS);return J.toString(2).padStart(11,"0")}).join(""),r=Math.floor(t.length/33)*32,o=t.slice(0,r),h=t.slice(r),v=o.match(/(.{1,8})/g).map(Wp);if(v.length<16||v.length>32||v.length%4!==0)throw new Error(vS);const C=Uint8Array.from(v);if(Qp(C)!==h)throw new Error(BS);return C}jn.mnemonicToEntropy=gc;class nr{constructor(n){if(!nr.mnemonicMatcher.test(n))throw new Error("Invalid mnemonic format");const t=n.split(" "),r=[12,15,18,21,24];if(r.indexOf(t.length)===-1)throw new Error(`Invalid word count in mnemonic (allowed: ${r} got: ${t.length})`);for(const o of t)if(nr.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");gc(n),this.data=n}toString(){return this.data}}jn.EnglishMnemonic=nr;nr.wordlist=hc;nr.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class bS{static encode(n){return new nr(Fp(n))}static decode(n){return gc(n.toString())}static async mnemonicToSeed(n,t){const r=(0,kl.toUtf8)(Du(n.toString())),o="mnemonic"+(t?Du(t):""),h=(0,kl.toUtf8)(o);return(0,hS.pbkdf2Sha512)(r,h,2048,64)}}jn.Bip39=bS;var lo={};Object.defineProperty(lo,"__esModule",{value:!0});lo.Hmac=void 0;class OS{constructor(n,t){const r=new n().blockSize;this.hash=h=>new n().update(h).digest();let o=t;if(o.length>r&&(o=this.hash(o)),o.length<r){const h=new Uint8Array(r-o.length);o=new Uint8Array([...o,...h])}this.oKeyPad=o.map(h=>h^92),this.iKeyPad=o.map(h=>h^54),this.messageHasher=new n,this.blockSize=r,this.update(this.iKeyPad)}update(n){return this.messageHasher.update(n),this}digest(){const n=this.messageHasher.digest();return this.hash(new Uint8Array([...this.oKeyPad,...n]))}}lo.Hmac=OS;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.keccak256=Xr.Keccak256=void 0;const AS=vh,IS=Ai;class Gp{constructor(n){this.blockSize=512/8,this.impl=AS.keccak_256.create(),n&&this.update(n)}update(n){return this.impl.update((0,IS.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}Xr.Keccak256=Gp;function TS(e){return new Gp(e).digest()}Xr.keccak256=TS;var nn={},CS=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(nn,"__esModule",{value:!0});nn.Xchacha20poly1305Ietf=nn.xchacha20NonceLength=nn.Ed25519=nn.Ed25519Keypair=nn.Argon2id=nn.isArgon2idOptions=void 0;const NS=Oe,cn=CS(Bh);function wS(e){return!(!(0,NS.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}nn.isArgon2idOptions=wS;class ES{static async execute(n,t,r){return await cn.default.ready,cn.default.crypto_pwhash(r.outputLength,n,t,r.opsLimit,r.memLimitKib*1024,cn.default.crypto_pwhash_ALG_ARGON2ID13)}}nn.Argon2id=ES;class Ea{static fromLibsodiumPrivkey(n){if(n.length!==64)throw new Error(`Unexpected key length ${n.length}. Must be 64.`);return new Ea(n.slice(0,32),n.slice(32,64))}constructor(n,t){this.privkey=n,this.pubkey=t}toLibsodiumPrivkey(){return new Uint8Array([...this.privkey,...this.pubkey])}}nn.Ed25519Keypair=Ea;class _S{static async makeKeypair(n){await cn.default.ready;const t=cn.default.crypto_sign_seed_keypair(n);return Ea.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(n,t){return await cn.default.ready,cn.default.crypto_sign_detached(n,t.toLibsodiumPrivkey())}static async verifySignature(n,t,r){return await cn.default.ready,cn.default.crypto_sign_verify_detached(n,t,r)}}nn.Ed25519=_S;nn.xchacha20NonceLength=24;class US{static async encrypt(n,t,r){return await cn.default.ready,cn.default.crypto_aead_xchacha20poly1305_ietf_encrypt(n,null,null,r,t)}static async decrypt(n,t,r){return await cn.default.ready,cn.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,n,null,r,t)}}nn.Xchacha20poly1305Ietf=US;var _a={};Object.defineProperty(_a,"__esModule",{value:!0});_a.Random=void 0;class JS{static getBytes(n){try{const t=typeof window=="object"?window:self,r=typeof t.crypto<"u"?t.crypto:t.msCrypto,o=new Uint8Array(n);return r.getRandomValues(o),o}catch{try{const t=hp();return new Uint8Array([...t.randomBytes(n)])}catch{throw new Error("No secure random number generator found")}}}}_a.Random=JS;var xr={};Object.defineProperty(xr,"__esModule",{value:!0});xr.ripemd160=xr.Ripemd160=void 0;const DS=bh,MS=Ai;class Lp{constructor(n){this.blockSize=512/8,this.impl=DS.ripemd160.create(),n&&this.update(n)}update(n){return this.impl.update((0,MS.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}xr.Ripemd160=Lp;function qS(e){return new Lp(e).digest()}xr.ripemd160=qS;var Ua={},tr={};Object.defineProperty(tr,"__esModule",{value:!0});tr.ExtendedSecp256k1Signature=tr.Secp256k1Signature=void 0;function Tr(e){let n=0;for(const t of e)if(t===0)n++;else break;return e.slice(n)}const To=2;class ro{static fromFixedLength(n){if(n.length!==64)throw new Error(`Got invalid data length: ${n.length}. Expected 2x 32 bytes for the pair (r, s)`);return new ro(Tr(n.slice(0,32)),Tr(n.slice(32,64)))}static fromDer(n){let t=0;if(n[t++]!==48)throw new Error("Prefix 0x30 expected");const r=n[t++];if(n.length-t!==r)throw new Error("Data length mismatch detected");if(n[t++]!==To)throw new Error("INTEGER tag expected");const h=n[t++];if(h>=128)throw new Error("Decoding length values above 127 not supported");const v=n.slice(t,t+h);if(t+=h,n[t++]!==To)throw new Error("INTEGER tag expected");const w=n[t++];if(w>=128)throw new Error("Decoding length values above 127 not supported");const D=n.slice(t,t+w);return t+=w,new ro(Tr(v),Tr(D))}constructor(n,t){if(n.length>32||n.length===0||n[0]===0)throw new Error("Unsigned integer r must be encoded as unpadded big endian.");if(t.length>32||t.length===0||t[0]===0)throw new Error("Unsigned integer s must be encoded as unpadded big endian.");this.data={r:n,s:t}}r(n){if(n===void 0)return this.data.r;{const t=n-this.data.r.length;if(t<0)throw new Error("Length too small to hold parameter r");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.r])}}s(n){if(n===void 0)return this.data.s;{const t=n-this.data.s.length;if(t<0)throw new Error("Length too small to hold parameter s");const r=new Uint8Array(t);return new Uint8Array([...r,...this.data.s])}}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32)])}toDer(){const n=this.data.r[0]>=128?new Uint8Array([0,...this.data.r]):this.data.r,t=this.data.s[0]>=128?new Uint8Array([0,...this.data.s]):this.data.s,r=n.length,o=t.length,h=new Uint8Array([To,r,...n,To,o,...t]);return new Uint8Array([48,h.length,...h])}}tr.Secp256k1Signature=ro;class Sc extends ro{static fromFixedLength(n){if(n.length!==65)throw new Error(`Got invalid data length ${n.length}. Expected 32 + 32 + 1`);return new Sc(Tr(n.slice(0,32)),Tr(n.slice(32,64)),n[64])}constructor(n,t,r){if(super(n,t),!Number.isInteger(r))throw new Error("The recovery parameter must be an integer.");if(r<0||r>4)throw new Error("The recovery parameter must be one of 0, 1, 2, 3.");this.recovery=r}toFixedLength(){return new Uint8Array([...this.r(32),...this.s(32),this.recovery])}}tr.ExtendedSecp256k1Signature=Sc;var $p=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.Secp256k1=void 0;const Co=de,Kp=$p(Ia),HS=$p(Sp()),VS=tr,Jt=new HS.default.ec("secp256k1"),QS=new Kp.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class WS{static async makeKeypair(n){if(n.length!==32)throw new Error("input data is not a valid secp256k1 private key");const t=Jt.keyFromPrivate(n);if(t.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new Kp.default(n).gte(QS))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,Co.fromHex)(t.getPrivate("hex")),pubkey:Uint8Array.from(t.getPublic("array"))}}static async createSignature(n,t){if(n.length===0)throw new Error("Message hash must not be empty");if(n.length>32)throw new Error("Message hash length must not exceed 32 bytes");const r=Jt.keyFromPrivate(t),{r:o,s:h,recoveryParam:v}=r.sign(n,{canonical:!0});if(typeof v!="number")throw new Error("Recovery param missing");return new VS.ExtendedSecp256k1Signature(Uint8Array.from(o.toArray()),Uint8Array.from(h.toArray()),v)}static async verifySignature(n,t,r){if(t.length===0)throw new Error("Message hash must not be empty");if(t.length>32)throw new Error("Message hash length must not exceed 32 bytes");const o=Jt.keyFromPublic(r);try{return o.verify(t,n.toDer())}catch{return!1}}static recoverPubkey(n,t){const r={r:(0,Co.toHex)(n.r()),s:(0,Co.toHex)(n.s())},o=Jt.recoverPubKey(t,r,n.recovery),h=Jt.keyFromPublic(o);return(0,Co.fromHex)(h.getPublic(!1,"hex"))}static compressPubkey(n){switch(n.length){case 33:return n;case 65:return Uint8Array.from(Jt.keyFromPublic(n).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(n){switch(n.length){case 33:return Uint8Array.from(Jt.keyFromPublic(n).getPublic(!1,"array"));case 65:return n;default:throw new Error("Invalid pubkey length")}}static trimRecoveryByte(n){switch(n.length){case 64:return n;case 65:return n.slice(0,64);default:throw new Error("Invalid signature length")}}}Ua.Secp256k1=WS;var zp={};(function(e){var n=x&&x.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.pathToString=e.Slip10=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=void 0;const t=de,r=Te,o=n(Ia),h=n(Sp()),v=lo,C=_n;var w;(function(d){d.Secp256k1="Bitcoin seed",d.Ed25519="ed25519 seed"})(w=e.Slip10Curve||(e.Slip10Curve={}));function D(d){switch(d){case w.Ed25519:return w.Ed25519;case w.Secp256k1:return w.Secp256k1;default:throw new Error(`Unknown curve string: '${d}'`)}}e.slip10CurveFromString=D;class J extends r.Uint32{static hardened(s){return new J(s+2**31)}static normal(s){return new J(s)}isHardened(){return this.data>=2**31}}e.Slip10RawIndex=J;const I=new h.default.ec("secp256k1");class g{static derivePath(s,y,E){let _=this.master(s,y);for(const U of E)_=this.child(s,_.privkey,_.chainCode,U);return _}static master(s,y){const E=new v.Hmac(C.Sha512,(0,t.toAscii)(s)).update(y).digest(),_=E.slice(0,32),U=E.slice(32,64);return s!==w.Ed25519&&(this.isZero(_)||this.isGteN(s,_))?this.master(s,E):{chainCode:U,privkey:_}}static child(s,y,E,_){let U;if(_.isHardened()){const H=new Uint8Array([0,...y,..._.toBytesBigEndian()]);U=new v.Hmac(C.Sha512,E).update(H).digest()}else{if(s===w.Ed25519)throw new Error("Normal keys are not allowed with ed25519");{const H=new Uint8Array([...g.serializedPoint(s,new o.default(y)),..._.toBytesBigEndian()]);U=new v.Hmac(C.Sha512,E).update(H).digest()}}return this.childImpl(s,y,E,_,U)}static serializedPoint(s,y){switch(s){case w.Secp256k1:return(0,t.fromHex)(I.g.mul(y).encodeCompressed("hex"));default:throw new Error("curve not supported")}}static childImpl(s,y,E,_,U){const H=U.slice(0,32),i=U.slice(32,64),m=i;if(s===w.Ed25519)return{chainCode:m,privkey:H};const N=this.n(s),V=new o.default(H).add(new o.default(y)).mod(N),u=Uint8Array.from(V.toArray("be",32));if(this.isGteN(s,H)||this.isZero(u)){const l=new v.Hmac(C.Sha512,E).update(new Uint8Array([1,...i,..._.toBytesBigEndian()])).digest();return this.childImpl(s,y,E,_,l)}return{chainCode:m,privkey:u}}static isZero(s){return s.every(y=>y===0)}static isGteN(s,y){return new o.default(y).gte(this.n(s))}static n(s){switch(s){case w.Secp256k1:return new o.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",16);default:throw new Error("curve not supported")}}}e.Slip10=g;function R(d){return d.reduce((s,y)=>{const E=y.isHardened()?`${y.toNumber()-2147483648}'`:y.toString();return s+"/"+E},"m")}e.pathToString=R;function B(d){if(!d.startsWith("m"))throw new Error("Path string must start with 'm'");let s=d.slice(1);const y=new Array;for(;s;){const E=s.match(/^\/([0-9]+)('?)/);if(!E)throw new Error("Syntax error while reading path component");const[_,U,H]=E,i=r.Uint53.fromString(U).toNumber();if(i>=2**31)throw new Error("Component value too high. Must not exceed 2**31-1.");H?y.push(J.hardened(i)):y.push(J.normal(i)),s=s.slice(_.length)}return y}e.stringToPath=B})(zp);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.stringToPath=e.Slip10RawIndex=e.slip10CurveFromString=e.Slip10Curve=e.Slip10=e.pathToString=e.sha512=e.Sha512=e.sha256=e.Sha256=e.Secp256k1Signature=e.ExtendedSecp256k1Signature=e.Secp256k1=e.ripemd160=e.Ripemd160=e.Random=e.Xchacha20poly1305Ietf=e.xchacha20NonceLength=e.isArgon2idOptions=e.Ed25519Keypair=e.Ed25519=e.Argon2id=e.keccak256=e.Keccak256=e.Hmac=e.EnglishMnemonic=e.Bip39=void 0;var n=jn;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return n.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return n.EnglishMnemonic}});var t=lo;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return t.Hmac}});var r=Xr;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return r.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return r.keccak256}});var o=nn;Object.defineProperty(e,"Argon2id",{enumerable:!0,get:function(){return o.Argon2id}}),Object.defineProperty(e,"Ed25519",{enumerable:!0,get:function(){return o.Ed25519}}),Object.defineProperty(e,"Ed25519Keypair",{enumerable:!0,get:function(){return o.Ed25519Keypair}}),Object.defineProperty(e,"isArgon2idOptions",{enumerable:!0,get:function(){return o.isArgon2idOptions}}),Object.defineProperty(e,"xchacha20NonceLength",{enumerable:!0,get:function(){return o.xchacha20NonceLength}}),Object.defineProperty(e,"Xchacha20poly1305Ietf",{enumerable:!0,get:function(){return o.Xchacha20poly1305Ietf}});var h=_a;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return h.Random}});var v=xr;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return v.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return v.ripemd160}});var C=Ua;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return C.Secp256k1}});var w=tr;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return w.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return w.Secp256k1Signature}});var D=_n;Object.defineProperty(e,"Sha256",{enumerable:!0,get:function(){return D.Sha256}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return D.sha256}}),Object.defineProperty(e,"Sha512",{enumerable:!0,get:function(){return D.Sha512}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return D.sha512}});var J=zp;Object.defineProperty(e,"pathToString",{enumerable:!0,get:function(){return J.pathToString}}),Object.defineProperty(e,"Slip10",{enumerable:!0,get:function(){return J.Slip10}}),Object.defineProperty(e,"Slip10Curve",{enumerable:!0,get:function(){return J.Slip10Curve}}),Object.defineProperty(e,"slip10CurveFromString",{enumerable:!0,get:function(){return J.slip10CurveFromString}}),Object.defineProperty(e,"Slip10RawIndex",{enumerable:!0,get:function(){return J.Slip10RawIndex}}),Object.defineProperty(e,"stringToPath",{enumerable:!0,get:function(){return J.stringToPath}})})(Ge);var Fe={},fo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isMultisigThresholdPubkey=e.isSinglePubkey=e.pubkeyType=e.isSecp256k1Pubkey=e.isEd25519Pubkey=void 0;function n(h){return h.type==="tendermint/PubKeyEd25519"}e.isEd25519Pubkey=n;function t(h){return h.type==="tendermint/PubKeySecp256k1"}e.isSecp256k1Pubkey=t,e.pubkeyType={secp256k1:"tendermint/PubKeySecp256k1",ed25519:"tendermint/PubKeyEd25519",sr25519:"tendermint/PubKeySr25519",multisigThreshold:"tendermint/PubKeyMultisigThreshold"};function r(h){return[e.pubkeyType.ed25519,e.pubkeyType.secp256k1,e.pubkeyType.sr25519].includes(h.type)}e.isSinglePubkey=r;function o(h){return h.type==="tendermint/PubKeyMultisigThreshold"}e.isMultisigThresholdPubkey=o})(fo);Object.defineProperty(Fe,"__esModule",{value:!0});Fe.encodeBech32Pubkey=Fe.encodeAminoPubkey=Fe.decodeBech32Pubkey=Fe.decodeAminoPubkey=Fe.encodeEd25519Pubkey=Fe.encodeSecp256k1Pubkey=void 0;const on=de,FS=Te,Li=Oe,lt=fo;function GS(e){if(e.length!==33||e[0]!==2&&e[0]!==3)throw new Error("Public key must be compressed secp256k1, i.e. 33 bytes starting with 0x02 or 0x03");return{type:lt.pubkeyType.secp256k1,value:(0,on.toBase64)(e)}}Fe.encodeSecp256k1Pubkey=GS;function LS(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:lt.pubkeyType.ed25519,value:(0,on.toBase64)(e)}}Fe.encodeEd25519Pubkey=LS;const Mu=(0,on.fromHex)("eb5ae98721"),qu=(0,on.fromHex)("1624de6420"),Pl=(0,on.fromHex)("0dfb100520"),ca=(0,on.fromHex)("22c1f7e2");function kc(e){if((0,Li.arrayContentStartsWith)(e,Mu)){const n=e.slice(Mu.length);if(n.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:lt.pubkeyType.secp256k1,value:(0,on.toBase64)(n)}}else if((0,Li.arrayContentStartsWith)(e,qu)){const n=e.slice(qu.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:lt.pubkeyType.ed25519,value:(0,on.toBase64)(n)}}else if((0,Li.arrayContentStartsWith)(e,Pl)){const n=e.slice(Pl.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:lt.pubkeyType.sr25519,value:(0,on.toBase64)(n)}}else{if((0,Li.arrayContentStartsWith)(e,ca))return KS(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,on.toHex)(e.slice(0,5)))}}Fe.decodeAminoPubkey=kc;function $S(e){const{data:n}=(0,on.fromBech32)(e);return kc(n)}Fe.decodeBech32Pubkey=$S;function Rl(e){if(e.length<1)throw new Error("Can't decode varint. EOF");if(e[0]>127)throw new Error("Decoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.Varint implementation from the Go standard library and write some tests.");return[e[0],1]}function KS(e){const n=Array.from(e),t=n.splice(0,ca.length);if(!(0,Li.arrayContentStartsWith)(t,ca))throw new Error("Invalid multisig prefix.");if(n.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[r,o]=Rl(n);n.splice(0,o);const h=[];for(;n.length>0;){if(n.shift()!=18)throw new Error("Invalid multisig data. Expecting 0x12 prefix before participant pubkey length.");const[v,C]=Rl(n);if(n.splice(0,C),n.length<v)throw new Error("Invalid multisig data length.");const w=n.splice(0,v),D=kc(Uint8Array.from(w));h.push(D)}return{type:lt.pubkeyType.multisigThreshold,value:{threshold:r.toString(),pubkeys:h}}}function vl(e){const n=FS.Uint53.fromString(e.toString()).toNumber();if(n>127)throw new Error("Encoding numbers > 127 is not supported here. Please tell those lazy CosmJS maintainers to port the binary.PutUvarint implementation from the Go standard library and write some tests.");return[n]}function Pc(e){if((0,lt.isMultisigThresholdPubkey)(e)){const n=Array.from(ca);n.push(8),n.push(...vl(e.value.threshold));for(const t of e.value.pubkeys.map(r=>Pc(r)))n.push(18),n.push(...vl(t.length)),n.push(...t);return new Uint8Array(n)}else{if((0,lt.isEd25519Pubkey)(e))return new Uint8Array([...qu,...(0,on.fromBase64)(e.value)]);if((0,lt.isSecp256k1Pubkey)(e))return new Uint8Array([...Mu,...(0,on.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}Fe.encodeAminoPubkey=Pc;function zS(e,n){return(0,on.toBech32)(n,Pc(e))}Fe.encodeBech32Pubkey=zS;Object.defineProperty(mn,"__esModule",{value:!0});mn.pubkeyToAddress=mn.pubkeyToRawAddress=mn.rawSecp256k1PubkeyToRawAddress=mn.rawEd25519PubkeyToRawAddress=void 0;const la=Ge,Hu=de,YS=Fe,Od=fo;function Yp(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,la.sha256)(e).slice(0,20)}mn.rawEd25519PubkeyToRawAddress=Yp;function Zp(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,la.ripemd160)((0,la.sha256)(e))}mn.rawSecp256k1PubkeyToRawAddress=Zp;function Xp(e){if((0,Od.isSecp256k1Pubkey)(e)){const n=(0,Hu.fromBase64)(e.value);return Zp(n)}else if((0,Od.isEd25519Pubkey)(e)){const n=(0,Hu.fromBase64)(e.value);return Yp(n)}else if((0,Od.isMultisigThresholdPubkey)(e)){const n=(0,YS.encodeAminoPubkey)(e);return(0,la.sha256)(n).slice(0,20)}else throw new Error("Unsupported public key type")}mn.pubkeyToRawAddress=Xp;function ZS(e,n){return(0,Hu.toBech32)(n,Xp(e))}mn.pubkeyToAddress=ZS;var et={};Object.defineProperty(et,"__esModule",{value:!0});et.addCoins=et.parseCoins=et.coins=et.coin=void 0;const Vu=Te;function xp(e,n){let t;if(typeof e=="number")try{t=new Vu.Uint53(e).toString()}catch{throw new Error("Given amount is not a safe integer. Consider using a string instead to overcome the limitations of JS numbers.")}else{if(!e.match(/^[0-9]+$/))throw new Error("Invalid unsigned integer string format");t=e.replace(/^0*/,"")||"0"}return{amount:t,denom:n}}et.coin=xp;function XS(e,n){return[xp(e,n)]}et.coins=XS;function xS(e){return e.replace(/\s/g,"").split(",").filter(Boolean).map(n=>{const t=n.match(/^([0-9]+)([a-zA-Z][a-zA-Z0-9/]{2,127})$/);if(!t)throw new Error("Got an invalid coin string");return{amount:t[1].replace(/^0+/,"")||"0",denom:t[2]}})}et.parseCoins=xS;function jS(e,n){if(e.denom!==n.denom)throw new Error("Trying to add two coins with different denoms");return{amount:Vu.Decimal.fromAtomics(e.amount,0).plus(Vu.Decimal.fromAtomics(n.amount,0)).atomics,denom:e.denom}}et.addCoins=jS;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.createMultisigThresholdPubkey=jr.compareArrays=void 0;const Bl=de,ek=Te,bl=mn;function jp(e,n){const t=(0,Bl.toHex)(e),r=(0,Bl.toHex)(n);return t===r?0:t<r?-1:1}jr.compareArrays=jp;function nk(e,n,t=!1){const r=new ek.Uint53(n);if(r.toNumber()>e.length)throw new Error(`Threshold k = ${r.toNumber()} exceeds number of keys n = ${e.length}`);const o=t?e:Array.from(e).sort((h,v)=>{const C=(0,bl.pubkeyToRawAddress)(h),w=(0,bl.pubkeyToRawAddress)(v);return jp(C,w)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:r.toString(),pubkeys:o}}}jr.createMultisigThresholdPubkey=nk;var Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.omitDefault=void 0;function tk(e){switch(typeof e){case"string":return e===""?void 0:e;case"number":return e===0?void 0:e;case"bigint":return e===BigInt(0)?void 0:e;case"boolean":return e||void 0;default:throw new Error(`Got unsupported type '${typeof e}'`)}}Ja.omitDefault=tk;var po={};Object.defineProperty(po,"__esModule",{value:!0});po.makeCosmoshubPath=void 0;const Ii=Ge;function rk(e){return[Ii.Slip10RawIndex.hardened(44),Ii.Slip10RawIndex.hardened(118),Ii.Slip10RawIndex.hardened(0),Ii.Slip10RawIndex.normal(0),Ii.Slip10RawIndex.normal(e)]}po.makeCosmoshubPath=rk;var ei={},Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.decodeSignature=Ut.encodeSecp256k1Signature=void 0;const Qu=de,ik=Fe,ok=fo;function ak(e,n){if(n.length!==64)throw new Error("Signature must be 64 bytes long. Cosmos SDK uses a 2x32 byte fixed length encoding for the secp256k1 signature integers r and s.");return{pub_key:(0,ik.encodeSecp256k1Pubkey)(e),signature:(0,Qu.toBase64)(n)}}Ut.encodeSecp256k1Signature=ak;function sk(e){switch(e.pub_key.type){case ok.pubkeyType.secp256k1:return{pubkey:(0,Qu.fromBase64)(e.pub_key.value),signature:(0,Qu.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}Ut.decodeSignature=sk;var Un={};Object.defineProperty(Un,"__esModule",{value:!0});Un.serializeSignDoc=Un.escapeCharacters=Un.makeSignDoc=Un.sortedJsonStringify=void 0;const dk=de,Ol=Te;function Wu(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(Wu);const n=Object.keys(e).sort(),t={};return n.forEach(r=>{t[r]=Wu(e[r])}),t}function em(e){return JSON.stringify(Wu(e))}Un.sortedJsonStringify=em;function uk(e,n,t,r,o,h,v){return{chain_id:t,account_number:Ol.Uint53.fromString(o.toString()).toString(),sequence:Ol.Uint53.fromString(h.toString()).toString(),fee:n,msgs:e,memo:r||"",...v&&{timeout_height:v.toString()}}}Un.makeSignDoc=uk;function nm(e){const n=/&/g,t=/</g,r=/>/g;return e.replace(n,"\\u0026").replace(t,"\\u003c").replace(r,"\\u003e")}Un.escapeCharacters=nm;function ck(e){const n=nm(em(e));return(0,dk.toUtf8)(n)}Un.serializeSignDoc=ck;var Rc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=Ge,t=de;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function r(v,C){switch(C.algorithm){case"argon2id":{const w=C.params;if(!(0,n.isArgon2idOptions)(w))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(v,e.cosmjsSalt,w)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(v,C,D)])}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.encrypt=o;async function h(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=v.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(v.slice(n.xchacha20NonceLength),C,D)}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.decrypt=h})(Rc);Object.defineProperty(ei,"__esModule",{value:!0});ei.Secp256k1HdWallet=ei.extractKdfConfiguration=void 0;const Sn=Ge,Ti=de,Cr=Oe,lk=mn,fk=po,pk=Ut,mk=Un,Ci=Rc,ea="secp256k1wallet-v1",yk={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function hk(e){return!(!(0,Cr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function gk(e){return e.kdf}function Sk(e){const n=JSON.parse(e);if(!(0,Cr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case ea:return gk(n);default:throw new Error("Unsupported serialization type")}}ei.extractKdfConfiguration=Sk;const Al={bip39Password:"",hdPaths:[(0,fk.makeCosmoshubPath)(0)],prefix:"cosmos"};class Lt{static async fromMnemonic(n,t={}){const r=new Sn.EnglishMnemonic(n),o=await Sn.Bip39.mnemonicToSeed(r,t.bip39Password);return new Lt(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=Sn.Random.getBytes(r),h=Sn.Bip39.encode(o);return Lt.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,Cr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case ea:return Lt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,Cr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case ea:{const h=await(0,Ci.decrypt)((0,Ti.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,Ti.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,Cr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>hk(I)))throw new Error("Account is not in the correct format.");const D=w[0].prefix;if(!w.every(({prefix:I})=>I===D))throw new Error("Accounts do not all have the same prefix");const J=w.map(({hdPath:I})=>(0,Sn.stringToPath)(I));return Lt.fromMnemonic(C,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const r=JSON.parse(n);if(!(0,Cr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,Ci.executeKdf)(t,r.kdf);return Lt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.hdPaths??Al.hdPaths,o=t.prefix??Al.prefix;this.secret=n,this.seed=t.seed,this.accounts=r.map(h=>({hdPath:h,prefix:o}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:r,address:o})=>({algo:t,pubkey:r,address:o}))}async signAmino(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:J})=>J===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:h,pubkey:v}=o,C=(0,Sn.sha256)((0,mk.serializeSignDoc)(t)),w=await Sn.Secp256k1.createSignature(C,h),D=new Uint8Array([...w.r(32),...w.s(32)]);return{signed:t,signature:(0,pk.encodeSecp256k1Signature)(v,D)}}async serialize(n){const t=yk,r=await(0,Ci.executeKdf)(n,t);return this.serializeWithEncryptionKey(r,t)}async serializeWithEncryptionKey(n,t){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:w,prefix:D})=>({hdPath:(0,Sn.pathToString)(w),prefix:D}))},o=(0,Ti.toUtf8)(JSON.stringify(r)),h={algorithm:Ci.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,Ci.encrypt)(o,n,h),C={type:ea,kdf:t,encryption:h,data:(0,Ti.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=Sn.Slip10.derivePath(Sn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await Sn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:Sn.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(n),h=(0,Ti.toBech32)(t,(0,lk.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}ei.Secp256k1HdWallet=Lt;var Da={};Object.defineProperty(Da,"__esModule",{value:!0});Da.Secp256k1Wallet=void 0;const No=Ge,kk=de,Pk=mn,Rk=Ut,vk=Un;class vc{static async fromKey(n,t="cosmos"){const r=(await No.Secp256k1.makeKeypair(n)).pubkey;return new vc(n,No.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,kk.toBech32)(this.prefix,(0,Pk.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signAmino(n,t){if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const r=new No.Sha256((0,vk.serializeSignDoc)(t)).digest(),o=await No.Secp256k1.createSignature(r,this.privkey),h=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:t,signature:(0,Rk.encodeSecp256k1Signature)(this.pubkey,h)}}}Da.Secp256k1Wallet=vc;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.makeStdTx=ni.isStdTx=void 0;function Bk(e){const{memo:n,msg:t,fee:r,signatures:o}=e;return typeof n=="string"&&Array.isArray(t)&&typeof r=="object"&&Array.isArray(o)}ni.isStdTx=Bk;function bk(e,n){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(n)?n:[n]}}ni.makeStdTx=bk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.executeKdf=e.makeStdTx=e.isStdTx=e.serializeSignDoc=e.makeSignDoc=e.encodeSecp256k1Signature=e.decodeSignature=e.Secp256k1Wallet=e.Secp256k1HdWallet=e.extractKdfConfiguration=e.pubkeyType=e.isSinglePubkey=e.isSecp256k1Pubkey=e.isMultisigThresholdPubkey=e.isEd25519Pubkey=e.makeCosmoshubPath=e.omitDefault=e.createMultisigThresholdPubkey=e.encodeSecp256k1Pubkey=e.encodeEd25519Pubkey=e.encodeBech32Pubkey=e.encodeAminoPubkey=e.decodeBech32Pubkey=e.decodeAminoPubkey=e.parseCoins=e.coins=e.coin=e.addCoins=e.rawSecp256k1PubkeyToRawAddress=e.rawEd25519PubkeyToRawAddress=e.pubkeyToRawAddress=e.pubkeyToAddress=void 0;var n=mn;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return n.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return n.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return n.rawSecp256k1PubkeyToRawAddress}});var t=et;Object.defineProperty(e,"addCoins",{enumerable:!0,get:function(){return t.addCoins}}),Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return t.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return t.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return t.parseCoins}});var r=Fe;Object.defineProperty(e,"decodeAminoPubkey",{enumerable:!0,get:function(){return r.decodeAminoPubkey}}),Object.defineProperty(e,"decodeBech32Pubkey",{enumerable:!0,get:function(){return r.decodeBech32Pubkey}}),Object.defineProperty(e,"encodeAminoPubkey",{enumerable:!0,get:function(){return r.encodeAminoPubkey}}),Object.defineProperty(e,"encodeBech32Pubkey",{enumerable:!0,get:function(){return r.encodeBech32Pubkey}}),Object.defineProperty(e,"encodeEd25519Pubkey",{enumerable:!0,get:function(){return r.encodeEd25519Pubkey}}),Object.defineProperty(e,"encodeSecp256k1Pubkey",{enumerable:!0,get:function(){return r.encodeSecp256k1Pubkey}});var o=jr;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var h=Ja;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return h.omitDefault}});var v=po;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return v.makeCosmoshubPath}});var C=fo;Object.defineProperty(e,"isEd25519Pubkey",{enumerable:!0,get:function(){return C.isEd25519Pubkey}}),Object.defineProperty(e,"isMultisigThresholdPubkey",{enumerable:!0,get:function(){return C.isMultisigThresholdPubkey}}),Object.defineProperty(e,"isSecp256k1Pubkey",{enumerable:!0,get:function(){return C.isSecp256k1Pubkey}}),Object.defineProperty(e,"isSinglePubkey",{enumerable:!0,get:function(){return C.isSinglePubkey}}),Object.defineProperty(e,"pubkeyType",{enumerable:!0,get:function(){return C.pubkeyType}});var w=ei;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return w.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return w.Secp256k1HdWallet}});var D=Da;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return D.Secp256k1Wallet}});var J=Ut;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return J.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return J.encodeSecp256k1Signature}});var I=Un;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return I.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return I.serializeSignDoc}});var g=ni;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return g.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return g.makeStdTx}});var R=Rc;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return R.executeKdf}})})(zn);var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.makeSignBytes=ot.makeSignDoc=ot.makeAuthInfoBytes=void 0;const Il=Oe,Ok=uo,fa=at;function Ak(e,n){return e.map(({pubkey:t,sequence:r})=>({publicKey:t,modeInfo:{single:{mode:n}},sequence:BigInt(r)}))}function Ik(e,n,t,r,o,h=Ok.SignMode.SIGN_MODE_DIRECT){(0,Il.assert)(r===void 0||typeof r=="string","feeGranter must be undefined or string"),(0,Il.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const v=fa.AuthInfo.fromPartial({signerInfos:Ak(e,h),fee:{amount:[...n],gasLimit:BigInt(t),granter:r,payer:o}});return fa.AuthInfo.encode(v).finish()}ot.makeAuthInfoBytes=Ik;function Tk(e,n,t,r){return{bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:BigInt(r)}}ot.makeSignDoc=Tk;function Ck({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r}){const o=fa.SignDoc.fromPartial({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r});return fa.SignDoc.encode(o).finish()}ot.makeSignBytes=Ck;var Bc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=Ge,t=de;e.cosmjsSalt=(0,t.toAscii)("The CosmJS salt.");async function r(v,C){switch(C.algorithm){case"argon2id":{const w=C.params;if(!(0,n.isArgon2idOptions)(w))throw new Error("Invalid format of argon2id params");return n.Argon2id.execute(v,e.cosmjsSalt,w)}default:throw new Error("Unsupported KDF algorithm")}}e.executeKdf=r,e.supportedAlgorithms={xchacha20poly1305Ietf:"xchacha20poly1305-ietf"};async function o(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=n.Random.getBytes(n.xchacha20NonceLength);return new Uint8Array([...D,...await n.Xchacha20poly1305Ietf.encrypt(v,C,D)])}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.encrypt=o;async function h(v,C,w){switch(w.algorithm){case e.supportedAlgorithms.xchacha20poly1305Ietf:{const D=v.slice(0,n.xchacha20NonceLength);return n.Xchacha20poly1305Ietf.decrypt(v.slice(n.xchacha20NonceLength),C,D)}default:throw new Error(`Unsupported encryption algorithm: '${w.algorithm}'`)}}e.decrypt=h})(Bc);Object.defineProperty(Gr,"__esModule",{value:!0});Gr.DirectSecp256k1HdWallet=Gr.extractKdfConfiguration=void 0;const Fu=zn,kn=Ge,Ni=de,Nr=Oe,Nk=ot,wi=Bc,na="directsecp256k1hdwallet-v1",wk={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function Ek(e){return!(!(0,Nr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function _k(e){return e.kdf}function Uk(e){const n=JSON.parse(e);if(!(0,Nr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case na:return _k(n);default:throw new Error("Unsupported serialization type")}}Gr.extractKdfConfiguration=Uk;const Tl={bip39Password:"",hdPaths:[(0,Fu.makeCosmoshubPath)(0)],prefix:"cosmos"};class $t{static async fromMnemonic(n,t={}){const r=new kn.EnglishMnemonic(n),o=await kn.Bip39.mnemonicToSeed(r,t.bip39Password);return new $t(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=kn.Random.getBytes(r),h=kn.Bip39.encode(o);return $t.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,Nr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case na:return $t.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,Nr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case na:{const h=await(0,wi.decrypt)((0,Ni.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,Ni.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,Nr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>Ek(I)))throw new Error("Account is not in the correct format.");const D=w[0].prefix;if(!w.every(({prefix:I})=>I===D))throw new Error("Accounts do not all have the same prefix");const J=w.map(({hdPath:I})=>(0,kn.stringToPath)(I));return $t.fromMnemonic(C,{hdPaths:J,prefix:D})}default:throw new Error("Unsupported serialization type")}}static async deserializeTypeV1(n,t){const r=JSON.parse(n);if(!(0,Nr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,wi.executeKdf)(t,r.kdf);return $t.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.prefix??Tl.prefix,o=t.hdPaths??Tl.hdPaths;this.secret=n,this.seed=t.seed,this.accounts=o.map(h=>({hdPath:h,prefix:r}))}get mnemonic(){return this.secret.toString()}async getAccounts(){return(await this.getAccountsWithPrivkeys()).map(({algo:t,pubkey:r,address:o})=>({algo:t,pubkey:r,address:o}))}async signDirect(n,t){const o=(await this.getAccountsWithPrivkeys()).find(({address:g})=>g===n);if(o===void 0)throw new Error(`Address ${n} not found in wallet`);const{privkey:h,pubkey:v}=o,C=(0,Nk.makeSignBytes)(t),w=(0,kn.sha256)(C),D=await kn.Secp256k1.createSignature(w,h),J=new Uint8Array([...D.r(32),...D.s(32)]),I=(0,Fu.encodeSecp256k1Signature)(v,J);return{signed:t,signature:I}}async serialize(n){const t=wk,r=await(0,wi.executeKdf)(n,t);return this.serializeWithEncryptionKey(r,t)}async serializeWithEncryptionKey(n,t){const r={mnemonic:this.mnemonic,accounts:this.accounts.map(({hdPath:w,prefix:D})=>({hdPath:(0,kn.pathToString)(w),prefix:D}))},o=(0,Ni.toUtf8)(JSON.stringify(r)),h={algorithm:wi.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,wi.encrypt)(o,n,h),C={type:na,kdf:t,encryption:h,data:(0,Ni.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=kn.Slip10.derivePath(kn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await kn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:kn.Secp256k1.compressPubkey(r)}}async getAccountsWithPrivkeys(){return Promise.all(this.accounts.map(async({hdPath:n,prefix:t})=>{const{privkey:r,pubkey:o}=await this.getKeyPair(n),h=(0,Ni.toBech32)(t,(0,Fu.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}Gr.DirectSecp256k1HdWallet=$t;var Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.DirectSecp256k1Wallet=void 0;const Cl=zn,wo=Ge,Jk=de,Dk=ot;class bc{static async fromKey(n,t="cosmos"){const r=(await wo.Secp256k1.makeKeypair(n)).pubkey;return new bc(n,wo.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,Jk.toBech32)(this.prefix,(0,Cl.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(n,t){const r=(0,Dk.makeSignBytes)(t);if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const o=(0,wo.sha256)(r),h=await wo.Secp256k1.createSignature(o,this.privkey),v=new Uint8Array([...h.r(32),...h.s(32)]),C=(0,Cl.encodeSecp256k1Signature)(this.pubkey,v);return{signed:t,signature:C}}}Ma.DirectSecp256k1Wallet=bc;var qa={};Object.defineProperty(qa,"__esModule",{value:!0});qa.makeCosmoshubPath=void 0;const Ei=Ge;function Mk(e){return[Ei.Slip10RawIndex.hardened(44),Ei.Slip10RawIndex.hardened(118),Ei.Slip10RawIndex.hardened(0),Ei.Slip10RawIndex.normal(0),Ei.Slip10RawIndex.normal(e)]}qa.makeCosmoshubPath=Mk;var nt={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});vt.PrivKey=vt.PubKey=vt.protobufPackage=void 0;const _r=ee,Ur=ne;vt.protobufPackage="cosmos.crypto.ed25519";function Ad(){return{key:new Uint8Array}}vt.PubKey={typeUrl:"/cosmos.crypto.ed25519.PubKey",encode(e,n=_r.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof _r.BinaryReader?e:new _r.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Ad();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Ad();return(0,Ur.isSet)(e.key)&&(n.key=(0,Ur.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Ur.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Ad();return n.key=e.key??new Uint8Array,n}};function Id(){return{key:new Uint8Array}}vt.PrivKey={typeUrl:"/cosmos.crypto.ed25519.PrivKey",encode(e,n=_r.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof _r.BinaryReader?e:new _r.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Id();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Id();return(0,Ur.isSet)(e.key)&&(n.key=(0,Ur.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Ur.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Id();return n.key=e.key??new Uint8Array,n}};var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.LegacyAminoPubKey=ti.protobufPackage=void 0;const _i=Re,Td=ee,qk=ne;ti.protobufPackage="cosmos.crypto.multisig";function Cd(){return{threshold:0,publicKeys:[]}}ti.LegacyAminoPubKey={typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",encode(e,n=Td.BinaryWriter.create()){e.threshold!==0&&n.uint32(8).uint32(e.threshold);for(const t of e.publicKeys)_i.Any.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof Td.BinaryReader?e:new Td.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Cd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.threshold=t.uint32();break;case 2:o.publicKeys.push(_i.Any.decode(t,t.uint32()));break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Cd();return(0,qk.isSet)(e.threshold)&&(n.threshold=Number(e.threshold)),Array.isArray(e==null?void 0:e.publicKeys)&&(n.publicKeys=e.publicKeys.map(t=>_i.Any.fromJSON(t))),n},toJSON(e){const n={};return e.threshold!==void 0&&(n.threshold=Math.round(e.threshold)),e.publicKeys?n.publicKeys=e.publicKeys.map(t=>t?_i.Any.toJSON(t):void 0):n.publicKeys=[],n},fromPartial(e){var t;const n=Cd();return n.threshold=e.threshold??0,n.publicKeys=((t=e.publicKeys)==null?void 0:t.map(r=>_i.Any.fromPartial(r)))||[],n}};var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.PrivKey=Bt.PubKey=Bt.protobufPackage=void 0;const Jr=ee,Dr=ne;Bt.protobufPackage="cosmos.crypto.secp256k1";function Nd(){return{key:new Uint8Array}}Bt.PubKey={typeUrl:"/cosmos.crypto.secp256k1.PubKey",encode(e,n=Jr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Jr.BinaryReader?e:new Jr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Nd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Nd();return(0,Dr.isSet)(e.key)&&(n.key=(0,Dr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Dr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=Nd();return n.key=e.key??new Uint8Array,n}};function wd(){return{key:new Uint8Array}}Bt.PrivKey={typeUrl:"/cosmos.crypto.secp256k1.PrivKey",encode(e,n=Jr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Jr.BinaryReader?e:new Jr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=wd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=wd();return(0,Dr.isSet)(e.key)&&(n.key=(0,Dr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Dr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=wd();return n.key=e.key??new Uint8Array,n}};Object.defineProperty(nt,"__esModule",{value:!0});nt.decodeOptionalPubkey=nt.decodePubkey=nt.anyToSinglePubkey=nt.encodePubkey=void 0;const Yi=zn,Nl=de,Hk=Te,Gu=vt,Lu=ti,$u=Bt,Ed=Re;function tm(e){if((0,Yi.isSecp256k1Pubkey)(e)){const n=$u.PubKey.fromPartial({key:(0,Nl.fromBase64)(e.value)});return Ed.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from($u.PubKey.encode(n).finish())})}else if((0,Yi.isEd25519Pubkey)(e)){const n=Gu.PubKey.fromPartial({key:(0,Nl.fromBase64)(e.value)});return Ed.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(Gu.PubKey.encode(n).finish())})}else if((0,Yi.isMultisigThresholdPubkey)(e)){const n=Lu.LegacyAminoPubKey.fromPartial({threshold:Hk.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(tm)});return Ed.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(Lu.LegacyAminoPubKey.encode(n).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}nt.encodePubkey=tm;function Ku(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:n}=$u.PubKey.decode(e.value);return(0,Yi.encodeSecp256k1Pubkey)(n)}case"/cosmos.crypto.ed25519.PubKey":{const{key:n}=Gu.PubKey.decode(e.value);return(0,Yi.encodeEd25519Pubkey)(n)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}nt.anyToSinglePubkey=Ku;function rm(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return Ku(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:n,publicKeys:t}=Lu.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:n.toString(),pubkeys:t.map(Ku)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}nt.decodePubkey=rm;function Vk(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return rm(e);throw new Error(`Pubkey is an Any with type URL '${e.typeUrl}' but an empty value`)}else{if(e.value.length)throw new Error("Pubkey is an Any with an empty type URL but a value set");return null}}nt.decodeOptionalPubkey=Vk;var Bn={},Oc={},Ac={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Metadata=e.DenomUnit=e.Supply=e.Output=e.Input=e.SendEnabled=e.Params=e.protobufPackage=void 0;const n=Me,t=ee,r=ne;e.protobufPackage="cosmos.bank.v1beta1";function o(){return{sendEnabled:[],defaultSendEnabled:!1}}e.Params={typeUrl:"/cosmos.bank.v1beta1.Params",encode(I,g=t.BinaryWriter.create()){for(const R of I.sendEnabled)e.SendEnabled.encode(R,g.uint32(10).fork()).ldelim();return I.defaultSendEnabled===!0&&g.uint32(16).bool(I.defaultSendEnabled),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=o();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.sendEnabled.push(e.SendEnabled.decode(R,R.uint32()));break;case 2:d.defaultSendEnabled=R.bool();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=o();return Array.isArray(I==null?void 0:I.sendEnabled)&&(g.sendEnabled=I.sendEnabled.map(R=>e.SendEnabled.fromJSON(R))),(0,r.isSet)(I.defaultSendEnabled)&&(g.defaultSendEnabled=!!I.defaultSendEnabled),g},toJSON(I){const g={};return I.sendEnabled?g.sendEnabled=I.sendEnabled.map(R=>R?e.SendEnabled.toJSON(R):void 0):g.sendEnabled=[],I.defaultSendEnabled!==void 0&&(g.defaultSendEnabled=I.defaultSendEnabled),g},fromPartial(I){var R;const g=o();return g.sendEnabled=((R=I.sendEnabled)==null?void 0:R.map(B=>e.SendEnabled.fromPartial(B)))||[],g.defaultSendEnabled=I.defaultSendEnabled??!1,g}};function h(){return{denom:"",enabled:!1}}e.SendEnabled={typeUrl:"/cosmos.bank.v1beta1.SendEnabled",encode(I,g=t.BinaryWriter.create()){return I.denom!==""&&g.uint32(10).string(I.denom),I.enabled===!0&&g.uint32(16).bool(I.enabled),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=h();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.denom=R.string();break;case 2:d.enabled=R.bool();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=h();return(0,r.isSet)(I.denom)&&(g.denom=String(I.denom)),(0,r.isSet)(I.enabled)&&(g.enabled=!!I.enabled),g},toJSON(I){const g={};return I.denom!==void 0&&(g.denom=I.denom),I.enabled!==void 0&&(g.enabled=I.enabled),g},fromPartial(I){const g=h();return g.denom=I.denom??"",g.enabled=I.enabled??!1,g}};function v(){return{address:"",coins:[]}}e.Input={typeUrl:"/cosmos.bank.v1beta1.Input",encode(I,g=t.BinaryWriter.create()){I.address!==""&&g.uint32(10).string(I.address);for(const R of I.coins)n.Coin.encode(R,g.uint32(18).fork()).ldelim();return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=v();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.address=R.string();break;case 2:d.coins.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=v();return(0,r.isSet)(I.address)&&(g.address=String(I.address)),Array.isArray(I==null?void 0:I.coins)&&(g.coins=I.coins.map(R=>n.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.address!==void 0&&(g.address=I.address),I.coins?g.coins=I.coins.map(R=>R?n.Coin.toJSON(R):void 0):g.coins=[],g},fromPartial(I){var R;const g=v();return g.address=I.address??"",g.coins=((R=I.coins)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],g}};function C(){return{address:"",coins:[]}}e.Output={typeUrl:"/cosmos.bank.v1beta1.Output",encode(I,g=t.BinaryWriter.create()){I.address!==""&&g.uint32(10).string(I.address);for(const R of I.coins)n.Coin.encode(R,g.uint32(18).fork()).ldelim();return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=C();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.address=R.string();break;case 2:d.coins.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=C();return(0,r.isSet)(I.address)&&(g.address=String(I.address)),Array.isArray(I==null?void 0:I.coins)&&(g.coins=I.coins.map(R=>n.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.address!==void 0&&(g.address=I.address),I.coins?g.coins=I.coins.map(R=>R?n.Coin.toJSON(R):void 0):g.coins=[],g},fromPartial(I){var R;const g=C();return g.address=I.address??"",g.coins=((R=I.coins)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],g}};function w(){return{total:[]}}e.Supply={typeUrl:"/cosmos.bank.v1beta1.Supply",encode(I,g=t.BinaryWriter.create()){for(const R of I.total)n.Coin.encode(R,g.uint32(10).fork()).ldelim();return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=w();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.total.push(n.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=w();return Array.isArray(I==null?void 0:I.total)&&(g.total=I.total.map(R=>n.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.total?g.total=I.total.map(R=>R?n.Coin.toJSON(R):void 0):g.total=[],g},fromPartial(I){var R;const g=w();return g.total=((R=I.total)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],g}};function D(){return{denom:"",exponent:0,aliases:[]}}e.DenomUnit={typeUrl:"/cosmos.bank.v1beta1.DenomUnit",encode(I,g=t.BinaryWriter.create()){I.denom!==""&&g.uint32(10).string(I.denom),I.exponent!==0&&g.uint32(16).uint32(I.exponent);for(const R of I.aliases)g.uint32(26).string(R);return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=D();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.denom=R.string();break;case 2:d.exponent=R.uint32();break;case 3:d.aliases.push(R.string());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=D();return(0,r.isSet)(I.denom)&&(g.denom=String(I.denom)),(0,r.isSet)(I.exponent)&&(g.exponent=Number(I.exponent)),Array.isArray(I==null?void 0:I.aliases)&&(g.aliases=I.aliases.map(R=>String(R))),g},toJSON(I){const g={};return I.denom!==void 0&&(g.denom=I.denom),I.exponent!==void 0&&(g.exponent=Math.round(I.exponent)),I.aliases?g.aliases=I.aliases.map(R=>R):g.aliases=[],g},fromPartial(I){var R;const g=D();return g.denom=I.denom??"",g.exponent=I.exponent??0,g.aliases=((R=I.aliases)==null?void 0:R.map(B=>B))||[],g}};function J(){return{description:"",denomUnits:[],base:"",display:"",name:"",symbol:"",uri:"",uriHash:""}}e.Metadata={typeUrl:"/cosmos.bank.v1beta1.Metadata",encode(I,g=t.BinaryWriter.create()){I.description!==""&&g.uint32(10).string(I.description);for(const R of I.denomUnits)e.DenomUnit.encode(R,g.uint32(18).fork()).ldelim();return I.base!==""&&g.uint32(26).string(I.base),I.display!==""&&g.uint32(34).string(I.display),I.name!==""&&g.uint32(42).string(I.name),I.symbol!==""&&g.uint32(50).string(I.symbol),I.uri!==""&&g.uint32(58).string(I.uri),I.uriHash!==""&&g.uint32(66).string(I.uriHash),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=J();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.description=R.string();break;case 2:d.denomUnits.push(e.DenomUnit.decode(R,R.uint32()));break;case 3:d.base=R.string();break;case 4:d.display=R.string();break;case 5:d.name=R.string();break;case 6:d.symbol=R.string();break;case 7:d.uri=R.string();break;case 8:d.uriHash=R.string();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=J();return(0,r.isSet)(I.description)&&(g.description=String(I.description)),Array.isArray(I==null?void 0:I.denomUnits)&&(g.denomUnits=I.denomUnits.map(R=>e.DenomUnit.fromJSON(R))),(0,r.isSet)(I.base)&&(g.base=String(I.base)),(0,r.isSet)(I.display)&&(g.display=String(I.display)),(0,r.isSet)(I.name)&&(g.name=String(I.name)),(0,r.isSet)(I.symbol)&&(g.symbol=String(I.symbol)),(0,r.isSet)(I.uri)&&(g.uri=String(I.uri)),(0,r.isSet)(I.uriHash)&&(g.uriHash=String(I.uriHash)),g},toJSON(I){const g={};return I.description!==void 0&&(g.description=I.description),I.denomUnits?g.denomUnits=I.denomUnits.map(R=>R?e.DenomUnit.toJSON(R):void 0):g.denomUnits=[],I.base!==void 0&&(g.base=I.base),I.display!==void 0&&(g.display=I.display),I.name!==void 0&&(g.name=I.name),I.symbol!==void 0&&(g.symbol=I.symbol),I.uri!==void 0&&(g.uri=I.uri),I.uriHash!==void 0&&(g.uriHash=I.uriHash),g},fromPartial(I){var R;const g=J();return g.description=I.description??"",g.denomUnits=((R=I.denomUnits)==null?void 0:R.map(B=>e.DenomUnit.fromPartial(B)))||[],g.base=I.base??"",g.display=I.display??"",g.name=I.name??"",g.symbol=I.symbol??"",g.uri=I.uri??"",g.uriHash=I.uriHash??"",g}}})(Ac);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgSetSendEnabledResponse=e.MsgSetSendEnabled=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgMultiSendResponse=e.MsgMultiSend=e.MsgSendResponse=e.MsgSend=e.protobufPackage=void 0;const n=Me,t=Ac,r=ee,o=ne;e.protobufPackage="cosmos.bank.v1beta1";function h(){return{fromAddress:"",toAddress:"",amount:[]}}e.MsgSend={typeUrl:"/cosmos.bank.v1beta1.MsgSend",encode(B,d=r.BinaryWriter.create()){B.fromAddress!==""&&d.uint32(10).string(B.fromAddress),B.toAddress!==""&&d.uint32(18).string(B.toAddress);for(const s of B.amount)n.Coin.encode(s,d.uint32(26).fork()).ldelim();return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=h();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.fromAddress=s.string();break;case 2:E.toAddress=s.string();break;case 3:E.amount.push(n.Coin.decode(s,s.uint32()));break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=h();return(0,o.isSet)(B.fromAddress)&&(d.fromAddress=String(B.fromAddress)),(0,o.isSet)(B.toAddress)&&(d.toAddress=String(B.toAddress)),Array.isArray(B==null?void 0:B.amount)&&(d.amount=B.amount.map(s=>n.Coin.fromJSON(s))),d},toJSON(B){const d={};return B.fromAddress!==void 0&&(d.fromAddress=B.fromAddress),B.toAddress!==void 0&&(d.toAddress=B.toAddress),B.amount?d.amount=B.amount.map(s=>s?n.Coin.toJSON(s):void 0):d.amount=[],d},fromPartial(B){var s;const d=h();return d.fromAddress=B.fromAddress??"",d.toAddress=B.toAddress??"",d.amount=((s=B.amount)==null?void 0:s.map(y=>n.Coin.fromPartial(y)))||[],d}};function v(){return{}}e.MsgSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSendResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=v();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return v()},toJSON(B){return{}},fromPartial(B){return v()}};function C(){return{inputs:[],outputs:[]}}e.MsgMultiSend={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSend",encode(B,d=r.BinaryWriter.create()){for(const s of B.inputs)t.Input.encode(s,d.uint32(10).fork()).ldelim();for(const s of B.outputs)t.Output.encode(s,d.uint32(18).fork()).ldelim();return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=C();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.inputs.push(t.Input.decode(s,s.uint32()));break;case 2:E.outputs.push(t.Output.decode(s,s.uint32()));break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=C();return Array.isArray(B==null?void 0:B.inputs)&&(d.inputs=B.inputs.map(s=>t.Input.fromJSON(s))),Array.isArray(B==null?void 0:B.outputs)&&(d.outputs=B.outputs.map(s=>t.Output.fromJSON(s))),d},toJSON(B){const d={};return B.inputs?d.inputs=B.inputs.map(s=>s?t.Input.toJSON(s):void 0):d.inputs=[],B.outputs?d.outputs=B.outputs.map(s=>s?t.Output.toJSON(s):void 0):d.outputs=[],d},fromPartial(B){var s,y;const d=C();return d.inputs=((s=B.inputs)==null?void 0:s.map(E=>t.Input.fromPartial(E)))||[],d.outputs=((y=B.outputs)==null?void 0:y.map(E=>t.Output.fromPartial(E)))||[],d}};function w(){return{}}e.MsgMultiSendResponse={typeUrl:"/cosmos.bank.v1beta1.MsgMultiSendResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=w();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return w()},toJSON(B){return{}},fromPartial(B){return w()}};function D(){return{authority:"",params:t.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParams",encode(B,d=r.BinaryWriter.create()){return B.authority!==""&&d.uint32(10).string(B.authority),B.params!==void 0&&t.Params.encode(B.params,d.uint32(18).fork()).ldelim(),d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=D();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.authority=s.string();break;case 2:E.params=t.Params.decode(s,s.uint32());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=D();return(0,o.isSet)(B.authority)&&(d.authority=String(B.authority)),(0,o.isSet)(B.params)&&(d.params=t.Params.fromJSON(B.params)),d},toJSON(B){const d={};return B.authority!==void 0&&(d.authority=B.authority),B.params!==void 0&&(d.params=B.params?t.Params.toJSON(B.params):void 0),d},fromPartial(B){const d=D();return d.authority=B.authority??"",B.params!==void 0&&B.params!==null&&(d.params=t.Params.fromPartial(B.params)),d}};function J(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.bank.v1beta1.MsgUpdateParamsResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=J();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return J()},toJSON(B){return{}},fromPartial(B){return J()}};function I(){return{authority:"",sendEnabled:[],useDefaultFor:[]}}e.MsgSetSendEnabled={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabled",encode(B,d=r.BinaryWriter.create()){B.authority!==""&&d.uint32(10).string(B.authority);for(const s of B.sendEnabled)t.SendEnabled.encode(s,d.uint32(18).fork()).ldelim();for(const s of B.useDefaultFor)d.uint32(26).string(s);return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=I();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.authority=s.string();break;case 2:E.sendEnabled.push(t.SendEnabled.decode(s,s.uint32()));break;case 3:E.useDefaultFor.push(s.string());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=I();return(0,o.isSet)(B.authority)&&(d.authority=String(B.authority)),Array.isArray(B==null?void 0:B.sendEnabled)&&(d.sendEnabled=B.sendEnabled.map(s=>t.SendEnabled.fromJSON(s))),Array.isArray(B==null?void 0:B.useDefaultFor)&&(d.useDefaultFor=B.useDefaultFor.map(s=>String(s))),d},toJSON(B){const d={};return B.authority!==void 0&&(d.authority=B.authority),B.sendEnabled?d.sendEnabled=B.sendEnabled.map(s=>s?t.SendEnabled.toJSON(s):void 0):d.sendEnabled=[],B.useDefaultFor?d.useDefaultFor=B.useDefaultFor.map(s=>s):d.useDefaultFor=[],d},fromPartial(B){var s,y;const d=I();return d.authority=B.authority??"",d.sendEnabled=((s=B.sendEnabled)==null?void 0:s.map(E=>t.SendEnabled.fromPartial(E)))||[],d.useDefaultFor=((y=B.useDefaultFor)==null?void 0:y.map(E=>E))||[],d}};function g(){return{}}e.MsgSetSendEnabledResponse={typeUrl:"/cosmos.bank.v1beta1.MsgSetSendEnabledResponse",encode(B,d=r.BinaryWriter.create()){return d},decode(B,d){const s=B instanceof r.BinaryReader?B:new r.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=g();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){default:s.skipType(_&7);break}}return E},fromJSON(B){return g()},toJSON(B){return{}},fromPartial(B){return g()}};class R{constructor(d){this.rpc=d,this.Send=this.Send.bind(this),this.MultiSend=this.MultiSend.bind(this),this.UpdateParams=this.UpdateParams.bind(this),this.SetSendEnabled=this.SetSendEnabled.bind(this)}Send(d){const s=e.MsgSend.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","Send",s).then(E=>e.MsgSendResponse.decode(new r.BinaryReader(E)))}MultiSend(d){const s=e.MsgMultiSend.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","MultiSend",s).then(E=>e.MsgMultiSendResponse.decode(new r.BinaryReader(E)))}UpdateParams(d){const s=e.MsgUpdateParams.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","UpdateParams",s).then(E=>e.MsgUpdateParamsResponse.decode(new r.BinaryReader(E)))}SetSendEnabled(d){const s=e.MsgSetSendEnabled.encode(d).finish();return this.rpc.request("cosmos.bank.v1beta1.Msg","SetSendEnabled",s).then(E=>e.MsgSetSendEnabledResponse.decode(new r.BinaryReader(E)))}}e.MsgClientImpl=R})(Oc);Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Registry=Bn.isTxBodyEncodeObject=Bn.isPbjsGeneratedType=Bn.isTsProtoGeneratedType=Bn.isTelescopeGeneratedType=void 0;const Qk=Oc,Wk=Me,_d=at,Fk=Re;function im(e){const n=e;return typeof n.fromPartial=="function"&&typeof n.typeUrl=="string"}Bn.isTelescopeGeneratedType=im;function Ic(e){return typeof e.fromPartial=="function"}Bn.isTsProtoGeneratedType=Ic;function Gk(e){return!Ic(e)}Bn.isPbjsGeneratedType=Gk;const wl={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function om(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}Bn.isTxBodyEncodeObject=om;class Lk{constructor(n){const{cosmosCoin:t,cosmosMsgSend:r}=wl;this.types=n?new Map([...n]):new Map([[t,Wk.Coin],[r,Qk.MsgSend]])}register(n,t){this.types.set(n,t)}lookupType(n){return this.types.get(n)}lookupTypeWithError(n){const t=this.lookupType(n);if(!t)throw new Error(`Unregistered type url: ${n}`);return t}encode(n){const{value:t,typeUrl:r}=n;if(om(n))return this.encodeTxBody(t);const o=this.lookupTypeWithError(r),h=im(o)||Ic(o)?o.fromPartial(t):o.create(t);return o.encode(h).finish()}encodeAsAny(n){const t=this.encode(n);return Fk.Any.fromPartial({typeUrl:n.typeUrl,value:t})}encodeTxBody(n){var o;const t=n.messages.map(h=>this.encodeAsAny(h)),r=_d.TxBody.fromPartial({...n,timeoutHeight:BigInt(((o=n.timeoutHeight)==null?void 0:o.toString())??"0"),messages:t});return _d.TxBody.encode(r).finish()}decode({typeUrl:n,value:t}){if(n===wl.cosmosTxBody)return this.decodeTxBody(t);const o=this.lookupTypeWithError(n).decode(t);return Object.entries(o).forEach(([h,v])=>{typeof ue.Buffer<"u"&&typeof ue.Buffer.isBuffer<"u"&&ue.Buffer.isBuffer(v)&&(o[h]=Uint8Array.from(v))}),o}decodeTxBody(n){const t=_d.TxBody.decode(n);return{...t,messages:t.messages.map(({typeUrl:r,value:o})=>{if(!r)throw new Error("Missing type_url in Any");if(!o)throw new Error("Missing value in Any");return this.decode({typeUrl:r,value:o})})}}}Bn.Registry=Lk;var Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.isOfflineDirectSigner=void 0;function $k(e){return e.signDirect!==void 0}Ha.isOfflineDirectSigner=$k;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseCoins=e.coins=e.coin=e.executeKdf=e.makeSignDoc=e.makeSignBytes=e.makeAuthInfoBytes=e.isOfflineDirectSigner=e.Registry=e.isTxBodyEncodeObject=e.isTsProtoGeneratedType=e.isPbjsGeneratedType=e.encodePubkey=e.decodePubkey=e.decodeOptionalPubkey=e.anyToSinglePubkey=e.makeCosmoshubPath=e.DirectSecp256k1Wallet=e.extractKdfConfiguration=e.DirectSecp256k1HdWallet=e.decodeTxRaw=void 0;var n=Ca;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return n.decodeTxRaw}});var t=Gr;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return t.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return t.extractKdfConfiguration}});var r=Ma;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return r.DirectSecp256k1Wallet}});var o=qa;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var h=nt;Object.defineProperty(e,"anyToSinglePubkey",{enumerable:!0,get:function(){return h.anyToSinglePubkey}}),Object.defineProperty(e,"decodeOptionalPubkey",{enumerable:!0,get:function(){return h.decodeOptionalPubkey}}),Object.defineProperty(e,"decodePubkey",{enumerable:!0,get:function(){return h.decodePubkey}}),Object.defineProperty(e,"encodePubkey",{enumerable:!0,get:function(){return h.encodePubkey}});var v=Bn;Object.defineProperty(e,"isPbjsGeneratedType",{enumerable:!0,get:function(){return v.isPbjsGeneratedType}}),Object.defineProperty(e,"isTsProtoGeneratedType",{enumerable:!0,get:function(){return v.isTsProtoGeneratedType}}),Object.defineProperty(e,"isTxBodyEncodeObject",{enumerable:!0,get:function(){return v.isTxBodyEncodeObject}}),Object.defineProperty(e,"Registry",{enumerable:!0,get:function(){return v.Registry}});var C=Ha;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return C.isOfflineDirectSigner}});var w=ot;Object.defineProperty(e,"makeAuthInfoBytes",{enumerable:!0,get:function(){return w.makeAuthInfoBytes}}),Object.defineProperty(e,"makeSignBytes",{enumerable:!0,get:function(){return w.makeSignBytes}}),Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return w.makeSignDoc}});var D=Bc;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return D.executeKdf}});var J=zn;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return J.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return J.coins}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return J.parseCoins}})})(st);var Va={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.ModuleCredential=e.ModuleAccount=e.BaseAccount=e.protobufPackage=void 0;const n=Re,t=ee,r=ne;e.protobufPackage="cosmos.auth.v1beta1";function o(){return{address:"",pubKey:void 0,accountNumber:BigInt(0),sequence:BigInt(0)}}e.BaseAccount={typeUrl:"/cosmos.auth.v1beta1.BaseAccount",encode(w,D=t.BinaryWriter.create()){return w.address!==""&&D.uint32(10).string(w.address),w.pubKey!==void 0&&n.Any.encode(w.pubKey,D.uint32(18).fork()).ldelim(),w.accountNumber!==BigInt(0)&&D.uint32(24).uint64(w.accountNumber),w.sequence!==BigInt(0)&&D.uint32(32).uint64(w.sequence),D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=o();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.address=J.string();break;case 2:g.pubKey=n.Any.decode(J,J.uint32());break;case 3:g.accountNumber=J.uint64();break;case 4:g.sequence=J.uint64();break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=o();return(0,r.isSet)(w.address)&&(D.address=String(w.address)),(0,r.isSet)(w.pubKey)&&(D.pubKey=n.Any.fromJSON(w.pubKey)),(0,r.isSet)(w.accountNumber)&&(D.accountNumber=BigInt(w.accountNumber.toString())),(0,r.isSet)(w.sequence)&&(D.sequence=BigInt(w.sequence.toString())),D},toJSON(w){const D={};return w.address!==void 0&&(D.address=w.address),w.pubKey!==void 0&&(D.pubKey=w.pubKey?n.Any.toJSON(w.pubKey):void 0),w.accountNumber!==void 0&&(D.accountNumber=(w.accountNumber||BigInt(0)).toString()),w.sequence!==void 0&&(D.sequence=(w.sequence||BigInt(0)).toString()),D},fromPartial(w){const D=o();return D.address=w.address??"",w.pubKey!==void 0&&w.pubKey!==null&&(D.pubKey=n.Any.fromPartial(w.pubKey)),w.accountNumber!==void 0&&w.accountNumber!==null&&(D.accountNumber=BigInt(w.accountNumber.toString())),w.sequence!==void 0&&w.sequence!==null&&(D.sequence=BigInt(w.sequence.toString())),D}};function h(){return{baseAccount:void 0,name:"",permissions:[]}}e.ModuleAccount={typeUrl:"/cosmos.auth.v1beta1.ModuleAccount",encode(w,D=t.BinaryWriter.create()){w.baseAccount!==void 0&&e.BaseAccount.encode(w.baseAccount,D.uint32(10).fork()).ldelim(),w.name!==""&&D.uint32(18).string(w.name);for(const J of w.permissions)D.uint32(26).string(J);return D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=h();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.baseAccount=e.BaseAccount.decode(J,J.uint32());break;case 2:g.name=J.string();break;case 3:g.permissions.push(J.string());break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=h();return(0,r.isSet)(w.baseAccount)&&(D.baseAccount=e.BaseAccount.fromJSON(w.baseAccount)),(0,r.isSet)(w.name)&&(D.name=String(w.name)),Array.isArray(w==null?void 0:w.permissions)&&(D.permissions=w.permissions.map(J=>String(J))),D},toJSON(w){const D={};return w.baseAccount!==void 0&&(D.baseAccount=w.baseAccount?e.BaseAccount.toJSON(w.baseAccount):void 0),w.name!==void 0&&(D.name=w.name),w.permissions?D.permissions=w.permissions.map(J=>J):D.permissions=[],D},fromPartial(w){var J;const D=h();return w.baseAccount!==void 0&&w.baseAccount!==null&&(D.baseAccount=e.BaseAccount.fromPartial(w.baseAccount)),D.name=w.name??"",D.permissions=((J=w.permissions)==null?void 0:J.map(I=>I))||[],D}};function v(){return{moduleName:"",derivationKeys:[]}}e.ModuleCredential={typeUrl:"/cosmos.auth.v1beta1.ModuleCredential",encode(w,D=t.BinaryWriter.create()){w.moduleName!==""&&D.uint32(10).string(w.moduleName);for(const J of w.derivationKeys)D.uint32(18).bytes(J);return D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=v();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.moduleName=J.string();break;case 2:g.derivationKeys.push(J.bytes());break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=v();return(0,r.isSet)(w.moduleName)&&(D.moduleName=String(w.moduleName)),Array.isArray(w==null?void 0:w.derivationKeys)&&(D.derivationKeys=w.derivationKeys.map(J=>(0,r.bytesFromBase64)(J))),D},toJSON(w){const D={};return w.moduleName!==void 0&&(D.moduleName=w.moduleName),w.derivationKeys?D.derivationKeys=w.derivationKeys.map(J=>(0,r.base64FromBytes)(J!==void 0?J:new Uint8Array)):D.derivationKeys=[],D},fromPartial(w){var J;const D=v();return D.moduleName=w.moduleName??"",D.derivationKeys=((J=w.derivationKeys)==null?void 0:J.map(I=>I))||[],D}};function C(){return{maxMemoCharacters:BigInt(0),txSigLimit:BigInt(0),txSizeCostPerByte:BigInt(0),sigVerifyCostEd25519:BigInt(0),sigVerifyCostSecp256k1:BigInt(0)}}e.Params={typeUrl:"/cosmos.auth.v1beta1.Params",encode(w,D=t.BinaryWriter.create()){return w.maxMemoCharacters!==BigInt(0)&&D.uint32(8).uint64(w.maxMemoCharacters),w.txSigLimit!==BigInt(0)&&D.uint32(16).uint64(w.txSigLimit),w.txSizeCostPerByte!==BigInt(0)&&D.uint32(24).uint64(w.txSizeCostPerByte),w.sigVerifyCostEd25519!==BigInt(0)&&D.uint32(32).uint64(w.sigVerifyCostEd25519),w.sigVerifyCostSecp256k1!==BigInt(0)&&D.uint32(40).uint64(w.sigVerifyCostSecp256k1),D},decode(w,D){const J=w instanceof t.BinaryReader?w:new t.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=C();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.maxMemoCharacters=J.uint64();break;case 2:g.txSigLimit=J.uint64();break;case 3:g.txSizeCostPerByte=J.uint64();break;case 4:g.sigVerifyCostEd25519=J.uint64();break;case 5:g.sigVerifyCostSecp256k1=J.uint64();break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=C();return(0,r.isSet)(w.maxMemoCharacters)&&(D.maxMemoCharacters=BigInt(w.maxMemoCharacters.toString())),(0,r.isSet)(w.txSigLimit)&&(D.txSigLimit=BigInt(w.txSigLimit.toString())),(0,r.isSet)(w.txSizeCostPerByte)&&(D.txSizeCostPerByte=BigInt(w.txSizeCostPerByte.toString())),(0,r.isSet)(w.sigVerifyCostEd25519)&&(D.sigVerifyCostEd25519=BigInt(w.sigVerifyCostEd25519.toString())),(0,r.isSet)(w.sigVerifyCostSecp256k1)&&(D.sigVerifyCostSecp256k1=BigInt(w.sigVerifyCostSecp256k1.toString())),D},toJSON(w){const D={};return w.maxMemoCharacters!==void 0&&(D.maxMemoCharacters=(w.maxMemoCharacters||BigInt(0)).toString()),w.txSigLimit!==void 0&&(D.txSigLimit=(w.txSigLimit||BigInt(0)).toString()),w.txSizeCostPerByte!==void 0&&(D.txSizeCostPerByte=(w.txSizeCostPerByte||BigInt(0)).toString()),w.sigVerifyCostEd25519!==void 0&&(D.sigVerifyCostEd25519=(w.sigVerifyCostEd25519||BigInt(0)).toString()),w.sigVerifyCostSecp256k1!==void 0&&(D.sigVerifyCostSecp256k1=(w.sigVerifyCostSecp256k1||BigInt(0)).toString()),D},fromPartial(w){const D=C();return w.maxMemoCharacters!==void 0&&w.maxMemoCharacters!==null&&(D.maxMemoCharacters=BigInt(w.maxMemoCharacters.toString())),w.txSigLimit!==void 0&&w.txSigLimit!==null&&(D.txSigLimit=BigInt(w.txSigLimit.toString())),w.txSizeCostPerByte!==void 0&&w.txSizeCostPerByte!==null&&(D.txSizeCostPerByte=BigInt(w.txSizeCostPerByte.toString())),w.sigVerifyCostEd25519!==void 0&&w.sigVerifyCostEd25519!==null&&(D.sigVerifyCostEd25519=BigInt(w.sigVerifyCostEd25519.toString())),w.sigVerifyCostSecp256k1!==void 0&&w.sigVerifyCostSecp256k1!==null&&(D.sigVerifyCostSecp256k1=BigInt(w.sigVerifyCostSecp256k1.toString())),D}}})(Va);var Tc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.PermanentLockedAccount=e.PeriodicVestingAccount=e.Period=e.DelayedVestingAccount=e.ContinuousVestingAccount=e.BaseVestingAccount=e.protobufPackage=void 0;const n=Va,t=Me,r=ee,o=ne;e.protobufPackage="cosmos.vesting.v1beta1";function h(){return{baseAccount:void 0,originalVesting:[],delegatedFree:[],delegatedVesting:[],endTime:BigInt(0)}}e.BaseVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.BaseVestingAccount",encode(I,g=r.BinaryWriter.create()){I.baseAccount!==void 0&&n.BaseAccount.encode(I.baseAccount,g.uint32(10).fork()).ldelim();for(const R of I.originalVesting)t.Coin.encode(R,g.uint32(18).fork()).ldelim();for(const R of I.delegatedFree)t.Coin.encode(R,g.uint32(26).fork()).ldelim();for(const R of I.delegatedVesting)t.Coin.encode(R,g.uint32(34).fork()).ldelim();return I.endTime!==BigInt(0)&&g.uint32(40).int64(I.endTime),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=h();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseAccount=n.BaseAccount.decode(R,R.uint32());break;case 2:d.originalVesting.push(t.Coin.decode(R,R.uint32()));break;case 3:d.delegatedFree.push(t.Coin.decode(R,R.uint32()));break;case 4:d.delegatedVesting.push(t.Coin.decode(R,R.uint32()));break;case 5:d.endTime=R.int64();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=h();return(0,o.isSet)(I.baseAccount)&&(g.baseAccount=n.BaseAccount.fromJSON(I.baseAccount)),Array.isArray(I==null?void 0:I.originalVesting)&&(g.originalVesting=I.originalVesting.map(R=>t.Coin.fromJSON(R))),Array.isArray(I==null?void 0:I.delegatedFree)&&(g.delegatedFree=I.delegatedFree.map(R=>t.Coin.fromJSON(R))),Array.isArray(I==null?void 0:I.delegatedVesting)&&(g.delegatedVesting=I.delegatedVesting.map(R=>t.Coin.fromJSON(R))),(0,o.isSet)(I.endTime)&&(g.endTime=BigInt(I.endTime.toString())),g},toJSON(I){const g={};return I.baseAccount!==void 0&&(g.baseAccount=I.baseAccount?n.BaseAccount.toJSON(I.baseAccount):void 0),I.originalVesting?g.originalVesting=I.originalVesting.map(R=>R?t.Coin.toJSON(R):void 0):g.originalVesting=[],I.delegatedFree?g.delegatedFree=I.delegatedFree.map(R=>R?t.Coin.toJSON(R):void 0):g.delegatedFree=[],I.delegatedVesting?g.delegatedVesting=I.delegatedVesting.map(R=>R?t.Coin.toJSON(R):void 0):g.delegatedVesting=[],I.endTime!==void 0&&(g.endTime=(I.endTime||BigInt(0)).toString()),g},fromPartial(I){var R,B,d;const g=h();return I.baseAccount!==void 0&&I.baseAccount!==null&&(g.baseAccount=n.BaseAccount.fromPartial(I.baseAccount)),g.originalVesting=((R=I.originalVesting)==null?void 0:R.map(s=>t.Coin.fromPartial(s)))||[],g.delegatedFree=((B=I.delegatedFree)==null?void 0:B.map(s=>t.Coin.fromPartial(s)))||[],g.delegatedVesting=((d=I.delegatedVesting)==null?void 0:d.map(s=>t.Coin.fromPartial(s)))||[],I.endTime!==void 0&&I.endTime!==null&&(g.endTime=BigInt(I.endTime.toString())),g}};function v(){return{baseVestingAccount:void 0,startTime:BigInt(0)}}e.ContinuousVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.ContinuousVestingAccount",encode(I,g=r.BinaryWriter.create()){return I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),I.startTime!==BigInt(0)&&g.uint32(16).int64(I.startTime),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=v();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;case 2:d.startTime=R.int64();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=v();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),(0,o.isSet)(I.startTime)&&(g.startTime=BigInt(I.startTime.toString())),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),I.startTime!==void 0&&(g.startTime=(I.startTime||BigInt(0)).toString()),g},fromPartial(I){const g=v();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),I.startTime!==void 0&&I.startTime!==null&&(g.startTime=BigInt(I.startTime.toString())),g}};function C(){return{baseVestingAccount:void 0}}e.DelayedVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.DelayedVestingAccount",encode(I,g=r.BinaryWriter.create()){return I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=C();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=C();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),g},fromPartial(I){const g=C();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),g}};function w(){return{length:BigInt(0),amount:[]}}e.Period={typeUrl:"/cosmos.vesting.v1beta1.Period",encode(I,g=r.BinaryWriter.create()){I.length!==BigInt(0)&&g.uint32(8).int64(I.length);for(const R of I.amount)t.Coin.encode(R,g.uint32(18).fork()).ldelim();return g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=w();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.length=R.int64();break;case 2:d.amount.push(t.Coin.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=w();return(0,o.isSet)(I.length)&&(g.length=BigInt(I.length.toString())),Array.isArray(I==null?void 0:I.amount)&&(g.amount=I.amount.map(R=>t.Coin.fromJSON(R))),g},toJSON(I){const g={};return I.length!==void 0&&(g.length=(I.length||BigInt(0)).toString()),I.amount?g.amount=I.amount.map(R=>R?t.Coin.toJSON(R):void 0):g.amount=[],g},fromPartial(I){var R;const g=w();return I.length!==void 0&&I.length!==null&&(g.length=BigInt(I.length.toString())),g.amount=((R=I.amount)==null?void 0:R.map(B=>t.Coin.fromPartial(B)))||[],g}};function D(){return{baseVestingAccount:void 0,startTime:BigInt(0),vestingPeriods:[]}}e.PeriodicVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.PeriodicVestingAccount",encode(I,g=r.BinaryWriter.create()){I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),I.startTime!==BigInt(0)&&g.uint32(16).int64(I.startTime);for(const R of I.vestingPeriods)e.Period.encode(R,g.uint32(26).fork()).ldelim();return g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=D();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;case 2:d.startTime=R.int64();break;case 3:d.vestingPeriods.push(e.Period.decode(R,R.uint32()));break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=D();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),(0,o.isSet)(I.startTime)&&(g.startTime=BigInt(I.startTime.toString())),Array.isArray(I==null?void 0:I.vestingPeriods)&&(g.vestingPeriods=I.vestingPeriods.map(R=>e.Period.fromJSON(R))),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),I.startTime!==void 0&&(g.startTime=(I.startTime||BigInt(0)).toString()),I.vestingPeriods?g.vestingPeriods=I.vestingPeriods.map(R=>R?e.Period.toJSON(R):void 0):g.vestingPeriods=[],g},fromPartial(I){var R;const g=D();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),I.startTime!==void 0&&I.startTime!==null&&(g.startTime=BigInt(I.startTime.toString())),g.vestingPeriods=((R=I.vestingPeriods)==null?void 0:R.map(B=>e.Period.fromPartial(B)))||[],g}};function J(){return{baseVestingAccount:void 0}}e.PermanentLockedAccount={typeUrl:"/cosmos.vesting.v1beta1.PermanentLockedAccount",encode(I,g=r.BinaryWriter.create()){return I.baseVestingAccount!==void 0&&e.BaseVestingAccount.encode(I.baseVestingAccount,g.uint32(10).fork()).ldelim(),g},decode(I,g){const R=I instanceof r.BinaryReader?I:new r.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=J();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.baseVestingAccount=e.BaseVestingAccount.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=J();return(0,o.isSet)(I.baseVestingAccount)&&(g.baseVestingAccount=e.BaseVestingAccount.fromJSON(I.baseVestingAccount)),g},toJSON(I){const g={};return I.baseVestingAccount!==void 0&&(g.baseVestingAccount=I.baseVestingAccount?e.BaseVestingAccount.toJSON(I.baseVestingAccount):void 0),g},fromPartial(I){const g=J();return I.baseVestingAccount!==void 0&&I.baseVestingAccount!==null&&(g.baseVestingAccount=e.BaseVestingAccount.fromPartial(I.baseVestingAccount)),g}}})(Tc);Object.defineProperty(co,"__esModule",{value:!0});co.accountFromAny=void 0;const Kk=Te,zk=st,Ui=Oe,El=Va,Eo=Tc;function _l(e){return Kk.Uint64.fromString(e.toString())}function mr(e){const{address:n,pubKey:t,accountNumber:r,sequence:o}=e,h=(0,zk.decodeOptionalPubkey)(t);return{address:n,pubkey:h,accountNumber:_l(r).toNumber(),sequence:_l(o).toNumber()}}function Yk(e){var r,o,h,v,C,w,D;const{typeUrl:n,value:t}=e;switch(n){case"/cosmos.auth.v1beta1.BaseAccount":return mr(El.BaseAccount.decode(t));case"/cosmos.auth.v1beta1.ModuleAccount":{const J=El.ModuleAccount.decode(t).baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const J=(r=Eo.BaseVestingAccount.decode(t))==null?void 0:r.baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const J=(h=(o=Eo.ContinuousVestingAccount.decode(t))==null?void 0:o.baseVestingAccount)==null?void 0:h.baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const J=(C=(v=Eo.DelayedVestingAccount.decode(t))==null?void 0:v.baseVestingAccount)==null?void 0:C.baseAccount;return(0,Ui.assert)(J),mr(J)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const J=(D=(w=Eo.PeriodicVestingAccount.decode(t))==null?void 0:w.baseVestingAccount)==null?void 0:D.baseAccount;return(0,Ui.assert)(J),mr(J)}default:throw new Error(`Unsupported type: '${n}'`)}}co.accountFromAny=Yk;var mo={};Object.defineProperty(mo,"__esModule",{value:!0});mo.AminoTypes=void 0;class Zk{constructor(n){this.register=n}toAmino({typeUrl:n,value:t}){const r=this.register[n];if(!r)throw new Error(`Type URL '${n}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);return{type:r.aminoType,value:r.toAmino(t)}}fromAmino({type:n,value:t}){const r=Object.entries(this.register).filter(([o,{aminoType:h}])=>h===n);switch(r.length){case 0:throw new Error(`Amino type identifier '${n}' does not exist in the Amino message type register. If you need support for this message type, you can pass in additional entries to the AminoTypes constructor. If you think this message type should be included by default, please open an issue at https://github.com/cosmos/cosmjs/issues.`);case 1:{const[o,h]=r[0];return{typeUrl:o,value:h.fromAmino(t)}}default:throw new Error(`Multiple types are registered with Amino type identifier '${n}': '`+r.map(([o,h])=>o).sort().join("', '")+"'. Thus fromAmino cannot be performed.")}}}mo.AminoTypes=Zk;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.fromTendermintEvent=void 0;const Ul=de;function Xk(e){return{type:e.type,attributes:e.attributes.map(n=>({key:typeof n.key=="string"?n.key:(0,Ul.fromUtf8)(n.key,!0),value:typeof n.value=="string"?n.value:(0,Ul.fromUtf8)(n.value,!0)}))}}yo.fromTendermintEvent=Xk;var rr={};Object.defineProperty(rr,"__esModule",{value:!0});rr.calculateFee=rr.GasPrice=void 0;const am=Te,xk=st;function jk(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Qa{constructor(n,t){this.amount=n,this.denom=t}static fromString(n){const t=n.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!t)throw new Error("Invalid gas price string");const[r,o,h]=t;jk(h);const C=am.Decimal.fromUserInput(o,18);return new Qa(C,h)}toString(){return this.amount.toString()+this.denom}}rr.GasPrice=Qa;function eP(e,n){const t=typeof n=="string"?Qa.fromString(n):n,{denom:r,amount:o}=t,h=o.multiply(new am.Uint53(e)).ceil().toString();return{amount:(0,xk.coins)(h,r),gas:e.toString()}}rr.calculateFee=eP;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.findAttribute=tn.parseRawLog=tn.parseLogs=tn.parseLog=tn.parseEvent=tn.parseAttribute=void 0;const Cc=Oe;function sm(e){if(!(0,Cc.isNonNullObject)(e))throw new Error("Attribute must be a non-null object");const{key:n,value:t}=e;if(typeof n!="string"||!n)throw new Error("Attribute's key must be a non-empty string");if(typeof t!="string"&&typeof t<"u")throw new Error("Attribute's value must be a string or unset");return{key:n,value:t||""}}tn.parseAttribute=sm;function dm(e){if(!(0,Cc.isNonNullObject)(e))throw new Error("Event must be a non-null object");const{type:n,attributes:t}=e;if(typeof n!="string"||n==="")throw new Error("Event type must be a non-empty string");if(!Array.isArray(t))throw new Error("Event's attributes must be an array");return{type:n,attributes:t.map(sm)}}tn.parseEvent=dm;function um(e){if(!(0,Cc.isNonNullObject)(e))throw new Error("Log must be a non-null object");const{msg_index:n,log:t,events:r}=e;if(typeof n!="number")throw new Error("Log's msg_index must be a number");if(typeof t!="string")throw new Error("Log's log must be a string");if(!Array.isArray(r))throw new Error("Log's events must be an array");return{msg_index:n,log:t,events:r.map(dm)}}tn.parseLog=um;function cm(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(um)}tn.parseLogs=cm;function nP(e){if(!e)return[];const n=JSON.parse(e).map(({events:t},r)=>({msg_index:r,events:t,log:""}));return cm(n)}tn.parseRawLog=nP;function tP(e,n,t){var h;const r=e.find(()=>!0),o=(h=r==null?void 0:r.events.find(v=>v.type===n))==null?void 0:h.attributes.find(v=>v.key===t);if(!o)throw new Error(`Could not find attribute '${t}' in first event of type '${n}' in first log.`);return o}tn.findAttribute=tP;var io={},Wa={},lm={},be={};Object.defineProperty(be,"__esModule",{value:!0});be.PageResponse=be.PageRequest=be.protobufPackage=void 0;const Mr=ee,Vn=ne;be.protobufPackage="cosmos.base.query.v1beta1";function Ud(){return{key:new Uint8Array,offset:BigInt(0),limit:BigInt(0),countTotal:!1,reverse:!1}}be.PageRequest={typeUrl:"/cosmos.base.query.v1beta1.PageRequest",encode(e,n=Mr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),e.offset!==BigInt(0)&&n.uint32(16).uint64(e.offset),e.limit!==BigInt(0)&&n.uint32(24).uint64(e.limit),e.countTotal===!0&&n.uint32(32).bool(e.countTotal),e.reverse===!0&&n.uint32(40).bool(e.reverse),n},decode(e,n){const t=e instanceof Mr.BinaryReader?e:new Mr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Ud();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.key=t.bytes();break;case 2:o.offset=t.uint64();break;case 3:o.limit=t.uint64();break;case 4:o.countTotal=t.bool();break;case 5:o.reverse=t.bool();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Ud();return(0,Vn.isSet)(e.key)&&(n.key=(0,Vn.bytesFromBase64)(e.key)),(0,Vn.isSet)(e.offset)&&(n.offset=BigInt(e.offset.toString())),(0,Vn.isSet)(e.limit)&&(n.limit=BigInt(e.limit.toString())),(0,Vn.isSet)(e.countTotal)&&(n.countTotal=!!e.countTotal),(0,Vn.isSet)(e.reverse)&&(n.reverse=!!e.reverse),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,Vn.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),e.offset!==void 0&&(n.offset=(e.offset||BigInt(0)).toString()),e.limit!==void 0&&(n.limit=(e.limit||BigInt(0)).toString()),e.countTotal!==void 0&&(n.countTotal=e.countTotal),e.reverse!==void 0&&(n.reverse=e.reverse),n},fromPartial(e){const n=Ud();return n.key=e.key??new Uint8Array,e.offset!==void 0&&e.offset!==null&&(n.offset=BigInt(e.offset.toString())),e.limit!==void 0&&e.limit!==null&&(n.limit=BigInt(e.limit.toString())),n.countTotal=e.countTotal??!1,n.reverse=e.reverse??!1,n}};function Jd(){return{nextKey:new Uint8Array,total:BigInt(0)}}be.PageResponse={typeUrl:"/cosmos.base.query.v1beta1.PageResponse",encode(e,n=Mr.BinaryWriter.create()){return e.nextKey.length!==0&&n.uint32(10).bytes(e.nextKey),e.total!==BigInt(0)&&n.uint32(16).uint64(e.total),n},decode(e,n){const t=e instanceof Mr.BinaryReader?e:new Mr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Jd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.nextKey=t.bytes();break;case 2:o.total=t.uint64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Jd();return(0,Vn.isSet)(e.nextKey)&&(n.nextKey=(0,Vn.bytesFromBase64)(e.nextKey)),(0,Vn.isSet)(e.total)&&(n.total=BigInt(e.total.toString())),n},toJSON(e){const n={};return e.nextKey!==void 0&&(n.nextKey=(0,Vn.base64FromBytes)(e.nextKey!==void 0?e.nextKey:new Uint8Array)),e.total!==void 0&&(n.total=(e.total||BigInt(0)).toString()),n},fromPartial(e){const n=Jd();return n.nextKey=e.nextKey??new Uint8Array,e.total!==void 0&&e.total!==null&&(n.total=BigInt(e.total.toString())),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAccountInfoResponse=e.QueryAccountInfoRequest=e.QueryAccountAddressByIDResponse=e.QueryAccountAddressByIDRequest=e.AddressStringToBytesResponse=e.AddressStringToBytesRequest=e.AddressBytesToStringResponse=e.AddressBytesToStringRequest=e.Bech32PrefixResponse=e.Bech32PrefixRequest=e.QueryModuleAccountByNameResponse=e.QueryModuleAccountByNameRequest=e.QueryModuleAccountsResponse=e.QueryModuleAccountsRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryAccountResponse=e.QueryAccountRequest=e.QueryAccountsResponse=e.QueryAccountsRequest=e.protobufPackage=void 0;const n=be,t=Re,r=Va,o=ee,h=ne;e.protobufPackage="cosmos.auth.v1beta1";function v(){return{pagination:void 0}}e.QueryAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsRequest",encode(l,T=o.BinaryWriter.create()){return l.pagination!==void 0&&n.PageRequest.encode(l.pagination,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=v();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.pagination=n.PageRequest.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=v();return(0,h.isSet)(l.pagination)&&(T.pagination=n.PageRequest.fromJSON(l.pagination)),T},toJSON(l){const T={};return l.pagination!==void 0&&(T.pagination=l.pagination?n.PageRequest.toJSON(l.pagination):void 0),T},fromPartial(l){const T=v();return l.pagination!==void 0&&l.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(l.pagination)),T}};function C(){return{accounts:[],pagination:void 0}}e.QueryAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.accounts)t.Any.encode(f,T.uint32(10).fork()).ldelim();return l.pagination!==void 0&&n.PageResponse.encode(l.pagination,T.uint32(18).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=C();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.accounts.push(t.Any.decode(f,f.uint32()));break;case 2:A.pagination=n.PageResponse.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=C();return Array.isArray(l==null?void 0:l.accounts)&&(T.accounts=l.accounts.map(f=>t.Any.fromJSON(f))),(0,h.isSet)(l.pagination)&&(T.pagination=n.PageResponse.fromJSON(l.pagination)),T},toJSON(l){const T={};return l.accounts?T.accounts=l.accounts.map(f=>f?t.Any.toJSON(f):void 0):T.accounts=[],l.pagination!==void 0&&(T.pagination=l.pagination?n.PageResponse.toJSON(l.pagination):void 0),T},fromPartial(l){var f;const T=C();return T.accounts=((f=l.accounts)==null?void 0:f.map(p=>t.Any.fromPartial(p)))||[],l.pagination!==void 0&&l.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(l.pagination)),T}};function w(){return{address:""}}e.QueryAccountRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountRequest",encode(l,T=o.BinaryWriter.create()){return l.address!==""&&T.uint32(10).string(l.address),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=w();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.address=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=w();return(0,h.isSet)(l.address)&&(T.address=String(l.address)),T},toJSON(l){const T={};return l.address!==void 0&&(T.address=l.address),T},fromPartial(l){const T=w();return T.address=l.address??"",T}};function D(){return{account:void 0}}e.QueryAccountResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountResponse",encode(l,T=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=D();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.account=t.Any.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=D();return(0,h.isSet)(l.account)&&(T.account=t.Any.fromJSON(l.account)),T},toJSON(l){const T={};return l.account!==void 0&&(T.account=l.account?t.Any.toJSON(l.account):void 0),T},fromPartial(l){const T=D();return l.account!==void 0&&l.account!==null&&(T.account=t.Any.fromPartial(l.account)),T}};function J(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryParamsRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=J();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return J()},toJSON(l){return{}},fromPartial(l){return J()}};function I(){return{params:r.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryParamsResponse",encode(l,T=o.BinaryWriter.create()){return l.params!==void 0&&r.Params.encode(l.params,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=I();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.params=r.Params.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=I();return(0,h.isSet)(l.params)&&(T.params=r.Params.fromJSON(l.params)),T},toJSON(l){const T={};return l.params!==void 0&&(T.params=l.params?r.Params.toJSON(l.params):void 0),T},fromPartial(l){const T=I();return l.params!==void 0&&l.params!==null&&(T.params=r.Params.fromPartial(l.params)),T}};function g(){return{}}e.QueryModuleAccountsRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=g();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return g()},toJSON(l){return{}},fromPartial(l){return g()}};function R(){return{accounts:[]}}e.QueryModuleAccountsResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.accounts)t.Any.encode(f,T.uint32(10).fork()).ldelim();return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=R();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.accounts.push(t.Any.decode(f,f.uint32()));break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=R();return Array.isArray(l==null?void 0:l.accounts)&&(T.accounts=l.accounts.map(f=>t.Any.fromJSON(f))),T},toJSON(l){const T={};return l.accounts?T.accounts=l.accounts.map(f=>f?t.Any.toJSON(f):void 0):T.accounts=[],T},fromPartial(l){var f;const T=R();return T.accounts=((f=l.accounts)==null?void 0:f.map(p=>t.Any.fromPartial(p)))||[],T}};function B(){return{name:""}}e.QueryModuleAccountByNameRequest={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameRequest",encode(l,T=o.BinaryWriter.create()){return l.name!==""&&T.uint32(10).string(l.name),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=B();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.name=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=B();return(0,h.isSet)(l.name)&&(T.name=String(l.name)),T},toJSON(l){const T={};return l.name!==void 0&&(T.name=l.name),T},fromPartial(l){const T=B();return T.name=l.name??"",T}};function d(){return{account:void 0}}e.QueryModuleAccountByNameResponse={typeUrl:"/cosmos.auth.v1beta1.QueryModuleAccountByNameResponse",encode(l,T=o.BinaryWriter.create()){return l.account!==void 0&&t.Any.encode(l.account,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=d();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.account=t.Any.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=d();return(0,h.isSet)(l.account)&&(T.account=t.Any.fromJSON(l.account)),T},toJSON(l){const T={};return l.account!==void 0&&(T.account=l.account?t.Any.toJSON(l.account):void 0),T},fromPartial(l){const T=d();return l.account!==void 0&&l.account!==null&&(T.account=t.Any.fromPartial(l.account)),T}};function s(){return{}}e.Bech32PrefixRequest={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=s();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return s()},toJSON(l){return{}},fromPartial(l){return s()}};function y(){return{bech32Prefix:""}}e.Bech32PrefixResponse={typeUrl:"/cosmos.auth.v1beta1.Bech32PrefixResponse",encode(l,T=o.BinaryWriter.create()){return l.bech32Prefix!==""&&T.uint32(10).string(l.bech32Prefix),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=y();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.bech32Prefix=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=y();return(0,h.isSet)(l.bech32Prefix)&&(T.bech32Prefix=String(l.bech32Prefix)),T},toJSON(l){const T={};return l.bech32Prefix!==void 0&&(T.bech32Prefix=l.bech32Prefix),T},fromPartial(l){const T=y();return T.bech32Prefix=l.bech32Prefix??"",T}};function E(){return{addressBytes:new Uint8Array}}e.AddressBytesToStringRequest={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringRequest",encode(l,T=o.BinaryWriter.create()){return l.addressBytes.length!==0&&T.uint32(10).bytes(l.addressBytes),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=E();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressBytes=f.bytes();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=E();return(0,h.isSet)(l.addressBytes)&&(T.addressBytes=(0,h.bytesFromBase64)(l.addressBytes)),T},toJSON(l){const T={};return l.addressBytes!==void 0&&(T.addressBytes=(0,h.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),T},fromPartial(l){const T=E();return T.addressBytes=l.addressBytes??new Uint8Array,T}};function _(){return{addressString:""}}e.AddressBytesToStringResponse={typeUrl:"/cosmos.auth.v1beta1.AddressBytesToStringResponse",encode(l,T=o.BinaryWriter.create()){return l.addressString!==""&&T.uint32(10).string(l.addressString),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=_();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressString=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=_();return(0,h.isSet)(l.addressString)&&(T.addressString=String(l.addressString)),T},toJSON(l){const T={};return l.addressString!==void 0&&(T.addressString=l.addressString),T},fromPartial(l){const T=_();return T.addressString=l.addressString??"",T}};function U(){return{addressString:""}}e.AddressStringToBytesRequest={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesRequest",encode(l,T=o.BinaryWriter.create()){return l.addressString!==""&&T.uint32(10).string(l.addressString),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=U();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressString=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=U();return(0,h.isSet)(l.addressString)&&(T.addressString=String(l.addressString)),T},toJSON(l){const T={};return l.addressString!==void 0&&(T.addressString=l.addressString),T},fromPartial(l){const T=U();return T.addressString=l.addressString??"",T}};function H(){return{addressBytes:new Uint8Array}}e.AddressStringToBytesResponse={typeUrl:"/cosmos.auth.v1beta1.AddressStringToBytesResponse",encode(l,T=o.BinaryWriter.create()){return l.addressBytes.length!==0&&T.uint32(10).bytes(l.addressBytes),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=H();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.addressBytes=f.bytes();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=H();return(0,h.isSet)(l.addressBytes)&&(T.addressBytes=(0,h.bytesFromBase64)(l.addressBytes)),T},toJSON(l){const T={};return l.addressBytes!==void 0&&(T.addressBytes=(0,h.base64FromBytes)(l.addressBytes!==void 0?l.addressBytes:new Uint8Array)),T},fromPartial(l){const T=H();return T.addressBytes=l.addressBytes??new Uint8Array,T}};function i(){return{id:BigInt(0),accountId:BigInt(0)}}e.QueryAccountAddressByIDRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDRequest",encode(l,T=o.BinaryWriter.create()){return l.id!==BigInt(0)&&T.uint32(8).int64(l.id),l.accountId!==BigInt(0)&&T.uint32(16).uint64(l.accountId),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=i();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.id=f.int64();break;case 2:A.accountId=f.uint64();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=i();return(0,h.isSet)(l.id)&&(T.id=BigInt(l.id.toString())),(0,h.isSet)(l.accountId)&&(T.accountId=BigInt(l.accountId.toString())),T},toJSON(l){const T={};return l.id!==void 0&&(T.id=(l.id||BigInt(0)).toString()),l.accountId!==void 0&&(T.accountId=(l.accountId||BigInt(0)).toString()),T},fromPartial(l){const T=i();return l.id!==void 0&&l.id!==null&&(T.id=BigInt(l.id.toString())),l.accountId!==void 0&&l.accountId!==null&&(T.accountId=BigInt(l.accountId.toString())),T}};function m(){return{accountAddress:""}}e.QueryAccountAddressByIDResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountAddressByIDResponse",encode(l,T=o.BinaryWriter.create()){return l.accountAddress!==""&&T.uint32(10).string(l.accountAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=m();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.accountAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=m();return(0,h.isSet)(l.accountAddress)&&(T.accountAddress=String(l.accountAddress)),T},toJSON(l){const T={};return l.accountAddress!==void 0&&(T.accountAddress=l.accountAddress),T},fromPartial(l){const T=m();return T.accountAddress=l.accountAddress??"",T}};function N(){return{address:""}}e.QueryAccountInfoRequest={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoRequest",encode(l,T=o.BinaryWriter.create()){return l.address!==""&&T.uint32(10).string(l.address),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=N();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.address=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=N();return(0,h.isSet)(l.address)&&(T.address=String(l.address)),T},toJSON(l){const T={};return l.address!==void 0&&(T.address=l.address),T},fromPartial(l){const T=N();return T.address=l.address??"",T}};function V(){return{info:void 0}}e.QueryAccountInfoResponse={typeUrl:"/cosmos.auth.v1beta1.QueryAccountInfoResponse",encode(l,T=o.BinaryWriter.create()){return l.info!==void 0&&r.BaseAccount.encode(l.info,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=V();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.info=r.BaseAccount.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=V();return(0,h.isSet)(l.info)&&(T.info=r.BaseAccount.fromJSON(l.info)),T},toJSON(l){const T={};return l.info!==void 0&&(T.info=l.info?r.BaseAccount.toJSON(l.info):void 0),T},fromPartial(l){const T=V();return l.info!==void 0&&l.info!==null&&(T.info=r.BaseAccount.fromPartial(l.info)),T}};class u{constructor(T){this.rpc=T,this.Accounts=this.Accounts.bind(this),this.Account=this.Account.bind(this),this.AccountAddressByID=this.AccountAddressByID.bind(this),this.Params=this.Params.bind(this),this.ModuleAccounts=this.ModuleAccounts.bind(this),this.ModuleAccountByName=this.ModuleAccountByName.bind(this),this.Bech32Prefix=this.Bech32Prefix.bind(this),this.AddressBytesToString=this.AddressBytesToString.bind(this),this.AddressStringToBytes=this.AddressStringToBytes.bind(this),this.AccountInfo=this.AccountInfo.bind(this)}Accounts(T={pagination:n.PageRequest.fromPartial({})}){const f=e.QueryAccountsRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Accounts",f).then(A=>e.QueryAccountsResponse.decode(new o.BinaryReader(A)))}Account(T){const f=e.QueryAccountRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Account",f).then(A=>e.QueryAccountResponse.decode(new o.BinaryReader(A)))}AccountAddressByID(T){const f=e.QueryAccountAddressByIDRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountAddressByID",f).then(A=>e.QueryAccountAddressByIDResponse.decode(new o.BinaryReader(A)))}Params(T={}){const f=e.QueryParamsRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Params",f).then(A=>e.QueryParamsResponse.decode(new o.BinaryReader(A)))}ModuleAccounts(T={}){const f=e.QueryModuleAccountsRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccounts",f).then(A=>e.QueryModuleAccountsResponse.decode(new o.BinaryReader(A)))}ModuleAccountByName(T){const f=e.QueryModuleAccountByNameRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","ModuleAccountByName",f).then(A=>e.QueryModuleAccountByNameResponse.decode(new o.BinaryReader(A)))}Bech32Prefix(T={}){const f=e.Bech32PrefixRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","Bech32Prefix",f).then(A=>e.Bech32PrefixResponse.decode(new o.BinaryReader(A)))}AddressBytesToString(T){const f=e.AddressBytesToStringRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressBytesToString",f).then(A=>e.AddressBytesToStringResponse.decode(new o.BinaryReader(A)))}AddressStringToBytes(T){const f=e.AddressStringToBytesRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AddressStringToBytes",f).then(A=>e.AddressStringToBytesResponse.decode(new o.BinaryReader(A)))}AccountInfo(T){const f=e.QueryAccountInfoRequest.encode(T).finish();return this.rpc.request("cosmos.auth.v1beta1.Query","AccountInfo",f).then(A=>e.QueryAccountInfoResponse.decode(new o.BinaryReader(A)))}}e.QueryClientImpl=u})(lm);var Ke={},Fa={},ho={},Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});Ga.concat=void 0;const rP=ar;function iP(...e){const n=new Array,t=new Array,r=new Set;let o=0;function h(){for(;n.length>0;)n.shift().unsubscribe();t.length=0,r.clear(),o=0}const v={start:C=>{e.forEach(J=>t.push([]));function w(J){for(;;){const I=t[J].shift();if(I===void 0)return;C.next(I)}}function D(){return o>=e.length}if(D()){C.complete();return}e.forEach((J,I)=>{n.push(J.subscribe({next:g=>{I===o?C.next(g):t[I].push(g)},complete:()=>{for(r.add(I);r.has(o);)w(o),o++;D()?C.complete():w(o)},error:g=>{C.error(g),h()}}))})},stop:()=>{h()}};return rP.Stream.create(v)}Ga.concat=iP;var La={};Object.defineProperty(La,"__esModule",{value:!0});La.DefaultValueProducer=void 0;class oP{get value(){return this.internalValue}constructor(n,t){this.callbacks=t,this.internalValue=n}update(n){this.internalValue=n,this.listener&&this.listener.next(n)}error(n){this.listener&&this.listener.error(n)}start(n){this.listener=n,n.next(this.internalValue),this.callbacks&&this.callbacks.onStarted()}stop(){this.callbacks&&this.callbacks.onStop(),this.listener=void 0}}La.DefaultValueProducer=oP;var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.dropDuplicates=void 0;function aP(e){return t=>{const r=new Set;return t.filter(h=>!r.has(e(h))).debug(h=>r.add(e(h)))}}$a.dropDuplicates=aP;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.firstEvent=bt.toListPromise=bt.fromListPromise=void 0;const sP=ar;function dP(e){const n={start:t=>{e.then(r=>{for(const o of r)t.next(o);t.complete()}).catch(r=>t.error(r))},stop:()=>{}};return sP.Stream.create(n)}bt.fromListPromise=dP;async function fm(e,n){return new Promise((t,r)=>{if(n===0){t([]);return}const o=new Array;e.take(n).subscribe({next:h=>{o.push(h),o.length===n&&t(o)},complete:()=>{r(`Stream completed before all events could be collected. Collected ${o.length}, expected ${n}`)},error:h=>r(h)})})}bt.toListPromise=fm;async function uP(e){return(await fm(e,1))[0]}bt.firstEvent=uP;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.lastValue=tt.asArray=tt.countStream=tt.Reducer=void 0;class Ka{constructor(n,t,r){this.stream=n,this.reducer=t,this.state=r,this.completed=new Promise((o,h)=>{const v=this.stream.subscribe({next:C=>{this.state=this.reducer(this.state,C)},complete:()=>{o(),v.unsubscribe()},error:C=>{h(C),v.unsubscribe()}})})}value(){return this.state}async finished(){return this.completed}}tt.Reducer=Ka;function cP(e,n){return e+1}function lP(e){return new Ka(e,cP,0)}tt.countStream=lP;function fP(e,n){return[...e,n]}function pP(e){return new Ka(e,fP,[])}tt.asArray=pP;function mP(e,n){return n}function yP(e){return new Ka(e,mP,void 0)}tt.lastValue=yP;var za={};Object.defineProperty(za,"__esModule",{value:!0});za.ValueAndUpdates=void 0;const hP=ar;class gP{get value(){return this.producer.value}constructor(n){this.producer=n,this.updates=hP.MemoryStream.createWithMemory(this.producer)}async waitFor(n){const t=typeof n=="function"?n:r=>r===n;return new Promise((r,o)=>{const h=this.updates.subscribe({next:v=>{t(v)&&(r(v),setTimeout(()=>h.unsubscribe(),0))},complete:()=>{h.unsubscribe(),o("Update stream completed without expected value")},error:v=>{o(v)}})})}}za.ValueAndUpdates=gP;(function(e){var n=x&&x.__createBinding||(Object.create?function(w,D,J,I){I===void 0&&(I=J);var g=Object.getOwnPropertyDescriptor(D,J);(!g||("get"in g?!D.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return D[J]}}),Object.defineProperty(w,I,g)}:function(w,D,J,I){I===void 0&&(I=J),w[I]=D[J]}),t=x&&x.__exportStar||function(w,D){for(var J in w)J!=="default"&&!Object.prototype.hasOwnProperty.call(D,J)&&n(D,w,J)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueAndUpdates=e.toListPromise=e.fromListPromise=e.firstEvent=e.dropDuplicates=e.DefaultValueProducer=e.concat=void 0;var r=Ga;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return r.concat}});var o=La;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var h=$a;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return h.dropDuplicates}});var v=bt;Object.defineProperty(e,"firstEvent",{enumerable:!0,get:function(){return v.firstEvent}}),Object.defineProperty(e,"fromListPromise",{enumerable:!0,get:function(){return v.fromListPromise}}),Object.defineProperty(e,"toListPromise",{enumerable:!0,get:function(){return v.toListPromise}}),t(tt,e);var C=za;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return C.ValueAndUpdates}})})(ho);Object.defineProperty(Fa,"__esModule",{value:!0});Fa.QueryClient=void 0;const Ft=Oh,Kt=de,SP=ho,xe=Oe;function _o(e,n,t){if(e.type!==n)throw new Error(`Op expected to be ${n}, got "${e.type}`);if(!(0,xe.arrayContentEquals)(t,e.key))throw new Error(`Proven key different than queried key.
3
3
  Query: ${(0,Kt.toHex)(t)}
4
4
  Proven: ${(0,Kt.toHex)(e.key)}`);return Ft.ics23.CommitmentProof.decode(e.data)}class Nc{static withExtensions(n,...t){const r=new Nc(n),o=t.map(h=>h(r));for(const h of o){(0,xe.assert)((0,xe.isNonNullObject)(h),"Extension must be a non-null object");for(const[v,C]of Object.entries(h)){(0,xe.assert)((0,xe.isNonNullObject)(C),`Module must be a non-null object. Found type ${typeof C} for module "${v}".`);const w=r[v]||{};r[v]={...w,...C}}}return r}constructor(n){this.cometClient=n}async queryStoreVerified(n,t,r){const{height:o,proof:h,key:v,value:C}=await this.queryRawProof(n,t,r),w=_o(h.ops[0],"ics23:iavl",t),D=_o(h.ops[1],"ics23:simple",(0,Kt.toAscii)(n));(0,xe.assert)(D.exist),(0,xe.assert)(D.exist.value),!C||C.length===0?((0,xe.assert)(w.nonexist),(0,Ft.verifyNonExistence)(w.nonexist,Ft.iavlSpec,D.exist.value,t)):((0,xe.assert)(w.exist),(0,xe.assert)(w.exist.value),(0,Ft.verifyExistence)(w.exist,Ft.iavlSpec,D.exist.value,t,C));const J=await this.getNextHeader(o);return(0,Ft.verifyExistence)(D.exist,Ft.tendermintSpec,J.appHash,(0,Kt.toAscii)(n),D.exist.value),{key:v,value:C,height:o}}async queryRawProof(n,t,r){const{key:o,value:h,height:v,proof:C,code:w,log:D}=await this.cometClient.abciQuery({path:`/store/${n}/key`,data:t,prove:!0,height:r});if(w)throw new Error(`Query failed with (${w}): ${D}`);if(!(0,xe.arrayContentEquals)(t,o))throw new Error(`Response key ${(0,Kt.toHex)(o)} doesn't match query key ${(0,Kt.toHex)(t)}`);if(!v)throw new Error("No query height returned");if(!C||C.ops.length!==2)throw new Error(`Expected 2 proof ops, got ${(C==null?void 0:C.ops.length)??0}. Are you using stargate?`);return _o(C.ops[0],"ics23:iavl",o),_o(C.ops[1],"ics23:simple",(0,Kt.toAscii)(n)),{key:o,value:h,height:v,proof:{ops:[...C.ops]}}}async queryAbci(n,t,r){const o=await this.cometClient.abciQuery({path:n,data:t,prove:!1,height:r});if(o.code)throw new Error(`Query failed with (${o.code}): ${o.log}`);if(!o.height)throw new Error("No query height returned");return{value:o.value,height:o.height}}async getNextHeader(n){if((0,xe.assertDefined)(n),n===0)throw new Error("Query returned height 0, cannot prove it");const t=n+1;let r,o;try{o=this.cometClient.subscribeNewBlockHeader()}catch{}if(o){const h=await(0,SP.firstEvent)(o);h.height===t&&(r=h)}for(;!r;){const h=(await this.cometClient.blockchain(n,t)).blockMetas.map(v=>v.header).find(v=>v.height===t);h?r=h:await(0,xe.sleep)(1e3)}return(0,xe.assert)(r.height===t,"Got wrong header. This is a bug in the logic above."),r}}Fa.QueryClient=Nc;var bn={};Object.defineProperty(bn,"__esModule",{value:!0});bn.decodeCosmosSdkDecFromProto=bn.longify=bn.createProtobufRpcClient=bn.createPagination=bn.toAccAddress=void 0;const pm=de,mm=Te,Jl=be;function kP(e){return(0,pm.fromBech32)(e).data}bn.toAccAddress=kP;function PP(e){return e?Jl.PageRequest.fromPartial({key:e}):Jl.PageRequest.fromPartial({})}bn.createPagination=PP;function RP(e){return{request:async(n,t,r)=>{const o=`/${n}/${t}`;return(await e.queryAbci(o,r,void 0)).value}}}bn.createProtobufRpcClient=RP;function vP(e){const n=mm.Uint64.fromString(e.toString());return BigInt(n.toString())}bn.longify=vP;function BP(e){const n=typeof e=="string"?e:(0,pm.fromAscii)(e);return mm.Decimal.fromAtomics(n,18)}bn.decodeCosmosSdkDecFromProto=BP;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.longify=e.decodeCosmosSdkDecFromProto=e.createProtobufRpcClient=e.createPagination=e.QueryClient=void 0;var n=Fa;Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return n.QueryClient}});var t=bn;Object.defineProperty(e,"createPagination",{enumerable:!0,get:function(){return t.createPagination}}),Object.defineProperty(e,"createProtobufRpcClient",{enumerable:!0,get:function(){return t.createProtobufRpcClient}}),Object.defineProperty(e,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return t.decodeCosmosSdkDecFromProto}}),Object.defineProperty(e,"longify",{enumerable:!0,get:function(){return t.longify}})})(Ke);Object.defineProperty(Wa,"__esModule",{value:!0});Wa.setupAuthExtension=void 0;const bP=lm,OP=Ke;function AP(e){const n=(0,OP.createProtobufRpcClient)(e),t=new bP.QueryClientImpl(n);return{auth:{account:async r=>{const{account:o}=await t.Account({address:r});return o??null}}}}Wa.setupAuthExtension=AP;var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.createAuthzAminoConverters=void 0;function IP(){return{}}Ya.createAuthzAminoConverters=IP;var Za={},ym={},fn={};Object.defineProperty(fn,"__esModule",{value:!0});fn.GrantQueueItem=fn.GrantAuthorization=fn.Grant=fn.GenericAuthorization=fn.protobufPackage=void 0;const Xn=Re,qr=Mn,Jn=ee,Wn=ne;fn.protobufPackage="cosmos.authz.v1beta1";function Dd(){return{msg:""}}fn.GenericAuthorization={typeUrl:"/cosmos.authz.v1beta1.GenericAuthorization",encode(e,n=Jn.BinaryWriter.create()){return e.msg!==""&&n.uint32(10).string(e.msg),n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Dd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.msg=t.string();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Dd();return(0,Wn.isSet)(e.msg)&&(n.msg=String(e.msg)),n},toJSON(e){const n={};return e.msg!==void 0&&(n.msg=e.msg),n},fromPartial(e){const n=Dd();return n.msg=e.msg??"",n}};function Md(){return{authorization:void 0,expiration:void 0}}fn.Grant={typeUrl:"/cosmos.authz.v1beta1.Grant",encode(e,n=Jn.BinaryWriter.create()){return e.authorization!==void 0&&Xn.Any.encode(e.authorization,n.uint32(10).fork()).ldelim(),e.expiration!==void 0&&qr.Timestamp.encode(e.expiration,n.uint32(18).fork()).ldelim(),n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Md();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.authorization=Xn.Any.decode(t,t.uint32());break;case 2:o.expiration=qr.Timestamp.decode(t,t.uint32());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Md();return(0,Wn.isSet)(e.authorization)&&(n.authorization=Xn.Any.fromJSON(e.authorization)),(0,Wn.isSet)(e.expiration)&&(n.expiration=(0,Wn.fromJsonTimestamp)(e.expiration)),n},toJSON(e){const n={};return e.authorization!==void 0&&(n.authorization=e.authorization?Xn.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(n.expiration=(0,Wn.fromTimestamp)(e.expiration).toISOString()),n},fromPartial(e){const n=Md();return e.authorization!==void 0&&e.authorization!==null&&(n.authorization=Xn.Any.fromPartial(e.authorization)),e.expiration!==void 0&&e.expiration!==null&&(n.expiration=qr.Timestamp.fromPartial(e.expiration)),n}};function qd(){return{granter:"",grantee:"",authorization:void 0,expiration:void 0}}fn.GrantAuthorization={typeUrl:"/cosmos.authz.v1beta1.GrantAuthorization",encode(e,n=Jn.BinaryWriter.create()){return e.granter!==""&&n.uint32(10).string(e.granter),e.grantee!==""&&n.uint32(18).string(e.grantee),e.authorization!==void 0&&Xn.Any.encode(e.authorization,n.uint32(26).fork()).ldelim(),e.expiration!==void 0&&qr.Timestamp.encode(e.expiration,n.uint32(34).fork()).ldelim(),n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=qd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.granter=t.string();break;case 2:o.grantee=t.string();break;case 3:o.authorization=Xn.Any.decode(t,t.uint32());break;case 4:o.expiration=qr.Timestamp.decode(t,t.uint32());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=qd();return(0,Wn.isSet)(e.granter)&&(n.granter=String(e.granter)),(0,Wn.isSet)(e.grantee)&&(n.grantee=String(e.grantee)),(0,Wn.isSet)(e.authorization)&&(n.authorization=Xn.Any.fromJSON(e.authorization)),(0,Wn.isSet)(e.expiration)&&(n.expiration=(0,Wn.fromJsonTimestamp)(e.expiration)),n},toJSON(e){const n={};return e.granter!==void 0&&(n.granter=e.granter),e.grantee!==void 0&&(n.grantee=e.grantee),e.authorization!==void 0&&(n.authorization=e.authorization?Xn.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(n.expiration=(0,Wn.fromTimestamp)(e.expiration).toISOString()),n},fromPartial(e){const n=qd();return n.granter=e.granter??"",n.grantee=e.grantee??"",e.authorization!==void 0&&e.authorization!==null&&(n.authorization=Xn.Any.fromPartial(e.authorization)),e.expiration!==void 0&&e.expiration!==null&&(n.expiration=qr.Timestamp.fromPartial(e.expiration)),n}};function Hd(){return{msgTypeUrls:[]}}fn.GrantQueueItem={typeUrl:"/cosmos.authz.v1beta1.GrantQueueItem",encode(e,n=Jn.BinaryWriter.create()){for(const t of e.msgTypeUrls)n.uint32(10).string(t);return n},decode(e,n){const t=e instanceof Jn.BinaryReader?e:new Jn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Hd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.msgTypeUrls.push(t.string());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Hd();return Array.isArray(e==null?void 0:e.msgTypeUrls)&&(n.msgTypeUrls=e.msgTypeUrls.map(t=>String(t))),n},toJSON(e){const n={};return e.msgTypeUrls?n.msgTypeUrls=e.msgTypeUrls.map(t=>t):n.msgTypeUrls=[],n},fromPartial(e){var t;const n=Hd();return n.msgTypeUrls=((t=e.msgTypeUrls)==null?void 0:t.map(r=>r))||[],n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgRevokeResponse=e.MsgRevoke=e.MsgGrantResponse=e.MsgExec=e.MsgExecResponse=e.MsgGrant=e.protobufPackage=void 0;const n=fn,t=Re,r=ee,o=ne;e.protobufPackage="cosmos.authz.v1beta1";function h(){return{granter:"",grantee:"",grant:n.Grant.fromPartial({})}}e.MsgGrant={typeUrl:"/cosmos.authz.v1beta1.MsgGrant",encode(g,R=r.BinaryWriter.create()){return g.granter!==""&&R.uint32(10).string(g.granter),g.grantee!==""&&R.uint32(18).string(g.grantee),g.grant!==void 0&&n.Grant.encode(g.grant,R.uint32(26).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=h();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.granter=B.string();break;case 2:s.grantee=B.string();break;case 3:s.grant=n.Grant.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=h();return(0,o.isSet)(g.granter)&&(R.granter=String(g.granter)),(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),(0,o.isSet)(g.grant)&&(R.grant=n.Grant.fromJSON(g.grant)),R},toJSON(g){const R={};return g.granter!==void 0&&(R.granter=g.granter),g.grantee!==void 0&&(R.grantee=g.grantee),g.grant!==void 0&&(R.grant=g.grant?n.Grant.toJSON(g.grant):void 0),R},fromPartial(g){const R=h();return R.granter=g.granter??"",R.grantee=g.grantee??"",g.grant!==void 0&&g.grant!==null&&(R.grant=n.Grant.fromPartial(g.grant)),R}};function v(){return{results:[]}}e.MsgExecResponse={typeUrl:"/cosmos.authz.v1beta1.MsgExecResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.results)R.uint32(10).bytes(B);return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=v();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.results.push(B.bytes());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=v();return Array.isArray(g==null?void 0:g.results)&&(R.results=g.results.map(B=>(0,o.bytesFromBase64)(B))),R},toJSON(g){const R={};return g.results?R.results=g.results.map(B=>(0,o.base64FromBytes)(B!==void 0?B:new Uint8Array)):R.results=[],R},fromPartial(g){var B;const R=v();return R.results=((B=g.results)==null?void 0:B.map(d=>d))||[],R}};function C(){return{grantee:"",msgs:[]}}e.MsgExec={typeUrl:"/cosmos.authz.v1beta1.MsgExec",encode(g,R=r.BinaryWriter.create()){g.grantee!==""&&R.uint32(10).string(g.grantee);for(const B of g.msgs)t.Any.encode(B,R.uint32(18).fork()).ldelim();return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=C();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.grantee=B.string();break;case 2:s.msgs.push(t.Any.decode(B,B.uint32()));break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=C();return(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),Array.isArray(g==null?void 0:g.msgs)&&(R.msgs=g.msgs.map(B=>t.Any.fromJSON(B))),R},toJSON(g){const R={};return g.grantee!==void 0&&(R.grantee=g.grantee),g.msgs?R.msgs=g.msgs.map(B=>B?t.Any.toJSON(B):void 0):R.msgs=[],R},fromPartial(g){var B;const R=C();return R.grantee=g.grantee??"",R.msgs=((B=g.msgs)==null?void 0:B.map(d=>t.Any.fromPartial(d)))||[],R}};function w(){return{}}e.MsgGrantResponse={typeUrl:"/cosmos.authz.v1beta1.MsgGrantResponse",encode(g,R=r.BinaryWriter.create()){return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=w();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){default:B.skipType(y&7);break}}return s},fromJSON(g){return w()},toJSON(g){return{}},fromPartial(g){return w()}};function D(){return{granter:"",grantee:"",msgTypeUrl:""}}e.MsgRevoke={typeUrl:"/cosmos.authz.v1beta1.MsgRevoke",encode(g,R=r.BinaryWriter.create()){return g.granter!==""&&R.uint32(10).string(g.granter),g.grantee!==""&&R.uint32(18).string(g.grantee),g.msgTypeUrl!==""&&R.uint32(26).string(g.msgTypeUrl),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=D();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.granter=B.string();break;case 2:s.grantee=B.string();break;case 3:s.msgTypeUrl=B.string();break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=D();return(0,o.isSet)(g.granter)&&(R.granter=String(g.granter)),(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),(0,o.isSet)(g.msgTypeUrl)&&(R.msgTypeUrl=String(g.msgTypeUrl)),R},toJSON(g){const R={};return g.granter!==void 0&&(R.granter=g.granter),g.grantee!==void 0&&(R.grantee=g.grantee),g.msgTypeUrl!==void 0&&(R.msgTypeUrl=g.msgTypeUrl),R},fromPartial(g){const R=D();return R.granter=g.granter??"",R.grantee=g.grantee??"",R.msgTypeUrl=g.msgTypeUrl??"",R}};function J(){return{}}e.MsgRevokeResponse={typeUrl:"/cosmos.authz.v1beta1.MsgRevokeResponse",encode(g,R=r.BinaryWriter.create()){return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=J();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){default:B.skipType(y&7);break}}return s},fromJSON(g){return J()},toJSON(g){return{}},fromPartial(g){return J()}};class I{constructor(R){this.rpc=R,this.Grant=this.Grant.bind(this),this.Exec=this.Exec.bind(this),this.Revoke=this.Revoke.bind(this)}Grant(R){const B=e.MsgGrant.encode(R).finish();return this.rpc.request("cosmos.authz.v1beta1.Msg","Grant",B).then(s=>e.MsgGrantResponse.decode(new r.BinaryReader(s)))}Exec(R){const B=e.MsgExec.encode(R).finish();return this.rpc.request("cosmos.authz.v1beta1.Msg","Exec",B).then(s=>e.MsgExecResponse.decode(new r.BinaryReader(s)))}Revoke(R){const B=e.MsgRevoke.encode(R).finish();return this.rpc.request("cosmos.authz.v1beta1.Msg","Revoke",B).then(s=>e.MsgRevokeResponse.decode(new r.BinaryReader(s)))}}e.MsgClientImpl=I})(ym);Object.defineProperty(Za,"__esModule",{value:!0});Za.authzTypes=void 0;const Vd=ym;Za.authzTypes=[["/cosmos.authz.v1beta1.MsgExec",Vd.MsgExec],["/cosmos.authz.v1beta1.MsgGrant",Vd.MsgGrant],["/cosmos.authz.v1beta1.MsgRevoke",Vd.MsgRevoke]];var Xa={},hm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryGranteeGrantsResponse=e.QueryGranteeGrantsRequest=e.QueryGranterGrantsResponse=e.QueryGranterGrantsRequest=e.QueryGrantsResponse=e.QueryGrantsRequest=e.protobufPackage=void 0;const n=be,t=fn,r=ee,o=ne;e.protobufPackage="cosmos.authz.v1beta1";function h(){return{granter:"",grantee:"",msgTypeUrl:"",pagination:void 0}}e.QueryGrantsRequest={typeUrl:"/cosmos.authz.v1beta1.QueryGrantsRequest",encode(g,R=r.BinaryWriter.create()){return g.granter!==""&&R.uint32(10).string(g.granter),g.grantee!==""&&R.uint32(18).string(g.grantee),g.msgTypeUrl!==""&&R.uint32(26).string(g.msgTypeUrl),g.pagination!==void 0&&n.PageRequest.encode(g.pagination,R.uint32(34).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=h();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.granter=B.string();break;case 2:s.grantee=B.string();break;case 3:s.msgTypeUrl=B.string();break;case 4:s.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=h();return(0,o.isSet)(g.granter)&&(R.granter=String(g.granter)),(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),(0,o.isSet)(g.msgTypeUrl)&&(R.msgTypeUrl=String(g.msgTypeUrl)),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageRequest.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.granter!==void 0&&(R.granter=g.granter),g.grantee!==void 0&&(R.grantee=g.grantee),g.msgTypeUrl!==void 0&&(R.msgTypeUrl=g.msgTypeUrl),g.pagination!==void 0&&(R.pagination=g.pagination?n.PageRequest.toJSON(g.pagination):void 0),R},fromPartial(g){const R=h();return R.granter=g.granter??"",R.grantee=g.grantee??"",R.msgTypeUrl=g.msgTypeUrl??"",g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageRequest.fromPartial(g.pagination)),R}};function v(){return{grants:[],pagination:void 0}}e.QueryGrantsResponse={typeUrl:"/cosmos.authz.v1beta1.QueryGrantsResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.grants)t.Grant.encode(B,R.uint32(10).fork()).ldelim();return g.pagination!==void 0&&n.PageResponse.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=v();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.grants.push(t.Grant.decode(B,B.uint32()));break;case 2:s.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=v();return Array.isArray(g==null?void 0:g.grants)&&(R.grants=g.grants.map(B=>t.Grant.fromJSON(B))),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageResponse.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.grants?R.grants=g.grants.map(B=>B?t.Grant.toJSON(B):void 0):R.grants=[],g.pagination!==void 0&&(R.pagination=g.pagination?n.PageResponse.toJSON(g.pagination):void 0),R},fromPartial(g){var B;const R=v();return R.grants=((B=g.grants)==null?void 0:B.map(d=>t.Grant.fromPartial(d)))||[],g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageResponse.fromPartial(g.pagination)),R}};function C(){return{granter:"",pagination:void 0}}e.QueryGranterGrantsRequest={typeUrl:"/cosmos.authz.v1beta1.QueryGranterGrantsRequest",encode(g,R=r.BinaryWriter.create()){return g.granter!==""&&R.uint32(10).string(g.granter),g.pagination!==void 0&&n.PageRequest.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=C();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.granter=B.string();break;case 2:s.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=C();return(0,o.isSet)(g.granter)&&(R.granter=String(g.granter)),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageRequest.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.granter!==void 0&&(R.granter=g.granter),g.pagination!==void 0&&(R.pagination=g.pagination?n.PageRequest.toJSON(g.pagination):void 0),R},fromPartial(g){const R=C();return R.granter=g.granter??"",g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageRequest.fromPartial(g.pagination)),R}};function w(){return{grants:[],pagination:void 0}}e.QueryGranterGrantsResponse={typeUrl:"/cosmos.authz.v1beta1.QueryGranterGrantsResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.grants)t.GrantAuthorization.encode(B,R.uint32(10).fork()).ldelim();return g.pagination!==void 0&&n.PageResponse.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=w();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.grants.push(t.GrantAuthorization.decode(B,B.uint32()));break;case 2:s.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=w();return Array.isArray(g==null?void 0:g.grants)&&(R.grants=g.grants.map(B=>t.GrantAuthorization.fromJSON(B))),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageResponse.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.grants?R.grants=g.grants.map(B=>B?t.GrantAuthorization.toJSON(B):void 0):R.grants=[],g.pagination!==void 0&&(R.pagination=g.pagination?n.PageResponse.toJSON(g.pagination):void 0),R},fromPartial(g){var B;const R=w();return R.grants=((B=g.grants)==null?void 0:B.map(d=>t.GrantAuthorization.fromPartial(d)))||[],g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageResponse.fromPartial(g.pagination)),R}};function D(){return{grantee:"",pagination:void 0}}e.QueryGranteeGrantsRequest={typeUrl:"/cosmos.authz.v1beta1.QueryGranteeGrantsRequest",encode(g,R=r.BinaryWriter.create()){return g.grantee!==""&&R.uint32(10).string(g.grantee),g.pagination!==void 0&&n.PageRequest.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=D();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.grantee=B.string();break;case 2:s.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=D();return(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageRequest.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.grantee!==void 0&&(R.grantee=g.grantee),g.pagination!==void 0&&(R.pagination=g.pagination?n.PageRequest.toJSON(g.pagination):void 0),R},fromPartial(g){const R=D();return R.grantee=g.grantee??"",g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageRequest.fromPartial(g.pagination)),R}};function J(){return{grants:[],pagination:void 0}}e.QueryGranteeGrantsResponse={typeUrl:"/cosmos.authz.v1beta1.QueryGranteeGrantsResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.grants)t.GrantAuthorization.encode(B,R.uint32(10).fork()).ldelim();return g.pagination!==void 0&&n.PageResponse.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=J();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.grants.push(t.GrantAuthorization.decode(B,B.uint32()));break;case 2:s.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=J();return Array.isArray(g==null?void 0:g.grants)&&(R.grants=g.grants.map(B=>t.GrantAuthorization.fromJSON(B))),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageResponse.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.grants?R.grants=g.grants.map(B=>B?t.GrantAuthorization.toJSON(B):void 0):R.grants=[],g.pagination!==void 0&&(R.pagination=g.pagination?n.PageResponse.toJSON(g.pagination):void 0),R},fromPartial(g){var B;const R=J();return R.grants=((B=g.grants)==null?void 0:B.map(d=>t.GrantAuthorization.fromPartial(d)))||[],g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageResponse.fromPartial(g.pagination)),R}};class I{constructor(R){this.rpc=R,this.Grants=this.Grants.bind(this),this.GranterGrants=this.GranterGrants.bind(this),this.GranteeGrants=this.GranteeGrants.bind(this)}Grants(R){const B=e.QueryGrantsRequest.encode(R).finish();return this.rpc.request("cosmos.authz.v1beta1.Query","Grants",B).then(s=>e.QueryGrantsResponse.decode(new r.BinaryReader(s)))}GranterGrants(R){const B=e.QueryGranterGrantsRequest.encode(R).finish();return this.rpc.request("cosmos.authz.v1beta1.Query","GranterGrants",B).then(s=>e.QueryGranterGrantsResponse.decode(new r.BinaryReader(s)))}GranteeGrants(R){const B=e.QueryGranteeGrantsRequest.encode(R).finish();return this.rpc.request("cosmos.authz.v1beta1.Query","GranteeGrants",B).then(s=>e.QueryGranteeGrantsResponse.decode(new r.BinaryReader(s)))}}e.QueryClientImpl=I})(hm);Object.defineProperty(Xa,"__esModule",{value:!0});Xa.setupAuthzExtension=void 0;const TP=hm,Uo=Ke;function CP(e){const n=(0,Uo.createProtobufRpcClient)(e),t=new TP.QueryClientImpl(n);return{authz:{grants:async(r,o,h,v)=>await t.Grants({granter:r,grantee:o,msgTypeUrl:h,pagination:(0,Uo.createPagination)(v)}),granteeGrants:async(r,o)=>await t.GranteeGrants({grantee:r,pagination:(0,Uo.createPagination)(o)}),granterGrants:async(r,o)=>await t.GranterGrants({granter:r,pagination:(0,Uo.createPagination)(o)})}}}Xa.setupAuthzExtension=CP;var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.createBankAminoConverters=Ot.isAminoMsgMultiSend=Ot.isAminoMsgSend=void 0;function NP(e){return e.type==="cosmos-sdk/MsgSend"}Ot.isAminoMsgSend=NP;function wP(e){return e.type==="cosmos-sdk/MsgMultiSend"}Ot.isAminoMsgMultiSend=wP;function EP(){return{"/cosmos.bank.v1beta1.MsgSend":{aminoType:"cosmos-sdk/MsgSend",toAmino:({fromAddress:e,toAddress:n,amount:t})=>({from_address:e,to_address:n,amount:[...t]}),fromAmino:({from_address:e,to_address:n,amount:t})=>({fromAddress:e,toAddress:n,amount:[...t]})},"/cosmos.bank.v1beta1.MsgMultiSend":{aminoType:"cosmos-sdk/MsgMultiSend",toAmino:({inputs:e,outputs:n})=>({inputs:e.map(t=>({address:t.address,coins:[...t.coins]})),outputs:n.map(t=>({address:t.address,coins:[...t.coins]}))}),fromAmino:({inputs:e,outputs:n})=>({inputs:e.map(t=>({address:t.address,coins:[...t.coins]})),outputs:n.map(t=>({address:t.address,coins:[...t.coins]}))})}}}Ot.createBankAminoConverters=EP;var ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.isMsgSendEncodeObject=ri.bankTypes=void 0;const Dl=Oc;ri.bankTypes=[["/cosmos.bank.v1beta1.MsgMultiSend",Dl.MsgMultiSend],["/cosmos.bank.v1beta1.MsgSend",Dl.MsgSend]];function _P(e){return e.typeUrl==="/cosmos.bank.v1beta1.MsgSend"}ri.isMsgSendEncodeObject=_P;var xa={},gm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QuerySendEnabledResponse=e.QuerySendEnabledRequest=e.QueryDenomOwnersResponse=e.DenomOwner=e.QueryDenomOwnersRequest=e.QueryDenomMetadataResponse=e.QueryDenomMetadataRequest=e.QueryDenomsMetadataResponse=e.QueryDenomsMetadataRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QuerySupplyOfResponse=e.QuerySupplyOfRequest=e.QueryTotalSupplyResponse=e.QueryTotalSupplyRequest=e.QuerySpendableBalanceByDenomResponse=e.QuerySpendableBalanceByDenomRequest=e.QuerySpendableBalancesResponse=e.QuerySpendableBalancesRequest=e.QueryAllBalancesResponse=e.QueryAllBalancesRequest=e.QueryBalanceResponse=e.QueryBalanceRequest=e.protobufPackage=void 0;const n=be,t=Me,r=Ac,o=ee,h=ne;e.protobufPackage="cosmos.bank.v1beta1";function v(){return{address:"",denom:""}}e.QueryBalanceRequest={typeUrl:"/cosmos.bank.v1beta1.QueryBalanceRequest",encode(p,A=o.BinaryWriter.create()){return p.address!==""&&A.uint32(10).string(p.address),p.denom!==""&&A.uint32(18).string(p.denom),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=v();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.address=Q.string();break;case 2:a.denom=Q.string();break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=v();return(0,h.isSet)(p.address)&&(A.address=String(p.address)),(0,h.isSet)(p.denom)&&(A.denom=String(p.denom)),A},toJSON(p){const A={};return p.address!==void 0&&(A.address=p.address),p.denom!==void 0&&(A.denom=p.denom),A},fromPartial(p){const A=v();return A.address=p.address??"",A.denom=p.denom??"",A}};function C(){return{balance:void 0}}e.QueryBalanceResponse={typeUrl:"/cosmos.bank.v1beta1.QueryBalanceResponse",encode(p,A=o.BinaryWriter.create()){return p.balance!==void 0&&t.Coin.encode(p.balance,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=C();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.balance=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=C();return(0,h.isSet)(p.balance)&&(A.balance=t.Coin.fromJSON(p.balance)),A},toJSON(p){const A={};return p.balance!==void 0&&(A.balance=p.balance?t.Coin.toJSON(p.balance):void 0),A},fromPartial(p){const A=C();return p.balance!==void 0&&p.balance!==null&&(A.balance=t.Coin.fromPartial(p.balance)),A}};function w(){return{address:"",pagination:void 0}}e.QueryAllBalancesRequest={typeUrl:"/cosmos.bank.v1beta1.QueryAllBalancesRequest",encode(p,A=o.BinaryWriter.create()){return p.address!==""&&A.uint32(10).string(p.address),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=w();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.address=Q.string();break;case 2:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=w();return(0,h.isSet)(p.address)&&(A.address=String(p.address)),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageRequest.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.address!==void 0&&(A.address=p.address),p.pagination!==void 0&&(A.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),A},fromPartial(p){const A=w();return A.address=p.address??"",p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageRequest.fromPartial(p.pagination)),A}};function D(){return{balances:[],pagination:void 0}}e.QueryAllBalancesResponse={typeUrl:"/cosmos.bank.v1beta1.QueryAllBalancesResponse",encode(p,A=o.BinaryWriter.create()){for(const Q of p.balances)t.Coin.encode(Q,A.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=D();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.balances.push(t.Coin.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=D();return Array.isArray(p==null?void 0:p.balances)&&(A.balances=p.balances.map(Q=>t.Coin.fromJSON(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageResponse.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.balances?A.balances=p.balances.map(Q=>Q?t.Coin.toJSON(Q):void 0):A.balances=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=D();return A.balances=((Q=p.balances)==null?void 0:Q.map(M=>t.Coin.fromPartial(M)))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageResponse.fromPartial(p.pagination)),A}};function J(){return{address:"",pagination:void 0}}e.QuerySpendableBalancesRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalancesRequest",encode(p,A=o.BinaryWriter.create()){return p.address!==""&&A.uint32(10).string(p.address),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=J();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.address=Q.string();break;case 2:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=J();return(0,h.isSet)(p.address)&&(A.address=String(p.address)),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageRequest.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.address!==void 0&&(A.address=p.address),p.pagination!==void 0&&(A.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),A},fromPartial(p){const A=J();return A.address=p.address??"",p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageRequest.fromPartial(p.pagination)),A}};function I(){return{balances:[],pagination:void 0}}e.QuerySpendableBalancesResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalancesResponse",encode(p,A=o.BinaryWriter.create()){for(const Q of p.balances)t.Coin.encode(Q,A.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=I();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.balances.push(t.Coin.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=I();return Array.isArray(p==null?void 0:p.balances)&&(A.balances=p.balances.map(Q=>t.Coin.fromJSON(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageResponse.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.balances?A.balances=p.balances.map(Q=>Q?t.Coin.toJSON(Q):void 0):A.balances=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=I();return A.balances=((Q=p.balances)==null?void 0:Q.map(M=>t.Coin.fromPartial(M)))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageResponse.fromPartial(p.pagination)),A}};function g(){return{address:"",denom:""}}e.QuerySpendableBalanceByDenomRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomRequest",encode(p,A=o.BinaryWriter.create()){return p.address!==""&&A.uint32(10).string(p.address),p.denom!==""&&A.uint32(18).string(p.denom),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=g();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.address=Q.string();break;case 2:a.denom=Q.string();break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=g();return(0,h.isSet)(p.address)&&(A.address=String(p.address)),(0,h.isSet)(p.denom)&&(A.denom=String(p.denom)),A},toJSON(p){const A={};return p.address!==void 0&&(A.address=p.address),p.denom!==void 0&&(A.denom=p.denom),A},fromPartial(p){const A=g();return A.address=p.address??"",A.denom=p.denom??"",A}};function R(){return{balance:void 0}}e.QuerySpendableBalanceByDenomResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySpendableBalanceByDenomResponse",encode(p,A=o.BinaryWriter.create()){return p.balance!==void 0&&t.Coin.encode(p.balance,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=R();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.balance=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=R();return(0,h.isSet)(p.balance)&&(A.balance=t.Coin.fromJSON(p.balance)),A},toJSON(p){const A={};return p.balance!==void 0&&(A.balance=p.balance?t.Coin.toJSON(p.balance):void 0),A},fromPartial(p){const A=R();return p.balance!==void 0&&p.balance!==null&&(A.balance=t.Coin.fromPartial(p.balance)),A}};function B(){return{pagination:void 0}}e.QueryTotalSupplyRequest={typeUrl:"/cosmos.bank.v1beta1.QueryTotalSupplyRequest",encode(p,A=o.BinaryWriter.create()){return p.pagination!==void 0&&n.PageRequest.encode(p.pagination,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=B();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=B();return(0,h.isSet)(p.pagination)&&(A.pagination=n.PageRequest.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.pagination!==void 0&&(A.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),A},fromPartial(p){const A=B();return p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageRequest.fromPartial(p.pagination)),A}};function d(){return{supply:[],pagination:void 0}}e.QueryTotalSupplyResponse={typeUrl:"/cosmos.bank.v1beta1.QueryTotalSupplyResponse",encode(p,A=o.BinaryWriter.create()){for(const Q of p.supply)t.Coin.encode(Q,A.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=d();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.supply.push(t.Coin.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=d();return Array.isArray(p==null?void 0:p.supply)&&(A.supply=p.supply.map(Q=>t.Coin.fromJSON(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageResponse.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.supply?A.supply=p.supply.map(Q=>Q?t.Coin.toJSON(Q):void 0):A.supply=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=d();return A.supply=((Q=p.supply)==null?void 0:Q.map(M=>t.Coin.fromPartial(M)))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageResponse.fromPartial(p.pagination)),A}};function s(){return{denom:""}}e.QuerySupplyOfRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySupplyOfRequest",encode(p,A=o.BinaryWriter.create()){return p.denom!==""&&A.uint32(10).string(p.denom),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=s();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.denom=Q.string();break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=s();return(0,h.isSet)(p.denom)&&(A.denom=String(p.denom)),A},toJSON(p){const A={};return p.denom!==void 0&&(A.denom=p.denom),A},fromPartial(p){const A=s();return A.denom=p.denom??"",A}};function y(){return{amount:t.Coin.fromPartial({})}}e.QuerySupplyOfResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySupplyOfResponse",encode(p,A=o.BinaryWriter.create()){return p.amount!==void 0&&t.Coin.encode(p.amount,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=y();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.amount=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=y();return(0,h.isSet)(p.amount)&&(A.amount=t.Coin.fromJSON(p.amount)),A},toJSON(p){const A={};return p.amount!==void 0&&(A.amount=p.amount?t.Coin.toJSON(p.amount):void 0),A},fromPartial(p){const A=y();return p.amount!==void 0&&p.amount!==null&&(A.amount=t.Coin.fromPartial(p.amount)),A}};function E(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.bank.v1beta1.QueryParamsRequest",encode(p,A=o.BinaryWriter.create()){return A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=E();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){default:Q.skipType(k&7);break}}return a},fromJSON(p){return E()},toJSON(p){return{}},fromPartial(p){return E()}};function _(){return{params:r.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.bank.v1beta1.QueryParamsResponse",encode(p,A=o.BinaryWriter.create()){return p.params!==void 0&&r.Params.encode(p.params,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=_();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.params=r.Params.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=_();return(0,h.isSet)(p.params)&&(A.params=r.Params.fromJSON(p.params)),A},toJSON(p){const A={};return p.params!==void 0&&(A.params=p.params?r.Params.toJSON(p.params):void 0),A},fromPartial(p){const A=_();return p.params!==void 0&&p.params!==null&&(A.params=r.Params.fromPartial(p.params)),A}};function U(){return{pagination:void 0}}e.QueryDenomsMetadataRequest={typeUrl:"/cosmos.bank.v1beta1.QueryDenomsMetadataRequest",encode(p,A=o.BinaryWriter.create()){return p.pagination!==void 0&&n.PageRequest.encode(p.pagination,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=U();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=U();return(0,h.isSet)(p.pagination)&&(A.pagination=n.PageRequest.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.pagination!==void 0&&(A.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),A},fromPartial(p){const A=U();return p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageRequest.fromPartial(p.pagination)),A}};function H(){return{metadatas:[],pagination:void 0}}e.QueryDenomsMetadataResponse={typeUrl:"/cosmos.bank.v1beta1.QueryDenomsMetadataResponse",encode(p,A=o.BinaryWriter.create()){for(const Q of p.metadatas)r.Metadata.encode(Q,A.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=H();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.metadatas.push(r.Metadata.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=H();return Array.isArray(p==null?void 0:p.metadatas)&&(A.metadatas=p.metadatas.map(Q=>r.Metadata.fromJSON(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageResponse.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.metadatas?A.metadatas=p.metadatas.map(Q=>Q?r.Metadata.toJSON(Q):void 0):A.metadatas=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=H();return A.metadatas=((Q=p.metadatas)==null?void 0:Q.map(M=>r.Metadata.fromPartial(M)))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageResponse.fromPartial(p.pagination)),A}};function i(){return{denom:""}}e.QueryDenomMetadataRequest={typeUrl:"/cosmos.bank.v1beta1.QueryDenomMetadataRequest",encode(p,A=o.BinaryWriter.create()){return p.denom!==""&&A.uint32(10).string(p.denom),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=i();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.denom=Q.string();break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=i();return(0,h.isSet)(p.denom)&&(A.denom=String(p.denom)),A},toJSON(p){const A={};return p.denom!==void 0&&(A.denom=p.denom),A},fromPartial(p){const A=i();return A.denom=p.denom??"",A}};function m(){return{metadata:r.Metadata.fromPartial({})}}e.QueryDenomMetadataResponse={typeUrl:"/cosmos.bank.v1beta1.QueryDenomMetadataResponse",encode(p,A=o.BinaryWriter.create()){return p.metadata!==void 0&&r.Metadata.encode(p.metadata,A.uint32(10).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=m();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.metadata=r.Metadata.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=m();return(0,h.isSet)(p.metadata)&&(A.metadata=r.Metadata.fromJSON(p.metadata)),A},toJSON(p){const A={};return p.metadata!==void 0&&(A.metadata=p.metadata?r.Metadata.toJSON(p.metadata):void 0),A},fromPartial(p){const A=m();return p.metadata!==void 0&&p.metadata!==null&&(A.metadata=r.Metadata.fromPartial(p.metadata)),A}};function N(){return{denom:"",pagination:void 0}}e.QueryDenomOwnersRequest={typeUrl:"/cosmos.bank.v1beta1.QueryDenomOwnersRequest",encode(p,A=o.BinaryWriter.create()){return p.denom!==""&&A.uint32(10).string(p.denom),p.pagination!==void 0&&n.PageRequest.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=N();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.denom=Q.string();break;case 2:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=N();return(0,h.isSet)(p.denom)&&(A.denom=String(p.denom)),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageRequest.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.denom!==void 0&&(A.denom=p.denom),p.pagination!==void 0&&(A.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),A},fromPartial(p){const A=N();return A.denom=p.denom??"",p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageRequest.fromPartial(p.pagination)),A}};function V(){return{address:"",balance:t.Coin.fromPartial({})}}e.DenomOwner={typeUrl:"/cosmos.bank.v1beta1.DenomOwner",encode(p,A=o.BinaryWriter.create()){return p.address!==""&&A.uint32(10).string(p.address),p.balance!==void 0&&t.Coin.encode(p.balance,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=V();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.address=Q.string();break;case 2:a.balance=t.Coin.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=V();return(0,h.isSet)(p.address)&&(A.address=String(p.address)),(0,h.isSet)(p.balance)&&(A.balance=t.Coin.fromJSON(p.balance)),A},toJSON(p){const A={};return p.address!==void 0&&(A.address=p.address),p.balance!==void 0&&(A.balance=p.balance?t.Coin.toJSON(p.balance):void 0),A},fromPartial(p){const A=V();return A.address=p.address??"",p.balance!==void 0&&p.balance!==null&&(A.balance=t.Coin.fromPartial(p.balance)),A}};function u(){return{denomOwners:[],pagination:void 0}}e.QueryDenomOwnersResponse={typeUrl:"/cosmos.bank.v1beta1.QueryDenomOwnersResponse",encode(p,A=o.BinaryWriter.create()){for(const Q of p.denomOwners)e.DenomOwner.encode(Q,A.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,A.uint32(18).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=u();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.denomOwners.push(e.DenomOwner.decode(Q,Q.uint32()));break;case 2:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=u();return Array.isArray(p==null?void 0:p.denomOwners)&&(A.denomOwners=p.denomOwners.map(Q=>e.DenomOwner.fromJSON(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageResponse.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.denomOwners?A.denomOwners=p.denomOwners.map(Q=>Q?e.DenomOwner.toJSON(Q):void 0):A.denomOwners=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=u();return A.denomOwners=((Q=p.denomOwners)==null?void 0:Q.map(M=>e.DenomOwner.fromPartial(M)))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageResponse.fromPartial(p.pagination)),A}};function l(){return{denoms:[],pagination:void 0}}e.QuerySendEnabledRequest={typeUrl:"/cosmos.bank.v1beta1.QuerySendEnabledRequest",encode(p,A=o.BinaryWriter.create()){for(const Q of p.denoms)A.uint32(10).string(Q);return p.pagination!==void 0&&n.PageRequest.encode(p.pagination,A.uint32(794).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=l();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.denoms.push(Q.string());break;case 99:a.pagination=n.PageRequest.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=l();return Array.isArray(p==null?void 0:p.denoms)&&(A.denoms=p.denoms.map(Q=>String(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageRequest.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.denoms?A.denoms=p.denoms.map(Q=>Q):A.denoms=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageRequest.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=l();return A.denoms=((Q=p.denoms)==null?void 0:Q.map(M=>M))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageRequest.fromPartial(p.pagination)),A}};function T(){return{sendEnabled:[],pagination:void 0}}e.QuerySendEnabledResponse={typeUrl:"/cosmos.bank.v1beta1.QuerySendEnabledResponse",encode(p,A=o.BinaryWriter.create()){for(const Q of p.sendEnabled)r.SendEnabled.encode(Q,A.uint32(10).fork()).ldelim();return p.pagination!==void 0&&n.PageResponse.encode(p.pagination,A.uint32(794).fork()).ldelim(),A},decode(p,A){const Q=p instanceof o.BinaryReader?p:new o.BinaryReader(p);let M=A===void 0?Q.len:Q.pos+A;const a=T();for(;Q.pos<M;){const k=Q.uint32();switch(k>>>3){case 1:a.sendEnabled.push(r.SendEnabled.decode(Q,Q.uint32()));break;case 99:a.pagination=n.PageResponse.decode(Q,Q.uint32());break;default:Q.skipType(k&7);break}}return a},fromJSON(p){const A=T();return Array.isArray(p==null?void 0:p.sendEnabled)&&(A.sendEnabled=p.sendEnabled.map(Q=>r.SendEnabled.fromJSON(Q))),(0,h.isSet)(p.pagination)&&(A.pagination=n.PageResponse.fromJSON(p.pagination)),A},toJSON(p){const A={};return p.sendEnabled?A.sendEnabled=p.sendEnabled.map(Q=>Q?r.SendEnabled.toJSON(Q):void 0):A.sendEnabled=[],p.pagination!==void 0&&(A.pagination=p.pagination?n.PageResponse.toJSON(p.pagination):void 0),A},fromPartial(p){var Q;const A=T();return A.sendEnabled=((Q=p.sendEnabled)==null?void 0:Q.map(M=>r.SendEnabled.fromPartial(M)))||[],p.pagination!==void 0&&p.pagination!==null&&(A.pagination=n.PageResponse.fromPartial(p.pagination)),A}};class f{constructor(A){this.rpc=A,this.Balance=this.Balance.bind(this),this.AllBalances=this.AllBalances.bind(this),this.SpendableBalances=this.SpendableBalances.bind(this),this.SpendableBalanceByDenom=this.SpendableBalanceByDenom.bind(this),this.TotalSupply=this.TotalSupply.bind(this),this.SupplyOf=this.SupplyOf.bind(this),this.Params=this.Params.bind(this),this.DenomMetadata=this.DenomMetadata.bind(this),this.DenomsMetadata=this.DenomsMetadata.bind(this),this.DenomOwners=this.DenomOwners.bind(this),this.SendEnabled=this.SendEnabled.bind(this)}Balance(A){const Q=e.QueryBalanceRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","Balance",Q).then(a=>e.QueryBalanceResponse.decode(new o.BinaryReader(a)))}AllBalances(A){const Q=e.QueryAllBalancesRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","AllBalances",Q).then(a=>e.QueryAllBalancesResponse.decode(new o.BinaryReader(a)))}SpendableBalances(A){const Q=e.QuerySpendableBalancesRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SpendableBalances",Q).then(a=>e.QuerySpendableBalancesResponse.decode(new o.BinaryReader(a)))}SpendableBalanceByDenom(A){const Q=e.QuerySpendableBalanceByDenomRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SpendableBalanceByDenom",Q).then(a=>e.QuerySpendableBalanceByDenomResponse.decode(new o.BinaryReader(a)))}TotalSupply(A={pagination:n.PageRequest.fromPartial({})}){const Q=e.QueryTotalSupplyRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","TotalSupply",Q).then(a=>e.QueryTotalSupplyResponse.decode(new o.BinaryReader(a)))}SupplyOf(A){const Q=e.QuerySupplyOfRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SupplyOf",Q).then(a=>e.QuerySupplyOfResponse.decode(new o.BinaryReader(a)))}Params(A={}){const Q=e.QueryParamsRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","Params",Q).then(a=>e.QueryParamsResponse.decode(new o.BinaryReader(a)))}DenomMetadata(A){const Q=e.QueryDenomMetadataRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","DenomMetadata",Q).then(a=>e.QueryDenomMetadataResponse.decode(new o.BinaryReader(a)))}DenomsMetadata(A={pagination:n.PageRequest.fromPartial({})}){const Q=e.QueryDenomsMetadataRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","DenomsMetadata",Q).then(a=>e.QueryDenomsMetadataResponse.decode(new o.BinaryReader(a)))}DenomOwners(A){const Q=e.QueryDenomOwnersRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","DenomOwners",Q).then(a=>e.QueryDenomOwnersResponse.decode(new o.BinaryReader(a)))}SendEnabled(A){const Q=e.QuerySendEnabledRequest.encode(A).finish();return this.rpc.request("cosmos.bank.v1beta1.Query","SendEnabled",Q).then(a=>e.QuerySendEnabledResponse.decode(new o.BinaryReader(a)))}}e.QueryClientImpl=f})(gm);Object.defineProperty(xa,"__esModule",{value:!0});xa.setupBankExtension=void 0;const Qd=Oe,Wd=gm,Ml=Ke;function UP(e){const n=(0,Ml.createProtobufRpcClient)(e),t=new Wd.QueryClientImpl(n);return{bank:{balance:async(r,o)=>{const{balance:h}=await t.Balance({address:r,denom:o});return(0,Qd.assert)(h),h},allBalances:async r=>{const{balances:o}=await t.AllBalances(Wd.QueryAllBalancesRequest.fromPartial({address:r}));return o},totalSupply:async r=>await t.TotalSupply({pagination:(0,Ml.createPagination)(r)}),supplyOf:async r=>{const{amount:o}=await t.SupplyOf({denom:r});return(0,Qd.assert)(o),o},denomMetadata:async r=>{const{metadata:o}=await t.DenomMetadata({denom:r});return(0,Qd.assert)(o),o},denomsMetadata:async()=>{const{metadatas:r}=await t.DenomsMetadata(Wd.QueryDenomsMetadataRequest.fromPartial({pagination:void 0}));return r}}}}xa.setupBankExtension=UP;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.createCrysisAminoConverters=ii.isAminoMsgVerifyInvariant=void 0;function JP(e){return e.type==="cosmos-sdk/MsgVerifyInvariant"}ii.isAminoMsgVerifyInvariant=JP;function DP(){throw new Error("Not implemented")}ii.createCrysisAminoConverters=DP;var On={};Object.defineProperty(On,"__esModule",{value:!0});On.createDistributionAminoConverters=On.isAminoMsgFundCommunityPool=On.isAminoMsgWithdrawValidatorCommission=On.isAminoMsgWithdrawDelegatorReward=On.isAminoMsgSetWithdrawAddress=void 0;function MP(e){return e.type==="cosmos-sdk/MsgModifyWithdrawAddress"}On.isAminoMsgSetWithdrawAddress=MP;function qP(e){return e.type==="cosmos-sdk/MsgWithdrawDelegationReward"}On.isAminoMsgWithdrawDelegatorReward=qP;function HP(e){return e.type==="cosmos-sdk/MsgWithdrawValidatorCommission"}On.isAminoMsgWithdrawValidatorCommission=HP;function VP(e){return e.type==="cosmos-sdk/MsgFundCommunityPool"}On.isAminoMsgFundCommunityPool=VP;function QP(){return{"/cosmos.distribution.v1beta1.MsgFundCommunityPool":{aminoType:"cosmos-sdk/MsgFundCommunityPool",toAmino:({amount:e,depositor:n})=>({amount:[...e],depositor:n}),fromAmino:({amount:e,depositor:n})=>({amount:[...e],depositor:n})},"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress":{aminoType:"cosmos-sdk/MsgModifyWithdrawAddress",toAmino:({delegatorAddress:e,withdrawAddress:n})=>({delegator_address:e,withdraw_address:n}),fromAmino:({delegator_address:e,withdraw_address:n})=>({delegatorAddress:e,withdrawAddress:n})},"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward":{aminoType:"cosmos-sdk/MsgWithdrawDelegationReward",toAmino:({delegatorAddress:e,validatorAddress:n})=>({delegator_address:e,validator_address:n}),fromAmino:({delegator_address:e,validator_address:n})=>({delegatorAddress:e,validatorAddress:n})},"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission":{aminoType:"cosmos-sdk/MsgWithdrawValidatorCommission",toAmino:({validatorAddress:e})=>({validator_address:e}),fromAmino:({validator_address:e})=>({validatorAddress:e})}}}On.createDistributionAminoConverters=QP;var oi={},ja={},wc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CommunityPoolSpendProposalWithDeposit=e.DelegationDelegatorReward=e.DelegatorStartingInfo=e.CommunityPoolSpendProposal=e.FeePool=e.ValidatorSlashEvents=e.ValidatorSlashEvent=e.ValidatorOutstandingRewards=e.ValidatorAccumulatedCommission=e.ValidatorCurrentRewards=e.ValidatorHistoricalRewards=e.Params=e.protobufPackage=void 0;const n=Me,t=ee,r=ne;e.protobufPackage="cosmos.distribution.v1beta1";function o(){return{communityTax:"",baseProposerReward:"",bonusProposerReward:"",withdrawAddrEnabled:!1}}e.Params={typeUrl:"/cosmos.distribution.v1beta1.Params",encode(s,y=t.BinaryWriter.create()){return s.communityTax!==""&&y.uint32(10).string(s.communityTax),s.baseProposerReward!==""&&y.uint32(18).string(s.baseProposerReward),s.bonusProposerReward!==""&&y.uint32(26).string(s.bonusProposerReward),s.withdrawAddrEnabled===!0&&y.uint32(32).bool(s.withdrawAddrEnabled),y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=o();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.communityTax=E.string();break;case 2:U.baseProposerReward=E.string();break;case 3:U.bonusProposerReward=E.string();break;case 4:U.withdrawAddrEnabled=E.bool();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=o();return(0,r.isSet)(s.communityTax)&&(y.communityTax=String(s.communityTax)),(0,r.isSet)(s.baseProposerReward)&&(y.baseProposerReward=String(s.baseProposerReward)),(0,r.isSet)(s.bonusProposerReward)&&(y.bonusProposerReward=String(s.bonusProposerReward)),(0,r.isSet)(s.withdrawAddrEnabled)&&(y.withdrawAddrEnabled=!!s.withdrawAddrEnabled),y},toJSON(s){const y={};return s.communityTax!==void 0&&(y.communityTax=s.communityTax),s.baseProposerReward!==void 0&&(y.baseProposerReward=s.baseProposerReward),s.bonusProposerReward!==void 0&&(y.bonusProposerReward=s.bonusProposerReward),s.withdrawAddrEnabled!==void 0&&(y.withdrawAddrEnabled=s.withdrawAddrEnabled),y},fromPartial(s){const y=o();return y.communityTax=s.communityTax??"",y.baseProposerReward=s.baseProposerReward??"",y.bonusProposerReward=s.bonusProposerReward??"",y.withdrawAddrEnabled=s.withdrawAddrEnabled??!1,y}};function h(){return{cumulativeRewardRatio:[],referenceCount:0}}e.ValidatorHistoricalRewards={typeUrl:"/cosmos.distribution.v1beta1.ValidatorHistoricalRewards",encode(s,y=t.BinaryWriter.create()){for(const E of s.cumulativeRewardRatio)n.DecCoin.encode(E,y.uint32(10).fork()).ldelim();return s.referenceCount!==0&&y.uint32(16).uint32(s.referenceCount),y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=h();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.cumulativeRewardRatio.push(n.DecCoin.decode(E,E.uint32()));break;case 2:U.referenceCount=E.uint32();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=h();return Array.isArray(s==null?void 0:s.cumulativeRewardRatio)&&(y.cumulativeRewardRatio=s.cumulativeRewardRatio.map(E=>n.DecCoin.fromJSON(E))),(0,r.isSet)(s.referenceCount)&&(y.referenceCount=Number(s.referenceCount)),y},toJSON(s){const y={};return s.cumulativeRewardRatio?y.cumulativeRewardRatio=s.cumulativeRewardRatio.map(E=>E?n.DecCoin.toJSON(E):void 0):y.cumulativeRewardRatio=[],s.referenceCount!==void 0&&(y.referenceCount=Math.round(s.referenceCount)),y},fromPartial(s){var E;const y=h();return y.cumulativeRewardRatio=((E=s.cumulativeRewardRatio)==null?void 0:E.map(_=>n.DecCoin.fromPartial(_)))||[],y.referenceCount=s.referenceCount??0,y}};function v(){return{rewards:[],period:BigInt(0)}}e.ValidatorCurrentRewards={typeUrl:"/cosmos.distribution.v1beta1.ValidatorCurrentRewards",encode(s,y=t.BinaryWriter.create()){for(const E of s.rewards)n.DecCoin.encode(E,y.uint32(10).fork()).ldelim();return s.period!==BigInt(0)&&y.uint32(16).uint64(s.period),y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=v();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.rewards.push(n.DecCoin.decode(E,E.uint32()));break;case 2:U.period=E.uint64();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=v();return Array.isArray(s==null?void 0:s.rewards)&&(y.rewards=s.rewards.map(E=>n.DecCoin.fromJSON(E))),(0,r.isSet)(s.period)&&(y.period=BigInt(s.period.toString())),y},toJSON(s){const y={};return s.rewards?y.rewards=s.rewards.map(E=>E?n.DecCoin.toJSON(E):void 0):y.rewards=[],s.period!==void 0&&(y.period=(s.period||BigInt(0)).toString()),y},fromPartial(s){var E;const y=v();return y.rewards=((E=s.rewards)==null?void 0:E.map(_=>n.DecCoin.fromPartial(_)))||[],s.period!==void 0&&s.period!==null&&(y.period=BigInt(s.period.toString())),y}};function C(){return{commission:[]}}e.ValidatorAccumulatedCommission={typeUrl:"/cosmos.distribution.v1beta1.ValidatorAccumulatedCommission",encode(s,y=t.BinaryWriter.create()){for(const E of s.commission)n.DecCoin.encode(E,y.uint32(10).fork()).ldelim();return y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=C();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.commission.push(n.DecCoin.decode(E,E.uint32()));break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=C();return Array.isArray(s==null?void 0:s.commission)&&(y.commission=s.commission.map(E=>n.DecCoin.fromJSON(E))),y},toJSON(s){const y={};return s.commission?y.commission=s.commission.map(E=>E?n.DecCoin.toJSON(E):void 0):y.commission=[],y},fromPartial(s){var E;const y=C();return y.commission=((E=s.commission)==null?void 0:E.map(_=>n.DecCoin.fromPartial(_)))||[],y}};function w(){return{rewards:[]}}e.ValidatorOutstandingRewards={typeUrl:"/cosmos.distribution.v1beta1.ValidatorOutstandingRewards",encode(s,y=t.BinaryWriter.create()){for(const E of s.rewards)n.DecCoin.encode(E,y.uint32(10).fork()).ldelim();return y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=w();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.rewards.push(n.DecCoin.decode(E,E.uint32()));break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=w();return Array.isArray(s==null?void 0:s.rewards)&&(y.rewards=s.rewards.map(E=>n.DecCoin.fromJSON(E))),y},toJSON(s){const y={};return s.rewards?y.rewards=s.rewards.map(E=>E?n.DecCoin.toJSON(E):void 0):y.rewards=[],y},fromPartial(s){var E;const y=w();return y.rewards=((E=s.rewards)==null?void 0:E.map(_=>n.DecCoin.fromPartial(_)))||[],y}};function D(){return{validatorPeriod:BigInt(0),fraction:""}}e.ValidatorSlashEvent={typeUrl:"/cosmos.distribution.v1beta1.ValidatorSlashEvent",encode(s,y=t.BinaryWriter.create()){return s.validatorPeriod!==BigInt(0)&&y.uint32(8).uint64(s.validatorPeriod),s.fraction!==""&&y.uint32(18).string(s.fraction),y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=D();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.validatorPeriod=E.uint64();break;case 2:U.fraction=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=D();return(0,r.isSet)(s.validatorPeriod)&&(y.validatorPeriod=BigInt(s.validatorPeriod.toString())),(0,r.isSet)(s.fraction)&&(y.fraction=String(s.fraction)),y},toJSON(s){const y={};return s.validatorPeriod!==void 0&&(y.validatorPeriod=(s.validatorPeriod||BigInt(0)).toString()),s.fraction!==void 0&&(y.fraction=s.fraction),y},fromPartial(s){const y=D();return s.validatorPeriod!==void 0&&s.validatorPeriod!==null&&(y.validatorPeriod=BigInt(s.validatorPeriod.toString())),y.fraction=s.fraction??"",y}};function J(){return{validatorSlashEvents:[]}}e.ValidatorSlashEvents={typeUrl:"/cosmos.distribution.v1beta1.ValidatorSlashEvents",encode(s,y=t.BinaryWriter.create()){for(const E of s.validatorSlashEvents)e.ValidatorSlashEvent.encode(E,y.uint32(10).fork()).ldelim();return y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=J();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.validatorSlashEvents.push(e.ValidatorSlashEvent.decode(E,E.uint32()));break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=J();return Array.isArray(s==null?void 0:s.validatorSlashEvents)&&(y.validatorSlashEvents=s.validatorSlashEvents.map(E=>e.ValidatorSlashEvent.fromJSON(E))),y},toJSON(s){const y={};return s.validatorSlashEvents?y.validatorSlashEvents=s.validatorSlashEvents.map(E=>E?e.ValidatorSlashEvent.toJSON(E):void 0):y.validatorSlashEvents=[],y},fromPartial(s){var E;const y=J();return y.validatorSlashEvents=((E=s.validatorSlashEvents)==null?void 0:E.map(_=>e.ValidatorSlashEvent.fromPartial(_)))||[],y}};function I(){return{communityPool:[]}}e.FeePool={typeUrl:"/cosmos.distribution.v1beta1.FeePool",encode(s,y=t.BinaryWriter.create()){for(const E of s.communityPool)n.DecCoin.encode(E,y.uint32(10).fork()).ldelim();return y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=I();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.communityPool.push(n.DecCoin.decode(E,E.uint32()));break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=I();return Array.isArray(s==null?void 0:s.communityPool)&&(y.communityPool=s.communityPool.map(E=>n.DecCoin.fromJSON(E))),y},toJSON(s){const y={};return s.communityPool?y.communityPool=s.communityPool.map(E=>E?n.DecCoin.toJSON(E):void 0):y.communityPool=[],y},fromPartial(s){var E;const y=I();return y.communityPool=((E=s.communityPool)==null?void 0:E.map(_=>n.DecCoin.fromPartial(_)))||[],y}};function g(){return{title:"",description:"",recipient:"",amount:[]}}e.CommunityPoolSpendProposal={typeUrl:"/cosmos.distribution.v1beta1.CommunityPoolSpendProposal",encode(s,y=t.BinaryWriter.create()){s.title!==""&&y.uint32(10).string(s.title),s.description!==""&&y.uint32(18).string(s.description),s.recipient!==""&&y.uint32(26).string(s.recipient);for(const E of s.amount)n.Coin.encode(E,y.uint32(34).fork()).ldelim();return y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=g();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.title=E.string();break;case 2:U.description=E.string();break;case 3:U.recipient=E.string();break;case 4:U.amount.push(n.Coin.decode(E,E.uint32()));break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=g();return(0,r.isSet)(s.title)&&(y.title=String(s.title)),(0,r.isSet)(s.description)&&(y.description=String(s.description)),(0,r.isSet)(s.recipient)&&(y.recipient=String(s.recipient)),Array.isArray(s==null?void 0:s.amount)&&(y.amount=s.amount.map(E=>n.Coin.fromJSON(E))),y},toJSON(s){const y={};return s.title!==void 0&&(y.title=s.title),s.description!==void 0&&(y.description=s.description),s.recipient!==void 0&&(y.recipient=s.recipient),s.amount?y.amount=s.amount.map(E=>E?n.Coin.toJSON(E):void 0):y.amount=[],y},fromPartial(s){var E;const y=g();return y.title=s.title??"",y.description=s.description??"",y.recipient=s.recipient??"",y.amount=((E=s.amount)==null?void 0:E.map(_=>n.Coin.fromPartial(_)))||[],y}};function R(){return{previousPeriod:BigInt(0),stake:"",height:BigInt(0)}}e.DelegatorStartingInfo={typeUrl:"/cosmos.distribution.v1beta1.DelegatorStartingInfo",encode(s,y=t.BinaryWriter.create()){return s.previousPeriod!==BigInt(0)&&y.uint32(8).uint64(s.previousPeriod),s.stake!==""&&y.uint32(18).string(s.stake),s.height!==BigInt(0)&&y.uint32(24).uint64(s.height),y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=R();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.previousPeriod=E.uint64();break;case 2:U.stake=E.string();break;case 3:U.height=E.uint64();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=R();return(0,r.isSet)(s.previousPeriod)&&(y.previousPeriod=BigInt(s.previousPeriod.toString())),(0,r.isSet)(s.stake)&&(y.stake=String(s.stake)),(0,r.isSet)(s.height)&&(y.height=BigInt(s.height.toString())),y},toJSON(s){const y={};return s.previousPeriod!==void 0&&(y.previousPeriod=(s.previousPeriod||BigInt(0)).toString()),s.stake!==void 0&&(y.stake=s.stake),s.height!==void 0&&(y.height=(s.height||BigInt(0)).toString()),y},fromPartial(s){const y=R();return s.previousPeriod!==void 0&&s.previousPeriod!==null&&(y.previousPeriod=BigInt(s.previousPeriod.toString())),y.stake=s.stake??"",s.height!==void 0&&s.height!==null&&(y.height=BigInt(s.height.toString())),y}};function B(){return{validatorAddress:"",reward:[]}}e.DelegationDelegatorReward={typeUrl:"/cosmos.distribution.v1beta1.DelegationDelegatorReward",encode(s,y=t.BinaryWriter.create()){s.validatorAddress!==""&&y.uint32(10).string(s.validatorAddress);for(const E of s.reward)n.DecCoin.encode(E,y.uint32(18).fork()).ldelim();return y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=B();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.validatorAddress=E.string();break;case 2:U.reward.push(n.DecCoin.decode(E,E.uint32()));break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=B();return(0,r.isSet)(s.validatorAddress)&&(y.validatorAddress=String(s.validatorAddress)),Array.isArray(s==null?void 0:s.reward)&&(y.reward=s.reward.map(E=>n.DecCoin.fromJSON(E))),y},toJSON(s){const y={};return s.validatorAddress!==void 0&&(y.validatorAddress=s.validatorAddress),s.reward?y.reward=s.reward.map(E=>E?n.DecCoin.toJSON(E):void 0):y.reward=[],y},fromPartial(s){var E;const y=B();return y.validatorAddress=s.validatorAddress??"",y.reward=((E=s.reward)==null?void 0:E.map(_=>n.DecCoin.fromPartial(_)))||[],y}};function d(){return{title:"",description:"",recipient:"",amount:"",deposit:""}}e.CommunityPoolSpendProposalWithDeposit={typeUrl:"/cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit",encode(s,y=t.BinaryWriter.create()){return s.title!==""&&y.uint32(10).string(s.title),s.description!==""&&y.uint32(18).string(s.description),s.recipient!==""&&y.uint32(26).string(s.recipient),s.amount!==""&&y.uint32(34).string(s.amount),s.deposit!==""&&y.uint32(42).string(s.deposit),y},decode(s,y){const E=s instanceof t.BinaryReader?s:new t.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=d();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.title=E.string();break;case 2:U.description=E.string();break;case 3:U.recipient=E.string();break;case 4:U.amount=E.string();break;case 5:U.deposit=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=d();return(0,r.isSet)(s.title)&&(y.title=String(s.title)),(0,r.isSet)(s.description)&&(y.description=String(s.description)),(0,r.isSet)(s.recipient)&&(y.recipient=String(s.recipient)),(0,r.isSet)(s.amount)&&(y.amount=String(s.amount)),(0,r.isSet)(s.deposit)&&(y.deposit=String(s.deposit)),y},toJSON(s){const y={};return s.title!==void 0&&(y.title=s.title),s.description!==void 0&&(y.description=s.description),s.recipient!==void 0&&(y.recipient=s.recipient),s.amount!==void 0&&(y.amount=s.amount),s.deposit!==void 0&&(y.deposit=s.deposit),y},fromPartial(s){const y=d();return y.title=s.title??"",y.description=s.description??"",y.recipient=s.recipient??"",y.amount=s.amount??"",y.deposit=s.deposit??"",y}}})(wc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgCommunityPoolSpendResponse=e.MsgCommunityPoolSpend=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgFundCommunityPoolResponse=e.MsgFundCommunityPool=e.MsgWithdrawValidatorCommissionResponse=e.MsgWithdrawValidatorCommission=e.MsgWithdrawDelegatorRewardResponse=e.MsgWithdrawDelegatorReward=e.MsgSetWithdrawAddressResponse=e.MsgSetWithdrawAddress=e.protobufPackage=void 0;const n=Me,t=wc,r=ee,o=ne;e.protobufPackage="cosmos.distribution.v1beta1";function h(){return{delegatorAddress:"",withdrawAddress:""}}e.MsgSetWithdrawAddress={typeUrl:"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",encode(E,_=r.BinaryWriter.create()){return E.delegatorAddress!==""&&_.uint32(10).string(E.delegatorAddress),E.withdrawAddress!==""&&_.uint32(18).string(E.withdrawAddress),_},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=h();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.delegatorAddress=U.string();break;case 2:i.withdrawAddress=U.string();break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=h();return(0,o.isSet)(E.delegatorAddress)&&(_.delegatorAddress=String(E.delegatorAddress)),(0,o.isSet)(E.withdrawAddress)&&(_.withdrawAddress=String(E.withdrawAddress)),_},toJSON(E){const _={};return E.delegatorAddress!==void 0&&(_.delegatorAddress=E.delegatorAddress),E.withdrawAddress!==void 0&&(_.withdrawAddress=E.withdrawAddress),_},fromPartial(E){const _=h();return _.delegatorAddress=E.delegatorAddress??"",_.withdrawAddress=E.withdrawAddress??"",_}};function v(){return{}}e.MsgSetWithdrawAddressResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgSetWithdrawAddressResponse",encode(E,_=r.BinaryWriter.create()){return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=v();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){default:U.skipType(m&7);break}}return i},fromJSON(E){return v()},toJSON(E){return{}},fromPartial(E){return v()}};function C(){return{delegatorAddress:"",validatorAddress:""}}e.MsgWithdrawDelegatorReward={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",encode(E,_=r.BinaryWriter.create()){return E.delegatorAddress!==""&&_.uint32(10).string(E.delegatorAddress),E.validatorAddress!==""&&_.uint32(18).string(E.validatorAddress),_},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=C();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.delegatorAddress=U.string();break;case 2:i.validatorAddress=U.string();break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=C();return(0,o.isSet)(E.delegatorAddress)&&(_.delegatorAddress=String(E.delegatorAddress)),(0,o.isSet)(E.validatorAddress)&&(_.validatorAddress=String(E.validatorAddress)),_},toJSON(E){const _={};return E.delegatorAddress!==void 0&&(_.delegatorAddress=E.delegatorAddress),E.validatorAddress!==void 0&&(_.validatorAddress=E.validatorAddress),_},fromPartial(E){const _=C();return _.delegatorAddress=E.delegatorAddress??"",_.validatorAddress=E.validatorAddress??"",_}};function w(){return{amount:[]}}e.MsgWithdrawDelegatorRewardResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorRewardResponse",encode(E,_=r.BinaryWriter.create()){for(const U of E.amount)n.Coin.encode(U,_.uint32(10).fork()).ldelim();return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=w();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.amount.push(n.Coin.decode(U,U.uint32()));break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=w();return Array.isArray(E==null?void 0:E.amount)&&(_.amount=E.amount.map(U=>n.Coin.fromJSON(U))),_},toJSON(E){const _={};return E.amount?_.amount=E.amount.map(U=>U?n.Coin.toJSON(U):void 0):_.amount=[],_},fromPartial(E){var U;const _=w();return _.amount=((U=E.amount)==null?void 0:U.map(H=>n.Coin.fromPartial(H)))||[],_}};function D(){return{validatorAddress:""}}e.MsgWithdrawValidatorCommission={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",encode(E,_=r.BinaryWriter.create()){return E.validatorAddress!==""&&_.uint32(10).string(E.validatorAddress),_},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=D();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.validatorAddress=U.string();break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=D();return(0,o.isSet)(E.validatorAddress)&&(_.validatorAddress=String(E.validatorAddress)),_},toJSON(E){const _={};return E.validatorAddress!==void 0&&(_.validatorAddress=E.validatorAddress),_},fromPartial(E){const _=D();return _.validatorAddress=E.validatorAddress??"",_}};function J(){return{amount:[]}}e.MsgWithdrawValidatorCommissionResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommissionResponse",encode(E,_=r.BinaryWriter.create()){for(const U of E.amount)n.Coin.encode(U,_.uint32(10).fork()).ldelim();return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=J();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.amount.push(n.Coin.decode(U,U.uint32()));break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=J();return Array.isArray(E==null?void 0:E.amount)&&(_.amount=E.amount.map(U=>n.Coin.fromJSON(U))),_},toJSON(E){const _={};return E.amount?_.amount=E.amount.map(U=>U?n.Coin.toJSON(U):void 0):_.amount=[],_},fromPartial(E){var U;const _=J();return _.amount=((U=E.amount)==null?void 0:U.map(H=>n.Coin.fromPartial(H)))||[],_}};function I(){return{amount:[],depositor:""}}e.MsgFundCommunityPool={typeUrl:"/cosmos.distribution.v1beta1.MsgFundCommunityPool",encode(E,_=r.BinaryWriter.create()){for(const U of E.amount)n.Coin.encode(U,_.uint32(10).fork()).ldelim();return E.depositor!==""&&_.uint32(18).string(E.depositor),_},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=I();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.amount.push(n.Coin.decode(U,U.uint32()));break;case 2:i.depositor=U.string();break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=I();return Array.isArray(E==null?void 0:E.amount)&&(_.amount=E.amount.map(U=>n.Coin.fromJSON(U))),(0,o.isSet)(E.depositor)&&(_.depositor=String(E.depositor)),_},toJSON(E){const _={};return E.amount?_.amount=E.amount.map(U=>U?n.Coin.toJSON(U):void 0):_.amount=[],E.depositor!==void 0&&(_.depositor=E.depositor),_},fromPartial(E){var U;const _=I();return _.amount=((U=E.amount)==null?void 0:U.map(H=>n.Coin.fromPartial(H)))||[],_.depositor=E.depositor??"",_}};function g(){return{}}e.MsgFundCommunityPoolResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgFundCommunityPoolResponse",encode(E,_=r.BinaryWriter.create()){return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=g();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){default:U.skipType(m&7);break}}return i},fromJSON(E){return g()},toJSON(E){return{}},fromPartial(E){return g()}};function R(){return{authority:"",params:t.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.distribution.v1beta1.MsgUpdateParams",encode(E,_=r.BinaryWriter.create()){return E.authority!==""&&_.uint32(10).string(E.authority),E.params!==void 0&&t.Params.encode(E.params,_.uint32(18).fork()).ldelim(),_},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=R();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.authority=U.string();break;case 2:i.params=t.Params.decode(U,U.uint32());break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=R();return(0,o.isSet)(E.authority)&&(_.authority=String(E.authority)),(0,o.isSet)(E.params)&&(_.params=t.Params.fromJSON(E.params)),_},toJSON(E){const _={};return E.authority!==void 0&&(_.authority=E.authority),E.params!==void 0&&(_.params=E.params?t.Params.toJSON(E.params):void 0),_},fromPartial(E){const _=R();return _.authority=E.authority??"",E.params!==void 0&&E.params!==null&&(_.params=t.Params.fromPartial(E.params)),_}};function B(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgUpdateParamsResponse",encode(E,_=r.BinaryWriter.create()){return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=B();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){default:U.skipType(m&7);break}}return i},fromJSON(E){return B()},toJSON(E){return{}},fromPartial(E){return B()}};function d(){return{authority:"",recipient:"",amount:[]}}e.MsgCommunityPoolSpend={typeUrl:"/cosmos.distribution.v1beta1.MsgCommunityPoolSpend",encode(E,_=r.BinaryWriter.create()){E.authority!==""&&_.uint32(10).string(E.authority),E.recipient!==""&&_.uint32(18).string(E.recipient);for(const U of E.amount)n.Coin.encode(U,_.uint32(26).fork()).ldelim();return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=d();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){case 1:i.authority=U.string();break;case 2:i.recipient=U.string();break;case 3:i.amount.push(n.Coin.decode(U,U.uint32()));break;default:U.skipType(m&7);break}}return i},fromJSON(E){const _=d();return(0,o.isSet)(E.authority)&&(_.authority=String(E.authority)),(0,o.isSet)(E.recipient)&&(_.recipient=String(E.recipient)),Array.isArray(E==null?void 0:E.amount)&&(_.amount=E.amount.map(U=>n.Coin.fromJSON(U))),_},toJSON(E){const _={};return E.authority!==void 0&&(_.authority=E.authority),E.recipient!==void 0&&(_.recipient=E.recipient),E.amount?_.amount=E.amount.map(U=>U?n.Coin.toJSON(U):void 0):_.amount=[],_},fromPartial(E){var U;const _=d();return _.authority=E.authority??"",_.recipient=E.recipient??"",_.amount=((U=E.amount)==null?void 0:U.map(H=>n.Coin.fromPartial(H)))||[],_}};function s(){return{}}e.MsgCommunityPoolSpendResponse={typeUrl:"/cosmos.distribution.v1beta1.MsgCommunityPoolSpendResponse",encode(E,_=r.BinaryWriter.create()){return _},decode(E,_){const U=E instanceof r.BinaryReader?E:new r.BinaryReader(E);let H=_===void 0?U.len:U.pos+_;const i=s();for(;U.pos<H;){const m=U.uint32();switch(m>>>3){default:U.skipType(m&7);break}}return i},fromJSON(E){return s()},toJSON(E){return{}},fromPartial(E){return s()}};class y{constructor(_){this.rpc=_,this.SetWithdrawAddress=this.SetWithdrawAddress.bind(this),this.WithdrawDelegatorReward=this.WithdrawDelegatorReward.bind(this),this.WithdrawValidatorCommission=this.WithdrawValidatorCommission.bind(this),this.FundCommunityPool=this.FundCommunityPool.bind(this),this.UpdateParams=this.UpdateParams.bind(this),this.CommunityPoolSpend=this.CommunityPoolSpend.bind(this)}SetWithdrawAddress(_){const U=e.MsgSetWithdrawAddress.encode(_).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","SetWithdrawAddress",U).then(i=>e.MsgSetWithdrawAddressResponse.decode(new r.BinaryReader(i)))}WithdrawDelegatorReward(_){const U=e.MsgWithdrawDelegatorReward.encode(_).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawDelegatorReward",U).then(i=>e.MsgWithdrawDelegatorRewardResponse.decode(new r.BinaryReader(i)))}WithdrawValidatorCommission(_){const U=e.MsgWithdrawValidatorCommission.encode(_).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","WithdrawValidatorCommission",U).then(i=>e.MsgWithdrawValidatorCommissionResponse.decode(new r.BinaryReader(i)))}FundCommunityPool(_){const U=e.MsgFundCommunityPool.encode(_).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","FundCommunityPool",U).then(i=>e.MsgFundCommunityPoolResponse.decode(new r.BinaryReader(i)))}UpdateParams(_){const U=e.MsgUpdateParams.encode(_).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","UpdateParams",U).then(i=>e.MsgUpdateParamsResponse.decode(new r.BinaryReader(i)))}CommunityPoolSpend(_){const U=e.MsgCommunityPoolSpend.encode(_).finish();return this.rpc.request("cosmos.distribution.v1beta1.Msg","CommunityPoolSpend",U).then(i=>e.MsgCommunityPoolSpendResponse.decode(new r.BinaryReader(i)))}}e.MsgClientImpl=y})(ja);Object.defineProperty(oi,"__esModule",{value:!0});oi.isMsgWithdrawDelegatorRewardEncodeObject=oi.distributionTypes=void 0;const Jo=ja;oi.distributionTypes=[["/cosmos.distribution.v1beta1.MsgFundCommunityPool",Jo.MsgFundCommunityPool],["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",Jo.MsgSetWithdrawAddress],["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",Jo.MsgWithdrawDelegatorReward],["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",Jo.MsgWithdrawValidatorCommission]];function WP(e){return e.typeUrl==="/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"}oi.isMsgWithdrawDelegatorRewardEncodeObject=WP;var es={},Sm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryCommunityPoolResponse=e.QueryCommunityPoolRequest=e.QueryDelegatorWithdrawAddressResponse=e.QueryDelegatorWithdrawAddressRequest=e.QueryDelegatorValidatorsResponse=e.QueryDelegatorValidatorsRequest=e.QueryDelegationTotalRewardsResponse=e.QueryDelegationTotalRewardsRequest=e.QueryDelegationRewardsResponse=e.QueryDelegationRewardsRequest=e.QueryValidatorSlashesResponse=e.QueryValidatorSlashesRequest=e.QueryValidatorCommissionResponse=e.QueryValidatorCommissionRequest=e.QueryValidatorOutstandingRewardsResponse=e.QueryValidatorOutstandingRewardsRequest=e.QueryValidatorDistributionInfoResponse=e.QueryValidatorDistributionInfoRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.protobufPackage=void 0;const n=be,t=wc,r=Me,o=ee,h=ne;e.protobufPackage="cosmos.distribution.v1beta1";function v(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryParamsRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=v();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return v()},toJSON(l){return{}},fromPartial(l){return v()}};function C(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryParamsResponse",encode(l,T=o.BinaryWriter.create()){return l.params!==void 0&&t.Params.encode(l.params,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=C();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.params=t.Params.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=C();return(0,h.isSet)(l.params)&&(T.params=t.Params.fromJSON(l.params)),T},toJSON(l){const T={};return l.params!==void 0&&(T.params=l.params?t.Params.toJSON(l.params):void 0),T},fromPartial(l){const T=C();return l.params!==void 0&&l.params!==null&&(T.params=t.Params.fromPartial(l.params)),T}};function w(){return{validatorAddress:""}}e.QueryValidatorDistributionInfoRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoRequest",encode(l,T=o.BinaryWriter.create()){return l.validatorAddress!==""&&T.uint32(10).string(l.validatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=w();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.validatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=w();return(0,h.isSet)(l.validatorAddress)&&(T.validatorAddress=String(l.validatorAddress)),T},toJSON(l){const T={};return l.validatorAddress!==void 0&&(T.validatorAddress=l.validatorAddress),T},fromPartial(l){const T=w();return T.validatorAddress=l.validatorAddress??"",T}};function D(){return{operatorAddress:"",selfBondRewards:[],commission:[]}}e.QueryValidatorDistributionInfoResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorDistributionInfoResponse",encode(l,T=o.BinaryWriter.create()){l.operatorAddress!==""&&T.uint32(10).string(l.operatorAddress);for(const f of l.selfBondRewards)r.DecCoin.encode(f,T.uint32(18).fork()).ldelim();for(const f of l.commission)r.DecCoin.encode(f,T.uint32(26).fork()).ldelim();return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=D();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.operatorAddress=f.string();break;case 2:A.selfBondRewards.push(r.DecCoin.decode(f,f.uint32()));break;case 3:A.commission.push(r.DecCoin.decode(f,f.uint32()));break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=D();return(0,h.isSet)(l.operatorAddress)&&(T.operatorAddress=String(l.operatorAddress)),Array.isArray(l==null?void 0:l.selfBondRewards)&&(T.selfBondRewards=l.selfBondRewards.map(f=>r.DecCoin.fromJSON(f))),Array.isArray(l==null?void 0:l.commission)&&(T.commission=l.commission.map(f=>r.DecCoin.fromJSON(f))),T},toJSON(l){const T={};return l.operatorAddress!==void 0&&(T.operatorAddress=l.operatorAddress),l.selfBondRewards?T.selfBondRewards=l.selfBondRewards.map(f=>f?r.DecCoin.toJSON(f):void 0):T.selfBondRewards=[],l.commission?T.commission=l.commission.map(f=>f?r.DecCoin.toJSON(f):void 0):T.commission=[],T},fromPartial(l){var f,p;const T=D();return T.operatorAddress=l.operatorAddress??"",T.selfBondRewards=((f=l.selfBondRewards)==null?void 0:f.map(A=>r.DecCoin.fromPartial(A)))||[],T.commission=((p=l.commission)==null?void 0:p.map(A=>r.DecCoin.fromPartial(A)))||[],T}};function J(){return{validatorAddress:""}}e.QueryValidatorOutstandingRewardsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsRequest",encode(l,T=o.BinaryWriter.create()){return l.validatorAddress!==""&&T.uint32(10).string(l.validatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=J();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.validatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=J();return(0,h.isSet)(l.validatorAddress)&&(T.validatorAddress=String(l.validatorAddress)),T},toJSON(l){const T={};return l.validatorAddress!==void 0&&(T.validatorAddress=l.validatorAddress),T},fromPartial(l){const T=J();return T.validatorAddress=l.validatorAddress??"",T}};function I(){return{rewards:t.ValidatorOutstandingRewards.fromPartial({})}}e.QueryValidatorOutstandingRewardsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorOutstandingRewardsResponse",encode(l,T=o.BinaryWriter.create()){return l.rewards!==void 0&&t.ValidatorOutstandingRewards.encode(l.rewards,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=I();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.rewards=t.ValidatorOutstandingRewards.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=I();return(0,h.isSet)(l.rewards)&&(T.rewards=t.ValidatorOutstandingRewards.fromJSON(l.rewards)),T},toJSON(l){const T={};return l.rewards!==void 0&&(T.rewards=l.rewards?t.ValidatorOutstandingRewards.toJSON(l.rewards):void 0),T},fromPartial(l){const T=I();return l.rewards!==void 0&&l.rewards!==null&&(T.rewards=t.ValidatorOutstandingRewards.fromPartial(l.rewards)),T}};function g(){return{validatorAddress:""}}e.QueryValidatorCommissionRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorCommissionRequest",encode(l,T=o.BinaryWriter.create()){return l.validatorAddress!==""&&T.uint32(10).string(l.validatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=g();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.validatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=g();return(0,h.isSet)(l.validatorAddress)&&(T.validatorAddress=String(l.validatorAddress)),T},toJSON(l){const T={};return l.validatorAddress!==void 0&&(T.validatorAddress=l.validatorAddress),T},fromPartial(l){const T=g();return T.validatorAddress=l.validatorAddress??"",T}};function R(){return{commission:t.ValidatorAccumulatedCommission.fromPartial({})}}e.QueryValidatorCommissionResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorCommissionResponse",encode(l,T=o.BinaryWriter.create()){return l.commission!==void 0&&t.ValidatorAccumulatedCommission.encode(l.commission,T.uint32(10).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=R();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.commission=t.ValidatorAccumulatedCommission.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=R();return(0,h.isSet)(l.commission)&&(T.commission=t.ValidatorAccumulatedCommission.fromJSON(l.commission)),T},toJSON(l){const T={};return l.commission!==void 0&&(T.commission=l.commission?t.ValidatorAccumulatedCommission.toJSON(l.commission):void 0),T},fromPartial(l){const T=R();return l.commission!==void 0&&l.commission!==null&&(T.commission=t.ValidatorAccumulatedCommission.fromPartial(l.commission)),T}};function B(){return{validatorAddress:"",startingHeight:BigInt(0),endingHeight:BigInt(0),pagination:void 0}}e.QueryValidatorSlashesRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorSlashesRequest",encode(l,T=o.BinaryWriter.create()){return l.validatorAddress!==""&&T.uint32(10).string(l.validatorAddress),l.startingHeight!==BigInt(0)&&T.uint32(16).uint64(l.startingHeight),l.endingHeight!==BigInt(0)&&T.uint32(24).uint64(l.endingHeight),l.pagination!==void 0&&n.PageRequest.encode(l.pagination,T.uint32(34).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=B();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.validatorAddress=f.string();break;case 2:A.startingHeight=f.uint64();break;case 3:A.endingHeight=f.uint64();break;case 4:A.pagination=n.PageRequest.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=B();return(0,h.isSet)(l.validatorAddress)&&(T.validatorAddress=String(l.validatorAddress)),(0,h.isSet)(l.startingHeight)&&(T.startingHeight=BigInt(l.startingHeight.toString())),(0,h.isSet)(l.endingHeight)&&(T.endingHeight=BigInt(l.endingHeight.toString())),(0,h.isSet)(l.pagination)&&(T.pagination=n.PageRequest.fromJSON(l.pagination)),T},toJSON(l){const T={};return l.validatorAddress!==void 0&&(T.validatorAddress=l.validatorAddress),l.startingHeight!==void 0&&(T.startingHeight=(l.startingHeight||BigInt(0)).toString()),l.endingHeight!==void 0&&(T.endingHeight=(l.endingHeight||BigInt(0)).toString()),l.pagination!==void 0&&(T.pagination=l.pagination?n.PageRequest.toJSON(l.pagination):void 0),T},fromPartial(l){const T=B();return T.validatorAddress=l.validatorAddress??"",l.startingHeight!==void 0&&l.startingHeight!==null&&(T.startingHeight=BigInt(l.startingHeight.toString())),l.endingHeight!==void 0&&l.endingHeight!==null&&(T.endingHeight=BigInt(l.endingHeight.toString())),l.pagination!==void 0&&l.pagination!==null&&(T.pagination=n.PageRequest.fromPartial(l.pagination)),T}};function d(){return{slashes:[],pagination:void 0}}e.QueryValidatorSlashesResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryValidatorSlashesResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.slashes)t.ValidatorSlashEvent.encode(f,T.uint32(10).fork()).ldelim();return l.pagination!==void 0&&n.PageResponse.encode(l.pagination,T.uint32(18).fork()).ldelim(),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=d();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.slashes.push(t.ValidatorSlashEvent.decode(f,f.uint32()));break;case 2:A.pagination=n.PageResponse.decode(f,f.uint32());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=d();return Array.isArray(l==null?void 0:l.slashes)&&(T.slashes=l.slashes.map(f=>t.ValidatorSlashEvent.fromJSON(f))),(0,h.isSet)(l.pagination)&&(T.pagination=n.PageResponse.fromJSON(l.pagination)),T},toJSON(l){const T={};return l.slashes?T.slashes=l.slashes.map(f=>f?t.ValidatorSlashEvent.toJSON(f):void 0):T.slashes=[],l.pagination!==void 0&&(T.pagination=l.pagination?n.PageResponse.toJSON(l.pagination):void 0),T},fromPartial(l){var f;const T=d();return T.slashes=((f=l.slashes)==null?void 0:f.map(p=>t.ValidatorSlashEvent.fromPartial(p)))||[],l.pagination!==void 0&&l.pagination!==null&&(T.pagination=n.PageResponse.fromPartial(l.pagination)),T}};function s(){return{delegatorAddress:"",validatorAddress:""}}e.QueryDelegationRewardsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationRewardsRequest",encode(l,T=o.BinaryWriter.create()){return l.delegatorAddress!==""&&T.uint32(10).string(l.delegatorAddress),l.validatorAddress!==""&&T.uint32(18).string(l.validatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=s();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.delegatorAddress=f.string();break;case 2:A.validatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=s();return(0,h.isSet)(l.delegatorAddress)&&(T.delegatorAddress=String(l.delegatorAddress)),(0,h.isSet)(l.validatorAddress)&&(T.validatorAddress=String(l.validatorAddress)),T},toJSON(l){const T={};return l.delegatorAddress!==void 0&&(T.delegatorAddress=l.delegatorAddress),l.validatorAddress!==void 0&&(T.validatorAddress=l.validatorAddress),T},fromPartial(l){const T=s();return T.delegatorAddress=l.delegatorAddress??"",T.validatorAddress=l.validatorAddress??"",T}};function y(){return{rewards:[]}}e.QueryDelegationRewardsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationRewardsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.rewards)r.DecCoin.encode(f,T.uint32(10).fork()).ldelim();return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=y();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.rewards.push(r.DecCoin.decode(f,f.uint32()));break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=y();return Array.isArray(l==null?void 0:l.rewards)&&(T.rewards=l.rewards.map(f=>r.DecCoin.fromJSON(f))),T},toJSON(l){const T={};return l.rewards?T.rewards=l.rewards.map(f=>f?r.DecCoin.toJSON(f):void 0):T.rewards=[],T},fromPartial(l){var f;const T=y();return T.rewards=((f=l.rewards)==null?void 0:f.map(p=>r.DecCoin.fromPartial(p)))||[],T}};function E(){return{delegatorAddress:""}}e.QueryDelegationTotalRewardsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsRequest",encode(l,T=o.BinaryWriter.create()){return l.delegatorAddress!==""&&T.uint32(10).string(l.delegatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=E();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.delegatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=E();return(0,h.isSet)(l.delegatorAddress)&&(T.delegatorAddress=String(l.delegatorAddress)),T},toJSON(l){const T={};return l.delegatorAddress!==void 0&&(T.delegatorAddress=l.delegatorAddress),T},fromPartial(l){const T=E();return T.delegatorAddress=l.delegatorAddress??"",T}};function _(){return{rewards:[],total:[]}}e.QueryDelegationTotalRewardsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegationTotalRewardsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.rewards)t.DelegationDelegatorReward.encode(f,T.uint32(10).fork()).ldelim();for(const f of l.total)r.DecCoin.encode(f,T.uint32(18).fork()).ldelim();return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=_();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.rewards.push(t.DelegationDelegatorReward.decode(f,f.uint32()));break;case 2:A.total.push(r.DecCoin.decode(f,f.uint32()));break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=_();return Array.isArray(l==null?void 0:l.rewards)&&(T.rewards=l.rewards.map(f=>t.DelegationDelegatorReward.fromJSON(f))),Array.isArray(l==null?void 0:l.total)&&(T.total=l.total.map(f=>r.DecCoin.fromJSON(f))),T},toJSON(l){const T={};return l.rewards?T.rewards=l.rewards.map(f=>f?t.DelegationDelegatorReward.toJSON(f):void 0):T.rewards=[],l.total?T.total=l.total.map(f=>f?r.DecCoin.toJSON(f):void 0):T.total=[],T},fromPartial(l){var f,p;const T=_();return T.rewards=((f=l.rewards)==null?void 0:f.map(A=>t.DelegationDelegatorReward.fromPartial(A)))||[],T.total=((p=l.total)==null?void 0:p.map(A=>r.DecCoin.fromPartial(A)))||[],T}};function U(){return{delegatorAddress:""}}e.QueryDelegatorValidatorsRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorValidatorsRequest",encode(l,T=o.BinaryWriter.create()){return l.delegatorAddress!==""&&T.uint32(10).string(l.delegatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=U();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.delegatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=U();return(0,h.isSet)(l.delegatorAddress)&&(T.delegatorAddress=String(l.delegatorAddress)),T},toJSON(l){const T={};return l.delegatorAddress!==void 0&&(T.delegatorAddress=l.delegatorAddress),T},fromPartial(l){const T=U();return T.delegatorAddress=l.delegatorAddress??"",T}};function H(){return{validators:[]}}e.QueryDelegatorValidatorsResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorValidatorsResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.validators)T.uint32(10).string(f);return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=H();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.validators.push(f.string());break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=H();return Array.isArray(l==null?void 0:l.validators)&&(T.validators=l.validators.map(f=>String(f))),T},toJSON(l){const T={};return l.validators?T.validators=l.validators.map(f=>f):T.validators=[],T},fromPartial(l){var f;const T=H();return T.validators=((f=l.validators)==null?void 0:f.map(p=>p))||[],T}};function i(){return{delegatorAddress:""}}e.QueryDelegatorWithdrawAddressRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressRequest",encode(l,T=o.BinaryWriter.create()){return l.delegatorAddress!==""&&T.uint32(10).string(l.delegatorAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=i();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.delegatorAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=i();return(0,h.isSet)(l.delegatorAddress)&&(T.delegatorAddress=String(l.delegatorAddress)),T},toJSON(l){const T={};return l.delegatorAddress!==void 0&&(T.delegatorAddress=l.delegatorAddress),T},fromPartial(l){const T=i();return T.delegatorAddress=l.delegatorAddress??"",T}};function m(){return{withdrawAddress:""}}e.QueryDelegatorWithdrawAddressResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryDelegatorWithdrawAddressResponse",encode(l,T=o.BinaryWriter.create()){return l.withdrawAddress!==""&&T.uint32(10).string(l.withdrawAddress),T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=m();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.withdrawAddress=f.string();break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=m();return(0,h.isSet)(l.withdrawAddress)&&(T.withdrawAddress=String(l.withdrawAddress)),T},toJSON(l){const T={};return l.withdrawAddress!==void 0&&(T.withdrawAddress=l.withdrawAddress),T},fromPartial(l){const T=m();return T.withdrawAddress=l.withdrawAddress??"",T}};function N(){return{}}e.QueryCommunityPoolRequest={typeUrl:"/cosmos.distribution.v1beta1.QueryCommunityPoolRequest",encode(l,T=o.BinaryWriter.create()){return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=N();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){default:f.skipType(Q&7);break}}return A},fromJSON(l){return N()},toJSON(l){return{}},fromPartial(l){return N()}};function V(){return{pool:[]}}e.QueryCommunityPoolResponse={typeUrl:"/cosmos.distribution.v1beta1.QueryCommunityPoolResponse",encode(l,T=o.BinaryWriter.create()){for(const f of l.pool)r.DecCoin.encode(f,T.uint32(10).fork()).ldelim();return T},decode(l,T){const f=l instanceof o.BinaryReader?l:new o.BinaryReader(l);let p=T===void 0?f.len:f.pos+T;const A=V();for(;f.pos<p;){const Q=f.uint32();switch(Q>>>3){case 1:A.pool.push(r.DecCoin.decode(f,f.uint32()));break;default:f.skipType(Q&7);break}}return A},fromJSON(l){const T=V();return Array.isArray(l==null?void 0:l.pool)&&(T.pool=l.pool.map(f=>r.DecCoin.fromJSON(f))),T},toJSON(l){const T={};return l.pool?T.pool=l.pool.map(f=>f?r.DecCoin.toJSON(f):void 0):T.pool=[],T},fromPartial(l){var f;const T=V();return T.pool=((f=l.pool)==null?void 0:f.map(p=>r.DecCoin.fromPartial(p)))||[],T}};class u{constructor(T){this.rpc=T,this.Params=this.Params.bind(this),this.ValidatorDistributionInfo=this.ValidatorDistributionInfo.bind(this),this.ValidatorOutstandingRewards=this.ValidatorOutstandingRewards.bind(this),this.ValidatorCommission=this.ValidatorCommission.bind(this),this.ValidatorSlashes=this.ValidatorSlashes.bind(this),this.DelegationRewards=this.DelegationRewards.bind(this),this.DelegationTotalRewards=this.DelegationTotalRewards.bind(this),this.DelegatorValidators=this.DelegatorValidators.bind(this),this.DelegatorWithdrawAddress=this.DelegatorWithdrawAddress.bind(this),this.CommunityPool=this.CommunityPool.bind(this)}Params(T={}){const f=e.QueryParamsRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","Params",f).then(A=>e.QueryParamsResponse.decode(new o.BinaryReader(A)))}ValidatorDistributionInfo(T){const f=e.QueryValidatorDistributionInfoRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorDistributionInfo",f).then(A=>e.QueryValidatorDistributionInfoResponse.decode(new o.BinaryReader(A)))}ValidatorOutstandingRewards(T){const f=e.QueryValidatorOutstandingRewardsRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorOutstandingRewards",f).then(A=>e.QueryValidatorOutstandingRewardsResponse.decode(new o.BinaryReader(A)))}ValidatorCommission(T){const f=e.QueryValidatorCommissionRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorCommission",f).then(A=>e.QueryValidatorCommissionResponse.decode(new o.BinaryReader(A)))}ValidatorSlashes(T){const f=e.QueryValidatorSlashesRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","ValidatorSlashes",f).then(A=>e.QueryValidatorSlashesResponse.decode(new o.BinaryReader(A)))}DelegationRewards(T){const f=e.QueryDelegationRewardsRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegationRewards",f).then(A=>e.QueryDelegationRewardsResponse.decode(new o.BinaryReader(A)))}DelegationTotalRewards(T){const f=e.QueryDelegationTotalRewardsRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegationTotalRewards",f).then(A=>e.QueryDelegationTotalRewardsResponse.decode(new o.BinaryReader(A)))}DelegatorValidators(T){const f=e.QueryDelegatorValidatorsRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegatorValidators",f).then(A=>e.QueryDelegatorValidatorsResponse.decode(new o.BinaryReader(A)))}DelegatorWithdrawAddress(T){const f=e.QueryDelegatorWithdrawAddressRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","DelegatorWithdrawAddress",f).then(A=>e.QueryDelegatorWithdrawAddressResponse.decode(new o.BinaryReader(A)))}CommunityPool(T={}){const f=e.QueryCommunityPoolRequest.encode(T).finish();return this.rpc.request("cosmos.distribution.v1beta1.Query","CommunityPool",f).then(A=>e.QueryCommunityPoolResponse.decode(new o.BinaryReader(A)))}}e.QueryClientImpl=u})(Sm);Object.defineProperty(es,"__esModule",{value:!0});es.setupDistributionExtension=void 0;const FP=Sm,ql=Ke;function GP(e){const n=(0,ql.createProtobufRpcClient)(e),t=new FP.QueryClientImpl(n);return{distribution:{communityPool:async()=>await t.CommunityPool({}),delegationRewards:async(r,o)=>await t.DelegationRewards({delegatorAddress:r,validatorAddress:o}),delegationTotalRewards:async r=>await t.DelegationTotalRewards({delegatorAddress:r}),delegatorValidators:async r=>await t.DelegatorValidators({delegatorAddress:r}),delegatorWithdrawAddress:async r=>await t.DelegatorWithdrawAddress({delegatorAddress:r}),params:async()=>await t.Params({}),validatorCommission:async r=>await t.ValidatorCommission({validatorAddress:r}),validatorOutstandingRewards:async r=>await t.ValidatorOutstandingRewards({validatorAddress:r}),validatorSlashes:async(r,o,h,v)=>await t.ValidatorSlashes({validatorAddress:r,startingHeight:BigInt(o),endingHeight:BigInt(h),pagination:(0,ql.createPagination)(v)})}}}es.setupDistributionExtension=GP;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.createEvidenceAminoConverters=ai.isAminoMsgSubmitEvidence=void 0;function LP(e){return e.type==="cosmos-sdk/MsgSubmitEvidence"}ai.isAminoMsgSubmitEvidence=LP;function $P(){throw new Error("Not implemented")}ai.createEvidenceAminoConverters=$P;var ns={};Object.defineProperty(ns,"__esModule",{value:!0});ns.createFeegrantAminoConverters=void 0;function KP(){return{}}ns.createFeegrantAminoConverters=KP;var ts={},km={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgRevokeAllowanceResponse=e.MsgRevokeAllowance=e.MsgGrantAllowanceResponse=e.MsgGrantAllowance=e.protobufPackage=void 0;const n=Re,t=ee,r=ne;e.protobufPackage="cosmos.feegrant.v1beta1";function o(){return{granter:"",grantee:"",allowance:void 0}}e.MsgGrantAllowance={typeUrl:"/cosmos.feegrant.v1beta1.MsgGrantAllowance",encode(D,J=t.BinaryWriter.create()){return D.granter!==""&&J.uint32(10).string(D.granter),D.grantee!==""&&J.uint32(18).string(D.grantee),D.allowance!==void 0&&n.Any.encode(D.allowance,J.uint32(26).fork()).ldelim(),J},decode(D,J){const I=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let g=J===void 0?I.len:I.pos+J;const R=o();for(;I.pos<g;){const B=I.uint32();switch(B>>>3){case 1:R.granter=I.string();break;case 2:R.grantee=I.string();break;case 3:R.allowance=n.Any.decode(I,I.uint32());break;default:I.skipType(B&7);break}}return R},fromJSON(D){const J=o();return(0,r.isSet)(D.granter)&&(J.granter=String(D.granter)),(0,r.isSet)(D.grantee)&&(J.grantee=String(D.grantee)),(0,r.isSet)(D.allowance)&&(J.allowance=n.Any.fromJSON(D.allowance)),J},toJSON(D){const J={};return D.granter!==void 0&&(J.granter=D.granter),D.grantee!==void 0&&(J.grantee=D.grantee),D.allowance!==void 0&&(J.allowance=D.allowance?n.Any.toJSON(D.allowance):void 0),J},fromPartial(D){const J=o();return J.granter=D.granter??"",J.grantee=D.grantee??"",D.allowance!==void 0&&D.allowance!==null&&(J.allowance=n.Any.fromPartial(D.allowance)),J}};function h(){return{}}e.MsgGrantAllowanceResponse={typeUrl:"/cosmos.feegrant.v1beta1.MsgGrantAllowanceResponse",encode(D,J=t.BinaryWriter.create()){return J},decode(D,J){const I=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let g=J===void 0?I.len:I.pos+J;const R=h();for(;I.pos<g;){const B=I.uint32();switch(B>>>3){default:I.skipType(B&7);break}}return R},fromJSON(D){return h()},toJSON(D){return{}},fromPartial(D){return h()}};function v(){return{granter:"",grantee:""}}e.MsgRevokeAllowance={typeUrl:"/cosmos.feegrant.v1beta1.MsgRevokeAllowance",encode(D,J=t.BinaryWriter.create()){return D.granter!==""&&J.uint32(10).string(D.granter),D.grantee!==""&&J.uint32(18).string(D.grantee),J},decode(D,J){const I=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let g=J===void 0?I.len:I.pos+J;const R=v();for(;I.pos<g;){const B=I.uint32();switch(B>>>3){case 1:R.granter=I.string();break;case 2:R.grantee=I.string();break;default:I.skipType(B&7);break}}return R},fromJSON(D){const J=v();return(0,r.isSet)(D.granter)&&(J.granter=String(D.granter)),(0,r.isSet)(D.grantee)&&(J.grantee=String(D.grantee)),J},toJSON(D){const J={};return D.granter!==void 0&&(J.granter=D.granter),D.grantee!==void 0&&(J.grantee=D.grantee),J},fromPartial(D){const J=v();return J.granter=D.granter??"",J.grantee=D.grantee??"",J}};function C(){return{}}e.MsgRevokeAllowanceResponse={typeUrl:"/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse",encode(D,J=t.BinaryWriter.create()){return J},decode(D,J){const I=D instanceof t.BinaryReader?D:new t.BinaryReader(D);let g=J===void 0?I.len:I.pos+J;const R=C();for(;I.pos<g;){const B=I.uint32();switch(B>>>3){default:I.skipType(B&7);break}}return R},fromJSON(D){return C()},toJSON(D){return{}},fromPartial(D){return C()}};class w{constructor(J){this.rpc=J,this.GrantAllowance=this.GrantAllowance.bind(this),this.RevokeAllowance=this.RevokeAllowance.bind(this)}GrantAllowance(J){const I=e.MsgGrantAllowance.encode(J).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Msg","GrantAllowance",I).then(R=>e.MsgGrantAllowanceResponse.decode(new t.BinaryReader(R)))}RevokeAllowance(J){const I=e.MsgRevokeAllowance.encode(J).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Msg","RevokeAllowance",I).then(R=>e.MsgRevokeAllowanceResponse.decode(new t.BinaryReader(R)))}}e.MsgClientImpl=w})(km);Object.defineProperty(ts,"__esModule",{value:!0});ts.feegrantTypes=void 0;const Hl=km;ts.feegrantTypes=[["/cosmos.feegrant.v1beta1.MsgGrantAllowance",Hl.MsgGrantAllowance],["/cosmos.feegrant.v1beta1.MsgRevokeAllowance",Hl.MsgRevokeAllowance]];var rs={},Pm={},Rm={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});hn.Duration=hn.protobufPackage=void 0;const Fd=ee,Vl=ne;hn.protobufPackage="google.protobuf";function Gd(){return{seconds:BigInt(0),nanos:0}}hn.Duration={typeUrl:"/google.protobuf.Duration",encode(e,n=Fd.BinaryWriter.create()){return e.seconds!==BigInt(0)&&n.uint32(8).int64(e.seconds),e.nanos!==0&&n.uint32(16).int32(e.nanos),n},decode(e,n){const t=e instanceof Fd.BinaryReader?e:new Fd.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Gd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.seconds=t.int64();break;case 2:o.nanos=t.int32();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Gd();return(0,Vl.isSet)(e.seconds)&&(n.seconds=BigInt(e.seconds.toString())),(0,Vl.isSet)(e.nanos)&&(n.nanos=Number(e.nanos)),n},toJSON(e){const n={};return e.seconds!==void 0&&(n.seconds=(e.seconds||BigInt(0)).toString()),e.nanos!==void 0&&(n.nanos=Math.round(e.nanos)),n},fromPartial(e){const n=Gd();return e.seconds!==void 0&&e.seconds!==null&&(n.seconds=BigInt(e.seconds.toString())),n.nanos=e.nanos??0,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Grant=e.AllowedMsgAllowance=e.PeriodicAllowance=e.BasicAllowance=e.protobufPackage=void 0;const n=Me,t=Mn,r=hn,o=Re,h=ee,v=ne;e.protobufPackage="cosmos.feegrant.v1beta1";function C(){return{spendLimit:[],expiration:void 0}}e.BasicAllowance={typeUrl:"/cosmos.feegrant.v1beta1.BasicAllowance",encode(I,g=h.BinaryWriter.create()){for(const R of I.spendLimit)n.Coin.encode(R,g.uint32(10).fork()).ldelim();return I.expiration!==void 0&&t.Timestamp.encode(I.expiration,g.uint32(18).fork()).ldelim(),g},decode(I,g){const R=I instanceof h.BinaryReader?I:new h.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=C();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.spendLimit.push(n.Coin.decode(R,R.uint32()));break;case 2:d.expiration=t.Timestamp.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=C();return Array.isArray(I==null?void 0:I.spendLimit)&&(g.spendLimit=I.spendLimit.map(R=>n.Coin.fromJSON(R))),(0,v.isSet)(I.expiration)&&(g.expiration=(0,v.fromJsonTimestamp)(I.expiration)),g},toJSON(I){const g={};return I.spendLimit?g.spendLimit=I.spendLimit.map(R=>R?n.Coin.toJSON(R):void 0):g.spendLimit=[],I.expiration!==void 0&&(g.expiration=(0,v.fromTimestamp)(I.expiration).toISOString()),g},fromPartial(I){var R;const g=C();return g.spendLimit=((R=I.spendLimit)==null?void 0:R.map(B=>n.Coin.fromPartial(B)))||[],I.expiration!==void 0&&I.expiration!==null&&(g.expiration=t.Timestamp.fromPartial(I.expiration)),g}};function w(){return{basic:e.BasicAllowance.fromPartial({}),period:r.Duration.fromPartial({}),periodSpendLimit:[],periodCanSpend:[],periodReset:t.Timestamp.fromPartial({})}}e.PeriodicAllowance={typeUrl:"/cosmos.feegrant.v1beta1.PeriodicAllowance",encode(I,g=h.BinaryWriter.create()){I.basic!==void 0&&e.BasicAllowance.encode(I.basic,g.uint32(10).fork()).ldelim(),I.period!==void 0&&r.Duration.encode(I.period,g.uint32(18).fork()).ldelim();for(const R of I.periodSpendLimit)n.Coin.encode(R,g.uint32(26).fork()).ldelim();for(const R of I.periodCanSpend)n.Coin.encode(R,g.uint32(34).fork()).ldelim();return I.periodReset!==void 0&&t.Timestamp.encode(I.periodReset,g.uint32(42).fork()).ldelim(),g},decode(I,g){const R=I instanceof h.BinaryReader?I:new h.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=w();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.basic=e.BasicAllowance.decode(R,R.uint32());break;case 2:d.period=r.Duration.decode(R,R.uint32());break;case 3:d.periodSpendLimit.push(n.Coin.decode(R,R.uint32()));break;case 4:d.periodCanSpend.push(n.Coin.decode(R,R.uint32()));break;case 5:d.periodReset=t.Timestamp.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=w();return(0,v.isSet)(I.basic)&&(g.basic=e.BasicAllowance.fromJSON(I.basic)),(0,v.isSet)(I.period)&&(g.period=r.Duration.fromJSON(I.period)),Array.isArray(I==null?void 0:I.periodSpendLimit)&&(g.periodSpendLimit=I.periodSpendLimit.map(R=>n.Coin.fromJSON(R))),Array.isArray(I==null?void 0:I.periodCanSpend)&&(g.periodCanSpend=I.periodCanSpend.map(R=>n.Coin.fromJSON(R))),(0,v.isSet)(I.periodReset)&&(g.periodReset=(0,v.fromJsonTimestamp)(I.periodReset)),g},toJSON(I){const g={};return I.basic!==void 0&&(g.basic=I.basic?e.BasicAllowance.toJSON(I.basic):void 0),I.period!==void 0&&(g.period=I.period?r.Duration.toJSON(I.period):void 0),I.periodSpendLimit?g.periodSpendLimit=I.periodSpendLimit.map(R=>R?n.Coin.toJSON(R):void 0):g.periodSpendLimit=[],I.periodCanSpend?g.periodCanSpend=I.periodCanSpend.map(R=>R?n.Coin.toJSON(R):void 0):g.periodCanSpend=[],I.periodReset!==void 0&&(g.periodReset=(0,v.fromTimestamp)(I.periodReset).toISOString()),g},fromPartial(I){var R,B;const g=w();return I.basic!==void 0&&I.basic!==null&&(g.basic=e.BasicAllowance.fromPartial(I.basic)),I.period!==void 0&&I.period!==null&&(g.period=r.Duration.fromPartial(I.period)),g.periodSpendLimit=((R=I.periodSpendLimit)==null?void 0:R.map(d=>n.Coin.fromPartial(d)))||[],g.periodCanSpend=((B=I.periodCanSpend)==null?void 0:B.map(d=>n.Coin.fromPartial(d)))||[],I.periodReset!==void 0&&I.periodReset!==null&&(g.periodReset=t.Timestamp.fromPartial(I.periodReset)),g}};function D(){return{allowance:void 0,allowedMessages:[]}}e.AllowedMsgAllowance={typeUrl:"/cosmos.feegrant.v1beta1.AllowedMsgAllowance",encode(I,g=h.BinaryWriter.create()){I.allowance!==void 0&&o.Any.encode(I.allowance,g.uint32(10).fork()).ldelim();for(const R of I.allowedMessages)g.uint32(18).string(R);return g},decode(I,g){const R=I instanceof h.BinaryReader?I:new h.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=D();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.allowance=o.Any.decode(R,R.uint32());break;case 2:d.allowedMessages.push(R.string());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=D();return(0,v.isSet)(I.allowance)&&(g.allowance=o.Any.fromJSON(I.allowance)),Array.isArray(I==null?void 0:I.allowedMessages)&&(g.allowedMessages=I.allowedMessages.map(R=>String(R))),g},toJSON(I){const g={};return I.allowance!==void 0&&(g.allowance=I.allowance?o.Any.toJSON(I.allowance):void 0),I.allowedMessages?g.allowedMessages=I.allowedMessages.map(R=>R):g.allowedMessages=[],g},fromPartial(I){var R;const g=D();return I.allowance!==void 0&&I.allowance!==null&&(g.allowance=o.Any.fromPartial(I.allowance)),g.allowedMessages=((R=I.allowedMessages)==null?void 0:R.map(B=>B))||[],g}};function J(){return{granter:"",grantee:"",allowance:void 0}}e.Grant={typeUrl:"/cosmos.feegrant.v1beta1.Grant",encode(I,g=h.BinaryWriter.create()){return I.granter!==""&&g.uint32(10).string(I.granter),I.grantee!==""&&g.uint32(18).string(I.grantee),I.allowance!==void 0&&o.Any.encode(I.allowance,g.uint32(26).fork()).ldelim(),g},decode(I,g){const R=I instanceof h.BinaryReader?I:new h.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=J();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.granter=R.string();break;case 2:d.grantee=R.string();break;case 3:d.allowance=o.Any.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=J();return(0,v.isSet)(I.granter)&&(g.granter=String(I.granter)),(0,v.isSet)(I.grantee)&&(g.grantee=String(I.grantee)),(0,v.isSet)(I.allowance)&&(g.allowance=o.Any.fromJSON(I.allowance)),g},toJSON(I){const g={};return I.granter!==void 0&&(g.granter=I.granter),I.grantee!==void 0&&(g.grantee=I.grantee),I.allowance!==void 0&&(g.allowance=I.allowance?o.Any.toJSON(I.allowance):void 0),g},fromPartial(I){const g=J();return g.granter=I.granter??"",g.grantee=I.grantee??"",I.allowance!==void 0&&I.allowance!==null&&(g.allowance=o.Any.fromPartial(I.allowance)),g}}})(Rm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAllowancesByGranterResponse=e.QueryAllowancesByGranterRequest=e.QueryAllowancesResponse=e.QueryAllowancesRequest=e.QueryAllowanceResponse=e.QueryAllowanceRequest=e.protobufPackage=void 0;const n=be,t=Rm,r=ee,o=ne;e.protobufPackage="cosmos.feegrant.v1beta1";function h(){return{granter:"",grantee:""}}e.QueryAllowanceRequest={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowanceRequest",encode(g,R=r.BinaryWriter.create()){return g.granter!==""&&R.uint32(10).string(g.granter),g.grantee!==""&&R.uint32(18).string(g.grantee),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=h();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.granter=B.string();break;case 2:s.grantee=B.string();break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=h();return(0,o.isSet)(g.granter)&&(R.granter=String(g.granter)),(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),R},toJSON(g){const R={};return g.granter!==void 0&&(R.granter=g.granter),g.grantee!==void 0&&(R.grantee=g.grantee),R},fromPartial(g){const R=h();return R.granter=g.granter??"",R.grantee=g.grantee??"",R}};function v(){return{allowance:void 0}}e.QueryAllowanceResponse={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowanceResponse",encode(g,R=r.BinaryWriter.create()){return g.allowance!==void 0&&t.Grant.encode(g.allowance,R.uint32(10).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=v();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.allowance=t.Grant.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=v();return(0,o.isSet)(g.allowance)&&(R.allowance=t.Grant.fromJSON(g.allowance)),R},toJSON(g){const R={};return g.allowance!==void 0&&(R.allowance=g.allowance?t.Grant.toJSON(g.allowance):void 0),R},fromPartial(g){const R=v();return g.allowance!==void 0&&g.allowance!==null&&(R.allowance=t.Grant.fromPartial(g.allowance)),R}};function C(){return{grantee:"",pagination:void 0}}e.QueryAllowancesRequest={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesRequest",encode(g,R=r.BinaryWriter.create()){return g.grantee!==""&&R.uint32(10).string(g.grantee),g.pagination!==void 0&&n.PageRequest.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=C();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.grantee=B.string();break;case 2:s.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=C();return(0,o.isSet)(g.grantee)&&(R.grantee=String(g.grantee)),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageRequest.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.grantee!==void 0&&(R.grantee=g.grantee),g.pagination!==void 0&&(R.pagination=g.pagination?n.PageRequest.toJSON(g.pagination):void 0),R},fromPartial(g){const R=C();return R.grantee=g.grantee??"",g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageRequest.fromPartial(g.pagination)),R}};function w(){return{allowances:[],pagination:void 0}}e.QueryAllowancesResponse={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.allowances)t.Grant.encode(B,R.uint32(10).fork()).ldelim();return g.pagination!==void 0&&n.PageResponse.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=w();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.allowances.push(t.Grant.decode(B,B.uint32()));break;case 2:s.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=w();return Array.isArray(g==null?void 0:g.allowances)&&(R.allowances=g.allowances.map(B=>t.Grant.fromJSON(B))),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageResponse.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.allowances?R.allowances=g.allowances.map(B=>B?t.Grant.toJSON(B):void 0):R.allowances=[],g.pagination!==void 0&&(R.pagination=g.pagination?n.PageResponse.toJSON(g.pagination):void 0),R},fromPartial(g){var B;const R=w();return R.allowances=((B=g.allowances)==null?void 0:B.map(d=>t.Grant.fromPartial(d)))||[],g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageResponse.fromPartial(g.pagination)),R}};function D(){return{granter:"",pagination:void 0}}e.QueryAllowancesByGranterRequest={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesByGranterRequest",encode(g,R=r.BinaryWriter.create()){return g.granter!==""&&R.uint32(10).string(g.granter),g.pagination!==void 0&&n.PageRequest.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=D();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.granter=B.string();break;case 2:s.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=D();return(0,o.isSet)(g.granter)&&(R.granter=String(g.granter)),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageRequest.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.granter!==void 0&&(R.granter=g.granter),g.pagination!==void 0&&(R.pagination=g.pagination?n.PageRequest.toJSON(g.pagination):void 0),R},fromPartial(g){const R=D();return R.granter=g.granter??"",g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageRequest.fromPartial(g.pagination)),R}};function J(){return{allowances:[],pagination:void 0}}e.QueryAllowancesByGranterResponse={typeUrl:"/cosmos.feegrant.v1beta1.QueryAllowancesByGranterResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.allowances)t.Grant.encode(B,R.uint32(10).fork()).ldelim();return g.pagination!==void 0&&n.PageResponse.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=J();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.allowances.push(t.Grant.decode(B,B.uint32()));break;case 2:s.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=J();return Array.isArray(g==null?void 0:g.allowances)&&(R.allowances=g.allowances.map(B=>t.Grant.fromJSON(B))),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageResponse.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.allowances?R.allowances=g.allowances.map(B=>B?t.Grant.toJSON(B):void 0):R.allowances=[],g.pagination!==void 0&&(R.pagination=g.pagination?n.PageResponse.toJSON(g.pagination):void 0),R},fromPartial(g){var B;const R=J();return R.allowances=((B=g.allowances)==null?void 0:B.map(d=>t.Grant.fromPartial(d)))||[],g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageResponse.fromPartial(g.pagination)),R}};class I{constructor(R){this.rpc=R,this.Allowance=this.Allowance.bind(this),this.Allowances=this.Allowances.bind(this),this.AllowancesByGranter=this.AllowancesByGranter.bind(this)}Allowance(R){const B=e.QueryAllowanceRequest.encode(R).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Query","Allowance",B).then(s=>e.QueryAllowanceResponse.decode(new r.BinaryReader(s)))}Allowances(R){const B=e.QueryAllowancesRequest.encode(R).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Query","Allowances",B).then(s=>e.QueryAllowancesResponse.decode(new r.BinaryReader(s)))}AllowancesByGranter(R){const B=e.QueryAllowancesByGranterRequest.encode(R).finish();return this.rpc.request("cosmos.feegrant.v1beta1.Query","AllowancesByGranter",B).then(s=>e.QueryAllowancesByGranterResponse.decode(new r.BinaryReader(s)))}}e.QueryClientImpl=I})(Pm);Object.defineProperty(rs,"__esModule",{value:!0});rs.setupFeegrantExtension=void 0;const zP=Pm,Ql=Ke;function YP(e){const n=(0,Ql.createProtobufRpcClient)(e),t=new zP.QueryClientImpl(n);return{feegrant:{allowance:async(r,o)=>await t.Allowance({granter:r,grantee:o}),allowances:async(r,o)=>await t.Allowances({grantee:r,pagination:(0,Ql.createPagination)(o)})}}}rs.setupFeegrantExtension=YP;var An={},is={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.TextProposal=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;const n=Me,t=Re,r=Mn,o=hn,h=ee,v=ne;e.protobufPackage="cosmos.gov.v1beta1";var C;(function(i){i[i.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",i[i.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",i[i.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",i[i.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",i[i.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",i[i.UNRECOGNIZED=-1]="UNRECOGNIZED"})(C||(e.VoteOption=C={}));function w(i){switch(i){case 0:case"VOTE_OPTION_UNSPECIFIED":return C.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return C.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return C.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return C.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return C.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return C.UNRECOGNIZED}}e.voteOptionFromJSON=w;function D(i){switch(i){case C.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case C.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case C.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case C.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case C.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";case C.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.voteOptionToJSON=D;var J;(function(i){i[i.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",i[i.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]="PROPOSAL_STATUS_DEPOSIT_PERIOD",i[i.PROPOSAL_STATUS_VOTING_PERIOD=2]="PROPOSAL_STATUS_VOTING_PERIOD",i[i.PROPOSAL_STATUS_PASSED=3]="PROPOSAL_STATUS_PASSED",i[i.PROPOSAL_STATUS_REJECTED=4]="PROPOSAL_STATUS_REJECTED",i[i.PROPOSAL_STATUS_FAILED=5]="PROPOSAL_STATUS_FAILED",i[i.UNRECOGNIZED=-1]="UNRECOGNIZED"})(J||(e.ProposalStatus=J={}));function I(i){switch(i){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return J.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return J.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return J.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case"PROPOSAL_STATUS_PASSED":return J.PROPOSAL_STATUS_PASSED;case 4:case"PROPOSAL_STATUS_REJECTED":return J.PROPOSAL_STATUS_REJECTED;case 5:case"PROPOSAL_STATUS_FAILED":return J.PROPOSAL_STATUS_FAILED;case-1:case"UNRECOGNIZED":default:return J.UNRECOGNIZED}}e.proposalStatusFromJSON=I;function g(i){switch(i){case J.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case J.PROPOSAL_STATUS_DEPOSIT_PERIOD:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case J.PROPOSAL_STATUS_VOTING_PERIOD:return"PROPOSAL_STATUS_VOTING_PERIOD";case J.PROPOSAL_STATUS_PASSED:return"PROPOSAL_STATUS_PASSED";case J.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case J.PROPOSAL_STATUS_FAILED:return"PROPOSAL_STATUS_FAILED";case J.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalStatusToJSON=g;function R(){return{option:0,weight:""}}e.WeightedVoteOption={typeUrl:"/cosmos.gov.v1beta1.WeightedVoteOption",encode(i,m=h.BinaryWriter.create()){return i.option!==0&&m.uint32(8).int32(i.option),i.weight!==""&&m.uint32(18).string(i.weight),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=R();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.option=N.int32();break;case 2:u.weight=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=R();return(0,v.isSet)(i.option)&&(m.option=w(i.option)),(0,v.isSet)(i.weight)&&(m.weight=String(i.weight)),m},toJSON(i){const m={};return i.option!==void 0&&(m.option=D(i.option)),i.weight!==void 0&&(m.weight=i.weight),m},fromPartial(i){const m=R();return m.option=i.option??0,m.weight=i.weight??"",m}};function B(){return{title:"",description:""}}e.TextProposal={typeUrl:"/cosmos.gov.v1beta1.TextProposal",encode(i,m=h.BinaryWriter.create()){return i.title!==""&&m.uint32(10).string(i.title),i.description!==""&&m.uint32(18).string(i.description),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=B();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.title=N.string();break;case 2:u.description=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=B();return(0,v.isSet)(i.title)&&(m.title=String(i.title)),(0,v.isSet)(i.description)&&(m.description=String(i.description)),m},toJSON(i){const m={};return i.title!==void 0&&(m.title=i.title),i.description!==void 0&&(m.description=i.description),m},fromPartial(i){const m=B();return m.title=i.title??"",m.description=i.description??"",m}};function d(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.Deposit={typeUrl:"/cosmos.gov.v1beta1.Deposit",encode(i,m=h.BinaryWriter.create()){i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.depositor!==""&&m.uint32(18).string(i.depositor);for(const N of i.amount)n.Coin.encode(N,m.uint32(26).fork()).ldelim();return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=d();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.depositor=N.string();break;case 3:u.amount.push(n.Coin.decode(N,N.uint32()));break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=d();return(0,v.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,v.isSet)(i.depositor)&&(m.depositor=String(i.depositor)),Array.isArray(i==null?void 0:i.amount)&&(m.amount=i.amount.map(N=>n.Coin.fromJSON(N))),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.depositor!==void 0&&(m.depositor=i.depositor),i.amount?m.amount=i.amount.map(N=>N?n.Coin.toJSON(N):void 0):m.amount=[],m},fromPartial(i){var N;const m=d();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m.depositor=i.depositor??"",m.amount=((N=i.amount)==null?void 0:N.map(V=>n.Coin.fromPartial(V)))||[],m}};function s(){return{proposalId:BigInt(0),content:void 0,status:0,finalTallyResult:e.TallyResult.fromPartial({}),submitTime:r.Timestamp.fromPartial({}),depositEndTime:r.Timestamp.fromPartial({}),totalDeposit:[],votingStartTime:r.Timestamp.fromPartial({}),votingEndTime:r.Timestamp.fromPartial({})}}e.Proposal={typeUrl:"/cosmos.gov.v1beta1.Proposal",encode(i,m=h.BinaryWriter.create()){i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.content!==void 0&&t.Any.encode(i.content,m.uint32(18).fork()).ldelim(),i.status!==0&&m.uint32(24).int32(i.status),i.finalTallyResult!==void 0&&e.TallyResult.encode(i.finalTallyResult,m.uint32(34).fork()).ldelim(),i.submitTime!==void 0&&r.Timestamp.encode(i.submitTime,m.uint32(42).fork()).ldelim(),i.depositEndTime!==void 0&&r.Timestamp.encode(i.depositEndTime,m.uint32(50).fork()).ldelim();for(const N of i.totalDeposit)n.Coin.encode(N,m.uint32(58).fork()).ldelim();return i.votingStartTime!==void 0&&r.Timestamp.encode(i.votingStartTime,m.uint32(66).fork()).ldelim(),i.votingEndTime!==void 0&&r.Timestamp.encode(i.votingEndTime,m.uint32(74).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=s();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.content=t.Any.decode(N,N.uint32());break;case 3:u.status=N.int32();break;case 4:u.finalTallyResult=e.TallyResult.decode(N,N.uint32());break;case 5:u.submitTime=r.Timestamp.decode(N,N.uint32());break;case 6:u.depositEndTime=r.Timestamp.decode(N,N.uint32());break;case 7:u.totalDeposit.push(n.Coin.decode(N,N.uint32()));break;case 8:u.votingStartTime=r.Timestamp.decode(N,N.uint32());break;case 9:u.votingEndTime=r.Timestamp.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=s();return(0,v.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,v.isSet)(i.content)&&(m.content=t.Any.fromJSON(i.content)),(0,v.isSet)(i.status)&&(m.status=I(i.status)),(0,v.isSet)(i.finalTallyResult)&&(m.finalTallyResult=e.TallyResult.fromJSON(i.finalTallyResult)),(0,v.isSet)(i.submitTime)&&(m.submitTime=(0,v.fromJsonTimestamp)(i.submitTime)),(0,v.isSet)(i.depositEndTime)&&(m.depositEndTime=(0,v.fromJsonTimestamp)(i.depositEndTime)),Array.isArray(i==null?void 0:i.totalDeposit)&&(m.totalDeposit=i.totalDeposit.map(N=>n.Coin.fromJSON(N))),(0,v.isSet)(i.votingStartTime)&&(m.votingStartTime=(0,v.fromJsonTimestamp)(i.votingStartTime)),(0,v.isSet)(i.votingEndTime)&&(m.votingEndTime=(0,v.fromJsonTimestamp)(i.votingEndTime)),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.content!==void 0&&(m.content=i.content?t.Any.toJSON(i.content):void 0),i.status!==void 0&&(m.status=g(i.status)),i.finalTallyResult!==void 0&&(m.finalTallyResult=i.finalTallyResult?e.TallyResult.toJSON(i.finalTallyResult):void 0),i.submitTime!==void 0&&(m.submitTime=(0,v.fromTimestamp)(i.submitTime).toISOString()),i.depositEndTime!==void 0&&(m.depositEndTime=(0,v.fromTimestamp)(i.depositEndTime).toISOString()),i.totalDeposit?m.totalDeposit=i.totalDeposit.map(N=>N?n.Coin.toJSON(N):void 0):m.totalDeposit=[],i.votingStartTime!==void 0&&(m.votingStartTime=(0,v.fromTimestamp)(i.votingStartTime).toISOString()),i.votingEndTime!==void 0&&(m.votingEndTime=(0,v.fromTimestamp)(i.votingEndTime).toISOString()),m},fromPartial(i){var N;const m=s();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),i.content!==void 0&&i.content!==null&&(m.content=t.Any.fromPartial(i.content)),m.status=i.status??0,i.finalTallyResult!==void 0&&i.finalTallyResult!==null&&(m.finalTallyResult=e.TallyResult.fromPartial(i.finalTallyResult)),i.submitTime!==void 0&&i.submitTime!==null&&(m.submitTime=r.Timestamp.fromPartial(i.submitTime)),i.depositEndTime!==void 0&&i.depositEndTime!==null&&(m.depositEndTime=r.Timestamp.fromPartial(i.depositEndTime)),m.totalDeposit=((N=i.totalDeposit)==null?void 0:N.map(V=>n.Coin.fromPartial(V)))||[],i.votingStartTime!==void 0&&i.votingStartTime!==null&&(m.votingStartTime=r.Timestamp.fromPartial(i.votingStartTime)),i.votingEndTime!==void 0&&i.votingEndTime!==null&&(m.votingEndTime=r.Timestamp.fromPartial(i.votingEndTime)),m}};function y(){return{yes:"",abstain:"",no:"",noWithVeto:""}}e.TallyResult={typeUrl:"/cosmos.gov.v1beta1.TallyResult",encode(i,m=h.BinaryWriter.create()){return i.yes!==""&&m.uint32(10).string(i.yes),i.abstain!==""&&m.uint32(18).string(i.abstain),i.no!==""&&m.uint32(26).string(i.no),i.noWithVeto!==""&&m.uint32(34).string(i.noWithVeto),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=y();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.yes=N.string();break;case 2:u.abstain=N.string();break;case 3:u.no=N.string();break;case 4:u.noWithVeto=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=y();return(0,v.isSet)(i.yes)&&(m.yes=String(i.yes)),(0,v.isSet)(i.abstain)&&(m.abstain=String(i.abstain)),(0,v.isSet)(i.no)&&(m.no=String(i.no)),(0,v.isSet)(i.noWithVeto)&&(m.noWithVeto=String(i.noWithVeto)),m},toJSON(i){const m={};return i.yes!==void 0&&(m.yes=i.yes),i.abstain!==void 0&&(m.abstain=i.abstain),i.no!==void 0&&(m.no=i.no),i.noWithVeto!==void 0&&(m.noWithVeto=i.noWithVeto),m},fromPartial(i){const m=y();return m.yes=i.yes??"",m.abstain=i.abstain??"",m.no=i.no??"",m.noWithVeto=i.noWithVeto??"",m}};function E(){return{proposalId:BigInt(0),voter:"",option:0,options:[]}}e.Vote={typeUrl:"/cosmos.gov.v1beta1.Vote",encode(i,m=h.BinaryWriter.create()){i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.voter!==""&&m.uint32(18).string(i.voter),i.option!==0&&m.uint32(24).int32(i.option);for(const N of i.options)e.WeightedVoteOption.encode(N,m.uint32(34).fork()).ldelim();return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=E();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.voter=N.string();break;case 3:u.option=N.int32();break;case 4:u.options.push(e.WeightedVoteOption.decode(N,N.uint32()));break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=E();return(0,v.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,v.isSet)(i.voter)&&(m.voter=String(i.voter)),(0,v.isSet)(i.option)&&(m.option=w(i.option)),Array.isArray(i==null?void 0:i.options)&&(m.options=i.options.map(N=>e.WeightedVoteOption.fromJSON(N))),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.voter!==void 0&&(m.voter=i.voter),i.option!==void 0&&(m.option=D(i.option)),i.options?m.options=i.options.map(N=>N?e.WeightedVoteOption.toJSON(N):void 0):m.options=[],m},fromPartial(i){var N;const m=E();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m.voter=i.voter??"",m.option=i.option??0,m.options=((N=i.options)==null?void 0:N.map(V=>e.WeightedVoteOption.fromPartial(V)))||[],m}};function _(){return{minDeposit:[],maxDepositPeriod:o.Duration.fromPartial({})}}e.DepositParams={typeUrl:"/cosmos.gov.v1beta1.DepositParams",encode(i,m=h.BinaryWriter.create()){for(const N of i.minDeposit)n.Coin.encode(N,m.uint32(10).fork()).ldelim();return i.maxDepositPeriod!==void 0&&o.Duration.encode(i.maxDepositPeriod,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=_();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.minDeposit.push(n.Coin.decode(N,N.uint32()));break;case 2:u.maxDepositPeriod=o.Duration.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=_();return Array.isArray(i==null?void 0:i.minDeposit)&&(m.minDeposit=i.minDeposit.map(N=>n.Coin.fromJSON(N))),(0,v.isSet)(i.maxDepositPeriod)&&(m.maxDepositPeriod=o.Duration.fromJSON(i.maxDepositPeriod)),m},toJSON(i){const m={};return i.minDeposit?m.minDeposit=i.minDeposit.map(N=>N?n.Coin.toJSON(N):void 0):m.minDeposit=[],i.maxDepositPeriod!==void 0&&(m.maxDepositPeriod=i.maxDepositPeriod?o.Duration.toJSON(i.maxDepositPeriod):void 0),m},fromPartial(i){var N;const m=_();return m.minDeposit=((N=i.minDeposit)==null?void 0:N.map(V=>n.Coin.fromPartial(V)))||[],i.maxDepositPeriod!==void 0&&i.maxDepositPeriod!==null&&(m.maxDepositPeriod=o.Duration.fromPartial(i.maxDepositPeriod)),m}};function U(){return{votingPeriod:o.Duration.fromPartial({})}}e.VotingParams={typeUrl:"/cosmos.gov.v1beta1.VotingParams",encode(i,m=h.BinaryWriter.create()){return i.votingPeriod!==void 0&&o.Duration.encode(i.votingPeriod,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=U();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.votingPeriod=o.Duration.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=U();return(0,v.isSet)(i.votingPeriod)&&(m.votingPeriod=o.Duration.fromJSON(i.votingPeriod)),m},toJSON(i){const m={};return i.votingPeriod!==void 0&&(m.votingPeriod=i.votingPeriod?o.Duration.toJSON(i.votingPeriod):void 0),m},fromPartial(i){const m=U();return i.votingPeriod!==void 0&&i.votingPeriod!==null&&(m.votingPeriod=o.Duration.fromPartial(i.votingPeriod)),m}};function H(){return{quorum:new Uint8Array,threshold:new Uint8Array,vetoThreshold:new Uint8Array}}e.TallyParams={typeUrl:"/cosmos.gov.v1beta1.TallyParams",encode(i,m=h.BinaryWriter.create()){return i.quorum.length!==0&&m.uint32(10).bytes(i.quorum),i.threshold.length!==0&&m.uint32(18).bytes(i.threshold),i.vetoThreshold.length!==0&&m.uint32(26).bytes(i.vetoThreshold),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=H();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.quorum=N.bytes();break;case 2:u.threshold=N.bytes();break;case 3:u.vetoThreshold=N.bytes();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=H();return(0,v.isSet)(i.quorum)&&(m.quorum=(0,v.bytesFromBase64)(i.quorum)),(0,v.isSet)(i.threshold)&&(m.threshold=(0,v.bytesFromBase64)(i.threshold)),(0,v.isSet)(i.vetoThreshold)&&(m.vetoThreshold=(0,v.bytesFromBase64)(i.vetoThreshold)),m},toJSON(i){const m={};return i.quorum!==void 0&&(m.quorum=(0,v.base64FromBytes)(i.quorum!==void 0?i.quorum:new Uint8Array)),i.threshold!==void 0&&(m.threshold=(0,v.base64FromBytes)(i.threshold!==void 0?i.threshold:new Uint8Array)),i.vetoThreshold!==void 0&&(m.vetoThreshold=(0,v.base64FromBytes)(i.vetoThreshold!==void 0?i.vetoThreshold:new Uint8Array)),m},fromPartial(i){const m=H();return m.quorum=i.quorum??new Uint8Array,m.threshold=i.threshold??new Uint8Array,m.vetoThreshold=i.vetoThreshold??new Uint8Array,m}}})(is);Object.defineProperty(An,"__esModule",{value:!0});An.createGovAminoConverters=An.isAminoMsgDeposit=An.isAminoMsgVoteWeighted=An.isAminoMsgVote=An.isAminoMsgSubmitProposal=void 0;const ZP=Te,Ji=Oe,Di=is,XP=Re,xP=Ke;function jP(e){return e.type==="cosmos-sdk/MsgSubmitProposal"}An.isAminoMsgSubmitProposal=jP;function eR(e){return e.type==="cosmos-sdk/MsgVote"}An.isAminoMsgVote=eR;function nR(e){return e.type==="cosmos-sdk/MsgVoteWeighted"}An.isAminoMsgVoteWeighted=nR;function tR(e){return e.type==="cosmos-sdk/MsgDeposit"}An.isAminoMsgDeposit=tR;function rR(){return{"/cosmos.gov.v1beta1.MsgDeposit":{aminoType:"cosmos-sdk/MsgDeposit",toAmino:({amount:e,depositor:n,proposalId:t})=>({amount:e,depositor:n,proposal_id:t.toString()}),fromAmino:({amount:e,depositor:n,proposal_id:t})=>({amount:Array.from(e),depositor:n,proposalId:BigInt(t)})},"/cosmos.gov.v1beta1.MsgVote":{aminoType:"cosmos-sdk/MsgVote",toAmino:({option:e,proposalId:n,voter:t})=>({option:e,proposal_id:n.toString(),voter:t}),fromAmino:({option:e,proposal_id:n,voter:t})=>({option:(0,Di.voteOptionFromJSON)(e),proposalId:BigInt(n),voter:t})},"/cosmos.gov.v1beta1.MsgVoteWeighted":{aminoType:"cosmos-sdk/MsgVoteWeighted",toAmino:({options:e,proposalId:n,voter:t})=>({options:e.map(r=>({option:r.option,weight:(0,xP.decodeCosmosSdkDecFromProto)(r.weight).toString().padEnd(20,"0")})),proposal_id:n.toString(),voter:t}),fromAmino:({options:e,proposal_id:n,voter:t})=>({proposalId:BigInt(n),voter:t,options:e.map(r=>({option:(0,Di.voteOptionFromJSON)(r.option),weight:ZP.Decimal.fromUserInput(r.weight,18).atomics}))})},"/cosmos.gov.v1beta1.MsgSubmitProposal":{aminoType:"cosmos-sdk/MsgSubmitProposal",toAmino:({initialDeposit:e,proposer:n,content:t})=>{(0,Ji.assertDefinedAndNotNull)(t);let r;switch(t.typeUrl){case"/cosmos.gov.v1beta1.TextProposal":{const o=Di.TextProposal.decode(t.value);r={type:"cosmos-sdk/TextProposal",value:{description:o.description,title:o.title}};break}default:throw new Error(`Unsupported proposal type: '${t.typeUrl}'`)}return{initial_deposit:e,proposer:n,content:r}},fromAmino:({initial_deposit:e,proposer:n,content:t})=>{let r;switch(t.type){case"cosmos-sdk/TextProposal":{const{value:o}=t;(0,Ji.assert)((0,Ji.isNonNullObject)(o));const{title:h,description:v}=o;(0,Ji.assert)(typeof h=="string"),(0,Ji.assert)(typeof v=="string"),r=XP.Any.fromPartial({typeUrl:"/cosmos.gov.v1beta1.TextProposal",value:Di.TextProposal.encode(Di.TextProposal.fromPartial({title:h,description:v})).finish()});break}default:throw new Error(`Unsupported proposal type: '${t.type}'`)}return{initialDeposit:Array.from(e),proposer:n,content:r}}}}}An.createGovAminoConverters=rR;var In={},vm={},Bm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.TallyParams=e.VotingParams=e.DepositParams=e.Vote=e.TallyResult=e.Proposal=e.Deposit=e.WeightedVoteOption=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;const n=Me,t=Re,r=Mn,o=hn,h=ee,v=ne;e.protobufPackage="cosmos.gov.v1";var C;(function(i){i[i.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",i[i.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",i[i.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",i[i.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",i[i.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",i[i.UNRECOGNIZED=-1]="UNRECOGNIZED"})(C||(e.VoteOption=C={}));function w(i){switch(i){case 0:case"VOTE_OPTION_UNSPECIFIED":return C.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return C.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return C.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return C.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return C.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return C.UNRECOGNIZED}}e.voteOptionFromJSON=w;function D(i){switch(i){case C.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case C.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case C.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case C.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case C.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";case C.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.voteOptionToJSON=D;var J;(function(i){i[i.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",i[i.PROPOSAL_STATUS_DEPOSIT_PERIOD=1]="PROPOSAL_STATUS_DEPOSIT_PERIOD",i[i.PROPOSAL_STATUS_VOTING_PERIOD=2]="PROPOSAL_STATUS_VOTING_PERIOD",i[i.PROPOSAL_STATUS_PASSED=3]="PROPOSAL_STATUS_PASSED",i[i.PROPOSAL_STATUS_REJECTED=4]="PROPOSAL_STATUS_REJECTED",i[i.PROPOSAL_STATUS_FAILED=5]="PROPOSAL_STATUS_FAILED",i[i.UNRECOGNIZED=-1]="UNRECOGNIZED"})(J||(e.ProposalStatus=J={}));function I(i){switch(i){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return J.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_DEPOSIT_PERIOD":return J.PROPOSAL_STATUS_DEPOSIT_PERIOD;case 2:case"PROPOSAL_STATUS_VOTING_PERIOD":return J.PROPOSAL_STATUS_VOTING_PERIOD;case 3:case"PROPOSAL_STATUS_PASSED":return J.PROPOSAL_STATUS_PASSED;case 4:case"PROPOSAL_STATUS_REJECTED":return J.PROPOSAL_STATUS_REJECTED;case 5:case"PROPOSAL_STATUS_FAILED":return J.PROPOSAL_STATUS_FAILED;case-1:case"UNRECOGNIZED":default:return J.UNRECOGNIZED}}e.proposalStatusFromJSON=I;function g(i){switch(i){case J.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case J.PROPOSAL_STATUS_DEPOSIT_PERIOD:return"PROPOSAL_STATUS_DEPOSIT_PERIOD";case J.PROPOSAL_STATUS_VOTING_PERIOD:return"PROPOSAL_STATUS_VOTING_PERIOD";case J.PROPOSAL_STATUS_PASSED:return"PROPOSAL_STATUS_PASSED";case J.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case J.PROPOSAL_STATUS_FAILED:return"PROPOSAL_STATUS_FAILED";case J.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalStatusToJSON=g;function R(){return{option:0,weight:""}}e.WeightedVoteOption={typeUrl:"/cosmos.gov.v1.WeightedVoteOption",encode(i,m=h.BinaryWriter.create()){return i.option!==0&&m.uint32(8).int32(i.option),i.weight!==""&&m.uint32(18).string(i.weight),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=R();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.option=N.int32();break;case 2:u.weight=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=R();return(0,v.isSet)(i.option)&&(m.option=w(i.option)),(0,v.isSet)(i.weight)&&(m.weight=String(i.weight)),m},toJSON(i){const m={};return i.option!==void 0&&(m.option=D(i.option)),i.weight!==void 0&&(m.weight=i.weight),m},fromPartial(i){const m=R();return m.option=i.option??0,m.weight=i.weight??"",m}};function B(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.Deposit={typeUrl:"/cosmos.gov.v1.Deposit",encode(i,m=h.BinaryWriter.create()){i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.depositor!==""&&m.uint32(18).string(i.depositor);for(const N of i.amount)n.Coin.encode(N,m.uint32(26).fork()).ldelim();return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=B();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.depositor=N.string();break;case 3:u.amount.push(n.Coin.decode(N,N.uint32()));break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=B();return(0,v.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,v.isSet)(i.depositor)&&(m.depositor=String(i.depositor)),Array.isArray(i==null?void 0:i.amount)&&(m.amount=i.amount.map(N=>n.Coin.fromJSON(N))),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.depositor!==void 0&&(m.depositor=i.depositor),i.amount?m.amount=i.amount.map(N=>N?n.Coin.toJSON(N):void 0):m.amount=[],m},fromPartial(i){var N;const m=B();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m.depositor=i.depositor??"",m.amount=((N=i.amount)==null?void 0:N.map(V=>n.Coin.fromPartial(V)))||[],m}};function d(){return{id:BigInt(0),messages:[],status:0,finalTallyResult:void 0,submitTime:void 0,depositEndTime:void 0,totalDeposit:[],votingStartTime:void 0,votingEndTime:void 0,metadata:"",title:"",summary:"",proposer:""}}e.Proposal={typeUrl:"/cosmos.gov.v1.Proposal",encode(i,m=h.BinaryWriter.create()){i.id!==BigInt(0)&&m.uint32(8).uint64(i.id);for(const N of i.messages)t.Any.encode(N,m.uint32(18).fork()).ldelim();i.status!==0&&m.uint32(24).int32(i.status),i.finalTallyResult!==void 0&&e.TallyResult.encode(i.finalTallyResult,m.uint32(34).fork()).ldelim(),i.submitTime!==void 0&&r.Timestamp.encode(i.submitTime,m.uint32(42).fork()).ldelim(),i.depositEndTime!==void 0&&r.Timestamp.encode(i.depositEndTime,m.uint32(50).fork()).ldelim();for(const N of i.totalDeposit)n.Coin.encode(N,m.uint32(58).fork()).ldelim();return i.votingStartTime!==void 0&&r.Timestamp.encode(i.votingStartTime,m.uint32(66).fork()).ldelim(),i.votingEndTime!==void 0&&r.Timestamp.encode(i.votingEndTime,m.uint32(74).fork()).ldelim(),i.metadata!==""&&m.uint32(82).string(i.metadata),i.title!==""&&m.uint32(90).string(i.title),i.summary!==""&&m.uint32(98).string(i.summary),i.proposer!==""&&m.uint32(106).string(i.proposer),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=d();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.id=N.uint64();break;case 2:u.messages.push(t.Any.decode(N,N.uint32()));break;case 3:u.status=N.int32();break;case 4:u.finalTallyResult=e.TallyResult.decode(N,N.uint32());break;case 5:u.submitTime=r.Timestamp.decode(N,N.uint32());break;case 6:u.depositEndTime=r.Timestamp.decode(N,N.uint32());break;case 7:u.totalDeposit.push(n.Coin.decode(N,N.uint32()));break;case 8:u.votingStartTime=r.Timestamp.decode(N,N.uint32());break;case 9:u.votingEndTime=r.Timestamp.decode(N,N.uint32());break;case 10:u.metadata=N.string();break;case 11:u.title=N.string();break;case 12:u.summary=N.string();break;case 13:u.proposer=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=d();return(0,v.isSet)(i.id)&&(m.id=BigInt(i.id.toString())),Array.isArray(i==null?void 0:i.messages)&&(m.messages=i.messages.map(N=>t.Any.fromJSON(N))),(0,v.isSet)(i.status)&&(m.status=I(i.status)),(0,v.isSet)(i.finalTallyResult)&&(m.finalTallyResult=e.TallyResult.fromJSON(i.finalTallyResult)),(0,v.isSet)(i.submitTime)&&(m.submitTime=(0,v.fromJsonTimestamp)(i.submitTime)),(0,v.isSet)(i.depositEndTime)&&(m.depositEndTime=(0,v.fromJsonTimestamp)(i.depositEndTime)),Array.isArray(i==null?void 0:i.totalDeposit)&&(m.totalDeposit=i.totalDeposit.map(N=>n.Coin.fromJSON(N))),(0,v.isSet)(i.votingStartTime)&&(m.votingStartTime=(0,v.fromJsonTimestamp)(i.votingStartTime)),(0,v.isSet)(i.votingEndTime)&&(m.votingEndTime=(0,v.fromJsonTimestamp)(i.votingEndTime)),(0,v.isSet)(i.metadata)&&(m.metadata=String(i.metadata)),(0,v.isSet)(i.title)&&(m.title=String(i.title)),(0,v.isSet)(i.summary)&&(m.summary=String(i.summary)),(0,v.isSet)(i.proposer)&&(m.proposer=String(i.proposer)),m},toJSON(i){const m={};return i.id!==void 0&&(m.id=(i.id||BigInt(0)).toString()),i.messages?m.messages=i.messages.map(N=>N?t.Any.toJSON(N):void 0):m.messages=[],i.status!==void 0&&(m.status=g(i.status)),i.finalTallyResult!==void 0&&(m.finalTallyResult=i.finalTallyResult?e.TallyResult.toJSON(i.finalTallyResult):void 0),i.submitTime!==void 0&&(m.submitTime=(0,v.fromTimestamp)(i.submitTime).toISOString()),i.depositEndTime!==void 0&&(m.depositEndTime=(0,v.fromTimestamp)(i.depositEndTime).toISOString()),i.totalDeposit?m.totalDeposit=i.totalDeposit.map(N=>N?n.Coin.toJSON(N):void 0):m.totalDeposit=[],i.votingStartTime!==void 0&&(m.votingStartTime=(0,v.fromTimestamp)(i.votingStartTime).toISOString()),i.votingEndTime!==void 0&&(m.votingEndTime=(0,v.fromTimestamp)(i.votingEndTime).toISOString()),i.metadata!==void 0&&(m.metadata=i.metadata),i.title!==void 0&&(m.title=i.title),i.summary!==void 0&&(m.summary=i.summary),i.proposer!==void 0&&(m.proposer=i.proposer),m},fromPartial(i){var N,V;const m=d();return i.id!==void 0&&i.id!==null&&(m.id=BigInt(i.id.toString())),m.messages=((N=i.messages)==null?void 0:N.map(u=>t.Any.fromPartial(u)))||[],m.status=i.status??0,i.finalTallyResult!==void 0&&i.finalTallyResult!==null&&(m.finalTallyResult=e.TallyResult.fromPartial(i.finalTallyResult)),i.submitTime!==void 0&&i.submitTime!==null&&(m.submitTime=r.Timestamp.fromPartial(i.submitTime)),i.depositEndTime!==void 0&&i.depositEndTime!==null&&(m.depositEndTime=r.Timestamp.fromPartial(i.depositEndTime)),m.totalDeposit=((V=i.totalDeposit)==null?void 0:V.map(u=>n.Coin.fromPartial(u)))||[],i.votingStartTime!==void 0&&i.votingStartTime!==null&&(m.votingStartTime=r.Timestamp.fromPartial(i.votingStartTime)),i.votingEndTime!==void 0&&i.votingEndTime!==null&&(m.votingEndTime=r.Timestamp.fromPartial(i.votingEndTime)),m.metadata=i.metadata??"",m.title=i.title??"",m.summary=i.summary??"",m.proposer=i.proposer??"",m}};function s(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}e.TallyResult={typeUrl:"/cosmos.gov.v1.TallyResult",encode(i,m=h.BinaryWriter.create()){return i.yesCount!==""&&m.uint32(10).string(i.yesCount),i.abstainCount!==""&&m.uint32(18).string(i.abstainCount),i.noCount!==""&&m.uint32(26).string(i.noCount),i.noWithVetoCount!==""&&m.uint32(34).string(i.noWithVetoCount),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=s();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.yesCount=N.string();break;case 2:u.abstainCount=N.string();break;case 3:u.noCount=N.string();break;case 4:u.noWithVetoCount=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=s();return(0,v.isSet)(i.yesCount)&&(m.yesCount=String(i.yesCount)),(0,v.isSet)(i.abstainCount)&&(m.abstainCount=String(i.abstainCount)),(0,v.isSet)(i.noCount)&&(m.noCount=String(i.noCount)),(0,v.isSet)(i.noWithVetoCount)&&(m.noWithVetoCount=String(i.noWithVetoCount)),m},toJSON(i){const m={};return i.yesCount!==void 0&&(m.yesCount=i.yesCount),i.abstainCount!==void 0&&(m.abstainCount=i.abstainCount),i.noCount!==void 0&&(m.noCount=i.noCount),i.noWithVetoCount!==void 0&&(m.noWithVetoCount=i.noWithVetoCount),m},fromPartial(i){const m=s();return m.yesCount=i.yesCount??"",m.abstainCount=i.abstainCount??"",m.noCount=i.noCount??"",m.noWithVetoCount=i.noWithVetoCount??"",m}};function y(){return{proposalId:BigInt(0),voter:"",options:[],metadata:""}}e.Vote={typeUrl:"/cosmos.gov.v1.Vote",encode(i,m=h.BinaryWriter.create()){i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.voter!==""&&m.uint32(18).string(i.voter);for(const N of i.options)e.WeightedVoteOption.encode(N,m.uint32(34).fork()).ldelim();return i.metadata!==""&&m.uint32(42).string(i.metadata),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=y();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.voter=N.string();break;case 4:u.options.push(e.WeightedVoteOption.decode(N,N.uint32()));break;case 5:u.metadata=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=y();return(0,v.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,v.isSet)(i.voter)&&(m.voter=String(i.voter)),Array.isArray(i==null?void 0:i.options)&&(m.options=i.options.map(N=>e.WeightedVoteOption.fromJSON(N))),(0,v.isSet)(i.metadata)&&(m.metadata=String(i.metadata)),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.voter!==void 0&&(m.voter=i.voter),i.options?m.options=i.options.map(N=>N?e.WeightedVoteOption.toJSON(N):void 0):m.options=[],i.metadata!==void 0&&(m.metadata=i.metadata),m},fromPartial(i){var N;const m=y();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m.voter=i.voter??"",m.options=((N=i.options)==null?void 0:N.map(V=>e.WeightedVoteOption.fromPartial(V)))||[],m.metadata=i.metadata??"",m}};function E(){return{minDeposit:[],maxDepositPeriod:void 0}}e.DepositParams={typeUrl:"/cosmos.gov.v1.DepositParams",encode(i,m=h.BinaryWriter.create()){for(const N of i.minDeposit)n.Coin.encode(N,m.uint32(10).fork()).ldelim();return i.maxDepositPeriod!==void 0&&o.Duration.encode(i.maxDepositPeriod,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=E();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.minDeposit.push(n.Coin.decode(N,N.uint32()));break;case 2:u.maxDepositPeriod=o.Duration.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=E();return Array.isArray(i==null?void 0:i.minDeposit)&&(m.minDeposit=i.minDeposit.map(N=>n.Coin.fromJSON(N))),(0,v.isSet)(i.maxDepositPeriod)&&(m.maxDepositPeriod=o.Duration.fromJSON(i.maxDepositPeriod)),m},toJSON(i){const m={};return i.minDeposit?m.minDeposit=i.minDeposit.map(N=>N?n.Coin.toJSON(N):void 0):m.minDeposit=[],i.maxDepositPeriod!==void 0&&(m.maxDepositPeriod=i.maxDepositPeriod?o.Duration.toJSON(i.maxDepositPeriod):void 0),m},fromPartial(i){var N;const m=E();return m.minDeposit=((N=i.minDeposit)==null?void 0:N.map(V=>n.Coin.fromPartial(V)))||[],i.maxDepositPeriod!==void 0&&i.maxDepositPeriod!==null&&(m.maxDepositPeriod=o.Duration.fromPartial(i.maxDepositPeriod)),m}};function _(){return{votingPeriod:void 0}}e.VotingParams={typeUrl:"/cosmos.gov.v1.VotingParams",encode(i,m=h.BinaryWriter.create()){return i.votingPeriod!==void 0&&o.Duration.encode(i.votingPeriod,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=_();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.votingPeriod=o.Duration.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=_();return(0,v.isSet)(i.votingPeriod)&&(m.votingPeriod=o.Duration.fromJSON(i.votingPeriod)),m},toJSON(i){const m={};return i.votingPeriod!==void 0&&(m.votingPeriod=i.votingPeriod?o.Duration.toJSON(i.votingPeriod):void 0),m},fromPartial(i){const m=_();return i.votingPeriod!==void 0&&i.votingPeriod!==null&&(m.votingPeriod=o.Duration.fromPartial(i.votingPeriod)),m}};function U(){return{quorum:"",threshold:"",vetoThreshold:""}}e.TallyParams={typeUrl:"/cosmos.gov.v1.TallyParams",encode(i,m=h.BinaryWriter.create()){return i.quorum!==""&&m.uint32(10).string(i.quorum),i.threshold!==""&&m.uint32(18).string(i.threshold),i.vetoThreshold!==""&&m.uint32(26).string(i.vetoThreshold),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=U();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.quorum=N.string();break;case 2:u.threshold=N.string();break;case 3:u.vetoThreshold=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=U();return(0,v.isSet)(i.quorum)&&(m.quorum=String(i.quorum)),(0,v.isSet)(i.threshold)&&(m.threshold=String(i.threshold)),(0,v.isSet)(i.vetoThreshold)&&(m.vetoThreshold=String(i.vetoThreshold)),m},toJSON(i){const m={};return i.quorum!==void 0&&(m.quorum=i.quorum),i.threshold!==void 0&&(m.threshold=i.threshold),i.vetoThreshold!==void 0&&(m.vetoThreshold=i.vetoThreshold),m},fromPartial(i){const m=U();return m.quorum=i.quorum??"",m.threshold=i.threshold??"",m.vetoThreshold=i.vetoThreshold??"",m}};function H(){return{minDeposit:[],maxDepositPeriod:void 0,votingPeriod:void 0,quorum:"",threshold:"",vetoThreshold:"",minInitialDepositRatio:"",burnVoteQuorum:!1,burnProposalDepositPrevote:!1,burnVoteVeto:!1}}e.Params={typeUrl:"/cosmos.gov.v1.Params",encode(i,m=h.BinaryWriter.create()){for(const N of i.minDeposit)n.Coin.encode(N,m.uint32(10).fork()).ldelim();return i.maxDepositPeriod!==void 0&&o.Duration.encode(i.maxDepositPeriod,m.uint32(18).fork()).ldelim(),i.votingPeriod!==void 0&&o.Duration.encode(i.votingPeriod,m.uint32(26).fork()).ldelim(),i.quorum!==""&&m.uint32(34).string(i.quorum),i.threshold!==""&&m.uint32(42).string(i.threshold),i.vetoThreshold!==""&&m.uint32(50).string(i.vetoThreshold),i.minInitialDepositRatio!==""&&m.uint32(58).string(i.minInitialDepositRatio),i.burnVoteQuorum===!0&&m.uint32(104).bool(i.burnVoteQuorum),i.burnProposalDepositPrevote===!0&&m.uint32(112).bool(i.burnProposalDepositPrevote),i.burnVoteVeto===!0&&m.uint32(120).bool(i.burnVoteVeto),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=H();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.minDeposit.push(n.Coin.decode(N,N.uint32()));break;case 2:u.maxDepositPeriod=o.Duration.decode(N,N.uint32());break;case 3:u.votingPeriod=o.Duration.decode(N,N.uint32());break;case 4:u.quorum=N.string();break;case 5:u.threshold=N.string();break;case 6:u.vetoThreshold=N.string();break;case 7:u.minInitialDepositRatio=N.string();break;case 13:u.burnVoteQuorum=N.bool();break;case 14:u.burnProposalDepositPrevote=N.bool();break;case 15:u.burnVoteVeto=N.bool();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=H();return Array.isArray(i==null?void 0:i.minDeposit)&&(m.minDeposit=i.minDeposit.map(N=>n.Coin.fromJSON(N))),(0,v.isSet)(i.maxDepositPeriod)&&(m.maxDepositPeriod=o.Duration.fromJSON(i.maxDepositPeriod)),(0,v.isSet)(i.votingPeriod)&&(m.votingPeriod=o.Duration.fromJSON(i.votingPeriod)),(0,v.isSet)(i.quorum)&&(m.quorum=String(i.quorum)),(0,v.isSet)(i.threshold)&&(m.threshold=String(i.threshold)),(0,v.isSet)(i.vetoThreshold)&&(m.vetoThreshold=String(i.vetoThreshold)),(0,v.isSet)(i.minInitialDepositRatio)&&(m.minInitialDepositRatio=String(i.minInitialDepositRatio)),(0,v.isSet)(i.burnVoteQuorum)&&(m.burnVoteQuorum=!!i.burnVoteQuorum),(0,v.isSet)(i.burnProposalDepositPrevote)&&(m.burnProposalDepositPrevote=!!i.burnProposalDepositPrevote),(0,v.isSet)(i.burnVoteVeto)&&(m.burnVoteVeto=!!i.burnVoteVeto),m},toJSON(i){const m={};return i.minDeposit?m.minDeposit=i.minDeposit.map(N=>N?n.Coin.toJSON(N):void 0):m.minDeposit=[],i.maxDepositPeriod!==void 0&&(m.maxDepositPeriod=i.maxDepositPeriod?o.Duration.toJSON(i.maxDepositPeriod):void 0),i.votingPeriod!==void 0&&(m.votingPeriod=i.votingPeriod?o.Duration.toJSON(i.votingPeriod):void 0),i.quorum!==void 0&&(m.quorum=i.quorum),i.threshold!==void 0&&(m.threshold=i.threshold),i.vetoThreshold!==void 0&&(m.vetoThreshold=i.vetoThreshold),i.minInitialDepositRatio!==void 0&&(m.minInitialDepositRatio=i.minInitialDepositRatio),i.burnVoteQuorum!==void 0&&(m.burnVoteQuorum=i.burnVoteQuorum),i.burnProposalDepositPrevote!==void 0&&(m.burnProposalDepositPrevote=i.burnProposalDepositPrevote),i.burnVoteVeto!==void 0&&(m.burnVoteVeto=i.burnVoteVeto),m},fromPartial(i){var N;const m=H();return m.minDeposit=((N=i.minDeposit)==null?void 0:N.map(V=>n.Coin.fromPartial(V)))||[],i.maxDepositPeriod!==void 0&&i.maxDepositPeriod!==null&&(m.maxDepositPeriod=o.Duration.fromPartial(i.maxDepositPeriod)),i.votingPeriod!==void 0&&i.votingPeriod!==null&&(m.votingPeriod=o.Duration.fromPartial(i.votingPeriod)),m.quorum=i.quorum??"",m.threshold=i.threshold??"",m.vetoThreshold=i.vetoThreshold??"",m.minInitialDepositRatio=i.minInitialDepositRatio??"",m.burnVoteQuorum=i.burnVoteQuorum??!1,m.burnProposalDepositPrevote=i.burnProposalDepositPrevote??!1,m.burnVoteVeto=i.burnVoteVeto??!1,m}}})(Bm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgExecLegacyContentResponse=e.MsgExecLegacyContent=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;const n=Re,t=Me,r=Bm,o=ee,h=ne;e.protobufPackage="cosmos.gov.v1";function v(){return{messages:[],initialDeposit:[],proposer:"",metadata:"",title:"",summary:""}}e.MsgSubmitProposal={typeUrl:"/cosmos.gov.v1.MsgSubmitProposal",encode(_,U=o.BinaryWriter.create()){for(const H of _.messages)n.Any.encode(H,U.uint32(10).fork()).ldelim();for(const H of _.initialDeposit)t.Coin.encode(H,U.uint32(18).fork()).ldelim();return _.proposer!==""&&U.uint32(26).string(_.proposer),_.metadata!==""&&U.uint32(34).string(_.metadata),_.title!==""&&U.uint32(42).string(_.title),_.summary!==""&&U.uint32(50).string(_.summary),U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=v();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.messages.push(n.Any.decode(H,H.uint32()));break;case 2:m.initialDeposit.push(t.Coin.decode(H,H.uint32()));break;case 3:m.proposer=H.string();break;case 4:m.metadata=H.string();break;case 5:m.title=H.string();break;case 6:m.summary=H.string();break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=v();return Array.isArray(_==null?void 0:_.messages)&&(U.messages=_.messages.map(H=>n.Any.fromJSON(H))),Array.isArray(_==null?void 0:_.initialDeposit)&&(U.initialDeposit=_.initialDeposit.map(H=>t.Coin.fromJSON(H))),(0,h.isSet)(_.proposer)&&(U.proposer=String(_.proposer)),(0,h.isSet)(_.metadata)&&(U.metadata=String(_.metadata)),(0,h.isSet)(_.title)&&(U.title=String(_.title)),(0,h.isSet)(_.summary)&&(U.summary=String(_.summary)),U},toJSON(_){const U={};return _.messages?U.messages=_.messages.map(H=>H?n.Any.toJSON(H):void 0):U.messages=[],_.initialDeposit?U.initialDeposit=_.initialDeposit.map(H=>H?t.Coin.toJSON(H):void 0):U.initialDeposit=[],_.proposer!==void 0&&(U.proposer=_.proposer),_.metadata!==void 0&&(U.metadata=_.metadata),_.title!==void 0&&(U.title=_.title),_.summary!==void 0&&(U.summary=_.summary),U},fromPartial(_){var H,i;const U=v();return U.messages=((H=_.messages)==null?void 0:H.map(m=>n.Any.fromPartial(m)))||[],U.initialDeposit=((i=_.initialDeposit)==null?void 0:i.map(m=>t.Coin.fromPartial(m)))||[],U.proposer=_.proposer??"",U.metadata=_.metadata??"",U.title=_.title??"",U.summary=_.summary??"",U}};function C(){return{proposalId:BigInt(0)}}e.MsgSubmitProposalResponse={typeUrl:"/cosmos.gov.v1.MsgSubmitProposalResponse",encode(_,U=o.BinaryWriter.create()){return _.proposalId!==BigInt(0)&&U.uint32(8).uint64(_.proposalId),U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=C();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.proposalId=H.uint64();break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=C();return(0,h.isSet)(_.proposalId)&&(U.proposalId=BigInt(_.proposalId.toString())),U},toJSON(_){const U={};return _.proposalId!==void 0&&(U.proposalId=(_.proposalId||BigInt(0)).toString()),U},fromPartial(_){const U=C();return _.proposalId!==void 0&&_.proposalId!==null&&(U.proposalId=BigInt(_.proposalId.toString())),U}};function w(){return{content:void 0,authority:""}}e.MsgExecLegacyContent={typeUrl:"/cosmos.gov.v1.MsgExecLegacyContent",encode(_,U=o.BinaryWriter.create()){return _.content!==void 0&&n.Any.encode(_.content,U.uint32(10).fork()).ldelim(),_.authority!==""&&U.uint32(18).string(_.authority),U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=w();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.content=n.Any.decode(H,H.uint32());break;case 2:m.authority=H.string();break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=w();return(0,h.isSet)(_.content)&&(U.content=n.Any.fromJSON(_.content)),(0,h.isSet)(_.authority)&&(U.authority=String(_.authority)),U},toJSON(_){const U={};return _.content!==void 0&&(U.content=_.content?n.Any.toJSON(_.content):void 0),_.authority!==void 0&&(U.authority=_.authority),U},fromPartial(_){const U=w();return _.content!==void 0&&_.content!==null&&(U.content=n.Any.fromPartial(_.content)),U.authority=_.authority??"",U}};function D(){return{}}e.MsgExecLegacyContentResponse={typeUrl:"/cosmos.gov.v1.MsgExecLegacyContentResponse",encode(_,U=o.BinaryWriter.create()){return U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=D();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){default:H.skipType(N&7);break}}return m},fromJSON(_){return D()},toJSON(_){return{}},fromPartial(_){return D()}};function J(){return{proposalId:BigInt(0),voter:"",option:0,metadata:""}}e.MsgVote={typeUrl:"/cosmos.gov.v1.MsgVote",encode(_,U=o.BinaryWriter.create()){return _.proposalId!==BigInt(0)&&U.uint32(8).uint64(_.proposalId),_.voter!==""&&U.uint32(18).string(_.voter),_.option!==0&&U.uint32(24).int32(_.option),_.metadata!==""&&U.uint32(34).string(_.metadata),U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=J();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.proposalId=H.uint64();break;case 2:m.voter=H.string();break;case 3:m.option=H.int32();break;case 4:m.metadata=H.string();break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=J();return(0,h.isSet)(_.proposalId)&&(U.proposalId=BigInt(_.proposalId.toString())),(0,h.isSet)(_.voter)&&(U.voter=String(_.voter)),(0,h.isSet)(_.option)&&(U.option=(0,r.voteOptionFromJSON)(_.option)),(0,h.isSet)(_.metadata)&&(U.metadata=String(_.metadata)),U},toJSON(_){const U={};return _.proposalId!==void 0&&(U.proposalId=(_.proposalId||BigInt(0)).toString()),_.voter!==void 0&&(U.voter=_.voter),_.option!==void 0&&(U.option=(0,r.voteOptionToJSON)(_.option)),_.metadata!==void 0&&(U.metadata=_.metadata),U},fromPartial(_){const U=J();return _.proposalId!==void 0&&_.proposalId!==null&&(U.proposalId=BigInt(_.proposalId.toString())),U.voter=_.voter??"",U.option=_.option??0,U.metadata=_.metadata??"",U}};function I(){return{}}e.MsgVoteResponse={typeUrl:"/cosmos.gov.v1.MsgVoteResponse",encode(_,U=o.BinaryWriter.create()){return U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=I();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){default:H.skipType(N&7);break}}return m},fromJSON(_){return I()},toJSON(_){return{}},fromPartial(_){return I()}};function g(){return{proposalId:BigInt(0),voter:"",options:[],metadata:""}}e.MsgVoteWeighted={typeUrl:"/cosmos.gov.v1.MsgVoteWeighted",encode(_,U=o.BinaryWriter.create()){_.proposalId!==BigInt(0)&&U.uint32(8).uint64(_.proposalId),_.voter!==""&&U.uint32(18).string(_.voter);for(const H of _.options)r.WeightedVoteOption.encode(H,U.uint32(26).fork()).ldelim();return _.metadata!==""&&U.uint32(34).string(_.metadata),U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=g();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.proposalId=H.uint64();break;case 2:m.voter=H.string();break;case 3:m.options.push(r.WeightedVoteOption.decode(H,H.uint32()));break;case 4:m.metadata=H.string();break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=g();return(0,h.isSet)(_.proposalId)&&(U.proposalId=BigInt(_.proposalId.toString())),(0,h.isSet)(_.voter)&&(U.voter=String(_.voter)),Array.isArray(_==null?void 0:_.options)&&(U.options=_.options.map(H=>r.WeightedVoteOption.fromJSON(H))),(0,h.isSet)(_.metadata)&&(U.metadata=String(_.metadata)),U},toJSON(_){const U={};return _.proposalId!==void 0&&(U.proposalId=(_.proposalId||BigInt(0)).toString()),_.voter!==void 0&&(U.voter=_.voter),_.options?U.options=_.options.map(H=>H?r.WeightedVoteOption.toJSON(H):void 0):U.options=[],_.metadata!==void 0&&(U.metadata=_.metadata),U},fromPartial(_){var H;const U=g();return _.proposalId!==void 0&&_.proposalId!==null&&(U.proposalId=BigInt(_.proposalId.toString())),U.voter=_.voter??"",U.options=((H=_.options)==null?void 0:H.map(i=>r.WeightedVoteOption.fromPartial(i)))||[],U.metadata=_.metadata??"",U}};function R(){return{}}e.MsgVoteWeightedResponse={typeUrl:"/cosmos.gov.v1.MsgVoteWeightedResponse",encode(_,U=o.BinaryWriter.create()){return U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=R();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){default:H.skipType(N&7);break}}return m},fromJSON(_){return R()},toJSON(_){return{}},fromPartial(_){return R()}};function B(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.MsgDeposit={typeUrl:"/cosmos.gov.v1.MsgDeposit",encode(_,U=o.BinaryWriter.create()){_.proposalId!==BigInt(0)&&U.uint32(8).uint64(_.proposalId),_.depositor!==""&&U.uint32(18).string(_.depositor);for(const H of _.amount)t.Coin.encode(H,U.uint32(26).fork()).ldelim();return U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=B();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.proposalId=H.uint64();break;case 2:m.depositor=H.string();break;case 3:m.amount.push(t.Coin.decode(H,H.uint32()));break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=B();return(0,h.isSet)(_.proposalId)&&(U.proposalId=BigInt(_.proposalId.toString())),(0,h.isSet)(_.depositor)&&(U.depositor=String(_.depositor)),Array.isArray(_==null?void 0:_.amount)&&(U.amount=_.amount.map(H=>t.Coin.fromJSON(H))),U},toJSON(_){const U={};return _.proposalId!==void 0&&(U.proposalId=(_.proposalId||BigInt(0)).toString()),_.depositor!==void 0&&(U.depositor=_.depositor),_.amount?U.amount=_.amount.map(H=>H?t.Coin.toJSON(H):void 0):U.amount=[],U},fromPartial(_){var H;const U=B();return _.proposalId!==void 0&&_.proposalId!==null&&(U.proposalId=BigInt(_.proposalId.toString())),U.depositor=_.depositor??"",U.amount=((H=_.amount)==null?void 0:H.map(i=>t.Coin.fromPartial(i)))||[],U}};function d(){return{}}e.MsgDepositResponse={typeUrl:"/cosmos.gov.v1.MsgDepositResponse",encode(_,U=o.BinaryWriter.create()){return U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=d();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){default:H.skipType(N&7);break}}return m},fromJSON(_){return d()},toJSON(_){return{}},fromPartial(_){return d()}};function s(){return{authority:"",params:r.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.gov.v1.MsgUpdateParams",encode(_,U=o.BinaryWriter.create()){return _.authority!==""&&U.uint32(10).string(_.authority),_.params!==void 0&&r.Params.encode(_.params,U.uint32(18).fork()).ldelim(),U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=s();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){case 1:m.authority=H.string();break;case 2:m.params=r.Params.decode(H,H.uint32());break;default:H.skipType(N&7);break}}return m},fromJSON(_){const U=s();return(0,h.isSet)(_.authority)&&(U.authority=String(_.authority)),(0,h.isSet)(_.params)&&(U.params=r.Params.fromJSON(_.params)),U},toJSON(_){const U={};return _.authority!==void 0&&(U.authority=_.authority),_.params!==void 0&&(U.params=_.params?r.Params.toJSON(_.params):void 0),U},fromPartial(_){const U=s();return U.authority=_.authority??"",_.params!==void 0&&_.params!==null&&(U.params=r.Params.fromPartial(_.params)),U}};function y(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.gov.v1.MsgUpdateParamsResponse",encode(_,U=o.BinaryWriter.create()){return U},decode(_,U){const H=_ instanceof o.BinaryReader?_:new o.BinaryReader(_);let i=U===void 0?H.len:H.pos+U;const m=y();for(;H.pos<i;){const N=H.uint32();switch(N>>>3){default:H.skipType(N&7);break}}return m},fromJSON(_){return y()},toJSON(_){return{}},fromPartial(_){return y()}};class E{constructor(U){this.rpc=U,this.SubmitProposal=this.SubmitProposal.bind(this),this.ExecLegacyContent=this.ExecLegacyContent.bind(this),this.Vote=this.Vote.bind(this),this.VoteWeighted=this.VoteWeighted.bind(this),this.Deposit=this.Deposit.bind(this),this.UpdateParams=this.UpdateParams.bind(this)}SubmitProposal(U){const H=e.MsgSubmitProposal.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","SubmitProposal",H).then(m=>e.MsgSubmitProposalResponse.decode(new o.BinaryReader(m)))}ExecLegacyContent(U){const H=e.MsgExecLegacyContent.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","ExecLegacyContent",H).then(m=>e.MsgExecLegacyContentResponse.decode(new o.BinaryReader(m)))}Vote(U){const H=e.MsgVote.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","Vote",H).then(m=>e.MsgVoteResponse.decode(new o.BinaryReader(m)))}VoteWeighted(U){const H=e.MsgVoteWeighted.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","VoteWeighted",H).then(m=>e.MsgVoteWeightedResponse.decode(new o.BinaryReader(m)))}Deposit(U){const H=e.MsgDeposit.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","Deposit",H).then(m=>e.MsgDepositResponse.decode(new o.BinaryReader(m)))}UpdateParams(U){const H=e.MsgUpdateParams.encode(U).finish();return this.rpc.request("cosmos.gov.v1.Msg","UpdateParams",H).then(m=>e.MsgUpdateParamsResponse.decode(new o.BinaryReader(m)))}}e.MsgClientImpl=E})(vm);var bm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgDepositResponse=e.MsgDeposit=e.MsgVoteWeightedResponse=e.MsgVoteWeighted=e.MsgVoteResponse=e.MsgVote=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.protobufPackage=void 0;const n=Re,t=Me,r=is,o=ee,h=ne;e.protobufPackage="cosmos.gov.v1beta1";function v(){return{content:void 0,initialDeposit:[],proposer:""}}e.MsgSubmitProposal={typeUrl:"/cosmos.gov.v1beta1.MsgSubmitProposal",encode(d,s=o.BinaryWriter.create()){d.content!==void 0&&n.Any.encode(d.content,s.uint32(10).fork()).ldelim();for(const y of d.initialDeposit)t.Coin.encode(y,s.uint32(18).fork()).ldelim();return d.proposer!==""&&s.uint32(26).string(d.proposer),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=v();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.content=n.Any.decode(y,y.uint32());break;case 2:_.initialDeposit.push(t.Coin.decode(y,y.uint32()));break;case 3:_.proposer=y.string();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=v();return(0,h.isSet)(d.content)&&(s.content=n.Any.fromJSON(d.content)),Array.isArray(d==null?void 0:d.initialDeposit)&&(s.initialDeposit=d.initialDeposit.map(y=>t.Coin.fromJSON(y))),(0,h.isSet)(d.proposer)&&(s.proposer=String(d.proposer)),s},toJSON(d){const s={};return d.content!==void 0&&(s.content=d.content?n.Any.toJSON(d.content):void 0),d.initialDeposit?s.initialDeposit=d.initialDeposit.map(y=>y?t.Coin.toJSON(y):void 0):s.initialDeposit=[],d.proposer!==void 0&&(s.proposer=d.proposer),s},fromPartial(d){var y;const s=v();return d.content!==void 0&&d.content!==null&&(s.content=n.Any.fromPartial(d.content)),s.initialDeposit=((y=d.initialDeposit)==null?void 0:y.map(E=>t.Coin.fromPartial(E)))||[],s.proposer=d.proposer??"",s}};function C(){return{proposalId:BigInt(0)}}e.MsgSubmitProposalResponse={typeUrl:"/cosmos.gov.v1beta1.MsgSubmitProposalResponse",encode(d,s=o.BinaryWriter.create()){return d.proposalId!==BigInt(0)&&s.uint32(8).uint64(d.proposalId),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=C();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.proposalId=y.uint64();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=C();return(0,h.isSet)(d.proposalId)&&(s.proposalId=BigInt(d.proposalId.toString())),s},toJSON(d){const s={};return d.proposalId!==void 0&&(s.proposalId=(d.proposalId||BigInt(0)).toString()),s},fromPartial(d){const s=C();return d.proposalId!==void 0&&d.proposalId!==null&&(s.proposalId=BigInt(d.proposalId.toString())),s}};function w(){return{proposalId:BigInt(0),voter:"",option:0}}e.MsgVote={typeUrl:"/cosmos.gov.v1beta1.MsgVote",encode(d,s=o.BinaryWriter.create()){return d.proposalId!==BigInt(0)&&s.uint32(8).uint64(d.proposalId),d.voter!==""&&s.uint32(18).string(d.voter),d.option!==0&&s.uint32(24).int32(d.option),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=w();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.proposalId=y.uint64();break;case 2:_.voter=y.string();break;case 3:_.option=y.int32();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=w();return(0,h.isSet)(d.proposalId)&&(s.proposalId=BigInt(d.proposalId.toString())),(0,h.isSet)(d.voter)&&(s.voter=String(d.voter)),(0,h.isSet)(d.option)&&(s.option=(0,r.voteOptionFromJSON)(d.option)),s},toJSON(d){const s={};return d.proposalId!==void 0&&(s.proposalId=(d.proposalId||BigInt(0)).toString()),d.voter!==void 0&&(s.voter=d.voter),d.option!==void 0&&(s.option=(0,r.voteOptionToJSON)(d.option)),s},fromPartial(d){const s=w();return d.proposalId!==void 0&&d.proposalId!==null&&(s.proposalId=BigInt(d.proposalId.toString())),s.voter=d.voter??"",s.option=d.option??0,s}};function D(){return{}}e.MsgVoteResponse={typeUrl:"/cosmos.gov.v1beta1.MsgVoteResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=D();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return D()},toJSON(d){return{}},fromPartial(d){return D()}};function J(){return{proposalId:BigInt(0),voter:"",options:[]}}e.MsgVoteWeighted={typeUrl:"/cosmos.gov.v1beta1.MsgVoteWeighted",encode(d,s=o.BinaryWriter.create()){d.proposalId!==BigInt(0)&&s.uint32(8).uint64(d.proposalId),d.voter!==""&&s.uint32(18).string(d.voter);for(const y of d.options)r.WeightedVoteOption.encode(y,s.uint32(26).fork()).ldelim();return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=J();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.proposalId=y.uint64();break;case 2:_.voter=y.string();break;case 3:_.options.push(r.WeightedVoteOption.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=J();return(0,h.isSet)(d.proposalId)&&(s.proposalId=BigInt(d.proposalId.toString())),(0,h.isSet)(d.voter)&&(s.voter=String(d.voter)),Array.isArray(d==null?void 0:d.options)&&(s.options=d.options.map(y=>r.WeightedVoteOption.fromJSON(y))),s},toJSON(d){const s={};return d.proposalId!==void 0&&(s.proposalId=(d.proposalId||BigInt(0)).toString()),d.voter!==void 0&&(s.voter=d.voter),d.options?s.options=d.options.map(y=>y?r.WeightedVoteOption.toJSON(y):void 0):s.options=[],s},fromPartial(d){var y;const s=J();return d.proposalId!==void 0&&d.proposalId!==null&&(s.proposalId=BigInt(d.proposalId.toString())),s.voter=d.voter??"",s.options=((y=d.options)==null?void 0:y.map(E=>r.WeightedVoteOption.fromPartial(E)))||[],s}};function I(){return{}}e.MsgVoteWeightedResponse={typeUrl:"/cosmos.gov.v1beta1.MsgVoteWeightedResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=I();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return I()},toJSON(d){return{}},fromPartial(d){return I()}};function g(){return{proposalId:BigInt(0),depositor:"",amount:[]}}e.MsgDeposit={typeUrl:"/cosmos.gov.v1beta1.MsgDeposit",encode(d,s=o.BinaryWriter.create()){d.proposalId!==BigInt(0)&&s.uint32(8).uint64(d.proposalId),d.depositor!==""&&s.uint32(18).string(d.depositor);for(const y of d.amount)t.Coin.encode(y,s.uint32(26).fork()).ldelim();return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=g();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.proposalId=y.uint64();break;case 2:_.depositor=y.string();break;case 3:_.amount.push(t.Coin.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=g();return(0,h.isSet)(d.proposalId)&&(s.proposalId=BigInt(d.proposalId.toString())),(0,h.isSet)(d.depositor)&&(s.depositor=String(d.depositor)),Array.isArray(d==null?void 0:d.amount)&&(s.amount=d.amount.map(y=>t.Coin.fromJSON(y))),s},toJSON(d){const s={};return d.proposalId!==void 0&&(s.proposalId=(d.proposalId||BigInt(0)).toString()),d.depositor!==void 0&&(s.depositor=d.depositor),d.amount?s.amount=d.amount.map(y=>y?t.Coin.toJSON(y):void 0):s.amount=[],s},fromPartial(d){var y;const s=g();return d.proposalId!==void 0&&d.proposalId!==null&&(s.proposalId=BigInt(d.proposalId.toString())),s.depositor=d.depositor??"",s.amount=((y=d.amount)==null?void 0:y.map(E=>t.Coin.fromPartial(E)))||[],s}};function R(){return{}}e.MsgDepositResponse={typeUrl:"/cosmos.gov.v1beta1.MsgDepositResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=R();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return R()},toJSON(d){return{}},fromPartial(d){return R()}};class B{constructor(s){this.rpc=s,this.SubmitProposal=this.SubmitProposal.bind(this),this.Vote=this.Vote.bind(this),this.VoteWeighted=this.VoteWeighted.bind(this),this.Deposit=this.Deposit.bind(this)}SubmitProposal(s){const y=e.MsgSubmitProposal.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","SubmitProposal",y).then(_=>e.MsgSubmitProposalResponse.decode(new o.BinaryReader(_)))}Vote(s){const y=e.MsgVote.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","Vote",y).then(_=>e.MsgVoteResponse.decode(new o.BinaryReader(_)))}VoteWeighted(s){const y=e.MsgVoteWeighted.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","VoteWeighted",y).then(_=>e.MsgVoteWeightedResponse.decode(new o.BinaryReader(_)))}Deposit(s){const y=e.MsgDeposit.encode(s).finish();return this.rpc.request("cosmos.gov.v1beta1.Msg","Deposit",y).then(_=>e.MsgDepositResponse.decode(new o.BinaryReader(_)))}}e.MsgClientImpl=B})(bm);Object.defineProperty(In,"__esModule",{value:!0});In.isMsgVoteWeightedEncodeObject=In.isMsgVoteEncodeObject=In.isMsgSubmitProposalEncodeObject=In.isMsgDepositEncodeObject=In.govTypes=void 0;const Mi=vm,Do=bm;In.govTypes=[["/cosmos.gov.v1.MsgDeposit",Mi.MsgDeposit],["/cosmos.gov.v1.MsgSubmitProposal",Mi.MsgSubmitProposal],["/cosmos.gov.v1.MsgUpdateParams",Mi.MsgUpdateParams],["/cosmos.gov.v1.MsgVote",Mi.MsgVote],["/cosmos.gov.v1.MsgVoteWeighted",Mi.MsgVoteWeighted],["/cosmos.gov.v1beta1.MsgDeposit",Do.MsgDeposit],["/cosmos.gov.v1beta1.MsgSubmitProposal",Do.MsgSubmitProposal],["/cosmos.gov.v1beta1.MsgVote",Do.MsgVote],["/cosmos.gov.v1beta1.MsgVoteWeighted",Do.MsgVoteWeighted]];function iR(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgDeposit"}In.isMsgDepositEncodeObject=iR;function oR(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgSubmitProposal"}In.isMsgSubmitProposalEncodeObject=oR;function aR(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVote"}In.isMsgVoteEncodeObject=aR;function sR(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVoteWeighted"}In.isMsgVoteWeightedEncodeObject=sR;var os={},Om={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryTallyResultResponse=e.QueryTallyResultRequest=e.QueryDepositsResponse=e.QueryDepositsRequest=e.QueryDepositResponse=e.QueryDepositRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryVotesResponse=e.QueryVotesRequest=e.QueryVoteResponse=e.QueryVoteRequest=e.QueryProposalsResponse=e.QueryProposalsRequest=e.QueryProposalResponse=e.QueryProposalRequest=e.protobufPackage=void 0;const n=is,t=be,r=ee,o=ne;e.protobufPackage="cosmos.gov.v1beta1";function h(){return{proposalId:BigInt(0)}}e.QueryProposalRequest={typeUrl:"/cosmos.gov.v1beta1.QueryProposalRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=h();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=h();return(0,o.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),m},fromPartial(i){const m=h();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m}};function v(){return{proposal:n.Proposal.fromPartial({})}}e.QueryProposalResponse={typeUrl:"/cosmos.gov.v1beta1.QueryProposalResponse",encode(i,m=r.BinaryWriter.create()){return i.proposal!==void 0&&n.Proposal.encode(i.proposal,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=v();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposal=n.Proposal.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=v();return(0,o.isSet)(i.proposal)&&(m.proposal=n.Proposal.fromJSON(i.proposal)),m},toJSON(i){const m={};return i.proposal!==void 0&&(m.proposal=i.proposal?n.Proposal.toJSON(i.proposal):void 0),m},fromPartial(i){const m=v();return i.proposal!==void 0&&i.proposal!==null&&(m.proposal=n.Proposal.fromPartial(i.proposal)),m}};function C(){return{proposalStatus:0,voter:"",depositor:"",pagination:void 0}}e.QueryProposalsRequest={typeUrl:"/cosmos.gov.v1beta1.QueryProposalsRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalStatus!==0&&m.uint32(8).int32(i.proposalStatus),i.voter!==""&&m.uint32(18).string(i.voter),i.depositor!==""&&m.uint32(26).string(i.depositor),i.pagination!==void 0&&t.PageRequest.encode(i.pagination,m.uint32(34).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=C();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalStatus=N.int32();break;case 2:u.voter=N.string();break;case 3:u.depositor=N.string();break;case 4:u.pagination=t.PageRequest.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=C();return(0,o.isSet)(i.proposalStatus)&&(m.proposalStatus=(0,n.proposalStatusFromJSON)(i.proposalStatus)),(0,o.isSet)(i.voter)&&(m.voter=String(i.voter)),(0,o.isSet)(i.depositor)&&(m.depositor=String(i.depositor)),(0,o.isSet)(i.pagination)&&(m.pagination=t.PageRequest.fromJSON(i.pagination)),m},toJSON(i){const m={};return i.proposalStatus!==void 0&&(m.proposalStatus=(0,n.proposalStatusToJSON)(i.proposalStatus)),i.voter!==void 0&&(m.voter=i.voter),i.depositor!==void 0&&(m.depositor=i.depositor),i.pagination!==void 0&&(m.pagination=i.pagination?t.PageRequest.toJSON(i.pagination):void 0),m},fromPartial(i){const m=C();return m.proposalStatus=i.proposalStatus??0,m.voter=i.voter??"",m.depositor=i.depositor??"",i.pagination!==void 0&&i.pagination!==null&&(m.pagination=t.PageRequest.fromPartial(i.pagination)),m}};function w(){return{proposals:[],pagination:void 0}}e.QueryProposalsResponse={typeUrl:"/cosmos.gov.v1beta1.QueryProposalsResponse",encode(i,m=r.BinaryWriter.create()){for(const N of i.proposals)n.Proposal.encode(N,m.uint32(10).fork()).ldelim();return i.pagination!==void 0&&t.PageResponse.encode(i.pagination,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=w();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposals.push(n.Proposal.decode(N,N.uint32()));break;case 2:u.pagination=t.PageResponse.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=w();return Array.isArray(i==null?void 0:i.proposals)&&(m.proposals=i.proposals.map(N=>n.Proposal.fromJSON(N))),(0,o.isSet)(i.pagination)&&(m.pagination=t.PageResponse.fromJSON(i.pagination)),m},toJSON(i){const m={};return i.proposals?m.proposals=i.proposals.map(N=>N?n.Proposal.toJSON(N):void 0):m.proposals=[],i.pagination!==void 0&&(m.pagination=i.pagination?t.PageResponse.toJSON(i.pagination):void 0),m},fromPartial(i){var N;const m=w();return m.proposals=((N=i.proposals)==null?void 0:N.map(V=>n.Proposal.fromPartial(V)))||[],i.pagination!==void 0&&i.pagination!==null&&(m.pagination=t.PageResponse.fromPartial(i.pagination)),m}};function D(){return{proposalId:BigInt(0),voter:""}}e.QueryVoteRequest={typeUrl:"/cosmos.gov.v1beta1.QueryVoteRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.voter!==""&&m.uint32(18).string(i.voter),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=D();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.voter=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=D();return(0,o.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,o.isSet)(i.voter)&&(m.voter=String(i.voter)),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.voter!==void 0&&(m.voter=i.voter),m},fromPartial(i){const m=D();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m.voter=i.voter??"",m}};function J(){return{vote:n.Vote.fromPartial({})}}e.QueryVoteResponse={typeUrl:"/cosmos.gov.v1beta1.QueryVoteResponse",encode(i,m=r.BinaryWriter.create()){return i.vote!==void 0&&n.Vote.encode(i.vote,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=J();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.vote=n.Vote.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=J();return(0,o.isSet)(i.vote)&&(m.vote=n.Vote.fromJSON(i.vote)),m},toJSON(i){const m={};return i.vote!==void 0&&(m.vote=i.vote?n.Vote.toJSON(i.vote):void 0),m},fromPartial(i){const m=J();return i.vote!==void 0&&i.vote!==null&&(m.vote=n.Vote.fromPartial(i.vote)),m}};function I(){return{proposalId:BigInt(0),pagination:void 0}}e.QueryVotesRequest={typeUrl:"/cosmos.gov.v1beta1.QueryVotesRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.pagination!==void 0&&t.PageRequest.encode(i.pagination,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=I();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.pagination=t.PageRequest.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=I();return(0,o.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,o.isSet)(i.pagination)&&(m.pagination=t.PageRequest.fromJSON(i.pagination)),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.pagination!==void 0&&(m.pagination=i.pagination?t.PageRequest.toJSON(i.pagination):void 0),m},fromPartial(i){const m=I();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),i.pagination!==void 0&&i.pagination!==null&&(m.pagination=t.PageRequest.fromPartial(i.pagination)),m}};function g(){return{votes:[],pagination:void 0}}e.QueryVotesResponse={typeUrl:"/cosmos.gov.v1beta1.QueryVotesResponse",encode(i,m=r.BinaryWriter.create()){for(const N of i.votes)n.Vote.encode(N,m.uint32(10).fork()).ldelim();return i.pagination!==void 0&&t.PageResponse.encode(i.pagination,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=g();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.votes.push(n.Vote.decode(N,N.uint32()));break;case 2:u.pagination=t.PageResponse.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=g();return Array.isArray(i==null?void 0:i.votes)&&(m.votes=i.votes.map(N=>n.Vote.fromJSON(N))),(0,o.isSet)(i.pagination)&&(m.pagination=t.PageResponse.fromJSON(i.pagination)),m},toJSON(i){const m={};return i.votes?m.votes=i.votes.map(N=>N?n.Vote.toJSON(N):void 0):m.votes=[],i.pagination!==void 0&&(m.pagination=i.pagination?t.PageResponse.toJSON(i.pagination):void 0),m},fromPartial(i){var N;const m=g();return m.votes=((N=i.votes)==null?void 0:N.map(V=>n.Vote.fromPartial(V)))||[],i.pagination!==void 0&&i.pagination!==null&&(m.pagination=t.PageResponse.fromPartial(i.pagination)),m}};function R(){return{paramsType:""}}e.QueryParamsRequest={typeUrl:"/cosmos.gov.v1beta1.QueryParamsRequest",encode(i,m=r.BinaryWriter.create()){return i.paramsType!==""&&m.uint32(10).string(i.paramsType),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=R();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.paramsType=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=R();return(0,o.isSet)(i.paramsType)&&(m.paramsType=String(i.paramsType)),m},toJSON(i){const m={};return i.paramsType!==void 0&&(m.paramsType=i.paramsType),m},fromPartial(i){const m=R();return m.paramsType=i.paramsType??"",m}};function B(){return{votingParams:n.VotingParams.fromPartial({}),depositParams:n.DepositParams.fromPartial({}),tallyParams:n.TallyParams.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.gov.v1beta1.QueryParamsResponse",encode(i,m=r.BinaryWriter.create()){return i.votingParams!==void 0&&n.VotingParams.encode(i.votingParams,m.uint32(10).fork()).ldelim(),i.depositParams!==void 0&&n.DepositParams.encode(i.depositParams,m.uint32(18).fork()).ldelim(),i.tallyParams!==void 0&&n.TallyParams.encode(i.tallyParams,m.uint32(26).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=B();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.votingParams=n.VotingParams.decode(N,N.uint32());break;case 2:u.depositParams=n.DepositParams.decode(N,N.uint32());break;case 3:u.tallyParams=n.TallyParams.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=B();return(0,o.isSet)(i.votingParams)&&(m.votingParams=n.VotingParams.fromJSON(i.votingParams)),(0,o.isSet)(i.depositParams)&&(m.depositParams=n.DepositParams.fromJSON(i.depositParams)),(0,o.isSet)(i.tallyParams)&&(m.tallyParams=n.TallyParams.fromJSON(i.tallyParams)),m},toJSON(i){const m={};return i.votingParams!==void 0&&(m.votingParams=i.votingParams?n.VotingParams.toJSON(i.votingParams):void 0),i.depositParams!==void 0&&(m.depositParams=i.depositParams?n.DepositParams.toJSON(i.depositParams):void 0),i.tallyParams!==void 0&&(m.tallyParams=i.tallyParams?n.TallyParams.toJSON(i.tallyParams):void 0),m},fromPartial(i){const m=B();return i.votingParams!==void 0&&i.votingParams!==null&&(m.votingParams=n.VotingParams.fromPartial(i.votingParams)),i.depositParams!==void 0&&i.depositParams!==null&&(m.depositParams=n.DepositParams.fromPartial(i.depositParams)),i.tallyParams!==void 0&&i.tallyParams!==null&&(m.tallyParams=n.TallyParams.fromPartial(i.tallyParams)),m}};function d(){return{proposalId:BigInt(0),depositor:""}}e.QueryDepositRequest={typeUrl:"/cosmos.gov.v1beta1.QueryDepositRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.depositor!==""&&m.uint32(18).string(i.depositor),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=d();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.depositor=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=d();return(0,o.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,o.isSet)(i.depositor)&&(m.depositor=String(i.depositor)),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.depositor!==void 0&&(m.depositor=i.depositor),m},fromPartial(i){const m=d();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m.depositor=i.depositor??"",m}};function s(){return{deposit:n.Deposit.fromPartial({})}}e.QueryDepositResponse={typeUrl:"/cosmos.gov.v1beta1.QueryDepositResponse",encode(i,m=r.BinaryWriter.create()){return i.deposit!==void 0&&n.Deposit.encode(i.deposit,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=s();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.deposit=n.Deposit.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=s();return(0,o.isSet)(i.deposit)&&(m.deposit=n.Deposit.fromJSON(i.deposit)),m},toJSON(i){const m={};return i.deposit!==void 0&&(m.deposit=i.deposit?n.Deposit.toJSON(i.deposit):void 0),m},fromPartial(i){const m=s();return i.deposit!==void 0&&i.deposit!==null&&(m.deposit=n.Deposit.fromPartial(i.deposit)),m}};function y(){return{proposalId:BigInt(0),pagination:void 0}}e.QueryDepositsRequest={typeUrl:"/cosmos.gov.v1beta1.QueryDepositsRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),i.pagination!==void 0&&t.PageRequest.encode(i.pagination,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=y();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;case 2:u.pagination=t.PageRequest.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=y();return(0,o.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),(0,o.isSet)(i.pagination)&&(m.pagination=t.PageRequest.fromJSON(i.pagination)),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),i.pagination!==void 0&&(m.pagination=i.pagination?t.PageRequest.toJSON(i.pagination):void 0),m},fromPartial(i){const m=y();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),i.pagination!==void 0&&i.pagination!==null&&(m.pagination=t.PageRequest.fromPartial(i.pagination)),m}};function E(){return{deposits:[],pagination:void 0}}e.QueryDepositsResponse={typeUrl:"/cosmos.gov.v1beta1.QueryDepositsResponse",encode(i,m=r.BinaryWriter.create()){for(const N of i.deposits)n.Deposit.encode(N,m.uint32(10).fork()).ldelim();return i.pagination!==void 0&&t.PageResponse.encode(i.pagination,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=E();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.deposits.push(n.Deposit.decode(N,N.uint32()));break;case 2:u.pagination=t.PageResponse.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=E();return Array.isArray(i==null?void 0:i.deposits)&&(m.deposits=i.deposits.map(N=>n.Deposit.fromJSON(N))),(0,o.isSet)(i.pagination)&&(m.pagination=t.PageResponse.fromJSON(i.pagination)),m},toJSON(i){const m={};return i.deposits?m.deposits=i.deposits.map(N=>N?n.Deposit.toJSON(N):void 0):m.deposits=[],i.pagination!==void 0&&(m.pagination=i.pagination?t.PageResponse.toJSON(i.pagination):void 0),m},fromPartial(i){var N;const m=E();return m.deposits=((N=i.deposits)==null?void 0:N.map(V=>n.Deposit.fromPartial(V)))||[],i.pagination!==void 0&&i.pagination!==null&&(m.pagination=t.PageResponse.fromPartial(i.pagination)),m}};function _(){return{proposalId:BigInt(0)}}e.QueryTallyResultRequest={typeUrl:"/cosmos.gov.v1beta1.QueryTallyResultRequest",encode(i,m=r.BinaryWriter.create()){return i.proposalId!==BigInt(0)&&m.uint32(8).uint64(i.proposalId),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=_();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.proposalId=N.uint64();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=_();return(0,o.isSet)(i.proposalId)&&(m.proposalId=BigInt(i.proposalId.toString())),m},toJSON(i){const m={};return i.proposalId!==void 0&&(m.proposalId=(i.proposalId||BigInt(0)).toString()),m},fromPartial(i){const m=_();return i.proposalId!==void 0&&i.proposalId!==null&&(m.proposalId=BigInt(i.proposalId.toString())),m}};function U(){return{tally:n.TallyResult.fromPartial({})}}e.QueryTallyResultResponse={typeUrl:"/cosmos.gov.v1beta1.QueryTallyResultResponse",encode(i,m=r.BinaryWriter.create()){return i.tally!==void 0&&n.TallyResult.encode(i.tally,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof r.BinaryReader?i:new r.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=U();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.tally=n.TallyResult.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=U();return(0,o.isSet)(i.tally)&&(m.tally=n.TallyResult.fromJSON(i.tally)),m},toJSON(i){const m={};return i.tally!==void 0&&(m.tally=i.tally?n.TallyResult.toJSON(i.tally):void 0),m},fromPartial(i){const m=U();return i.tally!==void 0&&i.tally!==null&&(m.tally=n.TallyResult.fromPartial(i.tally)),m}};class H{constructor(m){this.rpc=m,this.Proposal=this.Proposal.bind(this),this.Proposals=this.Proposals.bind(this),this.Vote=this.Vote.bind(this),this.Votes=this.Votes.bind(this),this.Params=this.Params.bind(this),this.Deposit=this.Deposit.bind(this),this.Deposits=this.Deposits.bind(this),this.TallyResult=this.TallyResult.bind(this)}Proposal(m){const N=e.QueryProposalRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Proposal",N).then(u=>e.QueryProposalResponse.decode(new r.BinaryReader(u)))}Proposals(m){const N=e.QueryProposalsRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Proposals",N).then(u=>e.QueryProposalsResponse.decode(new r.BinaryReader(u)))}Vote(m){const N=e.QueryVoteRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Vote",N).then(u=>e.QueryVoteResponse.decode(new r.BinaryReader(u)))}Votes(m){const N=e.QueryVotesRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Votes",N).then(u=>e.QueryVotesResponse.decode(new r.BinaryReader(u)))}Params(m){const N=e.QueryParamsRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Params",N).then(u=>e.QueryParamsResponse.decode(new r.BinaryReader(u)))}Deposit(m){const N=e.QueryDepositRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Deposit",N).then(u=>e.QueryDepositResponse.decode(new r.BinaryReader(u)))}Deposits(m){const N=e.QueryDepositsRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","Deposits",N).then(u=>e.QueryDepositsResponse.decode(new r.BinaryReader(u)))}TallyResult(m){const N=e.QueryTallyResultRequest.encode(m).finish();return this.rpc.request("cosmos.gov.v1beta1.Query","TallyResult",N).then(u=>e.QueryTallyResultResponse.decode(new r.BinaryReader(u)))}}e.QueryClientImpl=H})(Om);Object.defineProperty(os,"__esModule",{value:!0});os.setupGovExtension=void 0;const dR=Om,Yn=Ke;function uR(e){const n=(0,Yn.createProtobufRpcClient)(e),t=new dR.QueryClientImpl(n);return{gov:{params:async r=>await t.Params({paramsType:r}),proposals:async(r,o,h,v)=>await t.Proposals({proposalStatus:r,depositor:o,voter:h,pagination:(0,Yn.createPagination)(v)}),proposal:async r=>await t.Proposal({proposalId:(0,Yn.longify)(r)}),deposits:async(r,o)=>await t.Deposits({proposalId:(0,Yn.longify)(r),pagination:(0,Yn.createPagination)(o)}),deposit:async(r,o)=>await t.Deposit({proposalId:(0,Yn.longify)(r),depositor:o}),tally:async r=>await t.TallyResult({proposalId:(0,Yn.longify)(r)}),votes:async(r,o)=>await t.Votes({proposalId:(0,Yn.longify)(r),pagination:(0,Yn.createPagination)(o)}),vote:async(r,o)=>await t.Vote({proposalId:(0,Yn.longify)(r),voter:o})}}}os.setupGovExtension=uR;var as={};Object.defineProperty(as,"__esModule",{value:!0});as.createGroupAminoConverters=void 0;function cR(){return{}}as.createGroupAminoConverters=cR;var ss={},Am={},Im={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Vote=e.TallyResult=e.Proposal=e.GroupPolicyInfo=e.GroupMember=e.GroupInfo=e.DecisionPolicyWindows=e.PercentageDecisionPolicy=e.ThresholdDecisionPolicy=e.MemberRequest=e.Member=e.proposalExecutorResultToJSON=e.proposalExecutorResultFromJSON=e.ProposalExecutorResult=e.proposalStatusToJSON=e.proposalStatusFromJSON=e.ProposalStatus=e.voteOptionToJSON=e.voteOptionFromJSON=e.VoteOption=e.protobufPackage=void 0;const n=Mn,t=hn,r=Re,o=ee,h=ne;e.protobufPackage="cosmos.group.v1";var v;(function(u){u[u.VOTE_OPTION_UNSPECIFIED=0]="VOTE_OPTION_UNSPECIFIED",u[u.VOTE_OPTION_YES=1]="VOTE_OPTION_YES",u[u.VOTE_OPTION_ABSTAIN=2]="VOTE_OPTION_ABSTAIN",u[u.VOTE_OPTION_NO=3]="VOTE_OPTION_NO",u[u.VOTE_OPTION_NO_WITH_VETO=4]="VOTE_OPTION_NO_WITH_VETO",u[u.UNRECOGNIZED=-1]="UNRECOGNIZED"})(v||(e.VoteOption=v={}));function C(u){switch(u){case 0:case"VOTE_OPTION_UNSPECIFIED":return v.VOTE_OPTION_UNSPECIFIED;case 1:case"VOTE_OPTION_YES":return v.VOTE_OPTION_YES;case 2:case"VOTE_OPTION_ABSTAIN":return v.VOTE_OPTION_ABSTAIN;case 3:case"VOTE_OPTION_NO":return v.VOTE_OPTION_NO;case 4:case"VOTE_OPTION_NO_WITH_VETO":return v.VOTE_OPTION_NO_WITH_VETO;case-1:case"UNRECOGNIZED":default:return v.UNRECOGNIZED}}e.voteOptionFromJSON=C;function w(u){switch(u){case v.VOTE_OPTION_UNSPECIFIED:return"VOTE_OPTION_UNSPECIFIED";case v.VOTE_OPTION_YES:return"VOTE_OPTION_YES";case v.VOTE_OPTION_ABSTAIN:return"VOTE_OPTION_ABSTAIN";case v.VOTE_OPTION_NO:return"VOTE_OPTION_NO";case v.VOTE_OPTION_NO_WITH_VETO:return"VOTE_OPTION_NO_WITH_VETO";case v.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.voteOptionToJSON=w;var D;(function(u){u[u.PROPOSAL_STATUS_UNSPECIFIED=0]="PROPOSAL_STATUS_UNSPECIFIED",u[u.PROPOSAL_STATUS_SUBMITTED=1]="PROPOSAL_STATUS_SUBMITTED",u[u.PROPOSAL_STATUS_ACCEPTED=2]="PROPOSAL_STATUS_ACCEPTED",u[u.PROPOSAL_STATUS_REJECTED=3]="PROPOSAL_STATUS_REJECTED",u[u.PROPOSAL_STATUS_ABORTED=4]="PROPOSAL_STATUS_ABORTED",u[u.PROPOSAL_STATUS_WITHDRAWN=5]="PROPOSAL_STATUS_WITHDRAWN",u[u.UNRECOGNIZED=-1]="UNRECOGNIZED"})(D||(e.ProposalStatus=D={}));function J(u){switch(u){case 0:case"PROPOSAL_STATUS_UNSPECIFIED":return D.PROPOSAL_STATUS_UNSPECIFIED;case 1:case"PROPOSAL_STATUS_SUBMITTED":return D.PROPOSAL_STATUS_SUBMITTED;case 2:case"PROPOSAL_STATUS_ACCEPTED":return D.PROPOSAL_STATUS_ACCEPTED;case 3:case"PROPOSAL_STATUS_REJECTED":return D.PROPOSAL_STATUS_REJECTED;case 4:case"PROPOSAL_STATUS_ABORTED":return D.PROPOSAL_STATUS_ABORTED;case 5:case"PROPOSAL_STATUS_WITHDRAWN":return D.PROPOSAL_STATUS_WITHDRAWN;case-1:case"UNRECOGNIZED":default:return D.UNRECOGNIZED}}e.proposalStatusFromJSON=J;function I(u){switch(u){case D.PROPOSAL_STATUS_UNSPECIFIED:return"PROPOSAL_STATUS_UNSPECIFIED";case D.PROPOSAL_STATUS_SUBMITTED:return"PROPOSAL_STATUS_SUBMITTED";case D.PROPOSAL_STATUS_ACCEPTED:return"PROPOSAL_STATUS_ACCEPTED";case D.PROPOSAL_STATUS_REJECTED:return"PROPOSAL_STATUS_REJECTED";case D.PROPOSAL_STATUS_ABORTED:return"PROPOSAL_STATUS_ABORTED";case D.PROPOSAL_STATUS_WITHDRAWN:return"PROPOSAL_STATUS_WITHDRAWN";case D.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalStatusToJSON=I;var g;(function(u){u[u.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED=0]="PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED",u[u.PROPOSAL_EXECUTOR_RESULT_NOT_RUN=1]="PROPOSAL_EXECUTOR_RESULT_NOT_RUN",u[u.PROPOSAL_EXECUTOR_RESULT_SUCCESS=2]="PROPOSAL_EXECUTOR_RESULT_SUCCESS",u[u.PROPOSAL_EXECUTOR_RESULT_FAILURE=3]="PROPOSAL_EXECUTOR_RESULT_FAILURE",u[u.UNRECOGNIZED=-1]="UNRECOGNIZED"})(g||(e.ProposalExecutorResult=g={}));function R(u){switch(u){case 0:case"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED":return g.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED;case 1:case"PROPOSAL_EXECUTOR_RESULT_NOT_RUN":return g.PROPOSAL_EXECUTOR_RESULT_NOT_RUN;case 2:case"PROPOSAL_EXECUTOR_RESULT_SUCCESS":return g.PROPOSAL_EXECUTOR_RESULT_SUCCESS;case 3:case"PROPOSAL_EXECUTOR_RESULT_FAILURE":return g.PROPOSAL_EXECUTOR_RESULT_FAILURE;case-1:case"UNRECOGNIZED":default:return g.UNRECOGNIZED}}e.proposalExecutorResultFromJSON=R;function B(u){switch(u){case g.PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED:return"PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED";case g.PROPOSAL_EXECUTOR_RESULT_NOT_RUN:return"PROPOSAL_EXECUTOR_RESULT_NOT_RUN";case g.PROPOSAL_EXECUTOR_RESULT_SUCCESS:return"PROPOSAL_EXECUTOR_RESULT_SUCCESS";case g.PROPOSAL_EXECUTOR_RESULT_FAILURE:return"PROPOSAL_EXECUTOR_RESULT_FAILURE";case g.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.proposalExecutorResultToJSON=B;function d(){return{address:"",weight:"",metadata:"",addedAt:n.Timestamp.fromPartial({})}}e.Member={typeUrl:"/cosmos.group.v1.Member",encode(u,l=o.BinaryWriter.create()){return u.address!==""&&l.uint32(10).string(u.address),u.weight!==""&&l.uint32(18).string(u.weight),u.metadata!==""&&l.uint32(26).string(u.metadata),u.addedAt!==void 0&&n.Timestamp.encode(u.addedAt,l.uint32(34).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=d();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.address=T.string();break;case 2:p.weight=T.string();break;case 3:p.metadata=T.string();break;case 4:p.addedAt=n.Timestamp.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=d();return(0,h.isSet)(u.address)&&(l.address=String(u.address)),(0,h.isSet)(u.weight)&&(l.weight=String(u.weight)),(0,h.isSet)(u.metadata)&&(l.metadata=String(u.metadata)),(0,h.isSet)(u.addedAt)&&(l.addedAt=(0,h.fromJsonTimestamp)(u.addedAt)),l},toJSON(u){const l={};return u.address!==void 0&&(l.address=u.address),u.weight!==void 0&&(l.weight=u.weight),u.metadata!==void 0&&(l.metadata=u.metadata),u.addedAt!==void 0&&(l.addedAt=(0,h.fromTimestamp)(u.addedAt).toISOString()),l},fromPartial(u){const l=d();return l.address=u.address??"",l.weight=u.weight??"",l.metadata=u.metadata??"",u.addedAt!==void 0&&u.addedAt!==null&&(l.addedAt=n.Timestamp.fromPartial(u.addedAt)),l}};function s(){return{address:"",weight:"",metadata:""}}e.MemberRequest={typeUrl:"/cosmos.group.v1.MemberRequest",encode(u,l=o.BinaryWriter.create()){return u.address!==""&&l.uint32(10).string(u.address),u.weight!==""&&l.uint32(18).string(u.weight),u.metadata!==""&&l.uint32(26).string(u.metadata),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=s();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.address=T.string();break;case 2:p.weight=T.string();break;case 3:p.metadata=T.string();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=s();return(0,h.isSet)(u.address)&&(l.address=String(u.address)),(0,h.isSet)(u.weight)&&(l.weight=String(u.weight)),(0,h.isSet)(u.metadata)&&(l.metadata=String(u.metadata)),l},toJSON(u){const l={};return u.address!==void 0&&(l.address=u.address),u.weight!==void 0&&(l.weight=u.weight),u.metadata!==void 0&&(l.metadata=u.metadata),l},fromPartial(u){const l=s();return l.address=u.address??"",l.weight=u.weight??"",l.metadata=u.metadata??"",l}};function y(){return{threshold:"",windows:void 0}}e.ThresholdDecisionPolicy={typeUrl:"/cosmos.group.v1.ThresholdDecisionPolicy",encode(u,l=o.BinaryWriter.create()){return u.threshold!==""&&l.uint32(10).string(u.threshold),u.windows!==void 0&&e.DecisionPolicyWindows.encode(u.windows,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=y();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.threshold=T.string();break;case 2:p.windows=e.DecisionPolicyWindows.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=y();return(0,h.isSet)(u.threshold)&&(l.threshold=String(u.threshold)),(0,h.isSet)(u.windows)&&(l.windows=e.DecisionPolicyWindows.fromJSON(u.windows)),l},toJSON(u){const l={};return u.threshold!==void 0&&(l.threshold=u.threshold),u.windows!==void 0&&(l.windows=u.windows?e.DecisionPolicyWindows.toJSON(u.windows):void 0),l},fromPartial(u){const l=y();return l.threshold=u.threshold??"",u.windows!==void 0&&u.windows!==null&&(l.windows=e.DecisionPolicyWindows.fromPartial(u.windows)),l}};function E(){return{percentage:"",windows:void 0}}e.PercentageDecisionPolicy={typeUrl:"/cosmos.group.v1.PercentageDecisionPolicy",encode(u,l=o.BinaryWriter.create()){return u.percentage!==""&&l.uint32(10).string(u.percentage),u.windows!==void 0&&e.DecisionPolicyWindows.encode(u.windows,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=E();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.percentage=T.string();break;case 2:p.windows=e.DecisionPolicyWindows.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=E();return(0,h.isSet)(u.percentage)&&(l.percentage=String(u.percentage)),(0,h.isSet)(u.windows)&&(l.windows=e.DecisionPolicyWindows.fromJSON(u.windows)),l},toJSON(u){const l={};return u.percentage!==void 0&&(l.percentage=u.percentage),u.windows!==void 0&&(l.windows=u.windows?e.DecisionPolicyWindows.toJSON(u.windows):void 0),l},fromPartial(u){const l=E();return l.percentage=u.percentage??"",u.windows!==void 0&&u.windows!==null&&(l.windows=e.DecisionPolicyWindows.fromPartial(u.windows)),l}};function _(){return{votingPeriod:t.Duration.fromPartial({}),minExecutionPeriod:t.Duration.fromPartial({})}}e.DecisionPolicyWindows={typeUrl:"/cosmos.group.v1.DecisionPolicyWindows",encode(u,l=o.BinaryWriter.create()){return u.votingPeriod!==void 0&&t.Duration.encode(u.votingPeriod,l.uint32(10).fork()).ldelim(),u.minExecutionPeriod!==void 0&&t.Duration.encode(u.minExecutionPeriod,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=_();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.votingPeriod=t.Duration.decode(T,T.uint32());break;case 2:p.minExecutionPeriod=t.Duration.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=_();return(0,h.isSet)(u.votingPeriod)&&(l.votingPeriod=t.Duration.fromJSON(u.votingPeriod)),(0,h.isSet)(u.minExecutionPeriod)&&(l.minExecutionPeriod=t.Duration.fromJSON(u.minExecutionPeriod)),l},toJSON(u){const l={};return u.votingPeriod!==void 0&&(l.votingPeriod=u.votingPeriod?t.Duration.toJSON(u.votingPeriod):void 0),u.minExecutionPeriod!==void 0&&(l.minExecutionPeriod=u.minExecutionPeriod?t.Duration.toJSON(u.minExecutionPeriod):void 0),l},fromPartial(u){const l=_();return u.votingPeriod!==void 0&&u.votingPeriod!==null&&(l.votingPeriod=t.Duration.fromPartial(u.votingPeriod)),u.minExecutionPeriod!==void 0&&u.minExecutionPeriod!==null&&(l.minExecutionPeriod=t.Duration.fromPartial(u.minExecutionPeriod)),l}};function U(){return{id:BigInt(0),admin:"",metadata:"",version:BigInt(0),totalWeight:"",createdAt:n.Timestamp.fromPartial({})}}e.GroupInfo={typeUrl:"/cosmos.group.v1.GroupInfo",encode(u,l=o.BinaryWriter.create()){return u.id!==BigInt(0)&&l.uint32(8).uint64(u.id),u.admin!==""&&l.uint32(18).string(u.admin),u.metadata!==""&&l.uint32(26).string(u.metadata),u.version!==BigInt(0)&&l.uint32(32).uint64(u.version),u.totalWeight!==""&&l.uint32(42).string(u.totalWeight),u.createdAt!==void 0&&n.Timestamp.encode(u.createdAt,l.uint32(50).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=U();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.id=T.uint64();break;case 2:p.admin=T.string();break;case 3:p.metadata=T.string();break;case 4:p.version=T.uint64();break;case 5:p.totalWeight=T.string();break;case 6:p.createdAt=n.Timestamp.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=U();return(0,h.isSet)(u.id)&&(l.id=BigInt(u.id.toString())),(0,h.isSet)(u.admin)&&(l.admin=String(u.admin)),(0,h.isSet)(u.metadata)&&(l.metadata=String(u.metadata)),(0,h.isSet)(u.version)&&(l.version=BigInt(u.version.toString())),(0,h.isSet)(u.totalWeight)&&(l.totalWeight=String(u.totalWeight)),(0,h.isSet)(u.createdAt)&&(l.createdAt=(0,h.fromJsonTimestamp)(u.createdAt)),l},toJSON(u){const l={};return u.id!==void 0&&(l.id=(u.id||BigInt(0)).toString()),u.admin!==void 0&&(l.admin=u.admin),u.metadata!==void 0&&(l.metadata=u.metadata),u.version!==void 0&&(l.version=(u.version||BigInt(0)).toString()),u.totalWeight!==void 0&&(l.totalWeight=u.totalWeight),u.createdAt!==void 0&&(l.createdAt=(0,h.fromTimestamp)(u.createdAt).toISOString()),l},fromPartial(u){const l=U();return u.id!==void 0&&u.id!==null&&(l.id=BigInt(u.id.toString())),l.admin=u.admin??"",l.metadata=u.metadata??"",u.version!==void 0&&u.version!==null&&(l.version=BigInt(u.version.toString())),l.totalWeight=u.totalWeight??"",u.createdAt!==void 0&&u.createdAt!==null&&(l.createdAt=n.Timestamp.fromPartial(u.createdAt)),l}};function H(){return{groupId:BigInt(0),member:void 0}}e.GroupMember={typeUrl:"/cosmos.group.v1.GroupMember",encode(u,l=o.BinaryWriter.create()){return u.groupId!==BigInt(0)&&l.uint32(8).uint64(u.groupId),u.member!==void 0&&e.Member.encode(u.member,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=H();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.groupId=T.uint64();break;case 2:p.member=e.Member.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=H();return(0,h.isSet)(u.groupId)&&(l.groupId=BigInt(u.groupId.toString())),(0,h.isSet)(u.member)&&(l.member=e.Member.fromJSON(u.member)),l},toJSON(u){const l={};return u.groupId!==void 0&&(l.groupId=(u.groupId||BigInt(0)).toString()),u.member!==void 0&&(l.member=u.member?e.Member.toJSON(u.member):void 0),l},fromPartial(u){const l=H();return u.groupId!==void 0&&u.groupId!==null&&(l.groupId=BigInt(u.groupId.toString())),u.member!==void 0&&u.member!==null&&(l.member=e.Member.fromPartial(u.member)),l}};function i(){return{address:"",groupId:BigInt(0),admin:"",metadata:"",version:BigInt(0),decisionPolicy:void 0,createdAt:n.Timestamp.fromPartial({})}}e.GroupPolicyInfo={typeUrl:"/cosmos.group.v1.GroupPolicyInfo",encode(u,l=o.BinaryWriter.create()){return u.address!==""&&l.uint32(10).string(u.address),u.groupId!==BigInt(0)&&l.uint32(16).uint64(u.groupId),u.admin!==""&&l.uint32(26).string(u.admin),u.metadata!==""&&l.uint32(34).string(u.metadata),u.version!==BigInt(0)&&l.uint32(40).uint64(u.version),u.decisionPolicy!==void 0&&r.Any.encode(u.decisionPolicy,l.uint32(50).fork()).ldelim(),u.createdAt!==void 0&&n.Timestamp.encode(u.createdAt,l.uint32(58).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=i();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.address=T.string();break;case 2:p.groupId=T.uint64();break;case 3:p.admin=T.string();break;case 4:p.metadata=T.string();break;case 5:p.version=T.uint64();break;case 6:p.decisionPolicy=r.Any.decode(T,T.uint32());break;case 7:p.createdAt=n.Timestamp.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=i();return(0,h.isSet)(u.address)&&(l.address=String(u.address)),(0,h.isSet)(u.groupId)&&(l.groupId=BigInt(u.groupId.toString())),(0,h.isSet)(u.admin)&&(l.admin=String(u.admin)),(0,h.isSet)(u.metadata)&&(l.metadata=String(u.metadata)),(0,h.isSet)(u.version)&&(l.version=BigInt(u.version.toString())),(0,h.isSet)(u.decisionPolicy)&&(l.decisionPolicy=r.Any.fromJSON(u.decisionPolicy)),(0,h.isSet)(u.createdAt)&&(l.createdAt=(0,h.fromJsonTimestamp)(u.createdAt)),l},toJSON(u){const l={};return u.address!==void 0&&(l.address=u.address),u.groupId!==void 0&&(l.groupId=(u.groupId||BigInt(0)).toString()),u.admin!==void 0&&(l.admin=u.admin),u.metadata!==void 0&&(l.metadata=u.metadata),u.version!==void 0&&(l.version=(u.version||BigInt(0)).toString()),u.decisionPolicy!==void 0&&(l.decisionPolicy=u.decisionPolicy?r.Any.toJSON(u.decisionPolicy):void 0),u.createdAt!==void 0&&(l.createdAt=(0,h.fromTimestamp)(u.createdAt).toISOString()),l},fromPartial(u){const l=i();return l.address=u.address??"",u.groupId!==void 0&&u.groupId!==null&&(l.groupId=BigInt(u.groupId.toString())),l.admin=u.admin??"",l.metadata=u.metadata??"",u.version!==void 0&&u.version!==null&&(l.version=BigInt(u.version.toString())),u.decisionPolicy!==void 0&&u.decisionPolicy!==null&&(l.decisionPolicy=r.Any.fromPartial(u.decisionPolicy)),u.createdAt!==void 0&&u.createdAt!==null&&(l.createdAt=n.Timestamp.fromPartial(u.createdAt)),l}};function m(){return{id:BigInt(0),groupPolicyAddress:"",metadata:"",proposers:[],submitTime:n.Timestamp.fromPartial({}),groupVersion:BigInt(0),groupPolicyVersion:BigInt(0),status:0,finalTallyResult:e.TallyResult.fromPartial({}),votingPeriodEnd:n.Timestamp.fromPartial({}),executorResult:0,messages:[],title:"",summary:""}}e.Proposal={typeUrl:"/cosmos.group.v1.Proposal",encode(u,l=o.BinaryWriter.create()){u.id!==BigInt(0)&&l.uint32(8).uint64(u.id),u.groupPolicyAddress!==""&&l.uint32(18).string(u.groupPolicyAddress),u.metadata!==""&&l.uint32(26).string(u.metadata);for(const T of u.proposers)l.uint32(34).string(T);u.submitTime!==void 0&&n.Timestamp.encode(u.submitTime,l.uint32(42).fork()).ldelim(),u.groupVersion!==BigInt(0)&&l.uint32(48).uint64(u.groupVersion),u.groupPolicyVersion!==BigInt(0)&&l.uint32(56).uint64(u.groupPolicyVersion),u.status!==0&&l.uint32(64).int32(u.status),u.finalTallyResult!==void 0&&e.TallyResult.encode(u.finalTallyResult,l.uint32(74).fork()).ldelim(),u.votingPeriodEnd!==void 0&&n.Timestamp.encode(u.votingPeriodEnd,l.uint32(82).fork()).ldelim(),u.executorResult!==0&&l.uint32(88).int32(u.executorResult);for(const T of u.messages)r.Any.encode(T,l.uint32(98).fork()).ldelim();return u.title!==""&&l.uint32(106).string(u.title),u.summary!==""&&l.uint32(114).string(u.summary),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=m();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.id=T.uint64();break;case 2:p.groupPolicyAddress=T.string();break;case 3:p.metadata=T.string();break;case 4:p.proposers.push(T.string());break;case 5:p.submitTime=n.Timestamp.decode(T,T.uint32());break;case 6:p.groupVersion=T.uint64();break;case 7:p.groupPolicyVersion=T.uint64();break;case 8:p.status=T.int32();break;case 9:p.finalTallyResult=e.TallyResult.decode(T,T.uint32());break;case 10:p.votingPeriodEnd=n.Timestamp.decode(T,T.uint32());break;case 11:p.executorResult=T.int32();break;case 12:p.messages.push(r.Any.decode(T,T.uint32()));break;case 13:p.title=T.string();break;case 14:p.summary=T.string();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=m();return(0,h.isSet)(u.id)&&(l.id=BigInt(u.id.toString())),(0,h.isSet)(u.groupPolicyAddress)&&(l.groupPolicyAddress=String(u.groupPolicyAddress)),(0,h.isSet)(u.metadata)&&(l.metadata=String(u.metadata)),Array.isArray(u==null?void 0:u.proposers)&&(l.proposers=u.proposers.map(T=>String(T))),(0,h.isSet)(u.submitTime)&&(l.submitTime=(0,h.fromJsonTimestamp)(u.submitTime)),(0,h.isSet)(u.groupVersion)&&(l.groupVersion=BigInt(u.groupVersion.toString())),(0,h.isSet)(u.groupPolicyVersion)&&(l.groupPolicyVersion=BigInt(u.groupPolicyVersion.toString())),(0,h.isSet)(u.status)&&(l.status=J(u.status)),(0,h.isSet)(u.finalTallyResult)&&(l.finalTallyResult=e.TallyResult.fromJSON(u.finalTallyResult)),(0,h.isSet)(u.votingPeriodEnd)&&(l.votingPeriodEnd=(0,h.fromJsonTimestamp)(u.votingPeriodEnd)),(0,h.isSet)(u.executorResult)&&(l.executorResult=R(u.executorResult)),Array.isArray(u==null?void 0:u.messages)&&(l.messages=u.messages.map(T=>r.Any.fromJSON(T))),(0,h.isSet)(u.title)&&(l.title=String(u.title)),(0,h.isSet)(u.summary)&&(l.summary=String(u.summary)),l},toJSON(u){const l={};return u.id!==void 0&&(l.id=(u.id||BigInt(0)).toString()),u.groupPolicyAddress!==void 0&&(l.groupPolicyAddress=u.groupPolicyAddress),u.metadata!==void 0&&(l.metadata=u.metadata),u.proposers?l.proposers=u.proposers.map(T=>T):l.proposers=[],u.submitTime!==void 0&&(l.submitTime=(0,h.fromTimestamp)(u.submitTime).toISOString()),u.groupVersion!==void 0&&(l.groupVersion=(u.groupVersion||BigInt(0)).toString()),u.groupPolicyVersion!==void 0&&(l.groupPolicyVersion=(u.groupPolicyVersion||BigInt(0)).toString()),u.status!==void 0&&(l.status=I(u.status)),u.finalTallyResult!==void 0&&(l.finalTallyResult=u.finalTallyResult?e.TallyResult.toJSON(u.finalTallyResult):void 0),u.votingPeriodEnd!==void 0&&(l.votingPeriodEnd=(0,h.fromTimestamp)(u.votingPeriodEnd).toISOString()),u.executorResult!==void 0&&(l.executorResult=B(u.executorResult)),u.messages?l.messages=u.messages.map(T=>T?r.Any.toJSON(T):void 0):l.messages=[],u.title!==void 0&&(l.title=u.title),u.summary!==void 0&&(l.summary=u.summary),l},fromPartial(u){var T,f;const l=m();return u.id!==void 0&&u.id!==null&&(l.id=BigInt(u.id.toString())),l.groupPolicyAddress=u.groupPolicyAddress??"",l.metadata=u.metadata??"",l.proposers=((T=u.proposers)==null?void 0:T.map(p=>p))||[],u.submitTime!==void 0&&u.submitTime!==null&&(l.submitTime=n.Timestamp.fromPartial(u.submitTime)),u.groupVersion!==void 0&&u.groupVersion!==null&&(l.groupVersion=BigInt(u.groupVersion.toString())),u.groupPolicyVersion!==void 0&&u.groupPolicyVersion!==null&&(l.groupPolicyVersion=BigInt(u.groupPolicyVersion.toString())),l.status=u.status??0,u.finalTallyResult!==void 0&&u.finalTallyResult!==null&&(l.finalTallyResult=e.TallyResult.fromPartial(u.finalTallyResult)),u.votingPeriodEnd!==void 0&&u.votingPeriodEnd!==null&&(l.votingPeriodEnd=n.Timestamp.fromPartial(u.votingPeriodEnd)),l.executorResult=u.executorResult??0,l.messages=((f=u.messages)==null?void 0:f.map(p=>r.Any.fromPartial(p)))||[],l.title=u.title??"",l.summary=u.summary??"",l}};function N(){return{yesCount:"",abstainCount:"",noCount:"",noWithVetoCount:""}}e.TallyResult={typeUrl:"/cosmos.group.v1.TallyResult",encode(u,l=o.BinaryWriter.create()){return u.yesCount!==""&&l.uint32(10).string(u.yesCount),u.abstainCount!==""&&l.uint32(18).string(u.abstainCount),u.noCount!==""&&l.uint32(26).string(u.noCount),u.noWithVetoCount!==""&&l.uint32(34).string(u.noWithVetoCount),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=N();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.yesCount=T.string();break;case 2:p.abstainCount=T.string();break;case 3:p.noCount=T.string();break;case 4:p.noWithVetoCount=T.string();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=N();return(0,h.isSet)(u.yesCount)&&(l.yesCount=String(u.yesCount)),(0,h.isSet)(u.abstainCount)&&(l.abstainCount=String(u.abstainCount)),(0,h.isSet)(u.noCount)&&(l.noCount=String(u.noCount)),(0,h.isSet)(u.noWithVetoCount)&&(l.noWithVetoCount=String(u.noWithVetoCount)),l},toJSON(u){const l={};return u.yesCount!==void 0&&(l.yesCount=u.yesCount),u.abstainCount!==void 0&&(l.abstainCount=u.abstainCount),u.noCount!==void 0&&(l.noCount=u.noCount),u.noWithVetoCount!==void 0&&(l.noWithVetoCount=u.noWithVetoCount),l},fromPartial(u){const l=N();return l.yesCount=u.yesCount??"",l.abstainCount=u.abstainCount??"",l.noCount=u.noCount??"",l.noWithVetoCount=u.noWithVetoCount??"",l}};function V(){return{proposalId:BigInt(0),voter:"",option:0,metadata:"",submitTime:n.Timestamp.fromPartial({})}}e.Vote={typeUrl:"/cosmos.group.v1.Vote",encode(u,l=o.BinaryWriter.create()){return u.proposalId!==BigInt(0)&&l.uint32(8).uint64(u.proposalId),u.voter!==""&&l.uint32(18).string(u.voter),u.option!==0&&l.uint32(24).int32(u.option),u.metadata!==""&&l.uint32(34).string(u.metadata),u.submitTime!==void 0&&n.Timestamp.encode(u.submitTime,l.uint32(42).fork()).ldelim(),l},decode(u,l){const T=u instanceof o.BinaryReader?u:new o.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=V();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.proposalId=T.uint64();break;case 2:p.voter=T.string();break;case 3:p.option=T.int32();break;case 4:p.metadata=T.string();break;case 5:p.submitTime=n.Timestamp.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=V();return(0,h.isSet)(u.proposalId)&&(l.proposalId=BigInt(u.proposalId.toString())),(0,h.isSet)(u.voter)&&(l.voter=String(u.voter)),(0,h.isSet)(u.option)&&(l.option=C(u.option)),(0,h.isSet)(u.metadata)&&(l.metadata=String(u.metadata)),(0,h.isSet)(u.submitTime)&&(l.submitTime=(0,h.fromJsonTimestamp)(u.submitTime)),l},toJSON(u){const l={};return u.proposalId!==void 0&&(l.proposalId=(u.proposalId||BigInt(0)).toString()),u.voter!==void 0&&(l.voter=u.voter),u.option!==void 0&&(l.option=w(u.option)),u.metadata!==void 0&&(l.metadata=u.metadata),u.submitTime!==void 0&&(l.submitTime=(0,h.fromTimestamp)(u.submitTime).toISOString()),l},fromPartial(u){const l=V();return u.proposalId!==void 0&&u.proposalId!==null&&(l.proposalId=BigInt(u.proposalId.toString())),l.voter=u.voter??"",l.option=u.option??0,l.metadata=u.metadata??"",u.submitTime!==void 0&&u.submitTime!==null&&(l.submitTime=n.Timestamp.fromPartial(u.submitTime)),l}}})(Im);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgLeaveGroupResponse=e.MsgLeaveGroup=e.MsgExecResponse=e.MsgExec=e.MsgVoteResponse=e.MsgVote=e.MsgWithdrawProposalResponse=e.MsgWithdrawProposal=e.MsgSubmitProposalResponse=e.MsgSubmitProposal=e.MsgUpdateGroupPolicyMetadataResponse=e.MsgUpdateGroupPolicyMetadata=e.MsgUpdateGroupPolicyDecisionPolicyResponse=e.MsgUpdateGroupPolicyDecisionPolicy=e.MsgCreateGroupWithPolicyResponse=e.MsgCreateGroupWithPolicy=e.MsgUpdateGroupPolicyAdminResponse=e.MsgUpdateGroupPolicyAdmin=e.MsgCreateGroupPolicyResponse=e.MsgCreateGroupPolicy=e.MsgUpdateGroupMetadataResponse=e.MsgUpdateGroupMetadata=e.MsgUpdateGroupAdminResponse=e.MsgUpdateGroupAdmin=e.MsgUpdateGroupMembersResponse=e.MsgUpdateGroupMembers=e.MsgCreateGroupResponse=e.MsgCreateGroup=e.execToJSON=e.execFromJSON=e.Exec=e.protobufPackage=void 0;const n=Im,t=Re,r=ee,o=ne;e.protobufPackage="cosmos.group.v1";var h;(function(P){P[P.EXEC_UNSPECIFIED=0]="EXEC_UNSPECIFIED",P[P.EXEC_TRY=1]="EXEC_TRY",P[P.UNRECOGNIZED=-1]="UNRECOGNIZED"})(h||(e.Exec=h={}));function v(P){switch(P){case 0:case"EXEC_UNSPECIFIED":return h.EXEC_UNSPECIFIED;case 1:case"EXEC_TRY":return h.EXEC_TRY;case-1:case"UNRECOGNIZED":default:return h.UNRECOGNIZED}}e.execFromJSON=v;function C(P){switch(P){case h.EXEC_UNSPECIFIED:return"EXEC_UNSPECIFIED";case h.EXEC_TRY:return"EXEC_TRY";case h.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.execToJSON=C;function w(){return{admin:"",members:[],metadata:""}}e.MsgCreateGroup={typeUrl:"/cosmos.group.v1.MsgCreateGroup",encode(P,O=r.BinaryWriter.create()){P.admin!==""&&O.uint32(10).string(P.admin);for(const W of P.members)n.MemberRequest.encode(W,O.uint32(18).fork()).ldelim();return P.metadata!==""&&O.uint32(26).string(P.metadata),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=w();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.members.push(n.MemberRequest.decode(W,W.uint32()));break;case 3:G.metadata=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=w();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),Array.isArray(P==null?void 0:P.members)&&(O.members=P.members.map(W=>n.MemberRequest.fromJSON(W))),(0,o.isSet)(P.metadata)&&(O.metadata=String(P.metadata)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.members?O.members=P.members.map(W=>W?n.MemberRequest.toJSON(W):void 0):O.members=[],P.metadata!==void 0&&(O.metadata=P.metadata),O},fromPartial(P){var W;const O=w();return O.admin=P.admin??"",O.members=((W=P.members)==null?void 0:W.map(L=>n.MemberRequest.fromPartial(L)))||[],O.metadata=P.metadata??"",O}};function D(){return{groupId:BigInt(0)}}e.MsgCreateGroupResponse={typeUrl:"/cosmos.group.v1.MsgCreateGroupResponse",encode(P,O=r.BinaryWriter.create()){return P.groupId!==BigInt(0)&&O.uint32(8).uint64(P.groupId),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=D();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.groupId=W.uint64();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=D();return(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),O},toJSON(P){const O={};return P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),O},fromPartial(P){const O=D();return P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O}};function J(){return{admin:"",groupId:BigInt(0),memberUpdates:[]}}e.MsgUpdateGroupMembers={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMembers",encode(P,O=r.BinaryWriter.create()){P.admin!==""&&O.uint32(10).string(P.admin),P.groupId!==BigInt(0)&&O.uint32(16).uint64(P.groupId);for(const W of P.memberUpdates)n.MemberRequest.encode(W,O.uint32(26).fork()).ldelim();return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=J();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupId=W.uint64();break;case 3:G.memberUpdates.push(n.MemberRequest.decode(W,W.uint32()));break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=J();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),Array.isArray(P==null?void 0:P.memberUpdates)&&(O.memberUpdates=P.memberUpdates.map(W=>n.MemberRequest.fromJSON(W))),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),P.memberUpdates?O.memberUpdates=P.memberUpdates.map(W=>W?n.MemberRequest.toJSON(W):void 0):O.memberUpdates=[],O},fromPartial(P){var W;const O=J();return O.admin=P.admin??"",P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O.memberUpdates=((W=P.memberUpdates)==null?void 0:W.map(L=>n.MemberRequest.fromPartial(L)))||[],O}};function I(){return{}}e.MsgUpdateGroupMembersResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMembersResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=I();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return I()},toJSON(P){return{}},fromPartial(P){return I()}};function g(){return{admin:"",groupId:BigInt(0),newAdmin:""}}e.MsgUpdateGroupAdmin={typeUrl:"/cosmos.group.v1.MsgUpdateGroupAdmin",encode(P,O=r.BinaryWriter.create()){return P.admin!==""&&O.uint32(10).string(P.admin),P.groupId!==BigInt(0)&&O.uint32(16).uint64(P.groupId),P.newAdmin!==""&&O.uint32(26).string(P.newAdmin),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=g();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupId=W.uint64();break;case 3:G.newAdmin=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=g();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),(0,o.isSet)(P.newAdmin)&&(O.newAdmin=String(P.newAdmin)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),P.newAdmin!==void 0&&(O.newAdmin=P.newAdmin),O},fromPartial(P){const O=g();return O.admin=P.admin??"",P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O.newAdmin=P.newAdmin??"",O}};function R(){return{}}e.MsgUpdateGroupAdminResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupAdminResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=R();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return R()},toJSON(P){return{}},fromPartial(P){return R()}};function B(){return{admin:"",groupId:BigInt(0),metadata:""}}e.MsgUpdateGroupMetadata={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMetadata",encode(P,O=r.BinaryWriter.create()){return P.admin!==""&&O.uint32(10).string(P.admin),P.groupId!==BigInt(0)&&O.uint32(16).uint64(P.groupId),P.metadata!==""&&O.uint32(26).string(P.metadata),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=B();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupId=W.uint64();break;case 3:G.metadata=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=B();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),(0,o.isSet)(P.metadata)&&(O.metadata=String(P.metadata)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),P.metadata!==void 0&&(O.metadata=P.metadata),O},fromPartial(P){const O=B();return O.admin=P.admin??"",P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O.metadata=P.metadata??"",O}};function d(){return{}}e.MsgUpdateGroupMetadataResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupMetadataResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=d();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return d()},toJSON(P){return{}},fromPartial(P){return d()}};function s(){return{admin:"",groupId:BigInt(0),metadata:"",decisionPolicy:void 0}}e.MsgCreateGroupPolicy={typeUrl:"/cosmos.group.v1.MsgCreateGroupPolicy",encode(P,O=r.BinaryWriter.create()){return P.admin!==""&&O.uint32(10).string(P.admin),P.groupId!==BigInt(0)&&O.uint32(16).uint64(P.groupId),P.metadata!==""&&O.uint32(26).string(P.metadata),P.decisionPolicy!==void 0&&t.Any.encode(P.decisionPolicy,O.uint32(34).fork()).ldelim(),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=s();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupId=W.uint64();break;case 3:G.metadata=W.string();break;case 4:G.decisionPolicy=t.Any.decode(W,W.uint32());break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=s();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),(0,o.isSet)(P.metadata)&&(O.metadata=String(P.metadata)),(0,o.isSet)(P.decisionPolicy)&&(O.decisionPolicy=t.Any.fromJSON(P.decisionPolicy)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),P.metadata!==void 0&&(O.metadata=P.metadata),P.decisionPolicy!==void 0&&(O.decisionPolicy=P.decisionPolicy?t.Any.toJSON(P.decisionPolicy):void 0),O},fromPartial(P){const O=s();return O.admin=P.admin??"",P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O.metadata=P.metadata??"",P.decisionPolicy!==void 0&&P.decisionPolicy!==null&&(O.decisionPolicy=t.Any.fromPartial(P.decisionPolicy)),O}};function y(){return{address:""}}e.MsgCreateGroupPolicyResponse={typeUrl:"/cosmos.group.v1.MsgCreateGroupPolicyResponse",encode(P,O=r.BinaryWriter.create()){return P.address!==""&&O.uint32(10).string(P.address),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=y();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.address=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=y();return(0,o.isSet)(P.address)&&(O.address=String(P.address)),O},toJSON(P){const O={};return P.address!==void 0&&(O.address=P.address),O},fromPartial(P){const O=y();return O.address=P.address??"",O}};function E(){return{admin:"",groupPolicyAddress:"",newAdmin:""}}e.MsgUpdateGroupPolicyAdmin={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",encode(P,O=r.BinaryWriter.create()){return P.admin!==""&&O.uint32(10).string(P.admin),P.groupPolicyAddress!==""&&O.uint32(18).string(P.groupPolicyAddress),P.newAdmin!==""&&O.uint32(26).string(P.newAdmin),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=E();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupPolicyAddress=W.string();break;case 3:G.newAdmin=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=E();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupPolicyAddress)&&(O.groupPolicyAddress=String(P.groupPolicyAddress)),(0,o.isSet)(P.newAdmin)&&(O.newAdmin=String(P.newAdmin)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupPolicyAddress!==void 0&&(O.groupPolicyAddress=P.groupPolicyAddress),P.newAdmin!==void 0&&(O.newAdmin=P.newAdmin),O},fromPartial(P){const O=E();return O.admin=P.admin??"",O.groupPolicyAddress=P.groupPolicyAddress??"",O.newAdmin=P.newAdmin??"",O}};function _(){return{}}e.MsgUpdateGroupPolicyAdminResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyAdminResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=_();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return _()},toJSON(P){return{}},fromPartial(P){return _()}};function U(){return{admin:"",members:[],groupMetadata:"",groupPolicyMetadata:"",groupPolicyAsAdmin:!1,decisionPolicy:void 0}}e.MsgCreateGroupWithPolicy={typeUrl:"/cosmos.group.v1.MsgCreateGroupWithPolicy",encode(P,O=r.BinaryWriter.create()){P.admin!==""&&O.uint32(10).string(P.admin);for(const W of P.members)n.MemberRequest.encode(W,O.uint32(18).fork()).ldelim();return P.groupMetadata!==""&&O.uint32(26).string(P.groupMetadata),P.groupPolicyMetadata!==""&&O.uint32(34).string(P.groupPolicyMetadata),P.groupPolicyAsAdmin===!0&&O.uint32(40).bool(P.groupPolicyAsAdmin),P.decisionPolicy!==void 0&&t.Any.encode(P.decisionPolicy,O.uint32(50).fork()).ldelim(),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=U();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.members.push(n.MemberRequest.decode(W,W.uint32()));break;case 3:G.groupMetadata=W.string();break;case 4:G.groupPolicyMetadata=W.string();break;case 5:G.groupPolicyAsAdmin=W.bool();break;case 6:G.decisionPolicy=t.Any.decode(W,W.uint32());break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=U();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),Array.isArray(P==null?void 0:P.members)&&(O.members=P.members.map(W=>n.MemberRequest.fromJSON(W))),(0,o.isSet)(P.groupMetadata)&&(O.groupMetadata=String(P.groupMetadata)),(0,o.isSet)(P.groupPolicyMetadata)&&(O.groupPolicyMetadata=String(P.groupPolicyMetadata)),(0,o.isSet)(P.groupPolicyAsAdmin)&&(O.groupPolicyAsAdmin=!!P.groupPolicyAsAdmin),(0,o.isSet)(P.decisionPolicy)&&(O.decisionPolicy=t.Any.fromJSON(P.decisionPolicy)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.members?O.members=P.members.map(W=>W?n.MemberRequest.toJSON(W):void 0):O.members=[],P.groupMetadata!==void 0&&(O.groupMetadata=P.groupMetadata),P.groupPolicyMetadata!==void 0&&(O.groupPolicyMetadata=P.groupPolicyMetadata),P.groupPolicyAsAdmin!==void 0&&(O.groupPolicyAsAdmin=P.groupPolicyAsAdmin),P.decisionPolicy!==void 0&&(O.decisionPolicy=P.decisionPolicy?t.Any.toJSON(P.decisionPolicy):void 0),O},fromPartial(P){var W;const O=U();return O.admin=P.admin??"",O.members=((W=P.members)==null?void 0:W.map(L=>n.MemberRequest.fromPartial(L)))||[],O.groupMetadata=P.groupMetadata??"",O.groupPolicyMetadata=P.groupPolicyMetadata??"",O.groupPolicyAsAdmin=P.groupPolicyAsAdmin??!1,P.decisionPolicy!==void 0&&P.decisionPolicy!==null&&(O.decisionPolicy=t.Any.fromPartial(P.decisionPolicy)),O}};function H(){return{groupId:BigInt(0),groupPolicyAddress:""}}e.MsgCreateGroupWithPolicyResponse={typeUrl:"/cosmos.group.v1.MsgCreateGroupWithPolicyResponse",encode(P,O=r.BinaryWriter.create()){return P.groupId!==BigInt(0)&&O.uint32(8).uint64(P.groupId),P.groupPolicyAddress!==""&&O.uint32(18).string(P.groupPolicyAddress),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=H();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.groupId=W.uint64();break;case 2:G.groupPolicyAddress=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=H();return(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),(0,o.isSet)(P.groupPolicyAddress)&&(O.groupPolicyAddress=String(P.groupPolicyAddress)),O},toJSON(P){const O={};return P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),P.groupPolicyAddress!==void 0&&(O.groupPolicyAddress=P.groupPolicyAddress),O},fromPartial(P){const O=H();return P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O.groupPolicyAddress=P.groupPolicyAddress??"",O}};function i(){return{admin:"",groupPolicyAddress:"",decisionPolicy:void 0}}e.MsgUpdateGroupPolicyDecisionPolicy={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",encode(P,O=r.BinaryWriter.create()){return P.admin!==""&&O.uint32(10).string(P.admin),P.groupPolicyAddress!==""&&O.uint32(18).string(P.groupPolicyAddress),P.decisionPolicy!==void 0&&t.Any.encode(P.decisionPolicy,O.uint32(26).fork()).ldelim(),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=i();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupPolicyAddress=W.string();break;case 3:G.decisionPolicy=t.Any.decode(W,W.uint32());break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=i();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupPolicyAddress)&&(O.groupPolicyAddress=String(P.groupPolicyAddress)),(0,o.isSet)(P.decisionPolicy)&&(O.decisionPolicy=t.Any.fromJSON(P.decisionPolicy)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupPolicyAddress!==void 0&&(O.groupPolicyAddress=P.groupPolicyAddress),P.decisionPolicy!==void 0&&(O.decisionPolicy=P.decisionPolicy?t.Any.toJSON(P.decisionPolicy):void 0),O},fromPartial(P){const O=i();return O.admin=P.admin??"",O.groupPolicyAddress=P.groupPolicyAddress??"",P.decisionPolicy!==void 0&&P.decisionPolicy!==null&&(O.decisionPolicy=t.Any.fromPartial(P.decisionPolicy)),O}};function m(){return{}}e.MsgUpdateGroupPolicyDecisionPolicyResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicyResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=m();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return m()},toJSON(P){return{}},fromPartial(P){return m()}};function N(){return{admin:"",groupPolicyAddress:"",metadata:""}}e.MsgUpdateGroupPolicyMetadata={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",encode(P,O=r.BinaryWriter.create()){return P.admin!==""&&O.uint32(10).string(P.admin),P.groupPolicyAddress!==""&&O.uint32(18).string(P.groupPolicyAddress),P.metadata!==""&&O.uint32(26).string(P.metadata),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=N();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.admin=W.string();break;case 2:G.groupPolicyAddress=W.string();break;case 3:G.metadata=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=N();return(0,o.isSet)(P.admin)&&(O.admin=String(P.admin)),(0,o.isSet)(P.groupPolicyAddress)&&(O.groupPolicyAddress=String(P.groupPolicyAddress)),(0,o.isSet)(P.metadata)&&(O.metadata=String(P.metadata)),O},toJSON(P){const O={};return P.admin!==void 0&&(O.admin=P.admin),P.groupPolicyAddress!==void 0&&(O.groupPolicyAddress=P.groupPolicyAddress),P.metadata!==void 0&&(O.metadata=P.metadata),O},fromPartial(P){const O=N();return O.admin=P.admin??"",O.groupPolicyAddress=P.groupPolicyAddress??"",O.metadata=P.metadata??"",O}};function V(){return{}}e.MsgUpdateGroupPolicyMetadataResponse={typeUrl:"/cosmos.group.v1.MsgUpdateGroupPolicyMetadataResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=V();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return V()},toJSON(P){return{}},fromPartial(P){return V()}};function u(){return{groupPolicyAddress:"",proposers:[],metadata:"",messages:[],exec:0,title:"",summary:""}}e.MsgSubmitProposal={typeUrl:"/cosmos.group.v1.MsgSubmitProposal",encode(P,O=r.BinaryWriter.create()){P.groupPolicyAddress!==""&&O.uint32(10).string(P.groupPolicyAddress);for(const W of P.proposers)O.uint32(18).string(W);P.metadata!==""&&O.uint32(26).string(P.metadata);for(const W of P.messages)t.Any.encode(W,O.uint32(34).fork()).ldelim();return P.exec!==0&&O.uint32(40).int32(P.exec),P.title!==""&&O.uint32(50).string(P.title),P.summary!==""&&O.uint32(58).string(P.summary),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=u();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.groupPolicyAddress=W.string();break;case 2:G.proposers.push(W.string());break;case 3:G.metadata=W.string();break;case 4:G.messages.push(t.Any.decode(W,W.uint32()));break;case 5:G.exec=W.int32();break;case 6:G.title=W.string();break;case 7:G.summary=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=u();return(0,o.isSet)(P.groupPolicyAddress)&&(O.groupPolicyAddress=String(P.groupPolicyAddress)),Array.isArray(P==null?void 0:P.proposers)&&(O.proposers=P.proposers.map(W=>String(W))),(0,o.isSet)(P.metadata)&&(O.metadata=String(P.metadata)),Array.isArray(P==null?void 0:P.messages)&&(O.messages=P.messages.map(W=>t.Any.fromJSON(W))),(0,o.isSet)(P.exec)&&(O.exec=v(P.exec)),(0,o.isSet)(P.title)&&(O.title=String(P.title)),(0,o.isSet)(P.summary)&&(O.summary=String(P.summary)),O},toJSON(P){const O={};return P.groupPolicyAddress!==void 0&&(O.groupPolicyAddress=P.groupPolicyAddress),P.proposers?O.proposers=P.proposers.map(W=>W):O.proposers=[],P.metadata!==void 0&&(O.metadata=P.metadata),P.messages?O.messages=P.messages.map(W=>W?t.Any.toJSON(W):void 0):O.messages=[],P.exec!==void 0&&(O.exec=C(P.exec)),P.title!==void 0&&(O.title=P.title),P.summary!==void 0&&(O.summary=P.summary),O},fromPartial(P){var W,L;const O=u();return O.groupPolicyAddress=P.groupPolicyAddress??"",O.proposers=((W=P.proposers)==null?void 0:W.map(G=>G))||[],O.metadata=P.metadata??"",O.messages=((L=P.messages)==null?void 0:L.map(G=>t.Any.fromPartial(G)))||[],O.exec=P.exec??0,O.title=P.title??"",O.summary=P.summary??"",O}};function l(){return{proposalId:BigInt(0)}}e.MsgSubmitProposalResponse={typeUrl:"/cosmos.group.v1.MsgSubmitProposalResponse",encode(P,O=r.BinaryWriter.create()){return P.proposalId!==BigInt(0)&&O.uint32(8).uint64(P.proposalId),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=l();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.proposalId=W.uint64();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=l();return(0,o.isSet)(P.proposalId)&&(O.proposalId=BigInt(P.proposalId.toString())),O},toJSON(P){const O={};return P.proposalId!==void 0&&(O.proposalId=(P.proposalId||BigInt(0)).toString()),O},fromPartial(P){const O=l();return P.proposalId!==void 0&&P.proposalId!==null&&(O.proposalId=BigInt(P.proposalId.toString())),O}};function T(){return{proposalId:BigInt(0),address:""}}e.MsgWithdrawProposal={typeUrl:"/cosmos.group.v1.MsgWithdrawProposal",encode(P,O=r.BinaryWriter.create()){return P.proposalId!==BigInt(0)&&O.uint32(8).uint64(P.proposalId),P.address!==""&&O.uint32(18).string(P.address),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=T();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.proposalId=W.uint64();break;case 2:G.address=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=T();return(0,o.isSet)(P.proposalId)&&(O.proposalId=BigInt(P.proposalId.toString())),(0,o.isSet)(P.address)&&(O.address=String(P.address)),O},toJSON(P){const O={};return P.proposalId!==void 0&&(O.proposalId=(P.proposalId||BigInt(0)).toString()),P.address!==void 0&&(O.address=P.address),O},fromPartial(P){const O=T();return P.proposalId!==void 0&&P.proposalId!==null&&(O.proposalId=BigInt(P.proposalId.toString())),O.address=P.address??"",O}};function f(){return{}}e.MsgWithdrawProposalResponse={typeUrl:"/cosmos.group.v1.MsgWithdrawProposalResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=f();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return f()},toJSON(P){return{}},fromPartial(P){return f()}};function p(){return{proposalId:BigInt(0),voter:"",option:0,metadata:"",exec:0}}e.MsgVote={typeUrl:"/cosmos.group.v1.MsgVote",encode(P,O=r.BinaryWriter.create()){return P.proposalId!==BigInt(0)&&O.uint32(8).uint64(P.proposalId),P.voter!==""&&O.uint32(18).string(P.voter),P.option!==0&&O.uint32(24).int32(P.option),P.metadata!==""&&O.uint32(34).string(P.metadata),P.exec!==0&&O.uint32(40).int32(P.exec),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=p();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.proposalId=W.uint64();break;case 2:G.voter=W.string();break;case 3:G.option=W.int32();break;case 4:G.metadata=W.string();break;case 5:G.exec=W.int32();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=p();return(0,o.isSet)(P.proposalId)&&(O.proposalId=BigInt(P.proposalId.toString())),(0,o.isSet)(P.voter)&&(O.voter=String(P.voter)),(0,o.isSet)(P.option)&&(O.option=(0,n.voteOptionFromJSON)(P.option)),(0,o.isSet)(P.metadata)&&(O.metadata=String(P.metadata)),(0,o.isSet)(P.exec)&&(O.exec=v(P.exec)),O},toJSON(P){const O={};return P.proposalId!==void 0&&(O.proposalId=(P.proposalId||BigInt(0)).toString()),P.voter!==void 0&&(O.voter=P.voter),P.option!==void 0&&(O.option=(0,n.voteOptionToJSON)(P.option)),P.metadata!==void 0&&(O.metadata=P.metadata),P.exec!==void 0&&(O.exec=C(P.exec)),O},fromPartial(P){const O=p();return P.proposalId!==void 0&&P.proposalId!==null&&(O.proposalId=BigInt(P.proposalId.toString())),O.voter=P.voter??"",O.option=P.option??0,O.metadata=P.metadata??"",O.exec=P.exec??0,O}};function A(){return{}}e.MsgVoteResponse={typeUrl:"/cosmos.group.v1.MsgVoteResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=A();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return A()},toJSON(P){return{}},fromPartial(P){return A()}};function Q(){return{proposalId:BigInt(0),executor:""}}e.MsgExec={typeUrl:"/cosmos.group.v1.MsgExec",encode(P,O=r.BinaryWriter.create()){return P.proposalId!==BigInt(0)&&O.uint32(8).uint64(P.proposalId),P.executor!==""&&O.uint32(18).string(P.executor),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=Q();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.proposalId=W.uint64();break;case 2:G.executor=W.string();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=Q();return(0,o.isSet)(P.proposalId)&&(O.proposalId=BigInt(P.proposalId.toString())),(0,o.isSet)(P.executor)&&(O.executor=String(P.executor)),O},toJSON(P){const O={};return P.proposalId!==void 0&&(O.proposalId=(P.proposalId||BigInt(0)).toString()),P.executor!==void 0&&(O.executor=P.executor),O},fromPartial(P){const O=Q();return P.proposalId!==void 0&&P.proposalId!==null&&(O.proposalId=BigInt(P.proposalId.toString())),O.executor=P.executor??"",O}};function M(){return{result:0}}e.MsgExecResponse={typeUrl:"/cosmos.group.v1.MsgExecResponse",encode(P,O=r.BinaryWriter.create()){return P.result!==0&&O.uint32(16).int32(P.result),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=M();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 2:G.result=W.int32();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=M();return(0,o.isSet)(P.result)&&(O.result=(0,n.proposalExecutorResultFromJSON)(P.result)),O},toJSON(P){const O={};return P.result!==void 0&&(O.result=(0,n.proposalExecutorResultToJSON)(P.result)),O},fromPartial(P){const O=M();return O.result=P.result??0,O}};function a(){return{address:"",groupId:BigInt(0)}}e.MsgLeaveGroup={typeUrl:"/cosmos.group.v1.MsgLeaveGroup",encode(P,O=r.BinaryWriter.create()){return P.address!==""&&O.uint32(10).string(P.address),P.groupId!==BigInt(0)&&O.uint32(16).uint64(P.groupId),O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=a();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){case 1:G.address=W.string();break;case 2:G.groupId=W.uint64();break;default:W.skipType(X&7);break}}return G},fromJSON(P){const O=a();return(0,o.isSet)(P.address)&&(O.address=String(P.address)),(0,o.isSet)(P.groupId)&&(O.groupId=BigInt(P.groupId.toString())),O},toJSON(P){const O={};return P.address!==void 0&&(O.address=P.address),P.groupId!==void 0&&(O.groupId=(P.groupId||BigInt(0)).toString()),O},fromPartial(P){const O=a();return O.address=P.address??"",P.groupId!==void 0&&P.groupId!==null&&(O.groupId=BigInt(P.groupId.toString())),O}};function k(){return{}}e.MsgLeaveGroupResponse={typeUrl:"/cosmos.group.v1.MsgLeaveGroupResponse",encode(P,O=r.BinaryWriter.create()){return O},decode(P,O){const W=P instanceof r.BinaryReader?P:new r.BinaryReader(P);let L=O===void 0?W.len:W.pos+O;const G=k();for(;W.pos<L;){const X=W.uint32();switch(X>>>3){default:W.skipType(X&7);break}}return G},fromJSON(P){return k()},toJSON(P){return{}},fromPartial(P){return k()}};class S{constructor(O){this.rpc=O,this.CreateGroup=this.CreateGroup.bind(this),this.UpdateGroupMembers=this.UpdateGroupMembers.bind(this),this.UpdateGroupAdmin=this.UpdateGroupAdmin.bind(this),this.UpdateGroupMetadata=this.UpdateGroupMetadata.bind(this),this.CreateGroupPolicy=this.CreateGroupPolicy.bind(this),this.CreateGroupWithPolicy=this.CreateGroupWithPolicy.bind(this),this.UpdateGroupPolicyAdmin=this.UpdateGroupPolicyAdmin.bind(this),this.UpdateGroupPolicyDecisionPolicy=this.UpdateGroupPolicyDecisionPolicy.bind(this),this.UpdateGroupPolicyMetadata=this.UpdateGroupPolicyMetadata.bind(this),this.SubmitProposal=this.SubmitProposal.bind(this),this.WithdrawProposal=this.WithdrawProposal.bind(this),this.Vote=this.Vote.bind(this),this.Exec=this.Exec.bind(this),this.LeaveGroup=this.LeaveGroup.bind(this)}CreateGroup(O){const W=e.MsgCreateGroup.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroup",W).then(G=>e.MsgCreateGroupResponse.decode(new r.BinaryReader(G)))}UpdateGroupMembers(O){const W=e.MsgUpdateGroupMembers.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupMembers",W).then(G=>e.MsgUpdateGroupMembersResponse.decode(new r.BinaryReader(G)))}UpdateGroupAdmin(O){const W=e.MsgUpdateGroupAdmin.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupAdmin",W).then(G=>e.MsgUpdateGroupAdminResponse.decode(new r.BinaryReader(G)))}UpdateGroupMetadata(O){const W=e.MsgUpdateGroupMetadata.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupMetadata",W).then(G=>e.MsgUpdateGroupMetadataResponse.decode(new r.BinaryReader(G)))}CreateGroupPolicy(O){const W=e.MsgCreateGroupPolicy.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroupPolicy",W).then(G=>e.MsgCreateGroupPolicyResponse.decode(new r.BinaryReader(G)))}CreateGroupWithPolicy(O){const W=e.MsgCreateGroupWithPolicy.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroupWithPolicy",W).then(G=>e.MsgCreateGroupWithPolicyResponse.decode(new r.BinaryReader(G)))}UpdateGroupPolicyAdmin(O){const W=e.MsgUpdateGroupPolicyAdmin.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyAdmin",W).then(G=>e.MsgUpdateGroupPolicyAdminResponse.decode(new r.BinaryReader(G)))}UpdateGroupPolicyDecisionPolicy(O){const W=e.MsgUpdateGroupPolicyDecisionPolicy.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyDecisionPolicy",W).then(G=>e.MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new r.BinaryReader(G)))}UpdateGroupPolicyMetadata(O){const W=e.MsgUpdateGroupPolicyMetadata.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyMetadata",W).then(G=>e.MsgUpdateGroupPolicyMetadataResponse.decode(new r.BinaryReader(G)))}SubmitProposal(O){const W=e.MsgSubmitProposal.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","SubmitProposal",W).then(G=>e.MsgSubmitProposalResponse.decode(new r.BinaryReader(G)))}WithdrawProposal(O){const W=e.MsgWithdrawProposal.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","WithdrawProposal",W).then(G=>e.MsgWithdrawProposalResponse.decode(new r.BinaryReader(G)))}Vote(O){const W=e.MsgVote.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","Vote",W).then(G=>e.MsgVoteResponse.decode(new r.BinaryReader(G)))}Exec(O){const W=e.MsgExec.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","Exec",W).then(G=>e.MsgExecResponse.decode(new r.BinaryReader(G)))}LeaveGroup(O){const W=e.MsgLeaveGroup.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","LeaveGroup",W).then(G=>e.MsgLeaveGroupResponse.decode(new r.BinaryReader(G)))}}e.MsgClientImpl=S})(Am);Object.defineProperty(ss,"__esModule",{value:!0});ss.groupTypes=void 0;const ze=Am;ss.groupTypes=[["/cosmos.group.v1.MsgCreateGroup",ze.MsgCreateGroup],["/cosmos.group.v1.MsgCreateGroupPolicy",ze.MsgCreateGroupPolicy],["/cosmos.group.v1.MsgCreateGroupWithPolicy",ze.MsgCreateGroupWithPolicy],["/cosmos.group.v1.MsgExec",ze.MsgExec],["/cosmos.group.v1.MsgLeaveGroup",ze.MsgLeaveGroup],["/cosmos.group.v1.MsgSubmitProposal",ze.MsgSubmitProposal],["/cosmos.group.v1.MsgUpdateGroupAdmin",ze.MsgUpdateGroupAdmin],["/cosmos.group.v1.MsgUpdateGroupMembers",ze.MsgUpdateGroupMembers],["/cosmos.group.v1.MsgUpdateGroupMetadata",ze.MsgUpdateGroupMetadata],["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",ze.MsgUpdateGroupPolicyAdmin],["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",ze.MsgUpdateGroupPolicyDecisionPolicy],["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",ze.MsgUpdateGroupPolicyMetadata],["/cosmos.group.v1.MsgVote",ze.MsgVote],["/cosmos.group.v1.MsgWithdrawProposal",ze.MsgWithdrawProposal]];var si={};Object.defineProperty(si,"__esModule",{value:!0});si.createIbcAminoConverters=si.isAminoMsgTransfer=void 0;const Mo=zn,lR=pc;function fR(e){return e.type==="cosmos-sdk/MsgTransfer"}si.isAminoMsgTransfer=fR;function pR(){return{"/ibc.applications.transfer.v1.MsgTransfer":{aminoType:"cosmos-sdk/MsgTransfer",toAmino:({sourcePort:e,sourceChannel:n,token:t,sender:r,receiver:o,timeoutHeight:h,timeoutTimestamp:v,memo:C})=>{var w,D,J;return{source_port:e,source_channel:n,token:t,sender:r,receiver:o,timeout_height:h?{revision_height:(w=(0,Mo.omitDefault)(h.revisionHeight))==null?void 0:w.toString(),revision_number:(D=(0,Mo.omitDefault)(h.revisionNumber))==null?void 0:D.toString()}:{},timeout_timestamp:(J=(0,Mo.omitDefault)(v))==null?void 0:J.toString(),memo:(0,Mo.omitDefault)(C)}},fromAmino:({source_port:e,source_channel:n,token:t,sender:r,receiver:o,timeout_height:h,timeout_timestamp:v,memo:C})=>lR.MsgTransfer.fromPartial({sourcePort:e,sourceChannel:n,token:t,sender:r,receiver:o,timeoutHeight:h?{revisionHeight:BigInt(h.revision_height||"0"),revisionNumber:BigInt(h.revision_number||"0")}:void 0,timeoutTimestamp:BigInt(v||"0"),memo:C??""})}}}si.createIbcAminoConverters=pR;var di={},Tm={},ds={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Acknowledgement=e.PacketId=e.PacketState=e.Packet=e.Counterparty=e.IdentifiedChannel=e.Channel=e.orderToJSON=e.orderFromJSON=e.Order=e.stateToJSON=e.stateFromJSON=e.State=e.protobufPackage=void 0;const n=sr,t=ee,r=ne;e.protobufPackage="ibc.core.channel.v1";var o;(function(y){y[y.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",y[y.STATE_INIT=1]="STATE_INIT",y[y.STATE_TRYOPEN=2]="STATE_TRYOPEN",y[y.STATE_OPEN=3]="STATE_OPEN",y[y.STATE_CLOSED=4]="STATE_CLOSED",y[y.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o||(e.State=o={}));function h(y){switch(y){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return o.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return o.STATE_INIT;case 2:case"STATE_TRYOPEN":return o.STATE_TRYOPEN;case 3:case"STATE_OPEN":return o.STATE_OPEN;case 4:case"STATE_CLOSED":return o.STATE_CLOSED;case-1:case"UNRECOGNIZED":default:return o.UNRECOGNIZED}}e.stateFromJSON=h;function v(y){switch(y){case o.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case o.STATE_INIT:return"STATE_INIT";case o.STATE_TRYOPEN:return"STATE_TRYOPEN";case o.STATE_OPEN:return"STATE_OPEN";case o.STATE_CLOSED:return"STATE_CLOSED";case o.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.stateToJSON=v;var C;(function(y){y[y.ORDER_NONE_UNSPECIFIED=0]="ORDER_NONE_UNSPECIFIED",y[y.ORDER_UNORDERED=1]="ORDER_UNORDERED",y[y.ORDER_ORDERED=2]="ORDER_ORDERED",y[y.UNRECOGNIZED=-1]="UNRECOGNIZED"})(C||(e.Order=C={}));function w(y){switch(y){case 0:case"ORDER_NONE_UNSPECIFIED":return C.ORDER_NONE_UNSPECIFIED;case 1:case"ORDER_UNORDERED":return C.ORDER_UNORDERED;case 2:case"ORDER_ORDERED":return C.ORDER_ORDERED;case-1:case"UNRECOGNIZED":default:return C.UNRECOGNIZED}}e.orderFromJSON=w;function D(y){switch(y){case C.ORDER_NONE_UNSPECIFIED:return"ORDER_NONE_UNSPECIFIED";case C.ORDER_UNORDERED:return"ORDER_UNORDERED";case C.ORDER_ORDERED:return"ORDER_ORDERED";case C.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.orderToJSON=D;function J(){return{state:0,ordering:0,counterparty:e.Counterparty.fromPartial({}),connectionHops:[],version:""}}e.Channel={typeUrl:"/ibc.core.channel.v1.Channel",encode(y,E=t.BinaryWriter.create()){y.state!==0&&E.uint32(8).int32(y.state),y.ordering!==0&&E.uint32(16).int32(y.ordering),y.counterparty!==void 0&&e.Counterparty.encode(y.counterparty,E.uint32(26).fork()).ldelim();for(const _ of y.connectionHops)E.uint32(34).string(_);return y.version!==""&&E.uint32(42).string(y.version),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=J();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 1:H.state=_.int32();break;case 2:H.ordering=_.int32();break;case 3:H.counterparty=e.Counterparty.decode(_,_.uint32());break;case 4:H.connectionHops.push(_.string());break;case 5:H.version=_.string();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=J();return(0,r.isSet)(y.state)&&(E.state=h(y.state)),(0,r.isSet)(y.ordering)&&(E.ordering=w(y.ordering)),(0,r.isSet)(y.counterparty)&&(E.counterparty=e.Counterparty.fromJSON(y.counterparty)),Array.isArray(y==null?void 0:y.connectionHops)&&(E.connectionHops=y.connectionHops.map(_=>String(_))),(0,r.isSet)(y.version)&&(E.version=String(y.version)),E},toJSON(y){const E={};return y.state!==void 0&&(E.state=v(y.state)),y.ordering!==void 0&&(E.ordering=D(y.ordering)),y.counterparty!==void 0&&(E.counterparty=y.counterparty?e.Counterparty.toJSON(y.counterparty):void 0),y.connectionHops?E.connectionHops=y.connectionHops.map(_=>_):E.connectionHops=[],y.version!==void 0&&(E.version=y.version),E},fromPartial(y){var _;const E=J();return E.state=y.state??0,E.ordering=y.ordering??0,y.counterparty!==void 0&&y.counterparty!==null&&(E.counterparty=e.Counterparty.fromPartial(y.counterparty)),E.connectionHops=((_=y.connectionHops)==null?void 0:_.map(U=>U))||[],E.version=y.version??"",E}};function I(){return{state:0,ordering:0,counterparty:e.Counterparty.fromPartial({}),connectionHops:[],version:"",portId:"",channelId:""}}e.IdentifiedChannel={typeUrl:"/ibc.core.channel.v1.IdentifiedChannel",encode(y,E=t.BinaryWriter.create()){y.state!==0&&E.uint32(8).int32(y.state),y.ordering!==0&&E.uint32(16).int32(y.ordering),y.counterparty!==void 0&&e.Counterparty.encode(y.counterparty,E.uint32(26).fork()).ldelim();for(const _ of y.connectionHops)E.uint32(34).string(_);return y.version!==""&&E.uint32(42).string(y.version),y.portId!==""&&E.uint32(50).string(y.portId),y.channelId!==""&&E.uint32(58).string(y.channelId),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=I();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 1:H.state=_.int32();break;case 2:H.ordering=_.int32();break;case 3:H.counterparty=e.Counterparty.decode(_,_.uint32());break;case 4:H.connectionHops.push(_.string());break;case 5:H.version=_.string();break;case 6:H.portId=_.string();break;case 7:H.channelId=_.string();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=I();return(0,r.isSet)(y.state)&&(E.state=h(y.state)),(0,r.isSet)(y.ordering)&&(E.ordering=w(y.ordering)),(0,r.isSet)(y.counterparty)&&(E.counterparty=e.Counterparty.fromJSON(y.counterparty)),Array.isArray(y==null?void 0:y.connectionHops)&&(E.connectionHops=y.connectionHops.map(_=>String(_))),(0,r.isSet)(y.version)&&(E.version=String(y.version)),(0,r.isSet)(y.portId)&&(E.portId=String(y.portId)),(0,r.isSet)(y.channelId)&&(E.channelId=String(y.channelId)),E},toJSON(y){const E={};return y.state!==void 0&&(E.state=v(y.state)),y.ordering!==void 0&&(E.ordering=D(y.ordering)),y.counterparty!==void 0&&(E.counterparty=y.counterparty?e.Counterparty.toJSON(y.counterparty):void 0),y.connectionHops?E.connectionHops=y.connectionHops.map(_=>_):E.connectionHops=[],y.version!==void 0&&(E.version=y.version),y.portId!==void 0&&(E.portId=y.portId),y.channelId!==void 0&&(E.channelId=y.channelId),E},fromPartial(y){var _;const E=I();return E.state=y.state??0,E.ordering=y.ordering??0,y.counterparty!==void 0&&y.counterparty!==null&&(E.counterparty=e.Counterparty.fromPartial(y.counterparty)),E.connectionHops=((_=y.connectionHops)==null?void 0:_.map(U=>U))||[],E.version=y.version??"",E.portId=y.portId??"",E.channelId=y.channelId??"",E}};function g(){return{portId:"",channelId:""}}e.Counterparty={typeUrl:"/ibc.core.channel.v1.Counterparty",encode(y,E=t.BinaryWriter.create()){return y.portId!==""&&E.uint32(10).string(y.portId),y.channelId!==""&&E.uint32(18).string(y.channelId),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=g();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 1:H.portId=_.string();break;case 2:H.channelId=_.string();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=g();return(0,r.isSet)(y.portId)&&(E.portId=String(y.portId)),(0,r.isSet)(y.channelId)&&(E.channelId=String(y.channelId)),E},toJSON(y){const E={};return y.portId!==void 0&&(E.portId=y.portId),y.channelId!==void 0&&(E.channelId=y.channelId),E},fromPartial(y){const E=g();return E.portId=y.portId??"",E.channelId=y.channelId??"",E}};function R(){return{sequence:BigInt(0),sourcePort:"",sourceChannel:"",destinationPort:"",destinationChannel:"",data:new Uint8Array,timeoutHeight:n.Height.fromPartial({}),timeoutTimestamp:BigInt(0)}}e.Packet={typeUrl:"/ibc.core.channel.v1.Packet",encode(y,E=t.BinaryWriter.create()){return y.sequence!==BigInt(0)&&E.uint32(8).uint64(y.sequence),y.sourcePort!==""&&E.uint32(18).string(y.sourcePort),y.sourceChannel!==""&&E.uint32(26).string(y.sourceChannel),y.destinationPort!==""&&E.uint32(34).string(y.destinationPort),y.destinationChannel!==""&&E.uint32(42).string(y.destinationChannel),y.data.length!==0&&E.uint32(50).bytes(y.data),y.timeoutHeight!==void 0&&n.Height.encode(y.timeoutHeight,E.uint32(58).fork()).ldelim(),y.timeoutTimestamp!==BigInt(0)&&E.uint32(64).uint64(y.timeoutTimestamp),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=R();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 1:H.sequence=_.uint64();break;case 2:H.sourcePort=_.string();break;case 3:H.sourceChannel=_.string();break;case 4:H.destinationPort=_.string();break;case 5:H.destinationChannel=_.string();break;case 6:H.data=_.bytes();break;case 7:H.timeoutHeight=n.Height.decode(_,_.uint32());break;case 8:H.timeoutTimestamp=_.uint64();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=R();return(0,r.isSet)(y.sequence)&&(E.sequence=BigInt(y.sequence.toString())),(0,r.isSet)(y.sourcePort)&&(E.sourcePort=String(y.sourcePort)),(0,r.isSet)(y.sourceChannel)&&(E.sourceChannel=String(y.sourceChannel)),(0,r.isSet)(y.destinationPort)&&(E.destinationPort=String(y.destinationPort)),(0,r.isSet)(y.destinationChannel)&&(E.destinationChannel=String(y.destinationChannel)),(0,r.isSet)(y.data)&&(E.data=(0,r.bytesFromBase64)(y.data)),(0,r.isSet)(y.timeoutHeight)&&(E.timeoutHeight=n.Height.fromJSON(y.timeoutHeight)),(0,r.isSet)(y.timeoutTimestamp)&&(E.timeoutTimestamp=BigInt(y.timeoutTimestamp.toString())),E},toJSON(y){const E={};return y.sequence!==void 0&&(E.sequence=(y.sequence||BigInt(0)).toString()),y.sourcePort!==void 0&&(E.sourcePort=y.sourcePort),y.sourceChannel!==void 0&&(E.sourceChannel=y.sourceChannel),y.destinationPort!==void 0&&(E.destinationPort=y.destinationPort),y.destinationChannel!==void 0&&(E.destinationChannel=y.destinationChannel),y.data!==void 0&&(E.data=(0,r.base64FromBytes)(y.data!==void 0?y.data:new Uint8Array)),y.timeoutHeight!==void 0&&(E.timeoutHeight=y.timeoutHeight?n.Height.toJSON(y.timeoutHeight):void 0),y.timeoutTimestamp!==void 0&&(E.timeoutTimestamp=(y.timeoutTimestamp||BigInt(0)).toString()),E},fromPartial(y){const E=R();return y.sequence!==void 0&&y.sequence!==null&&(E.sequence=BigInt(y.sequence.toString())),E.sourcePort=y.sourcePort??"",E.sourceChannel=y.sourceChannel??"",E.destinationPort=y.destinationPort??"",E.destinationChannel=y.destinationChannel??"",E.data=y.data??new Uint8Array,y.timeoutHeight!==void 0&&y.timeoutHeight!==null&&(E.timeoutHeight=n.Height.fromPartial(y.timeoutHeight)),y.timeoutTimestamp!==void 0&&y.timeoutTimestamp!==null&&(E.timeoutTimestamp=BigInt(y.timeoutTimestamp.toString())),E}};function B(){return{portId:"",channelId:"",sequence:BigInt(0),data:new Uint8Array}}e.PacketState={typeUrl:"/ibc.core.channel.v1.PacketState",encode(y,E=t.BinaryWriter.create()){return y.portId!==""&&E.uint32(10).string(y.portId),y.channelId!==""&&E.uint32(18).string(y.channelId),y.sequence!==BigInt(0)&&E.uint32(24).uint64(y.sequence),y.data.length!==0&&E.uint32(34).bytes(y.data),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=B();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 1:H.portId=_.string();break;case 2:H.channelId=_.string();break;case 3:H.sequence=_.uint64();break;case 4:H.data=_.bytes();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=B();return(0,r.isSet)(y.portId)&&(E.portId=String(y.portId)),(0,r.isSet)(y.channelId)&&(E.channelId=String(y.channelId)),(0,r.isSet)(y.sequence)&&(E.sequence=BigInt(y.sequence.toString())),(0,r.isSet)(y.data)&&(E.data=(0,r.bytesFromBase64)(y.data)),E},toJSON(y){const E={};return y.portId!==void 0&&(E.portId=y.portId),y.channelId!==void 0&&(E.channelId=y.channelId),y.sequence!==void 0&&(E.sequence=(y.sequence||BigInt(0)).toString()),y.data!==void 0&&(E.data=(0,r.base64FromBytes)(y.data!==void 0?y.data:new Uint8Array)),E},fromPartial(y){const E=B();return E.portId=y.portId??"",E.channelId=y.channelId??"",y.sequence!==void 0&&y.sequence!==null&&(E.sequence=BigInt(y.sequence.toString())),E.data=y.data??new Uint8Array,E}};function d(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.PacketId={typeUrl:"/ibc.core.channel.v1.PacketId",encode(y,E=t.BinaryWriter.create()){return y.portId!==""&&E.uint32(10).string(y.portId),y.channelId!==""&&E.uint32(18).string(y.channelId),y.sequence!==BigInt(0)&&E.uint32(24).uint64(y.sequence),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=d();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 1:H.portId=_.string();break;case 2:H.channelId=_.string();break;case 3:H.sequence=_.uint64();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=d();return(0,r.isSet)(y.portId)&&(E.portId=String(y.portId)),(0,r.isSet)(y.channelId)&&(E.channelId=String(y.channelId)),(0,r.isSet)(y.sequence)&&(E.sequence=BigInt(y.sequence.toString())),E},toJSON(y){const E={};return y.portId!==void 0&&(E.portId=y.portId),y.channelId!==void 0&&(E.channelId=y.channelId),y.sequence!==void 0&&(E.sequence=(y.sequence||BigInt(0)).toString()),E},fromPartial(y){const E=d();return E.portId=y.portId??"",E.channelId=y.channelId??"",y.sequence!==void 0&&y.sequence!==null&&(E.sequence=BigInt(y.sequence.toString())),E}};function s(){return{result:void 0,error:void 0}}e.Acknowledgement={typeUrl:"/ibc.core.channel.v1.Acknowledgement",encode(y,E=t.BinaryWriter.create()){return y.result!==void 0&&E.uint32(170).bytes(y.result),y.error!==void 0&&E.uint32(178).string(y.error),E},decode(y,E){const _=y instanceof t.BinaryReader?y:new t.BinaryReader(y);let U=E===void 0?_.len:_.pos+E;const H=s();for(;_.pos<U;){const i=_.uint32();switch(i>>>3){case 21:H.result=_.bytes();break;case 22:H.error=_.string();break;default:_.skipType(i&7);break}}return H},fromJSON(y){const E=s();return(0,r.isSet)(y.result)&&(E.result=(0,r.bytesFromBase64)(y.result)),(0,r.isSet)(y.error)&&(E.error=String(y.error)),E},toJSON(y){const E={};return y.result!==void 0&&(E.result=y.result!==void 0?(0,r.base64FromBytes)(y.result):void 0),y.error!==void 0&&(E.error=y.error),E},fromPartial(y){const E=s();return E.result=y.result??void 0,E.error=y.error??void 0,E}}})(ds);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgAcknowledgementResponse=e.MsgAcknowledgement=e.MsgTimeoutOnCloseResponse=e.MsgTimeoutOnClose=e.MsgTimeoutResponse=e.MsgTimeout=e.MsgRecvPacketResponse=e.MsgRecvPacket=e.MsgChannelCloseConfirmResponse=e.MsgChannelCloseConfirm=e.MsgChannelCloseInitResponse=e.MsgChannelCloseInit=e.MsgChannelOpenConfirmResponse=e.MsgChannelOpenConfirm=e.MsgChannelOpenAckResponse=e.MsgChannelOpenAck=e.MsgChannelOpenTryResponse=e.MsgChannelOpenTry=e.MsgChannelOpenInitResponse=e.MsgChannelOpenInit=e.responseResultTypeToJSON=e.responseResultTypeFromJSON=e.ResponseResultType=e.protobufPackage=void 0;const n=ds,t=sr,r=ee,o=ne;e.protobufPackage="ibc.core.channel.v1";var h;(function(f){f[f.RESPONSE_RESULT_TYPE_UNSPECIFIED=0]="RESPONSE_RESULT_TYPE_UNSPECIFIED",f[f.RESPONSE_RESULT_TYPE_NOOP=1]="RESPONSE_RESULT_TYPE_NOOP",f[f.RESPONSE_RESULT_TYPE_SUCCESS=2]="RESPONSE_RESULT_TYPE_SUCCESS",f[f.UNRECOGNIZED=-1]="UNRECOGNIZED"})(h||(e.ResponseResultType=h={}));function v(f){switch(f){case 0:case"RESPONSE_RESULT_TYPE_UNSPECIFIED":return h.RESPONSE_RESULT_TYPE_UNSPECIFIED;case 1:case"RESPONSE_RESULT_TYPE_NOOP":return h.RESPONSE_RESULT_TYPE_NOOP;case 2:case"RESPONSE_RESULT_TYPE_SUCCESS":return h.RESPONSE_RESULT_TYPE_SUCCESS;case-1:case"UNRECOGNIZED":default:return h.UNRECOGNIZED}}e.responseResultTypeFromJSON=v;function C(f){switch(f){case h.RESPONSE_RESULT_TYPE_UNSPECIFIED:return"RESPONSE_RESULT_TYPE_UNSPECIFIED";case h.RESPONSE_RESULT_TYPE_NOOP:return"RESPONSE_RESULT_TYPE_NOOP";case h.RESPONSE_RESULT_TYPE_SUCCESS:return"RESPONSE_RESULT_TYPE_SUCCESS";case h.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseResultTypeToJSON=C;function w(){return{portId:"",channel:n.Channel.fromPartial({}),signer:""}}e.MsgChannelOpenInit={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenInit",encode(f,p=r.BinaryWriter.create()){return f.portId!==""&&p.uint32(10).string(f.portId),f.channel!==void 0&&n.Channel.encode(f.channel,p.uint32(18).fork()).ldelim(),f.signer!==""&&p.uint32(26).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=w();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.portId=A.string();break;case 2:M.channel=n.Channel.decode(A,A.uint32());break;case 3:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=w();return(0,o.isSet)(f.portId)&&(p.portId=String(f.portId)),(0,o.isSet)(f.channel)&&(p.channel=n.Channel.fromJSON(f.channel)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.portId!==void 0&&(p.portId=f.portId),f.channel!==void 0&&(p.channel=f.channel?n.Channel.toJSON(f.channel):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=w();return p.portId=f.portId??"",f.channel!==void 0&&f.channel!==null&&(p.channel=n.Channel.fromPartial(f.channel)),p.signer=f.signer??"",p}};function D(){return{channelId:"",version:""}}e.MsgChannelOpenInitResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenInitResponse",encode(f,p=r.BinaryWriter.create()){return f.channelId!==""&&p.uint32(10).string(f.channelId),f.version!==""&&p.uint32(18).string(f.version),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=D();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.channelId=A.string();break;case 2:M.version=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=D();return(0,o.isSet)(f.channelId)&&(p.channelId=String(f.channelId)),(0,o.isSet)(f.version)&&(p.version=String(f.version)),p},toJSON(f){const p={};return f.channelId!==void 0&&(p.channelId=f.channelId),f.version!==void 0&&(p.version=f.version),p},fromPartial(f){const p=D();return p.channelId=f.channelId??"",p.version=f.version??"",p}};function J(){return{portId:"",previousChannelId:"",channel:n.Channel.fromPartial({}),counterpartyVersion:"",proofInit:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelOpenTry={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenTry",encode(f,p=r.BinaryWriter.create()){return f.portId!==""&&p.uint32(10).string(f.portId),f.previousChannelId!==""&&p.uint32(18).string(f.previousChannelId),f.channel!==void 0&&n.Channel.encode(f.channel,p.uint32(26).fork()).ldelim(),f.counterpartyVersion!==""&&p.uint32(34).string(f.counterpartyVersion),f.proofInit.length!==0&&p.uint32(42).bytes(f.proofInit),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(50).fork()).ldelim(),f.signer!==""&&p.uint32(58).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=J();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.portId=A.string();break;case 2:M.previousChannelId=A.string();break;case 3:M.channel=n.Channel.decode(A,A.uint32());break;case 4:M.counterpartyVersion=A.string();break;case 5:M.proofInit=A.bytes();break;case 6:M.proofHeight=t.Height.decode(A,A.uint32());break;case 7:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=J();return(0,o.isSet)(f.portId)&&(p.portId=String(f.portId)),(0,o.isSet)(f.previousChannelId)&&(p.previousChannelId=String(f.previousChannelId)),(0,o.isSet)(f.channel)&&(p.channel=n.Channel.fromJSON(f.channel)),(0,o.isSet)(f.counterpartyVersion)&&(p.counterpartyVersion=String(f.counterpartyVersion)),(0,o.isSet)(f.proofInit)&&(p.proofInit=(0,o.bytesFromBase64)(f.proofInit)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.portId!==void 0&&(p.portId=f.portId),f.previousChannelId!==void 0&&(p.previousChannelId=f.previousChannelId),f.channel!==void 0&&(p.channel=f.channel?n.Channel.toJSON(f.channel):void 0),f.counterpartyVersion!==void 0&&(p.counterpartyVersion=f.counterpartyVersion),f.proofInit!==void 0&&(p.proofInit=(0,o.base64FromBytes)(f.proofInit!==void 0?f.proofInit:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=J();return p.portId=f.portId??"",p.previousChannelId=f.previousChannelId??"",f.channel!==void 0&&f.channel!==null&&(p.channel=n.Channel.fromPartial(f.channel)),p.counterpartyVersion=f.counterpartyVersion??"",p.proofInit=f.proofInit??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),p.signer=f.signer??"",p}};function I(){return{version:""}}e.MsgChannelOpenTryResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenTryResponse",encode(f,p=r.BinaryWriter.create()){return f.version!==""&&p.uint32(10).string(f.version),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=I();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.version=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=I();return(0,o.isSet)(f.version)&&(p.version=String(f.version)),p},toJSON(f){const p={};return f.version!==void 0&&(p.version=f.version),p},fromPartial(f){const p=I();return p.version=f.version??"",p}};function g(){return{portId:"",channelId:"",counterpartyChannelId:"",counterpartyVersion:"",proofTry:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelOpenAck={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenAck",encode(f,p=r.BinaryWriter.create()){return f.portId!==""&&p.uint32(10).string(f.portId),f.channelId!==""&&p.uint32(18).string(f.channelId),f.counterpartyChannelId!==""&&p.uint32(26).string(f.counterpartyChannelId),f.counterpartyVersion!==""&&p.uint32(34).string(f.counterpartyVersion),f.proofTry.length!==0&&p.uint32(42).bytes(f.proofTry),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(50).fork()).ldelim(),f.signer!==""&&p.uint32(58).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=g();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.portId=A.string();break;case 2:M.channelId=A.string();break;case 3:M.counterpartyChannelId=A.string();break;case 4:M.counterpartyVersion=A.string();break;case 5:M.proofTry=A.bytes();break;case 6:M.proofHeight=t.Height.decode(A,A.uint32());break;case 7:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=g();return(0,o.isSet)(f.portId)&&(p.portId=String(f.portId)),(0,o.isSet)(f.channelId)&&(p.channelId=String(f.channelId)),(0,o.isSet)(f.counterpartyChannelId)&&(p.counterpartyChannelId=String(f.counterpartyChannelId)),(0,o.isSet)(f.counterpartyVersion)&&(p.counterpartyVersion=String(f.counterpartyVersion)),(0,o.isSet)(f.proofTry)&&(p.proofTry=(0,o.bytesFromBase64)(f.proofTry)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.portId!==void 0&&(p.portId=f.portId),f.channelId!==void 0&&(p.channelId=f.channelId),f.counterpartyChannelId!==void 0&&(p.counterpartyChannelId=f.counterpartyChannelId),f.counterpartyVersion!==void 0&&(p.counterpartyVersion=f.counterpartyVersion),f.proofTry!==void 0&&(p.proofTry=(0,o.base64FromBytes)(f.proofTry!==void 0?f.proofTry:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=g();return p.portId=f.portId??"",p.channelId=f.channelId??"",p.counterpartyChannelId=f.counterpartyChannelId??"",p.counterpartyVersion=f.counterpartyVersion??"",p.proofTry=f.proofTry??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),p.signer=f.signer??"",p}};function R(){return{}}e.MsgChannelOpenAckResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenAckResponse",encode(f,p=r.BinaryWriter.create()){return p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=R();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){default:A.skipType(a&7);break}}return M},fromJSON(f){return R()},toJSON(f){return{}},fromPartial(f){return R()}};function B(){return{portId:"",channelId:"",proofAck:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelOpenConfirm={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenConfirm",encode(f,p=r.BinaryWriter.create()){return f.portId!==""&&p.uint32(10).string(f.portId),f.channelId!==""&&p.uint32(18).string(f.channelId),f.proofAck.length!==0&&p.uint32(26).bytes(f.proofAck),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(34).fork()).ldelim(),f.signer!==""&&p.uint32(42).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=B();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.portId=A.string();break;case 2:M.channelId=A.string();break;case 3:M.proofAck=A.bytes();break;case 4:M.proofHeight=t.Height.decode(A,A.uint32());break;case 5:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=B();return(0,o.isSet)(f.portId)&&(p.portId=String(f.portId)),(0,o.isSet)(f.channelId)&&(p.channelId=String(f.channelId)),(0,o.isSet)(f.proofAck)&&(p.proofAck=(0,o.bytesFromBase64)(f.proofAck)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.portId!==void 0&&(p.portId=f.portId),f.channelId!==void 0&&(p.channelId=f.channelId),f.proofAck!==void 0&&(p.proofAck=(0,o.base64FromBytes)(f.proofAck!==void 0?f.proofAck:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=B();return p.portId=f.portId??"",p.channelId=f.channelId??"",p.proofAck=f.proofAck??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),p.signer=f.signer??"",p}};function d(){return{}}e.MsgChannelOpenConfirmResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelOpenConfirmResponse",encode(f,p=r.BinaryWriter.create()){return p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=d();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){default:A.skipType(a&7);break}}return M},fromJSON(f){return d()},toJSON(f){return{}},fromPartial(f){return d()}};function s(){return{portId:"",channelId:"",signer:""}}e.MsgChannelCloseInit={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseInit",encode(f,p=r.BinaryWriter.create()){return f.portId!==""&&p.uint32(10).string(f.portId),f.channelId!==""&&p.uint32(18).string(f.channelId),f.signer!==""&&p.uint32(26).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=s();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.portId=A.string();break;case 2:M.channelId=A.string();break;case 3:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=s();return(0,o.isSet)(f.portId)&&(p.portId=String(f.portId)),(0,o.isSet)(f.channelId)&&(p.channelId=String(f.channelId)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.portId!==void 0&&(p.portId=f.portId),f.channelId!==void 0&&(p.channelId=f.channelId),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=s();return p.portId=f.portId??"",p.channelId=f.channelId??"",p.signer=f.signer??"",p}};function y(){return{}}e.MsgChannelCloseInitResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseInitResponse",encode(f,p=r.BinaryWriter.create()){return p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=y();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){default:A.skipType(a&7);break}}return M},fromJSON(f){return y()},toJSON(f){return{}},fromPartial(f){return y()}};function E(){return{portId:"",channelId:"",proofInit:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgChannelCloseConfirm={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseConfirm",encode(f,p=r.BinaryWriter.create()){return f.portId!==""&&p.uint32(10).string(f.portId),f.channelId!==""&&p.uint32(18).string(f.channelId),f.proofInit.length!==0&&p.uint32(26).bytes(f.proofInit),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(34).fork()).ldelim(),f.signer!==""&&p.uint32(42).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=E();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.portId=A.string();break;case 2:M.channelId=A.string();break;case 3:M.proofInit=A.bytes();break;case 4:M.proofHeight=t.Height.decode(A,A.uint32());break;case 5:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=E();return(0,o.isSet)(f.portId)&&(p.portId=String(f.portId)),(0,o.isSet)(f.channelId)&&(p.channelId=String(f.channelId)),(0,o.isSet)(f.proofInit)&&(p.proofInit=(0,o.bytesFromBase64)(f.proofInit)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.portId!==void 0&&(p.portId=f.portId),f.channelId!==void 0&&(p.channelId=f.channelId),f.proofInit!==void 0&&(p.proofInit=(0,o.base64FromBytes)(f.proofInit!==void 0?f.proofInit:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=E();return p.portId=f.portId??"",p.channelId=f.channelId??"",p.proofInit=f.proofInit??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),p.signer=f.signer??"",p}};function _(){return{}}e.MsgChannelCloseConfirmResponse={typeUrl:"/ibc.core.channel.v1.MsgChannelCloseConfirmResponse",encode(f,p=r.BinaryWriter.create()){return p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=_();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){default:A.skipType(a&7);break}}return M},fromJSON(f){return _()},toJSON(f){return{}},fromPartial(f){return _()}};function U(){return{packet:n.Packet.fromPartial({}),proofCommitment:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgRecvPacket={typeUrl:"/ibc.core.channel.v1.MsgRecvPacket",encode(f,p=r.BinaryWriter.create()){return f.packet!==void 0&&n.Packet.encode(f.packet,p.uint32(10).fork()).ldelim(),f.proofCommitment.length!==0&&p.uint32(18).bytes(f.proofCommitment),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(26).fork()).ldelim(),f.signer!==""&&p.uint32(34).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=U();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.packet=n.Packet.decode(A,A.uint32());break;case 2:M.proofCommitment=A.bytes();break;case 3:M.proofHeight=t.Height.decode(A,A.uint32());break;case 4:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=U();return(0,o.isSet)(f.packet)&&(p.packet=n.Packet.fromJSON(f.packet)),(0,o.isSet)(f.proofCommitment)&&(p.proofCommitment=(0,o.bytesFromBase64)(f.proofCommitment)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.packet!==void 0&&(p.packet=f.packet?n.Packet.toJSON(f.packet):void 0),f.proofCommitment!==void 0&&(p.proofCommitment=(0,o.base64FromBytes)(f.proofCommitment!==void 0?f.proofCommitment:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=U();return f.packet!==void 0&&f.packet!==null&&(p.packet=n.Packet.fromPartial(f.packet)),p.proofCommitment=f.proofCommitment??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),p.signer=f.signer??"",p}};function H(){return{result:0}}e.MsgRecvPacketResponse={typeUrl:"/ibc.core.channel.v1.MsgRecvPacketResponse",encode(f,p=r.BinaryWriter.create()){return f.result!==0&&p.uint32(8).int32(f.result),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=H();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.result=A.int32();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=H();return(0,o.isSet)(f.result)&&(p.result=v(f.result)),p},toJSON(f){const p={};return f.result!==void 0&&(p.result=C(f.result)),p},fromPartial(f){const p=H();return p.result=f.result??0,p}};function i(){return{packet:n.Packet.fromPartial({}),proofUnreceived:new Uint8Array,proofHeight:t.Height.fromPartial({}),nextSequenceRecv:BigInt(0),signer:""}}e.MsgTimeout={typeUrl:"/ibc.core.channel.v1.MsgTimeout",encode(f,p=r.BinaryWriter.create()){return f.packet!==void 0&&n.Packet.encode(f.packet,p.uint32(10).fork()).ldelim(),f.proofUnreceived.length!==0&&p.uint32(18).bytes(f.proofUnreceived),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(26).fork()).ldelim(),f.nextSequenceRecv!==BigInt(0)&&p.uint32(32).uint64(f.nextSequenceRecv),f.signer!==""&&p.uint32(42).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=i();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.packet=n.Packet.decode(A,A.uint32());break;case 2:M.proofUnreceived=A.bytes();break;case 3:M.proofHeight=t.Height.decode(A,A.uint32());break;case 4:M.nextSequenceRecv=A.uint64();break;case 5:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=i();return(0,o.isSet)(f.packet)&&(p.packet=n.Packet.fromJSON(f.packet)),(0,o.isSet)(f.proofUnreceived)&&(p.proofUnreceived=(0,o.bytesFromBase64)(f.proofUnreceived)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.nextSequenceRecv)&&(p.nextSequenceRecv=BigInt(f.nextSequenceRecv.toString())),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.packet!==void 0&&(p.packet=f.packet?n.Packet.toJSON(f.packet):void 0),f.proofUnreceived!==void 0&&(p.proofUnreceived=(0,o.base64FromBytes)(f.proofUnreceived!==void 0?f.proofUnreceived:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.nextSequenceRecv!==void 0&&(p.nextSequenceRecv=(f.nextSequenceRecv||BigInt(0)).toString()),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=i();return f.packet!==void 0&&f.packet!==null&&(p.packet=n.Packet.fromPartial(f.packet)),p.proofUnreceived=f.proofUnreceived??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),f.nextSequenceRecv!==void 0&&f.nextSequenceRecv!==null&&(p.nextSequenceRecv=BigInt(f.nextSequenceRecv.toString())),p.signer=f.signer??"",p}};function m(){return{result:0}}e.MsgTimeoutResponse={typeUrl:"/ibc.core.channel.v1.MsgTimeoutResponse",encode(f,p=r.BinaryWriter.create()){return f.result!==0&&p.uint32(8).int32(f.result),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=m();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.result=A.int32();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=m();return(0,o.isSet)(f.result)&&(p.result=v(f.result)),p},toJSON(f){const p={};return f.result!==void 0&&(p.result=C(f.result)),p},fromPartial(f){const p=m();return p.result=f.result??0,p}};function N(){return{packet:n.Packet.fromPartial({}),proofUnreceived:new Uint8Array,proofClose:new Uint8Array,proofHeight:t.Height.fromPartial({}),nextSequenceRecv:BigInt(0),signer:""}}e.MsgTimeoutOnClose={typeUrl:"/ibc.core.channel.v1.MsgTimeoutOnClose",encode(f,p=r.BinaryWriter.create()){return f.packet!==void 0&&n.Packet.encode(f.packet,p.uint32(10).fork()).ldelim(),f.proofUnreceived.length!==0&&p.uint32(18).bytes(f.proofUnreceived),f.proofClose.length!==0&&p.uint32(26).bytes(f.proofClose),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(34).fork()).ldelim(),f.nextSequenceRecv!==BigInt(0)&&p.uint32(40).uint64(f.nextSequenceRecv),f.signer!==""&&p.uint32(50).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=N();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.packet=n.Packet.decode(A,A.uint32());break;case 2:M.proofUnreceived=A.bytes();break;case 3:M.proofClose=A.bytes();break;case 4:M.proofHeight=t.Height.decode(A,A.uint32());break;case 5:M.nextSequenceRecv=A.uint64();break;case 6:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=N();return(0,o.isSet)(f.packet)&&(p.packet=n.Packet.fromJSON(f.packet)),(0,o.isSet)(f.proofUnreceived)&&(p.proofUnreceived=(0,o.bytesFromBase64)(f.proofUnreceived)),(0,o.isSet)(f.proofClose)&&(p.proofClose=(0,o.bytesFromBase64)(f.proofClose)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.nextSequenceRecv)&&(p.nextSequenceRecv=BigInt(f.nextSequenceRecv.toString())),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.packet!==void 0&&(p.packet=f.packet?n.Packet.toJSON(f.packet):void 0),f.proofUnreceived!==void 0&&(p.proofUnreceived=(0,o.base64FromBytes)(f.proofUnreceived!==void 0?f.proofUnreceived:new Uint8Array)),f.proofClose!==void 0&&(p.proofClose=(0,o.base64FromBytes)(f.proofClose!==void 0?f.proofClose:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.nextSequenceRecv!==void 0&&(p.nextSequenceRecv=(f.nextSequenceRecv||BigInt(0)).toString()),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=N();return f.packet!==void 0&&f.packet!==null&&(p.packet=n.Packet.fromPartial(f.packet)),p.proofUnreceived=f.proofUnreceived??new Uint8Array,p.proofClose=f.proofClose??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),f.nextSequenceRecv!==void 0&&f.nextSequenceRecv!==null&&(p.nextSequenceRecv=BigInt(f.nextSequenceRecv.toString())),p.signer=f.signer??"",p}};function V(){return{result:0}}e.MsgTimeoutOnCloseResponse={typeUrl:"/ibc.core.channel.v1.MsgTimeoutOnCloseResponse",encode(f,p=r.BinaryWriter.create()){return f.result!==0&&p.uint32(8).int32(f.result),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=V();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.result=A.int32();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=V();return(0,o.isSet)(f.result)&&(p.result=v(f.result)),p},toJSON(f){const p={};return f.result!==void 0&&(p.result=C(f.result)),p},fromPartial(f){const p=V();return p.result=f.result??0,p}};function u(){return{packet:n.Packet.fromPartial({}),acknowledgement:new Uint8Array,proofAcked:new Uint8Array,proofHeight:t.Height.fromPartial({}),signer:""}}e.MsgAcknowledgement={typeUrl:"/ibc.core.channel.v1.MsgAcknowledgement",encode(f,p=r.BinaryWriter.create()){return f.packet!==void 0&&n.Packet.encode(f.packet,p.uint32(10).fork()).ldelim(),f.acknowledgement.length!==0&&p.uint32(18).bytes(f.acknowledgement),f.proofAcked.length!==0&&p.uint32(26).bytes(f.proofAcked),f.proofHeight!==void 0&&t.Height.encode(f.proofHeight,p.uint32(34).fork()).ldelim(),f.signer!==""&&p.uint32(42).string(f.signer),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=u();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.packet=n.Packet.decode(A,A.uint32());break;case 2:M.acknowledgement=A.bytes();break;case 3:M.proofAcked=A.bytes();break;case 4:M.proofHeight=t.Height.decode(A,A.uint32());break;case 5:M.signer=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=u();return(0,o.isSet)(f.packet)&&(p.packet=n.Packet.fromJSON(f.packet)),(0,o.isSet)(f.acknowledgement)&&(p.acknowledgement=(0,o.bytesFromBase64)(f.acknowledgement)),(0,o.isSet)(f.proofAcked)&&(p.proofAcked=(0,o.bytesFromBase64)(f.proofAcked)),(0,o.isSet)(f.proofHeight)&&(p.proofHeight=t.Height.fromJSON(f.proofHeight)),(0,o.isSet)(f.signer)&&(p.signer=String(f.signer)),p},toJSON(f){const p={};return f.packet!==void 0&&(p.packet=f.packet?n.Packet.toJSON(f.packet):void 0),f.acknowledgement!==void 0&&(p.acknowledgement=(0,o.base64FromBytes)(f.acknowledgement!==void 0?f.acknowledgement:new Uint8Array)),f.proofAcked!==void 0&&(p.proofAcked=(0,o.base64FromBytes)(f.proofAcked!==void 0?f.proofAcked:new Uint8Array)),f.proofHeight!==void 0&&(p.proofHeight=f.proofHeight?t.Height.toJSON(f.proofHeight):void 0),f.signer!==void 0&&(p.signer=f.signer),p},fromPartial(f){const p=u();return f.packet!==void 0&&f.packet!==null&&(p.packet=n.Packet.fromPartial(f.packet)),p.acknowledgement=f.acknowledgement??new Uint8Array,p.proofAcked=f.proofAcked??new Uint8Array,f.proofHeight!==void 0&&f.proofHeight!==null&&(p.proofHeight=t.Height.fromPartial(f.proofHeight)),p.signer=f.signer??"",p}};function l(){return{result:0}}e.MsgAcknowledgementResponse={typeUrl:"/ibc.core.channel.v1.MsgAcknowledgementResponse",encode(f,p=r.BinaryWriter.create()){return f.result!==0&&p.uint32(8).int32(f.result),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=l();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.result=A.int32();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=l();return(0,o.isSet)(f.result)&&(p.result=v(f.result)),p},toJSON(f){const p={};return f.result!==void 0&&(p.result=C(f.result)),p},fromPartial(f){const p=l();return p.result=f.result??0,p}};class T{constructor(p){this.rpc=p,this.ChannelOpenInit=this.ChannelOpenInit.bind(this),this.ChannelOpenTry=this.ChannelOpenTry.bind(this),this.ChannelOpenAck=this.ChannelOpenAck.bind(this),this.ChannelOpenConfirm=this.ChannelOpenConfirm.bind(this),this.ChannelCloseInit=this.ChannelCloseInit.bind(this),this.ChannelCloseConfirm=this.ChannelCloseConfirm.bind(this),this.RecvPacket=this.RecvPacket.bind(this),this.Timeout=this.Timeout.bind(this),this.TimeoutOnClose=this.TimeoutOnClose.bind(this),this.Acknowledgement=this.Acknowledgement.bind(this)}ChannelOpenInit(p){const A=e.MsgChannelOpenInit.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenInit",A).then(M=>e.MsgChannelOpenInitResponse.decode(new r.BinaryReader(M)))}ChannelOpenTry(p){const A=e.MsgChannelOpenTry.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenTry",A).then(M=>e.MsgChannelOpenTryResponse.decode(new r.BinaryReader(M)))}ChannelOpenAck(p){const A=e.MsgChannelOpenAck.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenAck",A).then(M=>e.MsgChannelOpenAckResponse.decode(new r.BinaryReader(M)))}ChannelOpenConfirm(p){const A=e.MsgChannelOpenConfirm.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelOpenConfirm",A).then(M=>e.MsgChannelOpenConfirmResponse.decode(new r.BinaryReader(M)))}ChannelCloseInit(p){const A=e.MsgChannelCloseInit.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelCloseInit",A).then(M=>e.MsgChannelCloseInitResponse.decode(new r.BinaryReader(M)))}ChannelCloseConfirm(p){const A=e.MsgChannelCloseConfirm.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","ChannelCloseConfirm",A).then(M=>e.MsgChannelCloseConfirmResponse.decode(new r.BinaryReader(M)))}RecvPacket(p){const A=e.MsgRecvPacket.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","RecvPacket",A).then(M=>e.MsgRecvPacketResponse.decode(new r.BinaryReader(M)))}Timeout(p){const A=e.MsgTimeout.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","Timeout",A).then(M=>e.MsgTimeoutResponse.decode(new r.BinaryReader(M)))}TimeoutOnClose(p){const A=e.MsgTimeoutOnClose.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","TimeoutOnClose",A).then(M=>e.MsgTimeoutOnCloseResponse.decode(new r.BinaryReader(M)))}Acknowledgement(p){const A=e.MsgAcknowledgement.encode(p).finish();return this.rpc.request("ibc.core.channel.v1.Msg","Acknowledgement",A).then(M=>e.MsgAcknowledgementResponse.decode(new r.BinaryReader(M)))}}e.MsgClientImpl=T})(Tm);var Cm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgSubmitMisbehaviourResponse=e.MsgSubmitMisbehaviour=e.MsgUpgradeClientResponse=e.MsgUpgradeClient=e.MsgUpdateClientResponse=e.MsgUpdateClient=e.MsgCreateClientResponse=e.MsgCreateClient=e.protobufPackage=void 0;const n=Re,t=ee,r=ne;e.protobufPackage="ibc.core.client.v1";function o(){return{clientState:void 0,consensusState:void 0,signer:""}}e.MsgCreateClient={typeUrl:"/ibc.core.client.v1.MsgCreateClient",encode(R,B=t.BinaryWriter.create()){return R.clientState!==void 0&&n.Any.encode(R.clientState,B.uint32(10).fork()).ldelim(),R.consensusState!==void 0&&n.Any.encode(R.consensusState,B.uint32(18).fork()).ldelim(),R.signer!==""&&B.uint32(26).string(R.signer),B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=o();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){case 1:y.clientState=n.Any.decode(d,d.uint32());break;case 2:y.consensusState=n.Any.decode(d,d.uint32());break;case 3:y.signer=d.string();break;default:d.skipType(E&7);break}}return y},fromJSON(R){const B=o();return(0,r.isSet)(R.clientState)&&(B.clientState=n.Any.fromJSON(R.clientState)),(0,r.isSet)(R.consensusState)&&(B.consensusState=n.Any.fromJSON(R.consensusState)),(0,r.isSet)(R.signer)&&(B.signer=String(R.signer)),B},toJSON(R){const B={};return R.clientState!==void 0&&(B.clientState=R.clientState?n.Any.toJSON(R.clientState):void 0),R.consensusState!==void 0&&(B.consensusState=R.consensusState?n.Any.toJSON(R.consensusState):void 0),R.signer!==void 0&&(B.signer=R.signer),B},fromPartial(R){const B=o();return R.clientState!==void 0&&R.clientState!==null&&(B.clientState=n.Any.fromPartial(R.clientState)),R.consensusState!==void 0&&R.consensusState!==null&&(B.consensusState=n.Any.fromPartial(R.consensusState)),B.signer=R.signer??"",B}};function h(){return{}}e.MsgCreateClientResponse={typeUrl:"/ibc.core.client.v1.MsgCreateClientResponse",encode(R,B=t.BinaryWriter.create()){return B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=h();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){default:d.skipType(E&7);break}}return y},fromJSON(R){return h()},toJSON(R){return{}},fromPartial(R){return h()}};function v(){return{clientId:"",clientMessage:void 0,signer:""}}e.MsgUpdateClient={typeUrl:"/ibc.core.client.v1.MsgUpdateClient",encode(R,B=t.BinaryWriter.create()){return R.clientId!==""&&B.uint32(10).string(R.clientId),R.clientMessage!==void 0&&n.Any.encode(R.clientMessage,B.uint32(18).fork()).ldelim(),R.signer!==""&&B.uint32(26).string(R.signer),B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=v();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){case 1:y.clientId=d.string();break;case 2:y.clientMessage=n.Any.decode(d,d.uint32());break;case 3:y.signer=d.string();break;default:d.skipType(E&7);break}}return y},fromJSON(R){const B=v();return(0,r.isSet)(R.clientId)&&(B.clientId=String(R.clientId)),(0,r.isSet)(R.clientMessage)&&(B.clientMessage=n.Any.fromJSON(R.clientMessage)),(0,r.isSet)(R.signer)&&(B.signer=String(R.signer)),B},toJSON(R){const B={};return R.clientId!==void 0&&(B.clientId=R.clientId),R.clientMessage!==void 0&&(B.clientMessage=R.clientMessage?n.Any.toJSON(R.clientMessage):void 0),R.signer!==void 0&&(B.signer=R.signer),B},fromPartial(R){const B=v();return B.clientId=R.clientId??"",R.clientMessage!==void 0&&R.clientMessage!==null&&(B.clientMessage=n.Any.fromPartial(R.clientMessage)),B.signer=R.signer??"",B}};function C(){return{}}e.MsgUpdateClientResponse={typeUrl:"/ibc.core.client.v1.MsgUpdateClientResponse",encode(R,B=t.BinaryWriter.create()){return B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=C();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){default:d.skipType(E&7);break}}return y},fromJSON(R){return C()},toJSON(R){return{}},fromPartial(R){return C()}};function w(){return{clientId:"",clientState:void 0,consensusState:void 0,proofUpgradeClient:new Uint8Array,proofUpgradeConsensusState:new Uint8Array,signer:""}}e.MsgUpgradeClient={typeUrl:"/ibc.core.client.v1.MsgUpgradeClient",encode(R,B=t.BinaryWriter.create()){return R.clientId!==""&&B.uint32(10).string(R.clientId),R.clientState!==void 0&&n.Any.encode(R.clientState,B.uint32(18).fork()).ldelim(),R.consensusState!==void 0&&n.Any.encode(R.consensusState,B.uint32(26).fork()).ldelim(),R.proofUpgradeClient.length!==0&&B.uint32(34).bytes(R.proofUpgradeClient),R.proofUpgradeConsensusState.length!==0&&B.uint32(42).bytes(R.proofUpgradeConsensusState),R.signer!==""&&B.uint32(50).string(R.signer),B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=w();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){case 1:y.clientId=d.string();break;case 2:y.clientState=n.Any.decode(d,d.uint32());break;case 3:y.consensusState=n.Any.decode(d,d.uint32());break;case 4:y.proofUpgradeClient=d.bytes();break;case 5:y.proofUpgradeConsensusState=d.bytes();break;case 6:y.signer=d.string();break;default:d.skipType(E&7);break}}return y},fromJSON(R){const B=w();return(0,r.isSet)(R.clientId)&&(B.clientId=String(R.clientId)),(0,r.isSet)(R.clientState)&&(B.clientState=n.Any.fromJSON(R.clientState)),(0,r.isSet)(R.consensusState)&&(B.consensusState=n.Any.fromJSON(R.consensusState)),(0,r.isSet)(R.proofUpgradeClient)&&(B.proofUpgradeClient=(0,r.bytesFromBase64)(R.proofUpgradeClient)),(0,r.isSet)(R.proofUpgradeConsensusState)&&(B.proofUpgradeConsensusState=(0,r.bytesFromBase64)(R.proofUpgradeConsensusState)),(0,r.isSet)(R.signer)&&(B.signer=String(R.signer)),B},toJSON(R){const B={};return R.clientId!==void 0&&(B.clientId=R.clientId),R.clientState!==void 0&&(B.clientState=R.clientState?n.Any.toJSON(R.clientState):void 0),R.consensusState!==void 0&&(B.consensusState=R.consensusState?n.Any.toJSON(R.consensusState):void 0),R.proofUpgradeClient!==void 0&&(B.proofUpgradeClient=(0,r.base64FromBytes)(R.proofUpgradeClient!==void 0?R.proofUpgradeClient:new Uint8Array)),R.proofUpgradeConsensusState!==void 0&&(B.proofUpgradeConsensusState=(0,r.base64FromBytes)(R.proofUpgradeConsensusState!==void 0?R.proofUpgradeConsensusState:new Uint8Array)),R.signer!==void 0&&(B.signer=R.signer),B},fromPartial(R){const B=w();return B.clientId=R.clientId??"",R.clientState!==void 0&&R.clientState!==null&&(B.clientState=n.Any.fromPartial(R.clientState)),R.consensusState!==void 0&&R.consensusState!==null&&(B.consensusState=n.Any.fromPartial(R.consensusState)),B.proofUpgradeClient=R.proofUpgradeClient??new Uint8Array,B.proofUpgradeConsensusState=R.proofUpgradeConsensusState??new Uint8Array,B.signer=R.signer??"",B}};function D(){return{}}e.MsgUpgradeClientResponse={typeUrl:"/ibc.core.client.v1.MsgUpgradeClientResponse",encode(R,B=t.BinaryWriter.create()){return B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=D();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){default:d.skipType(E&7);break}}return y},fromJSON(R){return D()},toJSON(R){return{}},fromPartial(R){return D()}};function J(){return{clientId:"",misbehaviour:void 0,signer:""}}e.MsgSubmitMisbehaviour={typeUrl:"/ibc.core.client.v1.MsgSubmitMisbehaviour",encode(R,B=t.BinaryWriter.create()){return R.clientId!==""&&B.uint32(10).string(R.clientId),R.misbehaviour!==void 0&&n.Any.encode(R.misbehaviour,B.uint32(18).fork()).ldelim(),R.signer!==""&&B.uint32(26).string(R.signer),B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=J();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){case 1:y.clientId=d.string();break;case 2:y.misbehaviour=n.Any.decode(d,d.uint32());break;case 3:y.signer=d.string();break;default:d.skipType(E&7);break}}return y},fromJSON(R){const B=J();return(0,r.isSet)(R.clientId)&&(B.clientId=String(R.clientId)),(0,r.isSet)(R.misbehaviour)&&(B.misbehaviour=n.Any.fromJSON(R.misbehaviour)),(0,r.isSet)(R.signer)&&(B.signer=String(R.signer)),B},toJSON(R){const B={};return R.clientId!==void 0&&(B.clientId=R.clientId),R.misbehaviour!==void 0&&(B.misbehaviour=R.misbehaviour?n.Any.toJSON(R.misbehaviour):void 0),R.signer!==void 0&&(B.signer=R.signer),B},fromPartial(R){const B=J();return B.clientId=R.clientId??"",R.misbehaviour!==void 0&&R.misbehaviour!==null&&(B.misbehaviour=n.Any.fromPartial(R.misbehaviour)),B.signer=R.signer??"",B}};function I(){return{}}e.MsgSubmitMisbehaviourResponse={typeUrl:"/ibc.core.client.v1.MsgSubmitMisbehaviourResponse",encode(R,B=t.BinaryWriter.create()){return B},decode(R,B){const d=R instanceof t.BinaryReader?R:new t.BinaryReader(R);let s=B===void 0?d.len:d.pos+B;const y=I();for(;d.pos<s;){const E=d.uint32();switch(E>>>3){default:d.skipType(E&7);break}}return y},fromJSON(R){return I()},toJSON(R){return{}},fromPartial(R){return I()}};class g{constructor(B){this.rpc=B,this.CreateClient=this.CreateClient.bind(this),this.UpdateClient=this.UpdateClient.bind(this),this.UpgradeClient=this.UpgradeClient.bind(this),this.SubmitMisbehaviour=this.SubmitMisbehaviour.bind(this)}CreateClient(B){const d=e.MsgCreateClient.encode(B).finish();return this.rpc.request("ibc.core.client.v1.Msg","CreateClient",d).then(y=>e.MsgCreateClientResponse.decode(new t.BinaryReader(y)))}UpdateClient(B){const d=e.MsgUpdateClient.encode(B).finish();return this.rpc.request("ibc.core.client.v1.Msg","UpdateClient",d).then(y=>e.MsgUpdateClientResponse.decode(new t.BinaryReader(y)))}UpgradeClient(B){const d=e.MsgUpgradeClient.encode(B).finish();return this.rpc.request("ibc.core.client.v1.Msg","UpgradeClient",d).then(y=>e.MsgUpgradeClientResponse.decode(new t.BinaryReader(y)))}SubmitMisbehaviour(B){const d=e.MsgSubmitMisbehaviour.encode(B).finish();return this.rpc.request("ibc.core.client.v1.Msg","SubmitMisbehaviour",d).then(y=>e.MsgSubmitMisbehaviourResponse.decode(new t.BinaryReader(y)))}}e.MsgClientImpl=g})(Cm);var Nm={},Ec={},pn={},_c={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CompressedNonExistenceProof=e.CompressedExistenceProof=e.CompressedBatchEntry=e.CompressedBatchProof=e.BatchEntry=e.BatchProof=e.InnerSpec=e.ProofSpec=e.InnerOp=e.LeafOp=e.CommitmentProof=e.NonExistenceProof=e.ExistenceProof=e.lengthOpToJSON=e.lengthOpFromJSON=e.LengthOp=e.hashOpToJSON=e.hashOpFromJSON=e.HashOp=e.protobufPackage=void 0;const n=ee,t=ne;e.protobufPackage="cosmos.ics23.v1";var r;(function(i){i[i.NO_HASH=0]="NO_HASH",i[i.SHA256=1]="SHA256",i[i.SHA512=2]="SHA512",i[i.KECCAK=3]="KECCAK",i[i.RIPEMD160=4]="RIPEMD160",i[i.BITCOIN=5]="BITCOIN",i[i.SHA512_256=6]="SHA512_256",i[i.UNRECOGNIZED=-1]="UNRECOGNIZED"})(r||(e.HashOp=r={}));function o(i){switch(i){case 0:case"NO_HASH":return r.NO_HASH;case 1:case"SHA256":return r.SHA256;case 2:case"SHA512":return r.SHA512;case 3:case"KECCAK":return r.KECCAK;case 4:case"RIPEMD160":return r.RIPEMD160;case 5:case"BITCOIN":return r.BITCOIN;case 6:case"SHA512_256":return r.SHA512_256;case-1:case"UNRECOGNIZED":default:return r.UNRECOGNIZED}}e.hashOpFromJSON=o;function h(i){switch(i){case r.NO_HASH:return"NO_HASH";case r.SHA256:return"SHA256";case r.SHA512:return"SHA512";case r.KECCAK:return"KECCAK";case r.RIPEMD160:return"RIPEMD160";case r.BITCOIN:return"BITCOIN";case r.SHA512_256:return"SHA512_256";case r.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.hashOpToJSON=h;var v;(function(i){i[i.NO_PREFIX=0]="NO_PREFIX",i[i.VAR_PROTO=1]="VAR_PROTO",i[i.VAR_RLP=2]="VAR_RLP",i[i.FIXED32_BIG=3]="FIXED32_BIG",i[i.FIXED32_LITTLE=4]="FIXED32_LITTLE",i[i.FIXED64_BIG=5]="FIXED64_BIG",i[i.FIXED64_LITTLE=6]="FIXED64_LITTLE",i[i.REQUIRE_32_BYTES=7]="REQUIRE_32_BYTES",i[i.REQUIRE_64_BYTES=8]="REQUIRE_64_BYTES",i[i.UNRECOGNIZED=-1]="UNRECOGNIZED"})(v||(e.LengthOp=v={}));function C(i){switch(i){case 0:case"NO_PREFIX":return v.NO_PREFIX;case 1:case"VAR_PROTO":return v.VAR_PROTO;case 2:case"VAR_RLP":return v.VAR_RLP;case 3:case"FIXED32_BIG":return v.FIXED32_BIG;case 4:case"FIXED32_LITTLE":return v.FIXED32_LITTLE;case 5:case"FIXED64_BIG":return v.FIXED64_BIG;case 6:case"FIXED64_LITTLE":return v.FIXED64_LITTLE;case 7:case"REQUIRE_32_BYTES":return v.REQUIRE_32_BYTES;case 8:case"REQUIRE_64_BYTES":return v.REQUIRE_64_BYTES;case-1:case"UNRECOGNIZED":default:return v.UNRECOGNIZED}}e.lengthOpFromJSON=C;function w(i){switch(i){case v.NO_PREFIX:return"NO_PREFIX";case v.VAR_PROTO:return"VAR_PROTO";case v.VAR_RLP:return"VAR_RLP";case v.FIXED32_BIG:return"FIXED32_BIG";case v.FIXED32_LITTLE:return"FIXED32_LITTLE";case v.FIXED64_BIG:return"FIXED64_BIG";case v.FIXED64_LITTLE:return"FIXED64_LITTLE";case v.REQUIRE_32_BYTES:return"REQUIRE_32_BYTES";case v.REQUIRE_64_BYTES:return"REQUIRE_64_BYTES";case v.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.lengthOpToJSON=w;function D(){return{key:new Uint8Array,value:new Uint8Array,leaf:void 0,path:[]}}e.ExistenceProof={typeUrl:"/cosmos.ics23.v1.ExistenceProof",encode(i,m=n.BinaryWriter.create()){i.key.length!==0&&m.uint32(10).bytes(i.key),i.value.length!==0&&m.uint32(18).bytes(i.value),i.leaf!==void 0&&e.LeafOp.encode(i.leaf,m.uint32(26).fork()).ldelim();for(const N of i.path)e.InnerOp.encode(N,m.uint32(34).fork()).ldelim();return m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=D();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.key=N.bytes();break;case 2:u.value=N.bytes();break;case 3:u.leaf=e.LeafOp.decode(N,N.uint32());break;case 4:u.path.push(e.InnerOp.decode(N,N.uint32()));break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=D();return(0,t.isSet)(i.key)&&(m.key=(0,t.bytesFromBase64)(i.key)),(0,t.isSet)(i.value)&&(m.value=(0,t.bytesFromBase64)(i.value)),(0,t.isSet)(i.leaf)&&(m.leaf=e.LeafOp.fromJSON(i.leaf)),Array.isArray(i==null?void 0:i.path)&&(m.path=i.path.map(N=>e.InnerOp.fromJSON(N))),m},toJSON(i){const m={};return i.key!==void 0&&(m.key=(0,t.base64FromBytes)(i.key!==void 0?i.key:new Uint8Array)),i.value!==void 0&&(m.value=(0,t.base64FromBytes)(i.value!==void 0?i.value:new Uint8Array)),i.leaf!==void 0&&(m.leaf=i.leaf?e.LeafOp.toJSON(i.leaf):void 0),i.path?m.path=i.path.map(N=>N?e.InnerOp.toJSON(N):void 0):m.path=[],m},fromPartial(i){var N;const m=D();return m.key=i.key??new Uint8Array,m.value=i.value??new Uint8Array,i.leaf!==void 0&&i.leaf!==null&&(m.leaf=e.LeafOp.fromPartial(i.leaf)),m.path=((N=i.path)==null?void 0:N.map(V=>e.InnerOp.fromPartial(V)))||[],m}};function J(){return{key:new Uint8Array,left:void 0,right:void 0}}e.NonExistenceProof={typeUrl:"/cosmos.ics23.v1.NonExistenceProof",encode(i,m=n.BinaryWriter.create()){return i.key.length!==0&&m.uint32(10).bytes(i.key),i.left!==void 0&&e.ExistenceProof.encode(i.left,m.uint32(18).fork()).ldelim(),i.right!==void 0&&e.ExistenceProof.encode(i.right,m.uint32(26).fork()).ldelim(),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=J();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.key=N.bytes();break;case 2:u.left=e.ExistenceProof.decode(N,N.uint32());break;case 3:u.right=e.ExistenceProof.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=J();return(0,t.isSet)(i.key)&&(m.key=(0,t.bytesFromBase64)(i.key)),(0,t.isSet)(i.left)&&(m.left=e.ExistenceProof.fromJSON(i.left)),(0,t.isSet)(i.right)&&(m.right=e.ExistenceProof.fromJSON(i.right)),m},toJSON(i){const m={};return i.key!==void 0&&(m.key=(0,t.base64FromBytes)(i.key!==void 0?i.key:new Uint8Array)),i.left!==void 0&&(m.left=i.left?e.ExistenceProof.toJSON(i.left):void 0),i.right!==void 0&&(m.right=i.right?e.ExistenceProof.toJSON(i.right):void 0),m},fromPartial(i){const m=J();return m.key=i.key??new Uint8Array,i.left!==void 0&&i.left!==null&&(m.left=e.ExistenceProof.fromPartial(i.left)),i.right!==void 0&&i.right!==null&&(m.right=e.ExistenceProof.fromPartial(i.right)),m}};function I(){return{exist:void 0,nonexist:void 0,batch:void 0,compressed:void 0}}e.CommitmentProof={typeUrl:"/cosmos.ics23.v1.CommitmentProof",encode(i,m=n.BinaryWriter.create()){return i.exist!==void 0&&e.ExistenceProof.encode(i.exist,m.uint32(10).fork()).ldelim(),i.nonexist!==void 0&&e.NonExistenceProof.encode(i.nonexist,m.uint32(18).fork()).ldelim(),i.batch!==void 0&&e.BatchProof.encode(i.batch,m.uint32(26).fork()).ldelim(),i.compressed!==void 0&&e.CompressedBatchProof.encode(i.compressed,m.uint32(34).fork()).ldelim(),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=I();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.exist=e.ExistenceProof.decode(N,N.uint32());break;case 2:u.nonexist=e.NonExistenceProof.decode(N,N.uint32());break;case 3:u.batch=e.BatchProof.decode(N,N.uint32());break;case 4:u.compressed=e.CompressedBatchProof.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=I();return(0,t.isSet)(i.exist)&&(m.exist=e.ExistenceProof.fromJSON(i.exist)),(0,t.isSet)(i.nonexist)&&(m.nonexist=e.NonExistenceProof.fromJSON(i.nonexist)),(0,t.isSet)(i.batch)&&(m.batch=e.BatchProof.fromJSON(i.batch)),(0,t.isSet)(i.compressed)&&(m.compressed=e.CompressedBatchProof.fromJSON(i.compressed)),m},toJSON(i){const m={};return i.exist!==void 0&&(m.exist=i.exist?e.ExistenceProof.toJSON(i.exist):void 0),i.nonexist!==void 0&&(m.nonexist=i.nonexist?e.NonExistenceProof.toJSON(i.nonexist):void 0),i.batch!==void 0&&(m.batch=i.batch?e.BatchProof.toJSON(i.batch):void 0),i.compressed!==void 0&&(m.compressed=i.compressed?e.CompressedBatchProof.toJSON(i.compressed):void 0),m},fromPartial(i){const m=I();return i.exist!==void 0&&i.exist!==null&&(m.exist=e.ExistenceProof.fromPartial(i.exist)),i.nonexist!==void 0&&i.nonexist!==null&&(m.nonexist=e.NonExistenceProof.fromPartial(i.nonexist)),i.batch!==void 0&&i.batch!==null&&(m.batch=e.BatchProof.fromPartial(i.batch)),i.compressed!==void 0&&i.compressed!==null&&(m.compressed=e.CompressedBatchProof.fromPartial(i.compressed)),m}};function g(){return{hash:0,prehashKey:0,prehashValue:0,length:0,prefix:new Uint8Array}}e.LeafOp={typeUrl:"/cosmos.ics23.v1.LeafOp",encode(i,m=n.BinaryWriter.create()){return i.hash!==0&&m.uint32(8).int32(i.hash),i.prehashKey!==0&&m.uint32(16).int32(i.prehashKey),i.prehashValue!==0&&m.uint32(24).int32(i.prehashValue),i.length!==0&&m.uint32(32).int32(i.length),i.prefix.length!==0&&m.uint32(42).bytes(i.prefix),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=g();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.hash=N.int32();break;case 2:u.prehashKey=N.int32();break;case 3:u.prehashValue=N.int32();break;case 4:u.length=N.int32();break;case 5:u.prefix=N.bytes();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=g();return(0,t.isSet)(i.hash)&&(m.hash=o(i.hash)),(0,t.isSet)(i.prehashKey)&&(m.prehashKey=o(i.prehashKey)),(0,t.isSet)(i.prehashValue)&&(m.prehashValue=o(i.prehashValue)),(0,t.isSet)(i.length)&&(m.length=C(i.length)),(0,t.isSet)(i.prefix)&&(m.prefix=(0,t.bytesFromBase64)(i.prefix)),m},toJSON(i){const m={};return i.hash!==void 0&&(m.hash=h(i.hash)),i.prehashKey!==void 0&&(m.prehashKey=h(i.prehashKey)),i.prehashValue!==void 0&&(m.prehashValue=h(i.prehashValue)),i.length!==void 0&&(m.length=w(i.length)),i.prefix!==void 0&&(m.prefix=(0,t.base64FromBytes)(i.prefix!==void 0?i.prefix:new Uint8Array)),m},fromPartial(i){const m=g();return m.hash=i.hash??0,m.prehashKey=i.prehashKey??0,m.prehashValue=i.prehashValue??0,m.length=i.length??0,m.prefix=i.prefix??new Uint8Array,m}};function R(){return{hash:0,prefix:new Uint8Array,suffix:new Uint8Array}}e.InnerOp={typeUrl:"/cosmos.ics23.v1.InnerOp",encode(i,m=n.BinaryWriter.create()){return i.hash!==0&&m.uint32(8).int32(i.hash),i.prefix.length!==0&&m.uint32(18).bytes(i.prefix),i.suffix.length!==0&&m.uint32(26).bytes(i.suffix),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=R();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.hash=N.int32();break;case 2:u.prefix=N.bytes();break;case 3:u.suffix=N.bytes();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=R();return(0,t.isSet)(i.hash)&&(m.hash=o(i.hash)),(0,t.isSet)(i.prefix)&&(m.prefix=(0,t.bytesFromBase64)(i.prefix)),(0,t.isSet)(i.suffix)&&(m.suffix=(0,t.bytesFromBase64)(i.suffix)),m},toJSON(i){const m={};return i.hash!==void 0&&(m.hash=h(i.hash)),i.prefix!==void 0&&(m.prefix=(0,t.base64FromBytes)(i.prefix!==void 0?i.prefix:new Uint8Array)),i.suffix!==void 0&&(m.suffix=(0,t.base64FromBytes)(i.suffix!==void 0?i.suffix:new Uint8Array)),m},fromPartial(i){const m=R();return m.hash=i.hash??0,m.prefix=i.prefix??new Uint8Array,m.suffix=i.suffix??new Uint8Array,m}};function B(){return{leafSpec:void 0,innerSpec:void 0,maxDepth:0,minDepth:0}}e.ProofSpec={typeUrl:"/cosmos.ics23.v1.ProofSpec",encode(i,m=n.BinaryWriter.create()){return i.leafSpec!==void 0&&e.LeafOp.encode(i.leafSpec,m.uint32(10).fork()).ldelim(),i.innerSpec!==void 0&&e.InnerSpec.encode(i.innerSpec,m.uint32(18).fork()).ldelim(),i.maxDepth!==0&&m.uint32(24).int32(i.maxDepth),i.minDepth!==0&&m.uint32(32).int32(i.minDepth),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=B();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.leafSpec=e.LeafOp.decode(N,N.uint32());break;case 2:u.innerSpec=e.InnerSpec.decode(N,N.uint32());break;case 3:u.maxDepth=N.int32();break;case 4:u.minDepth=N.int32();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=B();return(0,t.isSet)(i.leafSpec)&&(m.leafSpec=e.LeafOp.fromJSON(i.leafSpec)),(0,t.isSet)(i.innerSpec)&&(m.innerSpec=e.InnerSpec.fromJSON(i.innerSpec)),(0,t.isSet)(i.maxDepth)&&(m.maxDepth=Number(i.maxDepth)),(0,t.isSet)(i.minDepth)&&(m.minDepth=Number(i.minDepth)),m},toJSON(i){const m={};return i.leafSpec!==void 0&&(m.leafSpec=i.leafSpec?e.LeafOp.toJSON(i.leafSpec):void 0),i.innerSpec!==void 0&&(m.innerSpec=i.innerSpec?e.InnerSpec.toJSON(i.innerSpec):void 0),i.maxDepth!==void 0&&(m.maxDepth=Math.round(i.maxDepth)),i.minDepth!==void 0&&(m.minDepth=Math.round(i.minDepth)),m},fromPartial(i){const m=B();return i.leafSpec!==void 0&&i.leafSpec!==null&&(m.leafSpec=e.LeafOp.fromPartial(i.leafSpec)),i.innerSpec!==void 0&&i.innerSpec!==null&&(m.innerSpec=e.InnerSpec.fromPartial(i.innerSpec)),m.maxDepth=i.maxDepth??0,m.minDepth=i.minDepth??0,m}};function d(){return{childOrder:[],childSize:0,minPrefixLength:0,maxPrefixLength:0,emptyChild:new Uint8Array,hash:0}}e.InnerSpec={typeUrl:"/cosmos.ics23.v1.InnerSpec",encode(i,m=n.BinaryWriter.create()){m.uint32(10).fork();for(const N of i.childOrder)m.int32(N);return m.ldelim(),i.childSize!==0&&m.uint32(16).int32(i.childSize),i.minPrefixLength!==0&&m.uint32(24).int32(i.minPrefixLength),i.maxPrefixLength!==0&&m.uint32(32).int32(i.maxPrefixLength),i.emptyChild.length!==0&&m.uint32(42).bytes(i.emptyChild),i.hash!==0&&m.uint32(48).int32(i.hash),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=d();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:if((l&7)===2){const T=N.uint32()+N.pos;for(;N.pos<T;)u.childOrder.push(N.int32())}else u.childOrder.push(N.int32());break;case 2:u.childSize=N.int32();break;case 3:u.minPrefixLength=N.int32();break;case 4:u.maxPrefixLength=N.int32();break;case 5:u.emptyChild=N.bytes();break;case 6:u.hash=N.int32();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=d();return Array.isArray(i==null?void 0:i.childOrder)&&(m.childOrder=i.childOrder.map(N=>Number(N))),(0,t.isSet)(i.childSize)&&(m.childSize=Number(i.childSize)),(0,t.isSet)(i.minPrefixLength)&&(m.minPrefixLength=Number(i.minPrefixLength)),(0,t.isSet)(i.maxPrefixLength)&&(m.maxPrefixLength=Number(i.maxPrefixLength)),(0,t.isSet)(i.emptyChild)&&(m.emptyChild=(0,t.bytesFromBase64)(i.emptyChild)),(0,t.isSet)(i.hash)&&(m.hash=o(i.hash)),m},toJSON(i){const m={};return i.childOrder?m.childOrder=i.childOrder.map(N=>Math.round(N)):m.childOrder=[],i.childSize!==void 0&&(m.childSize=Math.round(i.childSize)),i.minPrefixLength!==void 0&&(m.minPrefixLength=Math.round(i.minPrefixLength)),i.maxPrefixLength!==void 0&&(m.maxPrefixLength=Math.round(i.maxPrefixLength)),i.emptyChild!==void 0&&(m.emptyChild=(0,t.base64FromBytes)(i.emptyChild!==void 0?i.emptyChild:new Uint8Array)),i.hash!==void 0&&(m.hash=h(i.hash)),m},fromPartial(i){var N;const m=d();return m.childOrder=((N=i.childOrder)==null?void 0:N.map(V=>V))||[],m.childSize=i.childSize??0,m.minPrefixLength=i.minPrefixLength??0,m.maxPrefixLength=i.maxPrefixLength??0,m.emptyChild=i.emptyChild??new Uint8Array,m.hash=i.hash??0,m}};function s(){return{entries:[]}}e.BatchProof={typeUrl:"/cosmos.ics23.v1.BatchProof",encode(i,m=n.BinaryWriter.create()){for(const N of i.entries)e.BatchEntry.encode(N,m.uint32(10).fork()).ldelim();return m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=s();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.entries.push(e.BatchEntry.decode(N,N.uint32()));break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=s();return Array.isArray(i==null?void 0:i.entries)&&(m.entries=i.entries.map(N=>e.BatchEntry.fromJSON(N))),m},toJSON(i){const m={};return i.entries?m.entries=i.entries.map(N=>N?e.BatchEntry.toJSON(N):void 0):m.entries=[],m},fromPartial(i){var N;const m=s();return m.entries=((N=i.entries)==null?void 0:N.map(V=>e.BatchEntry.fromPartial(V)))||[],m}};function y(){return{exist:void 0,nonexist:void 0}}e.BatchEntry={typeUrl:"/cosmos.ics23.v1.BatchEntry",encode(i,m=n.BinaryWriter.create()){return i.exist!==void 0&&e.ExistenceProof.encode(i.exist,m.uint32(10).fork()).ldelim(),i.nonexist!==void 0&&e.NonExistenceProof.encode(i.nonexist,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=y();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.exist=e.ExistenceProof.decode(N,N.uint32());break;case 2:u.nonexist=e.NonExistenceProof.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=y();return(0,t.isSet)(i.exist)&&(m.exist=e.ExistenceProof.fromJSON(i.exist)),(0,t.isSet)(i.nonexist)&&(m.nonexist=e.NonExistenceProof.fromJSON(i.nonexist)),m},toJSON(i){const m={};return i.exist!==void 0&&(m.exist=i.exist?e.ExistenceProof.toJSON(i.exist):void 0),i.nonexist!==void 0&&(m.nonexist=i.nonexist?e.NonExistenceProof.toJSON(i.nonexist):void 0),m},fromPartial(i){const m=y();return i.exist!==void 0&&i.exist!==null&&(m.exist=e.ExistenceProof.fromPartial(i.exist)),i.nonexist!==void 0&&i.nonexist!==null&&(m.nonexist=e.NonExistenceProof.fromPartial(i.nonexist)),m}};function E(){return{entries:[],lookupInners:[]}}e.CompressedBatchProof={typeUrl:"/cosmos.ics23.v1.CompressedBatchProof",encode(i,m=n.BinaryWriter.create()){for(const N of i.entries)e.CompressedBatchEntry.encode(N,m.uint32(10).fork()).ldelim();for(const N of i.lookupInners)e.InnerOp.encode(N,m.uint32(18).fork()).ldelim();return m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=E();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.entries.push(e.CompressedBatchEntry.decode(N,N.uint32()));break;case 2:u.lookupInners.push(e.InnerOp.decode(N,N.uint32()));break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=E();return Array.isArray(i==null?void 0:i.entries)&&(m.entries=i.entries.map(N=>e.CompressedBatchEntry.fromJSON(N))),Array.isArray(i==null?void 0:i.lookupInners)&&(m.lookupInners=i.lookupInners.map(N=>e.InnerOp.fromJSON(N))),m},toJSON(i){const m={};return i.entries?m.entries=i.entries.map(N=>N?e.CompressedBatchEntry.toJSON(N):void 0):m.entries=[],i.lookupInners?m.lookupInners=i.lookupInners.map(N=>N?e.InnerOp.toJSON(N):void 0):m.lookupInners=[],m},fromPartial(i){var N,V;const m=E();return m.entries=((N=i.entries)==null?void 0:N.map(u=>e.CompressedBatchEntry.fromPartial(u)))||[],m.lookupInners=((V=i.lookupInners)==null?void 0:V.map(u=>e.InnerOp.fromPartial(u)))||[],m}};function _(){return{exist:void 0,nonexist:void 0}}e.CompressedBatchEntry={typeUrl:"/cosmos.ics23.v1.CompressedBatchEntry",encode(i,m=n.BinaryWriter.create()){return i.exist!==void 0&&e.CompressedExistenceProof.encode(i.exist,m.uint32(10).fork()).ldelim(),i.nonexist!==void 0&&e.CompressedNonExistenceProof.encode(i.nonexist,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=_();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.exist=e.CompressedExistenceProof.decode(N,N.uint32());break;case 2:u.nonexist=e.CompressedNonExistenceProof.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=_();return(0,t.isSet)(i.exist)&&(m.exist=e.CompressedExistenceProof.fromJSON(i.exist)),(0,t.isSet)(i.nonexist)&&(m.nonexist=e.CompressedNonExistenceProof.fromJSON(i.nonexist)),m},toJSON(i){const m={};return i.exist!==void 0&&(m.exist=i.exist?e.CompressedExistenceProof.toJSON(i.exist):void 0),i.nonexist!==void 0&&(m.nonexist=i.nonexist?e.CompressedNonExistenceProof.toJSON(i.nonexist):void 0),m},fromPartial(i){const m=_();return i.exist!==void 0&&i.exist!==null&&(m.exist=e.CompressedExistenceProof.fromPartial(i.exist)),i.nonexist!==void 0&&i.nonexist!==null&&(m.nonexist=e.CompressedNonExistenceProof.fromPartial(i.nonexist)),m}};function U(){return{key:new Uint8Array,value:new Uint8Array,leaf:void 0,path:[]}}e.CompressedExistenceProof={typeUrl:"/cosmos.ics23.v1.CompressedExistenceProof",encode(i,m=n.BinaryWriter.create()){i.key.length!==0&&m.uint32(10).bytes(i.key),i.value.length!==0&&m.uint32(18).bytes(i.value),i.leaf!==void 0&&e.LeafOp.encode(i.leaf,m.uint32(26).fork()).ldelim(),m.uint32(34).fork();for(const N of i.path)m.int32(N);return m.ldelim(),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=U();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.key=N.bytes();break;case 2:u.value=N.bytes();break;case 3:u.leaf=e.LeafOp.decode(N,N.uint32());break;case 4:if((l&7)===2){const T=N.uint32()+N.pos;for(;N.pos<T;)u.path.push(N.int32())}else u.path.push(N.int32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=U();return(0,t.isSet)(i.key)&&(m.key=(0,t.bytesFromBase64)(i.key)),(0,t.isSet)(i.value)&&(m.value=(0,t.bytesFromBase64)(i.value)),(0,t.isSet)(i.leaf)&&(m.leaf=e.LeafOp.fromJSON(i.leaf)),Array.isArray(i==null?void 0:i.path)&&(m.path=i.path.map(N=>Number(N))),m},toJSON(i){const m={};return i.key!==void 0&&(m.key=(0,t.base64FromBytes)(i.key!==void 0?i.key:new Uint8Array)),i.value!==void 0&&(m.value=(0,t.base64FromBytes)(i.value!==void 0?i.value:new Uint8Array)),i.leaf!==void 0&&(m.leaf=i.leaf?e.LeafOp.toJSON(i.leaf):void 0),i.path?m.path=i.path.map(N=>Math.round(N)):m.path=[],m},fromPartial(i){var N;const m=U();return m.key=i.key??new Uint8Array,m.value=i.value??new Uint8Array,i.leaf!==void 0&&i.leaf!==null&&(m.leaf=e.LeafOp.fromPartial(i.leaf)),m.path=((N=i.path)==null?void 0:N.map(V=>V))||[],m}};function H(){return{key:new Uint8Array,left:void 0,right:void 0}}e.CompressedNonExistenceProof={typeUrl:"/cosmos.ics23.v1.CompressedNonExistenceProof",encode(i,m=n.BinaryWriter.create()){return i.key.length!==0&&m.uint32(10).bytes(i.key),i.left!==void 0&&e.CompressedExistenceProof.encode(i.left,m.uint32(18).fork()).ldelim(),i.right!==void 0&&e.CompressedExistenceProof.encode(i.right,m.uint32(26).fork()).ldelim(),m},decode(i,m){const N=i instanceof n.BinaryReader?i:new n.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=H();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.key=N.bytes();break;case 2:u.left=e.CompressedExistenceProof.decode(N,N.uint32());break;case 3:u.right=e.CompressedExistenceProof.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=H();return(0,t.isSet)(i.key)&&(m.key=(0,t.bytesFromBase64)(i.key)),(0,t.isSet)(i.left)&&(m.left=e.CompressedExistenceProof.fromJSON(i.left)),(0,t.isSet)(i.right)&&(m.right=e.CompressedExistenceProof.fromJSON(i.right)),m},toJSON(i){const m={};return i.key!==void 0&&(m.key=(0,t.base64FromBytes)(i.key!==void 0?i.key:new Uint8Array)),i.left!==void 0&&(m.left=i.left?e.CompressedExistenceProof.toJSON(i.left):void 0),i.right!==void 0&&(m.right=i.right?e.CompressedExistenceProof.toJSON(i.right):void 0),m},fromPartial(i){const m=H();return m.key=i.key??new Uint8Array,i.left!==void 0&&i.left!==null&&(m.left=e.CompressedExistenceProof.fromPartial(i.left)),i.right!==void 0&&i.right!==null&&(m.right=e.CompressedExistenceProof.fromPartial(i.right)),m}}})(_c);Object.defineProperty(pn,"__esModule",{value:!0});pn.MerkleProof=pn.MerklePath=pn.MerklePrefix=pn.MerkleRoot=pn.protobufPackage=void 0;const qi=_c,Dn=ee,Hr=ne;pn.protobufPackage="ibc.core.commitment.v1";function Ld(){return{hash:new Uint8Array}}pn.MerkleRoot={typeUrl:"/ibc.core.commitment.v1.MerkleRoot",encode(e,n=Dn.BinaryWriter.create()){return e.hash.length!==0&&n.uint32(10).bytes(e.hash),n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Ld();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.hash=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Ld();return(0,Hr.isSet)(e.hash)&&(n.hash=(0,Hr.bytesFromBase64)(e.hash)),n},toJSON(e){const n={};return e.hash!==void 0&&(n.hash=(0,Hr.base64FromBytes)(e.hash!==void 0?e.hash:new Uint8Array)),n},fromPartial(e){const n=Ld();return n.hash=e.hash??new Uint8Array,n}};function $d(){return{keyPrefix:new Uint8Array}}pn.MerklePrefix={typeUrl:"/ibc.core.commitment.v1.MerklePrefix",encode(e,n=Dn.BinaryWriter.create()){return e.keyPrefix.length!==0&&n.uint32(10).bytes(e.keyPrefix),n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=$d();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.keyPrefix=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=$d();return(0,Hr.isSet)(e.keyPrefix)&&(n.keyPrefix=(0,Hr.bytesFromBase64)(e.keyPrefix)),n},toJSON(e){const n={};return e.keyPrefix!==void 0&&(n.keyPrefix=(0,Hr.base64FromBytes)(e.keyPrefix!==void 0?e.keyPrefix:new Uint8Array)),n},fromPartial(e){const n=$d();return n.keyPrefix=e.keyPrefix??new Uint8Array,n}};function Kd(){return{keyPath:[]}}pn.MerklePath={typeUrl:"/ibc.core.commitment.v1.MerklePath",encode(e,n=Dn.BinaryWriter.create()){for(const t of e.keyPath)n.uint32(10).string(t);return n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Kd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.keyPath.push(t.string());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Kd();return Array.isArray(e==null?void 0:e.keyPath)&&(n.keyPath=e.keyPath.map(t=>String(t))),n},toJSON(e){const n={};return e.keyPath?n.keyPath=e.keyPath.map(t=>t):n.keyPath=[],n},fromPartial(e){var t;const n=Kd();return n.keyPath=((t=e.keyPath)==null?void 0:t.map(r=>r))||[],n}};function zd(){return{proofs:[]}}pn.MerkleProof={typeUrl:"/ibc.core.commitment.v1.MerkleProof",encode(e,n=Dn.BinaryWriter.create()){for(const t of e.proofs)qi.CommitmentProof.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){const t=e instanceof Dn.BinaryReader?e:new Dn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=zd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.proofs.push(qi.CommitmentProof.decode(t,t.uint32()));break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=zd();return Array.isArray(e==null?void 0:e.proofs)&&(n.proofs=e.proofs.map(t=>qi.CommitmentProof.fromJSON(t))),n},toJSON(e){const n={};return e.proofs?n.proofs=e.proofs.map(t=>t?qi.CommitmentProof.toJSON(t):void 0):n.proofs=[],n},fromPartial(e){var t;const n=zd();return n.proofs=((t=e.proofs)==null?void 0:t.map(r=>qi.CommitmentProof.fromPartial(r)))||[],n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.Version=e.ConnectionPaths=e.ClientPaths=e.Counterparty=e.IdentifiedConnection=e.ConnectionEnd=e.stateToJSON=e.stateFromJSON=e.State=e.protobufPackage=void 0;const n=pn,t=ee,r=ne;e.protobufPackage="ibc.core.connection.v1";var o;(function(B){B[B.STATE_UNINITIALIZED_UNSPECIFIED=0]="STATE_UNINITIALIZED_UNSPECIFIED",B[B.STATE_INIT=1]="STATE_INIT",B[B.STATE_TRYOPEN=2]="STATE_TRYOPEN",B[B.STATE_OPEN=3]="STATE_OPEN",B[B.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o||(e.State=o={}));function h(B){switch(B){case 0:case"STATE_UNINITIALIZED_UNSPECIFIED":return o.STATE_UNINITIALIZED_UNSPECIFIED;case 1:case"STATE_INIT":return o.STATE_INIT;case 2:case"STATE_TRYOPEN":return o.STATE_TRYOPEN;case 3:case"STATE_OPEN":return o.STATE_OPEN;case-1:case"UNRECOGNIZED":default:return o.UNRECOGNIZED}}e.stateFromJSON=h;function v(B){switch(B){case o.STATE_UNINITIALIZED_UNSPECIFIED:return"STATE_UNINITIALIZED_UNSPECIFIED";case o.STATE_INIT:return"STATE_INIT";case o.STATE_TRYOPEN:return"STATE_TRYOPEN";case o.STATE_OPEN:return"STATE_OPEN";case o.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.stateToJSON=v;function C(){return{clientId:"",versions:[],state:0,counterparty:e.Counterparty.fromPartial({}),delayPeriod:BigInt(0)}}e.ConnectionEnd={typeUrl:"/ibc.core.connection.v1.ConnectionEnd",encode(B,d=t.BinaryWriter.create()){B.clientId!==""&&d.uint32(10).string(B.clientId);for(const s of B.versions)e.Version.encode(s,d.uint32(18).fork()).ldelim();return B.state!==0&&d.uint32(24).int32(B.state),B.counterparty!==void 0&&e.Counterparty.encode(B.counterparty,d.uint32(34).fork()).ldelim(),B.delayPeriod!==BigInt(0)&&d.uint32(40).uint64(B.delayPeriod),d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=C();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.clientId=s.string();break;case 2:E.versions.push(e.Version.decode(s,s.uint32()));break;case 3:E.state=s.int32();break;case 4:E.counterparty=e.Counterparty.decode(s,s.uint32());break;case 5:E.delayPeriod=s.uint64();break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=C();return(0,r.isSet)(B.clientId)&&(d.clientId=String(B.clientId)),Array.isArray(B==null?void 0:B.versions)&&(d.versions=B.versions.map(s=>e.Version.fromJSON(s))),(0,r.isSet)(B.state)&&(d.state=h(B.state)),(0,r.isSet)(B.counterparty)&&(d.counterparty=e.Counterparty.fromJSON(B.counterparty)),(0,r.isSet)(B.delayPeriod)&&(d.delayPeriod=BigInt(B.delayPeriod.toString())),d},toJSON(B){const d={};return B.clientId!==void 0&&(d.clientId=B.clientId),B.versions?d.versions=B.versions.map(s=>s?e.Version.toJSON(s):void 0):d.versions=[],B.state!==void 0&&(d.state=v(B.state)),B.counterparty!==void 0&&(d.counterparty=B.counterparty?e.Counterparty.toJSON(B.counterparty):void 0),B.delayPeriod!==void 0&&(d.delayPeriod=(B.delayPeriod||BigInt(0)).toString()),d},fromPartial(B){var s;const d=C();return d.clientId=B.clientId??"",d.versions=((s=B.versions)==null?void 0:s.map(y=>e.Version.fromPartial(y)))||[],d.state=B.state??0,B.counterparty!==void 0&&B.counterparty!==null&&(d.counterparty=e.Counterparty.fromPartial(B.counterparty)),B.delayPeriod!==void 0&&B.delayPeriod!==null&&(d.delayPeriod=BigInt(B.delayPeriod.toString())),d}};function w(){return{id:"",clientId:"",versions:[],state:0,counterparty:e.Counterparty.fromPartial({}),delayPeriod:BigInt(0)}}e.IdentifiedConnection={typeUrl:"/ibc.core.connection.v1.IdentifiedConnection",encode(B,d=t.BinaryWriter.create()){B.id!==""&&d.uint32(10).string(B.id),B.clientId!==""&&d.uint32(18).string(B.clientId);for(const s of B.versions)e.Version.encode(s,d.uint32(26).fork()).ldelim();return B.state!==0&&d.uint32(32).int32(B.state),B.counterparty!==void 0&&e.Counterparty.encode(B.counterparty,d.uint32(42).fork()).ldelim(),B.delayPeriod!==BigInt(0)&&d.uint32(48).uint64(B.delayPeriod),d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=w();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.id=s.string();break;case 2:E.clientId=s.string();break;case 3:E.versions.push(e.Version.decode(s,s.uint32()));break;case 4:E.state=s.int32();break;case 5:E.counterparty=e.Counterparty.decode(s,s.uint32());break;case 6:E.delayPeriod=s.uint64();break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=w();return(0,r.isSet)(B.id)&&(d.id=String(B.id)),(0,r.isSet)(B.clientId)&&(d.clientId=String(B.clientId)),Array.isArray(B==null?void 0:B.versions)&&(d.versions=B.versions.map(s=>e.Version.fromJSON(s))),(0,r.isSet)(B.state)&&(d.state=h(B.state)),(0,r.isSet)(B.counterparty)&&(d.counterparty=e.Counterparty.fromJSON(B.counterparty)),(0,r.isSet)(B.delayPeriod)&&(d.delayPeriod=BigInt(B.delayPeriod.toString())),d},toJSON(B){const d={};return B.id!==void 0&&(d.id=B.id),B.clientId!==void 0&&(d.clientId=B.clientId),B.versions?d.versions=B.versions.map(s=>s?e.Version.toJSON(s):void 0):d.versions=[],B.state!==void 0&&(d.state=v(B.state)),B.counterparty!==void 0&&(d.counterparty=B.counterparty?e.Counterparty.toJSON(B.counterparty):void 0),B.delayPeriod!==void 0&&(d.delayPeriod=(B.delayPeriod||BigInt(0)).toString()),d},fromPartial(B){var s;const d=w();return d.id=B.id??"",d.clientId=B.clientId??"",d.versions=((s=B.versions)==null?void 0:s.map(y=>e.Version.fromPartial(y)))||[],d.state=B.state??0,B.counterparty!==void 0&&B.counterparty!==null&&(d.counterparty=e.Counterparty.fromPartial(B.counterparty)),B.delayPeriod!==void 0&&B.delayPeriod!==null&&(d.delayPeriod=BigInt(B.delayPeriod.toString())),d}};function D(){return{clientId:"",connectionId:"",prefix:n.MerklePrefix.fromPartial({})}}e.Counterparty={typeUrl:"/ibc.core.connection.v1.Counterparty",encode(B,d=t.BinaryWriter.create()){return B.clientId!==""&&d.uint32(10).string(B.clientId),B.connectionId!==""&&d.uint32(18).string(B.connectionId),B.prefix!==void 0&&n.MerklePrefix.encode(B.prefix,d.uint32(26).fork()).ldelim(),d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=D();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.clientId=s.string();break;case 2:E.connectionId=s.string();break;case 3:E.prefix=n.MerklePrefix.decode(s,s.uint32());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=D();return(0,r.isSet)(B.clientId)&&(d.clientId=String(B.clientId)),(0,r.isSet)(B.connectionId)&&(d.connectionId=String(B.connectionId)),(0,r.isSet)(B.prefix)&&(d.prefix=n.MerklePrefix.fromJSON(B.prefix)),d},toJSON(B){const d={};return B.clientId!==void 0&&(d.clientId=B.clientId),B.connectionId!==void 0&&(d.connectionId=B.connectionId),B.prefix!==void 0&&(d.prefix=B.prefix?n.MerklePrefix.toJSON(B.prefix):void 0),d},fromPartial(B){const d=D();return d.clientId=B.clientId??"",d.connectionId=B.connectionId??"",B.prefix!==void 0&&B.prefix!==null&&(d.prefix=n.MerklePrefix.fromPartial(B.prefix)),d}};function J(){return{paths:[]}}e.ClientPaths={typeUrl:"/ibc.core.connection.v1.ClientPaths",encode(B,d=t.BinaryWriter.create()){for(const s of B.paths)d.uint32(10).string(s);return d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=J();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.paths.push(s.string());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=J();return Array.isArray(B==null?void 0:B.paths)&&(d.paths=B.paths.map(s=>String(s))),d},toJSON(B){const d={};return B.paths?d.paths=B.paths.map(s=>s):d.paths=[],d},fromPartial(B){var s;const d=J();return d.paths=((s=B.paths)==null?void 0:s.map(y=>y))||[],d}};function I(){return{clientId:"",paths:[]}}e.ConnectionPaths={typeUrl:"/ibc.core.connection.v1.ConnectionPaths",encode(B,d=t.BinaryWriter.create()){B.clientId!==""&&d.uint32(10).string(B.clientId);for(const s of B.paths)d.uint32(18).string(s);return d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=I();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.clientId=s.string();break;case 2:E.paths.push(s.string());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=I();return(0,r.isSet)(B.clientId)&&(d.clientId=String(B.clientId)),Array.isArray(B==null?void 0:B.paths)&&(d.paths=B.paths.map(s=>String(s))),d},toJSON(B){const d={};return B.clientId!==void 0&&(d.clientId=B.clientId),B.paths?d.paths=B.paths.map(s=>s):d.paths=[],d},fromPartial(B){var s;const d=I();return d.clientId=B.clientId??"",d.paths=((s=B.paths)==null?void 0:s.map(y=>y))||[],d}};function g(){return{identifier:"",features:[]}}e.Version={typeUrl:"/ibc.core.connection.v1.Version",encode(B,d=t.BinaryWriter.create()){B.identifier!==""&&d.uint32(10).string(B.identifier);for(const s of B.features)d.uint32(18).string(s);return d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=g();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.identifier=s.string();break;case 2:E.features.push(s.string());break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=g();return(0,r.isSet)(B.identifier)&&(d.identifier=String(B.identifier)),Array.isArray(B==null?void 0:B.features)&&(d.features=B.features.map(s=>String(s))),d},toJSON(B){const d={};return B.identifier!==void 0&&(d.identifier=B.identifier),B.features?d.features=B.features.map(s=>s):d.features=[],d},fromPartial(B){var s;const d=g();return d.identifier=B.identifier??"",d.features=((s=B.features)==null?void 0:s.map(y=>y))||[],d}};function R(){return{maxExpectedTimePerBlock:BigInt(0)}}e.Params={typeUrl:"/ibc.core.connection.v1.Params",encode(B,d=t.BinaryWriter.create()){return B.maxExpectedTimePerBlock!==BigInt(0)&&d.uint32(8).uint64(B.maxExpectedTimePerBlock),d},decode(B,d){const s=B instanceof t.BinaryReader?B:new t.BinaryReader(B);let y=d===void 0?s.len:s.pos+d;const E=R();for(;s.pos<y;){const _=s.uint32();switch(_>>>3){case 1:E.maxExpectedTimePerBlock=s.uint64();break;default:s.skipType(_&7);break}}return E},fromJSON(B){const d=R();return(0,r.isSet)(B.maxExpectedTimePerBlock)&&(d.maxExpectedTimePerBlock=BigInt(B.maxExpectedTimePerBlock.toString())),d},toJSON(B){const d={};return B.maxExpectedTimePerBlock!==void 0&&(d.maxExpectedTimePerBlock=(B.maxExpectedTimePerBlock||BigInt(0)).toString()),d},fromPartial(B){const d=R();return B.maxExpectedTimePerBlock!==void 0&&B.maxExpectedTimePerBlock!==null&&(d.maxExpectedTimePerBlock=BigInt(B.maxExpectedTimePerBlock.toString())),d}}})(Ec);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgConnectionOpenConfirmResponse=e.MsgConnectionOpenConfirm=e.MsgConnectionOpenAckResponse=e.MsgConnectionOpenAck=e.MsgConnectionOpenTryResponse=e.MsgConnectionOpenTry=e.MsgConnectionOpenInitResponse=e.MsgConnectionOpenInit=e.protobufPackage=void 0;const n=Ec,t=Re,r=sr,o=ee,h=ne;e.protobufPackage="ibc.core.connection.v1";function v(){return{clientId:"",counterparty:n.Counterparty.fromPartial({}),version:void 0,delayPeriod:BigInt(0),signer:""}}e.MsgConnectionOpenInit={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenInit",encode(d,s=o.BinaryWriter.create()){return d.clientId!==""&&s.uint32(10).string(d.clientId),d.counterparty!==void 0&&n.Counterparty.encode(d.counterparty,s.uint32(18).fork()).ldelim(),d.version!==void 0&&n.Version.encode(d.version,s.uint32(26).fork()).ldelim(),d.delayPeriod!==BigInt(0)&&s.uint32(32).uint64(d.delayPeriod),d.signer!==""&&s.uint32(42).string(d.signer),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=v();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.clientId=y.string();break;case 2:_.counterparty=n.Counterparty.decode(y,y.uint32());break;case 3:_.version=n.Version.decode(y,y.uint32());break;case 4:_.delayPeriod=y.uint64();break;case 5:_.signer=y.string();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=v();return(0,h.isSet)(d.clientId)&&(s.clientId=String(d.clientId)),(0,h.isSet)(d.counterparty)&&(s.counterparty=n.Counterparty.fromJSON(d.counterparty)),(0,h.isSet)(d.version)&&(s.version=n.Version.fromJSON(d.version)),(0,h.isSet)(d.delayPeriod)&&(s.delayPeriod=BigInt(d.delayPeriod.toString())),(0,h.isSet)(d.signer)&&(s.signer=String(d.signer)),s},toJSON(d){const s={};return d.clientId!==void 0&&(s.clientId=d.clientId),d.counterparty!==void 0&&(s.counterparty=d.counterparty?n.Counterparty.toJSON(d.counterparty):void 0),d.version!==void 0&&(s.version=d.version?n.Version.toJSON(d.version):void 0),d.delayPeriod!==void 0&&(s.delayPeriod=(d.delayPeriod||BigInt(0)).toString()),d.signer!==void 0&&(s.signer=d.signer),s},fromPartial(d){const s=v();return s.clientId=d.clientId??"",d.counterparty!==void 0&&d.counterparty!==null&&(s.counterparty=n.Counterparty.fromPartial(d.counterparty)),d.version!==void 0&&d.version!==null&&(s.version=n.Version.fromPartial(d.version)),d.delayPeriod!==void 0&&d.delayPeriod!==null&&(s.delayPeriod=BigInt(d.delayPeriod.toString())),s.signer=d.signer??"",s}};function C(){return{}}e.MsgConnectionOpenInitResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenInitResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=C();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return C()},toJSON(d){return{}},fromPartial(d){return C()}};function w(){return{clientId:"",previousConnectionId:"",clientState:void 0,counterparty:n.Counterparty.fromPartial({}),delayPeriod:BigInt(0),counterpartyVersions:[],proofHeight:r.Height.fromPartial({}),proofInit:new Uint8Array,proofClient:new Uint8Array,proofConsensus:new Uint8Array,consensusHeight:r.Height.fromPartial({}),signer:"",hostConsensusStateProof:new Uint8Array}}e.MsgConnectionOpenTry={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenTry",encode(d,s=o.BinaryWriter.create()){d.clientId!==""&&s.uint32(10).string(d.clientId),d.previousConnectionId!==""&&s.uint32(18).string(d.previousConnectionId),d.clientState!==void 0&&t.Any.encode(d.clientState,s.uint32(26).fork()).ldelim(),d.counterparty!==void 0&&n.Counterparty.encode(d.counterparty,s.uint32(34).fork()).ldelim(),d.delayPeriod!==BigInt(0)&&s.uint32(40).uint64(d.delayPeriod);for(const y of d.counterpartyVersions)n.Version.encode(y,s.uint32(50).fork()).ldelim();return d.proofHeight!==void 0&&r.Height.encode(d.proofHeight,s.uint32(58).fork()).ldelim(),d.proofInit.length!==0&&s.uint32(66).bytes(d.proofInit),d.proofClient.length!==0&&s.uint32(74).bytes(d.proofClient),d.proofConsensus.length!==0&&s.uint32(82).bytes(d.proofConsensus),d.consensusHeight!==void 0&&r.Height.encode(d.consensusHeight,s.uint32(90).fork()).ldelim(),d.signer!==""&&s.uint32(98).string(d.signer),d.hostConsensusStateProof.length!==0&&s.uint32(106).bytes(d.hostConsensusStateProof),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=w();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.clientId=y.string();break;case 2:_.previousConnectionId=y.string();break;case 3:_.clientState=t.Any.decode(y,y.uint32());break;case 4:_.counterparty=n.Counterparty.decode(y,y.uint32());break;case 5:_.delayPeriod=y.uint64();break;case 6:_.counterpartyVersions.push(n.Version.decode(y,y.uint32()));break;case 7:_.proofHeight=r.Height.decode(y,y.uint32());break;case 8:_.proofInit=y.bytes();break;case 9:_.proofClient=y.bytes();break;case 10:_.proofConsensus=y.bytes();break;case 11:_.consensusHeight=r.Height.decode(y,y.uint32());break;case 12:_.signer=y.string();break;case 13:_.hostConsensusStateProof=y.bytes();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=w();return(0,h.isSet)(d.clientId)&&(s.clientId=String(d.clientId)),(0,h.isSet)(d.previousConnectionId)&&(s.previousConnectionId=String(d.previousConnectionId)),(0,h.isSet)(d.clientState)&&(s.clientState=t.Any.fromJSON(d.clientState)),(0,h.isSet)(d.counterparty)&&(s.counterparty=n.Counterparty.fromJSON(d.counterparty)),(0,h.isSet)(d.delayPeriod)&&(s.delayPeriod=BigInt(d.delayPeriod.toString())),Array.isArray(d==null?void 0:d.counterpartyVersions)&&(s.counterpartyVersions=d.counterpartyVersions.map(y=>n.Version.fromJSON(y))),(0,h.isSet)(d.proofHeight)&&(s.proofHeight=r.Height.fromJSON(d.proofHeight)),(0,h.isSet)(d.proofInit)&&(s.proofInit=(0,h.bytesFromBase64)(d.proofInit)),(0,h.isSet)(d.proofClient)&&(s.proofClient=(0,h.bytesFromBase64)(d.proofClient)),(0,h.isSet)(d.proofConsensus)&&(s.proofConsensus=(0,h.bytesFromBase64)(d.proofConsensus)),(0,h.isSet)(d.consensusHeight)&&(s.consensusHeight=r.Height.fromJSON(d.consensusHeight)),(0,h.isSet)(d.signer)&&(s.signer=String(d.signer)),(0,h.isSet)(d.hostConsensusStateProof)&&(s.hostConsensusStateProof=(0,h.bytesFromBase64)(d.hostConsensusStateProof)),s},toJSON(d){const s={};return d.clientId!==void 0&&(s.clientId=d.clientId),d.previousConnectionId!==void 0&&(s.previousConnectionId=d.previousConnectionId),d.clientState!==void 0&&(s.clientState=d.clientState?t.Any.toJSON(d.clientState):void 0),d.counterparty!==void 0&&(s.counterparty=d.counterparty?n.Counterparty.toJSON(d.counterparty):void 0),d.delayPeriod!==void 0&&(s.delayPeriod=(d.delayPeriod||BigInt(0)).toString()),d.counterpartyVersions?s.counterpartyVersions=d.counterpartyVersions.map(y=>y?n.Version.toJSON(y):void 0):s.counterpartyVersions=[],d.proofHeight!==void 0&&(s.proofHeight=d.proofHeight?r.Height.toJSON(d.proofHeight):void 0),d.proofInit!==void 0&&(s.proofInit=(0,h.base64FromBytes)(d.proofInit!==void 0?d.proofInit:new Uint8Array)),d.proofClient!==void 0&&(s.proofClient=(0,h.base64FromBytes)(d.proofClient!==void 0?d.proofClient:new Uint8Array)),d.proofConsensus!==void 0&&(s.proofConsensus=(0,h.base64FromBytes)(d.proofConsensus!==void 0?d.proofConsensus:new Uint8Array)),d.consensusHeight!==void 0&&(s.consensusHeight=d.consensusHeight?r.Height.toJSON(d.consensusHeight):void 0),d.signer!==void 0&&(s.signer=d.signer),d.hostConsensusStateProof!==void 0&&(s.hostConsensusStateProof=(0,h.base64FromBytes)(d.hostConsensusStateProof!==void 0?d.hostConsensusStateProof:new Uint8Array)),s},fromPartial(d){var y;const s=w();return s.clientId=d.clientId??"",s.previousConnectionId=d.previousConnectionId??"",d.clientState!==void 0&&d.clientState!==null&&(s.clientState=t.Any.fromPartial(d.clientState)),d.counterparty!==void 0&&d.counterparty!==null&&(s.counterparty=n.Counterparty.fromPartial(d.counterparty)),d.delayPeriod!==void 0&&d.delayPeriod!==null&&(s.delayPeriod=BigInt(d.delayPeriod.toString())),s.counterpartyVersions=((y=d.counterpartyVersions)==null?void 0:y.map(E=>n.Version.fromPartial(E)))||[],d.proofHeight!==void 0&&d.proofHeight!==null&&(s.proofHeight=r.Height.fromPartial(d.proofHeight)),s.proofInit=d.proofInit??new Uint8Array,s.proofClient=d.proofClient??new Uint8Array,s.proofConsensus=d.proofConsensus??new Uint8Array,d.consensusHeight!==void 0&&d.consensusHeight!==null&&(s.consensusHeight=r.Height.fromPartial(d.consensusHeight)),s.signer=d.signer??"",s.hostConsensusStateProof=d.hostConsensusStateProof??new Uint8Array,s}};function D(){return{}}e.MsgConnectionOpenTryResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenTryResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=D();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return D()},toJSON(d){return{}},fromPartial(d){return D()}};function J(){return{connectionId:"",counterpartyConnectionId:"",version:void 0,clientState:void 0,proofHeight:r.Height.fromPartial({}),proofTry:new Uint8Array,proofClient:new Uint8Array,proofConsensus:new Uint8Array,consensusHeight:r.Height.fromPartial({}),signer:"",hostConsensusStateProof:new Uint8Array}}e.MsgConnectionOpenAck={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenAck",encode(d,s=o.BinaryWriter.create()){return d.connectionId!==""&&s.uint32(10).string(d.connectionId),d.counterpartyConnectionId!==""&&s.uint32(18).string(d.counterpartyConnectionId),d.version!==void 0&&n.Version.encode(d.version,s.uint32(26).fork()).ldelim(),d.clientState!==void 0&&t.Any.encode(d.clientState,s.uint32(34).fork()).ldelim(),d.proofHeight!==void 0&&r.Height.encode(d.proofHeight,s.uint32(42).fork()).ldelim(),d.proofTry.length!==0&&s.uint32(50).bytes(d.proofTry),d.proofClient.length!==0&&s.uint32(58).bytes(d.proofClient),d.proofConsensus.length!==0&&s.uint32(66).bytes(d.proofConsensus),d.consensusHeight!==void 0&&r.Height.encode(d.consensusHeight,s.uint32(74).fork()).ldelim(),d.signer!==""&&s.uint32(82).string(d.signer),d.hostConsensusStateProof.length!==0&&s.uint32(90).bytes(d.hostConsensusStateProof),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=J();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.connectionId=y.string();break;case 2:_.counterpartyConnectionId=y.string();break;case 3:_.version=n.Version.decode(y,y.uint32());break;case 4:_.clientState=t.Any.decode(y,y.uint32());break;case 5:_.proofHeight=r.Height.decode(y,y.uint32());break;case 6:_.proofTry=y.bytes();break;case 7:_.proofClient=y.bytes();break;case 8:_.proofConsensus=y.bytes();break;case 9:_.consensusHeight=r.Height.decode(y,y.uint32());break;case 10:_.signer=y.string();break;case 11:_.hostConsensusStateProof=y.bytes();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=J();return(0,h.isSet)(d.connectionId)&&(s.connectionId=String(d.connectionId)),(0,h.isSet)(d.counterpartyConnectionId)&&(s.counterpartyConnectionId=String(d.counterpartyConnectionId)),(0,h.isSet)(d.version)&&(s.version=n.Version.fromJSON(d.version)),(0,h.isSet)(d.clientState)&&(s.clientState=t.Any.fromJSON(d.clientState)),(0,h.isSet)(d.proofHeight)&&(s.proofHeight=r.Height.fromJSON(d.proofHeight)),(0,h.isSet)(d.proofTry)&&(s.proofTry=(0,h.bytesFromBase64)(d.proofTry)),(0,h.isSet)(d.proofClient)&&(s.proofClient=(0,h.bytesFromBase64)(d.proofClient)),(0,h.isSet)(d.proofConsensus)&&(s.proofConsensus=(0,h.bytesFromBase64)(d.proofConsensus)),(0,h.isSet)(d.consensusHeight)&&(s.consensusHeight=r.Height.fromJSON(d.consensusHeight)),(0,h.isSet)(d.signer)&&(s.signer=String(d.signer)),(0,h.isSet)(d.hostConsensusStateProof)&&(s.hostConsensusStateProof=(0,h.bytesFromBase64)(d.hostConsensusStateProof)),s},toJSON(d){const s={};return d.connectionId!==void 0&&(s.connectionId=d.connectionId),d.counterpartyConnectionId!==void 0&&(s.counterpartyConnectionId=d.counterpartyConnectionId),d.version!==void 0&&(s.version=d.version?n.Version.toJSON(d.version):void 0),d.clientState!==void 0&&(s.clientState=d.clientState?t.Any.toJSON(d.clientState):void 0),d.proofHeight!==void 0&&(s.proofHeight=d.proofHeight?r.Height.toJSON(d.proofHeight):void 0),d.proofTry!==void 0&&(s.proofTry=(0,h.base64FromBytes)(d.proofTry!==void 0?d.proofTry:new Uint8Array)),d.proofClient!==void 0&&(s.proofClient=(0,h.base64FromBytes)(d.proofClient!==void 0?d.proofClient:new Uint8Array)),d.proofConsensus!==void 0&&(s.proofConsensus=(0,h.base64FromBytes)(d.proofConsensus!==void 0?d.proofConsensus:new Uint8Array)),d.consensusHeight!==void 0&&(s.consensusHeight=d.consensusHeight?r.Height.toJSON(d.consensusHeight):void 0),d.signer!==void 0&&(s.signer=d.signer),d.hostConsensusStateProof!==void 0&&(s.hostConsensusStateProof=(0,h.base64FromBytes)(d.hostConsensusStateProof!==void 0?d.hostConsensusStateProof:new Uint8Array)),s},fromPartial(d){const s=J();return s.connectionId=d.connectionId??"",s.counterpartyConnectionId=d.counterpartyConnectionId??"",d.version!==void 0&&d.version!==null&&(s.version=n.Version.fromPartial(d.version)),d.clientState!==void 0&&d.clientState!==null&&(s.clientState=t.Any.fromPartial(d.clientState)),d.proofHeight!==void 0&&d.proofHeight!==null&&(s.proofHeight=r.Height.fromPartial(d.proofHeight)),s.proofTry=d.proofTry??new Uint8Array,s.proofClient=d.proofClient??new Uint8Array,s.proofConsensus=d.proofConsensus??new Uint8Array,d.consensusHeight!==void 0&&d.consensusHeight!==null&&(s.consensusHeight=r.Height.fromPartial(d.consensusHeight)),s.signer=d.signer??"",s.hostConsensusStateProof=d.hostConsensusStateProof??new Uint8Array,s}};function I(){return{}}e.MsgConnectionOpenAckResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenAckResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=I();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return I()},toJSON(d){return{}},fromPartial(d){return I()}};function g(){return{connectionId:"",proofAck:new Uint8Array,proofHeight:r.Height.fromPartial({}),signer:""}}e.MsgConnectionOpenConfirm={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenConfirm",encode(d,s=o.BinaryWriter.create()){return d.connectionId!==""&&s.uint32(10).string(d.connectionId),d.proofAck.length!==0&&s.uint32(18).bytes(d.proofAck),d.proofHeight!==void 0&&r.Height.encode(d.proofHeight,s.uint32(26).fork()).ldelim(),d.signer!==""&&s.uint32(34).string(d.signer),s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=g();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.connectionId=y.string();break;case 2:_.proofAck=y.bytes();break;case 3:_.proofHeight=r.Height.decode(y,y.uint32());break;case 4:_.signer=y.string();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=g();return(0,h.isSet)(d.connectionId)&&(s.connectionId=String(d.connectionId)),(0,h.isSet)(d.proofAck)&&(s.proofAck=(0,h.bytesFromBase64)(d.proofAck)),(0,h.isSet)(d.proofHeight)&&(s.proofHeight=r.Height.fromJSON(d.proofHeight)),(0,h.isSet)(d.signer)&&(s.signer=String(d.signer)),s},toJSON(d){const s={};return d.connectionId!==void 0&&(s.connectionId=d.connectionId),d.proofAck!==void 0&&(s.proofAck=(0,h.base64FromBytes)(d.proofAck!==void 0?d.proofAck:new Uint8Array)),d.proofHeight!==void 0&&(s.proofHeight=d.proofHeight?r.Height.toJSON(d.proofHeight):void 0),d.signer!==void 0&&(s.signer=d.signer),s},fromPartial(d){const s=g();return s.connectionId=d.connectionId??"",s.proofAck=d.proofAck??new Uint8Array,d.proofHeight!==void 0&&d.proofHeight!==null&&(s.proofHeight=r.Height.fromPartial(d.proofHeight)),s.signer=d.signer??"",s}};function R(){return{}}e.MsgConnectionOpenConfirmResponse={typeUrl:"/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse",encode(d,s=o.BinaryWriter.create()){return s},decode(d,s){const y=d instanceof o.BinaryReader?d:new o.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=R();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){default:y.skipType(U&7);break}}return _},fromJSON(d){return R()},toJSON(d){return{}},fromPartial(d){return R()}};class B{constructor(s){this.rpc=s,this.ConnectionOpenInit=this.ConnectionOpenInit.bind(this),this.ConnectionOpenTry=this.ConnectionOpenTry.bind(this),this.ConnectionOpenAck=this.ConnectionOpenAck.bind(this),this.ConnectionOpenConfirm=this.ConnectionOpenConfirm.bind(this)}ConnectionOpenInit(s){const y=e.MsgConnectionOpenInit.encode(s).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenInit",y).then(_=>e.MsgConnectionOpenInitResponse.decode(new o.BinaryReader(_)))}ConnectionOpenTry(s){const y=e.MsgConnectionOpenTry.encode(s).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenTry",y).then(_=>e.MsgConnectionOpenTryResponse.decode(new o.BinaryReader(_)))}ConnectionOpenAck(s){const y=e.MsgConnectionOpenAck.encode(s).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenAck",y).then(_=>e.MsgConnectionOpenAckResponse.decode(new o.BinaryReader(_)))}ConnectionOpenConfirm(s){const y=e.MsgConnectionOpenConfirm.encode(s).finish();return this.rpc.request("ibc.core.connection.v1.Msg","ConnectionOpenConfirm",y).then(_=>e.MsgConnectionOpenConfirmResponse.decode(new o.BinaryReader(_)))}}e.MsgClientImpl=B})(Nm);Object.defineProperty(di,"__esModule",{value:!0});di.isMsgTransferEncodeObject=di.ibcTypes=void 0;const mR=pc,Zn=Tm,qo=Cm,Ho=Nm;di.ibcTypes=[["/ibc.applications.transfer.v1.MsgTransfer",mR.MsgTransfer],["/ibc.core.channel.v1.MsgAcknowledgement",Zn.MsgAcknowledgement],["/ibc.core.channel.v1.MsgChannelCloseConfirm",Zn.MsgChannelCloseConfirm],["/ibc.core.channel.v1.MsgChannelCloseInit",Zn.MsgChannelCloseInit],["/ibc.core.channel.v1.MsgChannelOpenAck",Zn.MsgChannelOpenAck],["/ibc.core.channel.v1.MsgChannelOpenConfirm",Zn.MsgChannelOpenConfirm],["/ibc.core.channel.v1.MsgChannelOpenInit",Zn.MsgChannelOpenInit],["/ibc.core.channel.v1.MsgChannelOpenTry",Zn.MsgChannelOpenTry],["/ibc.core.channel.v1.MsgRecvPacket",Zn.MsgRecvPacket],["/ibc.core.channel.v1.MsgTimeout",Zn.MsgTimeout],["/ibc.core.channel.v1.MsgTimeoutOnClose",Zn.MsgTimeoutOnClose],["/ibc.core.client.v1.MsgCreateClient",qo.MsgCreateClient],["/ibc.core.client.v1.MsgSubmitMisbehaviour",qo.MsgSubmitMisbehaviour],["/ibc.core.client.v1.MsgUpdateClient",qo.MsgUpdateClient],["/ibc.core.client.v1.MsgUpgradeClient",qo.MsgUpgradeClient],["/ibc.core.connection.v1.MsgConnectionOpenAck",Ho.MsgConnectionOpenAck],["/ibc.core.connection.v1.MsgConnectionOpenConfirm",Ho.MsgConnectionOpenConfirm],["/ibc.core.connection.v1.MsgConnectionOpenInit",Ho.MsgConnectionOpenInit],["/ibc.core.connection.v1.MsgConnectionOpenTry",Ho.MsgConnectionOpenTry]];function yR(e){return e.typeUrl==="/ibc.applications.transfer.v1.MsgTransfer"}di.isMsgTransferEncodeObject=yR;var us={},wm={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.Params=At.DenomTrace=At.protobufPackage=void 0;const Vr=ee,pa=ne;At.protobufPackage="ibc.applications.transfer.v1";function Yd(){return{path:"",baseDenom:""}}At.DenomTrace={typeUrl:"/ibc.applications.transfer.v1.DenomTrace",encode(e,n=Vr.BinaryWriter.create()){return e.path!==""&&n.uint32(10).string(e.path),e.baseDenom!==""&&n.uint32(18).string(e.baseDenom),n},decode(e,n){const t=e instanceof Vr.BinaryReader?e:new Vr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Yd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.path=t.string();break;case 2:o.baseDenom=t.string();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Yd();return(0,pa.isSet)(e.path)&&(n.path=String(e.path)),(0,pa.isSet)(e.baseDenom)&&(n.baseDenom=String(e.baseDenom)),n},toJSON(e){const n={};return e.path!==void 0&&(n.path=e.path),e.baseDenom!==void 0&&(n.baseDenom=e.baseDenom),n},fromPartial(e){const n=Yd();return n.path=e.path??"",n.baseDenom=e.baseDenom??"",n}};function Zd(){return{sendEnabled:!1,receiveEnabled:!1}}At.Params={typeUrl:"/ibc.applications.transfer.v1.Params",encode(e,n=Vr.BinaryWriter.create()){return e.sendEnabled===!0&&n.uint32(8).bool(e.sendEnabled),e.receiveEnabled===!0&&n.uint32(16).bool(e.receiveEnabled),n},decode(e,n){const t=e instanceof Vr.BinaryReader?e:new Vr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Zd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.sendEnabled=t.bool();break;case 2:o.receiveEnabled=t.bool();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Zd();return(0,pa.isSet)(e.sendEnabled)&&(n.sendEnabled=!!e.sendEnabled),(0,pa.isSet)(e.receiveEnabled)&&(n.receiveEnabled=!!e.receiveEnabled),n},toJSON(e){const n={};return e.sendEnabled!==void 0&&(n.sendEnabled=e.sendEnabled),e.receiveEnabled!==void 0&&(n.receiveEnabled=e.receiveEnabled),n},fromPartial(e){const n=Zd();return n.sendEnabled=e.sendEnabled??!1,n.receiveEnabled=e.receiveEnabled??!1,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryEscrowAddressResponse=e.QueryEscrowAddressRequest=e.QueryDenomHashResponse=e.QueryDenomHashRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryDenomTracesResponse=e.QueryDenomTracesRequest=e.QueryDenomTraceResponse=e.QueryDenomTraceRequest=e.protobufPackage=void 0;const n=be,t=At,r=ee,o=ne;e.protobufPackage="ibc.applications.transfer.v1";function h(){return{hash:""}}e.QueryDenomTraceRequest={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTraceRequest",encode(s,y=r.BinaryWriter.create()){return s.hash!==""&&y.uint32(10).string(s.hash),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=h();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.hash=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=h();return(0,o.isSet)(s.hash)&&(y.hash=String(s.hash)),y},toJSON(s){const y={};return s.hash!==void 0&&(y.hash=s.hash),y},fromPartial(s){const y=h();return y.hash=s.hash??"",y}};function v(){return{denomTrace:void 0}}e.QueryDenomTraceResponse={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTraceResponse",encode(s,y=r.BinaryWriter.create()){return s.denomTrace!==void 0&&t.DenomTrace.encode(s.denomTrace,y.uint32(10).fork()).ldelim(),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=v();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.denomTrace=t.DenomTrace.decode(E,E.uint32());break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=v();return(0,o.isSet)(s.denomTrace)&&(y.denomTrace=t.DenomTrace.fromJSON(s.denomTrace)),y},toJSON(s){const y={};return s.denomTrace!==void 0&&(y.denomTrace=s.denomTrace?t.DenomTrace.toJSON(s.denomTrace):void 0),y},fromPartial(s){const y=v();return s.denomTrace!==void 0&&s.denomTrace!==null&&(y.denomTrace=t.DenomTrace.fromPartial(s.denomTrace)),y}};function C(){return{pagination:void 0}}e.QueryDenomTracesRequest={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTracesRequest",encode(s,y=r.BinaryWriter.create()){return s.pagination!==void 0&&n.PageRequest.encode(s.pagination,y.uint32(10).fork()).ldelim(),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=C();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.pagination=n.PageRequest.decode(E,E.uint32());break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=C();return(0,o.isSet)(s.pagination)&&(y.pagination=n.PageRequest.fromJSON(s.pagination)),y},toJSON(s){const y={};return s.pagination!==void 0&&(y.pagination=s.pagination?n.PageRequest.toJSON(s.pagination):void 0),y},fromPartial(s){const y=C();return s.pagination!==void 0&&s.pagination!==null&&(y.pagination=n.PageRequest.fromPartial(s.pagination)),y}};function w(){return{denomTraces:[],pagination:void 0}}e.QueryDenomTracesResponse={typeUrl:"/ibc.applications.transfer.v1.QueryDenomTracesResponse",encode(s,y=r.BinaryWriter.create()){for(const E of s.denomTraces)t.DenomTrace.encode(E,y.uint32(10).fork()).ldelim();return s.pagination!==void 0&&n.PageResponse.encode(s.pagination,y.uint32(18).fork()).ldelim(),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=w();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.denomTraces.push(t.DenomTrace.decode(E,E.uint32()));break;case 2:U.pagination=n.PageResponse.decode(E,E.uint32());break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=w();return Array.isArray(s==null?void 0:s.denomTraces)&&(y.denomTraces=s.denomTraces.map(E=>t.DenomTrace.fromJSON(E))),(0,o.isSet)(s.pagination)&&(y.pagination=n.PageResponse.fromJSON(s.pagination)),y},toJSON(s){const y={};return s.denomTraces?y.denomTraces=s.denomTraces.map(E=>E?t.DenomTrace.toJSON(E):void 0):y.denomTraces=[],s.pagination!==void 0&&(y.pagination=s.pagination?n.PageResponse.toJSON(s.pagination):void 0),y},fromPartial(s){var E;const y=w();return y.denomTraces=((E=s.denomTraces)==null?void 0:E.map(_=>t.DenomTrace.fromPartial(_)))||[],s.pagination!==void 0&&s.pagination!==null&&(y.pagination=n.PageResponse.fromPartial(s.pagination)),y}};function D(){return{}}e.QueryParamsRequest={typeUrl:"/ibc.applications.transfer.v1.QueryParamsRequest",encode(s,y=r.BinaryWriter.create()){return y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=D();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){default:E.skipType(H&7);break}}return U},fromJSON(s){return D()},toJSON(s){return{}},fromPartial(s){return D()}};function J(){return{params:void 0}}e.QueryParamsResponse={typeUrl:"/ibc.applications.transfer.v1.QueryParamsResponse",encode(s,y=r.BinaryWriter.create()){return s.params!==void 0&&t.Params.encode(s.params,y.uint32(10).fork()).ldelim(),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=J();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.params=t.Params.decode(E,E.uint32());break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=J();return(0,o.isSet)(s.params)&&(y.params=t.Params.fromJSON(s.params)),y},toJSON(s){const y={};return s.params!==void 0&&(y.params=s.params?t.Params.toJSON(s.params):void 0),y},fromPartial(s){const y=J();return s.params!==void 0&&s.params!==null&&(y.params=t.Params.fromPartial(s.params)),y}};function I(){return{trace:""}}e.QueryDenomHashRequest={typeUrl:"/ibc.applications.transfer.v1.QueryDenomHashRequest",encode(s,y=r.BinaryWriter.create()){return s.trace!==""&&y.uint32(10).string(s.trace),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=I();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.trace=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=I();return(0,o.isSet)(s.trace)&&(y.trace=String(s.trace)),y},toJSON(s){const y={};return s.trace!==void 0&&(y.trace=s.trace),y},fromPartial(s){const y=I();return y.trace=s.trace??"",y}};function g(){return{hash:""}}e.QueryDenomHashResponse={typeUrl:"/ibc.applications.transfer.v1.QueryDenomHashResponse",encode(s,y=r.BinaryWriter.create()){return s.hash!==""&&y.uint32(10).string(s.hash),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=g();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.hash=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=g();return(0,o.isSet)(s.hash)&&(y.hash=String(s.hash)),y},toJSON(s){const y={};return s.hash!==void 0&&(y.hash=s.hash),y},fromPartial(s){const y=g();return y.hash=s.hash??"",y}};function R(){return{portId:"",channelId:""}}e.QueryEscrowAddressRequest={typeUrl:"/ibc.applications.transfer.v1.QueryEscrowAddressRequest",encode(s,y=r.BinaryWriter.create()){return s.portId!==""&&y.uint32(10).string(s.portId),s.channelId!==""&&y.uint32(18).string(s.channelId),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=R();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.portId=E.string();break;case 2:U.channelId=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=R();return(0,o.isSet)(s.portId)&&(y.portId=String(s.portId)),(0,o.isSet)(s.channelId)&&(y.channelId=String(s.channelId)),y},toJSON(s){const y={};return s.portId!==void 0&&(y.portId=s.portId),s.channelId!==void 0&&(y.channelId=s.channelId),y},fromPartial(s){const y=R();return y.portId=s.portId??"",y.channelId=s.channelId??"",y}};function B(){return{escrowAddress:""}}e.QueryEscrowAddressResponse={typeUrl:"/ibc.applications.transfer.v1.QueryEscrowAddressResponse",encode(s,y=r.BinaryWriter.create()){return s.escrowAddress!==""&&y.uint32(10).string(s.escrowAddress),y},decode(s,y){const E=s instanceof r.BinaryReader?s:new r.BinaryReader(s);let _=y===void 0?E.len:E.pos+y;const U=B();for(;E.pos<_;){const H=E.uint32();switch(H>>>3){case 1:U.escrowAddress=E.string();break;default:E.skipType(H&7);break}}return U},fromJSON(s){const y=B();return(0,o.isSet)(s.escrowAddress)&&(y.escrowAddress=String(s.escrowAddress)),y},toJSON(s){const y={};return s.escrowAddress!==void 0&&(y.escrowAddress=s.escrowAddress),y},fromPartial(s){const y=B();return y.escrowAddress=s.escrowAddress??"",y}};class d{constructor(y){this.rpc=y,this.DenomTrace=this.DenomTrace.bind(this),this.DenomTraces=this.DenomTraces.bind(this),this.Params=this.Params.bind(this),this.DenomHash=this.DenomHash.bind(this),this.EscrowAddress=this.EscrowAddress.bind(this)}DenomTrace(y){const E=e.QueryDenomTraceRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","DenomTrace",E).then(U=>e.QueryDenomTraceResponse.decode(new r.BinaryReader(U)))}DenomTraces(y={pagination:n.PageRequest.fromPartial({})}){const E=e.QueryDenomTracesRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","DenomTraces",E).then(U=>e.QueryDenomTracesResponse.decode(new r.BinaryReader(U)))}Params(y={}){const E=e.QueryParamsRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","Params",E).then(U=>e.QueryParamsResponse.decode(new r.BinaryReader(U)))}DenomHash(y){const E=e.QueryDenomHashRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","DenomHash",E).then(U=>e.QueryDenomHashResponse.decode(new r.BinaryReader(U)))}EscrowAddress(y){const E=e.QueryEscrowAddressRequest.encode(y).finish();return this.rpc.request("ibc.applications.transfer.v1.Query","EscrowAddress",E).then(U=>e.QueryEscrowAddressResponse.decode(new r.BinaryReader(U)))}}e.QueryClientImpl=d})(wm);var Em={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryNextSequenceReceiveResponse=e.QueryNextSequenceReceiveRequest=e.QueryUnreceivedAcksResponse=e.QueryUnreceivedAcksRequest=e.QueryUnreceivedPacketsResponse=e.QueryUnreceivedPacketsRequest=e.QueryPacketAcknowledgementsResponse=e.QueryPacketAcknowledgementsRequest=e.QueryPacketAcknowledgementResponse=e.QueryPacketAcknowledgementRequest=e.QueryPacketReceiptResponse=e.QueryPacketReceiptRequest=e.QueryPacketCommitmentsResponse=e.QueryPacketCommitmentsRequest=e.QueryPacketCommitmentResponse=e.QueryPacketCommitmentRequest=e.QueryChannelConsensusStateResponse=e.QueryChannelConsensusStateRequest=e.QueryChannelClientStateResponse=e.QueryChannelClientStateRequest=e.QueryConnectionChannelsResponse=e.QueryConnectionChannelsRequest=e.QueryChannelsResponse=e.QueryChannelsRequest=e.QueryChannelResponse=e.QueryChannelRequest=e.protobufPackage=void 0;const n=be,t=ds,r=sr,o=Re,h=ee,v=ne;e.protobufPackage="ibc.core.channel.v1";function C(){return{portId:"",channelId:""}}e.QueryChannelRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=C();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=C();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),k},fromPartial(a){const k=C();return k.portId=a.portId??"",k.channelId=a.channelId??"",k}};function w(){return{channel:void 0,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryChannelResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelResponse",encode(a,k=h.BinaryWriter.create()){return a.channel!==void 0&&t.Channel.encode(a.channel,k.uint32(10).fork()).ldelim(),a.proof.length!==0&&k.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=w();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.channel=t.Channel.decode(S,S.uint32());break;case 2:O.proof=S.bytes();break;case 3:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=w();return(0,v.isSet)(a.channel)&&(k.channel=t.Channel.fromJSON(a.channel)),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.channel!==void 0&&(k.channel=a.channel?t.Channel.toJSON(a.channel):void 0),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=w();return a.channel!==void 0&&a.channel!==null&&(k.channel=t.Channel.fromPartial(a.channel)),k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};function D(){return{pagination:void 0}}e.QueryChannelsRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelsRequest",encode(a,k=h.BinaryWriter.create()){return a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=D();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=D();return(0,v.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=D();return a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function J(){return{channels:[],pagination:void 0,height:r.Height.fromPartial({})}}e.QueryChannelsResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelsResponse",encode(a,k=h.BinaryWriter.create()){for(const S of a.channels)t.IdentifiedChannel.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),a.height!==void 0&&r.Height.encode(a.height,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=J();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.channels.push(t.IdentifiedChannel.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;case 3:O.height=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=J();return Array.isArray(a==null?void 0:a.channels)&&(k.channels=a.channels.map(S=>t.IdentifiedChannel.fromJSON(S))),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),(0,v.isSet)(a.height)&&(k.height=r.Height.fromJSON(a.height)),k},toJSON(a){const k={};return a.channels?k.channels=a.channels.map(S=>S?t.IdentifiedChannel.toJSON(S):void 0):k.channels=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(k.height=a.height?r.Height.toJSON(a.height):void 0),k},fromPartial(a){var S;const k=J();return k.channels=((S=a.channels)==null?void 0:S.map(P=>t.IdentifiedChannel.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(k.height=r.Height.fromPartial(a.height)),k}};function I(){return{connection:"",pagination:void 0}}e.QueryConnectionChannelsRequest={typeUrl:"/ibc.core.channel.v1.QueryConnectionChannelsRequest",encode(a,k=h.BinaryWriter.create()){return a.connection!==""&&k.uint32(10).string(a.connection),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=I();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.connection=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=I();return(0,v.isSet)(a.connection)&&(k.connection=String(a.connection)),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.connection!==void 0&&(k.connection=a.connection),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=I();return k.connection=a.connection??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function g(){return{channels:[],pagination:void 0,height:r.Height.fromPartial({})}}e.QueryConnectionChannelsResponse={typeUrl:"/ibc.core.channel.v1.QueryConnectionChannelsResponse",encode(a,k=h.BinaryWriter.create()){for(const S of a.channels)t.IdentifiedChannel.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),a.height!==void 0&&r.Height.encode(a.height,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=g();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.channels.push(t.IdentifiedChannel.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;case 3:O.height=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=g();return Array.isArray(a==null?void 0:a.channels)&&(k.channels=a.channels.map(S=>t.IdentifiedChannel.fromJSON(S))),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),(0,v.isSet)(a.height)&&(k.height=r.Height.fromJSON(a.height)),k},toJSON(a){const k={};return a.channels?k.channels=a.channels.map(S=>S?t.IdentifiedChannel.toJSON(S):void 0):k.channels=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(k.height=a.height?r.Height.toJSON(a.height):void 0),k},fromPartial(a){var S;const k=g();return k.channels=((S=a.channels)==null?void 0:S.map(P=>t.IdentifiedChannel.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(k.height=r.Height.fromPartial(a.height)),k}};function R(){return{portId:"",channelId:""}}e.QueryChannelClientStateRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelClientStateRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=R();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=R();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),k},fromPartial(a){const k=R();return k.portId=a.portId??"",k.channelId=a.channelId??"",k}};function B(){return{identifiedClientState:void 0,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryChannelClientStateResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelClientStateResponse",encode(a,k=h.BinaryWriter.create()){return a.identifiedClientState!==void 0&&r.IdentifiedClientState.encode(a.identifiedClientState,k.uint32(10).fork()).ldelim(),a.proof.length!==0&&k.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=B();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.identifiedClientState=r.IdentifiedClientState.decode(S,S.uint32());break;case 2:O.proof=S.bytes();break;case 3:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=B();return(0,v.isSet)(a.identifiedClientState)&&(k.identifiedClientState=r.IdentifiedClientState.fromJSON(a.identifiedClientState)),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.identifiedClientState!==void 0&&(k.identifiedClientState=a.identifiedClientState?r.IdentifiedClientState.toJSON(a.identifiedClientState):void 0),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=B();return a.identifiedClientState!==void 0&&a.identifiedClientState!==null&&(k.identifiedClientState=r.IdentifiedClientState.fromPartial(a.identifiedClientState)),k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};function d(){return{portId:"",channelId:"",revisionNumber:BigInt(0),revisionHeight:BigInt(0)}}e.QueryChannelConsensusStateRequest={typeUrl:"/ibc.core.channel.v1.QueryChannelConsensusStateRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),a.revisionNumber!==BigInt(0)&&k.uint32(24).uint64(a.revisionNumber),a.revisionHeight!==BigInt(0)&&k.uint32(32).uint64(a.revisionHeight),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=d();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:O.revisionNumber=S.uint64();break;case 4:O.revisionHeight=S.uint64();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=d();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),(0,v.isSet)(a.revisionNumber)&&(k.revisionNumber=BigInt(a.revisionNumber.toString())),(0,v.isSet)(a.revisionHeight)&&(k.revisionHeight=BigInt(a.revisionHeight.toString())),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.revisionNumber!==void 0&&(k.revisionNumber=(a.revisionNumber||BigInt(0)).toString()),a.revisionHeight!==void 0&&(k.revisionHeight=(a.revisionHeight||BigInt(0)).toString()),k},fromPartial(a){const k=d();return k.portId=a.portId??"",k.channelId=a.channelId??"",a.revisionNumber!==void 0&&a.revisionNumber!==null&&(k.revisionNumber=BigInt(a.revisionNumber.toString())),a.revisionHeight!==void 0&&a.revisionHeight!==null&&(k.revisionHeight=BigInt(a.revisionHeight.toString())),k}};function s(){return{consensusState:void 0,clientId:"",proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryChannelConsensusStateResponse={typeUrl:"/ibc.core.channel.v1.QueryChannelConsensusStateResponse",encode(a,k=h.BinaryWriter.create()){return a.consensusState!==void 0&&o.Any.encode(a.consensusState,k.uint32(10).fork()).ldelim(),a.clientId!==""&&k.uint32(18).string(a.clientId),a.proof.length!==0&&k.uint32(26).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(34).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=s();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.consensusState=o.Any.decode(S,S.uint32());break;case 2:O.clientId=S.string();break;case 3:O.proof=S.bytes();break;case 4:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=s();return(0,v.isSet)(a.consensusState)&&(k.consensusState=o.Any.fromJSON(a.consensusState)),(0,v.isSet)(a.clientId)&&(k.clientId=String(a.clientId)),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.consensusState!==void 0&&(k.consensusState=a.consensusState?o.Any.toJSON(a.consensusState):void 0),a.clientId!==void 0&&(k.clientId=a.clientId),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=s();return a.consensusState!==void 0&&a.consensusState!==null&&(k.consensusState=o.Any.fromPartial(a.consensusState)),k.clientId=a.clientId??"",k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};function y(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.QueryPacketCommitmentRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),a.sequence!==BigInt(0)&&k.uint32(24).uint64(a.sequence),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=y();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:O.sequence=S.uint64();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=y();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),(0,v.isSet)(a.sequence)&&(k.sequence=BigInt(a.sequence.toString())),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.sequence!==void 0&&(k.sequence=(a.sequence||BigInt(0)).toString()),k},fromPartial(a){const k=y();return k.portId=a.portId??"",k.channelId=a.channelId??"",a.sequence!==void 0&&a.sequence!==null&&(k.sequence=BigInt(a.sequence.toString())),k}};function E(){return{commitment:new Uint8Array,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryPacketCommitmentResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentResponse",encode(a,k=h.BinaryWriter.create()){return a.commitment.length!==0&&k.uint32(10).bytes(a.commitment),a.proof.length!==0&&k.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=E();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.commitment=S.bytes();break;case 2:O.proof=S.bytes();break;case 3:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=E();return(0,v.isSet)(a.commitment)&&(k.commitment=(0,v.bytesFromBase64)(a.commitment)),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.commitment!==void 0&&(k.commitment=(0,v.base64FromBytes)(a.commitment!==void 0?a.commitment:new Uint8Array)),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=E();return k.commitment=a.commitment??new Uint8Array,k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};function _(){return{portId:"",channelId:"",pagination:void 0}}e.QueryPacketCommitmentsRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentsRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=_();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=_();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=_();return k.portId=a.portId??"",k.channelId=a.channelId??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function U(){return{commitments:[],pagination:void 0,height:r.Height.fromPartial({})}}e.QueryPacketCommitmentsResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketCommitmentsResponse",encode(a,k=h.BinaryWriter.create()){for(const S of a.commitments)t.PacketState.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),a.height!==void 0&&r.Height.encode(a.height,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=U();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.commitments.push(t.PacketState.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;case 3:O.height=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=U();return Array.isArray(a==null?void 0:a.commitments)&&(k.commitments=a.commitments.map(S=>t.PacketState.fromJSON(S))),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),(0,v.isSet)(a.height)&&(k.height=r.Height.fromJSON(a.height)),k},toJSON(a){const k={};return a.commitments?k.commitments=a.commitments.map(S=>S?t.PacketState.toJSON(S):void 0):k.commitments=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(k.height=a.height?r.Height.toJSON(a.height):void 0),k},fromPartial(a){var S;const k=U();return k.commitments=((S=a.commitments)==null?void 0:S.map(P=>t.PacketState.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(k.height=r.Height.fromPartial(a.height)),k}};function H(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.QueryPacketReceiptRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketReceiptRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),a.sequence!==BigInt(0)&&k.uint32(24).uint64(a.sequence),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=H();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:O.sequence=S.uint64();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=H();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),(0,v.isSet)(a.sequence)&&(k.sequence=BigInt(a.sequence.toString())),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.sequence!==void 0&&(k.sequence=(a.sequence||BigInt(0)).toString()),k},fromPartial(a){const k=H();return k.portId=a.portId??"",k.channelId=a.channelId??"",a.sequence!==void 0&&a.sequence!==null&&(k.sequence=BigInt(a.sequence.toString())),k}};function i(){return{received:!1,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryPacketReceiptResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketReceiptResponse",encode(a,k=h.BinaryWriter.create()){return a.received===!0&&k.uint32(16).bool(a.received),a.proof.length!==0&&k.uint32(26).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(34).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=i();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 2:O.received=S.bool();break;case 3:O.proof=S.bytes();break;case 4:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=i();return(0,v.isSet)(a.received)&&(k.received=!!a.received),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.received!==void 0&&(k.received=a.received),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=i();return k.received=a.received??!1,k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};function m(){return{portId:"",channelId:"",sequence:BigInt(0)}}e.QueryPacketAcknowledgementRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),a.sequence!==BigInt(0)&&k.uint32(24).uint64(a.sequence),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=m();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:O.sequence=S.uint64();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=m();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),(0,v.isSet)(a.sequence)&&(k.sequence=BigInt(a.sequence.toString())),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.sequence!==void 0&&(k.sequence=(a.sequence||BigInt(0)).toString()),k},fromPartial(a){const k=m();return k.portId=a.portId??"",k.channelId=a.channelId??"",a.sequence!==void 0&&a.sequence!==null&&(k.sequence=BigInt(a.sequence.toString())),k}};function N(){return{acknowledgement:new Uint8Array,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryPacketAcknowledgementResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementResponse",encode(a,k=h.BinaryWriter.create()){return a.acknowledgement.length!==0&&k.uint32(10).bytes(a.acknowledgement),a.proof.length!==0&&k.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=N();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.acknowledgement=S.bytes();break;case 2:O.proof=S.bytes();break;case 3:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=N();return(0,v.isSet)(a.acknowledgement)&&(k.acknowledgement=(0,v.bytesFromBase64)(a.acknowledgement)),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.acknowledgement!==void 0&&(k.acknowledgement=(0,v.base64FromBytes)(a.acknowledgement!==void 0?a.acknowledgement:new Uint8Array)),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=N();return k.acknowledgement=a.acknowledgement??new Uint8Array,k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};function V(){return{portId:"",channelId:"",pagination:void 0,packetCommitmentSequences:[]}}e.QueryPacketAcknowledgementsRequest={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementsRequest",encode(a,k=h.BinaryWriter.create()){a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(26).fork()).ldelim(),k.uint32(34).fork();for(const S of a.packetCommitmentSequences)k.uint64(S);return k.ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=V();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:O.pagination=n.PageRequest.decode(S,S.uint32());break;case 4:if((W&7)===2){const L=S.uint32()+S.pos;for(;S.pos<L;)O.packetCommitmentSequences.push(S.uint64())}else O.packetCommitmentSequences.push(S.uint64());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=V();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),Array.isArray(a==null?void 0:a.packetCommitmentSequences)&&(k.packetCommitmentSequences=a.packetCommitmentSequences.map(S=>BigInt(S.toString()))),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),a.packetCommitmentSequences?k.packetCommitmentSequences=a.packetCommitmentSequences.map(S=>(S||BigInt(0)).toString()):k.packetCommitmentSequences=[],k},fromPartial(a){var S;const k=V();return k.portId=a.portId??"",k.channelId=a.channelId??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k.packetCommitmentSequences=((S=a.packetCommitmentSequences)==null?void 0:S.map(P=>BigInt(P.toString())))||[],k}};function u(){return{acknowledgements:[],pagination:void 0,height:r.Height.fromPartial({})}}e.QueryPacketAcknowledgementsResponse={typeUrl:"/ibc.core.channel.v1.QueryPacketAcknowledgementsResponse",encode(a,k=h.BinaryWriter.create()){for(const S of a.acknowledgements)t.PacketState.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),a.height!==void 0&&r.Height.encode(a.height,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=u();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.acknowledgements.push(t.PacketState.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;case 3:O.height=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=u();return Array.isArray(a==null?void 0:a.acknowledgements)&&(k.acknowledgements=a.acknowledgements.map(S=>t.PacketState.fromJSON(S))),(0,v.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),(0,v.isSet)(a.height)&&(k.height=r.Height.fromJSON(a.height)),k},toJSON(a){const k={};return a.acknowledgements?k.acknowledgements=a.acknowledgements.map(S=>S?t.PacketState.toJSON(S):void 0):k.acknowledgements=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),a.height!==void 0&&(k.height=a.height?r.Height.toJSON(a.height):void 0),k},fromPartial(a){var S;const k=u();return k.acknowledgements=((S=a.acknowledgements)==null?void 0:S.map(P=>t.PacketState.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),a.height!==void 0&&a.height!==null&&(k.height=r.Height.fromPartial(a.height)),k}};function l(){return{portId:"",channelId:"",packetCommitmentSequences:[]}}e.QueryUnreceivedPacketsRequest={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedPacketsRequest",encode(a,k=h.BinaryWriter.create()){a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),k.uint32(26).fork();for(const S of a.packetCommitmentSequences)k.uint64(S);return k.ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=l();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:if((W&7)===2){const L=S.uint32()+S.pos;for(;S.pos<L;)O.packetCommitmentSequences.push(S.uint64())}else O.packetCommitmentSequences.push(S.uint64());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=l();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),Array.isArray(a==null?void 0:a.packetCommitmentSequences)&&(k.packetCommitmentSequences=a.packetCommitmentSequences.map(S=>BigInt(S.toString()))),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.packetCommitmentSequences?k.packetCommitmentSequences=a.packetCommitmentSequences.map(S=>(S||BigInt(0)).toString()):k.packetCommitmentSequences=[],k},fromPartial(a){var S;const k=l();return k.portId=a.portId??"",k.channelId=a.channelId??"",k.packetCommitmentSequences=((S=a.packetCommitmentSequences)==null?void 0:S.map(P=>BigInt(P.toString())))||[],k}};function T(){return{sequences:[],height:r.Height.fromPartial({})}}e.QueryUnreceivedPacketsResponse={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedPacketsResponse",encode(a,k=h.BinaryWriter.create()){k.uint32(10).fork();for(const S of a.sequences)k.uint64(S);return k.ldelim(),a.height!==void 0&&r.Height.encode(a.height,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=T();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:if((W&7)===2){const L=S.uint32()+S.pos;for(;S.pos<L;)O.sequences.push(S.uint64())}else O.sequences.push(S.uint64());break;case 2:O.height=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=T();return Array.isArray(a==null?void 0:a.sequences)&&(k.sequences=a.sequences.map(S=>BigInt(S.toString()))),(0,v.isSet)(a.height)&&(k.height=r.Height.fromJSON(a.height)),k},toJSON(a){const k={};return a.sequences?k.sequences=a.sequences.map(S=>(S||BigInt(0)).toString()):k.sequences=[],a.height!==void 0&&(k.height=a.height?r.Height.toJSON(a.height):void 0),k},fromPartial(a){var S;const k=T();return k.sequences=((S=a.sequences)==null?void 0:S.map(P=>BigInt(P.toString())))||[],a.height!==void 0&&a.height!==null&&(k.height=r.Height.fromPartial(a.height)),k}};function f(){return{portId:"",channelId:"",packetAckSequences:[]}}e.QueryUnreceivedAcksRequest={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedAcksRequest",encode(a,k=h.BinaryWriter.create()){a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),k.uint32(26).fork();for(const S of a.packetAckSequences)k.uint64(S);return k.ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=f();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;case 3:if((W&7)===2){const L=S.uint32()+S.pos;for(;S.pos<L;)O.packetAckSequences.push(S.uint64())}else O.packetAckSequences.push(S.uint64());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=f();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),Array.isArray(a==null?void 0:a.packetAckSequences)&&(k.packetAckSequences=a.packetAckSequences.map(S=>BigInt(S.toString()))),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),a.packetAckSequences?k.packetAckSequences=a.packetAckSequences.map(S=>(S||BigInt(0)).toString()):k.packetAckSequences=[],k},fromPartial(a){var S;const k=f();return k.portId=a.portId??"",k.channelId=a.channelId??"",k.packetAckSequences=((S=a.packetAckSequences)==null?void 0:S.map(P=>BigInt(P.toString())))||[],k}};function p(){return{sequences:[],height:r.Height.fromPartial({})}}e.QueryUnreceivedAcksResponse={typeUrl:"/ibc.core.channel.v1.QueryUnreceivedAcksResponse",encode(a,k=h.BinaryWriter.create()){k.uint32(10).fork();for(const S of a.sequences)k.uint64(S);return k.ldelim(),a.height!==void 0&&r.Height.encode(a.height,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=p();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:if((W&7)===2){const L=S.uint32()+S.pos;for(;S.pos<L;)O.sequences.push(S.uint64())}else O.sequences.push(S.uint64());break;case 2:O.height=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=p();return Array.isArray(a==null?void 0:a.sequences)&&(k.sequences=a.sequences.map(S=>BigInt(S.toString()))),(0,v.isSet)(a.height)&&(k.height=r.Height.fromJSON(a.height)),k},toJSON(a){const k={};return a.sequences?k.sequences=a.sequences.map(S=>(S||BigInt(0)).toString()):k.sequences=[],a.height!==void 0&&(k.height=a.height?r.Height.toJSON(a.height):void 0),k},fromPartial(a){var S;const k=p();return k.sequences=((S=a.sequences)==null?void 0:S.map(P=>BigInt(P.toString())))||[],a.height!==void 0&&a.height!==null&&(k.height=r.Height.fromPartial(a.height)),k}};function A(){return{portId:"",channelId:""}}e.QueryNextSequenceReceiveRequest={typeUrl:"/ibc.core.channel.v1.QueryNextSequenceReceiveRequest",encode(a,k=h.BinaryWriter.create()){return a.portId!==""&&k.uint32(10).string(a.portId),a.channelId!==""&&k.uint32(18).string(a.channelId),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=A();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.portId=S.string();break;case 2:O.channelId=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=A();return(0,v.isSet)(a.portId)&&(k.portId=String(a.portId)),(0,v.isSet)(a.channelId)&&(k.channelId=String(a.channelId)),k},toJSON(a){const k={};return a.portId!==void 0&&(k.portId=a.portId),a.channelId!==void 0&&(k.channelId=a.channelId),k},fromPartial(a){const k=A();return k.portId=a.portId??"",k.channelId=a.channelId??"",k}};function Q(){return{nextSequenceReceive:BigInt(0),proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryNextSequenceReceiveResponse={typeUrl:"/ibc.core.channel.v1.QueryNextSequenceReceiveResponse",encode(a,k=h.BinaryWriter.create()){return a.nextSequenceReceive!==BigInt(0)&&k.uint32(8).uint64(a.nextSequenceReceive),a.proof.length!==0&&k.uint32(18).bytes(a.proof),a.proofHeight!==void 0&&r.Height.encode(a.proofHeight,k.uint32(26).fork()).ldelim(),k},decode(a,k){const S=a instanceof h.BinaryReader?a:new h.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=Q();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.nextSequenceReceive=S.uint64();break;case 2:O.proof=S.bytes();break;case 3:O.proofHeight=r.Height.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=Q();return(0,v.isSet)(a.nextSequenceReceive)&&(k.nextSequenceReceive=BigInt(a.nextSequenceReceive.toString())),(0,v.isSet)(a.proof)&&(k.proof=(0,v.bytesFromBase64)(a.proof)),(0,v.isSet)(a.proofHeight)&&(k.proofHeight=r.Height.fromJSON(a.proofHeight)),k},toJSON(a){const k={};return a.nextSequenceReceive!==void 0&&(k.nextSequenceReceive=(a.nextSequenceReceive||BigInt(0)).toString()),a.proof!==void 0&&(k.proof=(0,v.base64FromBytes)(a.proof!==void 0?a.proof:new Uint8Array)),a.proofHeight!==void 0&&(k.proofHeight=a.proofHeight?r.Height.toJSON(a.proofHeight):void 0),k},fromPartial(a){const k=Q();return a.nextSequenceReceive!==void 0&&a.nextSequenceReceive!==null&&(k.nextSequenceReceive=BigInt(a.nextSequenceReceive.toString())),k.proof=a.proof??new Uint8Array,a.proofHeight!==void 0&&a.proofHeight!==null&&(k.proofHeight=r.Height.fromPartial(a.proofHeight)),k}};class M{constructor(k){this.rpc=k,this.Channel=this.Channel.bind(this),this.Channels=this.Channels.bind(this),this.ConnectionChannels=this.ConnectionChannels.bind(this),this.ChannelClientState=this.ChannelClientState.bind(this),this.ChannelConsensusState=this.ChannelConsensusState.bind(this),this.PacketCommitment=this.PacketCommitment.bind(this),this.PacketCommitments=this.PacketCommitments.bind(this),this.PacketReceipt=this.PacketReceipt.bind(this),this.PacketAcknowledgement=this.PacketAcknowledgement.bind(this),this.PacketAcknowledgements=this.PacketAcknowledgements.bind(this),this.UnreceivedPackets=this.UnreceivedPackets.bind(this),this.UnreceivedAcks=this.UnreceivedAcks.bind(this),this.NextSequenceReceive=this.NextSequenceReceive.bind(this)}Channel(k){const S=e.QueryChannelRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","Channel",S).then(O=>e.QueryChannelResponse.decode(new h.BinaryReader(O)))}Channels(k={pagination:n.PageRequest.fromPartial({})}){const S=e.QueryChannelsRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","Channels",S).then(O=>e.QueryChannelsResponse.decode(new h.BinaryReader(O)))}ConnectionChannels(k){const S=e.QueryConnectionChannelsRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","ConnectionChannels",S).then(O=>e.QueryConnectionChannelsResponse.decode(new h.BinaryReader(O)))}ChannelClientState(k){const S=e.QueryChannelClientStateRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","ChannelClientState",S).then(O=>e.QueryChannelClientStateResponse.decode(new h.BinaryReader(O)))}ChannelConsensusState(k){const S=e.QueryChannelConsensusStateRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","ChannelConsensusState",S).then(O=>e.QueryChannelConsensusStateResponse.decode(new h.BinaryReader(O)))}PacketCommitment(k){const S=e.QueryPacketCommitmentRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketCommitment",S).then(O=>e.QueryPacketCommitmentResponse.decode(new h.BinaryReader(O)))}PacketCommitments(k){const S=e.QueryPacketCommitmentsRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketCommitments",S).then(O=>e.QueryPacketCommitmentsResponse.decode(new h.BinaryReader(O)))}PacketReceipt(k){const S=e.QueryPacketReceiptRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketReceipt",S).then(O=>e.QueryPacketReceiptResponse.decode(new h.BinaryReader(O)))}PacketAcknowledgement(k){const S=e.QueryPacketAcknowledgementRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketAcknowledgement",S).then(O=>e.QueryPacketAcknowledgementResponse.decode(new h.BinaryReader(O)))}PacketAcknowledgements(k){const S=e.QueryPacketAcknowledgementsRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","PacketAcknowledgements",S).then(O=>e.QueryPacketAcknowledgementsResponse.decode(new h.BinaryReader(O)))}UnreceivedPackets(k){const S=e.QueryUnreceivedPacketsRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","UnreceivedPackets",S).then(O=>e.QueryUnreceivedPacketsResponse.decode(new h.BinaryReader(O)))}UnreceivedAcks(k){const S=e.QueryUnreceivedAcksRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","UnreceivedAcks",S).then(O=>e.QueryUnreceivedAcksResponse.decode(new h.BinaryReader(O)))}NextSequenceReceive(k){const S=e.QueryNextSequenceReceiveRequest.encode(k).finish();return this.rpc.request("ibc.core.channel.v1.Query","NextSequenceReceive",S).then(O=>e.QueryNextSequenceReceiveResponse.decode(new h.BinaryReader(O)))}}e.QueryClientImpl=M})(Em);var _m={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryUpgradedConsensusStateResponse=e.QueryUpgradedConsensusStateRequest=e.QueryUpgradedClientStateResponse=e.QueryUpgradedClientStateRequest=e.QueryClientParamsResponse=e.QueryClientParamsRequest=e.QueryClientStatusResponse=e.QueryClientStatusRequest=e.QueryConsensusStateHeightsResponse=e.QueryConsensusStateHeightsRequest=e.QueryConsensusStatesResponse=e.QueryConsensusStatesRequest=e.QueryConsensusStateResponse=e.QueryConsensusStateRequest=e.QueryClientStatesResponse=e.QueryClientStatesRequest=e.QueryClientStateResponse=e.QueryClientStateRequest=e.protobufPackage=void 0;const n=be,t=Re,r=sr,o=ee,h=ne;e.protobufPackage="ibc.core.client.v1";function v(){return{clientId:""}}e.QueryClientStateRequest={typeUrl:"/ibc.core.client.v1.QueryClientStateRequest",encode(V,u=o.BinaryWriter.create()){return V.clientId!==""&&u.uint32(10).string(V.clientId),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=v();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientId=l.string();break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=v();return(0,h.isSet)(V.clientId)&&(u.clientId=String(V.clientId)),u},toJSON(V){const u={};return V.clientId!==void 0&&(u.clientId=V.clientId),u},fromPartial(V){const u=v();return u.clientId=V.clientId??"",u}};function C(){return{clientState:void 0,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryClientStateResponse={typeUrl:"/ibc.core.client.v1.QueryClientStateResponse",encode(V,u=o.BinaryWriter.create()){return V.clientState!==void 0&&t.Any.encode(V.clientState,u.uint32(10).fork()).ldelim(),V.proof.length!==0&&u.uint32(18).bytes(V.proof),V.proofHeight!==void 0&&r.Height.encode(V.proofHeight,u.uint32(26).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=C();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientState=t.Any.decode(l,l.uint32());break;case 2:f.proof=l.bytes();break;case 3:f.proofHeight=r.Height.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=C();return(0,h.isSet)(V.clientState)&&(u.clientState=t.Any.fromJSON(V.clientState)),(0,h.isSet)(V.proof)&&(u.proof=(0,h.bytesFromBase64)(V.proof)),(0,h.isSet)(V.proofHeight)&&(u.proofHeight=r.Height.fromJSON(V.proofHeight)),u},toJSON(V){const u={};return V.clientState!==void 0&&(u.clientState=V.clientState?t.Any.toJSON(V.clientState):void 0),V.proof!==void 0&&(u.proof=(0,h.base64FromBytes)(V.proof!==void 0?V.proof:new Uint8Array)),V.proofHeight!==void 0&&(u.proofHeight=V.proofHeight?r.Height.toJSON(V.proofHeight):void 0),u},fromPartial(V){const u=C();return V.clientState!==void 0&&V.clientState!==null&&(u.clientState=t.Any.fromPartial(V.clientState)),u.proof=V.proof??new Uint8Array,V.proofHeight!==void 0&&V.proofHeight!==null&&(u.proofHeight=r.Height.fromPartial(V.proofHeight)),u}};function w(){return{pagination:void 0}}e.QueryClientStatesRequest={typeUrl:"/ibc.core.client.v1.QueryClientStatesRequest",encode(V,u=o.BinaryWriter.create()){return V.pagination!==void 0&&n.PageRequest.encode(V.pagination,u.uint32(10).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=w();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.pagination=n.PageRequest.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=w();return(0,h.isSet)(V.pagination)&&(u.pagination=n.PageRequest.fromJSON(V.pagination)),u},toJSON(V){const u={};return V.pagination!==void 0&&(u.pagination=V.pagination?n.PageRequest.toJSON(V.pagination):void 0),u},fromPartial(V){const u=w();return V.pagination!==void 0&&V.pagination!==null&&(u.pagination=n.PageRequest.fromPartial(V.pagination)),u}};function D(){return{clientStates:[],pagination:void 0}}e.QueryClientStatesResponse={typeUrl:"/ibc.core.client.v1.QueryClientStatesResponse",encode(V,u=o.BinaryWriter.create()){for(const l of V.clientStates)r.IdentifiedClientState.encode(l,u.uint32(10).fork()).ldelim();return V.pagination!==void 0&&n.PageResponse.encode(V.pagination,u.uint32(18).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=D();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientStates.push(r.IdentifiedClientState.decode(l,l.uint32()));break;case 2:f.pagination=n.PageResponse.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=D();return Array.isArray(V==null?void 0:V.clientStates)&&(u.clientStates=V.clientStates.map(l=>r.IdentifiedClientState.fromJSON(l))),(0,h.isSet)(V.pagination)&&(u.pagination=n.PageResponse.fromJSON(V.pagination)),u},toJSON(V){const u={};return V.clientStates?u.clientStates=V.clientStates.map(l=>l?r.IdentifiedClientState.toJSON(l):void 0):u.clientStates=[],V.pagination!==void 0&&(u.pagination=V.pagination?n.PageResponse.toJSON(V.pagination):void 0),u},fromPartial(V){var l;const u=D();return u.clientStates=((l=V.clientStates)==null?void 0:l.map(T=>r.IdentifiedClientState.fromPartial(T)))||[],V.pagination!==void 0&&V.pagination!==null&&(u.pagination=n.PageResponse.fromPartial(V.pagination)),u}};function J(){return{clientId:"",revisionNumber:BigInt(0),revisionHeight:BigInt(0),latestHeight:!1}}e.QueryConsensusStateRequest={typeUrl:"/ibc.core.client.v1.QueryConsensusStateRequest",encode(V,u=o.BinaryWriter.create()){return V.clientId!==""&&u.uint32(10).string(V.clientId),V.revisionNumber!==BigInt(0)&&u.uint32(16).uint64(V.revisionNumber),V.revisionHeight!==BigInt(0)&&u.uint32(24).uint64(V.revisionHeight),V.latestHeight===!0&&u.uint32(32).bool(V.latestHeight),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=J();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientId=l.string();break;case 2:f.revisionNumber=l.uint64();break;case 3:f.revisionHeight=l.uint64();break;case 4:f.latestHeight=l.bool();break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=J();return(0,h.isSet)(V.clientId)&&(u.clientId=String(V.clientId)),(0,h.isSet)(V.revisionNumber)&&(u.revisionNumber=BigInt(V.revisionNumber.toString())),(0,h.isSet)(V.revisionHeight)&&(u.revisionHeight=BigInt(V.revisionHeight.toString())),(0,h.isSet)(V.latestHeight)&&(u.latestHeight=!!V.latestHeight),u},toJSON(V){const u={};return V.clientId!==void 0&&(u.clientId=V.clientId),V.revisionNumber!==void 0&&(u.revisionNumber=(V.revisionNumber||BigInt(0)).toString()),V.revisionHeight!==void 0&&(u.revisionHeight=(V.revisionHeight||BigInt(0)).toString()),V.latestHeight!==void 0&&(u.latestHeight=V.latestHeight),u},fromPartial(V){const u=J();return u.clientId=V.clientId??"",V.revisionNumber!==void 0&&V.revisionNumber!==null&&(u.revisionNumber=BigInt(V.revisionNumber.toString())),V.revisionHeight!==void 0&&V.revisionHeight!==null&&(u.revisionHeight=BigInt(V.revisionHeight.toString())),u.latestHeight=V.latestHeight??!1,u}};function I(){return{consensusState:void 0,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryConsensusStateResponse={typeUrl:"/ibc.core.client.v1.QueryConsensusStateResponse",encode(V,u=o.BinaryWriter.create()){return V.consensusState!==void 0&&t.Any.encode(V.consensusState,u.uint32(10).fork()).ldelim(),V.proof.length!==0&&u.uint32(18).bytes(V.proof),V.proofHeight!==void 0&&r.Height.encode(V.proofHeight,u.uint32(26).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=I();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.consensusState=t.Any.decode(l,l.uint32());break;case 2:f.proof=l.bytes();break;case 3:f.proofHeight=r.Height.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=I();return(0,h.isSet)(V.consensusState)&&(u.consensusState=t.Any.fromJSON(V.consensusState)),(0,h.isSet)(V.proof)&&(u.proof=(0,h.bytesFromBase64)(V.proof)),(0,h.isSet)(V.proofHeight)&&(u.proofHeight=r.Height.fromJSON(V.proofHeight)),u},toJSON(V){const u={};return V.consensusState!==void 0&&(u.consensusState=V.consensusState?t.Any.toJSON(V.consensusState):void 0),V.proof!==void 0&&(u.proof=(0,h.base64FromBytes)(V.proof!==void 0?V.proof:new Uint8Array)),V.proofHeight!==void 0&&(u.proofHeight=V.proofHeight?r.Height.toJSON(V.proofHeight):void 0),u},fromPartial(V){const u=I();return V.consensusState!==void 0&&V.consensusState!==null&&(u.consensusState=t.Any.fromPartial(V.consensusState)),u.proof=V.proof??new Uint8Array,V.proofHeight!==void 0&&V.proofHeight!==null&&(u.proofHeight=r.Height.fromPartial(V.proofHeight)),u}};function g(){return{clientId:"",pagination:void 0}}e.QueryConsensusStatesRequest={typeUrl:"/ibc.core.client.v1.QueryConsensusStatesRequest",encode(V,u=o.BinaryWriter.create()){return V.clientId!==""&&u.uint32(10).string(V.clientId),V.pagination!==void 0&&n.PageRequest.encode(V.pagination,u.uint32(18).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=g();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientId=l.string();break;case 2:f.pagination=n.PageRequest.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=g();return(0,h.isSet)(V.clientId)&&(u.clientId=String(V.clientId)),(0,h.isSet)(V.pagination)&&(u.pagination=n.PageRequest.fromJSON(V.pagination)),u},toJSON(V){const u={};return V.clientId!==void 0&&(u.clientId=V.clientId),V.pagination!==void 0&&(u.pagination=V.pagination?n.PageRequest.toJSON(V.pagination):void 0),u},fromPartial(V){const u=g();return u.clientId=V.clientId??"",V.pagination!==void 0&&V.pagination!==null&&(u.pagination=n.PageRequest.fromPartial(V.pagination)),u}};function R(){return{consensusStates:[],pagination:void 0}}e.QueryConsensusStatesResponse={typeUrl:"/ibc.core.client.v1.QueryConsensusStatesResponse",encode(V,u=o.BinaryWriter.create()){for(const l of V.consensusStates)r.ConsensusStateWithHeight.encode(l,u.uint32(10).fork()).ldelim();return V.pagination!==void 0&&n.PageResponse.encode(V.pagination,u.uint32(18).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=R();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.consensusStates.push(r.ConsensusStateWithHeight.decode(l,l.uint32()));break;case 2:f.pagination=n.PageResponse.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=R();return Array.isArray(V==null?void 0:V.consensusStates)&&(u.consensusStates=V.consensusStates.map(l=>r.ConsensusStateWithHeight.fromJSON(l))),(0,h.isSet)(V.pagination)&&(u.pagination=n.PageResponse.fromJSON(V.pagination)),u},toJSON(V){const u={};return V.consensusStates?u.consensusStates=V.consensusStates.map(l=>l?r.ConsensusStateWithHeight.toJSON(l):void 0):u.consensusStates=[],V.pagination!==void 0&&(u.pagination=V.pagination?n.PageResponse.toJSON(V.pagination):void 0),u},fromPartial(V){var l;const u=R();return u.consensusStates=((l=V.consensusStates)==null?void 0:l.map(T=>r.ConsensusStateWithHeight.fromPartial(T)))||[],V.pagination!==void 0&&V.pagination!==null&&(u.pagination=n.PageResponse.fromPartial(V.pagination)),u}};function B(){return{clientId:"",pagination:void 0}}e.QueryConsensusStateHeightsRequest={typeUrl:"/ibc.core.client.v1.QueryConsensusStateHeightsRequest",encode(V,u=o.BinaryWriter.create()){return V.clientId!==""&&u.uint32(10).string(V.clientId),V.pagination!==void 0&&n.PageRequest.encode(V.pagination,u.uint32(18).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=B();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientId=l.string();break;case 2:f.pagination=n.PageRequest.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=B();return(0,h.isSet)(V.clientId)&&(u.clientId=String(V.clientId)),(0,h.isSet)(V.pagination)&&(u.pagination=n.PageRequest.fromJSON(V.pagination)),u},toJSON(V){const u={};return V.clientId!==void 0&&(u.clientId=V.clientId),V.pagination!==void 0&&(u.pagination=V.pagination?n.PageRequest.toJSON(V.pagination):void 0),u},fromPartial(V){const u=B();return u.clientId=V.clientId??"",V.pagination!==void 0&&V.pagination!==null&&(u.pagination=n.PageRequest.fromPartial(V.pagination)),u}};function d(){return{consensusStateHeights:[],pagination:void 0}}e.QueryConsensusStateHeightsResponse={typeUrl:"/ibc.core.client.v1.QueryConsensusStateHeightsResponse",encode(V,u=o.BinaryWriter.create()){for(const l of V.consensusStateHeights)r.Height.encode(l,u.uint32(10).fork()).ldelim();return V.pagination!==void 0&&n.PageResponse.encode(V.pagination,u.uint32(18).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=d();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.consensusStateHeights.push(r.Height.decode(l,l.uint32()));break;case 2:f.pagination=n.PageResponse.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=d();return Array.isArray(V==null?void 0:V.consensusStateHeights)&&(u.consensusStateHeights=V.consensusStateHeights.map(l=>r.Height.fromJSON(l))),(0,h.isSet)(V.pagination)&&(u.pagination=n.PageResponse.fromJSON(V.pagination)),u},toJSON(V){const u={};return V.consensusStateHeights?u.consensusStateHeights=V.consensusStateHeights.map(l=>l?r.Height.toJSON(l):void 0):u.consensusStateHeights=[],V.pagination!==void 0&&(u.pagination=V.pagination?n.PageResponse.toJSON(V.pagination):void 0),u},fromPartial(V){var l;const u=d();return u.consensusStateHeights=((l=V.consensusStateHeights)==null?void 0:l.map(T=>r.Height.fromPartial(T)))||[],V.pagination!==void 0&&V.pagination!==null&&(u.pagination=n.PageResponse.fromPartial(V.pagination)),u}};function s(){return{clientId:""}}e.QueryClientStatusRequest={typeUrl:"/ibc.core.client.v1.QueryClientStatusRequest",encode(V,u=o.BinaryWriter.create()){return V.clientId!==""&&u.uint32(10).string(V.clientId),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=s();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.clientId=l.string();break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=s();return(0,h.isSet)(V.clientId)&&(u.clientId=String(V.clientId)),u},toJSON(V){const u={};return V.clientId!==void 0&&(u.clientId=V.clientId),u},fromPartial(V){const u=s();return u.clientId=V.clientId??"",u}};function y(){return{status:""}}e.QueryClientStatusResponse={typeUrl:"/ibc.core.client.v1.QueryClientStatusResponse",encode(V,u=o.BinaryWriter.create()){return V.status!==""&&u.uint32(10).string(V.status),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=y();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.status=l.string();break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=y();return(0,h.isSet)(V.status)&&(u.status=String(V.status)),u},toJSON(V){const u={};return V.status!==void 0&&(u.status=V.status),u},fromPartial(V){const u=y();return u.status=V.status??"",u}};function E(){return{}}e.QueryClientParamsRequest={typeUrl:"/ibc.core.client.v1.QueryClientParamsRequest",encode(V,u=o.BinaryWriter.create()){return u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=E();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){default:l.skipType(p&7);break}}return f},fromJSON(V){return E()},toJSON(V){return{}},fromPartial(V){return E()}};function _(){return{params:void 0}}e.QueryClientParamsResponse={typeUrl:"/ibc.core.client.v1.QueryClientParamsResponse",encode(V,u=o.BinaryWriter.create()){return V.params!==void 0&&r.Params.encode(V.params,u.uint32(10).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=_();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.params=r.Params.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=_();return(0,h.isSet)(V.params)&&(u.params=r.Params.fromJSON(V.params)),u},toJSON(V){const u={};return V.params!==void 0&&(u.params=V.params?r.Params.toJSON(V.params):void 0),u},fromPartial(V){const u=_();return V.params!==void 0&&V.params!==null&&(u.params=r.Params.fromPartial(V.params)),u}};function U(){return{}}e.QueryUpgradedClientStateRequest={typeUrl:"/ibc.core.client.v1.QueryUpgradedClientStateRequest",encode(V,u=o.BinaryWriter.create()){return u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=U();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){default:l.skipType(p&7);break}}return f},fromJSON(V){return U()},toJSON(V){return{}},fromPartial(V){return U()}};function H(){return{upgradedClientState:void 0}}e.QueryUpgradedClientStateResponse={typeUrl:"/ibc.core.client.v1.QueryUpgradedClientStateResponse",encode(V,u=o.BinaryWriter.create()){return V.upgradedClientState!==void 0&&t.Any.encode(V.upgradedClientState,u.uint32(10).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=H();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.upgradedClientState=t.Any.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=H();return(0,h.isSet)(V.upgradedClientState)&&(u.upgradedClientState=t.Any.fromJSON(V.upgradedClientState)),u},toJSON(V){const u={};return V.upgradedClientState!==void 0&&(u.upgradedClientState=V.upgradedClientState?t.Any.toJSON(V.upgradedClientState):void 0),u},fromPartial(V){const u=H();return V.upgradedClientState!==void 0&&V.upgradedClientState!==null&&(u.upgradedClientState=t.Any.fromPartial(V.upgradedClientState)),u}};function i(){return{}}e.QueryUpgradedConsensusStateRequest={typeUrl:"/ibc.core.client.v1.QueryUpgradedConsensusStateRequest",encode(V,u=o.BinaryWriter.create()){return u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=i();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){default:l.skipType(p&7);break}}return f},fromJSON(V){return i()},toJSON(V){return{}},fromPartial(V){return i()}};function m(){return{upgradedConsensusState:void 0}}e.QueryUpgradedConsensusStateResponse={typeUrl:"/ibc.core.client.v1.QueryUpgradedConsensusStateResponse",encode(V,u=o.BinaryWriter.create()){return V.upgradedConsensusState!==void 0&&t.Any.encode(V.upgradedConsensusState,u.uint32(10).fork()).ldelim(),u},decode(V,u){const l=V instanceof o.BinaryReader?V:new o.BinaryReader(V);let T=u===void 0?l.len:l.pos+u;const f=m();for(;l.pos<T;){const p=l.uint32();switch(p>>>3){case 1:f.upgradedConsensusState=t.Any.decode(l,l.uint32());break;default:l.skipType(p&7);break}}return f},fromJSON(V){const u=m();return(0,h.isSet)(V.upgradedConsensusState)&&(u.upgradedConsensusState=t.Any.fromJSON(V.upgradedConsensusState)),u},toJSON(V){const u={};return V.upgradedConsensusState!==void 0&&(u.upgradedConsensusState=V.upgradedConsensusState?t.Any.toJSON(V.upgradedConsensusState):void 0),u},fromPartial(V){const u=m();return V.upgradedConsensusState!==void 0&&V.upgradedConsensusState!==null&&(u.upgradedConsensusState=t.Any.fromPartial(V.upgradedConsensusState)),u}};class N{constructor(u){this.rpc=u,this.ClientState=this.ClientState.bind(this),this.ClientStates=this.ClientStates.bind(this),this.ConsensusState=this.ConsensusState.bind(this),this.ConsensusStates=this.ConsensusStates.bind(this),this.ConsensusStateHeights=this.ConsensusStateHeights.bind(this),this.ClientStatus=this.ClientStatus.bind(this),this.ClientParams=this.ClientParams.bind(this),this.UpgradedClientState=this.UpgradedClientState.bind(this),this.UpgradedConsensusState=this.UpgradedConsensusState.bind(this)}ClientState(u){const l=e.QueryClientStateRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientState",l).then(f=>e.QueryClientStateResponse.decode(new o.BinaryReader(f)))}ClientStates(u={pagination:n.PageRequest.fromPartial({})}){const l=e.QueryClientStatesRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientStates",l).then(f=>e.QueryClientStatesResponse.decode(new o.BinaryReader(f)))}ConsensusState(u){const l=e.QueryConsensusStateRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ConsensusState",l).then(f=>e.QueryConsensusStateResponse.decode(new o.BinaryReader(f)))}ConsensusStates(u){const l=e.QueryConsensusStatesRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ConsensusStates",l).then(f=>e.QueryConsensusStatesResponse.decode(new o.BinaryReader(f)))}ConsensusStateHeights(u){const l=e.QueryConsensusStateHeightsRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ConsensusStateHeights",l).then(f=>e.QueryConsensusStateHeightsResponse.decode(new o.BinaryReader(f)))}ClientStatus(u){const l=e.QueryClientStatusRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientStatus",l).then(f=>e.QueryClientStatusResponse.decode(new o.BinaryReader(f)))}ClientParams(u={}){const l=e.QueryClientParamsRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","ClientParams",l).then(f=>e.QueryClientParamsResponse.decode(new o.BinaryReader(f)))}UpgradedClientState(u={}){const l=e.QueryUpgradedClientStateRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","UpgradedClientState",l).then(f=>e.QueryUpgradedClientStateResponse.decode(new o.BinaryReader(f)))}UpgradedConsensusState(u={}){const l=e.QueryUpgradedConsensusStateRequest.encode(u).finish();return this.rpc.request("ibc.core.client.v1.Query","UpgradedConsensusState",l).then(f=>e.QueryUpgradedConsensusStateResponse.decode(new o.BinaryReader(f)))}}e.QueryClientImpl=N})(_m);var Um={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryConnectionParamsResponse=e.QueryConnectionParamsRequest=e.QueryConnectionConsensusStateResponse=e.QueryConnectionConsensusStateRequest=e.QueryConnectionClientStateResponse=e.QueryConnectionClientStateRequest=e.QueryClientConnectionsResponse=e.QueryClientConnectionsRequest=e.QueryConnectionsResponse=e.QueryConnectionsRequest=e.QueryConnectionResponse=e.QueryConnectionRequest=e.protobufPackage=void 0;const n=be,t=Ec,r=sr,o=Re,h=ee,v=ne;e.protobufPackage="ibc.core.connection.v1";function C(){return{connectionId:""}}e.QueryConnectionRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionRequest",encode(U,H=h.BinaryWriter.create()){return U.connectionId!==""&&H.uint32(10).string(U.connectionId),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=C();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.connectionId=i.string();break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=C();return(0,v.isSet)(U.connectionId)&&(H.connectionId=String(U.connectionId)),H},toJSON(U){const H={};return U.connectionId!==void 0&&(H.connectionId=U.connectionId),H},fromPartial(U){const H=C();return H.connectionId=U.connectionId??"",H}};function w(){return{connection:void 0,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryConnectionResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionResponse",encode(U,H=h.BinaryWriter.create()){return U.connection!==void 0&&t.ConnectionEnd.encode(U.connection,H.uint32(10).fork()).ldelim(),U.proof.length!==0&&H.uint32(18).bytes(U.proof),U.proofHeight!==void 0&&r.Height.encode(U.proofHeight,H.uint32(26).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=w();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.connection=t.ConnectionEnd.decode(i,i.uint32());break;case 2:N.proof=i.bytes();break;case 3:N.proofHeight=r.Height.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=w();return(0,v.isSet)(U.connection)&&(H.connection=t.ConnectionEnd.fromJSON(U.connection)),(0,v.isSet)(U.proof)&&(H.proof=(0,v.bytesFromBase64)(U.proof)),(0,v.isSet)(U.proofHeight)&&(H.proofHeight=r.Height.fromJSON(U.proofHeight)),H},toJSON(U){const H={};return U.connection!==void 0&&(H.connection=U.connection?t.ConnectionEnd.toJSON(U.connection):void 0),U.proof!==void 0&&(H.proof=(0,v.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(H.proofHeight=U.proofHeight?r.Height.toJSON(U.proofHeight):void 0),H},fromPartial(U){const H=w();return U.connection!==void 0&&U.connection!==null&&(H.connection=t.ConnectionEnd.fromPartial(U.connection)),H.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(H.proofHeight=r.Height.fromPartial(U.proofHeight)),H}};function D(){return{pagination:void 0}}e.QueryConnectionsRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionsRequest",encode(U,H=h.BinaryWriter.create()){return U.pagination!==void 0&&n.PageRequest.encode(U.pagination,H.uint32(10).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=D();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.pagination=n.PageRequest.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=D();return(0,v.isSet)(U.pagination)&&(H.pagination=n.PageRequest.fromJSON(U.pagination)),H},toJSON(U){const H={};return U.pagination!==void 0&&(H.pagination=U.pagination?n.PageRequest.toJSON(U.pagination):void 0),H},fromPartial(U){const H=D();return U.pagination!==void 0&&U.pagination!==null&&(H.pagination=n.PageRequest.fromPartial(U.pagination)),H}};function J(){return{connections:[],pagination:void 0,height:r.Height.fromPartial({})}}e.QueryConnectionsResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionsResponse",encode(U,H=h.BinaryWriter.create()){for(const i of U.connections)t.IdentifiedConnection.encode(i,H.uint32(10).fork()).ldelim();return U.pagination!==void 0&&n.PageResponse.encode(U.pagination,H.uint32(18).fork()).ldelim(),U.height!==void 0&&r.Height.encode(U.height,H.uint32(26).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=J();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.connections.push(t.IdentifiedConnection.decode(i,i.uint32()));break;case 2:N.pagination=n.PageResponse.decode(i,i.uint32());break;case 3:N.height=r.Height.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=J();return Array.isArray(U==null?void 0:U.connections)&&(H.connections=U.connections.map(i=>t.IdentifiedConnection.fromJSON(i))),(0,v.isSet)(U.pagination)&&(H.pagination=n.PageResponse.fromJSON(U.pagination)),(0,v.isSet)(U.height)&&(H.height=r.Height.fromJSON(U.height)),H},toJSON(U){const H={};return U.connections?H.connections=U.connections.map(i=>i?t.IdentifiedConnection.toJSON(i):void 0):H.connections=[],U.pagination!==void 0&&(H.pagination=U.pagination?n.PageResponse.toJSON(U.pagination):void 0),U.height!==void 0&&(H.height=U.height?r.Height.toJSON(U.height):void 0),H},fromPartial(U){var i;const H=J();return H.connections=((i=U.connections)==null?void 0:i.map(m=>t.IdentifiedConnection.fromPartial(m)))||[],U.pagination!==void 0&&U.pagination!==null&&(H.pagination=n.PageResponse.fromPartial(U.pagination)),U.height!==void 0&&U.height!==null&&(H.height=r.Height.fromPartial(U.height)),H}};function I(){return{clientId:""}}e.QueryClientConnectionsRequest={typeUrl:"/ibc.core.connection.v1.QueryClientConnectionsRequest",encode(U,H=h.BinaryWriter.create()){return U.clientId!==""&&H.uint32(10).string(U.clientId),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=I();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.clientId=i.string();break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=I();return(0,v.isSet)(U.clientId)&&(H.clientId=String(U.clientId)),H},toJSON(U){const H={};return U.clientId!==void 0&&(H.clientId=U.clientId),H},fromPartial(U){const H=I();return H.clientId=U.clientId??"",H}};function g(){return{connectionPaths:[],proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryClientConnectionsResponse={typeUrl:"/ibc.core.connection.v1.QueryClientConnectionsResponse",encode(U,H=h.BinaryWriter.create()){for(const i of U.connectionPaths)H.uint32(10).string(i);return U.proof.length!==0&&H.uint32(18).bytes(U.proof),U.proofHeight!==void 0&&r.Height.encode(U.proofHeight,H.uint32(26).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=g();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.connectionPaths.push(i.string());break;case 2:N.proof=i.bytes();break;case 3:N.proofHeight=r.Height.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=g();return Array.isArray(U==null?void 0:U.connectionPaths)&&(H.connectionPaths=U.connectionPaths.map(i=>String(i))),(0,v.isSet)(U.proof)&&(H.proof=(0,v.bytesFromBase64)(U.proof)),(0,v.isSet)(U.proofHeight)&&(H.proofHeight=r.Height.fromJSON(U.proofHeight)),H},toJSON(U){const H={};return U.connectionPaths?H.connectionPaths=U.connectionPaths.map(i=>i):H.connectionPaths=[],U.proof!==void 0&&(H.proof=(0,v.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(H.proofHeight=U.proofHeight?r.Height.toJSON(U.proofHeight):void 0),H},fromPartial(U){var i;const H=g();return H.connectionPaths=((i=U.connectionPaths)==null?void 0:i.map(m=>m))||[],H.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(H.proofHeight=r.Height.fromPartial(U.proofHeight)),H}};function R(){return{connectionId:""}}e.QueryConnectionClientStateRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionClientStateRequest",encode(U,H=h.BinaryWriter.create()){return U.connectionId!==""&&H.uint32(10).string(U.connectionId),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=R();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.connectionId=i.string();break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=R();return(0,v.isSet)(U.connectionId)&&(H.connectionId=String(U.connectionId)),H},toJSON(U){const H={};return U.connectionId!==void 0&&(H.connectionId=U.connectionId),H},fromPartial(U){const H=R();return H.connectionId=U.connectionId??"",H}};function B(){return{identifiedClientState:void 0,proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryConnectionClientStateResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionClientStateResponse",encode(U,H=h.BinaryWriter.create()){return U.identifiedClientState!==void 0&&r.IdentifiedClientState.encode(U.identifiedClientState,H.uint32(10).fork()).ldelim(),U.proof.length!==0&&H.uint32(18).bytes(U.proof),U.proofHeight!==void 0&&r.Height.encode(U.proofHeight,H.uint32(26).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=B();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.identifiedClientState=r.IdentifiedClientState.decode(i,i.uint32());break;case 2:N.proof=i.bytes();break;case 3:N.proofHeight=r.Height.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=B();return(0,v.isSet)(U.identifiedClientState)&&(H.identifiedClientState=r.IdentifiedClientState.fromJSON(U.identifiedClientState)),(0,v.isSet)(U.proof)&&(H.proof=(0,v.bytesFromBase64)(U.proof)),(0,v.isSet)(U.proofHeight)&&(H.proofHeight=r.Height.fromJSON(U.proofHeight)),H},toJSON(U){const H={};return U.identifiedClientState!==void 0&&(H.identifiedClientState=U.identifiedClientState?r.IdentifiedClientState.toJSON(U.identifiedClientState):void 0),U.proof!==void 0&&(H.proof=(0,v.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(H.proofHeight=U.proofHeight?r.Height.toJSON(U.proofHeight):void 0),H},fromPartial(U){const H=B();return U.identifiedClientState!==void 0&&U.identifiedClientState!==null&&(H.identifiedClientState=r.IdentifiedClientState.fromPartial(U.identifiedClientState)),H.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(H.proofHeight=r.Height.fromPartial(U.proofHeight)),H}};function d(){return{connectionId:"",revisionNumber:BigInt(0),revisionHeight:BigInt(0)}}e.QueryConnectionConsensusStateRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionConsensusStateRequest",encode(U,H=h.BinaryWriter.create()){return U.connectionId!==""&&H.uint32(10).string(U.connectionId),U.revisionNumber!==BigInt(0)&&H.uint32(16).uint64(U.revisionNumber),U.revisionHeight!==BigInt(0)&&H.uint32(24).uint64(U.revisionHeight),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=d();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.connectionId=i.string();break;case 2:N.revisionNumber=i.uint64();break;case 3:N.revisionHeight=i.uint64();break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=d();return(0,v.isSet)(U.connectionId)&&(H.connectionId=String(U.connectionId)),(0,v.isSet)(U.revisionNumber)&&(H.revisionNumber=BigInt(U.revisionNumber.toString())),(0,v.isSet)(U.revisionHeight)&&(H.revisionHeight=BigInt(U.revisionHeight.toString())),H},toJSON(U){const H={};return U.connectionId!==void 0&&(H.connectionId=U.connectionId),U.revisionNumber!==void 0&&(H.revisionNumber=(U.revisionNumber||BigInt(0)).toString()),U.revisionHeight!==void 0&&(H.revisionHeight=(U.revisionHeight||BigInt(0)).toString()),H},fromPartial(U){const H=d();return H.connectionId=U.connectionId??"",U.revisionNumber!==void 0&&U.revisionNumber!==null&&(H.revisionNumber=BigInt(U.revisionNumber.toString())),U.revisionHeight!==void 0&&U.revisionHeight!==null&&(H.revisionHeight=BigInt(U.revisionHeight.toString())),H}};function s(){return{consensusState:void 0,clientId:"",proof:new Uint8Array,proofHeight:r.Height.fromPartial({})}}e.QueryConnectionConsensusStateResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionConsensusStateResponse",encode(U,H=h.BinaryWriter.create()){return U.consensusState!==void 0&&o.Any.encode(U.consensusState,H.uint32(10).fork()).ldelim(),U.clientId!==""&&H.uint32(18).string(U.clientId),U.proof.length!==0&&H.uint32(26).bytes(U.proof),U.proofHeight!==void 0&&r.Height.encode(U.proofHeight,H.uint32(34).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=s();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.consensusState=o.Any.decode(i,i.uint32());break;case 2:N.clientId=i.string();break;case 3:N.proof=i.bytes();break;case 4:N.proofHeight=r.Height.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=s();return(0,v.isSet)(U.consensusState)&&(H.consensusState=o.Any.fromJSON(U.consensusState)),(0,v.isSet)(U.clientId)&&(H.clientId=String(U.clientId)),(0,v.isSet)(U.proof)&&(H.proof=(0,v.bytesFromBase64)(U.proof)),(0,v.isSet)(U.proofHeight)&&(H.proofHeight=r.Height.fromJSON(U.proofHeight)),H},toJSON(U){const H={};return U.consensusState!==void 0&&(H.consensusState=U.consensusState?o.Any.toJSON(U.consensusState):void 0),U.clientId!==void 0&&(H.clientId=U.clientId),U.proof!==void 0&&(H.proof=(0,v.base64FromBytes)(U.proof!==void 0?U.proof:new Uint8Array)),U.proofHeight!==void 0&&(H.proofHeight=U.proofHeight?r.Height.toJSON(U.proofHeight):void 0),H},fromPartial(U){const H=s();return U.consensusState!==void 0&&U.consensusState!==null&&(H.consensusState=o.Any.fromPartial(U.consensusState)),H.clientId=U.clientId??"",H.proof=U.proof??new Uint8Array,U.proofHeight!==void 0&&U.proofHeight!==null&&(H.proofHeight=r.Height.fromPartial(U.proofHeight)),H}};function y(){return{}}e.QueryConnectionParamsRequest={typeUrl:"/ibc.core.connection.v1.QueryConnectionParamsRequest",encode(U,H=h.BinaryWriter.create()){return H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=y();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){default:i.skipType(V&7);break}}return N},fromJSON(U){return y()},toJSON(U){return{}},fromPartial(U){return y()}};function E(){return{params:void 0}}e.QueryConnectionParamsResponse={typeUrl:"/ibc.core.connection.v1.QueryConnectionParamsResponse",encode(U,H=h.BinaryWriter.create()){return U.params!==void 0&&r.Params.encode(U.params,H.uint32(10).fork()).ldelim(),H},decode(U,H){const i=U instanceof h.BinaryReader?U:new h.BinaryReader(U);let m=H===void 0?i.len:i.pos+H;const N=E();for(;i.pos<m;){const V=i.uint32();switch(V>>>3){case 1:N.params=r.Params.decode(i,i.uint32());break;default:i.skipType(V&7);break}}return N},fromJSON(U){const H=E();return(0,v.isSet)(U.params)&&(H.params=r.Params.fromJSON(U.params)),H},toJSON(U){const H={};return U.params!==void 0&&(H.params=U.params?r.Params.toJSON(U.params):void 0),H},fromPartial(U){const H=E();return U.params!==void 0&&U.params!==null&&(H.params=r.Params.fromPartial(U.params)),H}};class _{constructor(H){this.rpc=H,this.Connection=this.Connection.bind(this),this.Connections=this.Connections.bind(this),this.ClientConnections=this.ClientConnections.bind(this),this.ConnectionClientState=this.ConnectionClientState.bind(this),this.ConnectionConsensusState=this.ConnectionConsensusState.bind(this),this.ConnectionParams=this.ConnectionParams.bind(this)}Connection(H){const i=e.QueryConnectionRequest.encode(H).finish();return this.rpc.request("ibc.core.connection.v1.Query","Connection",i).then(N=>e.QueryConnectionResponse.decode(new h.BinaryReader(N)))}Connections(H={pagination:n.PageRequest.fromPartial({})}){const i=e.QueryConnectionsRequest.encode(H).finish();return this.rpc.request("ibc.core.connection.v1.Query","Connections",i).then(N=>e.QueryConnectionsResponse.decode(new h.BinaryReader(N)))}ClientConnections(H){const i=e.QueryClientConnectionsRequest.encode(H).finish();return this.rpc.request("ibc.core.connection.v1.Query","ClientConnections",i).then(N=>e.QueryClientConnectionsResponse.decode(new h.BinaryReader(N)))}ConnectionClientState(H){const i=e.QueryConnectionClientStateRequest.encode(H).finish();return this.rpc.request("ibc.core.connection.v1.Query","ConnectionClientState",i).then(N=>e.QueryConnectionClientStateResponse.decode(new h.BinaryReader(N)))}ConnectionConsensusState(H){const i=e.QueryConnectionConsensusStateRequest.encode(H).finish();return this.rpc.request("ibc.core.connection.v1.Query","ConnectionConsensusState",i).then(N=>e.QueryConnectionConsensusStateResponse.decode(new h.BinaryReader(N)))}ConnectionParams(H={}){const i=e.QueryConnectionParamsRequest.encode(H).finish();return this.rpc.request("ibc.core.connection.v1.Query","ConnectionParams",i).then(N=>e.QueryConnectionParamsResponse.decode(new h.BinaryReader(N)))}}e.QueryClientImpl=_})(Um);var Jm={},dr={},Uc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;const n=ee,t=ne;e.protobufPackage="tendermint.crypto";function r(){return{total:BigInt(0),index:BigInt(0),leafHash:new Uint8Array,aunts:[]}}e.Proof={typeUrl:"/tendermint.crypto.Proof",encode(w,D=n.BinaryWriter.create()){w.total!==BigInt(0)&&D.uint32(8).int64(w.total),w.index!==BigInt(0)&&D.uint32(16).int64(w.index),w.leafHash.length!==0&&D.uint32(26).bytes(w.leafHash);for(const J of w.aunts)D.uint32(34).bytes(J);return D},decode(w,D){const J=w instanceof n.BinaryReader?w:new n.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=r();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.total=J.int64();break;case 2:g.index=J.int64();break;case 3:g.leafHash=J.bytes();break;case 4:g.aunts.push(J.bytes());break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=r();return(0,t.isSet)(w.total)&&(D.total=BigInt(w.total.toString())),(0,t.isSet)(w.index)&&(D.index=BigInt(w.index.toString())),(0,t.isSet)(w.leafHash)&&(D.leafHash=(0,t.bytesFromBase64)(w.leafHash)),Array.isArray(w==null?void 0:w.aunts)&&(D.aunts=w.aunts.map(J=>(0,t.bytesFromBase64)(J))),D},toJSON(w){const D={};return w.total!==void 0&&(D.total=(w.total||BigInt(0)).toString()),w.index!==void 0&&(D.index=(w.index||BigInt(0)).toString()),w.leafHash!==void 0&&(D.leafHash=(0,t.base64FromBytes)(w.leafHash!==void 0?w.leafHash:new Uint8Array)),w.aunts?D.aunts=w.aunts.map(J=>(0,t.base64FromBytes)(J!==void 0?J:new Uint8Array)):D.aunts=[],D},fromPartial(w){var J;const D=r();return w.total!==void 0&&w.total!==null&&(D.total=BigInt(w.total.toString())),w.index!==void 0&&w.index!==null&&(D.index=BigInt(w.index.toString())),D.leafHash=w.leafHash??new Uint8Array,D.aunts=((J=w.aunts)==null?void 0:J.map(I=>I))||[],D}};function o(){return{key:new Uint8Array,proof:void 0}}e.ValueOp={typeUrl:"/tendermint.crypto.ValueOp",encode(w,D=n.BinaryWriter.create()){return w.key.length!==0&&D.uint32(10).bytes(w.key),w.proof!==void 0&&e.Proof.encode(w.proof,D.uint32(18).fork()).ldelim(),D},decode(w,D){const J=w instanceof n.BinaryReader?w:new n.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=o();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.key=J.bytes();break;case 2:g.proof=e.Proof.decode(J,J.uint32());break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=o();return(0,t.isSet)(w.key)&&(D.key=(0,t.bytesFromBase64)(w.key)),(0,t.isSet)(w.proof)&&(D.proof=e.Proof.fromJSON(w.proof)),D},toJSON(w){const D={};return w.key!==void 0&&(D.key=(0,t.base64FromBytes)(w.key!==void 0?w.key:new Uint8Array)),w.proof!==void 0&&(D.proof=w.proof?e.Proof.toJSON(w.proof):void 0),D},fromPartial(w){const D=o();return D.key=w.key??new Uint8Array,w.proof!==void 0&&w.proof!==null&&(D.proof=e.Proof.fromPartial(w.proof)),D}};function h(){return{key:"",input:"",output:""}}e.DominoOp={typeUrl:"/tendermint.crypto.DominoOp",encode(w,D=n.BinaryWriter.create()){return w.key!==""&&D.uint32(10).string(w.key),w.input!==""&&D.uint32(18).string(w.input),w.output!==""&&D.uint32(26).string(w.output),D},decode(w,D){const J=w instanceof n.BinaryReader?w:new n.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=h();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.key=J.string();break;case 2:g.input=J.string();break;case 3:g.output=J.string();break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=h();return(0,t.isSet)(w.key)&&(D.key=String(w.key)),(0,t.isSet)(w.input)&&(D.input=String(w.input)),(0,t.isSet)(w.output)&&(D.output=String(w.output)),D},toJSON(w){const D={};return w.key!==void 0&&(D.key=w.key),w.input!==void 0&&(D.input=w.input),w.output!==void 0&&(D.output=w.output),D},fromPartial(w){const D=h();return D.key=w.key??"",D.input=w.input??"",D.output=w.output??"",D}};function v(){return{type:"",key:new Uint8Array,data:new Uint8Array}}e.ProofOp={typeUrl:"/tendermint.crypto.ProofOp",encode(w,D=n.BinaryWriter.create()){return w.type!==""&&D.uint32(10).string(w.type),w.key.length!==0&&D.uint32(18).bytes(w.key),w.data.length!==0&&D.uint32(26).bytes(w.data),D},decode(w,D){const J=w instanceof n.BinaryReader?w:new n.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=v();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.type=J.string();break;case 2:g.key=J.bytes();break;case 3:g.data=J.bytes();break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=v();return(0,t.isSet)(w.type)&&(D.type=String(w.type)),(0,t.isSet)(w.key)&&(D.key=(0,t.bytesFromBase64)(w.key)),(0,t.isSet)(w.data)&&(D.data=(0,t.bytesFromBase64)(w.data)),D},toJSON(w){const D={};return w.type!==void 0&&(D.type=w.type),w.key!==void 0&&(D.key=(0,t.base64FromBytes)(w.key!==void 0?w.key:new Uint8Array)),w.data!==void 0&&(D.data=(0,t.base64FromBytes)(w.data!==void 0?w.data:new Uint8Array)),D},fromPartial(w){const D=v();return D.type=w.type??"",D.key=w.key??new Uint8Array,D.data=w.data??new Uint8Array,D}};function C(){return{ops:[]}}e.ProofOps={typeUrl:"/tendermint.crypto.ProofOps",encode(w,D=n.BinaryWriter.create()){for(const J of w.ops)e.ProofOp.encode(J,D.uint32(10).fork()).ldelim();return D},decode(w,D){const J=w instanceof n.BinaryReader?w:new n.BinaryReader(w);let I=D===void 0?J.len:J.pos+D;const g=C();for(;J.pos<I;){const R=J.uint32();switch(R>>>3){case 1:g.ops.push(e.ProofOp.decode(J,J.uint32()));break;default:J.skipType(R&7);break}}return g},fromJSON(w){const D=C();return Array.isArray(w==null?void 0:w.ops)&&(D.ops=w.ops.map(J=>e.ProofOp.fromJSON(J))),D},toJSON(w){const D={};return w.ops?D.ops=w.ops.map(J=>J?e.ProofOp.toJSON(J):void 0):D.ops=[],D},fromPartial(w){var J;const D=C();return D.ops=((J=w.ops)==null?void 0:J.map(I=>e.ProofOp.fromPartial(I)))||[],D}}})(Uc);var It={};Object.defineProperty(It,"__esModule",{value:!0});It.Consensus=It.App=It.protobufPackage=void 0;const Qr=ee,ma=ne;It.protobufPackage="tendermint.version";function Xd(){return{protocol:BigInt(0),software:""}}It.App={typeUrl:"/tendermint.version.App",encode(e,n=Qr.BinaryWriter.create()){return e.protocol!==BigInt(0)&&n.uint32(8).uint64(e.protocol),e.software!==""&&n.uint32(18).string(e.software),n},decode(e,n){const t=e instanceof Qr.BinaryReader?e:new Qr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Xd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.protocol=t.uint64();break;case 2:o.software=t.string();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Xd();return(0,ma.isSet)(e.protocol)&&(n.protocol=BigInt(e.protocol.toString())),(0,ma.isSet)(e.software)&&(n.software=String(e.software)),n},toJSON(e){const n={};return e.protocol!==void 0&&(n.protocol=(e.protocol||BigInt(0)).toString()),e.software!==void 0&&(n.software=e.software),n},fromPartial(e){const n=Xd();return e.protocol!==void 0&&e.protocol!==null&&(n.protocol=BigInt(e.protocol.toString())),n.software=e.software??"",n}};function xd(){return{block:BigInt(0),app:BigInt(0)}}It.Consensus={typeUrl:"/tendermint.version.Consensus",encode(e,n=Qr.BinaryWriter.create()){return e.block!==BigInt(0)&&n.uint32(8).uint64(e.block),e.app!==BigInt(0)&&n.uint32(16).uint64(e.app),n},decode(e,n){const t=e instanceof Qr.BinaryReader?e:new Qr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=xd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.block=t.uint64();break;case 2:o.app=t.uint64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=xd();return(0,ma.isSet)(e.block)&&(n.block=BigInt(e.block.toString())),(0,ma.isSet)(e.app)&&(n.app=BigInt(e.app.toString())),n},toJSON(e){const n={};return e.block!==void 0&&(n.block=(e.block||BigInt(0)).toString()),e.app!==void 0&&(n.app=(e.app||BigInt(0)).toString()),n},fromPartial(e){const n=xd();return e.block!==void 0&&e.block!==null&&(n.block=BigInt(e.block.toString())),e.app!==void 0&&e.app!==null&&(n.app=BigInt(e.app.toString())),n}};var cs={},ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.PublicKey=ir.protobufPackage=void 0;const jd=ee,yr=ne;ir.protobufPackage="tendermint.crypto";function eu(){return{ed25519:void 0,secp256k1:void 0}}ir.PublicKey={typeUrl:"/tendermint.crypto.PublicKey",encode(e,n=jd.BinaryWriter.create()){return e.ed25519!==void 0&&n.uint32(10).bytes(e.ed25519),e.secp256k1!==void 0&&n.uint32(18).bytes(e.secp256k1),n},decode(e,n){const t=e instanceof jd.BinaryReader?e:new jd.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=eu();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.ed25519=t.bytes();break;case 2:o.secp256k1=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=eu();return(0,yr.isSet)(e.ed25519)&&(n.ed25519=(0,yr.bytesFromBase64)(e.ed25519)),(0,yr.isSet)(e.secp256k1)&&(n.secp256k1=(0,yr.bytesFromBase64)(e.secp256k1)),n},toJSON(e){const n={};return e.ed25519!==void 0&&(n.ed25519=e.ed25519!==void 0?(0,yr.base64FromBytes)(e.ed25519):void 0),e.secp256k1!==void 0&&(n.secp256k1=e.secp256k1!==void 0?(0,yr.base64FromBytes)(e.secp256k1):void 0),n},fromPartial(e){const n=eu();return n.ed25519=e.ed25519??void 0,n.secp256k1=e.secp256k1??void 0,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SimpleValidator=e.Validator=e.ValidatorSet=e.protobufPackage=void 0;const n=ir,t=ee,r=ne;e.protobufPackage="tendermint.types";function o(){return{validators:[],proposer:void 0,totalVotingPower:BigInt(0)}}e.ValidatorSet={typeUrl:"/tendermint.types.ValidatorSet",encode(C,w=t.BinaryWriter.create()){for(const D of C.validators)e.Validator.encode(D,w.uint32(10).fork()).ldelim();return C.proposer!==void 0&&e.Validator.encode(C.proposer,w.uint32(18).fork()).ldelim(),C.totalVotingPower!==BigInt(0)&&w.uint32(24).int64(C.totalVotingPower),w},decode(C,w){const D=C instanceof t.BinaryReader?C:new t.BinaryReader(C);let J=w===void 0?D.len:D.pos+w;const I=o();for(;D.pos<J;){const g=D.uint32();switch(g>>>3){case 1:I.validators.push(e.Validator.decode(D,D.uint32()));break;case 2:I.proposer=e.Validator.decode(D,D.uint32());break;case 3:I.totalVotingPower=D.int64();break;default:D.skipType(g&7);break}}return I},fromJSON(C){const w=o();return Array.isArray(C==null?void 0:C.validators)&&(w.validators=C.validators.map(D=>e.Validator.fromJSON(D))),(0,r.isSet)(C.proposer)&&(w.proposer=e.Validator.fromJSON(C.proposer)),(0,r.isSet)(C.totalVotingPower)&&(w.totalVotingPower=BigInt(C.totalVotingPower.toString())),w},toJSON(C){const w={};return C.validators?w.validators=C.validators.map(D=>D?e.Validator.toJSON(D):void 0):w.validators=[],C.proposer!==void 0&&(w.proposer=C.proposer?e.Validator.toJSON(C.proposer):void 0),C.totalVotingPower!==void 0&&(w.totalVotingPower=(C.totalVotingPower||BigInt(0)).toString()),w},fromPartial(C){var D;const w=o();return w.validators=((D=C.validators)==null?void 0:D.map(J=>e.Validator.fromPartial(J)))||[],C.proposer!==void 0&&C.proposer!==null&&(w.proposer=e.Validator.fromPartial(C.proposer)),C.totalVotingPower!==void 0&&C.totalVotingPower!==null&&(w.totalVotingPower=BigInt(C.totalVotingPower.toString())),w}};function h(){return{address:new Uint8Array,pubKey:n.PublicKey.fromPartial({}),votingPower:BigInt(0),proposerPriority:BigInt(0)}}e.Validator={typeUrl:"/tendermint.types.Validator",encode(C,w=t.BinaryWriter.create()){return C.address.length!==0&&w.uint32(10).bytes(C.address),C.pubKey!==void 0&&n.PublicKey.encode(C.pubKey,w.uint32(18).fork()).ldelim(),C.votingPower!==BigInt(0)&&w.uint32(24).int64(C.votingPower),C.proposerPriority!==BigInt(0)&&w.uint32(32).int64(C.proposerPriority),w},decode(C,w){const D=C instanceof t.BinaryReader?C:new t.BinaryReader(C);let J=w===void 0?D.len:D.pos+w;const I=h();for(;D.pos<J;){const g=D.uint32();switch(g>>>3){case 1:I.address=D.bytes();break;case 2:I.pubKey=n.PublicKey.decode(D,D.uint32());break;case 3:I.votingPower=D.int64();break;case 4:I.proposerPriority=D.int64();break;default:D.skipType(g&7);break}}return I},fromJSON(C){const w=h();return(0,r.isSet)(C.address)&&(w.address=(0,r.bytesFromBase64)(C.address)),(0,r.isSet)(C.pubKey)&&(w.pubKey=n.PublicKey.fromJSON(C.pubKey)),(0,r.isSet)(C.votingPower)&&(w.votingPower=BigInt(C.votingPower.toString())),(0,r.isSet)(C.proposerPriority)&&(w.proposerPriority=BigInt(C.proposerPriority.toString())),w},toJSON(C){const w={};return C.address!==void 0&&(w.address=(0,r.base64FromBytes)(C.address!==void 0?C.address:new Uint8Array)),C.pubKey!==void 0&&(w.pubKey=C.pubKey?n.PublicKey.toJSON(C.pubKey):void 0),C.votingPower!==void 0&&(w.votingPower=(C.votingPower||BigInt(0)).toString()),C.proposerPriority!==void 0&&(w.proposerPriority=(C.proposerPriority||BigInt(0)).toString()),w},fromPartial(C){const w=h();return w.address=C.address??new Uint8Array,C.pubKey!==void 0&&C.pubKey!==null&&(w.pubKey=n.PublicKey.fromPartial(C.pubKey)),C.votingPower!==void 0&&C.votingPower!==null&&(w.votingPower=BigInt(C.votingPower.toString())),C.proposerPriority!==void 0&&C.proposerPriority!==null&&(w.proposerPriority=BigInt(C.proposerPriority.toString())),w}};function v(){return{pubKey:void 0,votingPower:BigInt(0)}}e.SimpleValidator={typeUrl:"/tendermint.types.SimpleValidator",encode(C,w=t.BinaryWriter.create()){return C.pubKey!==void 0&&n.PublicKey.encode(C.pubKey,w.uint32(10).fork()).ldelim(),C.votingPower!==BigInt(0)&&w.uint32(16).int64(C.votingPower),w},decode(C,w){const D=C instanceof t.BinaryReader?C:new t.BinaryReader(C);let J=w===void 0?D.len:D.pos+w;const I=v();for(;D.pos<J;){const g=D.uint32();switch(g>>>3){case 1:I.pubKey=n.PublicKey.decode(D,D.uint32());break;case 2:I.votingPower=D.int64();break;default:D.skipType(g&7);break}}return I},fromJSON(C){const w=v();return(0,r.isSet)(C.pubKey)&&(w.pubKey=n.PublicKey.fromJSON(C.pubKey)),(0,r.isSet)(C.votingPower)&&(w.votingPower=BigInt(C.votingPower.toString())),w},toJSON(C){const w={};return C.pubKey!==void 0&&(w.pubKey=C.pubKey?n.PublicKey.toJSON(C.pubKey):void 0),C.votingPower!==void 0&&(w.votingPower=(C.votingPower||BigInt(0)).toString()),w},fromPartial(C){const w=v();return C.pubKey!==void 0&&C.pubKey!==null&&(w.pubKey=n.PublicKey.fromPartial(C.pubKey)),C.votingPower!==void 0&&C.votingPower!==null&&(w.votingPower=BigInt(C.votingPower.toString())),w}}})(cs);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TxProof=e.BlockMeta=e.LightBlock=e.SignedHeader=e.Proposal=e.CommitSig=e.Commit=e.Vote=e.Data=e.Header=e.BlockID=e.Part=e.PartSetHeader=e.signedMsgTypeToJSON=e.signedMsgTypeFromJSON=e.SignedMsgType=e.blockIDFlagToJSON=e.blockIDFlagFromJSON=e.BlockIDFlag=e.protobufPackage=void 0;const n=Uc,t=It,r=Mn,o=cs,h=ee,v=ne;e.protobufPackage="tendermint.types";var C;(function(u){u[u.BLOCK_ID_FLAG_UNKNOWN=0]="BLOCK_ID_FLAG_UNKNOWN",u[u.BLOCK_ID_FLAG_ABSENT=1]="BLOCK_ID_FLAG_ABSENT",u[u.BLOCK_ID_FLAG_COMMIT=2]="BLOCK_ID_FLAG_COMMIT",u[u.BLOCK_ID_FLAG_NIL=3]="BLOCK_ID_FLAG_NIL",u[u.UNRECOGNIZED=-1]="UNRECOGNIZED"})(C||(e.BlockIDFlag=C={}));function w(u){switch(u){case 0:case"BLOCK_ID_FLAG_UNKNOWN":return C.BLOCK_ID_FLAG_UNKNOWN;case 1:case"BLOCK_ID_FLAG_ABSENT":return C.BLOCK_ID_FLAG_ABSENT;case 2:case"BLOCK_ID_FLAG_COMMIT":return C.BLOCK_ID_FLAG_COMMIT;case 3:case"BLOCK_ID_FLAG_NIL":return C.BLOCK_ID_FLAG_NIL;case-1:case"UNRECOGNIZED":default:return C.UNRECOGNIZED}}e.blockIDFlagFromJSON=w;function D(u){switch(u){case C.BLOCK_ID_FLAG_UNKNOWN:return"BLOCK_ID_FLAG_UNKNOWN";case C.BLOCK_ID_FLAG_ABSENT:return"BLOCK_ID_FLAG_ABSENT";case C.BLOCK_ID_FLAG_COMMIT:return"BLOCK_ID_FLAG_COMMIT";case C.BLOCK_ID_FLAG_NIL:return"BLOCK_ID_FLAG_NIL";case C.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.blockIDFlagToJSON=D;var J;(function(u){u[u.SIGNED_MSG_TYPE_UNKNOWN=0]="SIGNED_MSG_TYPE_UNKNOWN",u[u.SIGNED_MSG_TYPE_PREVOTE=1]="SIGNED_MSG_TYPE_PREVOTE",u[u.SIGNED_MSG_TYPE_PRECOMMIT=2]="SIGNED_MSG_TYPE_PRECOMMIT",u[u.SIGNED_MSG_TYPE_PROPOSAL=32]="SIGNED_MSG_TYPE_PROPOSAL",u[u.UNRECOGNIZED=-1]="UNRECOGNIZED"})(J||(e.SignedMsgType=J={}));function I(u){switch(u){case 0:case"SIGNED_MSG_TYPE_UNKNOWN":return J.SIGNED_MSG_TYPE_UNKNOWN;case 1:case"SIGNED_MSG_TYPE_PREVOTE":return J.SIGNED_MSG_TYPE_PREVOTE;case 2:case"SIGNED_MSG_TYPE_PRECOMMIT":return J.SIGNED_MSG_TYPE_PRECOMMIT;case 32:case"SIGNED_MSG_TYPE_PROPOSAL":return J.SIGNED_MSG_TYPE_PROPOSAL;case-1:case"UNRECOGNIZED":default:return J.UNRECOGNIZED}}e.signedMsgTypeFromJSON=I;function g(u){switch(u){case J.SIGNED_MSG_TYPE_UNKNOWN:return"SIGNED_MSG_TYPE_UNKNOWN";case J.SIGNED_MSG_TYPE_PREVOTE:return"SIGNED_MSG_TYPE_PREVOTE";case J.SIGNED_MSG_TYPE_PRECOMMIT:return"SIGNED_MSG_TYPE_PRECOMMIT";case J.SIGNED_MSG_TYPE_PROPOSAL:return"SIGNED_MSG_TYPE_PROPOSAL";case J.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.signedMsgTypeToJSON=g;function R(){return{total:0,hash:new Uint8Array}}e.PartSetHeader={typeUrl:"/tendermint.types.PartSetHeader",encode(u,l=h.BinaryWriter.create()){return u.total!==0&&l.uint32(8).uint32(u.total),u.hash.length!==0&&l.uint32(18).bytes(u.hash),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=R();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.total=T.uint32();break;case 2:p.hash=T.bytes();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=R();return(0,v.isSet)(u.total)&&(l.total=Number(u.total)),(0,v.isSet)(u.hash)&&(l.hash=(0,v.bytesFromBase64)(u.hash)),l},toJSON(u){const l={};return u.total!==void 0&&(l.total=Math.round(u.total)),u.hash!==void 0&&(l.hash=(0,v.base64FromBytes)(u.hash!==void 0?u.hash:new Uint8Array)),l},fromPartial(u){const l=R();return l.total=u.total??0,l.hash=u.hash??new Uint8Array,l}};function B(){return{index:0,bytes:new Uint8Array,proof:n.Proof.fromPartial({})}}e.Part={typeUrl:"/tendermint.types.Part",encode(u,l=h.BinaryWriter.create()){return u.index!==0&&l.uint32(8).uint32(u.index),u.bytes.length!==0&&l.uint32(18).bytes(u.bytes),u.proof!==void 0&&n.Proof.encode(u.proof,l.uint32(26).fork()).ldelim(),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=B();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.index=T.uint32();break;case 2:p.bytes=T.bytes();break;case 3:p.proof=n.Proof.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=B();return(0,v.isSet)(u.index)&&(l.index=Number(u.index)),(0,v.isSet)(u.bytes)&&(l.bytes=(0,v.bytesFromBase64)(u.bytes)),(0,v.isSet)(u.proof)&&(l.proof=n.Proof.fromJSON(u.proof)),l},toJSON(u){const l={};return u.index!==void 0&&(l.index=Math.round(u.index)),u.bytes!==void 0&&(l.bytes=(0,v.base64FromBytes)(u.bytes!==void 0?u.bytes:new Uint8Array)),u.proof!==void 0&&(l.proof=u.proof?n.Proof.toJSON(u.proof):void 0),l},fromPartial(u){const l=B();return l.index=u.index??0,l.bytes=u.bytes??new Uint8Array,u.proof!==void 0&&u.proof!==null&&(l.proof=n.Proof.fromPartial(u.proof)),l}};function d(){return{hash:new Uint8Array,partSetHeader:e.PartSetHeader.fromPartial({})}}e.BlockID={typeUrl:"/tendermint.types.BlockID",encode(u,l=h.BinaryWriter.create()){return u.hash.length!==0&&l.uint32(10).bytes(u.hash),u.partSetHeader!==void 0&&e.PartSetHeader.encode(u.partSetHeader,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=d();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.hash=T.bytes();break;case 2:p.partSetHeader=e.PartSetHeader.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=d();return(0,v.isSet)(u.hash)&&(l.hash=(0,v.bytesFromBase64)(u.hash)),(0,v.isSet)(u.partSetHeader)&&(l.partSetHeader=e.PartSetHeader.fromJSON(u.partSetHeader)),l},toJSON(u){const l={};return u.hash!==void 0&&(l.hash=(0,v.base64FromBytes)(u.hash!==void 0?u.hash:new Uint8Array)),u.partSetHeader!==void 0&&(l.partSetHeader=u.partSetHeader?e.PartSetHeader.toJSON(u.partSetHeader):void 0),l},fromPartial(u){const l=d();return l.hash=u.hash??new Uint8Array,u.partSetHeader!==void 0&&u.partSetHeader!==null&&(l.partSetHeader=e.PartSetHeader.fromPartial(u.partSetHeader)),l}};function s(){return{version:t.Consensus.fromPartial({}),chainId:"",height:BigInt(0),time:r.Timestamp.fromPartial({}),lastBlockId:e.BlockID.fromPartial({}),lastCommitHash:new Uint8Array,dataHash:new Uint8Array,validatorsHash:new Uint8Array,nextValidatorsHash:new Uint8Array,consensusHash:new Uint8Array,appHash:new Uint8Array,lastResultsHash:new Uint8Array,evidenceHash:new Uint8Array,proposerAddress:new Uint8Array}}e.Header={typeUrl:"/tendermint.types.Header",encode(u,l=h.BinaryWriter.create()){return u.version!==void 0&&t.Consensus.encode(u.version,l.uint32(10).fork()).ldelim(),u.chainId!==""&&l.uint32(18).string(u.chainId),u.height!==BigInt(0)&&l.uint32(24).int64(u.height),u.time!==void 0&&r.Timestamp.encode(u.time,l.uint32(34).fork()).ldelim(),u.lastBlockId!==void 0&&e.BlockID.encode(u.lastBlockId,l.uint32(42).fork()).ldelim(),u.lastCommitHash.length!==0&&l.uint32(50).bytes(u.lastCommitHash),u.dataHash.length!==0&&l.uint32(58).bytes(u.dataHash),u.validatorsHash.length!==0&&l.uint32(66).bytes(u.validatorsHash),u.nextValidatorsHash.length!==0&&l.uint32(74).bytes(u.nextValidatorsHash),u.consensusHash.length!==0&&l.uint32(82).bytes(u.consensusHash),u.appHash.length!==0&&l.uint32(90).bytes(u.appHash),u.lastResultsHash.length!==0&&l.uint32(98).bytes(u.lastResultsHash),u.evidenceHash.length!==0&&l.uint32(106).bytes(u.evidenceHash),u.proposerAddress.length!==0&&l.uint32(114).bytes(u.proposerAddress),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=s();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.version=t.Consensus.decode(T,T.uint32());break;case 2:p.chainId=T.string();break;case 3:p.height=T.int64();break;case 4:p.time=r.Timestamp.decode(T,T.uint32());break;case 5:p.lastBlockId=e.BlockID.decode(T,T.uint32());break;case 6:p.lastCommitHash=T.bytes();break;case 7:p.dataHash=T.bytes();break;case 8:p.validatorsHash=T.bytes();break;case 9:p.nextValidatorsHash=T.bytes();break;case 10:p.consensusHash=T.bytes();break;case 11:p.appHash=T.bytes();break;case 12:p.lastResultsHash=T.bytes();break;case 13:p.evidenceHash=T.bytes();break;case 14:p.proposerAddress=T.bytes();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=s();return(0,v.isSet)(u.version)&&(l.version=t.Consensus.fromJSON(u.version)),(0,v.isSet)(u.chainId)&&(l.chainId=String(u.chainId)),(0,v.isSet)(u.height)&&(l.height=BigInt(u.height.toString())),(0,v.isSet)(u.time)&&(l.time=(0,v.fromJsonTimestamp)(u.time)),(0,v.isSet)(u.lastBlockId)&&(l.lastBlockId=e.BlockID.fromJSON(u.lastBlockId)),(0,v.isSet)(u.lastCommitHash)&&(l.lastCommitHash=(0,v.bytesFromBase64)(u.lastCommitHash)),(0,v.isSet)(u.dataHash)&&(l.dataHash=(0,v.bytesFromBase64)(u.dataHash)),(0,v.isSet)(u.validatorsHash)&&(l.validatorsHash=(0,v.bytesFromBase64)(u.validatorsHash)),(0,v.isSet)(u.nextValidatorsHash)&&(l.nextValidatorsHash=(0,v.bytesFromBase64)(u.nextValidatorsHash)),(0,v.isSet)(u.consensusHash)&&(l.consensusHash=(0,v.bytesFromBase64)(u.consensusHash)),(0,v.isSet)(u.appHash)&&(l.appHash=(0,v.bytesFromBase64)(u.appHash)),(0,v.isSet)(u.lastResultsHash)&&(l.lastResultsHash=(0,v.bytesFromBase64)(u.lastResultsHash)),(0,v.isSet)(u.evidenceHash)&&(l.evidenceHash=(0,v.bytesFromBase64)(u.evidenceHash)),(0,v.isSet)(u.proposerAddress)&&(l.proposerAddress=(0,v.bytesFromBase64)(u.proposerAddress)),l},toJSON(u){const l={};return u.version!==void 0&&(l.version=u.version?t.Consensus.toJSON(u.version):void 0),u.chainId!==void 0&&(l.chainId=u.chainId),u.height!==void 0&&(l.height=(u.height||BigInt(0)).toString()),u.time!==void 0&&(l.time=(0,v.fromTimestamp)(u.time).toISOString()),u.lastBlockId!==void 0&&(l.lastBlockId=u.lastBlockId?e.BlockID.toJSON(u.lastBlockId):void 0),u.lastCommitHash!==void 0&&(l.lastCommitHash=(0,v.base64FromBytes)(u.lastCommitHash!==void 0?u.lastCommitHash:new Uint8Array)),u.dataHash!==void 0&&(l.dataHash=(0,v.base64FromBytes)(u.dataHash!==void 0?u.dataHash:new Uint8Array)),u.validatorsHash!==void 0&&(l.validatorsHash=(0,v.base64FromBytes)(u.validatorsHash!==void 0?u.validatorsHash:new Uint8Array)),u.nextValidatorsHash!==void 0&&(l.nextValidatorsHash=(0,v.base64FromBytes)(u.nextValidatorsHash!==void 0?u.nextValidatorsHash:new Uint8Array)),u.consensusHash!==void 0&&(l.consensusHash=(0,v.base64FromBytes)(u.consensusHash!==void 0?u.consensusHash:new Uint8Array)),u.appHash!==void 0&&(l.appHash=(0,v.base64FromBytes)(u.appHash!==void 0?u.appHash:new Uint8Array)),u.lastResultsHash!==void 0&&(l.lastResultsHash=(0,v.base64FromBytes)(u.lastResultsHash!==void 0?u.lastResultsHash:new Uint8Array)),u.evidenceHash!==void 0&&(l.evidenceHash=(0,v.base64FromBytes)(u.evidenceHash!==void 0?u.evidenceHash:new Uint8Array)),u.proposerAddress!==void 0&&(l.proposerAddress=(0,v.base64FromBytes)(u.proposerAddress!==void 0?u.proposerAddress:new Uint8Array)),l},fromPartial(u){const l=s();return u.version!==void 0&&u.version!==null&&(l.version=t.Consensus.fromPartial(u.version)),l.chainId=u.chainId??"",u.height!==void 0&&u.height!==null&&(l.height=BigInt(u.height.toString())),u.time!==void 0&&u.time!==null&&(l.time=r.Timestamp.fromPartial(u.time)),u.lastBlockId!==void 0&&u.lastBlockId!==null&&(l.lastBlockId=e.BlockID.fromPartial(u.lastBlockId)),l.lastCommitHash=u.lastCommitHash??new Uint8Array,l.dataHash=u.dataHash??new Uint8Array,l.validatorsHash=u.validatorsHash??new Uint8Array,l.nextValidatorsHash=u.nextValidatorsHash??new Uint8Array,l.consensusHash=u.consensusHash??new Uint8Array,l.appHash=u.appHash??new Uint8Array,l.lastResultsHash=u.lastResultsHash??new Uint8Array,l.evidenceHash=u.evidenceHash??new Uint8Array,l.proposerAddress=u.proposerAddress??new Uint8Array,l}};function y(){return{txs:[]}}e.Data={typeUrl:"/tendermint.types.Data",encode(u,l=h.BinaryWriter.create()){for(const T of u.txs)l.uint32(10).bytes(T);return l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=y();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.txs.push(T.bytes());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=y();return Array.isArray(u==null?void 0:u.txs)&&(l.txs=u.txs.map(T=>(0,v.bytesFromBase64)(T))),l},toJSON(u){const l={};return u.txs?l.txs=u.txs.map(T=>(0,v.base64FromBytes)(T!==void 0?T:new Uint8Array)):l.txs=[],l},fromPartial(u){var T;const l=y();return l.txs=((T=u.txs)==null?void 0:T.map(f=>f))||[],l}};function E(){return{type:0,height:BigInt(0),round:0,blockId:e.BlockID.fromPartial({}),timestamp:r.Timestamp.fromPartial({}),validatorAddress:new Uint8Array,validatorIndex:0,signature:new Uint8Array}}e.Vote={typeUrl:"/tendermint.types.Vote",encode(u,l=h.BinaryWriter.create()){return u.type!==0&&l.uint32(8).int32(u.type),u.height!==BigInt(0)&&l.uint32(16).int64(u.height),u.round!==0&&l.uint32(24).int32(u.round),u.blockId!==void 0&&e.BlockID.encode(u.blockId,l.uint32(34).fork()).ldelim(),u.timestamp!==void 0&&r.Timestamp.encode(u.timestamp,l.uint32(42).fork()).ldelim(),u.validatorAddress.length!==0&&l.uint32(50).bytes(u.validatorAddress),u.validatorIndex!==0&&l.uint32(56).int32(u.validatorIndex),u.signature.length!==0&&l.uint32(66).bytes(u.signature),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=E();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.type=T.int32();break;case 2:p.height=T.int64();break;case 3:p.round=T.int32();break;case 4:p.blockId=e.BlockID.decode(T,T.uint32());break;case 5:p.timestamp=r.Timestamp.decode(T,T.uint32());break;case 6:p.validatorAddress=T.bytes();break;case 7:p.validatorIndex=T.int32();break;case 8:p.signature=T.bytes();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=E();return(0,v.isSet)(u.type)&&(l.type=I(u.type)),(0,v.isSet)(u.height)&&(l.height=BigInt(u.height.toString())),(0,v.isSet)(u.round)&&(l.round=Number(u.round)),(0,v.isSet)(u.blockId)&&(l.blockId=e.BlockID.fromJSON(u.blockId)),(0,v.isSet)(u.timestamp)&&(l.timestamp=(0,v.fromJsonTimestamp)(u.timestamp)),(0,v.isSet)(u.validatorAddress)&&(l.validatorAddress=(0,v.bytesFromBase64)(u.validatorAddress)),(0,v.isSet)(u.validatorIndex)&&(l.validatorIndex=Number(u.validatorIndex)),(0,v.isSet)(u.signature)&&(l.signature=(0,v.bytesFromBase64)(u.signature)),l},toJSON(u){const l={};return u.type!==void 0&&(l.type=g(u.type)),u.height!==void 0&&(l.height=(u.height||BigInt(0)).toString()),u.round!==void 0&&(l.round=Math.round(u.round)),u.blockId!==void 0&&(l.blockId=u.blockId?e.BlockID.toJSON(u.blockId):void 0),u.timestamp!==void 0&&(l.timestamp=(0,v.fromTimestamp)(u.timestamp).toISOString()),u.validatorAddress!==void 0&&(l.validatorAddress=(0,v.base64FromBytes)(u.validatorAddress!==void 0?u.validatorAddress:new Uint8Array)),u.validatorIndex!==void 0&&(l.validatorIndex=Math.round(u.validatorIndex)),u.signature!==void 0&&(l.signature=(0,v.base64FromBytes)(u.signature!==void 0?u.signature:new Uint8Array)),l},fromPartial(u){const l=E();return l.type=u.type??0,u.height!==void 0&&u.height!==null&&(l.height=BigInt(u.height.toString())),l.round=u.round??0,u.blockId!==void 0&&u.blockId!==null&&(l.blockId=e.BlockID.fromPartial(u.blockId)),u.timestamp!==void 0&&u.timestamp!==null&&(l.timestamp=r.Timestamp.fromPartial(u.timestamp)),l.validatorAddress=u.validatorAddress??new Uint8Array,l.validatorIndex=u.validatorIndex??0,l.signature=u.signature??new Uint8Array,l}};function _(){return{height:BigInt(0),round:0,blockId:e.BlockID.fromPartial({}),signatures:[]}}e.Commit={typeUrl:"/tendermint.types.Commit",encode(u,l=h.BinaryWriter.create()){u.height!==BigInt(0)&&l.uint32(8).int64(u.height),u.round!==0&&l.uint32(16).int32(u.round),u.blockId!==void 0&&e.BlockID.encode(u.blockId,l.uint32(26).fork()).ldelim();for(const T of u.signatures)e.CommitSig.encode(T,l.uint32(34).fork()).ldelim();return l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=_();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.height=T.int64();break;case 2:p.round=T.int32();break;case 3:p.blockId=e.BlockID.decode(T,T.uint32());break;case 4:p.signatures.push(e.CommitSig.decode(T,T.uint32()));break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=_();return(0,v.isSet)(u.height)&&(l.height=BigInt(u.height.toString())),(0,v.isSet)(u.round)&&(l.round=Number(u.round)),(0,v.isSet)(u.blockId)&&(l.blockId=e.BlockID.fromJSON(u.blockId)),Array.isArray(u==null?void 0:u.signatures)&&(l.signatures=u.signatures.map(T=>e.CommitSig.fromJSON(T))),l},toJSON(u){const l={};return u.height!==void 0&&(l.height=(u.height||BigInt(0)).toString()),u.round!==void 0&&(l.round=Math.round(u.round)),u.blockId!==void 0&&(l.blockId=u.blockId?e.BlockID.toJSON(u.blockId):void 0),u.signatures?l.signatures=u.signatures.map(T=>T?e.CommitSig.toJSON(T):void 0):l.signatures=[],l},fromPartial(u){var T;const l=_();return u.height!==void 0&&u.height!==null&&(l.height=BigInt(u.height.toString())),l.round=u.round??0,u.blockId!==void 0&&u.blockId!==null&&(l.blockId=e.BlockID.fromPartial(u.blockId)),l.signatures=((T=u.signatures)==null?void 0:T.map(f=>e.CommitSig.fromPartial(f)))||[],l}};function U(){return{blockIdFlag:0,validatorAddress:new Uint8Array,timestamp:r.Timestamp.fromPartial({}),signature:new Uint8Array}}e.CommitSig={typeUrl:"/tendermint.types.CommitSig",encode(u,l=h.BinaryWriter.create()){return u.blockIdFlag!==0&&l.uint32(8).int32(u.blockIdFlag),u.validatorAddress.length!==0&&l.uint32(18).bytes(u.validatorAddress),u.timestamp!==void 0&&r.Timestamp.encode(u.timestamp,l.uint32(26).fork()).ldelim(),u.signature.length!==0&&l.uint32(34).bytes(u.signature),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=U();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.blockIdFlag=T.int32();break;case 2:p.validatorAddress=T.bytes();break;case 3:p.timestamp=r.Timestamp.decode(T,T.uint32());break;case 4:p.signature=T.bytes();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=U();return(0,v.isSet)(u.blockIdFlag)&&(l.blockIdFlag=w(u.blockIdFlag)),(0,v.isSet)(u.validatorAddress)&&(l.validatorAddress=(0,v.bytesFromBase64)(u.validatorAddress)),(0,v.isSet)(u.timestamp)&&(l.timestamp=(0,v.fromJsonTimestamp)(u.timestamp)),(0,v.isSet)(u.signature)&&(l.signature=(0,v.bytesFromBase64)(u.signature)),l},toJSON(u){const l={};return u.blockIdFlag!==void 0&&(l.blockIdFlag=D(u.blockIdFlag)),u.validatorAddress!==void 0&&(l.validatorAddress=(0,v.base64FromBytes)(u.validatorAddress!==void 0?u.validatorAddress:new Uint8Array)),u.timestamp!==void 0&&(l.timestamp=(0,v.fromTimestamp)(u.timestamp).toISOString()),u.signature!==void 0&&(l.signature=(0,v.base64FromBytes)(u.signature!==void 0?u.signature:new Uint8Array)),l},fromPartial(u){const l=U();return l.blockIdFlag=u.blockIdFlag??0,l.validatorAddress=u.validatorAddress??new Uint8Array,u.timestamp!==void 0&&u.timestamp!==null&&(l.timestamp=r.Timestamp.fromPartial(u.timestamp)),l.signature=u.signature??new Uint8Array,l}};function H(){return{type:0,height:BigInt(0),round:0,polRound:0,blockId:e.BlockID.fromPartial({}),timestamp:r.Timestamp.fromPartial({}),signature:new Uint8Array}}e.Proposal={typeUrl:"/tendermint.types.Proposal",encode(u,l=h.BinaryWriter.create()){return u.type!==0&&l.uint32(8).int32(u.type),u.height!==BigInt(0)&&l.uint32(16).int64(u.height),u.round!==0&&l.uint32(24).int32(u.round),u.polRound!==0&&l.uint32(32).int32(u.polRound),u.blockId!==void 0&&e.BlockID.encode(u.blockId,l.uint32(42).fork()).ldelim(),u.timestamp!==void 0&&r.Timestamp.encode(u.timestamp,l.uint32(50).fork()).ldelim(),u.signature.length!==0&&l.uint32(58).bytes(u.signature),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=H();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.type=T.int32();break;case 2:p.height=T.int64();break;case 3:p.round=T.int32();break;case 4:p.polRound=T.int32();break;case 5:p.blockId=e.BlockID.decode(T,T.uint32());break;case 6:p.timestamp=r.Timestamp.decode(T,T.uint32());break;case 7:p.signature=T.bytes();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=H();return(0,v.isSet)(u.type)&&(l.type=I(u.type)),(0,v.isSet)(u.height)&&(l.height=BigInt(u.height.toString())),(0,v.isSet)(u.round)&&(l.round=Number(u.round)),(0,v.isSet)(u.polRound)&&(l.polRound=Number(u.polRound)),(0,v.isSet)(u.blockId)&&(l.blockId=e.BlockID.fromJSON(u.blockId)),(0,v.isSet)(u.timestamp)&&(l.timestamp=(0,v.fromJsonTimestamp)(u.timestamp)),(0,v.isSet)(u.signature)&&(l.signature=(0,v.bytesFromBase64)(u.signature)),l},toJSON(u){const l={};return u.type!==void 0&&(l.type=g(u.type)),u.height!==void 0&&(l.height=(u.height||BigInt(0)).toString()),u.round!==void 0&&(l.round=Math.round(u.round)),u.polRound!==void 0&&(l.polRound=Math.round(u.polRound)),u.blockId!==void 0&&(l.blockId=u.blockId?e.BlockID.toJSON(u.blockId):void 0),u.timestamp!==void 0&&(l.timestamp=(0,v.fromTimestamp)(u.timestamp).toISOString()),u.signature!==void 0&&(l.signature=(0,v.base64FromBytes)(u.signature!==void 0?u.signature:new Uint8Array)),l},fromPartial(u){const l=H();return l.type=u.type??0,u.height!==void 0&&u.height!==null&&(l.height=BigInt(u.height.toString())),l.round=u.round??0,l.polRound=u.polRound??0,u.blockId!==void 0&&u.blockId!==null&&(l.blockId=e.BlockID.fromPartial(u.blockId)),u.timestamp!==void 0&&u.timestamp!==null&&(l.timestamp=r.Timestamp.fromPartial(u.timestamp)),l.signature=u.signature??new Uint8Array,l}};function i(){return{header:void 0,commit:void 0}}e.SignedHeader={typeUrl:"/tendermint.types.SignedHeader",encode(u,l=h.BinaryWriter.create()){return u.header!==void 0&&e.Header.encode(u.header,l.uint32(10).fork()).ldelim(),u.commit!==void 0&&e.Commit.encode(u.commit,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=i();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.header=e.Header.decode(T,T.uint32());break;case 2:p.commit=e.Commit.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=i();return(0,v.isSet)(u.header)&&(l.header=e.Header.fromJSON(u.header)),(0,v.isSet)(u.commit)&&(l.commit=e.Commit.fromJSON(u.commit)),l},toJSON(u){const l={};return u.header!==void 0&&(l.header=u.header?e.Header.toJSON(u.header):void 0),u.commit!==void 0&&(l.commit=u.commit?e.Commit.toJSON(u.commit):void 0),l},fromPartial(u){const l=i();return u.header!==void 0&&u.header!==null&&(l.header=e.Header.fromPartial(u.header)),u.commit!==void 0&&u.commit!==null&&(l.commit=e.Commit.fromPartial(u.commit)),l}};function m(){return{signedHeader:void 0,validatorSet:void 0}}e.LightBlock={typeUrl:"/tendermint.types.LightBlock",encode(u,l=h.BinaryWriter.create()){return u.signedHeader!==void 0&&e.SignedHeader.encode(u.signedHeader,l.uint32(10).fork()).ldelim(),u.validatorSet!==void 0&&o.ValidatorSet.encode(u.validatorSet,l.uint32(18).fork()).ldelim(),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=m();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.signedHeader=e.SignedHeader.decode(T,T.uint32());break;case 2:p.validatorSet=o.ValidatorSet.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=m();return(0,v.isSet)(u.signedHeader)&&(l.signedHeader=e.SignedHeader.fromJSON(u.signedHeader)),(0,v.isSet)(u.validatorSet)&&(l.validatorSet=o.ValidatorSet.fromJSON(u.validatorSet)),l},toJSON(u){const l={};return u.signedHeader!==void 0&&(l.signedHeader=u.signedHeader?e.SignedHeader.toJSON(u.signedHeader):void 0),u.validatorSet!==void 0&&(l.validatorSet=u.validatorSet?o.ValidatorSet.toJSON(u.validatorSet):void 0),l},fromPartial(u){const l=m();return u.signedHeader!==void 0&&u.signedHeader!==null&&(l.signedHeader=e.SignedHeader.fromPartial(u.signedHeader)),u.validatorSet!==void 0&&u.validatorSet!==null&&(l.validatorSet=o.ValidatorSet.fromPartial(u.validatorSet)),l}};function N(){return{blockId:e.BlockID.fromPartial({}),blockSize:BigInt(0),header:e.Header.fromPartial({}),numTxs:BigInt(0)}}e.BlockMeta={typeUrl:"/tendermint.types.BlockMeta",encode(u,l=h.BinaryWriter.create()){return u.blockId!==void 0&&e.BlockID.encode(u.blockId,l.uint32(10).fork()).ldelim(),u.blockSize!==BigInt(0)&&l.uint32(16).int64(u.blockSize),u.header!==void 0&&e.Header.encode(u.header,l.uint32(26).fork()).ldelim(),u.numTxs!==BigInt(0)&&l.uint32(32).int64(u.numTxs),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=N();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.blockId=e.BlockID.decode(T,T.uint32());break;case 2:p.blockSize=T.int64();break;case 3:p.header=e.Header.decode(T,T.uint32());break;case 4:p.numTxs=T.int64();break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=N();return(0,v.isSet)(u.blockId)&&(l.blockId=e.BlockID.fromJSON(u.blockId)),(0,v.isSet)(u.blockSize)&&(l.blockSize=BigInt(u.blockSize.toString())),(0,v.isSet)(u.header)&&(l.header=e.Header.fromJSON(u.header)),(0,v.isSet)(u.numTxs)&&(l.numTxs=BigInt(u.numTxs.toString())),l},toJSON(u){const l={};return u.blockId!==void 0&&(l.blockId=u.blockId?e.BlockID.toJSON(u.blockId):void 0),u.blockSize!==void 0&&(l.blockSize=(u.blockSize||BigInt(0)).toString()),u.header!==void 0&&(l.header=u.header?e.Header.toJSON(u.header):void 0),u.numTxs!==void 0&&(l.numTxs=(u.numTxs||BigInt(0)).toString()),l},fromPartial(u){const l=N();return u.blockId!==void 0&&u.blockId!==null&&(l.blockId=e.BlockID.fromPartial(u.blockId)),u.blockSize!==void 0&&u.blockSize!==null&&(l.blockSize=BigInt(u.blockSize.toString())),u.header!==void 0&&u.header!==null&&(l.header=e.Header.fromPartial(u.header)),u.numTxs!==void 0&&u.numTxs!==null&&(l.numTxs=BigInt(u.numTxs.toString())),l}};function V(){return{rootHash:new Uint8Array,data:new Uint8Array,proof:void 0}}e.TxProof={typeUrl:"/tendermint.types.TxProof",encode(u,l=h.BinaryWriter.create()){return u.rootHash.length!==0&&l.uint32(10).bytes(u.rootHash),u.data.length!==0&&l.uint32(18).bytes(u.data),u.proof!==void 0&&n.Proof.encode(u.proof,l.uint32(26).fork()).ldelim(),l},decode(u,l){const T=u instanceof h.BinaryReader?u:new h.BinaryReader(u);let f=l===void 0?T.len:T.pos+l;const p=V();for(;T.pos<f;){const A=T.uint32();switch(A>>>3){case 1:p.rootHash=T.bytes();break;case 2:p.data=T.bytes();break;case 3:p.proof=n.Proof.decode(T,T.uint32());break;default:T.skipType(A&7);break}}return p},fromJSON(u){const l=V();return(0,v.isSet)(u.rootHash)&&(l.rootHash=(0,v.bytesFromBase64)(u.rootHash)),(0,v.isSet)(u.data)&&(l.data=(0,v.bytesFromBase64)(u.data)),(0,v.isSet)(u.proof)&&(l.proof=n.Proof.fromJSON(u.proof)),l},toJSON(u){const l={};return u.rootHash!==void 0&&(l.rootHash=(0,v.base64FromBytes)(u.rootHash!==void 0?u.rootHash:new Uint8Array)),u.data!==void 0&&(l.data=(0,v.base64FromBytes)(u.data!==void 0?u.data:new Uint8Array)),u.proof!==void 0&&(l.proof=u.proof?n.Proof.toJSON(u.proof):void 0),l},fromPartial(u){const l=V();return l.rootHash=u.rootHash??new Uint8Array,l.data=u.data??new Uint8Array,u.proof!==void 0&&u.proof!==null&&(l.proof=n.Proof.fromPartial(u.proof)),l}}})(dr);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=e.Header=e.Misbehaviour=e.ConsensusState=e.ClientState=e.protobufPackage=void 0;const n=hn,t=sr,r=_c,o=Mn,h=pn,v=dr,C=cs,w=ee,D=ne;e.protobufPackage="ibc.lightclients.tendermint.v1";function J(){return{chainId:"",trustLevel:e.Fraction.fromPartial({}),trustingPeriod:n.Duration.fromPartial({}),unbondingPeriod:n.Duration.fromPartial({}),maxClockDrift:n.Duration.fromPartial({}),frozenHeight:t.Height.fromPartial({}),latestHeight:t.Height.fromPartial({}),proofSpecs:[],upgradePath:[],allowUpdateAfterExpiry:!1,allowUpdateAfterMisbehaviour:!1}}e.ClientState={typeUrl:"/ibc.lightclients.tendermint.v1.ClientState",encode(d,s=w.BinaryWriter.create()){d.chainId!==""&&s.uint32(10).string(d.chainId),d.trustLevel!==void 0&&e.Fraction.encode(d.trustLevel,s.uint32(18).fork()).ldelim(),d.trustingPeriod!==void 0&&n.Duration.encode(d.trustingPeriod,s.uint32(26).fork()).ldelim(),d.unbondingPeriod!==void 0&&n.Duration.encode(d.unbondingPeriod,s.uint32(34).fork()).ldelim(),d.maxClockDrift!==void 0&&n.Duration.encode(d.maxClockDrift,s.uint32(42).fork()).ldelim(),d.frozenHeight!==void 0&&t.Height.encode(d.frozenHeight,s.uint32(50).fork()).ldelim(),d.latestHeight!==void 0&&t.Height.encode(d.latestHeight,s.uint32(58).fork()).ldelim();for(const y of d.proofSpecs)r.ProofSpec.encode(y,s.uint32(66).fork()).ldelim();for(const y of d.upgradePath)s.uint32(74).string(y);return d.allowUpdateAfterExpiry===!0&&s.uint32(80).bool(d.allowUpdateAfterExpiry),d.allowUpdateAfterMisbehaviour===!0&&s.uint32(88).bool(d.allowUpdateAfterMisbehaviour),s},decode(d,s){const y=d instanceof w.BinaryReader?d:new w.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=J();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.chainId=y.string();break;case 2:_.trustLevel=e.Fraction.decode(y,y.uint32());break;case 3:_.trustingPeriod=n.Duration.decode(y,y.uint32());break;case 4:_.unbondingPeriod=n.Duration.decode(y,y.uint32());break;case 5:_.maxClockDrift=n.Duration.decode(y,y.uint32());break;case 6:_.frozenHeight=t.Height.decode(y,y.uint32());break;case 7:_.latestHeight=t.Height.decode(y,y.uint32());break;case 8:_.proofSpecs.push(r.ProofSpec.decode(y,y.uint32()));break;case 9:_.upgradePath.push(y.string());break;case 10:_.allowUpdateAfterExpiry=y.bool();break;case 11:_.allowUpdateAfterMisbehaviour=y.bool();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=J();return(0,D.isSet)(d.chainId)&&(s.chainId=String(d.chainId)),(0,D.isSet)(d.trustLevel)&&(s.trustLevel=e.Fraction.fromJSON(d.trustLevel)),(0,D.isSet)(d.trustingPeriod)&&(s.trustingPeriod=n.Duration.fromJSON(d.trustingPeriod)),(0,D.isSet)(d.unbondingPeriod)&&(s.unbondingPeriod=n.Duration.fromJSON(d.unbondingPeriod)),(0,D.isSet)(d.maxClockDrift)&&(s.maxClockDrift=n.Duration.fromJSON(d.maxClockDrift)),(0,D.isSet)(d.frozenHeight)&&(s.frozenHeight=t.Height.fromJSON(d.frozenHeight)),(0,D.isSet)(d.latestHeight)&&(s.latestHeight=t.Height.fromJSON(d.latestHeight)),Array.isArray(d==null?void 0:d.proofSpecs)&&(s.proofSpecs=d.proofSpecs.map(y=>r.ProofSpec.fromJSON(y))),Array.isArray(d==null?void 0:d.upgradePath)&&(s.upgradePath=d.upgradePath.map(y=>String(y))),(0,D.isSet)(d.allowUpdateAfterExpiry)&&(s.allowUpdateAfterExpiry=!!d.allowUpdateAfterExpiry),(0,D.isSet)(d.allowUpdateAfterMisbehaviour)&&(s.allowUpdateAfterMisbehaviour=!!d.allowUpdateAfterMisbehaviour),s},toJSON(d){const s={};return d.chainId!==void 0&&(s.chainId=d.chainId),d.trustLevel!==void 0&&(s.trustLevel=d.trustLevel?e.Fraction.toJSON(d.trustLevel):void 0),d.trustingPeriod!==void 0&&(s.trustingPeriod=d.trustingPeriod?n.Duration.toJSON(d.trustingPeriod):void 0),d.unbondingPeriod!==void 0&&(s.unbondingPeriod=d.unbondingPeriod?n.Duration.toJSON(d.unbondingPeriod):void 0),d.maxClockDrift!==void 0&&(s.maxClockDrift=d.maxClockDrift?n.Duration.toJSON(d.maxClockDrift):void 0),d.frozenHeight!==void 0&&(s.frozenHeight=d.frozenHeight?t.Height.toJSON(d.frozenHeight):void 0),d.latestHeight!==void 0&&(s.latestHeight=d.latestHeight?t.Height.toJSON(d.latestHeight):void 0),d.proofSpecs?s.proofSpecs=d.proofSpecs.map(y=>y?r.ProofSpec.toJSON(y):void 0):s.proofSpecs=[],d.upgradePath?s.upgradePath=d.upgradePath.map(y=>y):s.upgradePath=[],d.allowUpdateAfterExpiry!==void 0&&(s.allowUpdateAfterExpiry=d.allowUpdateAfterExpiry),d.allowUpdateAfterMisbehaviour!==void 0&&(s.allowUpdateAfterMisbehaviour=d.allowUpdateAfterMisbehaviour),s},fromPartial(d){var y,E;const s=J();return s.chainId=d.chainId??"",d.trustLevel!==void 0&&d.trustLevel!==null&&(s.trustLevel=e.Fraction.fromPartial(d.trustLevel)),d.trustingPeriod!==void 0&&d.trustingPeriod!==null&&(s.trustingPeriod=n.Duration.fromPartial(d.trustingPeriod)),d.unbondingPeriod!==void 0&&d.unbondingPeriod!==null&&(s.unbondingPeriod=n.Duration.fromPartial(d.unbondingPeriod)),d.maxClockDrift!==void 0&&d.maxClockDrift!==null&&(s.maxClockDrift=n.Duration.fromPartial(d.maxClockDrift)),d.frozenHeight!==void 0&&d.frozenHeight!==null&&(s.frozenHeight=t.Height.fromPartial(d.frozenHeight)),d.latestHeight!==void 0&&d.latestHeight!==null&&(s.latestHeight=t.Height.fromPartial(d.latestHeight)),s.proofSpecs=((y=d.proofSpecs)==null?void 0:y.map(_=>r.ProofSpec.fromPartial(_)))||[],s.upgradePath=((E=d.upgradePath)==null?void 0:E.map(_=>_))||[],s.allowUpdateAfterExpiry=d.allowUpdateAfterExpiry??!1,s.allowUpdateAfterMisbehaviour=d.allowUpdateAfterMisbehaviour??!1,s}};function I(){return{timestamp:o.Timestamp.fromPartial({}),root:h.MerkleRoot.fromPartial({}),nextValidatorsHash:new Uint8Array}}e.ConsensusState={typeUrl:"/ibc.lightclients.tendermint.v1.ConsensusState",encode(d,s=w.BinaryWriter.create()){return d.timestamp!==void 0&&o.Timestamp.encode(d.timestamp,s.uint32(10).fork()).ldelim(),d.root!==void 0&&h.MerkleRoot.encode(d.root,s.uint32(18).fork()).ldelim(),d.nextValidatorsHash.length!==0&&s.uint32(26).bytes(d.nextValidatorsHash),s},decode(d,s){const y=d instanceof w.BinaryReader?d:new w.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=I();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.timestamp=o.Timestamp.decode(y,y.uint32());break;case 2:_.root=h.MerkleRoot.decode(y,y.uint32());break;case 3:_.nextValidatorsHash=y.bytes();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=I();return(0,D.isSet)(d.timestamp)&&(s.timestamp=(0,D.fromJsonTimestamp)(d.timestamp)),(0,D.isSet)(d.root)&&(s.root=h.MerkleRoot.fromJSON(d.root)),(0,D.isSet)(d.nextValidatorsHash)&&(s.nextValidatorsHash=(0,D.bytesFromBase64)(d.nextValidatorsHash)),s},toJSON(d){const s={};return d.timestamp!==void 0&&(s.timestamp=(0,D.fromTimestamp)(d.timestamp).toISOString()),d.root!==void 0&&(s.root=d.root?h.MerkleRoot.toJSON(d.root):void 0),d.nextValidatorsHash!==void 0&&(s.nextValidatorsHash=(0,D.base64FromBytes)(d.nextValidatorsHash!==void 0?d.nextValidatorsHash:new Uint8Array)),s},fromPartial(d){const s=I();return d.timestamp!==void 0&&d.timestamp!==null&&(s.timestamp=o.Timestamp.fromPartial(d.timestamp)),d.root!==void 0&&d.root!==null&&(s.root=h.MerkleRoot.fromPartial(d.root)),s.nextValidatorsHash=d.nextValidatorsHash??new Uint8Array,s}};function g(){return{clientId:"",header1:void 0,header2:void 0}}e.Misbehaviour={typeUrl:"/ibc.lightclients.tendermint.v1.Misbehaviour",encode(d,s=w.BinaryWriter.create()){return d.clientId!==""&&s.uint32(10).string(d.clientId),d.header1!==void 0&&e.Header.encode(d.header1,s.uint32(18).fork()).ldelim(),d.header2!==void 0&&e.Header.encode(d.header2,s.uint32(26).fork()).ldelim(),s},decode(d,s){const y=d instanceof w.BinaryReader?d:new w.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=g();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.clientId=y.string();break;case 2:_.header1=e.Header.decode(y,y.uint32());break;case 3:_.header2=e.Header.decode(y,y.uint32());break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=g();return(0,D.isSet)(d.clientId)&&(s.clientId=String(d.clientId)),(0,D.isSet)(d.header1)&&(s.header1=e.Header.fromJSON(d.header1)),(0,D.isSet)(d.header2)&&(s.header2=e.Header.fromJSON(d.header2)),s},toJSON(d){const s={};return d.clientId!==void 0&&(s.clientId=d.clientId),d.header1!==void 0&&(s.header1=d.header1?e.Header.toJSON(d.header1):void 0),d.header2!==void 0&&(s.header2=d.header2?e.Header.toJSON(d.header2):void 0),s},fromPartial(d){const s=g();return s.clientId=d.clientId??"",d.header1!==void 0&&d.header1!==null&&(s.header1=e.Header.fromPartial(d.header1)),d.header2!==void 0&&d.header2!==null&&(s.header2=e.Header.fromPartial(d.header2)),s}};function R(){return{signedHeader:void 0,validatorSet:void 0,trustedHeight:t.Height.fromPartial({}),trustedValidators:void 0}}e.Header={typeUrl:"/ibc.lightclients.tendermint.v1.Header",encode(d,s=w.BinaryWriter.create()){return d.signedHeader!==void 0&&v.SignedHeader.encode(d.signedHeader,s.uint32(10).fork()).ldelim(),d.validatorSet!==void 0&&C.ValidatorSet.encode(d.validatorSet,s.uint32(18).fork()).ldelim(),d.trustedHeight!==void 0&&t.Height.encode(d.trustedHeight,s.uint32(26).fork()).ldelim(),d.trustedValidators!==void 0&&C.ValidatorSet.encode(d.trustedValidators,s.uint32(34).fork()).ldelim(),s},decode(d,s){const y=d instanceof w.BinaryReader?d:new w.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=R();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.signedHeader=v.SignedHeader.decode(y,y.uint32());break;case 2:_.validatorSet=C.ValidatorSet.decode(y,y.uint32());break;case 3:_.trustedHeight=t.Height.decode(y,y.uint32());break;case 4:_.trustedValidators=C.ValidatorSet.decode(y,y.uint32());break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=R();return(0,D.isSet)(d.signedHeader)&&(s.signedHeader=v.SignedHeader.fromJSON(d.signedHeader)),(0,D.isSet)(d.validatorSet)&&(s.validatorSet=C.ValidatorSet.fromJSON(d.validatorSet)),(0,D.isSet)(d.trustedHeight)&&(s.trustedHeight=t.Height.fromJSON(d.trustedHeight)),(0,D.isSet)(d.trustedValidators)&&(s.trustedValidators=C.ValidatorSet.fromJSON(d.trustedValidators)),s},toJSON(d){const s={};return d.signedHeader!==void 0&&(s.signedHeader=d.signedHeader?v.SignedHeader.toJSON(d.signedHeader):void 0),d.validatorSet!==void 0&&(s.validatorSet=d.validatorSet?C.ValidatorSet.toJSON(d.validatorSet):void 0),d.trustedHeight!==void 0&&(s.trustedHeight=d.trustedHeight?t.Height.toJSON(d.trustedHeight):void 0),d.trustedValidators!==void 0&&(s.trustedValidators=d.trustedValidators?C.ValidatorSet.toJSON(d.trustedValidators):void 0),s},fromPartial(d){const s=R();return d.signedHeader!==void 0&&d.signedHeader!==null&&(s.signedHeader=v.SignedHeader.fromPartial(d.signedHeader)),d.validatorSet!==void 0&&d.validatorSet!==null&&(s.validatorSet=C.ValidatorSet.fromPartial(d.validatorSet)),d.trustedHeight!==void 0&&d.trustedHeight!==null&&(s.trustedHeight=t.Height.fromPartial(d.trustedHeight)),d.trustedValidators!==void 0&&d.trustedValidators!==null&&(s.trustedValidators=C.ValidatorSet.fromPartial(d.trustedValidators)),s}};function B(){return{numerator:BigInt(0),denominator:BigInt(0)}}e.Fraction={typeUrl:"/ibc.lightclients.tendermint.v1.Fraction",encode(d,s=w.BinaryWriter.create()){return d.numerator!==BigInt(0)&&s.uint32(8).uint64(d.numerator),d.denominator!==BigInt(0)&&s.uint32(16).uint64(d.denominator),s},decode(d,s){const y=d instanceof w.BinaryReader?d:new w.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=B();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.numerator=y.uint64();break;case 2:_.denominator=y.uint64();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=B();return(0,D.isSet)(d.numerator)&&(s.numerator=BigInt(d.numerator.toString())),(0,D.isSet)(d.denominator)&&(s.denominator=BigInt(d.denominator.toString())),s},toJSON(d){const s={};return d.numerator!==void 0&&(s.numerator=(d.numerator||BigInt(0)).toString()),d.denominator!==void 0&&(s.denominator=(d.denominator||BigInt(0)).toString()),s},fromPartial(d){const s=B();return d.numerator!==void 0&&d.numerator!==null&&(s.numerator=BigInt(d.numerator.toString())),d.denominator!==void 0&&d.denominator!==null&&(s.denominator=BigInt(d.denominator.toString())),s}}})(Jm);Object.defineProperty(us,"__esModule",{value:!0});us.setupIbcExtension=void 0;const Vo=de,hR=Te,Wl=wm,gR=ds,Dt=Em,Hi=_m,nu=Um,Dm=Jm,ve=Ke;function tu(e){if((e==null?void 0:e.typeUrl)!=="/ibc.lightclients.tendermint.v1.ClientState")throw new Error(`Unexpected client state type: ${e==null?void 0:e.typeUrl}`);return Dm.ClientState.decode(e.value)}function SR(e){if((e==null?void 0:e.typeUrl)!=="/ibc.lightclients.tendermint.v1.ConsensusState")throw new Error(`Unexpected client state type: ${e==null?void 0:e.typeUrl}`);return Dm.ConsensusState.decode(e.value)}function kR(e){const n=(0,ve.createProtobufRpcClient)(e),t=new Dt.QueryClientImpl(n),r=new Hi.QueryClientImpl(n),o=new nu.QueryClientImpl(n),h=new Wl.QueryClientImpl(n);return{ibc:{channel:{channel:async(v,C)=>t.Channel({portId:v,channelId:C}),channels:async v=>t.Channels({pagination:(0,ve.createPagination)(v)}),allChannels:async()=>{var D;const v=[];let C,w;do C=await t.Channels({pagination:(0,ve.createPagination)(w)}),v.push(...C.channels),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return Dt.QueryChannelsResponse.fromPartial({channels:v,height:C.height})},connectionChannels:async(v,C)=>t.ConnectionChannels({connection:v,pagination:(0,ve.createPagination)(C)}),allConnectionChannels:async v=>{var J;const C=[];let w,D;do w=await t.ConnectionChannels({connection:v,pagination:(0,ve.createPagination)(D)}),C.push(...w.channels),D=(J=w.pagination)==null?void 0:J.nextKey;while(D&&D.length);return Dt.QueryConnectionChannelsResponse.fromPartial({channels:C,height:w.height})},clientState:async(v,C)=>t.ChannelClientState({portId:v,channelId:C}),consensusState:async(v,C,w,D)=>t.ChannelConsensusState({portId:v,channelId:C,revisionNumber:BigInt(w),revisionHeight:BigInt(D)}),packetCommitment:async(v,C,w)=>t.PacketCommitment({portId:v,channelId:C,sequence:(0,ve.longify)(w)}),packetCommitments:async(v,C,w)=>t.PacketCommitments({channelId:C,portId:v,pagination:(0,ve.createPagination)(w)}),allPacketCommitments:async(v,C)=>{var I;const w=[];let D,J;do D=await t.PacketCommitments({channelId:C,portId:v,pagination:(0,ve.createPagination)(J)}),w.push(...D.commitments),J=(I=D.pagination)==null?void 0:I.nextKey;while(J&&J.length);return Dt.QueryPacketCommitmentsResponse.fromPartial({commitments:w,height:D.height})},packetReceipt:async(v,C,w)=>t.PacketReceipt({portId:v,channelId:C,sequence:(0,ve.longify)(w)}),packetAcknowledgement:async(v,C,w)=>t.PacketAcknowledgement({portId:v,channelId:C,sequence:(0,ve.longify)(w)}),packetAcknowledgements:async(v,C,w)=>{const D=Dt.QueryPacketAcknowledgementsRequest.fromPartial({portId:v,channelId:C,pagination:(0,ve.createPagination)(w)});return t.PacketAcknowledgements(D)},allPacketAcknowledgements:async(v,C)=>{var I;const w=[];let D,J;do{const g=Dt.QueryPacketAcknowledgementsRequest.fromPartial({channelId:C,portId:v,pagination:(0,ve.createPagination)(J)});D=await t.PacketAcknowledgements(g),w.push(...D.acknowledgements),J=(I=D.pagination)==null?void 0:I.nextKey}while(J&&J.length);return Dt.QueryPacketAcknowledgementsResponse.fromPartial({acknowledgements:w,height:D.height})},unreceivedPackets:async(v,C,w)=>t.UnreceivedPackets({portId:v,channelId:C,packetCommitmentSequences:w.map(D=>BigInt(D))}),unreceivedAcks:async(v,C,w)=>t.UnreceivedAcks({portId:v,channelId:C,packetAckSequences:w.map(D=>BigInt(D))}),nextSequenceReceive:async(v,C)=>t.NextSequenceReceive({portId:v,channelId:C})},client:{state:async v=>r.ClientState({clientId:v}),states:async v=>r.ClientStates({pagination:(0,ve.createPagination)(v)}),allStates:async()=>{var D;const v=[];let C,w;do C=await r.ClientStates({pagination:(0,ve.createPagination)(w)}),v.push(...C.clientStates),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return Hi.QueryClientStatesResponse.fromPartial({clientStates:v})},consensusState:async(v,C)=>r.ConsensusState(Hi.QueryConsensusStateRequest.fromPartial({clientId:v,revisionHeight:C!==void 0?BigInt(C):void 0,latestHeight:C===void 0})),consensusStates:async(v,C)=>r.ConsensusStates({clientId:v,pagination:(0,ve.createPagination)(C)}),allConsensusStates:async v=>{var J;const C=[];let w,D;do w=await r.ConsensusStates({clientId:v,pagination:(0,ve.createPagination)(D)}),C.push(...w.consensusStates),D=(J=w.pagination)==null?void 0:J.nextKey;while(D&&D.length);return Hi.QueryConsensusStatesResponse.fromPartial({consensusStates:C})},params:async()=>r.ClientParams({}),stateTm:async v=>{const C=await r.ClientState({clientId:v});return tu(C.clientState)},statesTm:async v=>{const{clientStates:C}=await r.ClientStates({pagination:(0,ve.createPagination)(v)});return C.map(({clientState:w})=>tu(w))},allStatesTm:async()=>{var D;const v=[];let C,w;do C=await r.ClientStates({pagination:(0,ve.createPagination)(w)}),v.push(...C.clientStates),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return v.map(({clientState:J})=>tu(J))},consensusStateTm:async(v,C)=>{const w=await r.ConsensusState(Hi.QueryConsensusStateRequest.fromPartial({clientId:v,revisionHeight:C==null?void 0:C.revisionHeight,revisionNumber:C==null?void 0:C.revisionNumber,latestHeight:C===void 0}));return SR(w.consensusState)}},connection:{connection:async v=>o.Connection({connectionId:v}),connections:async v=>o.Connections({pagination:(0,ve.createPagination)(v)}),allConnections:async()=>{var D;const v=[];let C,w;do C=await o.Connections({pagination:(0,ve.createPagination)(w)}),v.push(...C.connections),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return nu.QueryConnectionsResponse.fromPartial({connections:v,height:C.height})},clientConnections:async v=>o.ClientConnections({clientId:v}),clientState:async v=>o.ConnectionClientState({connectionId:v}),consensusState:async(v,C)=>o.ConnectionConsensusState(nu.QueryConnectionConsensusStateRequest.fromPartial({connectionId:v,revisionHeight:BigInt(C)}))},transfer:{denomTrace:async v=>h.DenomTrace({hash:v}),denomTraces:async v=>h.DenomTraces({pagination:(0,ve.createPagination)(v)}),allDenomTraces:async()=>{var D;const v=[];let C,w;do C=await h.DenomTraces({pagination:(0,ve.createPagination)(w)}),v.push(...C.denomTraces),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return Wl.QueryDenomTracesResponse.fromPartial({denomTraces:v})},params:async()=>h.Params({})},verified:{channel:{channel:async(v,C)=>{const w=(0,Vo.toAscii)(`channelEnds/ports/${v}/channels/${C}`),{value:D}=await e.queryStoreVerified("ibc",w);return D.length?gR.Channel.decode(D):null},packetCommitment:async(v,C,w)=>{const D=(0,Vo.toAscii)(`commitments/ports/${v}/channels/${C}/packets/${w}`),{value:J}=await e.queryStoreVerified("ibc",D);return J},packetAcknowledgement:async(v,C,w)=>{const D=(0,Vo.toAscii)(`acks/ports/${v}/channels/${C}/acknowledgements/${w}`),{value:J}=await e.queryStoreVerified("ibc",D);return J},nextSequenceReceive:async(v,C)=>{const w=(0,Vo.toAscii)(`seqAcks/ports/${v}/channels/${C}/nextSequenceAck`),{value:D}=await e.queryStoreVerified("ibc",w);return D.length?hR.Uint64.fromBytes(D).toNumber():null}}}}}}us.setupIbcExtension=kR;var ls={},Mm={},Tt={};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Params=Tt.Minter=Tt.protobufPackage=void 0;const Wr=ee,St=ne;Tt.protobufPackage="cosmos.mint.v1beta1";function ru(){return{inflation:"",annualProvisions:""}}Tt.Minter={typeUrl:"/cosmos.mint.v1beta1.Minter",encode(e,n=Wr.BinaryWriter.create()){return e.inflation!==""&&n.uint32(10).string(e.inflation),e.annualProvisions!==""&&n.uint32(18).string(e.annualProvisions),n},decode(e,n){const t=e instanceof Wr.BinaryReader?e:new Wr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=ru();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.inflation=t.string();break;case 2:o.annualProvisions=t.string();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=ru();return(0,St.isSet)(e.inflation)&&(n.inflation=String(e.inflation)),(0,St.isSet)(e.annualProvisions)&&(n.annualProvisions=String(e.annualProvisions)),n},toJSON(e){const n={};return e.inflation!==void 0&&(n.inflation=e.inflation),e.annualProvisions!==void 0&&(n.annualProvisions=e.annualProvisions),n},fromPartial(e){const n=ru();return n.inflation=e.inflation??"",n.annualProvisions=e.annualProvisions??"",n}};function iu(){return{mintDenom:"",inflationRateChange:"",inflationMax:"",inflationMin:"",goalBonded:"",blocksPerYear:BigInt(0)}}Tt.Params={typeUrl:"/cosmos.mint.v1beta1.Params",encode(e,n=Wr.BinaryWriter.create()){return e.mintDenom!==""&&n.uint32(10).string(e.mintDenom),e.inflationRateChange!==""&&n.uint32(18).string(e.inflationRateChange),e.inflationMax!==""&&n.uint32(26).string(e.inflationMax),e.inflationMin!==""&&n.uint32(34).string(e.inflationMin),e.goalBonded!==""&&n.uint32(42).string(e.goalBonded),e.blocksPerYear!==BigInt(0)&&n.uint32(48).uint64(e.blocksPerYear),n},decode(e,n){const t=e instanceof Wr.BinaryReader?e:new Wr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=iu();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.mintDenom=t.string();break;case 2:o.inflationRateChange=t.string();break;case 3:o.inflationMax=t.string();break;case 4:o.inflationMin=t.string();break;case 5:o.goalBonded=t.string();break;case 6:o.blocksPerYear=t.uint64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=iu();return(0,St.isSet)(e.mintDenom)&&(n.mintDenom=String(e.mintDenom)),(0,St.isSet)(e.inflationRateChange)&&(n.inflationRateChange=String(e.inflationRateChange)),(0,St.isSet)(e.inflationMax)&&(n.inflationMax=String(e.inflationMax)),(0,St.isSet)(e.inflationMin)&&(n.inflationMin=String(e.inflationMin)),(0,St.isSet)(e.goalBonded)&&(n.goalBonded=String(e.goalBonded)),(0,St.isSet)(e.blocksPerYear)&&(n.blocksPerYear=BigInt(e.blocksPerYear.toString())),n},toJSON(e){const n={};return e.mintDenom!==void 0&&(n.mintDenom=e.mintDenom),e.inflationRateChange!==void 0&&(n.inflationRateChange=e.inflationRateChange),e.inflationMax!==void 0&&(n.inflationMax=e.inflationMax),e.inflationMin!==void 0&&(n.inflationMin=e.inflationMin),e.goalBonded!==void 0&&(n.goalBonded=e.goalBonded),e.blocksPerYear!==void 0&&(n.blocksPerYear=(e.blocksPerYear||BigInt(0)).toString()),n},fromPartial(e){const n=iu();return n.mintDenom=e.mintDenom??"",n.inflationRateChange=e.inflationRateChange??"",n.inflationMax=e.inflationMax??"",n.inflationMin=e.inflationMin??"",n.goalBonded=e.goalBonded??"",e.blocksPerYear!==void 0&&e.blocksPerYear!==null&&(n.blocksPerYear=BigInt(e.blocksPerYear.toString())),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryAnnualProvisionsResponse=e.QueryAnnualProvisionsRequest=e.QueryInflationResponse=e.QueryInflationRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.protobufPackage=void 0;const n=Tt,t=ee,r=ne;e.protobufPackage="cosmos.mint.v1beta1";function o(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.mint.v1beta1.QueryParamsRequest",encode(I,g=t.BinaryWriter.create()){return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=o();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){default:R.skipType(s&7);break}}return d},fromJSON(I){return o()},toJSON(I){return{}},fromPartial(I){return o()}};function h(){return{params:n.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.mint.v1beta1.QueryParamsResponse",encode(I,g=t.BinaryWriter.create()){return I.params!==void 0&&n.Params.encode(I.params,g.uint32(10).fork()).ldelim(),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=h();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.params=n.Params.decode(R,R.uint32());break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=h();return(0,r.isSet)(I.params)&&(g.params=n.Params.fromJSON(I.params)),g},toJSON(I){const g={};return I.params!==void 0&&(g.params=I.params?n.Params.toJSON(I.params):void 0),g},fromPartial(I){const g=h();return I.params!==void 0&&I.params!==null&&(g.params=n.Params.fromPartial(I.params)),g}};function v(){return{}}e.QueryInflationRequest={typeUrl:"/cosmos.mint.v1beta1.QueryInflationRequest",encode(I,g=t.BinaryWriter.create()){return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=v();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){default:R.skipType(s&7);break}}return d},fromJSON(I){return v()},toJSON(I){return{}},fromPartial(I){return v()}};function C(){return{inflation:new Uint8Array}}e.QueryInflationResponse={typeUrl:"/cosmos.mint.v1beta1.QueryInflationResponse",encode(I,g=t.BinaryWriter.create()){return I.inflation.length!==0&&g.uint32(10).bytes(I.inflation),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=C();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.inflation=R.bytes();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=C();return(0,r.isSet)(I.inflation)&&(g.inflation=(0,r.bytesFromBase64)(I.inflation)),g},toJSON(I){const g={};return I.inflation!==void 0&&(g.inflation=(0,r.base64FromBytes)(I.inflation!==void 0?I.inflation:new Uint8Array)),g},fromPartial(I){const g=C();return g.inflation=I.inflation??new Uint8Array,g}};function w(){return{}}e.QueryAnnualProvisionsRequest={typeUrl:"/cosmos.mint.v1beta1.QueryAnnualProvisionsRequest",encode(I,g=t.BinaryWriter.create()){return g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=w();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){default:R.skipType(s&7);break}}return d},fromJSON(I){return w()},toJSON(I){return{}},fromPartial(I){return w()}};function D(){return{annualProvisions:new Uint8Array}}e.QueryAnnualProvisionsResponse={typeUrl:"/cosmos.mint.v1beta1.QueryAnnualProvisionsResponse",encode(I,g=t.BinaryWriter.create()){return I.annualProvisions.length!==0&&g.uint32(10).bytes(I.annualProvisions),g},decode(I,g){const R=I instanceof t.BinaryReader?I:new t.BinaryReader(I);let B=g===void 0?R.len:R.pos+g;const d=D();for(;R.pos<B;){const s=R.uint32();switch(s>>>3){case 1:d.annualProvisions=R.bytes();break;default:R.skipType(s&7);break}}return d},fromJSON(I){const g=D();return(0,r.isSet)(I.annualProvisions)&&(g.annualProvisions=(0,r.bytesFromBase64)(I.annualProvisions)),g},toJSON(I){const g={};return I.annualProvisions!==void 0&&(g.annualProvisions=(0,r.base64FromBytes)(I.annualProvisions!==void 0?I.annualProvisions:new Uint8Array)),g},fromPartial(I){const g=D();return g.annualProvisions=I.annualProvisions??new Uint8Array,g}};class J{constructor(g){this.rpc=g,this.Params=this.Params.bind(this),this.Inflation=this.Inflation.bind(this),this.AnnualProvisions=this.AnnualProvisions.bind(this)}Params(g={}){const R=e.QueryParamsRequest.encode(g).finish();return this.rpc.request("cosmos.mint.v1beta1.Query","Params",R).then(d=>e.QueryParamsResponse.decode(new t.BinaryReader(d)))}Inflation(g={}){const R=e.QueryInflationRequest.encode(g).finish();return this.rpc.request("cosmos.mint.v1beta1.Query","Inflation",R).then(d=>e.QueryInflationResponse.decode(new t.BinaryReader(d)))}AnnualProvisions(g={}){const R=e.QueryAnnualProvisionsRequest.encode(g).finish();return this.rpc.request("cosmos.mint.v1beta1.Query","AnnualProvisions",R).then(d=>e.QueryAnnualProvisionsResponse.decode(new t.BinaryReader(d)))}}e.QueryClientImpl=J})(Mm);Object.defineProperty(ls,"__esModule",{value:!0});ls.setupMintExtension=void 0;const PR=Oe,RR=Mm,Mt=Ke;function vR(e){const n=(0,Mt.createProtobufRpcClient)(e),t=new RR.QueryClientImpl(n);return{mint:{params:async()=>{const{params:r}=await t.Params({});return(0,PR.assert)(r),{blocksPerYear:r.blocksPerYear,goalBonded:(0,Mt.decodeCosmosSdkDecFromProto)(r.goalBonded),inflationMin:(0,Mt.decodeCosmosSdkDecFromProto)(r.inflationMin),inflationMax:(0,Mt.decodeCosmosSdkDecFromProto)(r.inflationMax),inflationRateChange:(0,Mt.decodeCosmosSdkDecFromProto)(r.inflationRateChange),mintDenom:r.mintDenom}},inflation:async()=>{const{inflation:r}=await t.Inflation({});return(0,Mt.decodeCosmosSdkDecFromProto)(r)},annualProvisions:async()=>{const{annualProvisions:r}=await t.AnnualProvisions({});return(0,Mt.decodeCosmosSdkDecFromProto)(r)}}}}ls.setupMintExtension=vR;var ui={};Object.defineProperty(ui,"__esModule",{value:!0});ui.createSlashingAminoConverters=ui.isAminoMsgUnjail=void 0;function BR(e){return e.type==="cosmos-sdk/MsgUnjail"}ui.isAminoMsgUnjail=BR;function bR(){throw new Error("Not implemented")}ui.createSlashingAminoConverters=bR;var fs={},qm={},Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.Params=Ct.ValidatorSigningInfo=Ct.protobufPackage=void 0;const ta=Mn,vr=hn,Fr=ee,Ne=ne;Ct.protobufPackage="cosmos.slashing.v1beta1";function ou(){return{address:"",startHeight:BigInt(0),indexOffset:BigInt(0),jailedUntil:ta.Timestamp.fromPartial({}),tombstoned:!1,missedBlocksCounter:BigInt(0)}}Ct.ValidatorSigningInfo={typeUrl:"/cosmos.slashing.v1beta1.ValidatorSigningInfo",encode(e,n=Fr.BinaryWriter.create()){return e.address!==""&&n.uint32(10).string(e.address),e.startHeight!==BigInt(0)&&n.uint32(16).int64(e.startHeight),e.indexOffset!==BigInt(0)&&n.uint32(24).int64(e.indexOffset),e.jailedUntil!==void 0&&ta.Timestamp.encode(e.jailedUntil,n.uint32(34).fork()).ldelim(),e.tombstoned===!0&&n.uint32(40).bool(e.tombstoned),e.missedBlocksCounter!==BigInt(0)&&n.uint32(48).int64(e.missedBlocksCounter),n},decode(e,n){const t=e instanceof Fr.BinaryReader?e:new Fr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=ou();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.address=t.string();break;case 2:o.startHeight=t.int64();break;case 3:o.indexOffset=t.int64();break;case 4:o.jailedUntil=ta.Timestamp.decode(t,t.uint32());break;case 5:o.tombstoned=t.bool();break;case 6:o.missedBlocksCounter=t.int64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=ou();return(0,Ne.isSet)(e.address)&&(n.address=String(e.address)),(0,Ne.isSet)(e.startHeight)&&(n.startHeight=BigInt(e.startHeight.toString())),(0,Ne.isSet)(e.indexOffset)&&(n.indexOffset=BigInt(e.indexOffset.toString())),(0,Ne.isSet)(e.jailedUntil)&&(n.jailedUntil=(0,Ne.fromJsonTimestamp)(e.jailedUntil)),(0,Ne.isSet)(e.tombstoned)&&(n.tombstoned=!!e.tombstoned),(0,Ne.isSet)(e.missedBlocksCounter)&&(n.missedBlocksCounter=BigInt(e.missedBlocksCounter.toString())),n},toJSON(e){const n={};return e.address!==void 0&&(n.address=e.address),e.startHeight!==void 0&&(n.startHeight=(e.startHeight||BigInt(0)).toString()),e.indexOffset!==void 0&&(n.indexOffset=(e.indexOffset||BigInt(0)).toString()),e.jailedUntil!==void 0&&(n.jailedUntil=(0,Ne.fromTimestamp)(e.jailedUntil).toISOString()),e.tombstoned!==void 0&&(n.tombstoned=e.tombstoned),e.missedBlocksCounter!==void 0&&(n.missedBlocksCounter=(e.missedBlocksCounter||BigInt(0)).toString()),n},fromPartial(e){const n=ou();return n.address=e.address??"",e.startHeight!==void 0&&e.startHeight!==null&&(n.startHeight=BigInt(e.startHeight.toString())),e.indexOffset!==void 0&&e.indexOffset!==null&&(n.indexOffset=BigInt(e.indexOffset.toString())),e.jailedUntil!==void 0&&e.jailedUntil!==null&&(n.jailedUntil=ta.Timestamp.fromPartial(e.jailedUntil)),n.tombstoned=e.tombstoned??!1,e.missedBlocksCounter!==void 0&&e.missedBlocksCounter!==null&&(n.missedBlocksCounter=BigInt(e.missedBlocksCounter.toString())),n}};function au(){return{signedBlocksWindow:BigInt(0),minSignedPerWindow:new Uint8Array,downtimeJailDuration:vr.Duration.fromPartial({}),slashFractionDoubleSign:new Uint8Array,slashFractionDowntime:new Uint8Array}}Ct.Params={typeUrl:"/cosmos.slashing.v1beta1.Params",encode(e,n=Fr.BinaryWriter.create()){return e.signedBlocksWindow!==BigInt(0)&&n.uint32(8).int64(e.signedBlocksWindow),e.minSignedPerWindow.length!==0&&n.uint32(18).bytes(e.minSignedPerWindow),e.downtimeJailDuration!==void 0&&vr.Duration.encode(e.downtimeJailDuration,n.uint32(26).fork()).ldelim(),e.slashFractionDoubleSign.length!==0&&n.uint32(34).bytes(e.slashFractionDoubleSign),e.slashFractionDowntime.length!==0&&n.uint32(42).bytes(e.slashFractionDowntime),n},decode(e,n){const t=e instanceof Fr.BinaryReader?e:new Fr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=au();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.signedBlocksWindow=t.int64();break;case 2:o.minSignedPerWindow=t.bytes();break;case 3:o.downtimeJailDuration=vr.Duration.decode(t,t.uint32());break;case 4:o.slashFractionDoubleSign=t.bytes();break;case 5:o.slashFractionDowntime=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=au();return(0,Ne.isSet)(e.signedBlocksWindow)&&(n.signedBlocksWindow=BigInt(e.signedBlocksWindow.toString())),(0,Ne.isSet)(e.minSignedPerWindow)&&(n.minSignedPerWindow=(0,Ne.bytesFromBase64)(e.minSignedPerWindow)),(0,Ne.isSet)(e.downtimeJailDuration)&&(n.downtimeJailDuration=vr.Duration.fromJSON(e.downtimeJailDuration)),(0,Ne.isSet)(e.slashFractionDoubleSign)&&(n.slashFractionDoubleSign=(0,Ne.bytesFromBase64)(e.slashFractionDoubleSign)),(0,Ne.isSet)(e.slashFractionDowntime)&&(n.slashFractionDowntime=(0,Ne.bytesFromBase64)(e.slashFractionDowntime)),n},toJSON(e){const n={};return e.signedBlocksWindow!==void 0&&(n.signedBlocksWindow=(e.signedBlocksWindow||BigInt(0)).toString()),e.minSignedPerWindow!==void 0&&(n.minSignedPerWindow=(0,Ne.base64FromBytes)(e.minSignedPerWindow!==void 0?e.minSignedPerWindow:new Uint8Array)),e.downtimeJailDuration!==void 0&&(n.downtimeJailDuration=e.downtimeJailDuration?vr.Duration.toJSON(e.downtimeJailDuration):void 0),e.slashFractionDoubleSign!==void 0&&(n.slashFractionDoubleSign=(0,Ne.base64FromBytes)(e.slashFractionDoubleSign!==void 0?e.slashFractionDoubleSign:new Uint8Array)),e.slashFractionDowntime!==void 0&&(n.slashFractionDowntime=(0,Ne.base64FromBytes)(e.slashFractionDowntime!==void 0?e.slashFractionDowntime:new Uint8Array)),n},fromPartial(e){const n=au();return e.signedBlocksWindow!==void 0&&e.signedBlocksWindow!==null&&(n.signedBlocksWindow=BigInt(e.signedBlocksWindow.toString())),n.minSignedPerWindow=e.minSignedPerWindow??new Uint8Array,e.downtimeJailDuration!==void 0&&e.downtimeJailDuration!==null&&(n.downtimeJailDuration=vr.Duration.fromPartial(e.downtimeJailDuration)),n.slashFractionDoubleSign=e.slashFractionDoubleSign??new Uint8Array,n.slashFractionDowntime=e.slashFractionDowntime??new Uint8Array,n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QuerySigningInfosResponse=e.QuerySigningInfosRequest=e.QuerySigningInfoResponse=e.QuerySigningInfoRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.protobufPackage=void 0;const n=be,t=Ct,r=ee,o=ne;e.protobufPackage="cosmos.slashing.v1beta1";function h(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.slashing.v1beta1.QueryParamsRequest",encode(g,R=r.BinaryWriter.create()){return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=h();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){default:B.skipType(y&7);break}}return s},fromJSON(g){return h()},toJSON(g){return{}},fromPartial(g){return h()}};function v(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.slashing.v1beta1.QueryParamsResponse",encode(g,R=r.BinaryWriter.create()){return g.params!==void 0&&t.Params.encode(g.params,R.uint32(10).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=v();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.params=t.Params.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=v();return(0,o.isSet)(g.params)&&(R.params=t.Params.fromJSON(g.params)),R},toJSON(g){const R={};return g.params!==void 0&&(R.params=g.params?t.Params.toJSON(g.params):void 0),R},fromPartial(g){const R=v();return g.params!==void 0&&g.params!==null&&(R.params=t.Params.fromPartial(g.params)),R}};function C(){return{consAddress:""}}e.QuerySigningInfoRequest={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfoRequest",encode(g,R=r.BinaryWriter.create()){return g.consAddress!==""&&R.uint32(10).string(g.consAddress),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=C();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.consAddress=B.string();break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=C();return(0,o.isSet)(g.consAddress)&&(R.consAddress=String(g.consAddress)),R},toJSON(g){const R={};return g.consAddress!==void 0&&(R.consAddress=g.consAddress),R},fromPartial(g){const R=C();return R.consAddress=g.consAddress??"",R}};function w(){return{valSigningInfo:t.ValidatorSigningInfo.fromPartial({})}}e.QuerySigningInfoResponse={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfoResponse",encode(g,R=r.BinaryWriter.create()){return g.valSigningInfo!==void 0&&t.ValidatorSigningInfo.encode(g.valSigningInfo,R.uint32(10).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=w();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.valSigningInfo=t.ValidatorSigningInfo.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=w();return(0,o.isSet)(g.valSigningInfo)&&(R.valSigningInfo=t.ValidatorSigningInfo.fromJSON(g.valSigningInfo)),R},toJSON(g){const R={};return g.valSigningInfo!==void 0&&(R.valSigningInfo=g.valSigningInfo?t.ValidatorSigningInfo.toJSON(g.valSigningInfo):void 0),R},fromPartial(g){const R=w();return g.valSigningInfo!==void 0&&g.valSigningInfo!==null&&(R.valSigningInfo=t.ValidatorSigningInfo.fromPartial(g.valSigningInfo)),R}};function D(){return{pagination:void 0}}e.QuerySigningInfosRequest={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfosRequest",encode(g,R=r.BinaryWriter.create()){return g.pagination!==void 0&&n.PageRequest.encode(g.pagination,R.uint32(10).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=D();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.pagination=n.PageRequest.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=D();return(0,o.isSet)(g.pagination)&&(R.pagination=n.PageRequest.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.pagination!==void 0&&(R.pagination=g.pagination?n.PageRequest.toJSON(g.pagination):void 0),R},fromPartial(g){const R=D();return g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageRequest.fromPartial(g.pagination)),R}};function J(){return{info:[],pagination:void 0}}e.QuerySigningInfosResponse={typeUrl:"/cosmos.slashing.v1beta1.QuerySigningInfosResponse",encode(g,R=r.BinaryWriter.create()){for(const B of g.info)t.ValidatorSigningInfo.encode(B,R.uint32(10).fork()).ldelim();return g.pagination!==void 0&&n.PageResponse.encode(g.pagination,R.uint32(18).fork()).ldelim(),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=J();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.info.push(t.ValidatorSigningInfo.decode(B,B.uint32()));break;case 2:s.pagination=n.PageResponse.decode(B,B.uint32());break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=J();return Array.isArray(g==null?void 0:g.info)&&(R.info=g.info.map(B=>t.ValidatorSigningInfo.fromJSON(B))),(0,o.isSet)(g.pagination)&&(R.pagination=n.PageResponse.fromJSON(g.pagination)),R},toJSON(g){const R={};return g.info?R.info=g.info.map(B=>B?t.ValidatorSigningInfo.toJSON(B):void 0):R.info=[],g.pagination!==void 0&&(R.pagination=g.pagination?n.PageResponse.toJSON(g.pagination):void 0),R},fromPartial(g){var B;const R=J();return R.info=((B=g.info)==null?void 0:B.map(d=>t.ValidatorSigningInfo.fromPartial(d)))||[],g.pagination!==void 0&&g.pagination!==null&&(R.pagination=n.PageResponse.fromPartial(g.pagination)),R}};class I{constructor(R){this.rpc=R,this.Params=this.Params.bind(this),this.SigningInfo=this.SigningInfo.bind(this),this.SigningInfos=this.SigningInfos.bind(this)}Params(R={}){const B=e.QueryParamsRequest.encode(R).finish();return this.rpc.request("cosmos.slashing.v1beta1.Query","Params",B).then(s=>e.QueryParamsResponse.decode(new r.BinaryReader(s)))}SigningInfo(R){const B=e.QuerySigningInfoRequest.encode(R).finish();return this.rpc.request("cosmos.slashing.v1beta1.Query","SigningInfo",B).then(s=>e.QuerySigningInfoResponse.decode(new r.BinaryReader(s)))}SigningInfos(R={pagination:n.PageRequest.fromPartial({})}){const B=e.QuerySigningInfosRequest.encode(R).finish();return this.rpc.request("cosmos.slashing.v1beta1.Query","SigningInfos",B).then(s=>e.QuerySigningInfosResponse.decode(new r.BinaryReader(s)))}}e.QueryClientImpl=I})(qm);Object.defineProperty(fs,"__esModule",{value:!0});fs.setupSlashingExtension=void 0;const OR=qm,Fl=Ke;function AR(e){const n=(0,Fl.createProtobufRpcClient)(e),t=new OR.QueryClientImpl(n);return{slashing:{signingInfo:async r=>await t.SigningInfo({consAddress:r}),signingInfos:async r=>await t.SigningInfos({pagination:(0,Fl.createPagination)(r)}),params:async()=>await t.Params({})}}}fs.setupSlashingExtension=AR;var We={};Object.defineProperty(We,"__esModule",{value:!0});We.createStakingAminoConverters=We.isAminoMsgUndelegate=We.isAminoMsgBeginRedelegate=We.isAminoMsgDelegate=We.isAminoMsgEditValidator=We.isAminoMsgCreateValidator=We.protoDecimalToJson=void 0;const Hm=Te,Gl=st,yt=Oe;function $i(e){const n=Hm.Decimal.fromAtomics(e,18),[t,r]=n.toString().split(".");return`${t}.${(r??"").padEnd(18,"0")}`}We.protoDecimalToJson=$i;function Qo(e){return Hm.Decimal.fromUserInput(e,18).atomics}function IR(e){return e.type==="cosmos-sdk/MsgCreateValidator"}We.isAminoMsgCreateValidator=IR;function TR(e){return e.type==="cosmos-sdk/MsgEditValidator"}We.isAminoMsgEditValidator=TR;function CR(e){return e.type==="cosmos-sdk/MsgDelegate"}We.isAminoMsgDelegate=CR;function NR(e){return e.type==="cosmos-sdk/MsgBeginRedelegate"}We.isAminoMsgBeginRedelegate=NR;function wR(e){return e.type==="cosmos-sdk/MsgUndelegate"}We.isAminoMsgUndelegate=wR;function ER(){return{"/cosmos.staking.v1beta1.MsgBeginRedelegate":{aminoType:"cosmos-sdk/MsgBeginRedelegate",toAmino:({delegatorAddress:e,validatorSrcAddress:n,validatorDstAddress:t,amount:r})=>((0,yt.assertDefinedAndNotNull)(r,"missing amount"),{delegator_address:e,validator_src_address:n,validator_dst_address:t,amount:r}),fromAmino:({delegator_address:e,validator_src_address:n,validator_dst_address:t,amount:r})=>({delegatorAddress:e,validatorSrcAddress:n,validatorDstAddress:t,amount:r})},"/cosmos.staking.v1beta1.MsgCreateValidator":{aminoType:"cosmos-sdk/MsgCreateValidator",toAmino:({description:e,commission:n,minSelfDelegation:t,delegatorAddress:r,validatorAddress:o,pubkey:h,value:v})=>((0,yt.assertDefinedAndNotNull)(e,"missing description"),(0,yt.assertDefinedAndNotNull)(n,"missing commission"),(0,yt.assertDefinedAndNotNull)(h,"missing pubkey"),(0,yt.assertDefinedAndNotNull)(v,"missing value"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission:{rate:$i(n.rate),max_rate:$i(n.maxRate),max_change_rate:$i(n.maxChangeRate)},min_self_delegation:t,delegator_address:r,validator_address:o,pubkey:(0,Gl.decodePubkey)(h),value:v}),fromAmino:({description:e,commission:n,min_self_delegation:t,delegator_address:r,validator_address:o,pubkey:h,value:v})=>({description:{moniker:e.moniker,identity:e.identity,website:e.website,securityContact:e.security_contact,details:e.details},commission:{rate:Qo(n.rate),maxRate:Qo(n.max_rate),maxChangeRate:Qo(n.max_change_rate)},minSelfDelegation:t,delegatorAddress:r,validatorAddress:o,pubkey:(0,Gl.encodePubkey)(h),value:v})},"/cosmos.staking.v1beta1.MsgDelegate":{aminoType:"cosmos-sdk/MsgDelegate",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t})=>((0,yt.assertDefinedAndNotNull)(t,"missing amount"),{delegator_address:e,validator_address:n,amount:t}),fromAmino:({delegator_address:e,validator_address:n,amount:t})=>({delegatorAddress:e,validatorAddress:n,amount:t})},"/cosmos.staking.v1beta1.MsgEditValidator":{aminoType:"cosmos-sdk/MsgEditValidator",toAmino:({description:e,commissionRate:n,minSelfDelegation:t,validatorAddress:r})=>((0,yt.assertDefinedAndNotNull)(e,"missing description"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission_rate:n?$i(n):void 0,min_self_delegation:t||void 0,validator_address:r}),fromAmino:({description:e,commission_rate:n,min_self_delegation:t,validator_address:r})=>({description:{moniker:e.moniker,identity:e.identity,website:e.website,securityContact:e.security_contact,details:e.details},commissionRate:n?Qo(n):"",minSelfDelegation:t??"",validatorAddress:r})},"/cosmos.staking.v1beta1.MsgUndelegate":{aminoType:"cosmos-sdk/MsgUndelegate",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t})=>((0,yt.assertDefinedAndNotNull)(t,"missing amount"),{delegator_address:e,validator_address:n,amount:t}),fromAmino:({delegator_address:e,validator_address:n,amount:t})=>({delegatorAddress:e,validatorAddress:n,amount:t})}}}We.createStakingAminoConverters=ER;var rn={},ps={},Jc={},Dc={},Vm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HashedParams=e.VersionParams=e.ValidatorParams=e.EvidenceParams=e.BlockParams=e.ConsensusParams=e.protobufPackage=void 0;const n=hn,t=ee,r=ne;e.protobufPackage="tendermint.types";function o(){return{block:void 0,evidence:void 0,validator:void 0,version:void 0}}e.ConsensusParams={typeUrl:"/tendermint.types.ConsensusParams",encode(J,I=t.BinaryWriter.create()){return J.block!==void 0&&e.BlockParams.encode(J.block,I.uint32(10).fork()).ldelim(),J.evidence!==void 0&&e.EvidenceParams.encode(J.evidence,I.uint32(18).fork()).ldelim(),J.validator!==void 0&&e.ValidatorParams.encode(J.validator,I.uint32(26).fork()).ldelim(),J.version!==void 0&&e.VersionParams.encode(J.version,I.uint32(34).fork()).ldelim(),I},decode(J,I){const g=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=o();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.block=e.BlockParams.decode(g,g.uint32());break;case 2:B.evidence=e.EvidenceParams.decode(g,g.uint32());break;case 3:B.validator=e.ValidatorParams.decode(g,g.uint32());break;case 4:B.version=e.VersionParams.decode(g,g.uint32());break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=o();return(0,r.isSet)(J.block)&&(I.block=e.BlockParams.fromJSON(J.block)),(0,r.isSet)(J.evidence)&&(I.evidence=e.EvidenceParams.fromJSON(J.evidence)),(0,r.isSet)(J.validator)&&(I.validator=e.ValidatorParams.fromJSON(J.validator)),(0,r.isSet)(J.version)&&(I.version=e.VersionParams.fromJSON(J.version)),I},toJSON(J){const I={};return J.block!==void 0&&(I.block=J.block?e.BlockParams.toJSON(J.block):void 0),J.evidence!==void 0&&(I.evidence=J.evidence?e.EvidenceParams.toJSON(J.evidence):void 0),J.validator!==void 0&&(I.validator=J.validator?e.ValidatorParams.toJSON(J.validator):void 0),J.version!==void 0&&(I.version=J.version?e.VersionParams.toJSON(J.version):void 0),I},fromPartial(J){const I=o();return J.block!==void 0&&J.block!==null&&(I.block=e.BlockParams.fromPartial(J.block)),J.evidence!==void 0&&J.evidence!==null&&(I.evidence=e.EvidenceParams.fromPartial(J.evidence)),J.validator!==void 0&&J.validator!==null&&(I.validator=e.ValidatorParams.fromPartial(J.validator)),J.version!==void 0&&J.version!==null&&(I.version=e.VersionParams.fromPartial(J.version)),I}};function h(){return{maxBytes:BigInt(0),maxGas:BigInt(0)}}e.BlockParams={typeUrl:"/tendermint.types.BlockParams",encode(J,I=t.BinaryWriter.create()){return J.maxBytes!==BigInt(0)&&I.uint32(8).int64(J.maxBytes),J.maxGas!==BigInt(0)&&I.uint32(16).int64(J.maxGas),I},decode(J,I){const g=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=h();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.maxBytes=g.int64();break;case 2:B.maxGas=g.int64();break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=h();return(0,r.isSet)(J.maxBytes)&&(I.maxBytes=BigInt(J.maxBytes.toString())),(0,r.isSet)(J.maxGas)&&(I.maxGas=BigInt(J.maxGas.toString())),I},toJSON(J){const I={};return J.maxBytes!==void 0&&(I.maxBytes=(J.maxBytes||BigInt(0)).toString()),J.maxGas!==void 0&&(I.maxGas=(J.maxGas||BigInt(0)).toString()),I},fromPartial(J){const I=h();return J.maxBytes!==void 0&&J.maxBytes!==null&&(I.maxBytes=BigInt(J.maxBytes.toString())),J.maxGas!==void 0&&J.maxGas!==null&&(I.maxGas=BigInt(J.maxGas.toString())),I}};function v(){return{maxAgeNumBlocks:BigInt(0),maxAgeDuration:n.Duration.fromPartial({}),maxBytes:BigInt(0)}}e.EvidenceParams={typeUrl:"/tendermint.types.EvidenceParams",encode(J,I=t.BinaryWriter.create()){return J.maxAgeNumBlocks!==BigInt(0)&&I.uint32(8).int64(J.maxAgeNumBlocks),J.maxAgeDuration!==void 0&&n.Duration.encode(J.maxAgeDuration,I.uint32(18).fork()).ldelim(),J.maxBytes!==BigInt(0)&&I.uint32(24).int64(J.maxBytes),I},decode(J,I){const g=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=v();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.maxAgeNumBlocks=g.int64();break;case 2:B.maxAgeDuration=n.Duration.decode(g,g.uint32());break;case 3:B.maxBytes=g.int64();break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=v();return(0,r.isSet)(J.maxAgeNumBlocks)&&(I.maxAgeNumBlocks=BigInt(J.maxAgeNumBlocks.toString())),(0,r.isSet)(J.maxAgeDuration)&&(I.maxAgeDuration=n.Duration.fromJSON(J.maxAgeDuration)),(0,r.isSet)(J.maxBytes)&&(I.maxBytes=BigInt(J.maxBytes.toString())),I},toJSON(J){const I={};return J.maxAgeNumBlocks!==void 0&&(I.maxAgeNumBlocks=(J.maxAgeNumBlocks||BigInt(0)).toString()),J.maxAgeDuration!==void 0&&(I.maxAgeDuration=J.maxAgeDuration?n.Duration.toJSON(J.maxAgeDuration):void 0),J.maxBytes!==void 0&&(I.maxBytes=(J.maxBytes||BigInt(0)).toString()),I},fromPartial(J){const I=v();return J.maxAgeNumBlocks!==void 0&&J.maxAgeNumBlocks!==null&&(I.maxAgeNumBlocks=BigInt(J.maxAgeNumBlocks.toString())),J.maxAgeDuration!==void 0&&J.maxAgeDuration!==null&&(I.maxAgeDuration=n.Duration.fromPartial(J.maxAgeDuration)),J.maxBytes!==void 0&&J.maxBytes!==null&&(I.maxBytes=BigInt(J.maxBytes.toString())),I}};function C(){return{pubKeyTypes:[]}}e.ValidatorParams={typeUrl:"/tendermint.types.ValidatorParams",encode(J,I=t.BinaryWriter.create()){for(const g of J.pubKeyTypes)I.uint32(10).string(g);return I},decode(J,I){const g=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=C();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.pubKeyTypes.push(g.string());break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=C();return Array.isArray(J==null?void 0:J.pubKeyTypes)&&(I.pubKeyTypes=J.pubKeyTypes.map(g=>String(g))),I},toJSON(J){const I={};return J.pubKeyTypes?I.pubKeyTypes=J.pubKeyTypes.map(g=>g):I.pubKeyTypes=[],I},fromPartial(J){var g;const I=C();return I.pubKeyTypes=((g=J.pubKeyTypes)==null?void 0:g.map(R=>R))||[],I}};function w(){return{app:BigInt(0)}}e.VersionParams={typeUrl:"/tendermint.types.VersionParams",encode(J,I=t.BinaryWriter.create()){return J.app!==BigInt(0)&&I.uint32(8).uint64(J.app),I},decode(J,I){const g=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=w();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.app=g.uint64();break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=w();return(0,r.isSet)(J.app)&&(I.app=BigInt(J.app.toString())),I},toJSON(J){const I={};return J.app!==void 0&&(I.app=(J.app||BigInt(0)).toString()),I},fromPartial(J){const I=w();return J.app!==void 0&&J.app!==null&&(I.app=BigInt(J.app.toString())),I}};function D(){return{blockMaxBytes:BigInt(0),blockMaxGas:BigInt(0)}}e.HashedParams={typeUrl:"/tendermint.types.HashedParams",encode(J,I=t.BinaryWriter.create()){return J.blockMaxBytes!==BigInt(0)&&I.uint32(8).int64(J.blockMaxBytes),J.blockMaxGas!==BigInt(0)&&I.uint32(16).int64(J.blockMaxGas),I},decode(J,I){const g=J instanceof t.BinaryReader?J:new t.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=D();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.blockMaxBytes=g.int64();break;case 2:B.blockMaxGas=g.int64();break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=D();return(0,r.isSet)(J.blockMaxBytes)&&(I.blockMaxBytes=BigInt(J.blockMaxBytes.toString())),(0,r.isSet)(J.blockMaxGas)&&(I.blockMaxGas=BigInt(J.blockMaxGas.toString())),I},toJSON(J){const I={};return J.blockMaxBytes!==void 0&&(I.blockMaxBytes=(J.blockMaxBytes||BigInt(0)).toString()),J.blockMaxGas!==void 0&&(I.blockMaxGas=(J.blockMaxGas||BigInt(0)).toString()),I},fromPartial(J){const I=D();return J.blockMaxBytes!==void 0&&J.blockMaxBytes!==null&&(I.blockMaxBytes=BigInt(J.blockMaxBytes.toString())),J.blockMaxGas!==void 0&&J.blockMaxGas!==null&&(I.blockMaxGas=BigInt(J.blockMaxGas.toString())),I}}})(Vm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ResponsePrepareProposal=e.ResponseApplySnapshotChunk=e.ResponseLoadSnapshotChunk=e.ResponseOfferSnapshot=e.ResponseListSnapshots=e.ResponseCommit=e.ResponseEndBlock=e.ResponseDeliverTx=e.ResponseCheckTx=e.ResponseBeginBlock=e.ResponseQuery=e.ResponseInitChain=e.ResponseInfo=e.ResponseFlush=e.ResponseEcho=e.ResponseException=e.Response=e.RequestProcessProposal=e.RequestPrepareProposal=e.RequestApplySnapshotChunk=e.RequestLoadSnapshotChunk=e.RequestOfferSnapshot=e.RequestListSnapshots=e.RequestCommit=e.RequestEndBlock=e.RequestDeliverTx=e.RequestCheckTx=e.RequestBeginBlock=e.RequestQuery=e.RequestInitChain=e.RequestInfo=e.RequestFlush=e.RequestEcho=e.Request=e.misbehaviorTypeToJSON=e.misbehaviorTypeFromJSON=e.MisbehaviorType=e.responseProcessProposal_ProposalStatusToJSON=e.responseProcessProposal_ProposalStatusFromJSON=e.ResponseProcessProposal_ProposalStatus=e.responseApplySnapshotChunk_ResultToJSON=e.responseApplySnapshotChunk_ResultFromJSON=e.ResponseApplySnapshotChunk_Result=e.responseOfferSnapshot_ResultToJSON=e.responseOfferSnapshot_ResultFromJSON=e.ResponseOfferSnapshot_Result=e.checkTxTypeToJSON=e.checkTxTypeFromJSON=e.CheckTxType=e.protobufPackage=void 0,e.ABCIApplicationClientImpl=e.Snapshot=e.Misbehavior=e.ExtendedVoteInfo=e.VoteInfo=e.ValidatorUpdate=e.Validator=e.TxResult=e.EventAttribute=e.Event=e.ExtendedCommitInfo=e.CommitInfo=e.ResponseProcessProposal=void 0;const n=Mn,t=Vm,r=dr,o=Uc,h=ir,v=ee,C=ne;e.protobufPackage="tendermint.abci";var w;(function(c){c[c.NEW=0]="NEW",c[c.RECHECK=1]="RECHECK",c[c.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.CheckTxType=w={}));function D(c){switch(c){case 0:case"NEW":return w.NEW;case 1:case"RECHECK":return w.RECHECK;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.checkTxTypeFromJSON=D;function J(c){switch(c){case w.NEW:return"NEW";case w.RECHECK:return"RECHECK";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.checkTxTypeToJSON=J;var I;(function(c){c[c.UNKNOWN=0]="UNKNOWN",c[c.ACCEPT=1]="ACCEPT",c[c.ABORT=2]="ABORT",c[c.REJECT=3]="REJECT",c[c.REJECT_FORMAT=4]="REJECT_FORMAT",c[c.REJECT_SENDER=5]="REJECT_SENDER",c[c.UNRECOGNIZED=-1]="UNRECOGNIZED"})(I||(e.ResponseOfferSnapshot_Result=I={}));function g(c){switch(c){case 0:case"UNKNOWN":return I.UNKNOWN;case 1:case"ACCEPT":return I.ACCEPT;case 2:case"ABORT":return I.ABORT;case 3:case"REJECT":return I.REJECT;case 4:case"REJECT_FORMAT":return I.REJECT_FORMAT;case 5:case"REJECT_SENDER":return I.REJECT_SENDER;case-1:case"UNRECOGNIZED":default:return I.UNRECOGNIZED}}e.responseOfferSnapshot_ResultFromJSON=g;function R(c){switch(c){case I.UNKNOWN:return"UNKNOWN";case I.ACCEPT:return"ACCEPT";case I.ABORT:return"ABORT";case I.REJECT:return"REJECT";case I.REJECT_FORMAT:return"REJECT_FORMAT";case I.REJECT_SENDER:return"REJECT_SENDER";case I.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseOfferSnapshot_ResultToJSON=R;var B;(function(c){c[c.UNKNOWN=0]="UNKNOWN",c[c.ACCEPT=1]="ACCEPT",c[c.ABORT=2]="ABORT",c[c.RETRY=3]="RETRY",c[c.RETRY_SNAPSHOT=4]="RETRY_SNAPSHOT",c[c.REJECT_SNAPSHOT=5]="REJECT_SNAPSHOT",c[c.UNRECOGNIZED=-1]="UNRECOGNIZED"})(B||(e.ResponseApplySnapshotChunk_Result=B={}));function d(c){switch(c){case 0:case"UNKNOWN":return B.UNKNOWN;case 1:case"ACCEPT":return B.ACCEPT;case 2:case"ABORT":return B.ABORT;case 3:case"RETRY":return B.RETRY;case 4:case"RETRY_SNAPSHOT":return B.RETRY_SNAPSHOT;case 5:case"REJECT_SNAPSHOT":return B.REJECT_SNAPSHOT;case-1:case"UNRECOGNIZED":default:return B.UNRECOGNIZED}}e.responseApplySnapshotChunk_ResultFromJSON=d;function s(c){switch(c){case B.UNKNOWN:return"UNKNOWN";case B.ACCEPT:return"ACCEPT";case B.ABORT:return"ABORT";case B.RETRY:return"RETRY";case B.RETRY_SNAPSHOT:return"RETRY_SNAPSHOT";case B.REJECT_SNAPSHOT:return"REJECT_SNAPSHOT";case B.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseApplySnapshotChunk_ResultToJSON=s;var y;(function(c){c[c.UNKNOWN=0]="UNKNOWN",c[c.ACCEPT=1]="ACCEPT",c[c.REJECT=2]="REJECT",c[c.UNRECOGNIZED=-1]="UNRECOGNIZED"})(y||(e.ResponseProcessProposal_ProposalStatus=y={}));function E(c){switch(c){case 0:case"UNKNOWN":return y.UNKNOWN;case 1:case"ACCEPT":return y.ACCEPT;case 2:case"REJECT":return y.REJECT;case-1:case"UNRECOGNIZED":default:return y.UNRECOGNIZED}}e.responseProcessProposal_ProposalStatusFromJSON=E;function _(c){switch(c){case y.UNKNOWN:return"UNKNOWN";case y.ACCEPT:return"ACCEPT";case y.REJECT:return"REJECT";case y.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.responseProcessProposal_ProposalStatusToJSON=_;var U;(function(c){c[c.UNKNOWN=0]="UNKNOWN",c[c.DUPLICATE_VOTE=1]="DUPLICATE_VOTE",c[c.LIGHT_CLIENT_ATTACK=2]="LIGHT_CLIENT_ATTACK",c[c.UNRECOGNIZED=-1]="UNRECOGNIZED"})(U||(e.MisbehaviorType=U={}));function H(c){switch(c){case 0:case"UNKNOWN":return U.UNKNOWN;case 1:case"DUPLICATE_VOTE":return U.DUPLICATE_VOTE;case 2:case"LIGHT_CLIENT_ATTACK":return U.LIGHT_CLIENT_ATTACK;case-1:case"UNRECOGNIZED":default:return U.UNRECOGNIZED}}e.misbehaviorTypeFromJSON=H;function i(c){switch(c){case U.UNKNOWN:return"UNKNOWN";case U.DUPLICATE_VOTE:return"DUPLICATE_VOTE";case U.LIGHT_CLIENT_ATTACK:return"LIGHT_CLIENT_ATTACK";case U.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.misbehaviorTypeToJSON=i;function m(){return{echo:void 0,flush:void 0,info:void 0,initChain:void 0,query:void 0,beginBlock:void 0,checkTx:void 0,deliverTx:void 0,endBlock:void 0,commit:void 0,listSnapshots:void 0,offerSnapshot:void 0,loadSnapshotChunk:void 0,applySnapshotChunk:void 0,prepareProposal:void 0,processProposal:void 0}}e.Request={typeUrl:"/tendermint.abci.Request",encode(c,b=v.BinaryWriter.create()){return c.echo!==void 0&&e.RequestEcho.encode(c.echo,b.uint32(10).fork()).ldelim(),c.flush!==void 0&&e.RequestFlush.encode(c.flush,b.uint32(18).fork()).ldelim(),c.info!==void 0&&e.RequestInfo.encode(c.info,b.uint32(26).fork()).ldelim(),c.initChain!==void 0&&e.RequestInitChain.encode(c.initChain,b.uint32(42).fork()).ldelim(),c.query!==void 0&&e.RequestQuery.encode(c.query,b.uint32(50).fork()).ldelim(),c.beginBlock!==void 0&&e.RequestBeginBlock.encode(c.beginBlock,b.uint32(58).fork()).ldelim(),c.checkTx!==void 0&&e.RequestCheckTx.encode(c.checkTx,b.uint32(66).fork()).ldelim(),c.deliverTx!==void 0&&e.RequestDeliverTx.encode(c.deliverTx,b.uint32(74).fork()).ldelim(),c.endBlock!==void 0&&e.RequestEndBlock.encode(c.endBlock,b.uint32(82).fork()).ldelim(),c.commit!==void 0&&e.RequestCommit.encode(c.commit,b.uint32(90).fork()).ldelim(),c.listSnapshots!==void 0&&e.RequestListSnapshots.encode(c.listSnapshots,b.uint32(98).fork()).ldelim(),c.offerSnapshot!==void 0&&e.RequestOfferSnapshot.encode(c.offerSnapshot,b.uint32(106).fork()).ldelim(),c.loadSnapshotChunk!==void 0&&e.RequestLoadSnapshotChunk.encode(c.loadSnapshotChunk,b.uint32(114).fork()).ldelim(),c.applySnapshotChunk!==void 0&&e.RequestApplySnapshotChunk.encode(c.applySnapshotChunk,b.uint32(122).fork()).ldelim(),c.prepareProposal!==void 0&&e.RequestPrepareProposal.encode(c.prepareProposal,b.uint32(130).fork()).ldelim(),c.processProposal!==void 0&&e.RequestProcessProposal.encode(c.processProposal,b.uint32(138).fork()).ldelim(),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=m();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.echo=e.RequestEcho.decode(q,q.uint32());break;case 2:F.flush=e.RequestFlush.decode(q,q.uint32());break;case 3:F.info=e.RequestInfo.decode(q,q.uint32());break;case 5:F.initChain=e.RequestInitChain.decode(q,q.uint32());break;case 6:F.query=e.RequestQuery.decode(q,q.uint32());break;case 7:F.beginBlock=e.RequestBeginBlock.decode(q,q.uint32());break;case 8:F.checkTx=e.RequestCheckTx.decode(q,q.uint32());break;case 9:F.deliverTx=e.RequestDeliverTx.decode(q,q.uint32());break;case 10:F.endBlock=e.RequestEndBlock.decode(q,q.uint32());break;case 11:F.commit=e.RequestCommit.decode(q,q.uint32());break;case 12:F.listSnapshots=e.RequestListSnapshots.decode(q,q.uint32());break;case 13:F.offerSnapshot=e.RequestOfferSnapshot.decode(q,q.uint32());break;case 14:F.loadSnapshotChunk=e.RequestLoadSnapshotChunk.decode(q,q.uint32());break;case 15:F.applySnapshotChunk=e.RequestApplySnapshotChunk.decode(q,q.uint32());break;case 16:F.prepareProposal=e.RequestPrepareProposal.decode(q,q.uint32());break;case 17:F.processProposal=e.RequestProcessProposal.decode(q,q.uint32());break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=m();return(0,C.isSet)(c.echo)&&(b.echo=e.RequestEcho.fromJSON(c.echo)),(0,C.isSet)(c.flush)&&(b.flush=e.RequestFlush.fromJSON(c.flush)),(0,C.isSet)(c.info)&&(b.info=e.RequestInfo.fromJSON(c.info)),(0,C.isSet)(c.initChain)&&(b.initChain=e.RequestInitChain.fromJSON(c.initChain)),(0,C.isSet)(c.query)&&(b.query=e.RequestQuery.fromJSON(c.query)),(0,C.isSet)(c.beginBlock)&&(b.beginBlock=e.RequestBeginBlock.fromJSON(c.beginBlock)),(0,C.isSet)(c.checkTx)&&(b.checkTx=e.RequestCheckTx.fromJSON(c.checkTx)),(0,C.isSet)(c.deliverTx)&&(b.deliverTx=e.RequestDeliverTx.fromJSON(c.deliverTx)),(0,C.isSet)(c.endBlock)&&(b.endBlock=e.RequestEndBlock.fromJSON(c.endBlock)),(0,C.isSet)(c.commit)&&(b.commit=e.RequestCommit.fromJSON(c.commit)),(0,C.isSet)(c.listSnapshots)&&(b.listSnapshots=e.RequestListSnapshots.fromJSON(c.listSnapshots)),(0,C.isSet)(c.offerSnapshot)&&(b.offerSnapshot=e.RequestOfferSnapshot.fromJSON(c.offerSnapshot)),(0,C.isSet)(c.loadSnapshotChunk)&&(b.loadSnapshotChunk=e.RequestLoadSnapshotChunk.fromJSON(c.loadSnapshotChunk)),(0,C.isSet)(c.applySnapshotChunk)&&(b.applySnapshotChunk=e.RequestApplySnapshotChunk.fromJSON(c.applySnapshotChunk)),(0,C.isSet)(c.prepareProposal)&&(b.prepareProposal=e.RequestPrepareProposal.fromJSON(c.prepareProposal)),(0,C.isSet)(c.processProposal)&&(b.processProposal=e.RequestProcessProposal.fromJSON(c.processProposal)),b},toJSON(c){const b={};return c.echo!==void 0&&(b.echo=c.echo?e.RequestEcho.toJSON(c.echo):void 0),c.flush!==void 0&&(b.flush=c.flush?e.RequestFlush.toJSON(c.flush):void 0),c.info!==void 0&&(b.info=c.info?e.RequestInfo.toJSON(c.info):void 0),c.initChain!==void 0&&(b.initChain=c.initChain?e.RequestInitChain.toJSON(c.initChain):void 0),c.query!==void 0&&(b.query=c.query?e.RequestQuery.toJSON(c.query):void 0),c.beginBlock!==void 0&&(b.beginBlock=c.beginBlock?e.RequestBeginBlock.toJSON(c.beginBlock):void 0),c.checkTx!==void 0&&(b.checkTx=c.checkTx?e.RequestCheckTx.toJSON(c.checkTx):void 0),c.deliverTx!==void 0&&(b.deliverTx=c.deliverTx?e.RequestDeliverTx.toJSON(c.deliverTx):void 0),c.endBlock!==void 0&&(b.endBlock=c.endBlock?e.RequestEndBlock.toJSON(c.endBlock):void 0),c.commit!==void 0&&(b.commit=c.commit?e.RequestCommit.toJSON(c.commit):void 0),c.listSnapshots!==void 0&&(b.listSnapshots=c.listSnapshots?e.RequestListSnapshots.toJSON(c.listSnapshots):void 0),c.offerSnapshot!==void 0&&(b.offerSnapshot=c.offerSnapshot?e.RequestOfferSnapshot.toJSON(c.offerSnapshot):void 0),c.loadSnapshotChunk!==void 0&&(b.loadSnapshotChunk=c.loadSnapshotChunk?e.RequestLoadSnapshotChunk.toJSON(c.loadSnapshotChunk):void 0),c.applySnapshotChunk!==void 0&&(b.applySnapshotChunk=c.applySnapshotChunk?e.RequestApplySnapshotChunk.toJSON(c.applySnapshotChunk):void 0),c.prepareProposal!==void 0&&(b.prepareProposal=c.prepareProposal?e.RequestPrepareProposal.toJSON(c.prepareProposal):void 0),c.processProposal!==void 0&&(b.processProposal=c.processProposal?e.RequestProcessProposal.toJSON(c.processProposal):void 0),b},fromPartial(c){const b=m();return c.echo!==void 0&&c.echo!==null&&(b.echo=e.RequestEcho.fromPartial(c.echo)),c.flush!==void 0&&c.flush!==null&&(b.flush=e.RequestFlush.fromPartial(c.flush)),c.info!==void 0&&c.info!==null&&(b.info=e.RequestInfo.fromPartial(c.info)),c.initChain!==void 0&&c.initChain!==null&&(b.initChain=e.RequestInitChain.fromPartial(c.initChain)),c.query!==void 0&&c.query!==null&&(b.query=e.RequestQuery.fromPartial(c.query)),c.beginBlock!==void 0&&c.beginBlock!==null&&(b.beginBlock=e.RequestBeginBlock.fromPartial(c.beginBlock)),c.checkTx!==void 0&&c.checkTx!==null&&(b.checkTx=e.RequestCheckTx.fromPartial(c.checkTx)),c.deliverTx!==void 0&&c.deliverTx!==null&&(b.deliverTx=e.RequestDeliverTx.fromPartial(c.deliverTx)),c.endBlock!==void 0&&c.endBlock!==null&&(b.endBlock=e.RequestEndBlock.fromPartial(c.endBlock)),c.commit!==void 0&&c.commit!==null&&(b.commit=e.RequestCommit.fromPartial(c.commit)),c.listSnapshots!==void 0&&c.listSnapshots!==null&&(b.listSnapshots=e.RequestListSnapshots.fromPartial(c.listSnapshots)),c.offerSnapshot!==void 0&&c.offerSnapshot!==null&&(b.offerSnapshot=e.RequestOfferSnapshot.fromPartial(c.offerSnapshot)),c.loadSnapshotChunk!==void 0&&c.loadSnapshotChunk!==null&&(b.loadSnapshotChunk=e.RequestLoadSnapshotChunk.fromPartial(c.loadSnapshotChunk)),c.applySnapshotChunk!==void 0&&c.applySnapshotChunk!==null&&(b.applySnapshotChunk=e.RequestApplySnapshotChunk.fromPartial(c.applySnapshotChunk)),c.prepareProposal!==void 0&&c.prepareProposal!==null&&(b.prepareProposal=e.RequestPrepareProposal.fromPartial(c.prepareProposal)),c.processProposal!==void 0&&c.processProposal!==null&&(b.processProposal=e.RequestProcessProposal.fromPartial(c.processProposal)),b}};function N(){return{message:""}}e.RequestEcho={typeUrl:"/tendermint.abci.RequestEcho",encode(c,b=v.BinaryWriter.create()){return c.message!==""&&b.uint32(10).string(c.message),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=N();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.message=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=N();return(0,C.isSet)(c.message)&&(b.message=String(c.message)),b},toJSON(c){const b={};return c.message!==void 0&&(b.message=c.message),b},fromPartial(c){const b=N();return b.message=c.message??"",b}};function V(){return{}}e.RequestFlush={typeUrl:"/tendermint.abci.RequestFlush",encode(c,b=v.BinaryWriter.create()){return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=V();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){default:q.skipType(K&7);break}}return F},fromJSON(c){return V()},toJSON(c){return{}},fromPartial(c){return V()}};function u(){return{version:"",blockVersion:BigInt(0),p2pVersion:BigInt(0),abciVersion:""}}e.RequestInfo={typeUrl:"/tendermint.abci.RequestInfo",encode(c,b=v.BinaryWriter.create()){return c.version!==""&&b.uint32(10).string(c.version),c.blockVersion!==BigInt(0)&&b.uint32(16).uint64(c.blockVersion),c.p2pVersion!==BigInt(0)&&b.uint32(24).uint64(c.p2pVersion),c.abciVersion!==""&&b.uint32(34).string(c.abciVersion),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=u();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.version=q.string();break;case 2:F.blockVersion=q.uint64();break;case 3:F.p2pVersion=q.uint64();break;case 4:F.abciVersion=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=u();return(0,C.isSet)(c.version)&&(b.version=String(c.version)),(0,C.isSet)(c.blockVersion)&&(b.blockVersion=BigInt(c.blockVersion.toString())),(0,C.isSet)(c.p2pVersion)&&(b.p2pVersion=BigInt(c.p2pVersion.toString())),(0,C.isSet)(c.abciVersion)&&(b.abciVersion=String(c.abciVersion)),b},toJSON(c){const b={};return c.version!==void 0&&(b.version=c.version),c.blockVersion!==void 0&&(b.blockVersion=(c.blockVersion||BigInt(0)).toString()),c.p2pVersion!==void 0&&(b.p2pVersion=(c.p2pVersion||BigInt(0)).toString()),c.abciVersion!==void 0&&(b.abciVersion=c.abciVersion),b},fromPartial(c){const b=u();return b.version=c.version??"",c.blockVersion!==void 0&&c.blockVersion!==null&&(b.blockVersion=BigInt(c.blockVersion.toString())),c.p2pVersion!==void 0&&c.p2pVersion!==null&&(b.p2pVersion=BigInt(c.p2pVersion.toString())),b.abciVersion=c.abciVersion??"",b}};function l(){return{time:n.Timestamp.fromPartial({}),chainId:"",consensusParams:void 0,validators:[],appStateBytes:new Uint8Array,initialHeight:BigInt(0)}}e.RequestInitChain={typeUrl:"/tendermint.abci.RequestInitChain",encode(c,b=v.BinaryWriter.create()){c.time!==void 0&&n.Timestamp.encode(c.time,b.uint32(10).fork()).ldelim(),c.chainId!==""&&b.uint32(18).string(c.chainId),c.consensusParams!==void 0&&t.ConsensusParams.encode(c.consensusParams,b.uint32(26).fork()).ldelim();for(const q of c.validators)e.ValidatorUpdate.encode(q,b.uint32(34).fork()).ldelim();return c.appStateBytes.length!==0&&b.uint32(42).bytes(c.appStateBytes),c.initialHeight!==BigInt(0)&&b.uint32(48).int64(c.initialHeight),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=l();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.time=n.Timestamp.decode(q,q.uint32());break;case 2:F.chainId=q.string();break;case 3:F.consensusParams=t.ConsensusParams.decode(q,q.uint32());break;case 4:F.validators.push(e.ValidatorUpdate.decode(q,q.uint32()));break;case 5:F.appStateBytes=q.bytes();break;case 6:F.initialHeight=q.int64();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=l();return(0,C.isSet)(c.time)&&(b.time=(0,C.fromJsonTimestamp)(c.time)),(0,C.isSet)(c.chainId)&&(b.chainId=String(c.chainId)),(0,C.isSet)(c.consensusParams)&&(b.consensusParams=t.ConsensusParams.fromJSON(c.consensusParams)),Array.isArray(c==null?void 0:c.validators)&&(b.validators=c.validators.map(q=>e.ValidatorUpdate.fromJSON(q))),(0,C.isSet)(c.appStateBytes)&&(b.appStateBytes=(0,C.bytesFromBase64)(c.appStateBytes)),(0,C.isSet)(c.initialHeight)&&(b.initialHeight=BigInt(c.initialHeight.toString())),b},toJSON(c){const b={};return c.time!==void 0&&(b.time=(0,C.fromTimestamp)(c.time).toISOString()),c.chainId!==void 0&&(b.chainId=c.chainId),c.consensusParams!==void 0&&(b.consensusParams=c.consensusParams?t.ConsensusParams.toJSON(c.consensusParams):void 0),c.validators?b.validators=c.validators.map(q=>q?e.ValidatorUpdate.toJSON(q):void 0):b.validators=[],c.appStateBytes!==void 0&&(b.appStateBytes=(0,C.base64FromBytes)(c.appStateBytes!==void 0?c.appStateBytes:new Uint8Array)),c.initialHeight!==void 0&&(b.initialHeight=(c.initialHeight||BigInt(0)).toString()),b},fromPartial(c){var q;const b=l();return c.time!==void 0&&c.time!==null&&(b.time=n.Timestamp.fromPartial(c.time)),b.chainId=c.chainId??"",c.consensusParams!==void 0&&c.consensusParams!==null&&(b.consensusParams=t.ConsensusParams.fromPartial(c.consensusParams)),b.validators=((q=c.validators)==null?void 0:q.map($=>e.ValidatorUpdate.fromPartial($)))||[],b.appStateBytes=c.appStateBytes??new Uint8Array,c.initialHeight!==void 0&&c.initialHeight!==null&&(b.initialHeight=BigInt(c.initialHeight.toString())),b}};function T(){return{data:new Uint8Array,path:"",height:BigInt(0),prove:!1}}e.RequestQuery={typeUrl:"/tendermint.abci.RequestQuery",encode(c,b=v.BinaryWriter.create()){return c.data.length!==0&&b.uint32(10).bytes(c.data),c.path!==""&&b.uint32(18).string(c.path),c.height!==BigInt(0)&&b.uint32(24).int64(c.height),c.prove===!0&&b.uint32(32).bool(c.prove),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=T();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.data=q.bytes();break;case 2:F.path=q.string();break;case 3:F.height=q.int64();break;case 4:F.prove=q.bool();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=T();return(0,C.isSet)(c.data)&&(b.data=(0,C.bytesFromBase64)(c.data)),(0,C.isSet)(c.path)&&(b.path=String(c.path)),(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.prove)&&(b.prove=!!c.prove),b},toJSON(c){const b={};return c.data!==void 0&&(b.data=(0,C.base64FromBytes)(c.data!==void 0?c.data:new Uint8Array)),c.path!==void 0&&(b.path=c.path),c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.prove!==void 0&&(b.prove=c.prove),b},fromPartial(c){const b=T();return b.data=c.data??new Uint8Array,b.path=c.path??"",c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),b.prove=c.prove??!1,b}};function f(){return{hash:new Uint8Array,header:r.Header.fromPartial({}),lastCommitInfo:e.CommitInfo.fromPartial({}),byzantineValidators:[]}}e.RequestBeginBlock={typeUrl:"/tendermint.abci.RequestBeginBlock",encode(c,b=v.BinaryWriter.create()){c.hash.length!==0&&b.uint32(10).bytes(c.hash),c.header!==void 0&&r.Header.encode(c.header,b.uint32(18).fork()).ldelim(),c.lastCommitInfo!==void 0&&e.CommitInfo.encode(c.lastCommitInfo,b.uint32(26).fork()).ldelim();for(const q of c.byzantineValidators)e.Misbehavior.encode(q,b.uint32(34).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=f();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.hash=q.bytes();break;case 2:F.header=r.Header.decode(q,q.uint32());break;case 3:F.lastCommitInfo=e.CommitInfo.decode(q,q.uint32());break;case 4:F.byzantineValidators.push(e.Misbehavior.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=f();return(0,C.isSet)(c.hash)&&(b.hash=(0,C.bytesFromBase64)(c.hash)),(0,C.isSet)(c.header)&&(b.header=r.Header.fromJSON(c.header)),(0,C.isSet)(c.lastCommitInfo)&&(b.lastCommitInfo=e.CommitInfo.fromJSON(c.lastCommitInfo)),Array.isArray(c==null?void 0:c.byzantineValidators)&&(b.byzantineValidators=c.byzantineValidators.map(q=>e.Misbehavior.fromJSON(q))),b},toJSON(c){const b={};return c.hash!==void 0&&(b.hash=(0,C.base64FromBytes)(c.hash!==void 0?c.hash:new Uint8Array)),c.header!==void 0&&(b.header=c.header?r.Header.toJSON(c.header):void 0),c.lastCommitInfo!==void 0&&(b.lastCommitInfo=c.lastCommitInfo?e.CommitInfo.toJSON(c.lastCommitInfo):void 0),c.byzantineValidators?b.byzantineValidators=c.byzantineValidators.map(q=>q?e.Misbehavior.toJSON(q):void 0):b.byzantineValidators=[],b},fromPartial(c){var q;const b=f();return b.hash=c.hash??new Uint8Array,c.header!==void 0&&c.header!==null&&(b.header=r.Header.fromPartial(c.header)),c.lastCommitInfo!==void 0&&c.lastCommitInfo!==null&&(b.lastCommitInfo=e.CommitInfo.fromPartial(c.lastCommitInfo)),b.byzantineValidators=((q=c.byzantineValidators)==null?void 0:q.map($=>e.Misbehavior.fromPartial($)))||[],b}};function p(){return{tx:new Uint8Array,type:0}}e.RequestCheckTx={typeUrl:"/tendermint.abci.RequestCheckTx",encode(c,b=v.BinaryWriter.create()){return c.tx.length!==0&&b.uint32(10).bytes(c.tx),c.type!==0&&b.uint32(16).int32(c.type),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=p();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.tx=q.bytes();break;case 2:F.type=q.int32();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=p();return(0,C.isSet)(c.tx)&&(b.tx=(0,C.bytesFromBase64)(c.tx)),(0,C.isSet)(c.type)&&(b.type=D(c.type)),b},toJSON(c){const b={};return c.tx!==void 0&&(b.tx=(0,C.base64FromBytes)(c.tx!==void 0?c.tx:new Uint8Array)),c.type!==void 0&&(b.type=J(c.type)),b},fromPartial(c){const b=p();return b.tx=c.tx??new Uint8Array,b.type=c.type??0,b}};function A(){return{tx:new Uint8Array}}e.RequestDeliverTx={typeUrl:"/tendermint.abci.RequestDeliverTx",encode(c,b=v.BinaryWriter.create()){return c.tx.length!==0&&b.uint32(10).bytes(c.tx),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=A();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.tx=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=A();return(0,C.isSet)(c.tx)&&(b.tx=(0,C.bytesFromBase64)(c.tx)),b},toJSON(c){const b={};return c.tx!==void 0&&(b.tx=(0,C.base64FromBytes)(c.tx!==void 0?c.tx:new Uint8Array)),b},fromPartial(c){const b=A();return b.tx=c.tx??new Uint8Array,b}};function Q(){return{height:BigInt(0)}}e.RequestEndBlock={typeUrl:"/tendermint.abci.RequestEndBlock",encode(c,b=v.BinaryWriter.create()){return c.height!==BigInt(0)&&b.uint32(8).int64(c.height),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=Q();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.height=q.int64();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=Q();return(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),b},toJSON(c){const b={};return c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),b},fromPartial(c){const b=Q();return c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),b}};function M(){return{}}e.RequestCommit={typeUrl:"/tendermint.abci.RequestCommit",encode(c,b=v.BinaryWriter.create()){return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=M();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){default:q.skipType(K&7);break}}return F},fromJSON(c){return M()},toJSON(c){return{}},fromPartial(c){return M()}};function a(){return{}}e.RequestListSnapshots={typeUrl:"/tendermint.abci.RequestListSnapshots",encode(c,b=v.BinaryWriter.create()){return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=a();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){default:q.skipType(K&7);break}}return F},fromJSON(c){return a()},toJSON(c){return{}},fromPartial(c){return a()}};function k(){return{snapshot:void 0,appHash:new Uint8Array}}e.RequestOfferSnapshot={typeUrl:"/tendermint.abci.RequestOfferSnapshot",encode(c,b=v.BinaryWriter.create()){return c.snapshot!==void 0&&e.Snapshot.encode(c.snapshot,b.uint32(10).fork()).ldelim(),c.appHash.length!==0&&b.uint32(18).bytes(c.appHash),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=k();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.snapshot=e.Snapshot.decode(q,q.uint32());break;case 2:F.appHash=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=k();return(0,C.isSet)(c.snapshot)&&(b.snapshot=e.Snapshot.fromJSON(c.snapshot)),(0,C.isSet)(c.appHash)&&(b.appHash=(0,C.bytesFromBase64)(c.appHash)),b},toJSON(c){const b={};return c.snapshot!==void 0&&(b.snapshot=c.snapshot?e.Snapshot.toJSON(c.snapshot):void 0),c.appHash!==void 0&&(b.appHash=(0,C.base64FromBytes)(c.appHash!==void 0?c.appHash:new Uint8Array)),b},fromPartial(c){const b=k();return c.snapshot!==void 0&&c.snapshot!==null&&(b.snapshot=e.Snapshot.fromPartial(c.snapshot)),b.appHash=c.appHash??new Uint8Array,b}};function S(){return{height:BigInt(0),format:0,chunk:0}}e.RequestLoadSnapshotChunk={typeUrl:"/tendermint.abci.RequestLoadSnapshotChunk",encode(c,b=v.BinaryWriter.create()){return c.height!==BigInt(0)&&b.uint32(8).uint64(c.height),c.format!==0&&b.uint32(16).uint32(c.format),c.chunk!==0&&b.uint32(24).uint32(c.chunk),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=S();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.height=q.uint64();break;case 2:F.format=q.uint32();break;case 3:F.chunk=q.uint32();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=S();return(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.format)&&(b.format=Number(c.format)),(0,C.isSet)(c.chunk)&&(b.chunk=Number(c.chunk)),b},toJSON(c){const b={};return c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.format!==void 0&&(b.format=Math.round(c.format)),c.chunk!==void 0&&(b.chunk=Math.round(c.chunk)),b},fromPartial(c){const b=S();return c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),b.format=c.format??0,b.chunk=c.chunk??0,b}};function P(){return{index:0,chunk:new Uint8Array,sender:""}}e.RequestApplySnapshotChunk={typeUrl:"/tendermint.abci.RequestApplySnapshotChunk",encode(c,b=v.BinaryWriter.create()){return c.index!==0&&b.uint32(8).uint32(c.index),c.chunk.length!==0&&b.uint32(18).bytes(c.chunk),c.sender!==""&&b.uint32(26).string(c.sender),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=P();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.index=q.uint32();break;case 2:F.chunk=q.bytes();break;case 3:F.sender=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=P();return(0,C.isSet)(c.index)&&(b.index=Number(c.index)),(0,C.isSet)(c.chunk)&&(b.chunk=(0,C.bytesFromBase64)(c.chunk)),(0,C.isSet)(c.sender)&&(b.sender=String(c.sender)),b},toJSON(c){const b={};return c.index!==void 0&&(b.index=Math.round(c.index)),c.chunk!==void 0&&(b.chunk=(0,C.base64FromBytes)(c.chunk!==void 0?c.chunk:new Uint8Array)),c.sender!==void 0&&(b.sender=c.sender),b},fromPartial(c){const b=P();return b.index=c.index??0,b.chunk=c.chunk??new Uint8Array,b.sender=c.sender??"",b}};function O(){return{maxTxBytes:BigInt(0),txs:[],localLastCommit:e.ExtendedCommitInfo.fromPartial({}),misbehavior:[],height:BigInt(0),time:n.Timestamp.fromPartial({}),nextValidatorsHash:new Uint8Array,proposerAddress:new Uint8Array}}e.RequestPrepareProposal={typeUrl:"/tendermint.abci.RequestPrepareProposal",encode(c,b=v.BinaryWriter.create()){c.maxTxBytes!==BigInt(0)&&b.uint32(8).int64(c.maxTxBytes);for(const q of c.txs)b.uint32(18).bytes(q);c.localLastCommit!==void 0&&e.ExtendedCommitInfo.encode(c.localLastCommit,b.uint32(26).fork()).ldelim();for(const q of c.misbehavior)e.Misbehavior.encode(q,b.uint32(34).fork()).ldelim();return c.height!==BigInt(0)&&b.uint32(40).int64(c.height),c.time!==void 0&&n.Timestamp.encode(c.time,b.uint32(50).fork()).ldelim(),c.nextValidatorsHash.length!==0&&b.uint32(58).bytes(c.nextValidatorsHash),c.proposerAddress.length!==0&&b.uint32(66).bytes(c.proposerAddress),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=O();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.maxTxBytes=q.int64();break;case 2:F.txs.push(q.bytes());break;case 3:F.localLastCommit=e.ExtendedCommitInfo.decode(q,q.uint32());break;case 4:F.misbehavior.push(e.Misbehavior.decode(q,q.uint32()));break;case 5:F.height=q.int64();break;case 6:F.time=n.Timestamp.decode(q,q.uint32());break;case 7:F.nextValidatorsHash=q.bytes();break;case 8:F.proposerAddress=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=O();return(0,C.isSet)(c.maxTxBytes)&&(b.maxTxBytes=BigInt(c.maxTxBytes.toString())),Array.isArray(c==null?void 0:c.txs)&&(b.txs=c.txs.map(q=>(0,C.bytesFromBase64)(q))),(0,C.isSet)(c.localLastCommit)&&(b.localLastCommit=e.ExtendedCommitInfo.fromJSON(c.localLastCommit)),Array.isArray(c==null?void 0:c.misbehavior)&&(b.misbehavior=c.misbehavior.map(q=>e.Misbehavior.fromJSON(q))),(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.time)&&(b.time=(0,C.fromJsonTimestamp)(c.time)),(0,C.isSet)(c.nextValidatorsHash)&&(b.nextValidatorsHash=(0,C.bytesFromBase64)(c.nextValidatorsHash)),(0,C.isSet)(c.proposerAddress)&&(b.proposerAddress=(0,C.bytesFromBase64)(c.proposerAddress)),b},toJSON(c){const b={};return c.maxTxBytes!==void 0&&(b.maxTxBytes=(c.maxTxBytes||BigInt(0)).toString()),c.txs?b.txs=c.txs.map(q=>(0,C.base64FromBytes)(q!==void 0?q:new Uint8Array)):b.txs=[],c.localLastCommit!==void 0&&(b.localLastCommit=c.localLastCommit?e.ExtendedCommitInfo.toJSON(c.localLastCommit):void 0),c.misbehavior?b.misbehavior=c.misbehavior.map(q=>q?e.Misbehavior.toJSON(q):void 0):b.misbehavior=[],c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.time!==void 0&&(b.time=(0,C.fromTimestamp)(c.time).toISOString()),c.nextValidatorsHash!==void 0&&(b.nextValidatorsHash=(0,C.base64FromBytes)(c.nextValidatorsHash!==void 0?c.nextValidatorsHash:new Uint8Array)),c.proposerAddress!==void 0&&(b.proposerAddress=(0,C.base64FromBytes)(c.proposerAddress!==void 0?c.proposerAddress:new Uint8Array)),b},fromPartial(c){var q,$;const b=O();return c.maxTxBytes!==void 0&&c.maxTxBytes!==null&&(b.maxTxBytes=BigInt(c.maxTxBytes.toString())),b.txs=((q=c.txs)==null?void 0:q.map(F=>F))||[],c.localLastCommit!==void 0&&c.localLastCommit!==null&&(b.localLastCommit=e.ExtendedCommitInfo.fromPartial(c.localLastCommit)),b.misbehavior=(($=c.misbehavior)==null?void 0:$.map(F=>e.Misbehavior.fromPartial(F)))||[],c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),c.time!==void 0&&c.time!==null&&(b.time=n.Timestamp.fromPartial(c.time)),b.nextValidatorsHash=c.nextValidatorsHash??new Uint8Array,b.proposerAddress=c.proposerAddress??new Uint8Array,b}};function W(){return{txs:[],proposedLastCommit:e.CommitInfo.fromPartial({}),misbehavior:[],hash:new Uint8Array,height:BigInt(0),time:n.Timestamp.fromPartial({}),nextValidatorsHash:new Uint8Array,proposerAddress:new Uint8Array}}e.RequestProcessProposal={typeUrl:"/tendermint.abci.RequestProcessProposal",encode(c,b=v.BinaryWriter.create()){for(const q of c.txs)b.uint32(10).bytes(q);c.proposedLastCommit!==void 0&&e.CommitInfo.encode(c.proposedLastCommit,b.uint32(18).fork()).ldelim();for(const q of c.misbehavior)e.Misbehavior.encode(q,b.uint32(26).fork()).ldelim();return c.hash.length!==0&&b.uint32(34).bytes(c.hash),c.height!==BigInt(0)&&b.uint32(40).int64(c.height),c.time!==void 0&&n.Timestamp.encode(c.time,b.uint32(50).fork()).ldelim(),c.nextValidatorsHash.length!==0&&b.uint32(58).bytes(c.nextValidatorsHash),c.proposerAddress.length!==0&&b.uint32(66).bytes(c.proposerAddress),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=W();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.txs.push(q.bytes());break;case 2:F.proposedLastCommit=e.CommitInfo.decode(q,q.uint32());break;case 3:F.misbehavior.push(e.Misbehavior.decode(q,q.uint32()));break;case 4:F.hash=q.bytes();break;case 5:F.height=q.int64();break;case 6:F.time=n.Timestamp.decode(q,q.uint32());break;case 7:F.nextValidatorsHash=q.bytes();break;case 8:F.proposerAddress=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=W();return Array.isArray(c==null?void 0:c.txs)&&(b.txs=c.txs.map(q=>(0,C.bytesFromBase64)(q))),(0,C.isSet)(c.proposedLastCommit)&&(b.proposedLastCommit=e.CommitInfo.fromJSON(c.proposedLastCommit)),Array.isArray(c==null?void 0:c.misbehavior)&&(b.misbehavior=c.misbehavior.map(q=>e.Misbehavior.fromJSON(q))),(0,C.isSet)(c.hash)&&(b.hash=(0,C.bytesFromBase64)(c.hash)),(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.time)&&(b.time=(0,C.fromJsonTimestamp)(c.time)),(0,C.isSet)(c.nextValidatorsHash)&&(b.nextValidatorsHash=(0,C.bytesFromBase64)(c.nextValidatorsHash)),(0,C.isSet)(c.proposerAddress)&&(b.proposerAddress=(0,C.bytesFromBase64)(c.proposerAddress)),b},toJSON(c){const b={};return c.txs?b.txs=c.txs.map(q=>(0,C.base64FromBytes)(q!==void 0?q:new Uint8Array)):b.txs=[],c.proposedLastCommit!==void 0&&(b.proposedLastCommit=c.proposedLastCommit?e.CommitInfo.toJSON(c.proposedLastCommit):void 0),c.misbehavior?b.misbehavior=c.misbehavior.map(q=>q?e.Misbehavior.toJSON(q):void 0):b.misbehavior=[],c.hash!==void 0&&(b.hash=(0,C.base64FromBytes)(c.hash!==void 0?c.hash:new Uint8Array)),c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.time!==void 0&&(b.time=(0,C.fromTimestamp)(c.time).toISOString()),c.nextValidatorsHash!==void 0&&(b.nextValidatorsHash=(0,C.base64FromBytes)(c.nextValidatorsHash!==void 0?c.nextValidatorsHash:new Uint8Array)),c.proposerAddress!==void 0&&(b.proposerAddress=(0,C.base64FromBytes)(c.proposerAddress!==void 0?c.proposerAddress:new Uint8Array)),b},fromPartial(c){var q,$;const b=W();return b.txs=((q=c.txs)==null?void 0:q.map(F=>F))||[],c.proposedLastCommit!==void 0&&c.proposedLastCommit!==null&&(b.proposedLastCommit=e.CommitInfo.fromPartial(c.proposedLastCommit)),b.misbehavior=(($=c.misbehavior)==null?void 0:$.map(F=>e.Misbehavior.fromPartial(F)))||[],b.hash=c.hash??new Uint8Array,c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),c.time!==void 0&&c.time!==null&&(b.time=n.Timestamp.fromPartial(c.time)),b.nextValidatorsHash=c.nextValidatorsHash??new Uint8Array,b.proposerAddress=c.proposerAddress??new Uint8Array,b}};function L(){return{exception:void 0,echo:void 0,flush:void 0,info:void 0,initChain:void 0,query:void 0,beginBlock:void 0,checkTx:void 0,deliverTx:void 0,endBlock:void 0,commit:void 0,listSnapshots:void 0,offerSnapshot:void 0,loadSnapshotChunk:void 0,applySnapshotChunk:void 0,prepareProposal:void 0,processProposal:void 0}}e.Response={typeUrl:"/tendermint.abci.Response",encode(c,b=v.BinaryWriter.create()){return c.exception!==void 0&&e.ResponseException.encode(c.exception,b.uint32(10).fork()).ldelim(),c.echo!==void 0&&e.ResponseEcho.encode(c.echo,b.uint32(18).fork()).ldelim(),c.flush!==void 0&&e.ResponseFlush.encode(c.flush,b.uint32(26).fork()).ldelim(),c.info!==void 0&&e.ResponseInfo.encode(c.info,b.uint32(34).fork()).ldelim(),c.initChain!==void 0&&e.ResponseInitChain.encode(c.initChain,b.uint32(50).fork()).ldelim(),c.query!==void 0&&e.ResponseQuery.encode(c.query,b.uint32(58).fork()).ldelim(),c.beginBlock!==void 0&&e.ResponseBeginBlock.encode(c.beginBlock,b.uint32(66).fork()).ldelim(),c.checkTx!==void 0&&e.ResponseCheckTx.encode(c.checkTx,b.uint32(74).fork()).ldelim(),c.deliverTx!==void 0&&e.ResponseDeliverTx.encode(c.deliverTx,b.uint32(82).fork()).ldelim(),c.endBlock!==void 0&&e.ResponseEndBlock.encode(c.endBlock,b.uint32(90).fork()).ldelim(),c.commit!==void 0&&e.ResponseCommit.encode(c.commit,b.uint32(98).fork()).ldelim(),c.listSnapshots!==void 0&&e.ResponseListSnapshots.encode(c.listSnapshots,b.uint32(106).fork()).ldelim(),c.offerSnapshot!==void 0&&e.ResponseOfferSnapshot.encode(c.offerSnapshot,b.uint32(114).fork()).ldelim(),c.loadSnapshotChunk!==void 0&&e.ResponseLoadSnapshotChunk.encode(c.loadSnapshotChunk,b.uint32(122).fork()).ldelim(),c.applySnapshotChunk!==void 0&&e.ResponseApplySnapshotChunk.encode(c.applySnapshotChunk,b.uint32(130).fork()).ldelim(),c.prepareProposal!==void 0&&e.ResponsePrepareProposal.encode(c.prepareProposal,b.uint32(138).fork()).ldelim(),c.processProposal!==void 0&&e.ResponseProcessProposal.encode(c.processProposal,b.uint32(146).fork()).ldelim(),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=L();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.exception=e.ResponseException.decode(q,q.uint32());break;case 2:F.echo=e.ResponseEcho.decode(q,q.uint32());break;case 3:F.flush=e.ResponseFlush.decode(q,q.uint32());break;case 4:F.info=e.ResponseInfo.decode(q,q.uint32());break;case 6:F.initChain=e.ResponseInitChain.decode(q,q.uint32());break;case 7:F.query=e.ResponseQuery.decode(q,q.uint32());break;case 8:F.beginBlock=e.ResponseBeginBlock.decode(q,q.uint32());break;case 9:F.checkTx=e.ResponseCheckTx.decode(q,q.uint32());break;case 10:F.deliverTx=e.ResponseDeliverTx.decode(q,q.uint32());break;case 11:F.endBlock=e.ResponseEndBlock.decode(q,q.uint32());break;case 12:F.commit=e.ResponseCommit.decode(q,q.uint32());break;case 13:F.listSnapshots=e.ResponseListSnapshots.decode(q,q.uint32());break;case 14:F.offerSnapshot=e.ResponseOfferSnapshot.decode(q,q.uint32());break;case 15:F.loadSnapshotChunk=e.ResponseLoadSnapshotChunk.decode(q,q.uint32());break;case 16:F.applySnapshotChunk=e.ResponseApplySnapshotChunk.decode(q,q.uint32());break;case 17:F.prepareProposal=e.ResponsePrepareProposal.decode(q,q.uint32());break;case 18:F.processProposal=e.ResponseProcessProposal.decode(q,q.uint32());break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=L();return(0,C.isSet)(c.exception)&&(b.exception=e.ResponseException.fromJSON(c.exception)),(0,C.isSet)(c.echo)&&(b.echo=e.ResponseEcho.fromJSON(c.echo)),(0,C.isSet)(c.flush)&&(b.flush=e.ResponseFlush.fromJSON(c.flush)),(0,C.isSet)(c.info)&&(b.info=e.ResponseInfo.fromJSON(c.info)),(0,C.isSet)(c.initChain)&&(b.initChain=e.ResponseInitChain.fromJSON(c.initChain)),(0,C.isSet)(c.query)&&(b.query=e.ResponseQuery.fromJSON(c.query)),(0,C.isSet)(c.beginBlock)&&(b.beginBlock=e.ResponseBeginBlock.fromJSON(c.beginBlock)),(0,C.isSet)(c.checkTx)&&(b.checkTx=e.ResponseCheckTx.fromJSON(c.checkTx)),(0,C.isSet)(c.deliverTx)&&(b.deliverTx=e.ResponseDeliverTx.fromJSON(c.deliverTx)),(0,C.isSet)(c.endBlock)&&(b.endBlock=e.ResponseEndBlock.fromJSON(c.endBlock)),(0,C.isSet)(c.commit)&&(b.commit=e.ResponseCommit.fromJSON(c.commit)),(0,C.isSet)(c.listSnapshots)&&(b.listSnapshots=e.ResponseListSnapshots.fromJSON(c.listSnapshots)),(0,C.isSet)(c.offerSnapshot)&&(b.offerSnapshot=e.ResponseOfferSnapshot.fromJSON(c.offerSnapshot)),(0,C.isSet)(c.loadSnapshotChunk)&&(b.loadSnapshotChunk=e.ResponseLoadSnapshotChunk.fromJSON(c.loadSnapshotChunk)),(0,C.isSet)(c.applySnapshotChunk)&&(b.applySnapshotChunk=e.ResponseApplySnapshotChunk.fromJSON(c.applySnapshotChunk)),(0,C.isSet)(c.prepareProposal)&&(b.prepareProposal=e.ResponsePrepareProposal.fromJSON(c.prepareProposal)),(0,C.isSet)(c.processProposal)&&(b.processProposal=e.ResponseProcessProposal.fromJSON(c.processProposal)),b},toJSON(c){const b={};return c.exception!==void 0&&(b.exception=c.exception?e.ResponseException.toJSON(c.exception):void 0),c.echo!==void 0&&(b.echo=c.echo?e.ResponseEcho.toJSON(c.echo):void 0),c.flush!==void 0&&(b.flush=c.flush?e.ResponseFlush.toJSON(c.flush):void 0),c.info!==void 0&&(b.info=c.info?e.ResponseInfo.toJSON(c.info):void 0),c.initChain!==void 0&&(b.initChain=c.initChain?e.ResponseInitChain.toJSON(c.initChain):void 0),c.query!==void 0&&(b.query=c.query?e.ResponseQuery.toJSON(c.query):void 0),c.beginBlock!==void 0&&(b.beginBlock=c.beginBlock?e.ResponseBeginBlock.toJSON(c.beginBlock):void 0),c.checkTx!==void 0&&(b.checkTx=c.checkTx?e.ResponseCheckTx.toJSON(c.checkTx):void 0),c.deliverTx!==void 0&&(b.deliverTx=c.deliverTx?e.ResponseDeliverTx.toJSON(c.deliverTx):void 0),c.endBlock!==void 0&&(b.endBlock=c.endBlock?e.ResponseEndBlock.toJSON(c.endBlock):void 0),c.commit!==void 0&&(b.commit=c.commit?e.ResponseCommit.toJSON(c.commit):void 0),c.listSnapshots!==void 0&&(b.listSnapshots=c.listSnapshots?e.ResponseListSnapshots.toJSON(c.listSnapshots):void 0),c.offerSnapshot!==void 0&&(b.offerSnapshot=c.offerSnapshot?e.ResponseOfferSnapshot.toJSON(c.offerSnapshot):void 0),c.loadSnapshotChunk!==void 0&&(b.loadSnapshotChunk=c.loadSnapshotChunk?e.ResponseLoadSnapshotChunk.toJSON(c.loadSnapshotChunk):void 0),c.applySnapshotChunk!==void 0&&(b.applySnapshotChunk=c.applySnapshotChunk?e.ResponseApplySnapshotChunk.toJSON(c.applySnapshotChunk):void 0),c.prepareProposal!==void 0&&(b.prepareProposal=c.prepareProposal?e.ResponsePrepareProposal.toJSON(c.prepareProposal):void 0),c.processProposal!==void 0&&(b.processProposal=c.processProposal?e.ResponseProcessProposal.toJSON(c.processProposal):void 0),b},fromPartial(c){const b=L();return c.exception!==void 0&&c.exception!==null&&(b.exception=e.ResponseException.fromPartial(c.exception)),c.echo!==void 0&&c.echo!==null&&(b.echo=e.ResponseEcho.fromPartial(c.echo)),c.flush!==void 0&&c.flush!==null&&(b.flush=e.ResponseFlush.fromPartial(c.flush)),c.info!==void 0&&c.info!==null&&(b.info=e.ResponseInfo.fromPartial(c.info)),c.initChain!==void 0&&c.initChain!==null&&(b.initChain=e.ResponseInitChain.fromPartial(c.initChain)),c.query!==void 0&&c.query!==null&&(b.query=e.ResponseQuery.fromPartial(c.query)),c.beginBlock!==void 0&&c.beginBlock!==null&&(b.beginBlock=e.ResponseBeginBlock.fromPartial(c.beginBlock)),c.checkTx!==void 0&&c.checkTx!==null&&(b.checkTx=e.ResponseCheckTx.fromPartial(c.checkTx)),c.deliverTx!==void 0&&c.deliverTx!==null&&(b.deliverTx=e.ResponseDeliverTx.fromPartial(c.deliverTx)),c.endBlock!==void 0&&c.endBlock!==null&&(b.endBlock=e.ResponseEndBlock.fromPartial(c.endBlock)),c.commit!==void 0&&c.commit!==null&&(b.commit=e.ResponseCommit.fromPartial(c.commit)),c.listSnapshots!==void 0&&c.listSnapshots!==null&&(b.listSnapshots=e.ResponseListSnapshots.fromPartial(c.listSnapshots)),c.offerSnapshot!==void 0&&c.offerSnapshot!==null&&(b.offerSnapshot=e.ResponseOfferSnapshot.fromPartial(c.offerSnapshot)),c.loadSnapshotChunk!==void 0&&c.loadSnapshotChunk!==null&&(b.loadSnapshotChunk=e.ResponseLoadSnapshotChunk.fromPartial(c.loadSnapshotChunk)),c.applySnapshotChunk!==void 0&&c.applySnapshotChunk!==null&&(b.applySnapshotChunk=e.ResponseApplySnapshotChunk.fromPartial(c.applySnapshotChunk)),c.prepareProposal!==void 0&&c.prepareProposal!==null&&(b.prepareProposal=e.ResponsePrepareProposal.fromPartial(c.prepareProposal)),c.processProposal!==void 0&&c.processProposal!==null&&(b.processProposal=e.ResponseProcessProposal.fromPartial(c.processProposal)),b}};function G(){return{error:""}}e.ResponseException={typeUrl:"/tendermint.abci.ResponseException",encode(c,b=v.BinaryWriter.create()){return c.error!==""&&b.uint32(10).string(c.error),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=G();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.error=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=G();return(0,C.isSet)(c.error)&&(b.error=String(c.error)),b},toJSON(c){const b={};return c.error!==void 0&&(b.error=c.error),b},fromPartial(c){const b=G();return b.error=c.error??"",b}};function X(){return{message:""}}e.ResponseEcho={typeUrl:"/tendermint.abci.ResponseEcho",encode(c,b=v.BinaryWriter.create()){return c.message!==""&&b.uint32(10).string(c.message),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=X();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.message=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=X();return(0,C.isSet)(c.message)&&(b.message=String(c.message)),b},toJSON(c){const b={};return c.message!==void 0&&(b.message=c.message),b},fromPartial(c){const b=X();return b.message=c.message??"",b}};function $s(){return{}}e.ResponseFlush={typeUrl:"/tendermint.abci.ResponseFlush",encode(c,b=v.BinaryWriter.create()){return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=$s();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){default:q.skipType(K&7);break}}return F},fromJSON(c){return $s()},toJSON(c){return{}},fromPartial(c){return $s()}};function Ks(){return{data:"",version:"",appVersion:BigInt(0),lastBlockHeight:BigInt(0),lastBlockAppHash:new Uint8Array}}e.ResponseInfo={typeUrl:"/tendermint.abci.ResponseInfo",encode(c,b=v.BinaryWriter.create()){return c.data!==""&&b.uint32(10).string(c.data),c.version!==""&&b.uint32(18).string(c.version),c.appVersion!==BigInt(0)&&b.uint32(24).uint64(c.appVersion),c.lastBlockHeight!==BigInt(0)&&b.uint32(32).int64(c.lastBlockHeight),c.lastBlockAppHash.length!==0&&b.uint32(42).bytes(c.lastBlockAppHash),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=Ks();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.data=q.string();break;case 2:F.version=q.string();break;case 3:F.appVersion=q.uint64();break;case 4:F.lastBlockHeight=q.int64();break;case 5:F.lastBlockAppHash=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=Ks();return(0,C.isSet)(c.data)&&(b.data=String(c.data)),(0,C.isSet)(c.version)&&(b.version=String(c.version)),(0,C.isSet)(c.appVersion)&&(b.appVersion=BigInt(c.appVersion.toString())),(0,C.isSet)(c.lastBlockHeight)&&(b.lastBlockHeight=BigInt(c.lastBlockHeight.toString())),(0,C.isSet)(c.lastBlockAppHash)&&(b.lastBlockAppHash=(0,C.bytesFromBase64)(c.lastBlockAppHash)),b},toJSON(c){const b={};return c.data!==void 0&&(b.data=c.data),c.version!==void 0&&(b.version=c.version),c.appVersion!==void 0&&(b.appVersion=(c.appVersion||BigInt(0)).toString()),c.lastBlockHeight!==void 0&&(b.lastBlockHeight=(c.lastBlockHeight||BigInt(0)).toString()),c.lastBlockAppHash!==void 0&&(b.lastBlockAppHash=(0,C.base64FromBytes)(c.lastBlockAppHash!==void 0?c.lastBlockAppHash:new Uint8Array)),b},fromPartial(c){const b=Ks();return b.data=c.data??"",b.version=c.version??"",c.appVersion!==void 0&&c.appVersion!==null&&(b.appVersion=BigInt(c.appVersion.toString())),c.lastBlockHeight!==void 0&&c.lastBlockHeight!==null&&(b.lastBlockHeight=BigInt(c.lastBlockHeight.toString())),b.lastBlockAppHash=c.lastBlockAppHash??new Uint8Array,b}};function zs(){return{consensusParams:void 0,validators:[],appHash:new Uint8Array}}e.ResponseInitChain={typeUrl:"/tendermint.abci.ResponseInitChain",encode(c,b=v.BinaryWriter.create()){c.consensusParams!==void 0&&t.ConsensusParams.encode(c.consensusParams,b.uint32(10).fork()).ldelim();for(const q of c.validators)e.ValidatorUpdate.encode(q,b.uint32(18).fork()).ldelim();return c.appHash.length!==0&&b.uint32(26).bytes(c.appHash),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=zs();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.consensusParams=t.ConsensusParams.decode(q,q.uint32());break;case 2:F.validators.push(e.ValidatorUpdate.decode(q,q.uint32()));break;case 3:F.appHash=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=zs();return(0,C.isSet)(c.consensusParams)&&(b.consensusParams=t.ConsensusParams.fromJSON(c.consensusParams)),Array.isArray(c==null?void 0:c.validators)&&(b.validators=c.validators.map(q=>e.ValidatorUpdate.fromJSON(q))),(0,C.isSet)(c.appHash)&&(b.appHash=(0,C.bytesFromBase64)(c.appHash)),b},toJSON(c){const b={};return c.consensusParams!==void 0&&(b.consensusParams=c.consensusParams?t.ConsensusParams.toJSON(c.consensusParams):void 0),c.validators?b.validators=c.validators.map(q=>q?e.ValidatorUpdate.toJSON(q):void 0):b.validators=[],c.appHash!==void 0&&(b.appHash=(0,C.base64FromBytes)(c.appHash!==void 0?c.appHash:new Uint8Array)),b},fromPartial(c){var q;const b=zs();return c.consensusParams!==void 0&&c.consensusParams!==null&&(b.consensusParams=t.ConsensusParams.fromPartial(c.consensusParams)),b.validators=((q=c.validators)==null?void 0:q.map($=>e.ValidatorUpdate.fromPartial($)))||[],b.appHash=c.appHash??new Uint8Array,b}};function Ys(){return{code:0,log:"",info:"",index:BigInt(0),key:new Uint8Array,value:new Uint8Array,proofOps:void 0,height:BigInt(0),codespace:""}}e.ResponseQuery={typeUrl:"/tendermint.abci.ResponseQuery",encode(c,b=v.BinaryWriter.create()){return c.code!==0&&b.uint32(8).uint32(c.code),c.log!==""&&b.uint32(26).string(c.log),c.info!==""&&b.uint32(34).string(c.info),c.index!==BigInt(0)&&b.uint32(40).int64(c.index),c.key.length!==0&&b.uint32(50).bytes(c.key),c.value.length!==0&&b.uint32(58).bytes(c.value),c.proofOps!==void 0&&o.ProofOps.encode(c.proofOps,b.uint32(66).fork()).ldelim(),c.height!==BigInt(0)&&b.uint32(72).int64(c.height),c.codespace!==""&&b.uint32(82).string(c.codespace),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=Ys();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.code=q.uint32();break;case 3:F.log=q.string();break;case 4:F.info=q.string();break;case 5:F.index=q.int64();break;case 6:F.key=q.bytes();break;case 7:F.value=q.bytes();break;case 8:F.proofOps=o.ProofOps.decode(q,q.uint32());break;case 9:F.height=q.int64();break;case 10:F.codespace=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=Ys();return(0,C.isSet)(c.code)&&(b.code=Number(c.code)),(0,C.isSet)(c.log)&&(b.log=String(c.log)),(0,C.isSet)(c.info)&&(b.info=String(c.info)),(0,C.isSet)(c.index)&&(b.index=BigInt(c.index.toString())),(0,C.isSet)(c.key)&&(b.key=(0,C.bytesFromBase64)(c.key)),(0,C.isSet)(c.value)&&(b.value=(0,C.bytesFromBase64)(c.value)),(0,C.isSet)(c.proofOps)&&(b.proofOps=o.ProofOps.fromJSON(c.proofOps)),(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.codespace)&&(b.codespace=String(c.codespace)),b},toJSON(c){const b={};return c.code!==void 0&&(b.code=Math.round(c.code)),c.log!==void 0&&(b.log=c.log),c.info!==void 0&&(b.info=c.info),c.index!==void 0&&(b.index=(c.index||BigInt(0)).toString()),c.key!==void 0&&(b.key=(0,C.base64FromBytes)(c.key!==void 0?c.key:new Uint8Array)),c.value!==void 0&&(b.value=(0,C.base64FromBytes)(c.value!==void 0?c.value:new Uint8Array)),c.proofOps!==void 0&&(b.proofOps=c.proofOps?o.ProofOps.toJSON(c.proofOps):void 0),c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.codespace!==void 0&&(b.codespace=c.codespace),b},fromPartial(c){const b=Ys();return b.code=c.code??0,b.log=c.log??"",b.info=c.info??"",c.index!==void 0&&c.index!==null&&(b.index=BigInt(c.index.toString())),b.key=c.key??new Uint8Array,b.value=c.value??new Uint8Array,c.proofOps!==void 0&&c.proofOps!==null&&(b.proofOps=o.ProofOps.fromPartial(c.proofOps)),c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),b.codespace=c.codespace??"",b}};function Zs(){return{events:[]}}e.ResponseBeginBlock={typeUrl:"/tendermint.abci.ResponseBeginBlock",encode(c,b=v.BinaryWriter.create()){for(const q of c.events)e.Event.encode(q,b.uint32(10).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=Zs();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.events.push(e.Event.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=Zs();return Array.isArray(c==null?void 0:c.events)&&(b.events=c.events.map(q=>e.Event.fromJSON(q))),b},toJSON(c){const b={};return c.events?b.events=c.events.map(q=>q?e.Event.toJSON(q):void 0):b.events=[],b},fromPartial(c){var q;const b=Zs();return b.events=((q=c.events)==null?void 0:q.map($=>e.Event.fromPartial($)))||[],b}};function Xs(){return{code:0,data:new Uint8Array,log:"",info:"",gasWanted:BigInt(0),gasUsed:BigInt(0),events:[],codespace:"",sender:"",priority:BigInt(0),mempoolError:""}}e.ResponseCheckTx={typeUrl:"/tendermint.abci.ResponseCheckTx",encode(c,b=v.BinaryWriter.create()){c.code!==0&&b.uint32(8).uint32(c.code),c.data.length!==0&&b.uint32(18).bytes(c.data),c.log!==""&&b.uint32(26).string(c.log),c.info!==""&&b.uint32(34).string(c.info),c.gasWanted!==BigInt(0)&&b.uint32(40).int64(c.gasWanted),c.gasUsed!==BigInt(0)&&b.uint32(48).int64(c.gasUsed);for(const q of c.events)e.Event.encode(q,b.uint32(58).fork()).ldelim();return c.codespace!==""&&b.uint32(66).string(c.codespace),c.sender!==""&&b.uint32(74).string(c.sender),c.priority!==BigInt(0)&&b.uint32(80).int64(c.priority),c.mempoolError!==""&&b.uint32(90).string(c.mempoolError),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=Xs();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.code=q.uint32();break;case 2:F.data=q.bytes();break;case 3:F.log=q.string();break;case 4:F.info=q.string();break;case 5:F.gasWanted=q.int64();break;case 6:F.gasUsed=q.int64();break;case 7:F.events.push(e.Event.decode(q,q.uint32()));break;case 8:F.codespace=q.string();break;case 9:F.sender=q.string();break;case 10:F.priority=q.int64();break;case 11:F.mempoolError=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=Xs();return(0,C.isSet)(c.code)&&(b.code=Number(c.code)),(0,C.isSet)(c.data)&&(b.data=(0,C.bytesFromBase64)(c.data)),(0,C.isSet)(c.log)&&(b.log=String(c.log)),(0,C.isSet)(c.info)&&(b.info=String(c.info)),(0,C.isSet)(c.gas_wanted)&&(b.gasWanted=BigInt(c.gas_wanted.toString())),(0,C.isSet)(c.gas_used)&&(b.gasUsed=BigInt(c.gas_used.toString())),Array.isArray(c==null?void 0:c.events)&&(b.events=c.events.map(q=>e.Event.fromJSON(q))),(0,C.isSet)(c.codespace)&&(b.codespace=String(c.codespace)),(0,C.isSet)(c.sender)&&(b.sender=String(c.sender)),(0,C.isSet)(c.priority)&&(b.priority=BigInt(c.priority.toString())),(0,C.isSet)(c.mempoolError)&&(b.mempoolError=String(c.mempoolError)),b},toJSON(c){const b={};return c.code!==void 0&&(b.code=Math.round(c.code)),c.data!==void 0&&(b.data=(0,C.base64FromBytes)(c.data!==void 0?c.data:new Uint8Array)),c.log!==void 0&&(b.log=c.log),c.info!==void 0&&(b.info=c.info),c.gasWanted!==void 0&&(b.gas_wanted=(c.gasWanted||BigInt(0)).toString()),c.gasUsed!==void 0&&(b.gas_used=(c.gasUsed||BigInt(0)).toString()),c.events?b.events=c.events.map(q=>q?e.Event.toJSON(q):void 0):b.events=[],c.codespace!==void 0&&(b.codespace=c.codespace),c.sender!==void 0&&(b.sender=c.sender),c.priority!==void 0&&(b.priority=(c.priority||BigInt(0)).toString()),c.mempoolError!==void 0&&(b.mempoolError=c.mempoolError),b},fromPartial(c){var q;const b=Xs();return b.code=c.code??0,b.data=c.data??new Uint8Array,b.log=c.log??"",b.info=c.info??"",c.gasWanted!==void 0&&c.gasWanted!==null&&(b.gasWanted=BigInt(c.gasWanted.toString())),c.gasUsed!==void 0&&c.gasUsed!==null&&(b.gasUsed=BigInt(c.gasUsed.toString())),b.events=((q=c.events)==null?void 0:q.map($=>e.Event.fromPartial($)))||[],b.codespace=c.codespace??"",b.sender=c.sender??"",c.priority!==void 0&&c.priority!==null&&(b.priority=BigInt(c.priority.toString())),b.mempoolError=c.mempoolError??"",b}};function xs(){return{code:0,data:new Uint8Array,log:"",info:"",gasWanted:BigInt(0),gasUsed:BigInt(0),events:[],codespace:""}}e.ResponseDeliverTx={typeUrl:"/tendermint.abci.ResponseDeliverTx",encode(c,b=v.BinaryWriter.create()){c.code!==0&&b.uint32(8).uint32(c.code),c.data.length!==0&&b.uint32(18).bytes(c.data),c.log!==""&&b.uint32(26).string(c.log),c.info!==""&&b.uint32(34).string(c.info),c.gasWanted!==BigInt(0)&&b.uint32(40).int64(c.gasWanted),c.gasUsed!==BigInt(0)&&b.uint32(48).int64(c.gasUsed);for(const q of c.events)e.Event.encode(q,b.uint32(58).fork()).ldelim();return c.codespace!==""&&b.uint32(66).string(c.codespace),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=xs();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.code=q.uint32();break;case 2:F.data=q.bytes();break;case 3:F.log=q.string();break;case 4:F.info=q.string();break;case 5:F.gasWanted=q.int64();break;case 6:F.gasUsed=q.int64();break;case 7:F.events.push(e.Event.decode(q,q.uint32()));break;case 8:F.codespace=q.string();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=xs();return(0,C.isSet)(c.code)&&(b.code=Number(c.code)),(0,C.isSet)(c.data)&&(b.data=(0,C.bytesFromBase64)(c.data)),(0,C.isSet)(c.log)&&(b.log=String(c.log)),(0,C.isSet)(c.info)&&(b.info=String(c.info)),(0,C.isSet)(c.gas_wanted)&&(b.gasWanted=BigInt(c.gas_wanted.toString())),(0,C.isSet)(c.gas_used)&&(b.gasUsed=BigInt(c.gas_used.toString())),Array.isArray(c==null?void 0:c.events)&&(b.events=c.events.map(q=>e.Event.fromJSON(q))),(0,C.isSet)(c.codespace)&&(b.codespace=String(c.codespace)),b},toJSON(c){const b={};return c.code!==void 0&&(b.code=Math.round(c.code)),c.data!==void 0&&(b.data=(0,C.base64FromBytes)(c.data!==void 0?c.data:new Uint8Array)),c.log!==void 0&&(b.log=c.log),c.info!==void 0&&(b.info=c.info),c.gasWanted!==void 0&&(b.gas_wanted=(c.gasWanted||BigInt(0)).toString()),c.gasUsed!==void 0&&(b.gas_used=(c.gasUsed||BigInt(0)).toString()),c.events?b.events=c.events.map(q=>q?e.Event.toJSON(q):void 0):b.events=[],c.codespace!==void 0&&(b.codespace=c.codespace),b},fromPartial(c){var q;const b=xs();return b.code=c.code??0,b.data=c.data??new Uint8Array,b.log=c.log??"",b.info=c.info??"",c.gasWanted!==void 0&&c.gasWanted!==null&&(b.gasWanted=BigInt(c.gasWanted.toString())),c.gasUsed!==void 0&&c.gasUsed!==null&&(b.gasUsed=BigInt(c.gasUsed.toString())),b.events=((q=c.events)==null?void 0:q.map($=>e.Event.fromPartial($)))||[],b.codespace=c.codespace??"",b}};function js(){return{validatorUpdates:[],consensusParamUpdates:void 0,events:[]}}e.ResponseEndBlock={typeUrl:"/tendermint.abci.ResponseEndBlock",encode(c,b=v.BinaryWriter.create()){for(const q of c.validatorUpdates)e.ValidatorUpdate.encode(q,b.uint32(10).fork()).ldelim();c.consensusParamUpdates!==void 0&&t.ConsensusParams.encode(c.consensusParamUpdates,b.uint32(18).fork()).ldelim();for(const q of c.events)e.Event.encode(q,b.uint32(26).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=js();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.validatorUpdates.push(e.ValidatorUpdate.decode(q,q.uint32()));break;case 2:F.consensusParamUpdates=t.ConsensusParams.decode(q,q.uint32());break;case 3:F.events.push(e.Event.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=js();return Array.isArray(c==null?void 0:c.validatorUpdates)&&(b.validatorUpdates=c.validatorUpdates.map(q=>e.ValidatorUpdate.fromJSON(q))),(0,C.isSet)(c.consensusParamUpdates)&&(b.consensusParamUpdates=t.ConsensusParams.fromJSON(c.consensusParamUpdates)),Array.isArray(c==null?void 0:c.events)&&(b.events=c.events.map(q=>e.Event.fromJSON(q))),b},toJSON(c){const b={};return c.validatorUpdates?b.validatorUpdates=c.validatorUpdates.map(q=>q?e.ValidatorUpdate.toJSON(q):void 0):b.validatorUpdates=[],c.consensusParamUpdates!==void 0&&(b.consensusParamUpdates=c.consensusParamUpdates?t.ConsensusParams.toJSON(c.consensusParamUpdates):void 0),c.events?b.events=c.events.map(q=>q?e.Event.toJSON(q):void 0):b.events=[],b},fromPartial(c){var q,$;const b=js();return b.validatorUpdates=((q=c.validatorUpdates)==null?void 0:q.map(F=>e.ValidatorUpdate.fromPartial(F)))||[],c.consensusParamUpdates!==void 0&&c.consensusParamUpdates!==null&&(b.consensusParamUpdates=t.ConsensusParams.fromPartial(c.consensusParamUpdates)),b.events=(($=c.events)==null?void 0:$.map(F=>e.Event.fromPartial(F)))||[],b}};function ed(){return{data:new Uint8Array,retainHeight:BigInt(0)}}e.ResponseCommit={typeUrl:"/tendermint.abci.ResponseCommit",encode(c,b=v.BinaryWriter.create()){return c.data.length!==0&&b.uint32(18).bytes(c.data),c.retainHeight!==BigInt(0)&&b.uint32(24).int64(c.retainHeight),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=ed();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 2:F.data=q.bytes();break;case 3:F.retainHeight=q.int64();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=ed();return(0,C.isSet)(c.data)&&(b.data=(0,C.bytesFromBase64)(c.data)),(0,C.isSet)(c.retainHeight)&&(b.retainHeight=BigInt(c.retainHeight.toString())),b},toJSON(c){const b={};return c.data!==void 0&&(b.data=(0,C.base64FromBytes)(c.data!==void 0?c.data:new Uint8Array)),c.retainHeight!==void 0&&(b.retainHeight=(c.retainHeight||BigInt(0)).toString()),b},fromPartial(c){const b=ed();return b.data=c.data??new Uint8Array,c.retainHeight!==void 0&&c.retainHeight!==null&&(b.retainHeight=BigInt(c.retainHeight.toString())),b}};function nd(){return{snapshots:[]}}e.ResponseListSnapshots={typeUrl:"/tendermint.abci.ResponseListSnapshots",encode(c,b=v.BinaryWriter.create()){for(const q of c.snapshots)e.Snapshot.encode(q,b.uint32(10).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=nd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.snapshots.push(e.Snapshot.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=nd();return Array.isArray(c==null?void 0:c.snapshots)&&(b.snapshots=c.snapshots.map(q=>e.Snapshot.fromJSON(q))),b},toJSON(c){const b={};return c.snapshots?b.snapshots=c.snapshots.map(q=>q?e.Snapshot.toJSON(q):void 0):b.snapshots=[],b},fromPartial(c){var q;const b=nd();return b.snapshots=((q=c.snapshots)==null?void 0:q.map($=>e.Snapshot.fromPartial($)))||[],b}};function td(){return{result:0}}e.ResponseOfferSnapshot={typeUrl:"/tendermint.abci.ResponseOfferSnapshot",encode(c,b=v.BinaryWriter.create()){return c.result!==0&&b.uint32(8).int32(c.result),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=td();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.result=q.int32();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=td();return(0,C.isSet)(c.result)&&(b.result=g(c.result)),b},toJSON(c){const b={};return c.result!==void 0&&(b.result=R(c.result)),b},fromPartial(c){const b=td();return b.result=c.result??0,b}};function rd(){return{chunk:new Uint8Array}}e.ResponseLoadSnapshotChunk={typeUrl:"/tendermint.abci.ResponseLoadSnapshotChunk",encode(c,b=v.BinaryWriter.create()){return c.chunk.length!==0&&b.uint32(10).bytes(c.chunk),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=rd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.chunk=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=rd();return(0,C.isSet)(c.chunk)&&(b.chunk=(0,C.bytesFromBase64)(c.chunk)),b},toJSON(c){const b={};return c.chunk!==void 0&&(b.chunk=(0,C.base64FromBytes)(c.chunk!==void 0?c.chunk:new Uint8Array)),b},fromPartial(c){const b=rd();return b.chunk=c.chunk??new Uint8Array,b}};function id(){return{result:0,refetchChunks:[],rejectSenders:[]}}e.ResponseApplySnapshotChunk={typeUrl:"/tendermint.abci.ResponseApplySnapshotChunk",encode(c,b=v.BinaryWriter.create()){c.result!==0&&b.uint32(8).int32(c.result),b.uint32(18).fork();for(const q of c.refetchChunks)b.uint32(q);b.ldelim();for(const q of c.rejectSenders)b.uint32(26).string(q);return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=id();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.result=q.int32();break;case 2:if((K&7)===2){const yh=q.uint32()+q.pos;for(;q.pos<yh;)F.refetchChunks.push(q.uint32())}else F.refetchChunks.push(q.uint32());break;case 3:F.rejectSenders.push(q.string());break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=id();return(0,C.isSet)(c.result)&&(b.result=d(c.result)),Array.isArray(c==null?void 0:c.refetchChunks)&&(b.refetchChunks=c.refetchChunks.map(q=>Number(q))),Array.isArray(c==null?void 0:c.rejectSenders)&&(b.rejectSenders=c.rejectSenders.map(q=>String(q))),b},toJSON(c){const b={};return c.result!==void 0&&(b.result=s(c.result)),c.refetchChunks?b.refetchChunks=c.refetchChunks.map(q=>Math.round(q)):b.refetchChunks=[],c.rejectSenders?b.rejectSenders=c.rejectSenders.map(q=>q):b.rejectSenders=[],b},fromPartial(c){var q,$;const b=id();return b.result=c.result??0,b.refetchChunks=((q=c.refetchChunks)==null?void 0:q.map(F=>F))||[],b.rejectSenders=(($=c.rejectSenders)==null?void 0:$.map(F=>F))||[],b}};function od(){return{txs:[]}}e.ResponsePrepareProposal={typeUrl:"/tendermint.abci.ResponsePrepareProposal",encode(c,b=v.BinaryWriter.create()){for(const q of c.txs)b.uint32(10).bytes(q);return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=od();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.txs.push(q.bytes());break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=od();return Array.isArray(c==null?void 0:c.txs)&&(b.txs=c.txs.map(q=>(0,C.bytesFromBase64)(q))),b},toJSON(c){const b={};return c.txs?b.txs=c.txs.map(q=>(0,C.base64FromBytes)(q!==void 0?q:new Uint8Array)):b.txs=[],b},fromPartial(c){var q;const b=od();return b.txs=((q=c.txs)==null?void 0:q.map($=>$))||[],b}};function ad(){return{status:0}}e.ResponseProcessProposal={typeUrl:"/tendermint.abci.ResponseProcessProposal",encode(c,b=v.BinaryWriter.create()){return c.status!==0&&b.uint32(8).int32(c.status),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=ad();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.status=q.int32();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=ad();return(0,C.isSet)(c.status)&&(b.status=E(c.status)),b},toJSON(c){const b={};return c.status!==void 0&&(b.status=_(c.status)),b},fromPartial(c){const b=ad();return b.status=c.status??0,b}};function sd(){return{round:0,votes:[]}}e.CommitInfo={typeUrl:"/tendermint.abci.CommitInfo",encode(c,b=v.BinaryWriter.create()){c.round!==0&&b.uint32(8).int32(c.round);for(const q of c.votes)e.VoteInfo.encode(q,b.uint32(18).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=sd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.round=q.int32();break;case 2:F.votes.push(e.VoteInfo.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=sd();return(0,C.isSet)(c.round)&&(b.round=Number(c.round)),Array.isArray(c==null?void 0:c.votes)&&(b.votes=c.votes.map(q=>e.VoteInfo.fromJSON(q))),b},toJSON(c){const b={};return c.round!==void 0&&(b.round=Math.round(c.round)),c.votes?b.votes=c.votes.map(q=>q?e.VoteInfo.toJSON(q):void 0):b.votes=[],b},fromPartial(c){var q;const b=sd();return b.round=c.round??0,b.votes=((q=c.votes)==null?void 0:q.map($=>e.VoteInfo.fromPartial($)))||[],b}};function dd(){return{round:0,votes:[]}}e.ExtendedCommitInfo={typeUrl:"/tendermint.abci.ExtendedCommitInfo",encode(c,b=v.BinaryWriter.create()){c.round!==0&&b.uint32(8).int32(c.round);for(const q of c.votes)e.ExtendedVoteInfo.encode(q,b.uint32(18).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=dd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.round=q.int32();break;case 2:F.votes.push(e.ExtendedVoteInfo.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=dd();return(0,C.isSet)(c.round)&&(b.round=Number(c.round)),Array.isArray(c==null?void 0:c.votes)&&(b.votes=c.votes.map(q=>e.ExtendedVoteInfo.fromJSON(q))),b},toJSON(c){const b={};return c.round!==void 0&&(b.round=Math.round(c.round)),c.votes?b.votes=c.votes.map(q=>q?e.ExtendedVoteInfo.toJSON(q):void 0):b.votes=[],b},fromPartial(c){var q;const b=dd();return b.round=c.round??0,b.votes=((q=c.votes)==null?void 0:q.map($=>e.ExtendedVoteInfo.fromPartial($)))||[],b}};function ud(){return{type:"",attributes:[]}}e.Event={typeUrl:"/tendermint.abci.Event",encode(c,b=v.BinaryWriter.create()){c.type!==""&&b.uint32(10).string(c.type);for(const q of c.attributes)e.EventAttribute.encode(q,b.uint32(18).fork()).ldelim();return b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=ud();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.type=q.string();break;case 2:F.attributes.push(e.EventAttribute.decode(q,q.uint32()));break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=ud();return(0,C.isSet)(c.type)&&(b.type=String(c.type)),Array.isArray(c==null?void 0:c.attributes)&&(b.attributes=c.attributes.map(q=>e.EventAttribute.fromJSON(q))),b},toJSON(c){const b={};return c.type!==void 0&&(b.type=c.type),c.attributes?b.attributes=c.attributes.map(q=>q?e.EventAttribute.toJSON(q):void 0):b.attributes=[],b},fromPartial(c){var q;const b=ud();return b.type=c.type??"",b.attributes=((q=c.attributes)==null?void 0:q.map($=>e.EventAttribute.fromPartial($)))||[],b}};function cd(){return{key:"",value:"",index:!1}}e.EventAttribute={typeUrl:"/tendermint.abci.EventAttribute",encode(c,b=v.BinaryWriter.create()){return c.key!==""&&b.uint32(10).string(c.key),c.value!==""&&b.uint32(18).string(c.value),c.index===!0&&b.uint32(24).bool(c.index),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=cd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.key=q.string();break;case 2:F.value=q.string();break;case 3:F.index=q.bool();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=cd();return(0,C.isSet)(c.key)&&(b.key=String(c.key)),(0,C.isSet)(c.value)&&(b.value=String(c.value)),(0,C.isSet)(c.index)&&(b.index=!!c.index),b},toJSON(c){const b={};return c.key!==void 0&&(b.key=c.key),c.value!==void 0&&(b.value=c.value),c.index!==void 0&&(b.index=c.index),b},fromPartial(c){const b=cd();return b.key=c.key??"",b.value=c.value??"",b.index=c.index??!1,b}};function ld(){return{height:BigInt(0),index:0,tx:new Uint8Array,result:e.ResponseDeliverTx.fromPartial({})}}e.TxResult={typeUrl:"/tendermint.abci.TxResult",encode(c,b=v.BinaryWriter.create()){return c.height!==BigInt(0)&&b.uint32(8).int64(c.height),c.index!==0&&b.uint32(16).uint32(c.index),c.tx.length!==0&&b.uint32(26).bytes(c.tx),c.result!==void 0&&e.ResponseDeliverTx.encode(c.result,b.uint32(34).fork()).ldelim(),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=ld();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.height=q.int64();break;case 2:F.index=q.uint32();break;case 3:F.tx=q.bytes();break;case 4:F.result=e.ResponseDeliverTx.decode(q,q.uint32());break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=ld();return(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.index)&&(b.index=Number(c.index)),(0,C.isSet)(c.tx)&&(b.tx=(0,C.bytesFromBase64)(c.tx)),(0,C.isSet)(c.result)&&(b.result=e.ResponseDeliverTx.fromJSON(c.result)),b},toJSON(c){const b={};return c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.index!==void 0&&(b.index=Math.round(c.index)),c.tx!==void 0&&(b.tx=(0,C.base64FromBytes)(c.tx!==void 0?c.tx:new Uint8Array)),c.result!==void 0&&(b.result=c.result?e.ResponseDeliverTx.toJSON(c.result):void 0),b},fromPartial(c){const b=ld();return c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),b.index=c.index??0,b.tx=c.tx??new Uint8Array,c.result!==void 0&&c.result!==null&&(b.result=e.ResponseDeliverTx.fromPartial(c.result)),b}};function fd(){return{address:new Uint8Array,power:BigInt(0)}}e.Validator={typeUrl:"/tendermint.abci.Validator",encode(c,b=v.BinaryWriter.create()){return c.address.length!==0&&b.uint32(10).bytes(c.address),c.power!==BigInt(0)&&b.uint32(24).int64(c.power),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=fd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.address=q.bytes();break;case 3:F.power=q.int64();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=fd();return(0,C.isSet)(c.address)&&(b.address=(0,C.bytesFromBase64)(c.address)),(0,C.isSet)(c.power)&&(b.power=BigInt(c.power.toString())),b},toJSON(c){const b={};return c.address!==void 0&&(b.address=(0,C.base64FromBytes)(c.address!==void 0?c.address:new Uint8Array)),c.power!==void 0&&(b.power=(c.power||BigInt(0)).toString()),b},fromPartial(c){const b=fd();return b.address=c.address??new Uint8Array,c.power!==void 0&&c.power!==null&&(b.power=BigInt(c.power.toString())),b}};function pd(){return{pubKey:h.PublicKey.fromPartial({}),power:BigInt(0)}}e.ValidatorUpdate={typeUrl:"/tendermint.abci.ValidatorUpdate",encode(c,b=v.BinaryWriter.create()){return c.pubKey!==void 0&&h.PublicKey.encode(c.pubKey,b.uint32(10).fork()).ldelim(),c.power!==BigInt(0)&&b.uint32(16).int64(c.power),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=pd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.pubKey=h.PublicKey.decode(q,q.uint32());break;case 2:F.power=q.int64();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=pd();return(0,C.isSet)(c.pubKey)&&(b.pubKey=h.PublicKey.fromJSON(c.pubKey)),(0,C.isSet)(c.power)&&(b.power=BigInt(c.power.toString())),b},toJSON(c){const b={};return c.pubKey!==void 0&&(b.pubKey=c.pubKey?h.PublicKey.toJSON(c.pubKey):void 0),c.power!==void 0&&(b.power=(c.power||BigInt(0)).toString()),b},fromPartial(c){const b=pd();return c.pubKey!==void 0&&c.pubKey!==null&&(b.pubKey=h.PublicKey.fromPartial(c.pubKey)),c.power!==void 0&&c.power!==null&&(b.power=BigInt(c.power.toString())),b}};function md(){return{validator:e.Validator.fromPartial({}),signedLastBlock:!1}}e.VoteInfo={typeUrl:"/tendermint.abci.VoteInfo",encode(c,b=v.BinaryWriter.create()){return c.validator!==void 0&&e.Validator.encode(c.validator,b.uint32(10).fork()).ldelim(),c.signedLastBlock===!0&&b.uint32(16).bool(c.signedLastBlock),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=md();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.validator=e.Validator.decode(q,q.uint32());break;case 2:F.signedLastBlock=q.bool();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=md();return(0,C.isSet)(c.validator)&&(b.validator=e.Validator.fromJSON(c.validator)),(0,C.isSet)(c.signedLastBlock)&&(b.signedLastBlock=!!c.signedLastBlock),b},toJSON(c){const b={};return c.validator!==void 0&&(b.validator=c.validator?e.Validator.toJSON(c.validator):void 0),c.signedLastBlock!==void 0&&(b.signedLastBlock=c.signedLastBlock),b},fromPartial(c){const b=md();return c.validator!==void 0&&c.validator!==null&&(b.validator=e.Validator.fromPartial(c.validator)),b.signedLastBlock=c.signedLastBlock??!1,b}};function yd(){return{validator:e.Validator.fromPartial({}),signedLastBlock:!1,voteExtension:new Uint8Array}}e.ExtendedVoteInfo={typeUrl:"/tendermint.abci.ExtendedVoteInfo",encode(c,b=v.BinaryWriter.create()){return c.validator!==void 0&&e.Validator.encode(c.validator,b.uint32(10).fork()).ldelim(),c.signedLastBlock===!0&&b.uint32(16).bool(c.signedLastBlock),c.voteExtension.length!==0&&b.uint32(26).bytes(c.voteExtension),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=yd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.validator=e.Validator.decode(q,q.uint32());break;case 2:F.signedLastBlock=q.bool();break;case 3:F.voteExtension=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=yd();return(0,C.isSet)(c.validator)&&(b.validator=e.Validator.fromJSON(c.validator)),(0,C.isSet)(c.signedLastBlock)&&(b.signedLastBlock=!!c.signedLastBlock),(0,C.isSet)(c.voteExtension)&&(b.voteExtension=(0,C.bytesFromBase64)(c.voteExtension)),b},toJSON(c){const b={};return c.validator!==void 0&&(b.validator=c.validator?e.Validator.toJSON(c.validator):void 0),c.signedLastBlock!==void 0&&(b.signedLastBlock=c.signedLastBlock),c.voteExtension!==void 0&&(b.voteExtension=(0,C.base64FromBytes)(c.voteExtension!==void 0?c.voteExtension:new Uint8Array)),b},fromPartial(c){const b=yd();return c.validator!==void 0&&c.validator!==null&&(b.validator=e.Validator.fromPartial(c.validator)),b.signedLastBlock=c.signedLastBlock??!1,b.voteExtension=c.voteExtension??new Uint8Array,b}};function hd(){return{type:0,validator:e.Validator.fromPartial({}),height:BigInt(0),time:n.Timestamp.fromPartial({}),totalVotingPower:BigInt(0)}}e.Misbehavior={typeUrl:"/tendermint.abci.Misbehavior",encode(c,b=v.BinaryWriter.create()){return c.type!==0&&b.uint32(8).int32(c.type),c.validator!==void 0&&e.Validator.encode(c.validator,b.uint32(18).fork()).ldelim(),c.height!==BigInt(0)&&b.uint32(24).int64(c.height),c.time!==void 0&&n.Timestamp.encode(c.time,b.uint32(34).fork()).ldelim(),c.totalVotingPower!==BigInt(0)&&b.uint32(40).int64(c.totalVotingPower),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=hd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.type=q.int32();break;case 2:F.validator=e.Validator.decode(q,q.uint32());break;case 3:F.height=q.int64();break;case 4:F.time=n.Timestamp.decode(q,q.uint32());break;case 5:F.totalVotingPower=q.int64();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=hd();return(0,C.isSet)(c.type)&&(b.type=H(c.type)),(0,C.isSet)(c.validator)&&(b.validator=e.Validator.fromJSON(c.validator)),(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.time)&&(b.time=(0,C.fromJsonTimestamp)(c.time)),(0,C.isSet)(c.totalVotingPower)&&(b.totalVotingPower=BigInt(c.totalVotingPower.toString())),b},toJSON(c){const b={};return c.type!==void 0&&(b.type=i(c.type)),c.validator!==void 0&&(b.validator=c.validator?e.Validator.toJSON(c.validator):void 0),c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.time!==void 0&&(b.time=(0,C.fromTimestamp)(c.time).toISOString()),c.totalVotingPower!==void 0&&(b.totalVotingPower=(c.totalVotingPower||BigInt(0)).toString()),b},fromPartial(c){const b=hd();return b.type=c.type??0,c.validator!==void 0&&c.validator!==null&&(b.validator=e.Validator.fromPartial(c.validator)),c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),c.time!==void 0&&c.time!==null&&(b.time=n.Timestamp.fromPartial(c.time)),c.totalVotingPower!==void 0&&c.totalVotingPower!==null&&(b.totalVotingPower=BigInt(c.totalVotingPower.toString())),b}};function gd(){return{height:BigInt(0),format:0,chunks:0,hash:new Uint8Array,metadata:new Uint8Array}}e.Snapshot={typeUrl:"/tendermint.abci.Snapshot",encode(c,b=v.BinaryWriter.create()){return c.height!==BigInt(0)&&b.uint32(8).uint64(c.height),c.format!==0&&b.uint32(16).uint32(c.format),c.chunks!==0&&b.uint32(24).uint32(c.chunks),c.hash.length!==0&&b.uint32(34).bytes(c.hash),c.metadata.length!==0&&b.uint32(42).bytes(c.metadata),b},decode(c,b){const q=c instanceof v.BinaryReader?c:new v.BinaryReader(c);let $=b===void 0?q.len:q.pos+b;const F=gd();for(;q.pos<$;){const K=q.uint32();switch(K>>>3){case 1:F.height=q.uint64();break;case 2:F.format=q.uint32();break;case 3:F.chunks=q.uint32();break;case 4:F.hash=q.bytes();break;case 5:F.metadata=q.bytes();break;default:q.skipType(K&7);break}}return F},fromJSON(c){const b=gd();return(0,C.isSet)(c.height)&&(b.height=BigInt(c.height.toString())),(0,C.isSet)(c.format)&&(b.format=Number(c.format)),(0,C.isSet)(c.chunks)&&(b.chunks=Number(c.chunks)),(0,C.isSet)(c.hash)&&(b.hash=(0,C.bytesFromBase64)(c.hash)),(0,C.isSet)(c.metadata)&&(b.metadata=(0,C.bytesFromBase64)(c.metadata)),b},toJSON(c){const b={};return c.height!==void 0&&(b.height=(c.height||BigInt(0)).toString()),c.format!==void 0&&(b.format=Math.round(c.format)),c.chunks!==void 0&&(b.chunks=Math.round(c.chunks)),c.hash!==void 0&&(b.hash=(0,C.base64FromBytes)(c.hash!==void 0?c.hash:new Uint8Array)),c.metadata!==void 0&&(b.metadata=(0,C.base64FromBytes)(c.metadata!==void 0?c.metadata:new Uint8Array)),b},fromPartial(c){const b=gd();return c.height!==void 0&&c.height!==null&&(b.height=BigInt(c.height.toString())),b.format=c.format??0,b.chunks=c.chunks??0,b.hash=c.hash??new Uint8Array,b.metadata=c.metadata??new Uint8Array,b}};class mh{constructor(b){this.rpc=b,this.Echo=this.Echo.bind(this),this.Flush=this.Flush.bind(this),this.Info=this.Info.bind(this),this.DeliverTx=this.DeliverTx.bind(this),this.CheckTx=this.CheckTx.bind(this),this.Query=this.Query.bind(this),this.Commit=this.Commit.bind(this),this.InitChain=this.InitChain.bind(this),this.BeginBlock=this.BeginBlock.bind(this),this.EndBlock=this.EndBlock.bind(this),this.ListSnapshots=this.ListSnapshots.bind(this),this.OfferSnapshot=this.OfferSnapshot.bind(this),this.LoadSnapshotChunk=this.LoadSnapshotChunk.bind(this),this.ApplySnapshotChunk=this.ApplySnapshotChunk.bind(this),this.PrepareProposal=this.PrepareProposal.bind(this),this.ProcessProposal=this.ProcessProposal.bind(this)}Echo(b){const q=e.RequestEcho.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Echo",q).then(F=>e.ResponseEcho.decode(new v.BinaryReader(F)))}Flush(b={}){const q=e.RequestFlush.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Flush",q).then(F=>e.ResponseFlush.decode(new v.BinaryReader(F)))}Info(b){const q=e.RequestInfo.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Info",q).then(F=>e.ResponseInfo.decode(new v.BinaryReader(F)))}DeliverTx(b){const q=e.RequestDeliverTx.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","DeliverTx",q).then(F=>e.ResponseDeliverTx.decode(new v.BinaryReader(F)))}CheckTx(b){const q=e.RequestCheckTx.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","CheckTx",q).then(F=>e.ResponseCheckTx.decode(new v.BinaryReader(F)))}Query(b){const q=e.RequestQuery.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Query",q).then(F=>e.ResponseQuery.decode(new v.BinaryReader(F)))}Commit(b={}){const q=e.RequestCommit.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","Commit",q).then(F=>e.ResponseCommit.decode(new v.BinaryReader(F)))}InitChain(b){const q=e.RequestInitChain.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","InitChain",q).then(F=>e.ResponseInitChain.decode(new v.BinaryReader(F)))}BeginBlock(b){const q=e.RequestBeginBlock.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","BeginBlock",q).then(F=>e.ResponseBeginBlock.decode(new v.BinaryReader(F)))}EndBlock(b){const q=e.RequestEndBlock.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","EndBlock",q).then(F=>e.ResponseEndBlock.decode(new v.BinaryReader(F)))}ListSnapshots(b={}){const q=e.RequestListSnapshots.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","ListSnapshots",q).then(F=>e.ResponseListSnapshots.decode(new v.BinaryReader(F)))}OfferSnapshot(b){const q=e.RequestOfferSnapshot.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","OfferSnapshot",q).then(F=>e.ResponseOfferSnapshot.decode(new v.BinaryReader(F)))}LoadSnapshotChunk(b){const q=e.RequestLoadSnapshotChunk.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","LoadSnapshotChunk",q).then(F=>e.ResponseLoadSnapshotChunk.decode(new v.BinaryReader(F)))}ApplySnapshotChunk(b){const q=e.RequestApplySnapshotChunk.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","ApplySnapshotChunk",q).then(F=>e.ResponseApplySnapshotChunk.decode(new v.BinaryReader(F)))}PrepareProposal(b){const q=e.RequestPrepareProposal.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","PrepareProposal",q).then(F=>e.ResponsePrepareProposal.decode(new v.BinaryReader(F)))}ProcessProposal(b){const q=e.RequestProcessProposal.encode(b).finish();return this.rpc.request("tendermint.abci.ABCIApplication","ProcessProposal",q).then(F=>e.ResponseProcessProposal.decode(new v.BinaryReader(F)))}}e.ABCIApplicationClientImpl=mh})(Dc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValidatorUpdates=e.Pool=e.RedelegationResponse=e.RedelegationEntryResponse=e.DelegationResponse=e.Params=e.Redelegation=e.RedelegationEntry=e.UnbondingDelegationEntry=e.UnbondingDelegation=e.Delegation=e.DVVTriplets=e.DVVTriplet=e.DVPairs=e.DVPair=e.ValAddresses=e.Validator=e.Description=e.Commission=e.CommissionRates=e.HistoricalInfo=e.infractionToJSON=e.infractionFromJSON=e.Infraction=e.bondStatusToJSON=e.bondStatusFromJSON=e.BondStatus=e.protobufPackage=void 0;const n=dr,t=Mn,r=Re,o=hn,h=Me,v=Dc,C=ee,w=ne;e.protobufPackage="cosmos.staking.v1beta1";var D;(function(S){S[S.BOND_STATUS_UNSPECIFIED=0]="BOND_STATUS_UNSPECIFIED",S[S.BOND_STATUS_UNBONDED=1]="BOND_STATUS_UNBONDED",S[S.BOND_STATUS_UNBONDING=2]="BOND_STATUS_UNBONDING",S[S.BOND_STATUS_BONDED=3]="BOND_STATUS_BONDED",S[S.UNRECOGNIZED=-1]="UNRECOGNIZED"})(D||(e.BondStatus=D={}));function J(S){switch(S){case 0:case"BOND_STATUS_UNSPECIFIED":return D.BOND_STATUS_UNSPECIFIED;case 1:case"BOND_STATUS_UNBONDED":return D.BOND_STATUS_UNBONDED;case 2:case"BOND_STATUS_UNBONDING":return D.BOND_STATUS_UNBONDING;case 3:case"BOND_STATUS_BONDED":return D.BOND_STATUS_BONDED;case-1:case"UNRECOGNIZED":default:return D.UNRECOGNIZED}}e.bondStatusFromJSON=J;function I(S){switch(S){case D.BOND_STATUS_UNSPECIFIED:return"BOND_STATUS_UNSPECIFIED";case D.BOND_STATUS_UNBONDED:return"BOND_STATUS_UNBONDED";case D.BOND_STATUS_UNBONDING:return"BOND_STATUS_UNBONDING";case D.BOND_STATUS_BONDED:return"BOND_STATUS_BONDED";case D.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.bondStatusToJSON=I;var g;(function(S){S[S.INFRACTION_UNSPECIFIED=0]="INFRACTION_UNSPECIFIED",S[S.INFRACTION_DOUBLE_SIGN=1]="INFRACTION_DOUBLE_SIGN",S[S.INFRACTION_DOWNTIME=2]="INFRACTION_DOWNTIME",S[S.UNRECOGNIZED=-1]="UNRECOGNIZED"})(g||(e.Infraction=g={}));function R(S){switch(S){case 0:case"INFRACTION_UNSPECIFIED":return g.INFRACTION_UNSPECIFIED;case 1:case"INFRACTION_DOUBLE_SIGN":return g.INFRACTION_DOUBLE_SIGN;case 2:case"INFRACTION_DOWNTIME":return g.INFRACTION_DOWNTIME;case-1:case"UNRECOGNIZED":default:return g.UNRECOGNIZED}}e.infractionFromJSON=R;function B(S){switch(S){case g.INFRACTION_UNSPECIFIED:return"INFRACTION_UNSPECIFIED";case g.INFRACTION_DOUBLE_SIGN:return"INFRACTION_DOUBLE_SIGN";case g.INFRACTION_DOWNTIME:return"INFRACTION_DOWNTIME";case g.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.infractionToJSON=B;function d(){return{header:n.Header.fromPartial({}),valset:[]}}e.HistoricalInfo={typeUrl:"/cosmos.staking.v1beta1.HistoricalInfo",encode(S,P=C.BinaryWriter.create()){S.header!==void 0&&n.Header.encode(S.header,P.uint32(10).fork()).ldelim();for(const O of S.valset)e.Validator.encode(O,P.uint32(18).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=d();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.header=n.Header.decode(O,O.uint32());break;case 2:L.valset.push(e.Validator.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=d();return(0,w.isSet)(S.header)&&(P.header=n.Header.fromJSON(S.header)),Array.isArray(S==null?void 0:S.valset)&&(P.valset=S.valset.map(O=>e.Validator.fromJSON(O))),P},toJSON(S){const P={};return S.header!==void 0&&(P.header=S.header?n.Header.toJSON(S.header):void 0),S.valset?P.valset=S.valset.map(O=>O?e.Validator.toJSON(O):void 0):P.valset=[],P},fromPartial(S){var O;const P=d();return S.header!==void 0&&S.header!==null&&(P.header=n.Header.fromPartial(S.header)),P.valset=((O=S.valset)==null?void 0:O.map(W=>e.Validator.fromPartial(W)))||[],P}};function s(){return{rate:"",maxRate:"",maxChangeRate:""}}e.CommissionRates={typeUrl:"/cosmos.staking.v1beta1.CommissionRates",encode(S,P=C.BinaryWriter.create()){return S.rate!==""&&P.uint32(10).string(S.rate),S.maxRate!==""&&P.uint32(18).string(S.maxRate),S.maxChangeRate!==""&&P.uint32(26).string(S.maxChangeRate),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=s();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.rate=O.string();break;case 2:L.maxRate=O.string();break;case 3:L.maxChangeRate=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=s();return(0,w.isSet)(S.rate)&&(P.rate=String(S.rate)),(0,w.isSet)(S.maxRate)&&(P.maxRate=String(S.maxRate)),(0,w.isSet)(S.maxChangeRate)&&(P.maxChangeRate=String(S.maxChangeRate)),P},toJSON(S){const P={};return S.rate!==void 0&&(P.rate=S.rate),S.maxRate!==void 0&&(P.maxRate=S.maxRate),S.maxChangeRate!==void 0&&(P.maxChangeRate=S.maxChangeRate),P},fromPartial(S){const P=s();return P.rate=S.rate??"",P.maxRate=S.maxRate??"",P.maxChangeRate=S.maxChangeRate??"",P}};function y(){return{commissionRates:e.CommissionRates.fromPartial({}),updateTime:t.Timestamp.fromPartial({})}}e.Commission={typeUrl:"/cosmos.staking.v1beta1.Commission",encode(S,P=C.BinaryWriter.create()){return S.commissionRates!==void 0&&e.CommissionRates.encode(S.commissionRates,P.uint32(10).fork()).ldelim(),S.updateTime!==void 0&&t.Timestamp.encode(S.updateTime,P.uint32(18).fork()).ldelim(),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=y();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.commissionRates=e.CommissionRates.decode(O,O.uint32());break;case 2:L.updateTime=t.Timestamp.decode(O,O.uint32());break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=y();return(0,w.isSet)(S.commissionRates)&&(P.commissionRates=e.CommissionRates.fromJSON(S.commissionRates)),(0,w.isSet)(S.updateTime)&&(P.updateTime=(0,w.fromJsonTimestamp)(S.updateTime)),P},toJSON(S){const P={};return S.commissionRates!==void 0&&(P.commissionRates=S.commissionRates?e.CommissionRates.toJSON(S.commissionRates):void 0),S.updateTime!==void 0&&(P.updateTime=(0,w.fromTimestamp)(S.updateTime).toISOString()),P},fromPartial(S){const P=y();return S.commissionRates!==void 0&&S.commissionRates!==null&&(P.commissionRates=e.CommissionRates.fromPartial(S.commissionRates)),S.updateTime!==void 0&&S.updateTime!==null&&(P.updateTime=t.Timestamp.fromPartial(S.updateTime)),P}};function E(){return{moniker:"",identity:"",website:"",securityContact:"",details:""}}e.Description={typeUrl:"/cosmos.staking.v1beta1.Description",encode(S,P=C.BinaryWriter.create()){return S.moniker!==""&&P.uint32(10).string(S.moniker),S.identity!==""&&P.uint32(18).string(S.identity),S.website!==""&&P.uint32(26).string(S.website),S.securityContact!==""&&P.uint32(34).string(S.securityContact),S.details!==""&&P.uint32(42).string(S.details),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=E();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.moniker=O.string();break;case 2:L.identity=O.string();break;case 3:L.website=O.string();break;case 4:L.securityContact=O.string();break;case 5:L.details=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=E();return(0,w.isSet)(S.moniker)&&(P.moniker=String(S.moniker)),(0,w.isSet)(S.identity)&&(P.identity=String(S.identity)),(0,w.isSet)(S.website)&&(P.website=String(S.website)),(0,w.isSet)(S.securityContact)&&(P.securityContact=String(S.securityContact)),(0,w.isSet)(S.details)&&(P.details=String(S.details)),P},toJSON(S){const P={};return S.moniker!==void 0&&(P.moniker=S.moniker),S.identity!==void 0&&(P.identity=S.identity),S.website!==void 0&&(P.website=S.website),S.securityContact!==void 0&&(P.securityContact=S.securityContact),S.details!==void 0&&(P.details=S.details),P},fromPartial(S){const P=E();return P.moniker=S.moniker??"",P.identity=S.identity??"",P.website=S.website??"",P.securityContact=S.securityContact??"",P.details=S.details??"",P}};function _(){return{operatorAddress:"",consensusPubkey:void 0,jailed:!1,status:0,tokens:"",delegatorShares:"",description:e.Description.fromPartial({}),unbondingHeight:BigInt(0),unbondingTime:t.Timestamp.fromPartial({}),commission:e.Commission.fromPartial({}),minSelfDelegation:"",unbondingOnHoldRefCount:BigInt(0),unbondingIds:[]}}e.Validator={typeUrl:"/cosmos.staking.v1beta1.Validator",encode(S,P=C.BinaryWriter.create()){S.operatorAddress!==""&&P.uint32(10).string(S.operatorAddress),S.consensusPubkey!==void 0&&r.Any.encode(S.consensusPubkey,P.uint32(18).fork()).ldelim(),S.jailed===!0&&P.uint32(24).bool(S.jailed),S.status!==0&&P.uint32(32).int32(S.status),S.tokens!==""&&P.uint32(42).string(S.tokens),S.delegatorShares!==""&&P.uint32(50).string(S.delegatorShares),S.description!==void 0&&e.Description.encode(S.description,P.uint32(58).fork()).ldelim(),S.unbondingHeight!==BigInt(0)&&P.uint32(64).int64(S.unbondingHeight),S.unbondingTime!==void 0&&t.Timestamp.encode(S.unbondingTime,P.uint32(74).fork()).ldelim(),S.commission!==void 0&&e.Commission.encode(S.commission,P.uint32(82).fork()).ldelim(),S.minSelfDelegation!==""&&P.uint32(90).string(S.minSelfDelegation),S.unbondingOnHoldRefCount!==BigInt(0)&&P.uint32(96).int64(S.unbondingOnHoldRefCount),P.uint32(106).fork();for(const O of S.unbondingIds)P.uint64(O);return P.ldelim(),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=_();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.operatorAddress=O.string();break;case 2:L.consensusPubkey=r.Any.decode(O,O.uint32());break;case 3:L.jailed=O.bool();break;case 4:L.status=O.int32();break;case 5:L.tokens=O.string();break;case 6:L.delegatorShares=O.string();break;case 7:L.description=e.Description.decode(O,O.uint32());break;case 8:L.unbondingHeight=O.int64();break;case 9:L.unbondingTime=t.Timestamp.decode(O,O.uint32());break;case 10:L.commission=e.Commission.decode(O,O.uint32());break;case 11:L.minSelfDelegation=O.string();break;case 12:L.unbondingOnHoldRefCount=O.int64();break;case 13:if((G&7)===2){const X=O.uint32()+O.pos;for(;O.pos<X;)L.unbondingIds.push(O.uint64())}else L.unbondingIds.push(O.uint64());break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=_();return(0,w.isSet)(S.operatorAddress)&&(P.operatorAddress=String(S.operatorAddress)),(0,w.isSet)(S.consensusPubkey)&&(P.consensusPubkey=r.Any.fromJSON(S.consensusPubkey)),(0,w.isSet)(S.jailed)&&(P.jailed=!!S.jailed),(0,w.isSet)(S.status)&&(P.status=J(S.status)),(0,w.isSet)(S.tokens)&&(P.tokens=String(S.tokens)),(0,w.isSet)(S.delegatorShares)&&(P.delegatorShares=String(S.delegatorShares)),(0,w.isSet)(S.description)&&(P.description=e.Description.fromJSON(S.description)),(0,w.isSet)(S.unbondingHeight)&&(P.unbondingHeight=BigInt(S.unbondingHeight.toString())),(0,w.isSet)(S.unbondingTime)&&(P.unbondingTime=(0,w.fromJsonTimestamp)(S.unbondingTime)),(0,w.isSet)(S.commission)&&(P.commission=e.Commission.fromJSON(S.commission)),(0,w.isSet)(S.minSelfDelegation)&&(P.minSelfDelegation=String(S.minSelfDelegation)),(0,w.isSet)(S.unbondingOnHoldRefCount)&&(P.unbondingOnHoldRefCount=BigInt(S.unbondingOnHoldRefCount.toString())),Array.isArray(S==null?void 0:S.unbondingIds)&&(P.unbondingIds=S.unbondingIds.map(O=>BigInt(O.toString()))),P},toJSON(S){const P={};return S.operatorAddress!==void 0&&(P.operatorAddress=S.operatorAddress),S.consensusPubkey!==void 0&&(P.consensusPubkey=S.consensusPubkey?r.Any.toJSON(S.consensusPubkey):void 0),S.jailed!==void 0&&(P.jailed=S.jailed),S.status!==void 0&&(P.status=I(S.status)),S.tokens!==void 0&&(P.tokens=S.tokens),S.delegatorShares!==void 0&&(P.delegatorShares=S.delegatorShares),S.description!==void 0&&(P.description=S.description?e.Description.toJSON(S.description):void 0),S.unbondingHeight!==void 0&&(P.unbondingHeight=(S.unbondingHeight||BigInt(0)).toString()),S.unbondingTime!==void 0&&(P.unbondingTime=(0,w.fromTimestamp)(S.unbondingTime).toISOString()),S.commission!==void 0&&(P.commission=S.commission?e.Commission.toJSON(S.commission):void 0),S.minSelfDelegation!==void 0&&(P.minSelfDelegation=S.minSelfDelegation),S.unbondingOnHoldRefCount!==void 0&&(P.unbondingOnHoldRefCount=(S.unbondingOnHoldRefCount||BigInt(0)).toString()),S.unbondingIds?P.unbondingIds=S.unbondingIds.map(O=>(O||BigInt(0)).toString()):P.unbondingIds=[],P},fromPartial(S){var O;const P=_();return P.operatorAddress=S.operatorAddress??"",S.consensusPubkey!==void 0&&S.consensusPubkey!==null&&(P.consensusPubkey=r.Any.fromPartial(S.consensusPubkey)),P.jailed=S.jailed??!1,P.status=S.status??0,P.tokens=S.tokens??"",P.delegatorShares=S.delegatorShares??"",S.description!==void 0&&S.description!==null&&(P.description=e.Description.fromPartial(S.description)),S.unbondingHeight!==void 0&&S.unbondingHeight!==null&&(P.unbondingHeight=BigInt(S.unbondingHeight.toString())),S.unbondingTime!==void 0&&S.unbondingTime!==null&&(P.unbondingTime=t.Timestamp.fromPartial(S.unbondingTime)),S.commission!==void 0&&S.commission!==null&&(P.commission=e.Commission.fromPartial(S.commission)),P.minSelfDelegation=S.minSelfDelegation??"",S.unbondingOnHoldRefCount!==void 0&&S.unbondingOnHoldRefCount!==null&&(P.unbondingOnHoldRefCount=BigInt(S.unbondingOnHoldRefCount.toString())),P.unbondingIds=((O=S.unbondingIds)==null?void 0:O.map(W=>BigInt(W.toString())))||[],P}};function U(){return{addresses:[]}}e.ValAddresses={typeUrl:"/cosmos.staking.v1beta1.ValAddresses",encode(S,P=C.BinaryWriter.create()){for(const O of S.addresses)P.uint32(10).string(O);return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=U();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.addresses.push(O.string());break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=U();return Array.isArray(S==null?void 0:S.addresses)&&(P.addresses=S.addresses.map(O=>String(O))),P},toJSON(S){const P={};return S.addresses?P.addresses=S.addresses.map(O=>O):P.addresses=[],P},fromPartial(S){var O;const P=U();return P.addresses=((O=S.addresses)==null?void 0:O.map(W=>W))||[],P}};function H(){return{delegatorAddress:"",validatorAddress:""}}e.DVPair={typeUrl:"/cosmos.staking.v1beta1.DVPair",encode(S,P=C.BinaryWriter.create()){return S.delegatorAddress!==""&&P.uint32(10).string(S.delegatorAddress),S.validatorAddress!==""&&P.uint32(18).string(S.validatorAddress),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=H();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.delegatorAddress=O.string();break;case 2:L.validatorAddress=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=H();return(0,w.isSet)(S.delegatorAddress)&&(P.delegatorAddress=String(S.delegatorAddress)),(0,w.isSet)(S.validatorAddress)&&(P.validatorAddress=String(S.validatorAddress)),P},toJSON(S){const P={};return S.delegatorAddress!==void 0&&(P.delegatorAddress=S.delegatorAddress),S.validatorAddress!==void 0&&(P.validatorAddress=S.validatorAddress),P},fromPartial(S){const P=H();return P.delegatorAddress=S.delegatorAddress??"",P.validatorAddress=S.validatorAddress??"",P}};function i(){return{pairs:[]}}e.DVPairs={typeUrl:"/cosmos.staking.v1beta1.DVPairs",encode(S,P=C.BinaryWriter.create()){for(const O of S.pairs)e.DVPair.encode(O,P.uint32(10).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=i();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.pairs.push(e.DVPair.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=i();return Array.isArray(S==null?void 0:S.pairs)&&(P.pairs=S.pairs.map(O=>e.DVPair.fromJSON(O))),P},toJSON(S){const P={};return S.pairs?P.pairs=S.pairs.map(O=>O?e.DVPair.toJSON(O):void 0):P.pairs=[],P},fromPartial(S){var O;const P=i();return P.pairs=((O=S.pairs)==null?void 0:O.map(W=>e.DVPair.fromPartial(W)))||[],P}};function m(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:""}}e.DVVTriplet={typeUrl:"/cosmos.staking.v1beta1.DVVTriplet",encode(S,P=C.BinaryWriter.create()){return S.delegatorAddress!==""&&P.uint32(10).string(S.delegatorAddress),S.validatorSrcAddress!==""&&P.uint32(18).string(S.validatorSrcAddress),S.validatorDstAddress!==""&&P.uint32(26).string(S.validatorDstAddress),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=m();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.delegatorAddress=O.string();break;case 2:L.validatorSrcAddress=O.string();break;case 3:L.validatorDstAddress=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=m();return(0,w.isSet)(S.delegatorAddress)&&(P.delegatorAddress=String(S.delegatorAddress)),(0,w.isSet)(S.validatorSrcAddress)&&(P.validatorSrcAddress=String(S.validatorSrcAddress)),(0,w.isSet)(S.validatorDstAddress)&&(P.validatorDstAddress=String(S.validatorDstAddress)),P},toJSON(S){const P={};return S.delegatorAddress!==void 0&&(P.delegatorAddress=S.delegatorAddress),S.validatorSrcAddress!==void 0&&(P.validatorSrcAddress=S.validatorSrcAddress),S.validatorDstAddress!==void 0&&(P.validatorDstAddress=S.validatorDstAddress),P},fromPartial(S){const P=m();return P.delegatorAddress=S.delegatorAddress??"",P.validatorSrcAddress=S.validatorSrcAddress??"",P.validatorDstAddress=S.validatorDstAddress??"",P}};function N(){return{triplets:[]}}e.DVVTriplets={typeUrl:"/cosmos.staking.v1beta1.DVVTriplets",encode(S,P=C.BinaryWriter.create()){for(const O of S.triplets)e.DVVTriplet.encode(O,P.uint32(10).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=N();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.triplets.push(e.DVVTriplet.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=N();return Array.isArray(S==null?void 0:S.triplets)&&(P.triplets=S.triplets.map(O=>e.DVVTriplet.fromJSON(O))),P},toJSON(S){const P={};return S.triplets?P.triplets=S.triplets.map(O=>O?e.DVVTriplet.toJSON(O):void 0):P.triplets=[],P},fromPartial(S){var O;const P=N();return P.triplets=((O=S.triplets)==null?void 0:O.map(W=>e.DVVTriplet.fromPartial(W)))||[],P}};function V(){return{delegatorAddress:"",validatorAddress:"",shares:""}}e.Delegation={typeUrl:"/cosmos.staking.v1beta1.Delegation",encode(S,P=C.BinaryWriter.create()){return S.delegatorAddress!==""&&P.uint32(10).string(S.delegatorAddress),S.validatorAddress!==""&&P.uint32(18).string(S.validatorAddress),S.shares!==""&&P.uint32(26).string(S.shares),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=V();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.delegatorAddress=O.string();break;case 2:L.validatorAddress=O.string();break;case 3:L.shares=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=V();return(0,w.isSet)(S.delegatorAddress)&&(P.delegatorAddress=String(S.delegatorAddress)),(0,w.isSet)(S.validatorAddress)&&(P.validatorAddress=String(S.validatorAddress)),(0,w.isSet)(S.shares)&&(P.shares=String(S.shares)),P},toJSON(S){const P={};return S.delegatorAddress!==void 0&&(P.delegatorAddress=S.delegatorAddress),S.validatorAddress!==void 0&&(P.validatorAddress=S.validatorAddress),S.shares!==void 0&&(P.shares=S.shares),P},fromPartial(S){const P=V();return P.delegatorAddress=S.delegatorAddress??"",P.validatorAddress=S.validatorAddress??"",P.shares=S.shares??"",P}};function u(){return{delegatorAddress:"",validatorAddress:"",entries:[]}}e.UnbondingDelegation={typeUrl:"/cosmos.staking.v1beta1.UnbondingDelegation",encode(S,P=C.BinaryWriter.create()){S.delegatorAddress!==""&&P.uint32(10).string(S.delegatorAddress),S.validatorAddress!==""&&P.uint32(18).string(S.validatorAddress);for(const O of S.entries)e.UnbondingDelegationEntry.encode(O,P.uint32(26).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=u();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.delegatorAddress=O.string();break;case 2:L.validatorAddress=O.string();break;case 3:L.entries.push(e.UnbondingDelegationEntry.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=u();return(0,w.isSet)(S.delegatorAddress)&&(P.delegatorAddress=String(S.delegatorAddress)),(0,w.isSet)(S.validatorAddress)&&(P.validatorAddress=String(S.validatorAddress)),Array.isArray(S==null?void 0:S.entries)&&(P.entries=S.entries.map(O=>e.UnbondingDelegationEntry.fromJSON(O))),P},toJSON(S){const P={};return S.delegatorAddress!==void 0&&(P.delegatorAddress=S.delegatorAddress),S.validatorAddress!==void 0&&(P.validatorAddress=S.validatorAddress),S.entries?P.entries=S.entries.map(O=>O?e.UnbondingDelegationEntry.toJSON(O):void 0):P.entries=[],P},fromPartial(S){var O;const P=u();return P.delegatorAddress=S.delegatorAddress??"",P.validatorAddress=S.validatorAddress??"",P.entries=((O=S.entries)==null?void 0:O.map(W=>e.UnbondingDelegationEntry.fromPartial(W)))||[],P}};function l(){return{creationHeight:BigInt(0),completionTime:t.Timestamp.fromPartial({}),initialBalance:"",balance:"",unbondingId:BigInt(0),unbondingOnHoldRefCount:BigInt(0)}}e.UnbondingDelegationEntry={typeUrl:"/cosmos.staking.v1beta1.UnbondingDelegationEntry",encode(S,P=C.BinaryWriter.create()){return S.creationHeight!==BigInt(0)&&P.uint32(8).int64(S.creationHeight),S.completionTime!==void 0&&t.Timestamp.encode(S.completionTime,P.uint32(18).fork()).ldelim(),S.initialBalance!==""&&P.uint32(26).string(S.initialBalance),S.balance!==""&&P.uint32(34).string(S.balance),S.unbondingId!==BigInt(0)&&P.uint32(40).uint64(S.unbondingId),S.unbondingOnHoldRefCount!==BigInt(0)&&P.uint32(48).int64(S.unbondingOnHoldRefCount),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=l();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.creationHeight=O.int64();break;case 2:L.completionTime=t.Timestamp.decode(O,O.uint32());break;case 3:L.initialBalance=O.string();break;case 4:L.balance=O.string();break;case 5:L.unbondingId=O.uint64();break;case 6:L.unbondingOnHoldRefCount=O.int64();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=l();return(0,w.isSet)(S.creationHeight)&&(P.creationHeight=BigInt(S.creationHeight.toString())),(0,w.isSet)(S.completionTime)&&(P.completionTime=(0,w.fromJsonTimestamp)(S.completionTime)),(0,w.isSet)(S.initialBalance)&&(P.initialBalance=String(S.initialBalance)),(0,w.isSet)(S.balance)&&(P.balance=String(S.balance)),(0,w.isSet)(S.unbondingId)&&(P.unbondingId=BigInt(S.unbondingId.toString())),(0,w.isSet)(S.unbondingOnHoldRefCount)&&(P.unbondingOnHoldRefCount=BigInt(S.unbondingOnHoldRefCount.toString())),P},toJSON(S){const P={};return S.creationHeight!==void 0&&(P.creationHeight=(S.creationHeight||BigInt(0)).toString()),S.completionTime!==void 0&&(P.completionTime=(0,w.fromTimestamp)(S.completionTime).toISOString()),S.initialBalance!==void 0&&(P.initialBalance=S.initialBalance),S.balance!==void 0&&(P.balance=S.balance),S.unbondingId!==void 0&&(P.unbondingId=(S.unbondingId||BigInt(0)).toString()),S.unbondingOnHoldRefCount!==void 0&&(P.unbondingOnHoldRefCount=(S.unbondingOnHoldRefCount||BigInt(0)).toString()),P},fromPartial(S){const P=l();return S.creationHeight!==void 0&&S.creationHeight!==null&&(P.creationHeight=BigInt(S.creationHeight.toString())),S.completionTime!==void 0&&S.completionTime!==null&&(P.completionTime=t.Timestamp.fromPartial(S.completionTime)),P.initialBalance=S.initialBalance??"",P.balance=S.balance??"",S.unbondingId!==void 0&&S.unbondingId!==null&&(P.unbondingId=BigInt(S.unbondingId.toString())),S.unbondingOnHoldRefCount!==void 0&&S.unbondingOnHoldRefCount!==null&&(P.unbondingOnHoldRefCount=BigInt(S.unbondingOnHoldRefCount.toString())),P}};function T(){return{creationHeight:BigInt(0),completionTime:t.Timestamp.fromPartial({}),initialBalance:"",sharesDst:"",unbondingId:BigInt(0),unbondingOnHoldRefCount:BigInt(0)}}e.RedelegationEntry={typeUrl:"/cosmos.staking.v1beta1.RedelegationEntry",encode(S,P=C.BinaryWriter.create()){return S.creationHeight!==BigInt(0)&&P.uint32(8).int64(S.creationHeight),S.completionTime!==void 0&&t.Timestamp.encode(S.completionTime,P.uint32(18).fork()).ldelim(),S.initialBalance!==""&&P.uint32(26).string(S.initialBalance),S.sharesDst!==""&&P.uint32(34).string(S.sharesDst),S.unbondingId!==BigInt(0)&&P.uint32(40).uint64(S.unbondingId),S.unbondingOnHoldRefCount!==BigInt(0)&&P.uint32(48).int64(S.unbondingOnHoldRefCount),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=T();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.creationHeight=O.int64();break;case 2:L.completionTime=t.Timestamp.decode(O,O.uint32());break;case 3:L.initialBalance=O.string();break;case 4:L.sharesDst=O.string();break;case 5:L.unbondingId=O.uint64();break;case 6:L.unbondingOnHoldRefCount=O.int64();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=T();return(0,w.isSet)(S.creationHeight)&&(P.creationHeight=BigInt(S.creationHeight.toString())),(0,w.isSet)(S.completionTime)&&(P.completionTime=(0,w.fromJsonTimestamp)(S.completionTime)),(0,w.isSet)(S.initialBalance)&&(P.initialBalance=String(S.initialBalance)),(0,w.isSet)(S.sharesDst)&&(P.sharesDst=String(S.sharesDst)),(0,w.isSet)(S.unbondingId)&&(P.unbondingId=BigInt(S.unbondingId.toString())),(0,w.isSet)(S.unbondingOnHoldRefCount)&&(P.unbondingOnHoldRefCount=BigInt(S.unbondingOnHoldRefCount.toString())),P},toJSON(S){const P={};return S.creationHeight!==void 0&&(P.creationHeight=(S.creationHeight||BigInt(0)).toString()),S.completionTime!==void 0&&(P.completionTime=(0,w.fromTimestamp)(S.completionTime).toISOString()),S.initialBalance!==void 0&&(P.initialBalance=S.initialBalance),S.sharesDst!==void 0&&(P.sharesDst=S.sharesDst),S.unbondingId!==void 0&&(P.unbondingId=(S.unbondingId||BigInt(0)).toString()),S.unbondingOnHoldRefCount!==void 0&&(P.unbondingOnHoldRefCount=(S.unbondingOnHoldRefCount||BigInt(0)).toString()),P},fromPartial(S){const P=T();return S.creationHeight!==void 0&&S.creationHeight!==null&&(P.creationHeight=BigInt(S.creationHeight.toString())),S.completionTime!==void 0&&S.completionTime!==null&&(P.completionTime=t.Timestamp.fromPartial(S.completionTime)),P.initialBalance=S.initialBalance??"",P.sharesDst=S.sharesDst??"",S.unbondingId!==void 0&&S.unbondingId!==null&&(P.unbondingId=BigInt(S.unbondingId.toString())),S.unbondingOnHoldRefCount!==void 0&&S.unbondingOnHoldRefCount!==null&&(P.unbondingOnHoldRefCount=BigInt(S.unbondingOnHoldRefCount.toString())),P}};function f(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",entries:[]}}e.Redelegation={typeUrl:"/cosmos.staking.v1beta1.Redelegation",encode(S,P=C.BinaryWriter.create()){S.delegatorAddress!==""&&P.uint32(10).string(S.delegatorAddress),S.validatorSrcAddress!==""&&P.uint32(18).string(S.validatorSrcAddress),S.validatorDstAddress!==""&&P.uint32(26).string(S.validatorDstAddress);for(const O of S.entries)e.RedelegationEntry.encode(O,P.uint32(34).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=f();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.delegatorAddress=O.string();break;case 2:L.validatorSrcAddress=O.string();break;case 3:L.validatorDstAddress=O.string();break;case 4:L.entries.push(e.RedelegationEntry.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=f();return(0,w.isSet)(S.delegatorAddress)&&(P.delegatorAddress=String(S.delegatorAddress)),(0,w.isSet)(S.validatorSrcAddress)&&(P.validatorSrcAddress=String(S.validatorSrcAddress)),(0,w.isSet)(S.validatorDstAddress)&&(P.validatorDstAddress=String(S.validatorDstAddress)),Array.isArray(S==null?void 0:S.entries)&&(P.entries=S.entries.map(O=>e.RedelegationEntry.fromJSON(O))),P},toJSON(S){const P={};return S.delegatorAddress!==void 0&&(P.delegatorAddress=S.delegatorAddress),S.validatorSrcAddress!==void 0&&(P.validatorSrcAddress=S.validatorSrcAddress),S.validatorDstAddress!==void 0&&(P.validatorDstAddress=S.validatorDstAddress),S.entries?P.entries=S.entries.map(O=>O?e.RedelegationEntry.toJSON(O):void 0):P.entries=[],P},fromPartial(S){var O;const P=f();return P.delegatorAddress=S.delegatorAddress??"",P.validatorSrcAddress=S.validatorSrcAddress??"",P.validatorDstAddress=S.validatorDstAddress??"",P.entries=((O=S.entries)==null?void 0:O.map(W=>e.RedelegationEntry.fromPartial(W)))||[],P}};function p(){return{unbondingTime:o.Duration.fromPartial({}),maxValidators:0,maxEntries:0,historicalEntries:0,bondDenom:"",minCommissionRate:""}}e.Params={typeUrl:"/cosmos.staking.v1beta1.Params",encode(S,P=C.BinaryWriter.create()){return S.unbondingTime!==void 0&&o.Duration.encode(S.unbondingTime,P.uint32(10).fork()).ldelim(),S.maxValidators!==0&&P.uint32(16).uint32(S.maxValidators),S.maxEntries!==0&&P.uint32(24).uint32(S.maxEntries),S.historicalEntries!==0&&P.uint32(32).uint32(S.historicalEntries),S.bondDenom!==""&&P.uint32(42).string(S.bondDenom),S.minCommissionRate!==""&&P.uint32(50).string(S.minCommissionRate),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=p();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.unbondingTime=o.Duration.decode(O,O.uint32());break;case 2:L.maxValidators=O.uint32();break;case 3:L.maxEntries=O.uint32();break;case 4:L.historicalEntries=O.uint32();break;case 5:L.bondDenom=O.string();break;case 6:L.minCommissionRate=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=p();return(0,w.isSet)(S.unbondingTime)&&(P.unbondingTime=o.Duration.fromJSON(S.unbondingTime)),(0,w.isSet)(S.maxValidators)&&(P.maxValidators=Number(S.maxValidators)),(0,w.isSet)(S.maxEntries)&&(P.maxEntries=Number(S.maxEntries)),(0,w.isSet)(S.historicalEntries)&&(P.historicalEntries=Number(S.historicalEntries)),(0,w.isSet)(S.bondDenom)&&(P.bondDenom=String(S.bondDenom)),(0,w.isSet)(S.minCommissionRate)&&(P.minCommissionRate=String(S.minCommissionRate)),P},toJSON(S){const P={};return S.unbondingTime!==void 0&&(P.unbondingTime=S.unbondingTime?o.Duration.toJSON(S.unbondingTime):void 0),S.maxValidators!==void 0&&(P.maxValidators=Math.round(S.maxValidators)),S.maxEntries!==void 0&&(P.maxEntries=Math.round(S.maxEntries)),S.historicalEntries!==void 0&&(P.historicalEntries=Math.round(S.historicalEntries)),S.bondDenom!==void 0&&(P.bondDenom=S.bondDenom),S.minCommissionRate!==void 0&&(P.minCommissionRate=S.minCommissionRate),P},fromPartial(S){const P=p();return S.unbondingTime!==void 0&&S.unbondingTime!==null&&(P.unbondingTime=o.Duration.fromPartial(S.unbondingTime)),P.maxValidators=S.maxValidators??0,P.maxEntries=S.maxEntries??0,P.historicalEntries=S.historicalEntries??0,P.bondDenom=S.bondDenom??"",P.minCommissionRate=S.minCommissionRate??"",P}};function A(){return{delegation:e.Delegation.fromPartial({}),balance:h.Coin.fromPartial({})}}e.DelegationResponse={typeUrl:"/cosmos.staking.v1beta1.DelegationResponse",encode(S,P=C.BinaryWriter.create()){return S.delegation!==void 0&&e.Delegation.encode(S.delegation,P.uint32(10).fork()).ldelim(),S.balance!==void 0&&h.Coin.encode(S.balance,P.uint32(18).fork()).ldelim(),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=A();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.delegation=e.Delegation.decode(O,O.uint32());break;case 2:L.balance=h.Coin.decode(O,O.uint32());break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=A();return(0,w.isSet)(S.delegation)&&(P.delegation=e.Delegation.fromJSON(S.delegation)),(0,w.isSet)(S.balance)&&(P.balance=h.Coin.fromJSON(S.balance)),P},toJSON(S){const P={};return S.delegation!==void 0&&(P.delegation=S.delegation?e.Delegation.toJSON(S.delegation):void 0),S.balance!==void 0&&(P.balance=S.balance?h.Coin.toJSON(S.balance):void 0),P},fromPartial(S){const P=A();return S.delegation!==void 0&&S.delegation!==null&&(P.delegation=e.Delegation.fromPartial(S.delegation)),S.balance!==void 0&&S.balance!==null&&(P.balance=h.Coin.fromPartial(S.balance)),P}};function Q(){return{redelegationEntry:e.RedelegationEntry.fromPartial({}),balance:""}}e.RedelegationEntryResponse={typeUrl:"/cosmos.staking.v1beta1.RedelegationEntryResponse",encode(S,P=C.BinaryWriter.create()){return S.redelegationEntry!==void 0&&e.RedelegationEntry.encode(S.redelegationEntry,P.uint32(10).fork()).ldelim(),S.balance!==""&&P.uint32(34).string(S.balance),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=Q();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.redelegationEntry=e.RedelegationEntry.decode(O,O.uint32());break;case 4:L.balance=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=Q();return(0,w.isSet)(S.redelegationEntry)&&(P.redelegationEntry=e.RedelegationEntry.fromJSON(S.redelegationEntry)),(0,w.isSet)(S.balance)&&(P.balance=String(S.balance)),P},toJSON(S){const P={};return S.redelegationEntry!==void 0&&(P.redelegationEntry=S.redelegationEntry?e.RedelegationEntry.toJSON(S.redelegationEntry):void 0),S.balance!==void 0&&(P.balance=S.balance),P},fromPartial(S){const P=Q();return S.redelegationEntry!==void 0&&S.redelegationEntry!==null&&(P.redelegationEntry=e.RedelegationEntry.fromPartial(S.redelegationEntry)),P.balance=S.balance??"",P}};function M(){return{redelegation:e.Redelegation.fromPartial({}),entries:[]}}e.RedelegationResponse={typeUrl:"/cosmos.staking.v1beta1.RedelegationResponse",encode(S,P=C.BinaryWriter.create()){S.redelegation!==void 0&&e.Redelegation.encode(S.redelegation,P.uint32(10).fork()).ldelim();for(const O of S.entries)e.RedelegationEntryResponse.encode(O,P.uint32(18).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=M();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.redelegation=e.Redelegation.decode(O,O.uint32());break;case 2:L.entries.push(e.RedelegationEntryResponse.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=M();return(0,w.isSet)(S.redelegation)&&(P.redelegation=e.Redelegation.fromJSON(S.redelegation)),Array.isArray(S==null?void 0:S.entries)&&(P.entries=S.entries.map(O=>e.RedelegationEntryResponse.fromJSON(O))),P},toJSON(S){const P={};return S.redelegation!==void 0&&(P.redelegation=S.redelegation?e.Redelegation.toJSON(S.redelegation):void 0),S.entries?P.entries=S.entries.map(O=>O?e.RedelegationEntryResponse.toJSON(O):void 0):P.entries=[],P},fromPartial(S){var O;const P=M();return S.redelegation!==void 0&&S.redelegation!==null&&(P.redelegation=e.Redelegation.fromPartial(S.redelegation)),P.entries=((O=S.entries)==null?void 0:O.map(W=>e.RedelegationEntryResponse.fromPartial(W)))||[],P}};function a(){return{notBondedTokens:"",bondedTokens:""}}e.Pool={typeUrl:"/cosmos.staking.v1beta1.Pool",encode(S,P=C.BinaryWriter.create()){return S.notBondedTokens!==""&&P.uint32(10).string(S.notBondedTokens),S.bondedTokens!==""&&P.uint32(18).string(S.bondedTokens),P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=a();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.notBondedTokens=O.string();break;case 2:L.bondedTokens=O.string();break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=a();return(0,w.isSet)(S.notBondedTokens)&&(P.notBondedTokens=String(S.notBondedTokens)),(0,w.isSet)(S.bondedTokens)&&(P.bondedTokens=String(S.bondedTokens)),P},toJSON(S){const P={};return S.notBondedTokens!==void 0&&(P.notBondedTokens=S.notBondedTokens),S.bondedTokens!==void 0&&(P.bondedTokens=S.bondedTokens),P},fromPartial(S){const P=a();return P.notBondedTokens=S.notBondedTokens??"",P.bondedTokens=S.bondedTokens??"",P}};function k(){return{updates:[]}}e.ValidatorUpdates={typeUrl:"/cosmos.staking.v1beta1.ValidatorUpdates",encode(S,P=C.BinaryWriter.create()){for(const O of S.updates)v.ValidatorUpdate.encode(O,P.uint32(10).fork()).ldelim();return P},decode(S,P){const O=S instanceof C.BinaryReader?S:new C.BinaryReader(S);let W=P===void 0?O.len:O.pos+P;const L=k();for(;O.pos<W;){const G=O.uint32();switch(G>>>3){case 1:L.updates.push(v.ValidatorUpdate.decode(O,O.uint32()));break;default:O.skipType(G&7);break}}return L},fromJSON(S){const P=k();return Array.isArray(S==null?void 0:S.updates)&&(P.updates=S.updates.map(O=>v.ValidatorUpdate.fromJSON(O))),P},toJSON(S){const P={};return S.updates?P.updates=S.updates.map(O=>O?v.ValidatorUpdate.toJSON(O):void 0):P.updates=[],P},fromPartial(S){var O;const P=k();return P.updates=((O=S.updates)==null?void 0:O.map(W=>v.ValidatorUpdate.fromPartial(W)))||[],P}}})(Jc);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgUpdateParamsResponse=e.MsgUpdateParams=e.MsgCancelUnbondingDelegationResponse=e.MsgCancelUnbondingDelegation=e.MsgUndelegateResponse=e.MsgUndelegate=e.MsgBeginRedelegateResponse=e.MsgBeginRedelegate=e.MsgDelegateResponse=e.MsgDelegate=e.MsgEditValidatorResponse=e.MsgEditValidator=e.MsgCreateValidatorResponse=e.MsgCreateValidator=e.protobufPackage=void 0;const n=Jc,t=Re,r=Me,o=Mn,h=ee,v=ne;e.protobufPackage="cosmos.staking.v1beta1";function C(){return{description:n.Description.fromPartial({}),commission:n.CommissionRates.fromPartial({}),minSelfDelegation:"",delegatorAddress:"",validatorAddress:"",pubkey:void 0,value:r.Coin.fromPartial({})}}e.MsgCreateValidator={typeUrl:"/cosmos.staking.v1beta1.MsgCreateValidator",encode(i,m=h.BinaryWriter.create()){return i.description!==void 0&&n.Description.encode(i.description,m.uint32(10).fork()).ldelim(),i.commission!==void 0&&n.CommissionRates.encode(i.commission,m.uint32(18).fork()).ldelim(),i.minSelfDelegation!==""&&m.uint32(26).string(i.minSelfDelegation),i.delegatorAddress!==""&&m.uint32(34).string(i.delegatorAddress),i.validatorAddress!==""&&m.uint32(42).string(i.validatorAddress),i.pubkey!==void 0&&t.Any.encode(i.pubkey,m.uint32(50).fork()).ldelim(),i.value!==void 0&&r.Coin.encode(i.value,m.uint32(58).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=C();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.description=n.Description.decode(N,N.uint32());break;case 2:u.commission=n.CommissionRates.decode(N,N.uint32());break;case 3:u.minSelfDelegation=N.string();break;case 4:u.delegatorAddress=N.string();break;case 5:u.validatorAddress=N.string();break;case 6:u.pubkey=t.Any.decode(N,N.uint32());break;case 7:u.value=r.Coin.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=C();return(0,v.isSet)(i.description)&&(m.description=n.Description.fromJSON(i.description)),(0,v.isSet)(i.commission)&&(m.commission=n.CommissionRates.fromJSON(i.commission)),(0,v.isSet)(i.minSelfDelegation)&&(m.minSelfDelegation=String(i.minSelfDelegation)),(0,v.isSet)(i.delegatorAddress)&&(m.delegatorAddress=String(i.delegatorAddress)),(0,v.isSet)(i.validatorAddress)&&(m.validatorAddress=String(i.validatorAddress)),(0,v.isSet)(i.pubkey)&&(m.pubkey=t.Any.fromJSON(i.pubkey)),(0,v.isSet)(i.value)&&(m.value=r.Coin.fromJSON(i.value)),m},toJSON(i){const m={};return i.description!==void 0&&(m.description=i.description?n.Description.toJSON(i.description):void 0),i.commission!==void 0&&(m.commission=i.commission?n.CommissionRates.toJSON(i.commission):void 0),i.minSelfDelegation!==void 0&&(m.minSelfDelegation=i.minSelfDelegation),i.delegatorAddress!==void 0&&(m.delegatorAddress=i.delegatorAddress),i.validatorAddress!==void 0&&(m.validatorAddress=i.validatorAddress),i.pubkey!==void 0&&(m.pubkey=i.pubkey?t.Any.toJSON(i.pubkey):void 0),i.value!==void 0&&(m.value=i.value?r.Coin.toJSON(i.value):void 0),m},fromPartial(i){const m=C();return i.description!==void 0&&i.description!==null&&(m.description=n.Description.fromPartial(i.description)),i.commission!==void 0&&i.commission!==null&&(m.commission=n.CommissionRates.fromPartial(i.commission)),m.minSelfDelegation=i.minSelfDelegation??"",m.delegatorAddress=i.delegatorAddress??"",m.validatorAddress=i.validatorAddress??"",i.pubkey!==void 0&&i.pubkey!==null&&(m.pubkey=t.Any.fromPartial(i.pubkey)),i.value!==void 0&&i.value!==null&&(m.value=r.Coin.fromPartial(i.value)),m}};function w(){return{}}e.MsgCreateValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.MsgCreateValidatorResponse",encode(i,m=h.BinaryWriter.create()){return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=w();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){default:N.skipType(l&7);break}}return u},fromJSON(i){return w()},toJSON(i){return{}},fromPartial(i){return w()}};function D(){return{description:n.Description.fromPartial({}),validatorAddress:"",commissionRate:"",minSelfDelegation:""}}e.MsgEditValidator={typeUrl:"/cosmos.staking.v1beta1.MsgEditValidator",encode(i,m=h.BinaryWriter.create()){return i.description!==void 0&&n.Description.encode(i.description,m.uint32(10).fork()).ldelim(),i.validatorAddress!==""&&m.uint32(18).string(i.validatorAddress),i.commissionRate!==""&&m.uint32(26).string(i.commissionRate),i.minSelfDelegation!==""&&m.uint32(34).string(i.minSelfDelegation),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=D();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.description=n.Description.decode(N,N.uint32());break;case 2:u.validatorAddress=N.string();break;case 3:u.commissionRate=N.string();break;case 4:u.minSelfDelegation=N.string();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=D();return(0,v.isSet)(i.description)&&(m.description=n.Description.fromJSON(i.description)),(0,v.isSet)(i.validatorAddress)&&(m.validatorAddress=String(i.validatorAddress)),(0,v.isSet)(i.commissionRate)&&(m.commissionRate=String(i.commissionRate)),(0,v.isSet)(i.minSelfDelegation)&&(m.minSelfDelegation=String(i.minSelfDelegation)),m},toJSON(i){const m={};return i.description!==void 0&&(m.description=i.description?n.Description.toJSON(i.description):void 0),i.validatorAddress!==void 0&&(m.validatorAddress=i.validatorAddress),i.commissionRate!==void 0&&(m.commissionRate=i.commissionRate),i.minSelfDelegation!==void 0&&(m.minSelfDelegation=i.minSelfDelegation),m},fromPartial(i){const m=D();return i.description!==void 0&&i.description!==null&&(m.description=n.Description.fromPartial(i.description)),m.validatorAddress=i.validatorAddress??"",m.commissionRate=i.commissionRate??"",m.minSelfDelegation=i.minSelfDelegation??"",m}};function J(){return{}}e.MsgEditValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.MsgEditValidatorResponse",encode(i,m=h.BinaryWriter.create()){return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=J();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){default:N.skipType(l&7);break}}return u},fromJSON(i){return J()},toJSON(i){return{}},fromPartial(i){return J()}};function I(){return{delegatorAddress:"",validatorAddress:"",amount:r.Coin.fromPartial({})}}e.MsgDelegate={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",encode(i,m=h.BinaryWriter.create()){return i.delegatorAddress!==""&&m.uint32(10).string(i.delegatorAddress),i.validatorAddress!==""&&m.uint32(18).string(i.validatorAddress),i.amount!==void 0&&r.Coin.encode(i.amount,m.uint32(26).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=I();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.delegatorAddress=N.string();break;case 2:u.validatorAddress=N.string();break;case 3:u.amount=r.Coin.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=I();return(0,v.isSet)(i.delegatorAddress)&&(m.delegatorAddress=String(i.delegatorAddress)),(0,v.isSet)(i.validatorAddress)&&(m.validatorAddress=String(i.validatorAddress)),(0,v.isSet)(i.amount)&&(m.amount=r.Coin.fromJSON(i.amount)),m},toJSON(i){const m={};return i.delegatorAddress!==void 0&&(m.delegatorAddress=i.delegatorAddress),i.validatorAddress!==void 0&&(m.validatorAddress=i.validatorAddress),i.amount!==void 0&&(m.amount=i.amount?r.Coin.toJSON(i.amount):void 0),m},fromPartial(i){const m=I();return m.delegatorAddress=i.delegatorAddress??"",m.validatorAddress=i.validatorAddress??"",i.amount!==void 0&&i.amount!==null&&(m.amount=r.Coin.fromPartial(i.amount)),m}};function g(){return{}}e.MsgDelegateResponse={typeUrl:"/cosmos.staking.v1beta1.MsgDelegateResponse",encode(i,m=h.BinaryWriter.create()){return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=g();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){default:N.skipType(l&7);break}}return u},fromJSON(i){return g()},toJSON(i){return{}},fromPartial(i){return g()}};function R(){return{delegatorAddress:"",validatorSrcAddress:"",validatorDstAddress:"",amount:r.Coin.fromPartial({})}}e.MsgBeginRedelegate={typeUrl:"/cosmos.staking.v1beta1.MsgBeginRedelegate",encode(i,m=h.BinaryWriter.create()){return i.delegatorAddress!==""&&m.uint32(10).string(i.delegatorAddress),i.validatorSrcAddress!==""&&m.uint32(18).string(i.validatorSrcAddress),i.validatorDstAddress!==""&&m.uint32(26).string(i.validatorDstAddress),i.amount!==void 0&&r.Coin.encode(i.amount,m.uint32(34).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=R();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.delegatorAddress=N.string();break;case 2:u.validatorSrcAddress=N.string();break;case 3:u.validatorDstAddress=N.string();break;case 4:u.amount=r.Coin.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=R();return(0,v.isSet)(i.delegatorAddress)&&(m.delegatorAddress=String(i.delegatorAddress)),(0,v.isSet)(i.validatorSrcAddress)&&(m.validatorSrcAddress=String(i.validatorSrcAddress)),(0,v.isSet)(i.validatorDstAddress)&&(m.validatorDstAddress=String(i.validatorDstAddress)),(0,v.isSet)(i.amount)&&(m.amount=r.Coin.fromJSON(i.amount)),m},toJSON(i){const m={};return i.delegatorAddress!==void 0&&(m.delegatorAddress=i.delegatorAddress),i.validatorSrcAddress!==void 0&&(m.validatorSrcAddress=i.validatorSrcAddress),i.validatorDstAddress!==void 0&&(m.validatorDstAddress=i.validatorDstAddress),i.amount!==void 0&&(m.amount=i.amount?r.Coin.toJSON(i.amount):void 0),m},fromPartial(i){const m=R();return m.delegatorAddress=i.delegatorAddress??"",m.validatorSrcAddress=i.validatorSrcAddress??"",m.validatorDstAddress=i.validatorDstAddress??"",i.amount!==void 0&&i.amount!==null&&(m.amount=r.Coin.fromPartial(i.amount)),m}};function B(){return{completionTime:o.Timestamp.fromPartial({})}}e.MsgBeginRedelegateResponse={typeUrl:"/cosmos.staking.v1beta1.MsgBeginRedelegateResponse",encode(i,m=h.BinaryWriter.create()){return i.completionTime!==void 0&&o.Timestamp.encode(i.completionTime,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=B();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.completionTime=o.Timestamp.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=B();return(0,v.isSet)(i.completionTime)&&(m.completionTime=(0,v.fromJsonTimestamp)(i.completionTime)),m},toJSON(i){const m={};return i.completionTime!==void 0&&(m.completionTime=(0,v.fromTimestamp)(i.completionTime).toISOString()),m},fromPartial(i){const m=B();return i.completionTime!==void 0&&i.completionTime!==null&&(m.completionTime=o.Timestamp.fromPartial(i.completionTime)),m}};function d(){return{delegatorAddress:"",validatorAddress:"",amount:r.Coin.fromPartial({})}}e.MsgUndelegate={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",encode(i,m=h.BinaryWriter.create()){return i.delegatorAddress!==""&&m.uint32(10).string(i.delegatorAddress),i.validatorAddress!==""&&m.uint32(18).string(i.validatorAddress),i.amount!==void 0&&r.Coin.encode(i.amount,m.uint32(26).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=d();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.delegatorAddress=N.string();break;case 2:u.validatorAddress=N.string();break;case 3:u.amount=r.Coin.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=d();return(0,v.isSet)(i.delegatorAddress)&&(m.delegatorAddress=String(i.delegatorAddress)),(0,v.isSet)(i.validatorAddress)&&(m.validatorAddress=String(i.validatorAddress)),(0,v.isSet)(i.amount)&&(m.amount=r.Coin.fromJSON(i.amount)),m},toJSON(i){const m={};return i.delegatorAddress!==void 0&&(m.delegatorAddress=i.delegatorAddress),i.validatorAddress!==void 0&&(m.validatorAddress=i.validatorAddress),i.amount!==void 0&&(m.amount=i.amount?r.Coin.toJSON(i.amount):void 0),m},fromPartial(i){const m=d();return m.delegatorAddress=i.delegatorAddress??"",m.validatorAddress=i.validatorAddress??"",i.amount!==void 0&&i.amount!==null&&(m.amount=r.Coin.fromPartial(i.amount)),m}};function s(){return{completionTime:o.Timestamp.fromPartial({})}}e.MsgUndelegateResponse={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegateResponse",encode(i,m=h.BinaryWriter.create()){return i.completionTime!==void 0&&o.Timestamp.encode(i.completionTime,m.uint32(10).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=s();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.completionTime=o.Timestamp.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=s();return(0,v.isSet)(i.completionTime)&&(m.completionTime=(0,v.fromJsonTimestamp)(i.completionTime)),m},toJSON(i){const m={};return i.completionTime!==void 0&&(m.completionTime=(0,v.fromTimestamp)(i.completionTime).toISOString()),m},fromPartial(i){const m=s();return i.completionTime!==void 0&&i.completionTime!==null&&(m.completionTime=o.Timestamp.fromPartial(i.completionTime)),m}};function y(){return{delegatorAddress:"",validatorAddress:"",amount:r.Coin.fromPartial({}),creationHeight:BigInt(0)}}e.MsgCancelUnbondingDelegation={typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegation",encode(i,m=h.BinaryWriter.create()){return i.delegatorAddress!==""&&m.uint32(10).string(i.delegatorAddress),i.validatorAddress!==""&&m.uint32(18).string(i.validatorAddress),i.amount!==void 0&&r.Coin.encode(i.amount,m.uint32(26).fork()).ldelim(),i.creationHeight!==BigInt(0)&&m.uint32(32).int64(i.creationHeight),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=y();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.delegatorAddress=N.string();break;case 2:u.validatorAddress=N.string();break;case 3:u.amount=r.Coin.decode(N,N.uint32());break;case 4:u.creationHeight=N.int64();break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=y();return(0,v.isSet)(i.delegatorAddress)&&(m.delegatorAddress=String(i.delegatorAddress)),(0,v.isSet)(i.validatorAddress)&&(m.validatorAddress=String(i.validatorAddress)),(0,v.isSet)(i.amount)&&(m.amount=r.Coin.fromJSON(i.amount)),(0,v.isSet)(i.creationHeight)&&(m.creationHeight=BigInt(i.creationHeight.toString())),m},toJSON(i){const m={};return i.delegatorAddress!==void 0&&(m.delegatorAddress=i.delegatorAddress),i.validatorAddress!==void 0&&(m.validatorAddress=i.validatorAddress),i.amount!==void 0&&(m.amount=i.amount?r.Coin.toJSON(i.amount):void 0),i.creationHeight!==void 0&&(m.creationHeight=(i.creationHeight||BigInt(0)).toString()),m},fromPartial(i){const m=y();return m.delegatorAddress=i.delegatorAddress??"",m.validatorAddress=i.validatorAddress??"",i.amount!==void 0&&i.amount!==null&&(m.amount=r.Coin.fromPartial(i.amount)),i.creationHeight!==void 0&&i.creationHeight!==null&&(m.creationHeight=BigInt(i.creationHeight.toString())),m}};function E(){return{}}e.MsgCancelUnbondingDelegationResponse={typeUrl:"/cosmos.staking.v1beta1.MsgCancelUnbondingDelegationResponse",encode(i,m=h.BinaryWriter.create()){return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=E();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){default:N.skipType(l&7);break}}return u},fromJSON(i){return E()},toJSON(i){return{}},fromPartial(i){return E()}};function _(){return{authority:"",params:n.Params.fromPartial({})}}e.MsgUpdateParams={typeUrl:"/cosmos.staking.v1beta1.MsgUpdateParams",encode(i,m=h.BinaryWriter.create()){return i.authority!==""&&m.uint32(10).string(i.authority),i.params!==void 0&&n.Params.encode(i.params,m.uint32(18).fork()).ldelim(),m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=_();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){case 1:u.authority=N.string();break;case 2:u.params=n.Params.decode(N,N.uint32());break;default:N.skipType(l&7);break}}return u},fromJSON(i){const m=_();return(0,v.isSet)(i.authority)&&(m.authority=String(i.authority)),(0,v.isSet)(i.params)&&(m.params=n.Params.fromJSON(i.params)),m},toJSON(i){const m={};return i.authority!==void 0&&(m.authority=i.authority),i.params!==void 0&&(m.params=i.params?n.Params.toJSON(i.params):void 0),m},fromPartial(i){const m=_();return m.authority=i.authority??"",i.params!==void 0&&i.params!==null&&(m.params=n.Params.fromPartial(i.params)),m}};function U(){return{}}e.MsgUpdateParamsResponse={typeUrl:"/cosmos.staking.v1beta1.MsgUpdateParamsResponse",encode(i,m=h.BinaryWriter.create()){return m},decode(i,m){const N=i instanceof h.BinaryReader?i:new h.BinaryReader(i);let V=m===void 0?N.len:N.pos+m;const u=U();for(;N.pos<V;){const l=N.uint32();switch(l>>>3){default:N.skipType(l&7);break}}return u},fromJSON(i){return U()},toJSON(i){return{}},fromPartial(i){return U()}};class H{constructor(m){this.rpc=m,this.CreateValidator=this.CreateValidator.bind(this),this.EditValidator=this.EditValidator.bind(this),this.Delegate=this.Delegate.bind(this),this.BeginRedelegate=this.BeginRedelegate.bind(this),this.Undelegate=this.Undelegate.bind(this),this.CancelUnbondingDelegation=this.CancelUnbondingDelegation.bind(this),this.UpdateParams=this.UpdateParams.bind(this)}CreateValidator(m){const N=e.MsgCreateValidator.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CreateValidator",N).then(u=>e.MsgCreateValidatorResponse.decode(new h.BinaryReader(u)))}EditValidator(m){const N=e.MsgEditValidator.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","EditValidator",N).then(u=>e.MsgEditValidatorResponse.decode(new h.BinaryReader(u)))}Delegate(m){const N=e.MsgDelegate.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Delegate",N).then(u=>e.MsgDelegateResponse.decode(new h.BinaryReader(u)))}BeginRedelegate(m){const N=e.MsgBeginRedelegate.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","BeginRedelegate",N).then(u=>e.MsgBeginRedelegateResponse.decode(new h.BinaryReader(u)))}Undelegate(m){const N=e.MsgUndelegate.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","Undelegate",N).then(u=>e.MsgUndelegateResponse.decode(new h.BinaryReader(u)))}CancelUnbondingDelegation(m){const N=e.MsgCancelUnbondingDelegation.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","CancelUnbondingDelegation",N).then(u=>e.MsgCancelUnbondingDelegationResponse.decode(new h.BinaryReader(u)))}UpdateParams(m){const N=e.MsgUpdateParams.encode(m).finish();return this.rpc.request("cosmos.staking.v1beta1.Msg","UpdateParams",N).then(u=>e.MsgUpdateParamsResponse.decode(new h.BinaryReader(u)))}}e.MsgClientImpl=H})(ps);Object.defineProperty(rn,"__esModule",{value:!0});rn.isMsgUndelegateEncodeObject=rn.isMsgEditValidatorEncodeObject=rn.isMsgDelegateEncodeObject=rn.isMsgCreateValidatorEncodeObject=rn.isMsgBeginRedelegateEncodeObject=rn.stakingTypes=void 0;const Vi=ps;rn.stakingTypes=[["/cosmos.staking.v1beta1.MsgBeginRedelegate",Vi.MsgBeginRedelegate],["/cosmos.staking.v1beta1.MsgCreateValidator",Vi.MsgCreateValidator],["/cosmos.staking.v1beta1.MsgDelegate",Vi.MsgDelegate],["/cosmos.staking.v1beta1.MsgEditValidator",Vi.MsgEditValidator],["/cosmos.staking.v1beta1.MsgUndelegate",Vi.MsgUndelegate]];function _R(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgBeginRedelegate"}rn.isMsgBeginRedelegateEncodeObject=_R;function UR(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgCreateValidator"}rn.isMsgCreateValidatorEncodeObject=UR;function JR(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgDelegate"}rn.isMsgDelegateEncodeObject=JR;function DR(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgEditValidator"}rn.isMsgEditValidatorEncodeObject=DR;function MR(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgUndelegate"}rn.isMsgUndelegateEncodeObject=MR;var ms={},Qm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryPoolResponse=e.QueryPoolRequest=e.QueryHistoricalInfoResponse=e.QueryHistoricalInfoRequest=e.QueryDelegatorValidatorResponse=e.QueryDelegatorValidatorRequest=e.QueryDelegatorValidatorsResponse=e.QueryDelegatorValidatorsRequest=e.QueryRedelegationsResponse=e.QueryRedelegationsRequest=e.QueryDelegatorUnbondingDelegationsResponse=e.QueryDelegatorUnbondingDelegationsRequest=e.QueryDelegatorDelegationsResponse=e.QueryDelegatorDelegationsRequest=e.QueryUnbondingDelegationResponse=e.QueryUnbondingDelegationRequest=e.QueryDelegationResponse=e.QueryDelegationRequest=e.QueryValidatorUnbondingDelegationsResponse=e.QueryValidatorUnbondingDelegationsRequest=e.QueryValidatorDelegationsResponse=e.QueryValidatorDelegationsRequest=e.QueryValidatorResponse=e.QueryValidatorRequest=e.QueryValidatorsResponse=e.QueryValidatorsRequest=e.protobufPackage=void 0;const n=be,t=Jc,r=ee,o=ne;e.protobufPackage="cosmos.staking.v1beta1";function h(){return{status:"",pagination:void 0}}e.QueryValidatorsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorsRequest",encode(a,k=r.BinaryWriter.create()){return a.status!==""&&k.uint32(10).string(a.status),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=h();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.status=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=h();return(0,o.isSet)(a.status)&&(k.status=String(a.status)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.status!==void 0&&(k.status=a.status),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=h();return k.status=a.status??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function v(){return{validators:[],pagination:void 0}}e.QueryValidatorsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.validators)t.Validator.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=v();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validators.push(t.Validator.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=v();return Array.isArray(a==null?void 0:a.validators)&&(k.validators=a.validators.map(S=>t.Validator.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.validators?k.validators=a.validators.map(S=>S?t.Validator.toJSON(S):void 0):k.validators=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=v();return k.validators=((S=a.validators)==null?void 0:S.map(P=>t.Validator.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function C(){return{validatorAddr:""}}e.QueryValidatorRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorRequest",encode(a,k=r.BinaryWriter.create()){return a.validatorAddr!==""&&k.uint32(10).string(a.validatorAddr),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=C();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validatorAddr=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=C();return(0,o.isSet)(a.validatorAddr)&&(k.validatorAddr=String(a.validatorAddr)),k},toJSON(a){const k={};return a.validatorAddr!==void 0&&(k.validatorAddr=a.validatorAddr),k},fromPartial(a){const k=C();return k.validatorAddr=a.validatorAddr??"",k}};function w(){return{validator:t.Validator.fromPartial({})}}e.QueryValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorResponse",encode(a,k=r.BinaryWriter.create()){return a.validator!==void 0&&t.Validator.encode(a.validator,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=w();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validator=t.Validator.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=w();return(0,o.isSet)(a.validator)&&(k.validator=t.Validator.fromJSON(a.validator)),k},toJSON(a){const k={};return a.validator!==void 0&&(k.validator=a.validator?t.Validator.toJSON(a.validator):void 0),k},fromPartial(a){const k=w();return a.validator!==void 0&&a.validator!==null&&(k.validator=t.Validator.fromPartial(a.validator)),k}};function D(){return{validatorAddr:"",pagination:void 0}}e.QueryValidatorDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorDelegationsRequest",encode(a,k=r.BinaryWriter.create()){return a.validatorAddr!==""&&k.uint32(10).string(a.validatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=D();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validatorAddr=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=D();return(0,o.isSet)(a.validatorAddr)&&(k.validatorAddr=String(a.validatorAddr)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.validatorAddr!==void 0&&(k.validatorAddr=a.validatorAddr),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=D();return k.validatorAddr=a.validatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function J(){return{delegationResponses:[],pagination:void 0}}e.QueryValidatorDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorDelegationsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.delegationResponses)t.DelegationResponse.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=J();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegationResponses.push(t.DelegationResponse.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=J();return Array.isArray(a==null?void 0:a.delegationResponses)&&(k.delegationResponses=a.delegationResponses.map(S=>t.DelegationResponse.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.delegationResponses?k.delegationResponses=a.delegationResponses.map(S=>S?t.DelegationResponse.toJSON(S):void 0):k.delegationResponses=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=J();return k.delegationResponses=((S=a.delegationResponses)==null?void 0:S.map(P=>t.DelegationResponse.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function I(){return{validatorAddr:"",pagination:void 0}}e.QueryValidatorUnbondingDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsRequest",encode(a,k=r.BinaryWriter.create()){return a.validatorAddr!==""&&k.uint32(10).string(a.validatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=I();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validatorAddr=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=I();return(0,o.isSet)(a.validatorAddr)&&(k.validatorAddr=String(a.validatorAddr)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.validatorAddr!==void 0&&(k.validatorAddr=a.validatorAddr),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=I();return k.validatorAddr=a.validatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function g(){return{unbondingResponses:[],pagination:void 0}}e.QueryValidatorUnbondingDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryValidatorUnbondingDelegationsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.unbondingResponses)t.UnbondingDelegation.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=g();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.unbondingResponses.push(t.UnbondingDelegation.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=g();return Array.isArray(a==null?void 0:a.unbondingResponses)&&(k.unbondingResponses=a.unbondingResponses.map(S=>t.UnbondingDelegation.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.unbondingResponses?k.unbondingResponses=a.unbondingResponses.map(S=>S?t.UnbondingDelegation.toJSON(S):void 0):k.unbondingResponses=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=g();return k.unbondingResponses=((S=a.unbondingResponses)==null?void 0:S.map(P=>t.UnbondingDelegation.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function R(){return{delegatorAddr:"",validatorAddr:""}}e.QueryDelegationRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegationRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.validatorAddr!==""&&k.uint32(18).string(a.validatorAddr),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=R();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.validatorAddr=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=R();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.validatorAddr)&&(k.validatorAddr=String(a.validatorAddr)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.validatorAddr!==void 0&&(k.validatorAddr=a.validatorAddr),k},fromPartial(a){const k=R();return k.delegatorAddr=a.delegatorAddr??"",k.validatorAddr=a.validatorAddr??"",k}};function B(){return{delegationResponse:void 0}}e.QueryDelegationResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegationResponse",encode(a,k=r.BinaryWriter.create()){return a.delegationResponse!==void 0&&t.DelegationResponse.encode(a.delegationResponse,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=B();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegationResponse=t.DelegationResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=B();return(0,o.isSet)(a.delegationResponse)&&(k.delegationResponse=t.DelegationResponse.fromJSON(a.delegationResponse)),k},toJSON(a){const k={};return a.delegationResponse!==void 0&&(k.delegationResponse=a.delegationResponse?t.DelegationResponse.toJSON(a.delegationResponse):void 0),k},fromPartial(a){const k=B();return a.delegationResponse!==void 0&&a.delegationResponse!==null&&(k.delegationResponse=t.DelegationResponse.fromPartial(a.delegationResponse)),k}};function d(){return{delegatorAddr:"",validatorAddr:""}}e.QueryUnbondingDelegationRequest={typeUrl:"/cosmos.staking.v1beta1.QueryUnbondingDelegationRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.validatorAddr!==""&&k.uint32(18).string(a.validatorAddr),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=d();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.validatorAddr=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=d();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.validatorAddr)&&(k.validatorAddr=String(a.validatorAddr)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.validatorAddr!==void 0&&(k.validatorAddr=a.validatorAddr),k},fromPartial(a){const k=d();return k.delegatorAddr=a.delegatorAddr??"",k.validatorAddr=a.validatorAddr??"",k}};function s(){return{unbond:t.UnbondingDelegation.fromPartial({})}}e.QueryUnbondingDelegationResponse={typeUrl:"/cosmos.staking.v1beta1.QueryUnbondingDelegationResponse",encode(a,k=r.BinaryWriter.create()){return a.unbond!==void 0&&t.UnbondingDelegation.encode(a.unbond,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=s();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.unbond=t.UnbondingDelegation.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=s();return(0,o.isSet)(a.unbond)&&(k.unbond=t.UnbondingDelegation.fromJSON(a.unbond)),k},toJSON(a){const k={};return a.unbond!==void 0&&(k.unbond=a.unbond?t.UnbondingDelegation.toJSON(a.unbond):void 0),k},fromPartial(a){const k=s();return a.unbond!==void 0&&a.unbond!==null&&(k.unbond=t.UnbondingDelegation.fromPartial(a.unbond)),k}};function y(){return{delegatorAddr:"",pagination:void 0}}e.QueryDelegatorDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorDelegationsRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=y();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=y();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=y();return k.delegatorAddr=a.delegatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function E(){return{delegationResponses:[],pagination:void 0}}e.QueryDelegatorDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorDelegationsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.delegationResponses)t.DelegationResponse.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=E();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegationResponses.push(t.DelegationResponse.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=E();return Array.isArray(a==null?void 0:a.delegationResponses)&&(k.delegationResponses=a.delegationResponses.map(S=>t.DelegationResponse.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.delegationResponses?k.delegationResponses=a.delegationResponses.map(S=>S?t.DelegationResponse.toJSON(S):void 0):k.delegationResponses=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=E();return k.delegationResponses=((S=a.delegationResponses)==null?void 0:S.map(P=>t.DelegationResponse.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function _(){return{delegatorAddr:"",pagination:void 0}}e.QueryDelegatorUnbondingDelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=_();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=_();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=_();return k.delegatorAddr=a.delegatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function U(){return{unbondingResponses:[],pagination:void 0}}e.QueryDelegatorUnbondingDelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorUnbondingDelegationsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.unbondingResponses)t.UnbondingDelegation.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=U();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.unbondingResponses.push(t.UnbondingDelegation.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=U();return Array.isArray(a==null?void 0:a.unbondingResponses)&&(k.unbondingResponses=a.unbondingResponses.map(S=>t.UnbondingDelegation.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.unbondingResponses?k.unbondingResponses=a.unbondingResponses.map(S=>S?t.UnbondingDelegation.toJSON(S):void 0):k.unbondingResponses=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=U();return k.unbondingResponses=((S=a.unbondingResponses)==null?void 0:S.map(P=>t.UnbondingDelegation.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function H(){return{delegatorAddr:"",srcValidatorAddr:"",dstValidatorAddr:"",pagination:void 0}}e.QueryRedelegationsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryRedelegationsRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.srcValidatorAddr!==""&&k.uint32(18).string(a.srcValidatorAddr),a.dstValidatorAddr!==""&&k.uint32(26).string(a.dstValidatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(34).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=H();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.srcValidatorAddr=S.string();break;case 3:O.dstValidatorAddr=S.string();break;case 4:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=H();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.srcValidatorAddr)&&(k.srcValidatorAddr=String(a.srcValidatorAddr)),(0,o.isSet)(a.dstValidatorAddr)&&(k.dstValidatorAddr=String(a.dstValidatorAddr)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.srcValidatorAddr!==void 0&&(k.srcValidatorAddr=a.srcValidatorAddr),a.dstValidatorAddr!==void 0&&(k.dstValidatorAddr=a.dstValidatorAddr),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=H();return k.delegatorAddr=a.delegatorAddr??"",k.srcValidatorAddr=a.srcValidatorAddr??"",k.dstValidatorAddr=a.dstValidatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function i(){return{redelegationResponses:[],pagination:void 0}}e.QueryRedelegationsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryRedelegationsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.redelegationResponses)t.RedelegationResponse.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=i();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.redelegationResponses.push(t.RedelegationResponse.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=i();return Array.isArray(a==null?void 0:a.redelegationResponses)&&(k.redelegationResponses=a.redelegationResponses.map(S=>t.RedelegationResponse.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.redelegationResponses?k.redelegationResponses=a.redelegationResponses.map(S=>S?t.RedelegationResponse.toJSON(S):void 0):k.redelegationResponses=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=i();return k.redelegationResponses=((S=a.redelegationResponses)==null?void 0:S.map(P=>t.RedelegationResponse.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function m(){return{delegatorAddr:"",pagination:void 0}}e.QueryDelegatorValidatorsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorsRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.pagination!==void 0&&n.PageRequest.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=m();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.pagination=n.PageRequest.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=m();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageRequest.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.pagination!==void 0&&(k.pagination=a.pagination?n.PageRequest.toJSON(a.pagination):void 0),k},fromPartial(a){const k=m();return k.delegatorAddr=a.delegatorAddr??"",a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageRequest.fromPartial(a.pagination)),k}};function N(){return{validators:[],pagination:void 0}}e.QueryDelegatorValidatorsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorsResponse",encode(a,k=r.BinaryWriter.create()){for(const S of a.validators)t.Validator.encode(S,k.uint32(10).fork()).ldelim();return a.pagination!==void 0&&n.PageResponse.encode(a.pagination,k.uint32(18).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=N();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validators.push(t.Validator.decode(S,S.uint32()));break;case 2:O.pagination=n.PageResponse.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=N();return Array.isArray(a==null?void 0:a.validators)&&(k.validators=a.validators.map(S=>t.Validator.fromJSON(S))),(0,o.isSet)(a.pagination)&&(k.pagination=n.PageResponse.fromJSON(a.pagination)),k},toJSON(a){const k={};return a.validators?k.validators=a.validators.map(S=>S?t.Validator.toJSON(S):void 0):k.validators=[],a.pagination!==void 0&&(k.pagination=a.pagination?n.PageResponse.toJSON(a.pagination):void 0),k},fromPartial(a){var S;const k=N();return k.validators=((S=a.validators)==null?void 0:S.map(P=>t.Validator.fromPartial(P)))||[],a.pagination!==void 0&&a.pagination!==null&&(k.pagination=n.PageResponse.fromPartial(a.pagination)),k}};function V(){return{delegatorAddr:"",validatorAddr:""}}e.QueryDelegatorValidatorRequest={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorRequest",encode(a,k=r.BinaryWriter.create()){return a.delegatorAddr!==""&&k.uint32(10).string(a.delegatorAddr),a.validatorAddr!==""&&k.uint32(18).string(a.validatorAddr),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=V();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.delegatorAddr=S.string();break;case 2:O.validatorAddr=S.string();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=V();return(0,o.isSet)(a.delegatorAddr)&&(k.delegatorAddr=String(a.delegatorAddr)),(0,o.isSet)(a.validatorAddr)&&(k.validatorAddr=String(a.validatorAddr)),k},toJSON(a){const k={};return a.delegatorAddr!==void 0&&(k.delegatorAddr=a.delegatorAddr),a.validatorAddr!==void 0&&(k.validatorAddr=a.validatorAddr),k},fromPartial(a){const k=V();return k.delegatorAddr=a.delegatorAddr??"",k.validatorAddr=a.validatorAddr??"",k}};function u(){return{validator:t.Validator.fromPartial({})}}e.QueryDelegatorValidatorResponse={typeUrl:"/cosmos.staking.v1beta1.QueryDelegatorValidatorResponse",encode(a,k=r.BinaryWriter.create()){return a.validator!==void 0&&t.Validator.encode(a.validator,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=u();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.validator=t.Validator.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=u();return(0,o.isSet)(a.validator)&&(k.validator=t.Validator.fromJSON(a.validator)),k},toJSON(a){const k={};return a.validator!==void 0&&(k.validator=a.validator?t.Validator.toJSON(a.validator):void 0),k},fromPartial(a){const k=u();return a.validator!==void 0&&a.validator!==null&&(k.validator=t.Validator.fromPartial(a.validator)),k}};function l(){return{height:BigInt(0)}}e.QueryHistoricalInfoRequest={typeUrl:"/cosmos.staking.v1beta1.QueryHistoricalInfoRequest",encode(a,k=r.BinaryWriter.create()){return a.height!==BigInt(0)&&k.uint32(8).int64(a.height),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=l();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.height=S.int64();break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=l();return(0,o.isSet)(a.height)&&(k.height=BigInt(a.height.toString())),k},toJSON(a){const k={};return a.height!==void 0&&(k.height=(a.height||BigInt(0)).toString()),k},fromPartial(a){const k=l();return a.height!==void 0&&a.height!==null&&(k.height=BigInt(a.height.toString())),k}};function T(){return{hist:void 0}}e.QueryHistoricalInfoResponse={typeUrl:"/cosmos.staking.v1beta1.QueryHistoricalInfoResponse",encode(a,k=r.BinaryWriter.create()){return a.hist!==void 0&&t.HistoricalInfo.encode(a.hist,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=T();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.hist=t.HistoricalInfo.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=T();return(0,o.isSet)(a.hist)&&(k.hist=t.HistoricalInfo.fromJSON(a.hist)),k},toJSON(a){const k={};return a.hist!==void 0&&(k.hist=a.hist?t.HistoricalInfo.toJSON(a.hist):void 0),k},fromPartial(a){const k=T();return a.hist!==void 0&&a.hist!==null&&(k.hist=t.HistoricalInfo.fromPartial(a.hist)),k}};function f(){return{}}e.QueryPoolRequest={typeUrl:"/cosmos.staking.v1beta1.QueryPoolRequest",encode(a,k=r.BinaryWriter.create()){return k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=f();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){default:S.skipType(W&7);break}}return O},fromJSON(a){return f()},toJSON(a){return{}},fromPartial(a){return f()}};function p(){return{pool:t.Pool.fromPartial({})}}e.QueryPoolResponse={typeUrl:"/cosmos.staking.v1beta1.QueryPoolResponse",encode(a,k=r.BinaryWriter.create()){return a.pool!==void 0&&t.Pool.encode(a.pool,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=p();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.pool=t.Pool.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=p();return(0,o.isSet)(a.pool)&&(k.pool=t.Pool.fromJSON(a.pool)),k},toJSON(a){const k={};return a.pool!==void 0&&(k.pool=a.pool?t.Pool.toJSON(a.pool):void 0),k},fromPartial(a){const k=p();return a.pool!==void 0&&a.pool!==null&&(k.pool=t.Pool.fromPartial(a.pool)),k}};function A(){return{}}e.QueryParamsRequest={typeUrl:"/cosmos.staking.v1beta1.QueryParamsRequest",encode(a,k=r.BinaryWriter.create()){return k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=A();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){default:S.skipType(W&7);break}}return O},fromJSON(a){return A()},toJSON(a){return{}},fromPartial(a){return A()}};function Q(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmos.staking.v1beta1.QueryParamsResponse",encode(a,k=r.BinaryWriter.create()){return a.params!==void 0&&t.Params.encode(a.params,k.uint32(10).fork()).ldelim(),k},decode(a,k){const S=a instanceof r.BinaryReader?a:new r.BinaryReader(a);let P=k===void 0?S.len:S.pos+k;const O=Q();for(;S.pos<P;){const W=S.uint32();switch(W>>>3){case 1:O.params=t.Params.decode(S,S.uint32());break;default:S.skipType(W&7);break}}return O},fromJSON(a){const k=Q();return(0,o.isSet)(a.params)&&(k.params=t.Params.fromJSON(a.params)),k},toJSON(a){const k={};return a.params!==void 0&&(k.params=a.params?t.Params.toJSON(a.params):void 0),k},fromPartial(a){const k=Q();return a.params!==void 0&&a.params!==null&&(k.params=t.Params.fromPartial(a.params)),k}};class M{constructor(k){this.rpc=k,this.Validators=this.Validators.bind(this),this.Validator=this.Validator.bind(this),this.ValidatorDelegations=this.ValidatorDelegations.bind(this),this.ValidatorUnbondingDelegations=this.ValidatorUnbondingDelegations.bind(this),this.Delegation=this.Delegation.bind(this),this.UnbondingDelegation=this.UnbondingDelegation.bind(this),this.DelegatorDelegations=this.DelegatorDelegations.bind(this),this.DelegatorUnbondingDelegations=this.DelegatorUnbondingDelegations.bind(this),this.Redelegations=this.Redelegations.bind(this),this.DelegatorValidators=this.DelegatorValidators.bind(this),this.DelegatorValidator=this.DelegatorValidator.bind(this),this.HistoricalInfo=this.HistoricalInfo.bind(this),this.Pool=this.Pool.bind(this),this.Params=this.Params.bind(this)}Validators(k){const S=e.QueryValidatorsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Validators",S).then(O=>e.QueryValidatorsResponse.decode(new r.BinaryReader(O)))}Validator(k){const S=e.QueryValidatorRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Validator",S).then(O=>e.QueryValidatorResponse.decode(new r.BinaryReader(O)))}ValidatorDelegations(k){const S=e.QueryValidatorDelegationsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","ValidatorDelegations",S).then(O=>e.QueryValidatorDelegationsResponse.decode(new r.BinaryReader(O)))}ValidatorUnbondingDelegations(k){const S=e.QueryValidatorUnbondingDelegationsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","ValidatorUnbondingDelegations",S).then(O=>e.QueryValidatorUnbondingDelegationsResponse.decode(new r.BinaryReader(O)))}Delegation(k){const S=e.QueryDelegationRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Delegation",S).then(O=>e.QueryDelegationResponse.decode(new r.BinaryReader(O)))}UnbondingDelegation(k){const S=e.QueryUnbondingDelegationRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","UnbondingDelegation",S).then(O=>e.QueryUnbondingDelegationResponse.decode(new r.BinaryReader(O)))}DelegatorDelegations(k){const S=e.QueryDelegatorDelegationsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorDelegations",S).then(O=>e.QueryDelegatorDelegationsResponse.decode(new r.BinaryReader(O)))}DelegatorUnbondingDelegations(k){const S=e.QueryDelegatorUnbondingDelegationsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorUnbondingDelegations",S).then(O=>e.QueryDelegatorUnbondingDelegationsResponse.decode(new r.BinaryReader(O)))}Redelegations(k){const S=e.QueryRedelegationsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Redelegations",S).then(O=>e.QueryRedelegationsResponse.decode(new r.BinaryReader(O)))}DelegatorValidators(k){const S=e.QueryDelegatorValidatorsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorValidators",S).then(O=>e.QueryDelegatorValidatorsResponse.decode(new r.BinaryReader(O)))}DelegatorValidator(k){const S=e.QueryDelegatorValidatorRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","DelegatorValidator",S).then(O=>e.QueryDelegatorValidatorResponse.decode(new r.BinaryReader(O)))}HistoricalInfo(k){const S=e.QueryHistoricalInfoRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","HistoricalInfo",S).then(O=>e.QueryHistoricalInfoResponse.decode(new r.BinaryReader(O)))}Pool(k={}){const S=e.QueryPoolRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Pool",S).then(O=>e.QueryPoolResponse.decode(new r.BinaryReader(O)))}Params(k={}){const S=e.QueryParamsRequest.encode(k).finish();return this.rpc.request("cosmos.staking.v1beta1.Query","Params",S).then(O=>e.QueryParamsResponse.decode(new r.BinaryReader(O)))}}e.QueryClientImpl=M})(Qm);Object.defineProperty(ms,"__esModule",{value:!0});ms.setupStakingExtension=void 0;const qR=Qm,ht=Ke;function HR(e){const n=(0,ht.createProtobufRpcClient)(e),t=new qR.QueryClientImpl(n);return{staking:{delegation:async(r,o)=>await t.Delegation({delegatorAddr:r,validatorAddr:o}),delegatorDelegations:async(r,o)=>await t.DelegatorDelegations({delegatorAddr:r,pagination:(0,ht.createPagination)(o)}),delegatorUnbondingDelegations:async(r,o)=>await t.DelegatorUnbondingDelegations({delegatorAddr:r,pagination:(0,ht.createPagination)(o)}),delegatorValidator:async(r,o)=>await t.DelegatorValidator({delegatorAddr:r,validatorAddr:o}),delegatorValidators:async(r,o)=>await t.DelegatorValidators({delegatorAddr:r,pagination:(0,ht.createPagination)(o)}),historicalInfo:async r=>await t.HistoricalInfo({height:BigInt(r)}),params:async()=>await t.Params({}),pool:async()=>await t.Pool({}),redelegations:async(r,o,h,v)=>await t.Redelegations({delegatorAddr:r,srcValidatorAddr:o,dstValidatorAddr:h,pagination:(0,ht.createPagination)(v)}),unbondingDelegation:async(r,o)=>await t.UnbondingDelegation({delegatorAddr:r,validatorAddr:o}),validator:async r=>await t.Validator({validatorAddr:r}),validatorDelegations:async(r,o)=>await t.ValidatorDelegations({validatorAddr:r,pagination:(0,ht.createPagination)(o)}),validators:async(r,o)=>await t.Validators({status:r,pagination:(0,ht.createPagination)(o)}),validatorUnbondingDelegations:async(r,o)=>await t.ValidatorUnbondingDelegations({validatorAddr:r,pagination:(0,ht.createPagination)(o)})}}}ms.setupStakingExtension=HR;var ys={},Wm={},hs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SearchTxsResult=e.TxMsgData=e.MsgData=e.SimulationResponse=e.Result=e.GasInfo=e.Attribute=e.StringEvent=e.ABCIMessageLog=e.TxResponse=e.protobufPackage=void 0;const n=Re,t=Dc,r=ee,o=ne;e.protobufPackage="cosmos.base.abci.v1beta1";function h(){return{height:BigInt(0),txhash:"",codespace:"",code:0,data:"",rawLog:"",logs:[],info:"",gasWanted:BigInt(0),gasUsed:BigInt(0),tx:void 0,timestamp:"",events:[]}}e.TxResponse={typeUrl:"/cosmos.base.abci.v1beta1.TxResponse",encode(d,s=r.BinaryWriter.create()){d.height!==BigInt(0)&&s.uint32(8).int64(d.height),d.txhash!==""&&s.uint32(18).string(d.txhash),d.codespace!==""&&s.uint32(26).string(d.codespace),d.code!==0&&s.uint32(32).uint32(d.code),d.data!==""&&s.uint32(42).string(d.data),d.rawLog!==""&&s.uint32(50).string(d.rawLog);for(const y of d.logs)e.ABCIMessageLog.encode(y,s.uint32(58).fork()).ldelim();d.info!==""&&s.uint32(66).string(d.info),d.gasWanted!==BigInt(0)&&s.uint32(72).int64(d.gasWanted),d.gasUsed!==BigInt(0)&&s.uint32(80).int64(d.gasUsed),d.tx!==void 0&&n.Any.encode(d.tx,s.uint32(90).fork()).ldelim(),d.timestamp!==""&&s.uint32(98).string(d.timestamp);for(const y of d.events)t.Event.encode(y,s.uint32(106).fork()).ldelim();return s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=h();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.height=y.int64();break;case 2:_.txhash=y.string();break;case 3:_.codespace=y.string();break;case 4:_.code=y.uint32();break;case 5:_.data=y.string();break;case 6:_.rawLog=y.string();break;case 7:_.logs.push(e.ABCIMessageLog.decode(y,y.uint32()));break;case 8:_.info=y.string();break;case 9:_.gasWanted=y.int64();break;case 10:_.gasUsed=y.int64();break;case 11:_.tx=n.Any.decode(y,y.uint32());break;case 12:_.timestamp=y.string();break;case 13:_.events.push(t.Event.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=h();return(0,o.isSet)(d.height)&&(s.height=BigInt(d.height.toString())),(0,o.isSet)(d.txhash)&&(s.txhash=String(d.txhash)),(0,o.isSet)(d.codespace)&&(s.codespace=String(d.codespace)),(0,o.isSet)(d.code)&&(s.code=Number(d.code)),(0,o.isSet)(d.data)&&(s.data=String(d.data)),(0,o.isSet)(d.rawLog)&&(s.rawLog=String(d.rawLog)),Array.isArray(d==null?void 0:d.logs)&&(s.logs=d.logs.map(y=>e.ABCIMessageLog.fromJSON(y))),(0,o.isSet)(d.info)&&(s.info=String(d.info)),(0,o.isSet)(d.gasWanted)&&(s.gasWanted=BigInt(d.gasWanted.toString())),(0,o.isSet)(d.gasUsed)&&(s.gasUsed=BigInt(d.gasUsed.toString())),(0,o.isSet)(d.tx)&&(s.tx=n.Any.fromJSON(d.tx)),(0,o.isSet)(d.timestamp)&&(s.timestamp=String(d.timestamp)),Array.isArray(d==null?void 0:d.events)&&(s.events=d.events.map(y=>t.Event.fromJSON(y))),s},toJSON(d){const s={};return d.height!==void 0&&(s.height=(d.height||BigInt(0)).toString()),d.txhash!==void 0&&(s.txhash=d.txhash),d.codespace!==void 0&&(s.codespace=d.codespace),d.code!==void 0&&(s.code=Math.round(d.code)),d.data!==void 0&&(s.data=d.data),d.rawLog!==void 0&&(s.rawLog=d.rawLog),d.logs?s.logs=d.logs.map(y=>y?e.ABCIMessageLog.toJSON(y):void 0):s.logs=[],d.info!==void 0&&(s.info=d.info),d.gasWanted!==void 0&&(s.gasWanted=(d.gasWanted||BigInt(0)).toString()),d.gasUsed!==void 0&&(s.gasUsed=(d.gasUsed||BigInt(0)).toString()),d.tx!==void 0&&(s.tx=d.tx?n.Any.toJSON(d.tx):void 0),d.timestamp!==void 0&&(s.timestamp=d.timestamp),d.events?s.events=d.events.map(y=>y?t.Event.toJSON(y):void 0):s.events=[],s},fromPartial(d){var y,E;const s=h();return d.height!==void 0&&d.height!==null&&(s.height=BigInt(d.height.toString())),s.txhash=d.txhash??"",s.codespace=d.codespace??"",s.code=d.code??0,s.data=d.data??"",s.rawLog=d.rawLog??"",s.logs=((y=d.logs)==null?void 0:y.map(_=>e.ABCIMessageLog.fromPartial(_)))||[],s.info=d.info??"",d.gasWanted!==void 0&&d.gasWanted!==null&&(s.gasWanted=BigInt(d.gasWanted.toString())),d.gasUsed!==void 0&&d.gasUsed!==null&&(s.gasUsed=BigInt(d.gasUsed.toString())),d.tx!==void 0&&d.tx!==null&&(s.tx=n.Any.fromPartial(d.tx)),s.timestamp=d.timestamp??"",s.events=((E=d.events)==null?void 0:E.map(_=>t.Event.fromPartial(_)))||[],s}};function v(){return{msgIndex:0,log:"",events:[]}}e.ABCIMessageLog={typeUrl:"/cosmos.base.abci.v1beta1.ABCIMessageLog",encode(d,s=r.BinaryWriter.create()){d.msgIndex!==0&&s.uint32(8).uint32(d.msgIndex),d.log!==""&&s.uint32(18).string(d.log);for(const y of d.events)e.StringEvent.encode(y,s.uint32(26).fork()).ldelim();return s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=v();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.msgIndex=y.uint32();break;case 2:_.log=y.string();break;case 3:_.events.push(e.StringEvent.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=v();return(0,o.isSet)(d.msgIndex)&&(s.msgIndex=Number(d.msgIndex)),(0,o.isSet)(d.log)&&(s.log=String(d.log)),Array.isArray(d==null?void 0:d.events)&&(s.events=d.events.map(y=>e.StringEvent.fromJSON(y))),s},toJSON(d){const s={};return d.msgIndex!==void 0&&(s.msgIndex=Math.round(d.msgIndex)),d.log!==void 0&&(s.log=d.log),d.events?s.events=d.events.map(y=>y?e.StringEvent.toJSON(y):void 0):s.events=[],s},fromPartial(d){var y;const s=v();return s.msgIndex=d.msgIndex??0,s.log=d.log??"",s.events=((y=d.events)==null?void 0:y.map(E=>e.StringEvent.fromPartial(E)))||[],s}};function C(){return{type:"",attributes:[]}}e.StringEvent={typeUrl:"/cosmos.base.abci.v1beta1.StringEvent",encode(d,s=r.BinaryWriter.create()){d.type!==""&&s.uint32(10).string(d.type);for(const y of d.attributes)e.Attribute.encode(y,s.uint32(18).fork()).ldelim();return s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=C();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.type=y.string();break;case 2:_.attributes.push(e.Attribute.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=C();return(0,o.isSet)(d.type)&&(s.type=String(d.type)),Array.isArray(d==null?void 0:d.attributes)&&(s.attributes=d.attributes.map(y=>e.Attribute.fromJSON(y))),s},toJSON(d){const s={};return d.type!==void 0&&(s.type=d.type),d.attributes?s.attributes=d.attributes.map(y=>y?e.Attribute.toJSON(y):void 0):s.attributes=[],s},fromPartial(d){var y;const s=C();return s.type=d.type??"",s.attributes=((y=d.attributes)==null?void 0:y.map(E=>e.Attribute.fromPartial(E)))||[],s}};function w(){return{key:"",value:""}}e.Attribute={typeUrl:"/cosmos.base.abci.v1beta1.Attribute",encode(d,s=r.BinaryWriter.create()){return d.key!==""&&s.uint32(10).string(d.key),d.value!==""&&s.uint32(18).string(d.value),s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=w();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.key=y.string();break;case 2:_.value=y.string();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=w();return(0,o.isSet)(d.key)&&(s.key=String(d.key)),(0,o.isSet)(d.value)&&(s.value=String(d.value)),s},toJSON(d){const s={};return d.key!==void 0&&(s.key=d.key),d.value!==void 0&&(s.value=d.value),s},fromPartial(d){const s=w();return s.key=d.key??"",s.value=d.value??"",s}};function D(){return{gasWanted:BigInt(0),gasUsed:BigInt(0)}}e.GasInfo={typeUrl:"/cosmos.base.abci.v1beta1.GasInfo",encode(d,s=r.BinaryWriter.create()){return d.gasWanted!==BigInt(0)&&s.uint32(8).uint64(d.gasWanted),d.gasUsed!==BigInt(0)&&s.uint32(16).uint64(d.gasUsed),s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=D();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.gasWanted=y.uint64();break;case 2:_.gasUsed=y.uint64();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=D();return(0,o.isSet)(d.gasWanted)&&(s.gasWanted=BigInt(d.gasWanted.toString())),(0,o.isSet)(d.gasUsed)&&(s.gasUsed=BigInt(d.gasUsed.toString())),s},toJSON(d){const s={};return d.gasWanted!==void 0&&(s.gasWanted=(d.gasWanted||BigInt(0)).toString()),d.gasUsed!==void 0&&(s.gasUsed=(d.gasUsed||BigInt(0)).toString()),s},fromPartial(d){const s=D();return d.gasWanted!==void 0&&d.gasWanted!==null&&(s.gasWanted=BigInt(d.gasWanted.toString())),d.gasUsed!==void 0&&d.gasUsed!==null&&(s.gasUsed=BigInt(d.gasUsed.toString())),s}};function J(){return{data:new Uint8Array,log:"",events:[],msgResponses:[]}}e.Result={typeUrl:"/cosmos.base.abci.v1beta1.Result",encode(d,s=r.BinaryWriter.create()){d.data.length!==0&&s.uint32(10).bytes(d.data),d.log!==""&&s.uint32(18).string(d.log);for(const y of d.events)t.Event.encode(y,s.uint32(26).fork()).ldelim();for(const y of d.msgResponses)n.Any.encode(y,s.uint32(34).fork()).ldelim();return s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=J();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.data=y.bytes();break;case 2:_.log=y.string();break;case 3:_.events.push(t.Event.decode(y,y.uint32()));break;case 4:_.msgResponses.push(n.Any.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=J();return(0,o.isSet)(d.data)&&(s.data=(0,o.bytesFromBase64)(d.data)),(0,o.isSet)(d.log)&&(s.log=String(d.log)),Array.isArray(d==null?void 0:d.events)&&(s.events=d.events.map(y=>t.Event.fromJSON(y))),Array.isArray(d==null?void 0:d.msgResponses)&&(s.msgResponses=d.msgResponses.map(y=>n.Any.fromJSON(y))),s},toJSON(d){const s={};return d.data!==void 0&&(s.data=(0,o.base64FromBytes)(d.data!==void 0?d.data:new Uint8Array)),d.log!==void 0&&(s.log=d.log),d.events?s.events=d.events.map(y=>y?t.Event.toJSON(y):void 0):s.events=[],d.msgResponses?s.msgResponses=d.msgResponses.map(y=>y?n.Any.toJSON(y):void 0):s.msgResponses=[],s},fromPartial(d){var y,E;const s=J();return s.data=d.data??new Uint8Array,s.log=d.log??"",s.events=((y=d.events)==null?void 0:y.map(_=>t.Event.fromPartial(_)))||[],s.msgResponses=((E=d.msgResponses)==null?void 0:E.map(_=>n.Any.fromPartial(_)))||[],s}};function I(){return{gasInfo:e.GasInfo.fromPartial({}),result:void 0}}e.SimulationResponse={typeUrl:"/cosmos.base.abci.v1beta1.SimulationResponse",encode(d,s=r.BinaryWriter.create()){return d.gasInfo!==void 0&&e.GasInfo.encode(d.gasInfo,s.uint32(10).fork()).ldelim(),d.result!==void 0&&e.Result.encode(d.result,s.uint32(18).fork()).ldelim(),s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=I();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.gasInfo=e.GasInfo.decode(y,y.uint32());break;case 2:_.result=e.Result.decode(y,y.uint32());break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=I();return(0,o.isSet)(d.gasInfo)&&(s.gasInfo=e.GasInfo.fromJSON(d.gasInfo)),(0,o.isSet)(d.result)&&(s.result=e.Result.fromJSON(d.result)),s},toJSON(d){const s={};return d.gasInfo!==void 0&&(s.gasInfo=d.gasInfo?e.GasInfo.toJSON(d.gasInfo):void 0),d.result!==void 0&&(s.result=d.result?e.Result.toJSON(d.result):void 0),s},fromPartial(d){const s=I();return d.gasInfo!==void 0&&d.gasInfo!==null&&(s.gasInfo=e.GasInfo.fromPartial(d.gasInfo)),d.result!==void 0&&d.result!==null&&(s.result=e.Result.fromPartial(d.result)),s}};function g(){return{msgType:"",data:new Uint8Array}}e.MsgData={typeUrl:"/cosmos.base.abci.v1beta1.MsgData",encode(d,s=r.BinaryWriter.create()){return d.msgType!==""&&s.uint32(10).string(d.msgType),d.data.length!==0&&s.uint32(18).bytes(d.data),s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=g();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.msgType=y.string();break;case 2:_.data=y.bytes();break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=g();return(0,o.isSet)(d.msgType)&&(s.msgType=String(d.msgType)),(0,o.isSet)(d.data)&&(s.data=(0,o.bytesFromBase64)(d.data)),s},toJSON(d){const s={};return d.msgType!==void 0&&(s.msgType=d.msgType),d.data!==void 0&&(s.data=(0,o.base64FromBytes)(d.data!==void 0?d.data:new Uint8Array)),s},fromPartial(d){const s=g();return s.msgType=d.msgType??"",s.data=d.data??new Uint8Array,s}};function R(){return{data:[],msgResponses:[]}}e.TxMsgData={typeUrl:"/cosmos.base.abci.v1beta1.TxMsgData",encode(d,s=r.BinaryWriter.create()){for(const y of d.data)e.MsgData.encode(y,s.uint32(10).fork()).ldelim();for(const y of d.msgResponses)n.Any.encode(y,s.uint32(18).fork()).ldelim();return s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=R();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.data.push(e.MsgData.decode(y,y.uint32()));break;case 2:_.msgResponses.push(n.Any.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=R();return Array.isArray(d==null?void 0:d.data)&&(s.data=d.data.map(y=>e.MsgData.fromJSON(y))),Array.isArray(d==null?void 0:d.msgResponses)&&(s.msgResponses=d.msgResponses.map(y=>n.Any.fromJSON(y))),s},toJSON(d){const s={};return d.data?s.data=d.data.map(y=>y?e.MsgData.toJSON(y):void 0):s.data=[],d.msgResponses?s.msgResponses=d.msgResponses.map(y=>y?n.Any.toJSON(y):void 0):s.msgResponses=[],s},fromPartial(d){var y,E;const s=R();return s.data=((y=d.data)==null?void 0:y.map(_=>e.MsgData.fromPartial(_)))||[],s.msgResponses=((E=d.msgResponses)==null?void 0:E.map(_=>n.Any.fromPartial(_)))||[],s}};function B(){return{totalCount:BigInt(0),count:BigInt(0),pageNumber:BigInt(0),pageTotal:BigInt(0),limit:BigInt(0),txs:[]}}e.SearchTxsResult={typeUrl:"/cosmos.base.abci.v1beta1.SearchTxsResult",encode(d,s=r.BinaryWriter.create()){d.totalCount!==BigInt(0)&&s.uint32(8).uint64(d.totalCount),d.count!==BigInt(0)&&s.uint32(16).uint64(d.count),d.pageNumber!==BigInt(0)&&s.uint32(24).uint64(d.pageNumber),d.pageTotal!==BigInt(0)&&s.uint32(32).uint64(d.pageTotal),d.limit!==BigInt(0)&&s.uint32(40).uint64(d.limit);for(const y of d.txs)e.TxResponse.encode(y,s.uint32(50).fork()).ldelim();return s},decode(d,s){const y=d instanceof r.BinaryReader?d:new r.BinaryReader(d);let E=s===void 0?y.len:y.pos+s;const _=B();for(;y.pos<E;){const U=y.uint32();switch(U>>>3){case 1:_.totalCount=y.uint64();break;case 2:_.count=y.uint64();break;case 3:_.pageNumber=y.uint64();break;case 4:_.pageTotal=y.uint64();break;case 5:_.limit=y.uint64();break;case 6:_.txs.push(e.TxResponse.decode(y,y.uint32()));break;default:y.skipType(U&7);break}}return _},fromJSON(d){const s=B();return(0,o.isSet)(d.totalCount)&&(s.totalCount=BigInt(d.totalCount.toString())),(0,o.isSet)(d.count)&&(s.count=BigInt(d.count.toString())),(0,o.isSet)(d.pageNumber)&&(s.pageNumber=BigInt(d.pageNumber.toString())),(0,o.isSet)(d.pageTotal)&&(s.pageTotal=BigInt(d.pageTotal.toString())),(0,o.isSet)(d.limit)&&(s.limit=BigInt(d.limit.toString())),Array.isArray(d==null?void 0:d.txs)&&(s.txs=d.txs.map(y=>e.TxResponse.fromJSON(y))),s},toJSON(d){const s={};return d.totalCount!==void 0&&(s.totalCount=(d.totalCount||BigInt(0)).toString()),d.count!==void 0&&(s.count=(d.count||BigInt(0)).toString()),d.pageNumber!==void 0&&(s.pageNumber=(d.pageNumber||BigInt(0)).toString()),d.pageTotal!==void 0&&(s.pageTotal=(d.pageTotal||BigInt(0)).toString()),d.limit!==void 0&&(s.limit=(d.limit||BigInt(0)).toString()),d.txs?s.txs=d.txs.map(y=>y?e.TxResponse.toJSON(y):void 0):s.txs=[],s},fromPartial(d){var y;const s=B();return d.totalCount!==void 0&&d.totalCount!==null&&(s.totalCount=BigInt(d.totalCount.toString())),d.count!==void 0&&d.count!==null&&(s.count=BigInt(d.count.toString())),d.pageNumber!==void 0&&d.pageNumber!==null&&(s.pageNumber=BigInt(d.pageNumber.toString())),d.pageTotal!==void 0&&d.pageTotal!==null&&(s.pageTotal=BigInt(d.pageTotal.toString())),d.limit!==void 0&&d.limit!==null&&(s.limit=BigInt(d.limit.toString())),s.txs=((y=d.txs)==null?void 0:y.map(E=>e.TxResponse.fromPartial(E)))||[],s}}})(hs);var ci={},Fm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EvidenceList=e.LightClientAttackEvidence=e.DuplicateVoteEvidence=e.Evidence=e.protobufPackage=void 0;const n=dr,t=Mn,r=cs,o=ee,h=ne;e.protobufPackage="tendermint.types";function v(){return{duplicateVoteEvidence:void 0,lightClientAttackEvidence:void 0}}e.Evidence={typeUrl:"/tendermint.types.Evidence",encode(J,I=o.BinaryWriter.create()){return J.duplicateVoteEvidence!==void 0&&e.DuplicateVoteEvidence.encode(J.duplicateVoteEvidence,I.uint32(10).fork()).ldelim(),J.lightClientAttackEvidence!==void 0&&e.LightClientAttackEvidence.encode(J.lightClientAttackEvidence,I.uint32(18).fork()).ldelim(),I},decode(J,I){const g=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=v();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.duplicateVoteEvidence=e.DuplicateVoteEvidence.decode(g,g.uint32());break;case 2:B.lightClientAttackEvidence=e.LightClientAttackEvidence.decode(g,g.uint32());break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=v();return(0,h.isSet)(J.duplicateVoteEvidence)&&(I.duplicateVoteEvidence=e.DuplicateVoteEvidence.fromJSON(J.duplicateVoteEvidence)),(0,h.isSet)(J.lightClientAttackEvidence)&&(I.lightClientAttackEvidence=e.LightClientAttackEvidence.fromJSON(J.lightClientAttackEvidence)),I},toJSON(J){const I={};return J.duplicateVoteEvidence!==void 0&&(I.duplicateVoteEvidence=J.duplicateVoteEvidence?e.DuplicateVoteEvidence.toJSON(J.duplicateVoteEvidence):void 0),J.lightClientAttackEvidence!==void 0&&(I.lightClientAttackEvidence=J.lightClientAttackEvidence?e.LightClientAttackEvidence.toJSON(J.lightClientAttackEvidence):void 0),I},fromPartial(J){const I=v();return J.duplicateVoteEvidence!==void 0&&J.duplicateVoteEvidence!==null&&(I.duplicateVoteEvidence=e.DuplicateVoteEvidence.fromPartial(J.duplicateVoteEvidence)),J.lightClientAttackEvidence!==void 0&&J.lightClientAttackEvidence!==null&&(I.lightClientAttackEvidence=e.LightClientAttackEvidence.fromPartial(J.lightClientAttackEvidence)),I}};function C(){return{voteA:void 0,voteB:void 0,totalVotingPower:BigInt(0),validatorPower:BigInt(0),timestamp:t.Timestamp.fromPartial({})}}e.DuplicateVoteEvidence={typeUrl:"/tendermint.types.DuplicateVoteEvidence",encode(J,I=o.BinaryWriter.create()){return J.voteA!==void 0&&n.Vote.encode(J.voteA,I.uint32(10).fork()).ldelim(),J.voteB!==void 0&&n.Vote.encode(J.voteB,I.uint32(18).fork()).ldelim(),J.totalVotingPower!==BigInt(0)&&I.uint32(24).int64(J.totalVotingPower),J.validatorPower!==BigInt(0)&&I.uint32(32).int64(J.validatorPower),J.timestamp!==void 0&&t.Timestamp.encode(J.timestamp,I.uint32(42).fork()).ldelim(),I},decode(J,I){const g=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=C();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.voteA=n.Vote.decode(g,g.uint32());break;case 2:B.voteB=n.Vote.decode(g,g.uint32());break;case 3:B.totalVotingPower=g.int64();break;case 4:B.validatorPower=g.int64();break;case 5:B.timestamp=t.Timestamp.decode(g,g.uint32());break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=C();return(0,h.isSet)(J.voteA)&&(I.voteA=n.Vote.fromJSON(J.voteA)),(0,h.isSet)(J.voteB)&&(I.voteB=n.Vote.fromJSON(J.voteB)),(0,h.isSet)(J.totalVotingPower)&&(I.totalVotingPower=BigInt(J.totalVotingPower.toString())),(0,h.isSet)(J.validatorPower)&&(I.validatorPower=BigInt(J.validatorPower.toString())),(0,h.isSet)(J.timestamp)&&(I.timestamp=(0,h.fromJsonTimestamp)(J.timestamp)),I},toJSON(J){const I={};return J.voteA!==void 0&&(I.voteA=J.voteA?n.Vote.toJSON(J.voteA):void 0),J.voteB!==void 0&&(I.voteB=J.voteB?n.Vote.toJSON(J.voteB):void 0),J.totalVotingPower!==void 0&&(I.totalVotingPower=(J.totalVotingPower||BigInt(0)).toString()),J.validatorPower!==void 0&&(I.validatorPower=(J.validatorPower||BigInt(0)).toString()),J.timestamp!==void 0&&(I.timestamp=(0,h.fromTimestamp)(J.timestamp).toISOString()),I},fromPartial(J){const I=C();return J.voteA!==void 0&&J.voteA!==null&&(I.voteA=n.Vote.fromPartial(J.voteA)),J.voteB!==void 0&&J.voteB!==null&&(I.voteB=n.Vote.fromPartial(J.voteB)),J.totalVotingPower!==void 0&&J.totalVotingPower!==null&&(I.totalVotingPower=BigInt(J.totalVotingPower.toString())),J.validatorPower!==void 0&&J.validatorPower!==null&&(I.validatorPower=BigInt(J.validatorPower.toString())),J.timestamp!==void 0&&J.timestamp!==null&&(I.timestamp=t.Timestamp.fromPartial(J.timestamp)),I}};function w(){return{conflictingBlock:void 0,commonHeight:BigInt(0),byzantineValidators:[],totalVotingPower:BigInt(0),timestamp:t.Timestamp.fromPartial({})}}e.LightClientAttackEvidence={typeUrl:"/tendermint.types.LightClientAttackEvidence",encode(J,I=o.BinaryWriter.create()){J.conflictingBlock!==void 0&&n.LightBlock.encode(J.conflictingBlock,I.uint32(10).fork()).ldelim(),J.commonHeight!==BigInt(0)&&I.uint32(16).int64(J.commonHeight);for(const g of J.byzantineValidators)r.Validator.encode(g,I.uint32(26).fork()).ldelim();return J.totalVotingPower!==BigInt(0)&&I.uint32(32).int64(J.totalVotingPower),J.timestamp!==void 0&&t.Timestamp.encode(J.timestamp,I.uint32(42).fork()).ldelim(),I},decode(J,I){const g=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=w();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.conflictingBlock=n.LightBlock.decode(g,g.uint32());break;case 2:B.commonHeight=g.int64();break;case 3:B.byzantineValidators.push(r.Validator.decode(g,g.uint32()));break;case 4:B.totalVotingPower=g.int64();break;case 5:B.timestamp=t.Timestamp.decode(g,g.uint32());break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=w();return(0,h.isSet)(J.conflictingBlock)&&(I.conflictingBlock=n.LightBlock.fromJSON(J.conflictingBlock)),(0,h.isSet)(J.commonHeight)&&(I.commonHeight=BigInt(J.commonHeight.toString())),Array.isArray(J==null?void 0:J.byzantineValidators)&&(I.byzantineValidators=J.byzantineValidators.map(g=>r.Validator.fromJSON(g))),(0,h.isSet)(J.totalVotingPower)&&(I.totalVotingPower=BigInt(J.totalVotingPower.toString())),(0,h.isSet)(J.timestamp)&&(I.timestamp=(0,h.fromJsonTimestamp)(J.timestamp)),I},toJSON(J){const I={};return J.conflictingBlock!==void 0&&(I.conflictingBlock=J.conflictingBlock?n.LightBlock.toJSON(J.conflictingBlock):void 0),J.commonHeight!==void 0&&(I.commonHeight=(J.commonHeight||BigInt(0)).toString()),J.byzantineValidators?I.byzantineValidators=J.byzantineValidators.map(g=>g?r.Validator.toJSON(g):void 0):I.byzantineValidators=[],J.totalVotingPower!==void 0&&(I.totalVotingPower=(J.totalVotingPower||BigInt(0)).toString()),J.timestamp!==void 0&&(I.timestamp=(0,h.fromTimestamp)(J.timestamp).toISOString()),I},fromPartial(J){var g;const I=w();return J.conflictingBlock!==void 0&&J.conflictingBlock!==null&&(I.conflictingBlock=n.LightBlock.fromPartial(J.conflictingBlock)),J.commonHeight!==void 0&&J.commonHeight!==null&&(I.commonHeight=BigInt(J.commonHeight.toString())),I.byzantineValidators=((g=J.byzantineValidators)==null?void 0:g.map(R=>r.Validator.fromPartial(R)))||[],J.totalVotingPower!==void 0&&J.totalVotingPower!==null&&(I.totalVotingPower=BigInt(J.totalVotingPower.toString())),J.timestamp!==void 0&&J.timestamp!==null&&(I.timestamp=t.Timestamp.fromPartial(J.timestamp)),I}};function D(){return{evidence:[]}}e.EvidenceList={typeUrl:"/tendermint.types.EvidenceList",encode(J,I=o.BinaryWriter.create()){for(const g of J.evidence)e.Evidence.encode(g,I.uint32(10).fork()).ldelim();return I},decode(J,I){const g=J instanceof o.BinaryReader?J:new o.BinaryReader(J);let R=I===void 0?g.len:g.pos+I;const B=D();for(;g.pos<R;){const d=g.uint32();switch(d>>>3){case 1:B.evidence.push(e.Evidence.decode(g,g.uint32()));break;default:g.skipType(d&7);break}}return B},fromJSON(J){const I=D();return Array.isArray(J==null?void 0:J.evidence)&&(I.evidence=J.evidence.map(g=>e.Evidence.fromJSON(g))),I},toJSON(J){const I={};return J.evidence?I.evidence=J.evidence.map(g=>g?e.Evidence.toJSON(g):void 0):I.evidence=[],I},fromPartial(J){var g;const I=D();return I.evidence=((g=J.evidence)==null?void 0:g.map(R=>e.Evidence.fromPartial(R)))||[],I}}})(Fm);Object.defineProperty(ci,"__esModule",{value:!0});ci.Block=ci.protobufPackage=void 0;const Ue=dr,Br=Fm,su=ee,Wo=ne;ci.protobufPackage="tendermint.types";function du(){return{header:Ue.Header.fromPartial({}),data:Ue.Data.fromPartial({}),evidence:Br.EvidenceList.fromPartial({}),lastCommit:void 0}}ci.Block={typeUrl:"/tendermint.types.Block",encode(e,n=su.BinaryWriter.create()){return e.header!==void 0&&Ue.Header.encode(e.header,n.uint32(10).fork()).ldelim(),e.data!==void 0&&Ue.Data.encode(e.data,n.uint32(18).fork()).ldelim(),e.evidence!==void 0&&Br.EvidenceList.encode(e.evidence,n.uint32(26).fork()).ldelim(),e.lastCommit!==void 0&&Ue.Commit.encode(e.lastCommit,n.uint32(34).fork()).ldelim(),n},decode(e,n){const t=e instanceof su.BinaryReader?e:new su.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=du();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.header=Ue.Header.decode(t,t.uint32());break;case 2:o.data=Ue.Data.decode(t,t.uint32());break;case 3:o.evidence=Br.EvidenceList.decode(t,t.uint32());break;case 4:o.lastCommit=Ue.Commit.decode(t,t.uint32());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=du();return(0,Wo.isSet)(e.header)&&(n.header=Ue.Header.fromJSON(e.header)),(0,Wo.isSet)(e.data)&&(n.data=Ue.Data.fromJSON(e.data)),(0,Wo.isSet)(e.evidence)&&(n.evidence=Br.EvidenceList.fromJSON(e.evidence)),(0,Wo.isSet)(e.lastCommit)&&(n.lastCommit=Ue.Commit.fromJSON(e.lastCommit)),n},toJSON(e){const n={};return e.header!==void 0&&(n.header=e.header?Ue.Header.toJSON(e.header):void 0),e.data!==void 0&&(n.data=e.data?Ue.Data.toJSON(e.data):void 0),e.evidence!==void 0&&(n.evidence=e.evidence?Br.EvidenceList.toJSON(e.evidence):void 0),e.lastCommit!==void 0&&(n.lastCommit=e.lastCommit?Ue.Commit.toJSON(e.lastCommit):void 0),n},fromPartial(e){const n=du();return e.header!==void 0&&e.header!==null&&(n.header=Ue.Header.fromPartial(e.header)),e.data!==void 0&&e.data!==null&&(n.data=Ue.Data.fromPartial(e.data)),e.evidence!==void 0&&e.evidence!==null&&(n.evidence=Br.EvidenceList.fromPartial(e.evidence)),e.lastCommit!==void 0&&e.lastCommit!==null&&(n.lastCommit=Ue.Commit.fromPartial(e.lastCommit)),n}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ServiceClientImpl=e.TxDecodeAminoResponse=e.TxDecodeAminoRequest=e.TxEncodeAminoResponse=e.TxEncodeAminoRequest=e.TxEncodeResponse=e.TxEncodeRequest=e.TxDecodeResponse=e.TxDecodeRequest=e.GetBlockWithTxsResponse=e.GetBlockWithTxsRequest=e.GetTxResponse=e.GetTxRequest=e.SimulateResponse=e.SimulateRequest=e.BroadcastTxResponse=e.BroadcastTxRequest=e.GetTxsEventResponse=e.GetTxsEventRequest=e.broadcastModeToJSON=e.broadcastModeFromJSON=e.BroadcastMode=e.orderByToJSON=e.orderByFromJSON=e.OrderBy=e.protobufPackage=void 0;const n=at,t=be,r=hs,o=dr,h=ci,v=ee,C=ne;e.protobufPackage="cosmos.tx.v1beta1";var w;(function(M){M[M.ORDER_BY_UNSPECIFIED=0]="ORDER_BY_UNSPECIFIED",M[M.ORDER_BY_ASC=1]="ORDER_BY_ASC",M[M.ORDER_BY_DESC=2]="ORDER_BY_DESC",M[M.UNRECOGNIZED=-1]="UNRECOGNIZED"})(w||(e.OrderBy=w={}));function D(M){switch(M){case 0:case"ORDER_BY_UNSPECIFIED":return w.ORDER_BY_UNSPECIFIED;case 1:case"ORDER_BY_ASC":return w.ORDER_BY_ASC;case 2:case"ORDER_BY_DESC":return w.ORDER_BY_DESC;case-1:case"UNRECOGNIZED":default:return w.UNRECOGNIZED}}e.orderByFromJSON=D;function J(M){switch(M){case w.ORDER_BY_UNSPECIFIED:return"ORDER_BY_UNSPECIFIED";case w.ORDER_BY_ASC:return"ORDER_BY_ASC";case w.ORDER_BY_DESC:return"ORDER_BY_DESC";case w.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.orderByToJSON=J;var I;(function(M){M[M.BROADCAST_MODE_UNSPECIFIED=0]="BROADCAST_MODE_UNSPECIFIED",M[M.BROADCAST_MODE_BLOCK=1]="BROADCAST_MODE_BLOCK",M[M.BROADCAST_MODE_SYNC=2]="BROADCAST_MODE_SYNC",M[M.BROADCAST_MODE_ASYNC=3]="BROADCAST_MODE_ASYNC",M[M.UNRECOGNIZED=-1]="UNRECOGNIZED"})(I||(e.BroadcastMode=I={}));function g(M){switch(M){case 0:case"BROADCAST_MODE_UNSPECIFIED":return I.BROADCAST_MODE_UNSPECIFIED;case 1:case"BROADCAST_MODE_BLOCK":return I.BROADCAST_MODE_BLOCK;case 2:case"BROADCAST_MODE_SYNC":return I.BROADCAST_MODE_SYNC;case 3:case"BROADCAST_MODE_ASYNC":return I.BROADCAST_MODE_ASYNC;case-1:case"UNRECOGNIZED":default:return I.UNRECOGNIZED}}e.broadcastModeFromJSON=g;function R(M){switch(M){case I.BROADCAST_MODE_UNSPECIFIED:return"BROADCAST_MODE_UNSPECIFIED";case I.BROADCAST_MODE_BLOCK:return"BROADCAST_MODE_BLOCK";case I.BROADCAST_MODE_SYNC:return"BROADCAST_MODE_SYNC";case I.BROADCAST_MODE_ASYNC:return"BROADCAST_MODE_ASYNC";case I.UNRECOGNIZED:default:return"UNRECOGNIZED"}}e.broadcastModeToJSON=R;function B(){return{events:[],pagination:void 0,orderBy:0,page:BigInt(0),limit:BigInt(0)}}e.GetTxsEventRequest={typeUrl:"/cosmos.tx.v1beta1.GetTxsEventRequest",encode(M,a=v.BinaryWriter.create()){for(const k of M.events)a.uint32(10).string(k);return M.pagination!==void 0&&t.PageRequest.encode(M.pagination,a.uint32(18).fork()).ldelim(),M.orderBy!==0&&a.uint32(24).int32(M.orderBy),M.page!==BigInt(0)&&a.uint32(32).uint64(M.page),M.limit!==BigInt(0)&&a.uint32(40).uint64(M.limit),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=B();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.events.push(k.string());break;case 2:P.pagination=t.PageRequest.decode(k,k.uint32());break;case 3:P.orderBy=k.int32();break;case 4:P.page=k.uint64();break;case 5:P.limit=k.uint64();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=B();return Array.isArray(M==null?void 0:M.events)&&(a.events=M.events.map(k=>String(k))),(0,C.isSet)(M.pagination)&&(a.pagination=t.PageRequest.fromJSON(M.pagination)),(0,C.isSet)(M.orderBy)&&(a.orderBy=D(M.orderBy)),(0,C.isSet)(M.page)&&(a.page=BigInt(M.page.toString())),(0,C.isSet)(M.limit)&&(a.limit=BigInt(M.limit.toString())),a},toJSON(M){const a={};return M.events?a.events=M.events.map(k=>k):a.events=[],M.pagination!==void 0&&(a.pagination=M.pagination?t.PageRequest.toJSON(M.pagination):void 0),M.orderBy!==void 0&&(a.orderBy=J(M.orderBy)),M.page!==void 0&&(a.page=(M.page||BigInt(0)).toString()),M.limit!==void 0&&(a.limit=(M.limit||BigInt(0)).toString()),a},fromPartial(M){var k;const a=B();return a.events=((k=M.events)==null?void 0:k.map(S=>S))||[],M.pagination!==void 0&&M.pagination!==null&&(a.pagination=t.PageRequest.fromPartial(M.pagination)),a.orderBy=M.orderBy??0,M.page!==void 0&&M.page!==null&&(a.page=BigInt(M.page.toString())),M.limit!==void 0&&M.limit!==null&&(a.limit=BigInt(M.limit.toString())),a}};function d(){return{txs:[],txResponses:[],pagination:void 0,total:BigInt(0)}}e.GetTxsEventResponse={typeUrl:"/cosmos.tx.v1beta1.GetTxsEventResponse",encode(M,a=v.BinaryWriter.create()){for(const k of M.txs)n.Tx.encode(k,a.uint32(10).fork()).ldelim();for(const k of M.txResponses)r.TxResponse.encode(k,a.uint32(18).fork()).ldelim();return M.pagination!==void 0&&t.PageResponse.encode(M.pagination,a.uint32(26).fork()).ldelim(),M.total!==BigInt(0)&&a.uint32(32).uint64(M.total),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=d();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.txs.push(n.Tx.decode(k,k.uint32()));break;case 2:P.txResponses.push(r.TxResponse.decode(k,k.uint32()));break;case 3:P.pagination=t.PageResponse.decode(k,k.uint32());break;case 4:P.total=k.uint64();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=d();return Array.isArray(M==null?void 0:M.txs)&&(a.txs=M.txs.map(k=>n.Tx.fromJSON(k))),Array.isArray(M==null?void 0:M.txResponses)&&(a.txResponses=M.txResponses.map(k=>r.TxResponse.fromJSON(k))),(0,C.isSet)(M.pagination)&&(a.pagination=t.PageResponse.fromJSON(M.pagination)),(0,C.isSet)(M.total)&&(a.total=BigInt(M.total.toString())),a},toJSON(M){const a={};return M.txs?a.txs=M.txs.map(k=>k?n.Tx.toJSON(k):void 0):a.txs=[],M.txResponses?a.txResponses=M.txResponses.map(k=>k?r.TxResponse.toJSON(k):void 0):a.txResponses=[],M.pagination!==void 0&&(a.pagination=M.pagination?t.PageResponse.toJSON(M.pagination):void 0),M.total!==void 0&&(a.total=(M.total||BigInt(0)).toString()),a},fromPartial(M){var k,S;const a=d();return a.txs=((k=M.txs)==null?void 0:k.map(P=>n.Tx.fromPartial(P)))||[],a.txResponses=((S=M.txResponses)==null?void 0:S.map(P=>r.TxResponse.fromPartial(P)))||[],M.pagination!==void 0&&M.pagination!==null&&(a.pagination=t.PageResponse.fromPartial(M.pagination)),M.total!==void 0&&M.total!==null&&(a.total=BigInt(M.total.toString())),a}};function s(){return{txBytes:new Uint8Array,mode:0}}e.BroadcastTxRequest={typeUrl:"/cosmos.tx.v1beta1.BroadcastTxRequest",encode(M,a=v.BinaryWriter.create()){return M.txBytes.length!==0&&a.uint32(10).bytes(M.txBytes),M.mode!==0&&a.uint32(16).int32(M.mode),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=s();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.txBytes=k.bytes();break;case 2:P.mode=k.int32();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=s();return(0,C.isSet)(M.txBytes)&&(a.txBytes=(0,C.bytesFromBase64)(M.txBytes)),(0,C.isSet)(M.mode)&&(a.mode=g(M.mode)),a},toJSON(M){const a={};return M.txBytes!==void 0&&(a.txBytes=(0,C.base64FromBytes)(M.txBytes!==void 0?M.txBytes:new Uint8Array)),M.mode!==void 0&&(a.mode=R(M.mode)),a},fromPartial(M){const a=s();return a.txBytes=M.txBytes??new Uint8Array,a.mode=M.mode??0,a}};function y(){return{txResponse:void 0}}e.BroadcastTxResponse={typeUrl:"/cosmos.tx.v1beta1.BroadcastTxResponse",encode(M,a=v.BinaryWriter.create()){return M.txResponse!==void 0&&r.TxResponse.encode(M.txResponse,a.uint32(10).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=y();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.txResponse=r.TxResponse.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=y();return(0,C.isSet)(M.txResponse)&&(a.txResponse=r.TxResponse.fromJSON(M.txResponse)),a},toJSON(M){const a={};return M.txResponse!==void 0&&(a.txResponse=M.txResponse?r.TxResponse.toJSON(M.txResponse):void 0),a},fromPartial(M){const a=y();return M.txResponse!==void 0&&M.txResponse!==null&&(a.txResponse=r.TxResponse.fromPartial(M.txResponse)),a}};function E(){return{tx:void 0,txBytes:new Uint8Array}}e.SimulateRequest={typeUrl:"/cosmos.tx.v1beta1.SimulateRequest",encode(M,a=v.BinaryWriter.create()){return M.tx!==void 0&&n.Tx.encode(M.tx,a.uint32(10).fork()).ldelim(),M.txBytes.length!==0&&a.uint32(18).bytes(M.txBytes),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=E();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.tx=n.Tx.decode(k,k.uint32());break;case 2:P.txBytes=k.bytes();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=E();return(0,C.isSet)(M.tx)&&(a.tx=n.Tx.fromJSON(M.tx)),(0,C.isSet)(M.txBytes)&&(a.txBytes=(0,C.bytesFromBase64)(M.txBytes)),a},toJSON(M){const a={};return M.tx!==void 0&&(a.tx=M.tx?n.Tx.toJSON(M.tx):void 0),M.txBytes!==void 0&&(a.txBytes=(0,C.base64FromBytes)(M.txBytes!==void 0?M.txBytes:new Uint8Array)),a},fromPartial(M){const a=E();return M.tx!==void 0&&M.tx!==null&&(a.tx=n.Tx.fromPartial(M.tx)),a.txBytes=M.txBytes??new Uint8Array,a}};function _(){return{gasInfo:void 0,result:void 0}}e.SimulateResponse={typeUrl:"/cosmos.tx.v1beta1.SimulateResponse",encode(M,a=v.BinaryWriter.create()){return M.gasInfo!==void 0&&r.GasInfo.encode(M.gasInfo,a.uint32(10).fork()).ldelim(),M.result!==void 0&&r.Result.encode(M.result,a.uint32(18).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=_();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.gasInfo=r.GasInfo.decode(k,k.uint32());break;case 2:P.result=r.Result.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=_();return(0,C.isSet)(M.gasInfo)&&(a.gasInfo=r.GasInfo.fromJSON(M.gasInfo)),(0,C.isSet)(M.result)&&(a.result=r.Result.fromJSON(M.result)),a},toJSON(M){const a={};return M.gasInfo!==void 0&&(a.gasInfo=M.gasInfo?r.GasInfo.toJSON(M.gasInfo):void 0),M.result!==void 0&&(a.result=M.result?r.Result.toJSON(M.result):void 0),a},fromPartial(M){const a=_();return M.gasInfo!==void 0&&M.gasInfo!==null&&(a.gasInfo=r.GasInfo.fromPartial(M.gasInfo)),M.result!==void 0&&M.result!==null&&(a.result=r.Result.fromPartial(M.result)),a}};function U(){return{hash:""}}e.GetTxRequest={typeUrl:"/cosmos.tx.v1beta1.GetTxRequest",encode(M,a=v.BinaryWriter.create()){return M.hash!==""&&a.uint32(10).string(M.hash),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=U();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.hash=k.string();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=U();return(0,C.isSet)(M.hash)&&(a.hash=String(M.hash)),a},toJSON(M){const a={};return M.hash!==void 0&&(a.hash=M.hash),a},fromPartial(M){const a=U();return a.hash=M.hash??"",a}};function H(){return{tx:void 0,txResponse:void 0}}e.GetTxResponse={typeUrl:"/cosmos.tx.v1beta1.GetTxResponse",encode(M,a=v.BinaryWriter.create()){return M.tx!==void 0&&n.Tx.encode(M.tx,a.uint32(10).fork()).ldelim(),M.txResponse!==void 0&&r.TxResponse.encode(M.txResponse,a.uint32(18).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=H();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.tx=n.Tx.decode(k,k.uint32());break;case 2:P.txResponse=r.TxResponse.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=H();return(0,C.isSet)(M.tx)&&(a.tx=n.Tx.fromJSON(M.tx)),(0,C.isSet)(M.txResponse)&&(a.txResponse=r.TxResponse.fromJSON(M.txResponse)),a},toJSON(M){const a={};return M.tx!==void 0&&(a.tx=M.tx?n.Tx.toJSON(M.tx):void 0),M.txResponse!==void 0&&(a.txResponse=M.txResponse?r.TxResponse.toJSON(M.txResponse):void 0),a},fromPartial(M){const a=H();return M.tx!==void 0&&M.tx!==null&&(a.tx=n.Tx.fromPartial(M.tx)),M.txResponse!==void 0&&M.txResponse!==null&&(a.txResponse=r.TxResponse.fromPartial(M.txResponse)),a}};function i(){return{height:BigInt(0),pagination:void 0}}e.GetBlockWithTxsRequest={typeUrl:"/cosmos.tx.v1beta1.GetBlockWithTxsRequest",encode(M,a=v.BinaryWriter.create()){return M.height!==BigInt(0)&&a.uint32(8).int64(M.height),M.pagination!==void 0&&t.PageRequest.encode(M.pagination,a.uint32(18).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=i();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.height=k.int64();break;case 2:P.pagination=t.PageRequest.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=i();return(0,C.isSet)(M.height)&&(a.height=BigInt(M.height.toString())),(0,C.isSet)(M.pagination)&&(a.pagination=t.PageRequest.fromJSON(M.pagination)),a},toJSON(M){const a={};return M.height!==void 0&&(a.height=(M.height||BigInt(0)).toString()),M.pagination!==void 0&&(a.pagination=M.pagination?t.PageRequest.toJSON(M.pagination):void 0),a},fromPartial(M){const a=i();return M.height!==void 0&&M.height!==null&&(a.height=BigInt(M.height.toString())),M.pagination!==void 0&&M.pagination!==null&&(a.pagination=t.PageRequest.fromPartial(M.pagination)),a}};function m(){return{txs:[],blockId:void 0,block:void 0,pagination:void 0}}e.GetBlockWithTxsResponse={typeUrl:"/cosmos.tx.v1beta1.GetBlockWithTxsResponse",encode(M,a=v.BinaryWriter.create()){for(const k of M.txs)n.Tx.encode(k,a.uint32(10).fork()).ldelim();return M.blockId!==void 0&&o.BlockID.encode(M.blockId,a.uint32(18).fork()).ldelim(),M.block!==void 0&&h.Block.encode(M.block,a.uint32(26).fork()).ldelim(),M.pagination!==void 0&&t.PageResponse.encode(M.pagination,a.uint32(34).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=m();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.txs.push(n.Tx.decode(k,k.uint32()));break;case 2:P.blockId=o.BlockID.decode(k,k.uint32());break;case 3:P.block=h.Block.decode(k,k.uint32());break;case 4:P.pagination=t.PageResponse.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=m();return Array.isArray(M==null?void 0:M.txs)&&(a.txs=M.txs.map(k=>n.Tx.fromJSON(k))),(0,C.isSet)(M.blockId)&&(a.blockId=o.BlockID.fromJSON(M.blockId)),(0,C.isSet)(M.block)&&(a.block=h.Block.fromJSON(M.block)),(0,C.isSet)(M.pagination)&&(a.pagination=t.PageResponse.fromJSON(M.pagination)),a},toJSON(M){const a={};return M.txs?a.txs=M.txs.map(k=>k?n.Tx.toJSON(k):void 0):a.txs=[],M.blockId!==void 0&&(a.blockId=M.blockId?o.BlockID.toJSON(M.blockId):void 0),M.block!==void 0&&(a.block=M.block?h.Block.toJSON(M.block):void 0),M.pagination!==void 0&&(a.pagination=M.pagination?t.PageResponse.toJSON(M.pagination):void 0),a},fromPartial(M){var k;const a=m();return a.txs=((k=M.txs)==null?void 0:k.map(S=>n.Tx.fromPartial(S)))||[],M.blockId!==void 0&&M.blockId!==null&&(a.blockId=o.BlockID.fromPartial(M.blockId)),M.block!==void 0&&M.block!==null&&(a.block=h.Block.fromPartial(M.block)),M.pagination!==void 0&&M.pagination!==null&&(a.pagination=t.PageResponse.fromPartial(M.pagination)),a}};function N(){return{txBytes:new Uint8Array}}e.TxDecodeRequest={typeUrl:"/cosmos.tx.v1beta1.TxDecodeRequest",encode(M,a=v.BinaryWriter.create()){return M.txBytes.length!==0&&a.uint32(10).bytes(M.txBytes),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=N();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.txBytes=k.bytes();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=N();return(0,C.isSet)(M.txBytes)&&(a.txBytes=(0,C.bytesFromBase64)(M.txBytes)),a},toJSON(M){const a={};return M.txBytes!==void 0&&(a.txBytes=(0,C.base64FromBytes)(M.txBytes!==void 0?M.txBytes:new Uint8Array)),a},fromPartial(M){const a=N();return a.txBytes=M.txBytes??new Uint8Array,a}};function V(){return{tx:void 0}}e.TxDecodeResponse={typeUrl:"/cosmos.tx.v1beta1.TxDecodeResponse",encode(M,a=v.BinaryWriter.create()){return M.tx!==void 0&&n.Tx.encode(M.tx,a.uint32(10).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=V();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.tx=n.Tx.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=V();return(0,C.isSet)(M.tx)&&(a.tx=n.Tx.fromJSON(M.tx)),a},toJSON(M){const a={};return M.tx!==void 0&&(a.tx=M.tx?n.Tx.toJSON(M.tx):void 0),a},fromPartial(M){const a=V();return M.tx!==void 0&&M.tx!==null&&(a.tx=n.Tx.fromPartial(M.tx)),a}};function u(){return{tx:void 0}}e.TxEncodeRequest={typeUrl:"/cosmos.tx.v1beta1.TxEncodeRequest",encode(M,a=v.BinaryWriter.create()){return M.tx!==void 0&&n.Tx.encode(M.tx,a.uint32(10).fork()).ldelim(),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=u();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.tx=n.Tx.decode(k,k.uint32());break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=u();return(0,C.isSet)(M.tx)&&(a.tx=n.Tx.fromJSON(M.tx)),a},toJSON(M){const a={};return M.tx!==void 0&&(a.tx=M.tx?n.Tx.toJSON(M.tx):void 0),a},fromPartial(M){const a=u();return M.tx!==void 0&&M.tx!==null&&(a.tx=n.Tx.fromPartial(M.tx)),a}};function l(){return{txBytes:new Uint8Array}}e.TxEncodeResponse={typeUrl:"/cosmos.tx.v1beta1.TxEncodeResponse",encode(M,a=v.BinaryWriter.create()){return M.txBytes.length!==0&&a.uint32(10).bytes(M.txBytes),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=l();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.txBytes=k.bytes();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=l();return(0,C.isSet)(M.txBytes)&&(a.txBytes=(0,C.bytesFromBase64)(M.txBytes)),a},toJSON(M){const a={};return M.txBytes!==void 0&&(a.txBytes=(0,C.base64FromBytes)(M.txBytes!==void 0?M.txBytes:new Uint8Array)),a},fromPartial(M){const a=l();return a.txBytes=M.txBytes??new Uint8Array,a}};function T(){return{aminoJson:""}}e.TxEncodeAminoRequest={typeUrl:"/cosmos.tx.v1beta1.TxEncodeAminoRequest",encode(M,a=v.BinaryWriter.create()){return M.aminoJson!==""&&a.uint32(10).string(M.aminoJson),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=T();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.aminoJson=k.string();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=T();return(0,C.isSet)(M.aminoJson)&&(a.aminoJson=String(M.aminoJson)),a},toJSON(M){const a={};return M.aminoJson!==void 0&&(a.aminoJson=M.aminoJson),a},fromPartial(M){const a=T();return a.aminoJson=M.aminoJson??"",a}};function f(){return{aminoBinary:new Uint8Array}}e.TxEncodeAminoResponse={typeUrl:"/cosmos.tx.v1beta1.TxEncodeAminoResponse",encode(M,a=v.BinaryWriter.create()){return M.aminoBinary.length!==0&&a.uint32(10).bytes(M.aminoBinary),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=f();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.aminoBinary=k.bytes();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=f();return(0,C.isSet)(M.aminoBinary)&&(a.aminoBinary=(0,C.bytesFromBase64)(M.aminoBinary)),a},toJSON(M){const a={};return M.aminoBinary!==void 0&&(a.aminoBinary=(0,C.base64FromBytes)(M.aminoBinary!==void 0?M.aminoBinary:new Uint8Array)),a},fromPartial(M){const a=f();return a.aminoBinary=M.aminoBinary??new Uint8Array,a}};function p(){return{aminoBinary:new Uint8Array}}e.TxDecodeAminoRequest={typeUrl:"/cosmos.tx.v1beta1.TxDecodeAminoRequest",encode(M,a=v.BinaryWriter.create()){return M.aminoBinary.length!==0&&a.uint32(10).bytes(M.aminoBinary),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=p();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.aminoBinary=k.bytes();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=p();return(0,C.isSet)(M.aminoBinary)&&(a.aminoBinary=(0,C.bytesFromBase64)(M.aminoBinary)),a},toJSON(M){const a={};return M.aminoBinary!==void 0&&(a.aminoBinary=(0,C.base64FromBytes)(M.aminoBinary!==void 0?M.aminoBinary:new Uint8Array)),a},fromPartial(M){const a=p();return a.aminoBinary=M.aminoBinary??new Uint8Array,a}};function A(){return{aminoJson:""}}e.TxDecodeAminoResponse={typeUrl:"/cosmos.tx.v1beta1.TxDecodeAminoResponse",encode(M,a=v.BinaryWriter.create()){return M.aminoJson!==""&&a.uint32(10).string(M.aminoJson),a},decode(M,a){const k=M instanceof v.BinaryReader?M:new v.BinaryReader(M);let S=a===void 0?k.len:k.pos+a;const P=A();for(;k.pos<S;){const O=k.uint32();switch(O>>>3){case 1:P.aminoJson=k.string();break;default:k.skipType(O&7);break}}return P},fromJSON(M){const a=A();return(0,C.isSet)(M.aminoJson)&&(a.aminoJson=String(M.aminoJson)),a},toJSON(M){const a={};return M.aminoJson!==void 0&&(a.aminoJson=M.aminoJson),a},fromPartial(M){const a=A();return a.aminoJson=M.aminoJson??"",a}};class Q{constructor(a){this.rpc=a,this.Simulate=this.Simulate.bind(this),this.GetTx=this.GetTx.bind(this),this.BroadcastTx=this.BroadcastTx.bind(this),this.GetTxsEvent=this.GetTxsEvent.bind(this),this.GetBlockWithTxs=this.GetBlockWithTxs.bind(this),this.TxDecode=this.TxDecode.bind(this),this.TxEncode=this.TxEncode.bind(this),this.TxEncodeAmino=this.TxEncodeAmino.bind(this),this.TxDecodeAmino=this.TxDecodeAmino.bind(this)}Simulate(a){const k=e.SimulateRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","Simulate",k).then(P=>e.SimulateResponse.decode(new v.BinaryReader(P)))}GetTx(a){const k=e.GetTxRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","GetTx",k).then(P=>e.GetTxResponse.decode(new v.BinaryReader(P)))}BroadcastTx(a){const k=e.BroadcastTxRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","BroadcastTx",k).then(P=>e.BroadcastTxResponse.decode(new v.BinaryReader(P)))}GetTxsEvent(a){const k=e.GetTxsEventRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","GetTxsEvent",k).then(P=>e.GetTxsEventResponse.decode(new v.BinaryReader(P)))}GetBlockWithTxs(a){const k=e.GetBlockWithTxsRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","GetBlockWithTxs",k).then(P=>e.GetBlockWithTxsResponse.decode(new v.BinaryReader(P)))}TxDecode(a){const k=e.TxDecodeRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxDecode",k).then(P=>e.TxDecodeResponse.decode(new v.BinaryReader(P)))}TxEncode(a){const k=e.TxEncodeRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxEncode",k).then(P=>e.TxEncodeResponse.decode(new v.BinaryReader(P)))}TxEncodeAmino(a){const k=e.TxEncodeAminoRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxEncodeAmino",k).then(P=>e.TxEncodeAminoResponse.decode(new v.BinaryReader(P)))}TxDecodeAmino(a){const k=e.TxDecodeAminoRequest.encode(a).finish();return this.rpc.request("cosmos.tx.v1beta1.Service","TxDecodeAmino",k).then(P=>e.TxDecodeAminoResponse.decode(new v.BinaryReader(P)))}}e.ServiceClientImpl=Q})(Wm);Object.defineProperty(ys,"__esModule",{value:!0});ys.setupTxExtension=void 0;const VR=st,QR=uo,Ll=Wm,Qi=at,WR=Ke;function FR(e){const n=(0,WR.createProtobufRpcClient)(e),t=new Ll.ServiceClientImpl(n);return{tx:{getTx:async r=>{const o={hash:r};return await t.GetTx(o)},simulate:async(r,o,h,v)=>{const C=Qi.Tx.fromPartial({authInfo:Qi.AuthInfo.fromPartial({fee:Qi.Fee.fromPartial({}),signerInfos:[{publicKey:(0,VR.encodePubkey)(h),sequence:BigInt(v),modeInfo:{single:{mode:QR.SignMode.SIGN_MODE_UNSPECIFIED}}}]}),body:Qi.TxBody.fromPartial({messages:Array.from(r),memo:o}),signatures:[new Uint8Array]}),w=Ll.SimulateRequest.fromPartial({txBytes:Qi.Tx.encode(C).finish()});return await t.Simulate(w)}}}}ys.setupTxExtension=FR;var li={};Object.defineProperty(li,"__esModule",{value:!0});li.createVestingAminoConverters=li.isAminoMsgCreateVestingAccount=void 0;function GR(e){return e.type==="cosmos-sdk/MsgCreateVestingAccount"}li.isAminoMsgCreateVestingAccount=GR;function LR(){return{"/cosmos.vesting.v1beta1.MsgCreateVestingAccount":{aminoType:"cosmos-sdk/MsgCreateVestingAccount",toAmino:({fromAddress:e,toAddress:n,amount:t,endTime:r,delayed:o})=>({from_address:e,to_address:n,amount:[...t],end_time:r.toString(),delayed:o}),fromAmino:({from_address:e,to_address:n,amount:t,end_time:r,delayed:o})=>({fromAddress:e,toAddress:n,amount:[...t],endTime:BigInt(r),delayed:o})}}}li.createVestingAminoConverters=LR;var gs={},Gm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgCreatePeriodicVestingAccountResponse=e.MsgCreatePeriodicVestingAccount=e.MsgCreatePermanentLockedAccountResponse=e.MsgCreatePermanentLockedAccount=e.MsgCreateVestingAccountResponse=e.MsgCreateVestingAccount=e.protobufPackage=void 0;const n=Me,t=Tc,r=ee,o=ne;e.protobufPackage="cosmos.vesting.v1beta1";function h(){return{fromAddress:"",toAddress:"",amount:[],endTime:BigInt(0),delayed:!1}}e.MsgCreateVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.MsgCreateVestingAccount",encode(g,R=r.BinaryWriter.create()){g.fromAddress!==""&&R.uint32(10).string(g.fromAddress),g.toAddress!==""&&R.uint32(18).string(g.toAddress);for(const B of g.amount)n.Coin.encode(B,R.uint32(26).fork()).ldelim();return g.endTime!==BigInt(0)&&R.uint32(32).int64(g.endTime),g.delayed===!0&&R.uint32(40).bool(g.delayed),R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=h();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.fromAddress=B.string();break;case 2:s.toAddress=B.string();break;case 3:s.amount.push(n.Coin.decode(B,B.uint32()));break;case 4:s.endTime=B.int64();break;case 5:s.delayed=B.bool();break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=h();return(0,o.isSet)(g.fromAddress)&&(R.fromAddress=String(g.fromAddress)),(0,o.isSet)(g.toAddress)&&(R.toAddress=String(g.toAddress)),Array.isArray(g==null?void 0:g.amount)&&(R.amount=g.amount.map(B=>n.Coin.fromJSON(B))),(0,o.isSet)(g.endTime)&&(R.endTime=BigInt(g.endTime.toString())),(0,o.isSet)(g.delayed)&&(R.delayed=!!g.delayed),R},toJSON(g){const R={};return g.fromAddress!==void 0&&(R.fromAddress=g.fromAddress),g.toAddress!==void 0&&(R.toAddress=g.toAddress),g.amount?R.amount=g.amount.map(B=>B?n.Coin.toJSON(B):void 0):R.amount=[],g.endTime!==void 0&&(R.endTime=(g.endTime||BigInt(0)).toString()),g.delayed!==void 0&&(R.delayed=g.delayed),R},fromPartial(g){var B;const R=h();return R.fromAddress=g.fromAddress??"",R.toAddress=g.toAddress??"",R.amount=((B=g.amount)==null?void 0:B.map(d=>n.Coin.fromPartial(d)))||[],g.endTime!==void 0&&g.endTime!==null&&(R.endTime=BigInt(g.endTime.toString())),R.delayed=g.delayed??!1,R}};function v(){return{}}e.MsgCreateVestingAccountResponse={typeUrl:"/cosmos.vesting.v1beta1.MsgCreateVestingAccountResponse",encode(g,R=r.BinaryWriter.create()){return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=v();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){default:B.skipType(y&7);break}}return s},fromJSON(g){return v()},toJSON(g){return{}},fromPartial(g){return v()}};function C(){return{fromAddress:"",toAddress:"",amount:[]}}e.MsgCreatePermanentLockedAccount={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccount",encode(g,R=r.BinaryWriter.create()){g.fromAddress!==""&&R.uint32(10).string(g.fromAddress),g.toAddress!==""&&R.uint32(18).string(g.toAddress);for(const B of g.amount)n.Coin.encode(B,R.uint32(26).fork()).ldelim();return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=C();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.fromAddress=B.string();break;case 2:s.toAddress=B.string();break;case 3:s.amount.push(n.Coin.decode(B,B.uint32()));break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=C();return(0,o.isSet)(g.fromAddress)&&(R.fromAddress=String(g.fromAddress)),(0,o.isSet)(g.toAddress)&&(R.toAddress=String(g.toAddress)),Array.isArray(g==null?void 0:g.amount)&&(R.amount=g.amount.map(B=>n.Coin.fromJSON(B))),R},toJSON(g){const R={};return g.fromAddress!==void 0&&(R.fromAddress=g.fromAddress),g.toAddress!==void 0&&(R.toAddress=g.toAddress),g.amount?R.amount=g.amount.map(B=>B?n.Coin.toJSON(B):void 0):R.amount=[],R},fromPartial(g){var B;const R=C();return R.fromAddress=g.fromAddress??"",R.toAddress=g.toAddress??"",R.amount=((B=g.amount)==null?void 0:B.map(d=>n.Coin.fromPartial(d)))||[],R}};function w(){return{}}e.MsgCreatePermanentLockedAccountResponse={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePermanentLockedAccountResponse",encode(g,R=r.BinaryWriter.create()){return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=w();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){default:B.skipType(y&7);break}}return s},fromJSON(g){return w()},toJSON(g){return{}},fromPartial(g){return w()}};function D(){return{fromAddress:"",toAddress:"",startTime:BigInt(0),vestingPeriods:[]}}e.MsgCreatePeriodicVestingAccount={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccount",encode(g,R=r.BinaryWriter.create()){g.fromAddress!==""&&R.uint32(10).string(g.fromAddress),g.toAddress!==""&&R.uint32(18).string(g.toAddress),g.startTime!==BigInt(0)&&R.uint32(24).int64(g.startTime);for(const B of g.vestingPeriods)t.Period.encode(B,R.uint32(34).fork()).ldelim();return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=D();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){case 1:s.fromAddress=B.string();break;case 2:s.toAddress=B.string();break;case 3:s.startTime=B.int64();break;case 4:s.vestingPeriods.push(t.Period.decode(B,B.uint32()));break;default:B.skipType(y&7);break}}return s},fromJSON(g){const R=D();return(0,o.isSet)(g.fromAddress)&&(R.fromAddress=String(g.fromAddress)),(0,o.isSet)(g.toAddress)&&(R.toAddress=String(g.toAddress)),(0,o.isSet)(g.startTime)&&(R.startTime=BigInt(g.startTime.toString())),Array.isArray(g==null?void 0:g.vestingPeriods)&&(R.vestingPeriods=g.vestingPeriods.map(B=>t.Period.fromJSON(B))),R},toJSON(g){const R={};return g.fromAddress!==void 0&&(R.fromAddress=g.fromAddress),g.toAddress!==void 0&&(R.toAddress=g.toAddress),g.startTime!==void 0&&(R.startTime=(g.startTime||BigInt(0)).toString()),g.vestingPeriods?R.vestingPeriods=g.vestingPeriods.map(B=>B?t.Period.toJSON(B):void 0):R.vestingPeriods=[],R},fromPartial(g){var B;const R=D();return R.fromAddress=g.fromAddress??"",R.toAddress=g.toAddress??"",g.startTime!==void 0&&g.startTime!==null&&(R.startTime=BigInt(g.startTime.toString())),R.vestingPeriods=((B=g.vestingPeriods)==null?void 0:B.map(d=>t.Period.fromPartial(d)))||[],R}};function J(){return{}}e.MsgCreatePeriodicVestingAccountResponse={typeUrl:"/cosmos.vesting.v1beta1.MsgCreatePeriodicVestingAccountResponse",encode(g,R=r.BinaryWriter.create()){return R},decode(g,R){const B=g instanceof r.BinaryReader?g:new r.BinaryReader(g);let d=R===void 0?B.len:B.pos+R;const s=J();for(;B.pos<d;){const y=B.uint32();switch(y>>>3){default:B.skipType(y&7);break}}return s},fromJSON(g){return J()},toJSON(g){return{}},fromPartial(g){return J()}};class I{constructor(R){this.rpc=R,this.CreateVestingAccount=this.CreateVestingAccount.bind(this),this.CreatePermanentLockedAccount=this.CreatePermanentLockedAccount.bind(this),this.CreatePeriodicVestingAccount=this.CreatePeriodicVestingAccount.bind(this)}CreateVestingAccount(R){const B=e.MsgCreateVestingAccount.encode(R).finish();return this.rpc.request("cosmos.vesting.v1beta1.Msg","CreateVestingAccount",B).then(s=>e.MsgCreateVestingAccountResponse.decode(new r.BinaryReader(s)))}CreatePermanentLockedAccount(R){const B=e.MsgCreatePermanentLockedAccount.encode(R).finish();return this.rpc.request("cosmos.vesting.v1beta1.Msg","CreatePermanentLockedAccount",B).then(s=>e.MsgCreatePermanentLockedAccountResponse.decode(new r.BinaryReader(s)))}CreatePeriodicVestingAccount(R){const B=e.MsgCreatePeriodicVestingAccount.encode(R).finish();return this.rpc.request("cosmos.vesting.v1beta1.Msg","CreatePeriodicVestingAccount",B).then(s=>e.MsgCreatePeriodicVestingAccountResponse.decode(new r.BinaryReader(s)))}}e.MsgClientImpl=I})(Gm);Object.defineProperty(gs,"__esModule",{value:!0});gs.vestingTypes=void 0;const $R=Gm;gs.vestingTypes=[["/cosmos.vesting.v1beta1.MsgCreateVestingAccount",$R.MsgCreateVestingAccount]];(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isAminoMsgCreateValidator=e.isAminoMsgBeginRedelegate=e.createStakingAminoConverters=e.setupSlashingExtension=e.isAminoMsgUnjail=e.createSlashingAminoConverters=e.setupMintExtension=e.setupIbcExtension=e.isMsgTransferEncodeObject=e.ibcTypes=e.isAminoMsgTransfer=e.createIbcAminoConverters=e.groupTypes=e.createGroupAminoConverters=e.setupGovExtension=e.isMsgVoteWeightedEncodeObject=e.isMsgVoteEncodeObject=e.isMsgSubmitProposalEncodeObject=e.isMsgDepositEncodeObject=e.govTypes=e.isAminoMsgVoteWeighted=e.isAminoMsgVote=e.isAminoMsgSubmitProposal=e.isAminoMsgDeposit=e.createGovAminoConverters=e.setupFeegrantExtension=e.feegrantTypes=e.createFeegrantAminoConverters=e.isAminoMsgSubmitEvidence=e.createEvidenceAminoConverters=e.setupDistributionExtension=e.isMsgWithdrawDelegatorRewardEncodeObject=e.distributionTypes=e.isAminoMsgWithdrawValidatorCommission=e.isAminoMsgWithdrawDelegatorReward=e.isAminoMsgSetWithdrawAddress=e.isAminoMsgFundCommunityPool=e.createDistributionAminoConverters=e.isAminoMsgVerifyInvariant=e.createCrysisAminoConverters=e.setupBankExtension=e.isMsgSendEncodeObject=e.bankTypes=e.isAminoMsgSend=e.isAminoMsgMultiSend=e.createBankAminoConverters=e.setupAuthzExtension=e.authzTypes=e.createAuthzAminoConverters=e.setupAuthExtension=void 0,e.vestingTypes=e.isAminoMsgCreateVestingAccount=e.createVestingAminoConverters=e.setupTxExtension=e.setupStakingExtension=e.stakingTypes=e.isMsgUndelegateEncodeObject=e.isMsgEditValidatorEncodeObject=e.isMsgDelegateEncodeObject=e.isMsgCreateValidatorEncodeObject=e.isMsgBeginRedelegateEncodeObject=e.isAminoMsgUndelegate=e.isAminoMsgEditValidator=e.isAminoMsgDelegate=void 0;var n=Wa;Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return n.setupAuthExtension}});var t=Ya;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return t.createAuthzAminoConverters}});var r=Za;Object.defineProperty(e,"authzTypes",{enumerable:!0,get:function(){return r.authzTypes}});var o=Xa;Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return o.setupAuthzExtension}});var h=Ot;Object.defineProperty(e,"createBankAminoConverters",{enumerable:!0,get:function(){return h.createBankAminoConverters}}),Object.defineProperty(e,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return h.isAminoMsgMultiSend}}),Object.defineProperty(e,"isAminoMsgSend",{enumerable:!0,get:function(){return h.isAminoMsgSend}});var v=ri;Object.defineProperty(e,"bankTypes",{enumerable:!0,get:function(){return v.bankTypes}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return v.isMsgSendEncodeObject}});var C=xa;Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return C.setupBankExtension}});var w=ii;Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return w.createCrysisAminoConverters}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return w.isAminoMsgVerifyInvariant}});var D=On;Object.defineProperty(e,"createDistributionAminoConverters",{enumerable:!0,get:function(){return D.createDistributionAminoConverters}}),Object.defineProperty(e,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return D.isAminoMsgFundCommunityPool}}),Object.defineProperty(e,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return D.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(e,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return D.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(e,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return D.isAminoMsgWithdrawValidatorCommission}});var J=oi;Object.defineProperty(e,"distributionTypes",{enumerable:!0,get:function(){return J.distributionTypes}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return J.isMsgWithdrawDelegatorRewardEncodeObject}});var I=es;Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return I.setupDistributionExtension}});var g=ai;Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return g.createEvidenceAminoConverters}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return g.isAminoMsgSubmitEvidence}});var R=ns;Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return R.createFeegrantAminoConverters}});var B=ts;Object.defineProperty(e,"feegrantTypes",{enumerable:!0,get:function(){return B.feegrantTypes}});var d=rs;Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return d.setupFeegrantExtension}});var s=An;Object.defineProperty(e,"createGovAminoConverters",{enumerable:!0,get:function(){return s.createGovAminoConverters}}),Object.defineProperty(e,"isAminoMsgDeposit",{enumerable:!0,get:function(){return s.isAminoMsgDeposit}}),Object.defineProperty(e,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return s.isAminoMsgSubmitProposal}}),Object.defineProperty(e,"isAminoMsgVote",{enumerable:!0,get:function(){return s.isAminoMsgVote}}),Object.defineProperty(e,"isAminoMsgVoteWeighted",{enumerable:!0,get:function(){return s.isAminoMsgVoteWeighted}});var y=In;Object.defineProperty(e,"govTypes",{enumerable:!0,get:function(){return y.govTypes}}),Object.defineProperty(e,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return y.isMsgDepositEncodeObject}}),Object.defineProperty(e,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return y.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(e,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return y.isMsgVoteEncodeObject}}),Object.defineProperty(e,"isMsgVoteWeightedEncodeObject",{enumerable:!0,get:function(){return y.isMsgVoteWeightedEncodeObject}});var E=os;Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return E.setupGovExtension}});var _=as;Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return _.createGroupAminoConverters}});var U=ss;Object.defineProperty(e,"groupTypes",{enumerable:!0,get:function(){return U.groupTypes}});var H=si;Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return H.createIbcAminoConverters}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return H.isAminoMsgTransfer}});var i=di;Object.defineProperty(e,"ibcTypes",{enumerable:!0,get:function(){return i.ibcTypes}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return i.isMsgTransferEncodeObject}});var m=us;Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return m.setupIbcExtension}});var N=ls;Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return N.setupMintExtension}});var V=ui;Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return V.createSlashingAminoConverters}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return V.isAminoMsgUnjail}});var u=fs;Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return u.setupSlashingExtension}});var l=We;Object.defineProperty(e,"createStakingAminoConverters",{enumerable:!0,get:function(){return l.createStakingAminoConverters}}),Object.defineProperty(e,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return l.isAminoMsgBeginRedelegate}}),Object.defineProperty(e,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return l.isAminoMsgCreateValidator}}),Object.defineProperty(e,"isAminoMsgDelegate",{enumerable:!0,get:function(){return l.isAminoMsgDelegate}}),Object.defineProperty(e,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return l.isAminoMsgEditValidator}}),Object.defineProperty(e,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return l.isAminoMsgUndelegate}});var T=rn;Object.defineProperty(e,"isMsgBeginRedelegateEncodeObject",{enumerable:!0,get:function(){return T.isMsgBeginRedelegateEncodeObject}}),Object.defineProperty(e,"isMsgCreateValidatorEncodeObject",{enumerable:!0,get:function(){return T.isMsgCreateValidatorEncodeObject}}),Object.defineProperty(e,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return T.isMsgDelegateEncodeObject}}),Object.defineProperty(e,"isMsgEditValidatorEncodeObject",{enumerable:!0,get:function(){return T.isMsgEditValidatorEncodeObject}}),Object.defineProperty(e,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return T.isMsgUndelegateEncodeObject}}),Object.defineProperty(e,"stakingTypes",{enumerable:!0,get:function(){return T.stakingTypes}});var f=ms;Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return f.setupStakingExtension}});var p=ys;Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return p.setupTxExtension}});var A=li;Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return A.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return A.isAminoMsgCreateVestingAccount}});var Q=gs;Object.defineProperty(e,"vestingTypes",{enumerable:!0,get:function(){return Q.vestingTypes}})})(io);var Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.makeMultisignedTxBytes=Nt.makeMultisignedTx=Nt.makeCompactBitArray=void 0;const KR=zn,zR=de,YR=st,zu=Kh,ZR=uo,$l=at,Lm=at;function $m(e){const n=Math.ceil(e.length/8),t=e.length-Math.floor(e.length/8)*8,r=new Uint8Array(n);return e.forEach((o,h)=>{const v=Math.floor(h/8),C=h%8;o&&(r[v]|=1<<7-C)}),zu.CompactBitArray.fromPartial({elems:r,extraBitsStored:t})}Nt.makeCompactBitArray=$m;function Km(e,n,t,r,o){const h=Array.from(o.keys()),v=(0,zR.fromBech32)(h[0]).prefix,C=Array(e.value.pubkeys.length).fill(!1),w=new Array;for(let R=0;R<e.value.pubkeys.length;R++){const B=(0,KR.pubkeyToAddress)(e.value.pubkeys[R],v),d=o.get(B);d&&(C[R]=!0,w.push(d))}const D={publicKey:(0,YR.encodePubkey)(e),modeInfo:{multi:{bitarray:$m(C),modeInfos:w.map(R=>({single:{mode:ZR.SignMode.SIGN_MODE_LEGACY_AMINO_JSON}}))}},sequence:BigInt(n)},J=$l.AuthInfo.fromPartial({signerInfos:[D],fee:{amount:[...t.amount],gasLimit:BigInt(t.gas)}}),I=$l.AuthInfo.encode(J).finish();return Lm.TxRaw.fromPartial({bodyBytes:r,authInfoBytes:I,signatures:[zu.MultiSignature.encode(zu.MultiSignature.fromPartial({signatures:w})).finish()]})}Nt.makeMultisignedTx=Km;function XR(e,n,t,r,o){const h=Km(e,n,t,r,o);return Uint8Array.from(Lm.TxRaw.encode(h).finish())}Nt.makeMultisignedTxBytes=XR;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.isSearchTxQueryArray=void 0;function xR(e){return Array.isArray(e)}go.isSearchTxQueryArray=xR;var zm={},So={},rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.pubkeyToAddress=rt.pubkeyToRawAddress=rt.rawSecp256k1PubkeyToRawAddress=rt.rawEd25519PubkeyToRawAddress=void 0;const Yu=Ge,jR=de;function Ym(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Yu.sha256)(e).slice(0,20)}rt.rawEd25519PubkeyToRawAddress=Ym;function Zm(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Yu.ripemd160)((0,Yu.sha256)(e))}rt.rawSecp256k1PubkeyToRawAddress=Zm;function Xm(e,n){switch(e){case"ed25519":return Ym(n);case"secp256k1":return Zm(n);default:throw new Error(`Pubkey type ${e} not supported`)}}rt.pubkeyToRawAddress=Xm;function ev(e,n){return(0,jR.toHex)(Xm(e,n)).toUpperCase()}rt.pubkeyToAddress=ev;var $e={};Object.defineProperty($e,"__esModule",{value:!0});$e.DateTime=$e.toSeconds=$e.fromSeconds=$e.toRfc3339WithNanoseconds=$e.fromRfc3339WithNanoseconds=void 0;const nv=de,tv=Te;function xm(e){const n=(0,nv.fromRfc3339)(e),t=e.match(/\.(\d+)Z$/),r=t?t[1].slice(3):"";return n.nanoseconds=parseInt(r.padEnd(6,"0"),10),n}$e.fromRfc3339WithNanoseconds=xm;function jm(e){var r;const n=e.toISOString(),t=((r=e.nanoseconds)==null?void 0:r.toString())??"";return`${n.slice(0,-1)}${t.padStart(6,"0")}Z`}$e.toRfc3339WithNanoseconds=jm;function rv(e,n=0){const t=new tv.Uint32(n).toNumber();if(t>999999999)throw new Error("Nano seconds must not exceed 999999999");const r=new Date(e*1e3+Math.floor(t/1e6));return r.nanoseconds=t%1e6,r}$e.fromSeconds=rv;function iv(e){return{seconds:Math.floor(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6+(e.nanoseconds??0)}}$e.toSeconds=iv;class ov{static decode(n){return xm(n)}static encode(n){return jm(n)}}$e.DateTime=ov;var ya={},Ss={},mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.createJsonRpcRequest=void 0;const Kl="123456789";function av(){return Kl[Math.floor(Math.random()*Kl.length)]}function sv(){return parseInt(Array.from({length:12}).map(()=>av()).join(""),10)}function dv(e,n){const t=n?{...n}:{};return{jsonrpc:"2.0",id:sv(),method:e,params:t}}mt.createJsonRpcRequest=dv;var ko={},ks={},Ps={},Rs={};Object.defineProperty(Rs,"__esModule",{value:!0});Rs.makeJsonRpcId=void 0;let uv=1e4;function cv(){return uv+=1}Rs.makeJsonRpcId=cv;var vs={},ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.jsonRpcCode=ft.isJsonRpcSuccessResponse=ft.isJsonRpcErrorResponse=void 0;function ey(e){return typeof e.error=="object"}ft.isJsonRpcErrorResponse=ey;function lv(e){return!ey(e)}ft.isJsonRpcSuccessResponse=lv;ft.jsonRpcCode={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:{default:-32e3}};Object.defineProperty(vs,"__esModule",{value:!0});vs.JsonRpcClient=void 0;const fv=ho,pv=ft;class mv{constructor(n){this.connection=n}async run(n){const t=this.connection.responseStream.filter(h=>h.id===n.id),r=(0,fv.firstEvent)(t);this.connection.sendRequest(n);const o=await r;if((0,pv.isJsonRpcErrorResponse)(o)){const h=o.error;throw new Error(`JSON RPC error: code=${h.code}; message='${h.message}'`)}return o}}vs.JsonRpcClient=mv;var Tn={},wt={};Object.defineProperty(wt,"__esModule",{value:!0});wt.isJsonCompatibleDictionary=wt.isJsonCompatibleArray=wt.isJsonCompatibleValue=void 0;function Mc(e){return!!(typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||ny(e)||ty(e))}wt.isJsonCompatibleValue=Mc;function ny(e){if(!Array.isArray(e))return!1;for(const n of e)if(!Mc(n))return!1;return!0}wt.isJsonCompatibleArray=ny;function ty(e){return typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]"?!1:Object.values(e).every(Mc)}wt.isJsonCompatibleDictionary=ty;Object.defineProperty(Tn,"__esModule",{value:!0});Tn.parseJsonRpcResponse=Tn.parseJsonRpcSuccessResponse=Tn.parseJsonRpcErrorResponse=Tn.parseJsonRpcRequest=Tn.parseJsonRpcId=void 0;const Et=wt;function ry(e){if(!(0,Et.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");const n=e.id;return typeof n!="number"&&typeof n!="string"?null:n}Tn.parseJsonRpcId=ry;function yv(e){if(!(0,Et.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");if(e.jsonrpc!=="2.0")throw new Error(`Got unexpected jsonrpc version: ${e.jsonrpc}`);const n=ry(e);if(n===null)throw new Error("Invalid id field");const t=e.method;if(typeof t!="string")throw new Error("Invalid method field");if(!(0,Et.isJsonCompatibleArray)(e.params)&&!(0,Et.isJsonCompatibleDictionary)(e.params))throw new Error("Invalid params field");return{jsonrpc:"2.0",id:n,method:t,params:e.params}}Tn.parseJsonRpcRequest=yv;function hv(e){if(typeof e.code!="number")throw new Error("Error property 'code' is not a number");if(typeof e.message!="string")throw new Error("Error property 'message' is not a string");let n;if(e.data===void 0)n=void 0;else if((0,Et.isJsonCompatibleValue)(e.data))n=e.data;else throw new Error("Error property 'data' is defined but not a JSON compatible value.");return{code:e.code,message:e.message,...n!==void 0?{data:n}:{}}}function iy(e){if(!(0,Et.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");if(e.jsonrpc!=="2.0")throw new Error(`Got unexpected jsonrpc version: ${JSON.stringify(e)}`);const n=e.id;if(typeof n!="number"&&typeof n!="string"&&n!==null)throw new Error("Invalid id field");if(typeof e.error>"u"||!(0,Et.isJsonCompatibleDictionary)(e.error))throw new Error("Invalid error field");return{jsonrpc:"2.0",id:n,error:hv(e.error)}}Tn.parseJsonRpcErrorResponse=iy;function oy(e){if(!(0,Et.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");if(e.jsonrpc!=="2.0")throw new Error(`Got unexpected jsonrpc version: ${JSON.stringify(e)}`);const n=e.id;if(typeof n!="number"&&typeof n!="string")throw new Error("Invalid id field");if(typeof e.result>"u")throw new Error("Invalid result field");const t=e.result;return{jsonrpc:"2.0",id:n,result:t}}Tn.parseJsonRpcSuccessResponse=oy;function gv(e){let n;try{n=iy(e)}catch{n=oy(e)}return n}Tn.parseJsonRpcResponse=gv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.jsonRpcCode=e.isJsonRpcSuccessResponse=e.isJsonRpcErrorResponse=e.parseJsonRpcSuccessResponse=e.parseJsonRpcResponse=e.parseJsonRpcRequest=e.parseJsonRpcId=e.parseJsonRpcErrorResponse=e.JsonRpcClient=e.makeJsonRpcId=void 0;var n=Rs;Object.defineProperty(e,"makeJsonRpcId",{enumerable:!0,get:function(){return n.makeJsonRpcId}});var t=vs;Object.defineProperty(e,"JsonRpcClient",{enumerable:!0,get:function(){return t.JsonRpcClient}});var r=Tn;Object.defineProperty(e,"parseJsonRpcErrorResponse",{enumerable:!0,get:function(){return r.parseJsonRpcErrorResponse}}),Object.defineProperty(e,"parseJsonRpcId",{enumerable:!0,get:function(){return r.parseJsonRpcId}}),Object.defineProperty(e,"parseJsonRpcRequest",{enumerable:!0,get:function(){return r.parseJsonRpcRequest}}),Object.defineProperty(e,"parseJsonRpcResponse",{enumerable:!0,get:function(){return r.parseJsonRpcResponse}}),Object.defineProperty(e,"parseJsonRpcSuccessResponse",{enumerable:!0,get:function(){return r.parseJsonRpcSuccessResponse}});var o=ft;Object.defineProperty(e,"isJsonRpcErrorResponse",{enumerable:!0,get:function(){return o.isJsonRpcErrorResponse}}),Object.defineProperty(e,"isJsonRpcSuccessResponse",{enumerable:!0,get:function(){return o.isJsonRpcSuccessResponse}}),Object.defineProperty(e,"jsonRpcCode",{enumerable:!0,get:function(){return o.jsonRpcCode}})})(Ps);var Po={};const Sv=Ah(mg);var kv=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Po,"__esModule",{value:!0});Po.http=void 0;const Pv=kv(Sv);function Rv(e){if(e.status>=400)throw new Error(`Bad status on response: ${e.status}`);return e}function vv(e){return e.toString().includes("emitExperimentalWarning")}async function Bv(e,n,t,r){if(typeof fetch=="function"&&!vv(fetch)){const o={method:e,body:r?JSON.stringify(r):void 0,headers:{"Content-Type":"application/json",...t}};return fetch(n,o).then(Rv).then(h=>h.json())}else return Pv.default.request({url:n,method:e,data:r,headers:t}).then(o=>o.data)}Po.http=Bv;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.hasProtocol=pt.instanceOfRpcStreamingClient=void 0;function bv(e){return typeof e.listen=="function"}pt.instanceOfRpcStreamingClient=bv;function Ov(e){return e.search("://")!==-1}pt.hasProtocol=Ov;Object.defineProperty(ks,"__esModule",{value:!0});ks.HttpBatchClient=void 0;const zl=Ps,Av=Po,Iv=pt,Yl={dispatchInterval:20,batchSizeLimit:20};class Tv{constructor(n,t={}){if(this.queue=[],this.options={batchSizeLimit:t.batchSizeLimit??Yl.batchSizeLimit,dispatchInterval:t.dispatchInterval??Yl.dispatchInterval},typeof n=="string"){if(!(0,Iv.hasProtocol)(n))throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");this.url=n}else this.url=n.url,this.headers=n.headers;this.timer=setInterval(()=>this.tick(),t.dispatchInterval),this.validate()}disconnect(){this.timer&&clearInterval(this.timer),this.timer=void 0}async execute(n){return new Promise((t,r)=>{this.queue.push({request:n,resolve:t,reject:r}),this.queue.length>=this.options.batchSizeLimit&&this.tick()})}validate(){if(!this.options.batchSizeLimit||!Number.isSafeInteger(this.options.batchSizeLimit)||this.options.batchSizeLimit<1)throw new Error("batchSizeLimit must be a safe integer >= 1")}tick(){const n=this.queue.splice(0,this.options.batchSizeLimit);if(!n.length)return;const t=n.map(o=>o.request),r=t.map(o=>o.id);(0,Av.http)("POST",this.url,this.headers,t).then(o=>{(Array.isArray(o)?o:[o]).forEach(v=>{const C=n.find(I=>I.request.id===v.id);if(!C)return;const{reject:w,resolve:D}=C,J=(0,zl.parseJsonRpcResponse)(v);(0,zl.isJsonRpcErrorResponse)(J)?w(new Error(JSON.stringify(J.error))):D(J)})},o=>{for(const h of r){const v=n.find(C=>C.request.id===h);if(!v)return;v.reject(o)}})}}ks.HttpBatchClient=Tv;var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0});Bs.HttpClient=void 0;const Zl=Ps,Cv=Po,Nv=pt;let wv=class{constructor(n){if(typeof n=="string"){if(!(0,Nv.hasProtocol)(n))throw new Error("Endpoint URL is missing a protocol. Expected 'https://' or 'http://'.");this.url=n}else this.url=n.url,this.headers=n.headers}disconnect(){}async execute(n){const t=(0,Zl.parseJsonRpcResponse)(await(0,Cv.http)("POST",this.url,this.headers,n));if((0,Zl.isJsonRpcErrorResponse)(t))throw new Error(JSON.stringify(t.error));return t}};Bs.HttpClient=wv;var bs={},ay={},qc={},Ro={},vo={},Ev=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vo,"__esModule",{value:!0});vo.SocketWrapper=void 0;const hr=Ev(Ih);function _v(){return typeof ue.process<"u"&&typeof ue.process.versions<"u"&&typeof ue.process.versions.node<"u"}class Uv{constructor(n,t,r,o,h,v=1e4){this.closed=!1,this.connected=new Promise((C,w)=>{this.connectedResolver=C,this.connectedRejecter=w}),this.url=n,this.messageHandler=t,this.errorHandler=r,this.openHandler=o,this.closeHandler=h,this.timeout=v}connect(){const n=new hr.default(this.url);n.onerror=r=>{this.clearTimeout(),this.errorHandler&&this.errorHandler(r)},n.onmessage=r=>{this.messageHandler({type:r.type,data:r.data})},n.onopen=r=>{this.clearTimeout(),this.connectedResolver(),this.openHandler&&this.openHandler()},n.onclose=r=>{this.closed=!0,this.closeHandler&&this.closeHandler(r)};const t=Date.now();this.timeoutId=setTimeout(()=>{n.onmessage=()=>0,n.onerror=()=>0,n.onopen=()=>0,n.onclose=()=>0,n.close(),this.socket=void 0;const r=Math.floor(Date.now()-t);this.connectedRejecter(`Connection attempt timed out after ${r} ms`)},this.timeout),this.socket=n}disconnect(){if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");switch(this.clearTimeout(),this.socket.readyState){case hr.default.OPEN:this.socket.close(1e3);break;case hr.default.CLOSED:break;case hr.default.CONNECTING:this.socket.onopen=()=>0,this.socket.onclose=()=>0,this.socket.onerror=()=>0,this.socket.onmessage=()=>0,this.socket=void 0,this.closeHandler&&this.closeHandler({wasClean:!1,code:4001});break;case hr.default.CLOSING:break;default:throw new Error(`Unknown readyState: ${this.socket.readyState}`)}}async send(n){return new Promise((t,r)=>{if(!this.socket)throw new Error("Socket undefined. This must be called after connecting.");if(this.closed)throw new Error("Socket was closed, so no data can be sent anymore.");if(this.socket.readyState!==hr.default.OPEN)throw new Error("Websocket is not open");_v()?this.socket.send(n,o=>o?r(o):t()):(this.socket.send(n),t())})}clearTimeout(){if(!this.timeoutId)throw new Error("Timeout ID not set. This should not happen and usually means connect() was not called.");clearTimeout(this.timeoutId)}}vo.SocketWrapper=Uv;Object.defineProperty(Ro,"__esModule",{value:!0});Ro.StreamingSocket=void 0;const Jv=ar,Dv=vo;class Mv{constructor(n,t=1e4){this.socket=new Dv.SocketWrapper(n,o=>{this.eventProducerListener&&this.eventProducerListener.next(o)},o=>{this.eventProducerListener&&this.eventProducerListener.error(o)},()=>{},o=>{this.eventProducerListener&&(o.wasClean?this.eventProducerListener.complete():this.eventProducerListener.error("Socket was closed unclean"))},t),this.connected=this.socket.connected;const r={start:o=>this.eventProducerListener=o,stop:()=>this.eventProducerListener=void 0};this.events=Jv.Stream.create(r)}connect(){this.socket.connect()}disconnect(){this.socket.disconnect()}async send(n){return this.socket.send(n)}}Ro.StreamingSocket=Mv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueueingStreamingSocket=e.ConnectionStatus=void 0;const n=ho,t=ar,r=Ro;var o;(function(v){v[v.Unconnected=0]="Unconnected",v[v.Connecting=1]="Connecting",v[v.Connected=2]="Connected",v[v.Disconnected=3]="Disconnected"})(o=e.ConnectionStatus||(e.ConnectionStatus={}));class h{constructor(C,w=1e4,D){this.queue=[],this.isProcessingQueue=!1,this.url=C,this.timeout=w,this.reconnectedHandler=D;const J={start:I=>this.eventProducerListener=I,stop:()=>this.eventProducerListener=void 0};this.events=t.Stream.create(J),this.connectionStatusProducer=new n.DefaultValueProducer(o.Unconnected),this.connectionStatus=new n.ValueAndUpdates(this.connectionStatusProducer),this.socket=new r.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:I=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(I)},error:()=>this.connectionStatusProducer.update(o.Disconnected)})}connect(){this.connectionStatusProducer.update(o.Connecting),this.socket.connected.then(async()=>(this.connectionStatusProducer.update(o.Connected),this.processQueue()),()=>this.connectionStatusProducer.update(o.Disconnected)),this.socket.connect()}disconnect(){this.connectionStatusProducer.update(o.Disconnected),this.socket.disconnect()}reconnect(){this.socket=new r.StreamingSocket(this.url,this.timeout),this.socket.events.subscribe({next:C=>{if(!this.eventProducerListener)throw new Error("No event producer listener set");this.eventProducerListener.next(C)},error:()=>this.connectionStatusProducer.update(o.Disconnected)}),this.socket.connected.then(()=>{this.reconnectedHandler&&this.reconnectedHandler()}),this.connect()}getQueueLength(){return this.queue.length}queueRequest(C){this.queue.push(C),this.processQueue()}async processQueue(){if(this.isProcessingQueue||this.connectionStatus.value!==o.Connected)return;this.isProcessingQueue=!0;let C;for(;C=this.queue.shift();)try{await this.socket.send(C),this.isProcessingQueue=!1}catch{this.queue.unshift(C),this.isProcessingQueue=!1;return}}}e.QueueingStreamingSocket=h})(qc);var Os={};Object.defineProperty(Os,"__esModule",{value:!0});Os.ReconnectingSocket=void 0;const qv=ar,uu=qc;class Hc{static calculateTimeout(n){return Math.min(2**n*100,5e3)}constructor(n,t=1e4,r){this.unconnected=!0,this.disconnected=!1,this.timeoutIndex=0,this.reconnectTimeout=null;const o={start:h=>this.eventProducerListener=h,stop:()=>this.eventProducerListener=void 0};this.events=qv.Stream.create(o),this.socket=new uu.QueueingStreamingSocket(n,t,r),this.socket.events.subscribe({next:h=>{this.eventProducerListener&&this.eventProducerListener.next(h)},error:h=>{this.eventProducerListener&&this.eventProducerListener.error(h)}}),this.connectionStatus=this.socket.connectionStatus,this.connectionStatus.updates.subscribe({next:h=>{h===uu.ConnectionStatus.Connected&&(this.timeoutIndex=0),h===uu.ConnectionStatus.Disconnected&&(this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.reconnectTimeout=setTimeout(()=>this.socket.reconnect(),Hc.calculateTimeout(this.timeoutIndex++)))}})}connect(){if(!this.unconnected)throw new Error("Cannot connect: socket has already connected");this.socket.connect(),this.unconnected=!1}disconnect(){if(this.unconnected)throw new Error("Cannot disconnect: socket has not yet connected");this.socket.disconnect(),this.eventProducerListener&&this.eventProducerListener.complete(),this.disconnected=!0}queueRequest(n){if(this.disconnected)throw new Error("Cannot queue request: socket has disconnected");this.socket.queueRequest(n)}}Os.ReconnectingSocket=Hc;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingSocket=e.SocketWrapper=e.ReconnectingSocket=e.QueueingStreamingSocket=e.ConnectionStatus=void 0;var n=qc;Object.defineProperty(e,"ConnectionStatus",{enumerable:!0,get:function(){return n.ConnectionStatus}}),Object.defineProperty(e,"QueueingStreamingSocket",{enumerable:!0,get:function(){return n.QueueingStreamingSocket}});var t=Os;Object.defineProperty(e,"ReconnectingSocket",{enumerable:!0,get:function(){return t.ReconnectingSocket}});var r=vo;Object.defineProperty(e,"SocketWrapper",{enumerable:!0,get:function(){return r.SocketWrapper}});var o=Ro;Object.defineProperty(e,"StreamingSocket",{enumerable:!0,get:function(){return o.StreamingSocket}})})(ay);Object.defineProperty(bs,"__esModule",{value:!0});bs.WebsocketClient=void 0;const ha=Ps,Xl=ay,Hv=ho,Vv=ar,Qv=pt;function Wv(e){throw e}function sy(e){if(e.type!=="message")throw new Error(`Unexcepted message type on websocket: ${e.type}`);return(0,ha.parseJsonRpcResponse)(JSON.parse(e.data))}class Fv{constructor(n,t){this.running=!1,this.subscriptions=[],this.request=n,this.socket=t}start(n){if(this.running)throw Error("Already started. Please stop first before restarting.");this.running=!0,this.connectToClient(n),this.socket.queueRequest(JSON.stringify(this.request))}stop(){this.running=!1;const n={...this.request,method:"unsubscribe"};try{this.socket.queueRequest(JSON.stringify(n))}catch(t){if(!(t instanceof Error&&t.message.match(/socket has disconnected/i)))throw t}}connectToClient(n){const t=this.socket.events.map(sy),r=t.filter(v=>v.id===this.request.id).subscribe({next:v=>{(0,ha.isJsonRpcErrorResponse)(v)&&(this.closeSubscriptions(),n.error(JSON.stringify(v.error))),r.unsubscribe()}}),o=t.filter(v=>v.id===this.request.id).subscribe({next:v=>{(0,ha.isJsonRpcErrorResponse)(v)?(this.closeSubscriptions(),n.error(JSON.stringify(v.error))):n.next(v.result)}}),h=t.subscribe({error:v=>{this.closeSubscriptions(),n.error(v)},complete:()=>{this.closeSubscriptions(),n.complete()}});this.subscriptions.push(r,o,h)}closeSubscriptions(){for(const n of this.subscriptions)n.unsubscribe();this.subscriptions=[]}}class Gv{constructor(n,t=Wv){if(this.subscriptionStreams=new Map,!(0,Qv.hasProtocol)(n))throw new Error("Base URL is missing a protocol. Expected 'ws://' or 'wss://'.");const r=n.endsWith("/")?"websocket":"/websocket";this.url=n+r,this.socket=new Xl.ReconnectingSocket(this.url);const o=this.socket.events.subscribe({error:h=>{t(h),o.unsubscribe()}});this.jsonRpcResponseStream=this.socket.events.map(sy),this.socket.connect()}async execute(n){const t=this.responseForRequestId(n.id);this.socket.queueRequest(JSON.stringify(n));const r=await t;if((0,ha.isJsonRpcErrorResponse)(r))throw new Error(JSON.stringify(r.error));return r}listen(n){if(n.method!=="subscribe")throw new Error('Request method must be "subscribe" to start event listening');const t=n.params.query;if(typeof t!="string")throw new Error("request.params.query must be a string");if(!this.subscriptionStreams.has(t)){const r=new Fv(n,this.socket),o=Vv.Stream.create(r);this.subscriptionStreams.set(t,o)}return this.subscriptionStreams.get(t).filter(r=>r.query!==void 0)}async connected(){await this.socket.connectionStatus.waitFor(Xl.ConnectionStatus.Connected)}disconnect(){this.socket.disconnect()}async responseForRequestId(n){return(0,Hv.firstEvent)(this.jsonRpcResponseStream.filter(t=>t.id===n))}}bs.WebsocketClient=Gv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebsocketClient=e.instanceOfRpcStreamingClient=e.HttpClient=e.HttpBatchClient=void 0;var n=ks;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return n.HttpBatchClient}});var t=Bs;Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return t.HttpClient}});var r=pt;Object.defineProperty(e,"instanceOfRpcStreamingClient",{enumerable:!0,get:function(){return r.instanceOfRpcStreamingClient}});var o=bs;Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return o.WebsocketClient}})})(ko);var dy={},As={},yn={},pe={};Object.defineProperty(pe,"__esModule",{value:!0});pe.encodeBlockId=pe.encodeVersion=pe.encodeBytes=pe.encodeTime=pe.encodeUvarint=pe.encodeString=pe.dictionaryToStringMap=pe.may=pe.assertNotEmpty=pe.assertObject=pe.assertArray=pe.assertNumber=pe.assertString=pe.assertBoolean=pe.assertSet=void 0;const Lv=de;function ur(e){if(e===void 0)throw new Error("Value must not be undefined");if(e===null)throw new Error("Value must not be null");return e}pe.assertSet=ur;function $v(e){if(ur(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}pe.assertBoolean=$v;function Kv(e){if(ur(e),typeof e!="string")throw new Error("Value must be a string");return e}pe.assertString=Kv;function zv(e){if(ur(e),typeof e!="number")throw new Error("Value must be a number");return e}pe.assertNumber=zv;function Yv(e){if(ur(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}pe.assertArray=Yv;function Zv(e){if(ur(e),typeof e!="object")throw new Error("Value must be an object");if(Object.prototype.toString.call(e)!=="[object Object]")throw new Error("Value must be a simple object");return e}pe.assertObject=Zv;function Xv(e){if(ur(e),typeof e=="number"&&e===0)throw new Error("must provide a non-zero value");if(e.length===0)throw new Error("must provide a non-empty value");return e}pe.assertNotEmpty=Xv;function xv(e,n){return n==null?void 0:e(n)}pe.may=xv;function jv(e){const n=new Map;for(const t of Object.keys(e)){const r=e[t];if(typeof r!="string")throw new Error("Found dictionary value of type other than string");n.set(t,r)}return n}pe.dictionaryToStringMap=jv;function eB(e){const n=(0,Lv.toUtf8)(e);return Uint8Array.from([n.length,...n])}pe.encodeString=eB;function fi(e){return e>=128?Uint8Array.from([e&255|128,...fi(e>>7)]):Uint8Array.from([e&255])}pe.encodeUvarint=fi;function nB(e){const n=e.getTime(),t=Math.floor(n/1e3),r=t?[8,...fi(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,h=o?[16,...fi(o)]:new Uint8Array;return Uint8Array.from([...r,...h])}pe.encodeTime=nB;function tB(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array}pe.encodeBytes=tB;function rB(e){const n=e.block?Uint8Array.from([8,...fi(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...fi(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}pe.encodeVersion=rB;function iB(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}pe.encodeBlockId=iB;Object.defineProperty(yn,"__esModule",{value:!0});yn.smallIntToApi=yn.apiToBigInt=yn.apiToSmallInt=void 0;const Zu=Te,oB=pe;function aB(e){return(typeof e=="number"?new Zu.Int53(e):Zu.Int53.fromString(e)).toNumber()}yn.apiToSmallInt=aB;function sB(e){if((0,oB.assertString)(e),!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return BigInt(e)}yn.apiToBigInt=sB;function dB(e){return new Zu.Int53(e).toString()}yn.smallIntToApi=dB;var ye={};Object.defineProperty(ye,"__esModule",{value:!0});ye.encodeBlockId=ye.encodeVersion=ye.encodeBytes=ye.encodeTime=ye.encodeUvarint=ye.encodeString=ye.dictionaryToStringMap=ye.may=ye.assertNotEmpty=ye.assertObject=ye.assertArray=ye.assertNumber=ye.assertString=ye.assertBoolean=ye.assertSet=void 0;const uB=de;function cr(e){if(e===void 0)throw new Error("Value must not be undefined");if(e===null)throw new Error("Value must not be null");return e}ye.assertSet=cr;function cB(e){if(cr(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}ye.assertBoolean=cB;function lB(e){if(cr(e),typeof e!="string")throw new Error("Value must be a string");return e}ye.assertString=lB;function fB(e){if(cr(e),typeof e!="number")throw new Error("Value must be a number");return e}ye.assertNumber=fB;function pB(e){if(cr(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}ye.assertArray=pB;function mB(e){if(cr(e),typeof e!="object")throw new Error("Value must be an object");if(Object.prototype.toString.call(e)!=="[object Object]")throw new Error("Value must be a simple object");return e}ye.assertObject=mB;function yB(e){if(cr(e),typeof e=="number"&&e===0)throw new Error("must provide a non-zero value");if(e.length===0)throw new Error("must provide a non-empty value");return e}ye.assertNotEmpty=yB;function hB(e,n){return n==null?void 0:e(n)}ye.may=hB;function gB(e){const n=new Map;for(const t of Object.keys(e)){const r=e[t];if(typeof r!="string")throw new Error("Found dictionary value of type other than string");n.set(t,r)}return n}ye.dictionaryToStringMap=gB;function SB(e){const n=(0,uB.toUtf8)(e);return Uint8Array.from([n.length,...n])}ye.encodeString=SB;function pi(e){return e>=128?Uint8Array.from([e&255|128,...pi(e>>7)]):Uint8Array.from([e&255])}ye.encodeUvarint=pi;function kB(e){const n=e.getTime(),t=Math.floor(n/1e3),r=t?[8,...pi(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,h=o?[16,...pi(o)]:new Uint8Array;return Uint8Array.from([...r,...h])}ye.encodeTime=kB;function PB(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array}ye.encodeBytes=PB;function RB(e){const n=e.block?Uint8Array.from([8,...pi(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...pi(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}ye.encodeVersion=RB;function vB(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}ye.encodeBlockId=vB;var Is={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(t){t.AbciInfo="abci_info",t.AbciQuery="abci_query",t.Block="block",t.Blockchain="blockchain",t.BlockResults="block_results",t.BlockSearch="block_search",t.BroadcastTxAsync="broadcast_tx_async",t.BroadcastTxSync="broadcast_tx_sync",t.BroadcastTxCommit="broadcast_tx_commit",t.Commit="commit",t.Genesis="genesis",t.Health="health",t.NumUnconfirmedTxs="num_unconfirmed_txs",t.Status="status",t.Subscribe="subscribe",t.Tx="tx",t.TxSearch="tx_search",t.Validators="validators",t.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(t){t.NewBlock="NewBlock",t.NewBlockHeader="NewBlockHeader",t.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function n(t){const o=(t.tags?t.tags:[]).map(v=>`${v.key}='${v.value}'`),h=t.raw?[t.raw]:[];return[...o,...h].join(" AND ")}e.buildQuery=n})(Is);var BB=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),bB=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),OB=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&BB(n,e,t);return bB(n,e),n};Object.defineProperty(As,"__esModule",{value:!0});As.Params=void 0;const Vc=de,Gn=yn,qe=mt,an=ye,AB=OB(Is);function cu(e){return{height:(0,an.may)(Gn.smallIntToApi,e.height)}}function IB(e){return{minHeight:(0,an.may)(Gn.smallIntToApi,e.minHeight),maxHeight:(0,an.may)(Gn.smallIntToApi,e.maxHeight)}}function TB(e){return{query:e.query,page:(0,an.may)(Gn.smallIntToApi,e.page),per_page:(0,an.may)(Gn.smallIntToApi,e.per_page),order_by:e.order_by}}function CB(e){return{path:(0,an.assertNotEmpty)(e.path),data:(0,Vc.toHex)(e.data),height:(0,an.may)(Gn.smallIntToApi,e.height),prove:e.prove}}function NB(e){return{tx:(0,Vc.toBase64)((0,an.assertNotEmpty)(e.tx))}}function wB(e){return{hash:(0,Vc.toBase64)((0,an.assertNotEmpty)(e.hash)),prove:e.prove}}function EB(e){return{query:e.query,prove:e.prove,page:(0,an.may)(Gn.smallIntToApi,e.page),per_page:(0,an.may)(Gn.smallIntToApi,e.per_page),order_by:e.order_by}}function _B(e){return{height:(0,an.may)(Gn.smallIntToApi,e.height),page:(0,an.may)(Gn.smallIntToApi,e.page),per_page:(0,an.may)(Gn.smallIntToApi,e.per_page)}}let UB=class{static encodeAbciInfo(n){return(0,qe.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,qe.createJsonRpcRequest)(n.method,CB(n.params))}static encodeBlock(n){return(0,qe.createJsonRpcRequest)(n.method,cu(n.params))}static encodeBlockchain(n){return(0,qe.createJsonRpcRequest)(n.method,IB(n.params))}static encodeBlockResults(n){return(0,qe.createJsonRpcRequest)(n.method,cu(n.params))}static encodeBlockSearch(n){return(0,qe.createJsonRpcRequest)(n.method,TB(n.params))}static encodeBroadcastTx(n){return(0,qe.createJsonRpcRequest)(n.method,NB(n.params))}static encodeCommit(n){return(0,qe.createJsonRpcRequest)(n.method,cu(n.params))}static encodeGenesis(n){return(0,qe.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,qe.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,qe.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,qe.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},r=AB.buildQuery({tags:[t],raw:n.query.raw});return(0,qe.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(n){return(0,qe.createJsonRpcRequest)(n.method,wB(n.params))}static encodeTxSearch(n){return(0,qe.createJsonRpcRequest)(n.method,EB(n.params))}static encodeValidators(n){return(0,qe.createJsonRpcRequest)(n.method,_B(n.params))}};As.Params=UB;var Cn={},Bo={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.BlockIdFlag=void 0,function(n){n[n.Unknown=0]="Unknown",n[n.Absent=1]="Absent",n[n.Commit=2]="Commit",n[n.Nil=3]="Nil",n[n.Unrecognized=-1]="Unrecognized"}(e.BlockIdFlag||(e.BlockIdFlag={}))})(Bo);var mi={};Object.defineProperty(mi,"__esModule",{value:!0});mi.hashBlock=mi.hashTx=void 0;const Qc=Ge,Ye=ye;function JB(e){return(0,Qc.sha256)(e)}mi.hashTx=JB;function DB(e){if(e<1)throw new Error("Cannot split an empty tree");const n=2**Math.floor(Math.log2(e));return n<e?n:n/2}function MB(e){const n=new Qc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function qB(e,n){const t=new Qc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function Xu(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return MB(e[0]);default:{const n=DB(e.length),t=Xu(e.slice(0,n)),r=Xu(e.slice(n));return qB(t,r)}}}function HB(e){if(!e.lastBlockId)throw new Error("Hashing a block header with no last block ID (i.e. header at height 1) is not supported. If you need this, contributions are welcome. Please add documentation and test vectors for this case.");const n=[(0,Ye.encodeVersion)(e.version),(0,Ye.encodeString)(e.chainId),(0,Ye.encodeUvarint)(e.height),(0,Ye.encodeTime)(e.time),(0,Ye.encodeBlockId)(e.lastBlockId),(0,Ye.encodeBytes)(e.lastCommitHash),(0,Ye.encodeBytes)(e.dataHash),(0,Ye.encodeBytes)(e.validatorsHash),(0,Ye.encodeBytes)(e.nextValidatorsHash),(0,Ye.encodeBytes)(e.consensusHash),(0,Ye.encodeBytes)(e.appHash),(0,Ye.encodeBytes)(e.lastResultsHash),(0,Ye.encodeBytes)(e.evidenceHash),(0,Ye.encodeBytes)(e.proposerAddress)];return Xu(n)}mi.hashBlock=HB;Object.defineProperty(Cn,"__esModule",{value:!0});Cn.Responses=Cn.decodeValidatorInfo=Cn.decodeValidatorGenesis=Cn.decodeValidatorUpdate=Cn.decodeEvent=void 0;const ae=de,uy=Oe,oo=$e,re=yn,VB=Bo,Z=ye,QB=mi;function WB(e){return{data:e.data,lastBlockHeight:(0,Z.may)(re.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,Z.may)(ae.fromBase64,e.last_block_app_hash)}}function FB(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,ae.fromBase64)(n.key),data:(0,ae.fromBase64)(n.data)}))}}function GB(e){return{key:(0,ae.fromBase64)((0,Z.assertString)(e.key??"")),value:(0,ae.fromBase64)((0,Z.assertString)(e.value??"")),proof:(0,Z.may)(FB,e.proofOps),height:(0,Z.may)(re.apiToSmallInt,e.height),code:(0,Z.may)(re.apiToSmallInt,e.code),codespace:(0,Z.assertString)(e.codespace??""),index:(0,Z.may)(re.apiToSmallInt,e.index),log:e.log,info:(0,Z.assertString)(e.info??"")}}function LB(e){return{key:(0,Z.assertNotEmpty)(e.key),value:e.value??""}}function $B(e){return(0,Z.assertArray)(e).map(LB)}function cy(e){return{type:e.type,attributes:e.attributes?$B(e.attributes):[]}}Cn.decodeEvent=cy;function xu(e){return(0,Z.assertArray)(e).map(cy)}function yi(e){return{code:(0,re.apiToSmallInt)((0,Z.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,Z.may)(ae.fromBase64,e.data),events:e.events?xu(e.events):[],gasWanted:(0,re.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,re.apiToBigInt)(e.gas_used??"0")}}function Wc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,uy.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,ae.fromBase64)((0,Z.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,ae.fromBase64)((0,Z.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,ae.fromBase64)((0,Z.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function KB(e){return{maxBytes:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_bytes)),maxGas:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_gas))}}function zB(e){return{maxAgeNumBlocks:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_age_duration))}}function ly(e){return{block:KB((0,Z.assertObject)(e.block)),evidence:zB((0,Z.assertObject)(e.evidence))}}function fy(e){return{pubkey:Wc((0,Z.assertObject)(e.pub_key)),votingPower:(0,re.apiToBigInt)(e.power??"0")}}Cn.decodeValidatorUpdate=fy;function YB(e){return{height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(yi),validatorUpdates:(e.validator_updates||[]).map(fy),consensusUpdates:(0,Z.may)(ly,e.consensus_param_updates),beginBlockEvents:xu(e.begin_block_events||[]),endBlockEvents:xu(e.end_block_events||[])}}function Ts(e){return{hash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.hash)),parts:{total:(0,Z.assertNotEmpty)(e.parts.total),hash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.parts.hash))}}}function ZB(e){return{block:(0,re.apiToSmallInt)(e.block),app:(0,re.apiToSmallInt)(e.app??0)}}function Cs(e){return{version:ZB(e.version),chainId:(0,Z.assertNotEmpty)(e.chain_id),height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),time:(0,oo.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?Ts(e.last_block_id):null,lastCommitHash:(0,ae.fromHex)((0,Z.assertSet)(e.last_commit_hash)),dataHash:(0,ae.fromHex)((0,Z.assertSet)(e.data_hash)),validatorsHash:(0,ae.fromHex)((0,Z.assertSet)(e.validators_hash)),nextValidatorsHash:(0,ae.fromHex)((0,Z.assertSet)(e.next_validators_hash)),consensusHash:(0,ae.fromHex)((0,Z.assertSet)(e.consensus_hash)),appHash:(0,ae.fromHex)((0,Z.assertSet)(e.app_hash)),lastResultsHash:(0,ae.fromHex)((0,Z.assertSet)(e.last_results_hash)),evidenceHash:(0,ae.fromHex)((0,Z.assertSet)(e.evidence_hash)),proposerAddress:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.proposer_address))}}function XB(e){return{blockId:Ts(e.block_id),blockSize:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.block_size)),header:Cs(e.header),numTxs:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.num_txs))}}function xB(e){return{lastHeight:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.last_height)),blockMetas:(0,Z.assertArray)(e.block_metas).map(XB)}}function jB(e){return{...yi(e),hash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.hash))}}function eb(e){const n=e.tx_result?yi(e.tx_result):void 0;return{height:(0,re.apiToSmallInt)(e.height),hash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.hash)),checkTx:yi((0,Z.assertObject)(e.check_tx)),deliverTx:n,txResult:n}}function nb(e){return(0,uy.assert)(e in VB.BlockIdFlag),e}function tb(e){return{blockIdFlag:nb(e.block_id_flag),validatorAddress:e.validator_address?(0,ae.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,oo.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,ae.fromBase64)(e.signature):void 0}}function py(e){return{blockId:Ts((0,Z.assertObject)(e.block_id)),height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),round:(0,re.apiToSmallInt)(e.round),signatures:(0,Z.assertArray)(e.signatures).map(tb)}}function rb(e){return{canonical:(0,Z.assertBoolean)(e.canonical),header:Cs(e.signed_header.header),commit:py(e.signed_header.commit)}}function my(e){return{address:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.address)),pubkey:Wc((0,Z.assertObject)(e.pub_key)),votingPower:(0,re.apiToBigInt)((0,Z.assertNotEmpty)(e.power))}}Cn.decodeValidatorGenesis=my;function ib(e){return{genesisTime:(0,oo.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.genesis_time)),chainId:(0,Z.assertNotEmpty)(e.chain_id),consensusParams:ly(e.consensus_params),validators:e.validators?(0,Z.assertArray)(e.validators).map(my):[],appHash:(0,ae.fromHex)((0,Z.assertSet)(e.app_hash)),appState:e.app_state}}function Fc(e){return{pubkey:Wc((0,Z.assertObject)(e.pub_key)),votingPower:(0,re.apiToBigInt)((0,Z.assertNotEmpty)(e.voting_power)),address:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,re.apiToSmallInt)(e.proposer_priority):void 0}}Cn.decodeValidatorInfo=Fc;function ob(e){return{id:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.id)),listenAddr:(0,Z.assertNotEmpty)(e.listen_addr),network:(0,Z.assertNotEmpty)(e.network),version:(0,Z.assertString)(e.version),channels:(0,Z.assertNotEmpty)(e.channels),moniker:(0,Z.assertNotEmpty)(e.moniker),other:(0,Z.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.protocol_version.app)),block:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.protocol_version.block)),p2p:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.protocol_version.p2p))}}}function ab(e){const n=e.earliest_block_height?(0,re.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,oo.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,ae.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,ae.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,oo.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,Z.assertBoolean)(e.catching_up)}}function sb(e){return{nodeInfo:ob(e.node_info),syncInfo:ab(e.sync_info),validatorInfo:Fc(e.validator_info)}}function db(e){return{data:(0,ae.fromBase64)((0,Z.assertNotEmpty)(e.data)),rootHash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.root_hash)),proof:{total:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.proof.total)),index:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.proof.index)),leafHash:(0,ae.fromBase64)((0,Z.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,Z.assertArray)(e.proof.aunts).map(ae.fromBase64)}}}function yy(e){return{tx:(0,ae.fromBase64)((0,Z.assertNotEmpty)(e.tx)),result:yi((0,Z.assertObject)(e.tx_result)),height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),index:(0,re.apiToSmallInt)((0,Z.assertNumber)(e.index)),hash:(0,ae.fromHex)((0,Z.assertNotEmpty)(e.hash)),proof:(0,Z.may)(db,e.proof)}}function ub(e){return{totalCount:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_count)),txs:(0,Z.assertArray)(e.txs).map(yy)}}function cb(e){const n=(0,ae.fromBase64)((0,Z.assertNotEmpty)(e.tx));return{tx:n,hash:(0,QB.hashTx)(n),result:yi(e.result),height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height))}}function lb(e){return{blockHeight:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.block_height)),validators:(0,Z.assertArray)(e.validators).map(Fc),count:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.count)),total:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total))}}function hy(e){var n;return{header:Cs((0,Z.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?py((0,Z.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,Z.assertArray)(e.data.txs).map(ae.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function gy(e){return{blockId:Ts(e.block_id),block:hy(e.block)}}function fb(e){return{totalCount:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_count)),blocks:(0,Z.assertArray)(e.blocks).map(gy)}}function pb(e){return{total:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total)),totalBytes:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_bytes))}}let mb=class Sy{static decodeAbciInfo(n){return WB((0,Z.assertObject)(n.result.response))}static decodeAbciQuery(n){return GB((0,Z.assertObject)(n.result.response))}static decodeBlock(n){return gy(n.result)}static decodeBlockResults(n){return YB(n.result)}static decodeBlockSearch(n){return fb(n.result)}static decodeBlockchain(n){return xB(n.result)}static decodeBroadcastTxSync(n){return jB(n.result)}static decodeBroadcastTxAsync(n){return Sy.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return eb(n.result)}static decodeCommit(n){return rb(n.result)}static decodeGenesis(n){return ib((0,Z.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return pb(n.result)}static decodeStatus(n){return sb(n.result)}static decodeNewBlockEvent(n){return hy(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return Cs(n.data.value.header)}static decodeTxEvent(n){return cb(n.data.value.TxResult)}static decodeTx(n){return yy(n.result)}static decodeTxSearch(n){return ub(n.result)}static decodeValidators(n){return lb(n.result)}};Cn.Responses=mb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=As;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=Cn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(dy);var yb=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),hb=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),gb=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&yb(n,e,t);return hb(n,e),n};Object.defineProperty(Ss,"__esModule",{value:!0});Ss.Comet38Client=void 0;const Sb=mt,Fo=ko,ce=dy,ge=gb(Is);class ga{static async connect(n){let t;return typeof n=="object"?t=new Fo.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new Fo.HttpClient(n):new Fo.WebsocketClient(n),await this.detectVersion(t),ga.create(t)}static async create(n){return new ga(n)}static async detectVersion(n){const t=(0,Sb.createJsonRpcRequest)(ge.Method.Status),o=(await n.execute(t)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const h=o.node_info.version;if(typeof h!="string")throw new Error("Unrecognized version format: must be string");return h}constructor(n){this.client=n}disconnect(){this.client.disconnect()}async abciInfo(){const n={method:ge.Method.AbciInfo};return this.doCall(n,ce.Params.encodeAbciInfo,ce.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:ge.Method.AbciQuery};return this.doCall(t,ce.Params.encodeAbciQuery,ce.Responses.decodeAbciQuery)}async block(n){const t={method:ge.Method.Block,params:{height:n}};return this.doCall(t,ce.Params.encodeBlock,ce.Responses.decodeBlock)}async blockResults(n){const t={method:ge.Method.BlockResults,params:{height:n}};return this.doCall(t,ce.Params.encodeBlockResults,ce.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:ge.Method.BlockSearch},r=await this.doCall(t,ce.Params.encodeBlockSearch,ce.Responses.decodeBlockSearch);return{...r,blocks:[...r.blocks].sort((o,h)=>o.block.header.height-h.block.header.height)}}async blockSearchAll(n){let t=n.page||1;const r=[];let o=!1;for(;!o;){const h=await this.blockSearch({...n,page:t});r.push(...h.blocks),r.length<h.totalCount?t++:o=!0}return r.sort((h,v)=>h.block.header.height-v.block.header.height),{totalCount:r.length,blocks:r}}async blockchain(n,t){const r={method:ge.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(r,ce.Params.encodeBlockchain,ce.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:ge.Method.BroadcastTxSync};return this.doCall(t,ce.Params.encodeBroadcastTx,ce.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:ge.Method.BroadcastTxAsync};return this.doCall(t,ce.Params.encodeBroadcastTx,ce.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:ge.Method.BroadcastTxCommit};return this.doCall(t,ce.Params.encodeBroadcastTx,ce.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:ge.Method.Commit,params:{height:n}};return this.doCall(t,ce.Params.encodeCommit,ce.Responses.decodeCommit)}async genesis(){const n={method:ge.Method.Genesis};return this.doCall(n,ce.Params.encodeGenesis,ce.Responses.decodeGenesis)}async health(){const n={method:ge.Method.Health};return this.doCall(n,ce.Params.encodeHealth,ce.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:ge.Method.NumUnconfirmedTxs};return this.doCall(n,ce.Params.encodeNumUnconfirmedTxs,ce.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:ge.Method.Status};return this.doCall(n,ce.Params.encodeStatus,ce.Responses.decodeStatus)}subscribeNewBlock(){const n={method:ge.Method.Subscribe,query:{type:ge.SubscriptionEventType.NewBlock}};return this.subscribe(n,ce.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:ge.Method.Subscribe,query:{type:ge.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,ce.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:ge.Method.Subscribe,query:{type:ge.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,ce.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:ge.Method.Tx};return this.doCall(t,ce.Params.encodeTx,ce.Responses.decodeTx)}async txSearch(n){const t={params:n,method:ge.Method.TxSearch};return this.doCall(t,ce.Params.encodeTxSearch,ce.Responses.decodeTxSearch)}async txSearchAll(n){let t=n.page||1;const r=[];let o=!1;for(;!o;){const h=await this.txSearch({...n,page:t});r.push(...h.txs),r.length<h.totalCount?t++:o=!0}return{totalCount:r.length,txs:r}}async validators(n){const t={method:ge.Method.Validators,params:n};return this.doCall(t,ce.Params.encodeValidators,ce.Responses.decodeValidators)}async validatorsAll(n){const t=[];let r=1,o=!1,h=n;for(;!o;){const v=await this.validators({per_page:50,height:h,page:r});t.push(...v.validators),h=h||v.blockHeight,t.length<v.total?r++:o=!0}return{blockHeight:h??0,count:t.length,total:t.length,validators:t}}async doCall(n,t,r){const o=t(n),h=await this.client.execute(o);return r(h)}subscribe(n,t){if(!(0,Fo.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=ce.Params.encodeSubscribe(n);return this.client.listen(r).map(h=>t(h))}}Ss.Comet38Client=ga;var ky={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function n(r){return r.code===0}e.broadcastTxSyncSuccess=n;function t(r){return r.checkTx.code===0&&!!r.deliverTx&&r.deliverTx.code===0}e.broadcastTxCommitSuccess=t,function(r){r[r.PreVote=1]="PreVote",r[r.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(ky);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=e.Comet38Client=void 0;var n=Ss;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return n.Comet38Client}});var t=Is;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return t.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return t.SubscriptionEventType}});var r=ky;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return r.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return r.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return r.VoteType}})})(ya);var Zi={},Ns={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(t){t.AbciInfo="abci_info",t.AbciQuery="abci_query",t.Block="block",t.Blockchain="blockchain",t.BlockResults="block_results",t.BlockSearch="block_search",t.BroadcastTxAsync="broadcast_tx_async",t.BroadcastTxSync="broadcast_tx_sync",t.BroadcastTxCommit="broadcast_tx_commit",t.Commit="commit",t.Genesis="genesis",t.Health="health",t.NumUnconfirmedTxs="num_unconfirmed_txs",t.Status="status",t.Subscribe="subscribe",t.Tx="tx",t.TxSearch="tx_search",t.Validators="validators",t.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(t){t.NewBlock="NewBlock",t.NewBlockHeader="NewBlockHeader",t.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function n(t){const o=(t.tags?t.tags:[]).map(v=>`${v.key}='${v.value}'`),h=t.raw?[t.raw]:[];return[...o,...h].join(" AND ")}e.buildQuery=n})(Ns);var Py={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function n(r){return r.code===0}e.broadcastTxSyncSuccess=n;function t(r){return r.checkTx.code===0&&!!r.deliverTx&&r.deliverTx.code===0}e.broadcastTxCommitSuccess=t,function(r){r[r.PreVote=1]="PreVote",r[r.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(Py);var ws={},Ry={},Es={},kb=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),Pb=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Rb=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&kb(n,e,t);return Pb(n,e),n};Object.defineProperty(Es,"__esModule",{value:!0});Es.Params=void 0;const Gc=de,Ln=yn,He=mt,sn=pe,vb=Rb(Ns);function lu(e){return{height:(0,sn.may)(Ln.smallIntToApi,e.height)}}function Bb(e){return{minHeight:(0,sn.may)(Ln.smallIntToApi,e.minHeight),maxHeight:(0,sn.may)(Ln.smallIntToApi,e.maxHeight)}}function bb(e){return{query:e.query,page:(0,sn.may)(Ln.smallIntToApi,e.page),per_page:(0,sn.may)(Ln.smallIntToApi,e.per_page),order_by:e.order_by}}function Ob(e){return{path:(0,sn.assertNotEmpty)(e.path),data:(0,Gc.toHex)(e.data),height:(0,sn.may)(Ln.smallIntToApi,e.height),prove:e.prove}}function Ab(e){return{tx:(0,Gc.toBase64)((0,sn.assertNotEmpty)(e.tx))}}function Ib(e){return{hash:(0,Gc.toBase64)((0,sn.assertNotEmpty)(e.hash)),prove:e.prove}}function Tb(e){return{query:e.query,prove:e.prove,page:(0,sn.may)(Ln.smallIntToApi,e.page),per_page:(0,sn.may)(Ln.smallIntToApi,e.per_page),order_by:e.order_by}}function Cb(e){return{height:(0,sn.may)(Ln.smallIntToApi,e.height),page:(0,sn.may)(Ln.smallIntToApi,e.page),per_page:(0,sn.may)(Ln.smallIntToApi,e.per_page)}}let Nb=class{static encodeAbciInfo(n){return(0,He.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,He.createJsonRpcRequest)(n.method,Ob(n.params))}static encodeBlock(n){return(0,He.createJsonRpcRequest)(n.method,lu(n.params))}static encodeBlockchain(n){return(0,He.createJsonRpcRequest)(n.method,Bb(n.params))}static encodeBlockResults(n){return(0,He.createJsonRpcRequest)(n.method,lu(n.params))}static encodeBlockSearch(n){return(0,He.createJsonRpcRequest)(n.method,bb(n.params))}static encodeBroadcastTx(n){return(0,He.createJsonRpcRequest)(n.method,Ab(n.params))}static encodeCommit(n){return(0,He.createJsonRpcRequest)(n.method,lu(n.params))}static encodeGenesis(n){return(0,He.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,He.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,He.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,He.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},r=vb.buildQuery({tags:[t],raw:n.query.raw});return(0,He.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(n){return(0,He.createJsonRpcRequest)(n.method,Ib(n.params))}static encodeTxSearch(n){return(0,He.createJsonRpcRequest)(n.method,Tb(n.params))}static encodeValidators(n){return(0,He.createJsonRpcRequest)(n.method,Cb(n.params))}};Es.Params=Nb;var Nn={},hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.hashBlock=hi.hashTx=void 0;const Lc=Ge,Ze=pe;function wb(e){return(0,Lc.sha256)(e)}hi.hashTx=wb;function Eb(e){if(e<1)throw new Error("Cannot split an empty tree");const n=2**Math.floor(Math.log2(e));return n<e?n:n/2}function _b(e){const n=new Lc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function Ub(e,n){const t=new Lc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function ju(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return _b(e[0]);default:{const n=Eb(e.length),t=ju(e.slice(0,n)),r=ju(e.slice(n));return Ub(t,r)}}}function Jb(e){if(!e.lastBlockId)throw new Error("Hashing a block header with no last block ID (i.e. header at height 1) is not supported. If you need this, contributions are welcome. Please add documentation and test vectors for this case.");const n=[(0,Ze.encodeVersion)(e.version),(0,Ze.encodeString)(e.chainId),(0,Ze.encodeUvarint)(e.height),(0,Ze.encodeTime)(e.time),(0,Ze.encodeBlockId)(e.lastBlockId),(0,Ze.encodeBytes)(e.lastCommitHash),(0,Ze.encodeBytes)(e.dataHash),(0,Ze.encodeBytes)(e.validatorsHash),(0,Ze.encodeBytes)(e.nextValidatorsHash),(0,Ze.encodeBytes)(e.consensusHash),(0,Ze.encodeBytes)(e.appHash),(0,Ze.encodeBytes)(e.lastResultsHash),(0,Ze.encodeBytes)(e.evidenceHash),(0,Ze.encodeBytes)(e.proposerAddress)];return ju(n)}hi.hashBlock=Jb;Object.defineProperty(Nn,"__esModule",{value:!0});Nn.Responses=Nn.decodeValidatorInfo=Nn.decodeValidatorGenesis=Nn.decodeValidatorUpdate=Nn.decodeEvent=void 0;const te=de,vy=Oe,ao=$e,ie=yn,Db=Bo,z=pe,Mb=hi;function qb(e){return{data:e.data,lastBlockHeight:(0,z.may)(ie.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,z.may)(te.fromBase64,e.last_block_app_hash)}}function Hb(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,te.fromBase64)(n.key),data:(0,te.fromBase64)(n.data)}))}}function Vb(e){return{key:(0,te.fromBase64)((0,z.assertString)(e.key??"")),value:(0,te.fromBase64)((0,z.assertString)(e.value??"")),proof:(0,z.may)(Hb,e.proofOps),height:(0,z.may)(ie.apiToSmallInt,e.height),code:(0,z.may)(ie.apiToSmallInt,e.code),codespace:(0,z.assertString)(e.codespace??""),index:(0,z.may)(ie.apiToSmallInt,e.index),log:e.log,info:(0,z.assertString)(e.info??"")}}function Qb(e){return{key:(0,te.fromBase64)((0,z.assertNotEmpty)(e.key)),value:(0,te.fromBase64)((0,z.assertString)(e.value??""))}}function Wb(e){return(0,z.assertArray)(e).map(Qb)}function By(e){return{type:e.type,attributes:e.attributes?Wb(e.attributes):[]}}Nn.decodeEvent=By;function ec(e){return(0,z.assertArray)(e).map(By)}function gi(e){return{code:(0,ie.apiToSmallInt)((0,z.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,z.may)(te.fromBase64,e.data),events:e.events?ec(e.events):[],gasWanted:(0,ie.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,ie.apiToBigInt)(e.gas_used??"0")}}function $c(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,vy.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,te.fromBase64)((0,z.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,te.fromBase64)((0,z.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,te.fromBase64)((0,z.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function Fb(e){return{maxBytes:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.max_bytes)),maxGas:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.max_gas))}}function Gb(e){return{maxAgeNumBlocks:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.max_age_duration))}}function by(e){return{block:Fb((0,z.assertObject)(e.block)),evidence:Gb((0,z.assertObject)(e.evidence))}}function Oy(e){return{pubkey:$c((0,z.assertObject)(e.pub_key)),votingPower:(0,ie.apiToBigInt)(e.power??"0")}}Nn.decodeValidatorUpdate=Oy;function Lb(e){return{height:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(gi),validatorUpdates:(e.validator_updates||[]).map(Oy),consensusUpdates:(0,z.may)(by,e.consensus_param_updates),beginBlockEvents:ec(e.begin_block_events||[]),endBlockEvents:ec(e.end_block_events||[])}}function _s(e){return{hash:(0,te.fromHex)((0,z.assertNotEmpty)(e.hash)),parts:{total:(0,z.assertNotEmpty)(e.parts.total),hash:(0,te.fromHex)((0,z.assertNotEmpty)(e.parts.hash))}}}function $b(e){return{block:(0,ie.apiToSmallInt)(e.block),app:(0,ie.apiToSmallInt)(e.app??0)}}function Us(e){return{version:$b(e.version),chainId:(0,z.assertNotEmpty)(e.chain_id),height:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.height)),time:(0,ao.fromRfc3339WithNanoseconds)((0,z.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?_s(e.last_block_id):null,lastCommitHash:(0,te.fromHex)((0,z.assertSet)(e.last_commit_hash)),dataHash:(0,te.fromHex)((0,z.assertSet)(e.data_hash)),validatorsHash:(0,te.fromHex)((0,z.assertSet)(e.validators_hash)),nextValidatorsHash:(0,te.fromHex)((0,z.assertSet)(e.next_validators_hash)),consensusHash:(0,te.fromHex)((0,z.assertSet)(e.consensus_hash)),appHash:(0,te.fromHex)((0,z.assertSet)(e.app_hash)),lastResultsHash:(0,te.fromHex)((0,z.assertSet)(e.last_results_hash)),evidenceHash:(0,te.fromHex)((0,z.assertSet)(e.evidence_hash)),proposerAddress:(0,te.fromHex)((0,z.assertNotEmpty)(e.proposer_address))}}function Kb(e){return{blockId:_s(e.block_id),blockSize:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.block_size)),header:Us(e.header),numTxs:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.num_txs))}}function zb(e){return{lastHeight:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.last_height)),blockMetas:(0,z.assertArray)(e.block_metas).map(Kb)}}function Yb(e){return{...gi(e),hash:(0,te.fromHex)((0,z.assertNotEmpty)(e.hash))}}function Zb(e){return{height:(0,ie.apiToSmallInt)(e.height),hash:(0,te.fromHex)((0,z.assertNotEmpty)(e.hash)),checkTx:gi((0,z.assertObject)(e.check_tx)),deliverTx:(0,z.may)(gi,e.deliver_tx)}}function Xb(e){return(0,vy.assert)(e in Db.BlockIdFlag),e}function xb(e){return{blockIdFlag:Xb(e.block_id_flag),validatorAddress:e.validator_address?(0,te.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,ao.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,te.fromBase64)(e.signature):void 0}}function Ay(e){return{blockId:_s((0,z.assertObject)(e.block_id)),height:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.height)),round:(0,ie.apiToSmallInt)(e.round),signatures:(0,z.assertArray)(e.signatures).map(xb)}}function jb(e){return{canonical:(0,z.assertBoolean)(e.canonical),header:Us(e.signed_header.header),commit:Ay(e.signed_header.commit)}}function Iy(e){return{address:(0,te.fromHex)((0,z.assertNotEmpty)(e.address)),pubkey:$c((0,z.assertObject)(e.pub_key)),votingPower:(0,ie.apiToBigInt)((0,z.assertNotEmpty)(e.power))}}Nn.decodeValidatorGenesis=Iy;function eO(e){return{genesisTime:(0,ao.fromRfc3339WithNanoseconds)((0,z.assertNotEmpty)(e.genesis_time)),chainId:(0,z.assertNotEmpty)(e.chain_id),consensusParams:by(e.consensus_params),validators:e.validators?(0,z.assertArray)(e.validators).map(Iy):[],appHash:(0,te.fromHex)((0,z.assertSet)(e.app_hash)),appState:e.app_state}}function Kc(e){return{pubkey:$c((0,z.assertObject)(e.pub_key)),votingPower:(0,ie.apiToBigInt)((0,z.assertNotEmpty)(e.voting_power)),address:(0,te.fromHex)((0,z.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,ie.apiToSmallInt)(e.proposer_priority):void 0}}Nn.decodeValidatorInfo=Kc;function nO(e){return{id:(0,te.fromHex)((0,z.assertNotEmpty)(e.id)),listenAddr:(0,z.assertNotEmpty)(e.listen_addr),network:(0,z.assertNotEmpty)(e.network),version:(0,z.assertString)(e.version),channels:(0,z.assertNotEmpty)(e.channels),moniker:(0,z.assertNotEmpty)(e.moniker),other:(0,z.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.protocol_version.app)),block:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.protocol_version.block)),p2p:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.protocol_version.p2p))}}}function tO(e){const n=e.earliest_block_height?(0,ie.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,ao.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,te.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,te.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,te.fromHex)((0,z.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,te.fromHex)((0,z.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,ao.fromRfc3339WithNanoseconds)((0,z.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,z.assertBoolean)(e.catching_up)}}function rO(e){return{nodeInfo:nO(e.node_info),syncInfo:tO(e.sync_info),validatorInfo:Kc(e.validator_info)}}function iO(e){return{data:(0,te.fromBase64)((0,z.assertNotEmpty)(e.data)),rootHash:(0,te.fromHex)((0,z.assertNotEmpty)(e.root_hash)),proof:{total:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.proof.total)),index:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.proof.index)),leafHash:(0,te.fromBase64)((0,z.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,z.assertArray)(e.proof.aunts).map(te.fromBase64)}}}function Ty(e){return{tx:(0,te.fromBase64)((0,z.assertNotEmpty)(e.tx)),result:gi((0,z.assertObject)(e.tx_result)),height:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.height)),index:(0,ie.apiToSmallInt)((0,z.assertNumber)(e.index)),hash:(0,te.fromHex)((0,z.assertNotEmpty)(e.hash)),proof:(0,z.may)(iO,e.proof)}}function oO(e){return{totalCount:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.total_count)),txs:(0,z.assertArray)(e.txs).map(Ty)}}function aO(e){const n=(0,te.fromBase64)((0,z.assertNotEmpty)(e.tx));return{tx:n,hash:(0,Mb.hashTx)(n),result:gi(e.result),height:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.height))}}function sO(e){return{blockHeight:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.block_height)),validators:(0,z.assertArray)(e.validators).map(Kc),count:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.count)),total:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.total))}}function Cy(e){var n;return{header:Us((0,z.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?Ay((0,z.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,z.assertArray)(e.data.txs).map(te.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function Ny(e){return{blockId:_s(e.block_id),block:Cy(e.block)}}function dO(e){return{totalCount:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.total_count)),blocks:(0,z.assertArray)(e.blocks).map(Ny)}}function uO(e){return{total:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.total)),totalBytes:(0,ie.apiToSmallInt)((0,z.assertNotEmpty)(e.total_bytes))}}let cO=class wy{static decodeAbciInfo(n){return qb((0,z.assertObject)(n.result.response))}static decodeAbciQuery(n){return Vb((0,z.assertObject)(n.result.response))}static decodeBlock(n){return Ny(n.result)}static decodeBlockResults(n){return Lb(n.result)}static decodeBlockSearch(n){return dO(n.result)}static decodeBlockchain(n){return zb(n.result)}static decodeBroadcastTxSync(n){return Yb(n.result)}static decodeBroadcastTxAsync(n){return wy.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return Zb(n.result)}static decodeCommit(n){return jb(n.result)}static decodeGenesis(n){return eO((0,z.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return uO(n.result)}static decodeStatus(n){return rO(n.result)}static decodeNewBlockEvent(n){return Cy(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return Us(n.data.value.header)}static decodeTxEvent(n){return aO(n.data.value.TxResult)}static decodeTx(n){return Ty(n.result)}static decodeTxSearch(n){return oO(n.result)}static decodeValidators(n){return sO(n.result)}};Nn.Responses=cO;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=Es;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=Nn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(Ry);var lO=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),fO=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),pO=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&lO(n,e,t);return fO(n,e),n};Object.defineProperty(ws,"__esModule",{value:!0});ws.Tendermint34Client=void 0;const mO=mt,Go=ko,le=Ry,Se=pO(Ns);class Sa{static async connect(n){let t;return typeof n=="object"?t=new Go.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new Go.HttpClient(n):new Go.WebsocketClient(n),await this.detectVersion(t),Sa.create(t)}static async create(n){return new Sa(n)}static async detectVersion(n){const t=(0,mO.createJsonRpcRequest)(Se.Method.Status),o=(await n.execute(t)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const h=o.node_info.version;if(typeof h!="string")throw new Error("Unrecognized version format: must be string");return h}constructor(n){this.client=n}disconnect(){this.client.disconnect()}async abciInfo(){const n={method:Se.Method.AbciInfo};return this.doCall(n,le.Params.encodeAbciInfo,le.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:Se.Method.AbciQuery};return this.doCall(t,le.Params.encodeAbciQuery,le.Responses.decodeAbciQuery)}async block(n){const t={method:Se.Method.Block,params:{height:n}};return this.doCall(t,le.Params.encodeBlock,le.Responses.decodeBlock)}async blockResults(n){const t={method:Se.Method.BlockResults,params:{height:n}};return this.doCall(t,le.Params.encodeBlockResults,le.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:Se.Method.BlockSearch},r=await this.doCall(t,le.Params.encodeBlockSearch,le.Responses.decodeBlockSearch);return{...r,blocks:[...r.blocks].sort((o,h)=>o.block.header.height-h.block.header.height)}}async blockSearchAll(n){let t=n.page||1;const r=[];let o=!1;for(;!o;){const h=await this.blockSearch({...n,page:t});r.push(...h.blocks),r.length<h.totalCount?t++:o=!0}return r.sort((h,v)=>h.block.header.height-v.block.header.height),{totalCount:r.length,blocks:r}}async blockchain(n,t){const r={method:Se.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(r,le.Params.encodeBlockchain,le.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:Se.Method.BroadcastTxSync};return this.doCall(t,le.Params.encodeBroadcastTx,le.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:Se.Method.BroadcastTxAsync};return this.doCall(t,le.Params.encodeBroadcastTx,le.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:Se.Method.BroadcastTxCommit};return this.doCall(t,le.Params.encodeBroadcastTx,le.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:Se.Method.Commit,params:{height:n}};return this.doCall(t,le.Params.encodeCommit,le.Responses.decodeCommit)}async genesis(){const n={method:Se.Method.Genesis};return this.doCall(n,le.Params.encodeGenesis,le.Responses.decodeGenesis)}async health(){const n={method:Se.Method.Health};return this.doCall(n,le.Params.encodeHealth,le.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:Se.Method.NumUnconfirmedTxs};return this.doCall(n,le.Params.encodeNumUnconfirmedTxs,le.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:Se.Method.Status};return this.doCall(n,le.Params.encodeStatus,le.Responses.decodeStatus)}subscribeNewBlock(){const n={method:Se.Method.Subscribe,query:{type:Se.SubscriptionEventType.NewBlock}};return this.subscribe(n,le.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:Se.Method.Subscribe,query:{type:Se.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,le.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:Se.Method.Subscribe,query:{type:Se.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,le.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:Se.Method.Tx};return this.doCall(t,le.Params.encodeTx,le.Responses.decodeTx)}async txSearch(n){const t={params:n,method:Se.Method.TxSearch};return this.doCall(t,le.Params.encodeTxSearch,le.Responses.decodeTxSearch)}async txSearchAll(n){let t=n.page||1;const r=[];let o=!1;for(;!o;){const h=await this.txSearch({...n,page:t});r.push(...h.txs),r.length<h.totalCount?t++:o=!0}return{totalCount:r.length,txs:r}}async validators(n){const t={method:Se.Method.Validators,params:n};return this.doCall(t,le.Params.encodeValidators,le.Responses.decodeValidators)}async validatorsAll(n){const t=[];let r=1,o=!1,h=n;for(;!o;){const v=await this.validators({per_page:50,height:h,page:r});t.push(...v.validators),h=h||v.blockHeight,t.length<v.total?r++:o=!0}return{blockHeight:h??0,count:t.length,total:t.length,validators:t}}async doCall(n,t,r){const o=t(n),h=await this.client.execute(o);return r(h)}subscribe(n,t){if(!(0,Go.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=le.Params.encodeSubscribe(n);return this.client.listen(r).map(h=>t(h))}}ws.Tendermint34Client=Sa;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint34Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var n=Ns;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var t=Py;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return t.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return t.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return t.VoteType}});var r=ws;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return r.Tendermint34Client}})})(Zi);var ka={},Js={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.buildQuery=e.SubscriptionEventType=e.Method=void 0,function(t){t.AbciInfo="abci_info",t.AbciQuery="abci_query",t.Block="block",t.Blockchain="blockchain",t.BlockResults="block_results",t.BlockSearch="block_search",t.BroadcastTxAsync="broadcast_tx_async",t.BroadcastTxSync="broadcast_tx_sync",t.BroadcastTxCommit="broadcast_tx_commit",t.Commit="commit",t.Genesis="genesis",t.Health="health",t.NumUnconfirmedTxs="num_unconfirmed_txs",t.Status="status",t.Subscribe="subscribe",t.Tx="tx",t.TxSearch="tx_search",t.Validators="validators",t.Unsubscribe="unsubscribe"}(e.Method||(e.Method={})),function(t){t.NewBlock="NewBlock",t.NewBlockHeader="NewBlockHeader",t.Tx="Tx"}(e.SubscriptionEventType||(e.SubscriptionEventType={}));function n(t){const o=(t.tags?t.tags:[]).map(v=>`${v.key}='${v.value}'`),h=t.raw?[t.raw]:[];return[...o,...h].join(" AND ")}e.buildQuery=n})(Js);var Ey={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxCommitSuccess=e.broadcastTxSyncSuccess=void 0;function n(r){return r.code===0}e.broadcastTxSyncSuccess=n;function t(r){return r.checkTx.code===0&&!!r.deliverTx&&r.deliverTx.code===0}e.broadcastTxCommitSuccess=t,function(r){r[r.PreVote=1]="PreVote",r[r.PreCommit=2]="PreCommit"}(e.VoteType||(e.VoteType={}))})(Ey);var Ds={},_y={},Ms={},he={};Object.defineProperty(he,"__esModule",{value:!0});he.encodeBlockId=he.encodeVersion=he.encodeBytes=he.encodeTime=he.encodeUvarint=he.encodeString=he.dictionaryToStringMap=he.may=he.assertNotEmpty=he.assertObject=he.assertArray=he.assertNumber=he.assertString=he.assertBoolean=he.assertSet=void 0;const yO=de;function lr(e){if(e===void 0)throw new Error("Value must not be undefined");if(e===null)throw new Error("Value must not be null");return e}he.assertSet=lr;function hO(e){if(lr(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}he.assertBoolean=hO;function gO(e){if(lr(e),typeof e!="string")throw new Error("Value must be a string");return e}he.assertString=gO;function SO(e){if(lr(e),typeof e!="number")throw new Error("Value must be a number");return e}he.assertNumber=SO;function kO(e){if(lr(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}he.assertArray=kO;function PO(e){if(lr(e),typeof e!="object")throw new Error("Value must be an object");if(Object.prototype.toString.call(e)!=="[object Object]")throw new Error("Value must be a simple object");return e}he.assertObject=PO;function RO(e){if(lr(e),typeof e=="number"&&e===0)throw new Error("must provide a non-zero value");if(e.length===0)throw new Error("must provide a non-empty value");return e}he.assertNotEmpty=RO;function vO(e,n){return n==null?void 0:e(n)}he.may=vO;function BO(e){const n=new Map;for(const t of Object.keys(e)){const r=e[t];if(typeof r!="string")throw new Error("Found dictionary value of type other than string");n.set(t,r)}return n}he.dictionaryToStringMap=BO;function bO(e){const n=(0,yO.toUtf8)(e);return Uint8Array.from([n.length,...n])}he.encodeString=bO;function Si(e){return e>=128?Uint8Array.from([e&255|128,...Si(e>>7)]):Uint8Array.from([e&255])}he.encodeUvarint=Si;function OO(e){const n=e.getTime(),t=Math.floor(n/1e3),r=t?[8,...Si(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,h=o?[16,...Si(o)]:new Uint8Array;return Uint8Array.from([...r,...h])}he.encodeTime=OO;function AO(e){if(e.length>=128)throw new Error("Not implemented for byte arrays of length 128 or more");return e.length?Uint8Array.from([e.length,...e]):new Uint8Array}he.encodeBytes=AO;function IO(e){const n=e.block?Uint8Array.from([8,...Si(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...Si(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}he.encodeVersion=IO;function TO(e){return Uint8Array.from([10,e.hash.length,...e.hash,18,e.parts.hash.length+4,8,e.parts.total,18,e.parts.hash.length,...e.parts.hash])}he.encodeBlockId=TO;var CO=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),NO=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),wO=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&CO(n,e,t);return NO(n,e),n};Object.defineProperty(Ms,"__esModule",{value:!0});Ms.Params=void 0;const zc=de,$n=yn,Ve=mt,dn=he,EO=wO(Js);function fu(e){return{height:(0,dn.may)($n.smallIntToApi,e.height)}}function _O(e){return{minHeight:(0,dn.may)($n.smallIntToApi,e.minHeight),maxHeight:(0,dn.may)($n.smallIntToApi,e.maxHeight)}}function UO(e){return{query:e.query,page:(0,dn.may)($n.smallIntToApi,e.page),per_page:(0,dn.may)($n.smallIntToApi,e.per_page),order_by:e.order_by}}function JO(e){return{path:(0,dn.assertNotEmpty)(e.path),data:(0,zc.toHex)(e.data),height:(0,dn.may)($n.smallIntToApi,e.height),prove:e.prove}}function DO(e){return{tx:(0,zc.toBase64)((0,dn.assertNotEmpty)(e.tx))}}function MO(e){return{hash:(0,zc.toBase64)((0,dn.assertNotEmpty)(e.hash)),prove:e.prove}}function qO(e){return{query:e.query,prove:e.prove,page:(0,dn.may)($n.smallIntToApi,e.page),per_page:(0,dn.may)($n.smallIntToApi,e.per_page),order_by:e.order_by}}function HO(e){return{height:(0,dn.may)($n.smallIntToApi,e.height),page:(0,dn.may)($n.smallIntToApi,e.page),per_page:(0,dn.may)($n.smallIntToApi,e.per_page)}}class VO{static encodeAbciInfo(n){return(0,Ve.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,Ve.createJsonRpcRequest)(n.method,JO(n.params))}static encodeBlock(n){return(0,Ve.createJsonRpcRequest)(n.method,fu(n.params))}static encodeBlockchain(n){return(0,Ve.createJsonRpcRequest)(n.method,_O(n.params))}static encodeBlockResults(n){return(0,Ve.createJsonRpcRequest)(n.method,fu(n.params))}static encodeBlockSearch(n){return(0,Ve.createJsonRpcRequest)(n.method,UO(n.params))}static encodeBroadcastTx(n){return(0,Ve.createJsonRpcRequest)(n.method,DO(n.params))}static encodeCommit(n){return(0,Ve.createJsonRpcRequest)(n.method,fu(n.params))}static encodeGenesis(n){return(0,Ve.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,Ve.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,Ve.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,Ve.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},r=EO.buildQuery({tags:[t],raw:n.query.raw});return(0,Ve.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(n){return(0,Ve.createJsonRpcRequest)(n.method,MO(n.params))}static encodeTxSearch(n){return(0,Ve.createJsonRpcRequest)(n.method,qO(n.params))}static encodeValidators(n){return(0,Ve.createJsonRpcRequest)(n.method,HO(n.params))}}Ms.Params=VO;var wn={},ki={};Object.defineProperty(ki,"__esModule",{value:!0});ki.hashBlock=ki.hashTx=void 0;const Yc=Ge,Xe=he;function QO(e){return(0,Yc.sha256)(e)}ki.hashTx=QO;function WO(e){if(e<1)throw new Error("Cannot split an empty tree");const n=2**Math.floor(Math.log2(e));return n<e?n:n/2}function FO(e){const n=new Yc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function GO(e,n){const t=new Yc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function nc(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return FO(e[0]);default:{const n=WO(e.length),t=nc(e.slice(0,n)),r=nc(e.slice(n));return GO(t,r)}}}function LO(e){if(!e.lastBlockId)throw new Error("Hashing a block header with no last block ID (i.e. header at height 1) is not supported. If you need this, contributions are welcome. Please add documentation and test vectors for this case.");const n=[(0,Xe.encodeVersion)(e.version),(0,Xe.encodeString)(e.chainId),(0,Xe.encodeUvarint)(e.height),(0,Xe.encodeTime)(e.time),(0,Xe.encodeBlockId)(e.lastBlockId),(0,Xe.encodeBytes)(e.lastCommitHash),(0,Xe.encodeBytes)(e.dataHash),(0,Xe.encodeBytes)(e.validatorsHash),(0,Xe.encodeBytes)(e.nextValidatorsHash),(0,Xe.encodeBytes)(e.consensusHash),(0,Xe.encodeBytes)(e.appHash),(0,Xe.encodeBytes)(e.lastResultsHash),(0,Xe.encodeBytes)(e.evidenceHash),(0,Xe.encodeBytes)(e.proposerAddress)];return nc(n)}ki.hashBlock=LO;Object.defineProperty(wn,"__esModule",{value:!0});wn.Responses=wn.decodeValidatorInfo=wn.decodeValidatorGenesis=wn.decodeValidatorUpdate=wn.decodeEvent=void 0;const se=de,Uy=Oe,so=$e,oe=yn,$O=Bo,Y=he,KO=ki;function zO(e){return{data:e.data,lastBlockHeight:(0,Y.may)(oe.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,Y.may)(se.fromBase64,e.last_block_app_hash)}}function YO(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,se.fromBase64)(n.key),data:(0,se.fromBase64)(n.data)}))}}function ZO(e){return{key:(0,se.fromBase64)((0,Y.assertString)(e.key??"")),value:(0,se.fromBase64)((0,Y.assertString)(e.value??"")),proof:(0,Y.may)(YO,e.proofOps),height:(0,Y.may)(oe.apiToSmallInt,e.height),code:(0,Y.may)(oe.apiToSmallInt,e.code),codespace:(0,Y.assertString)(e.codespace??""),index:(0,Y.may)(oe.apiToSmallInt,e.index),log:e.log,info:(0,Y.assertString)(e.info??"")}}function XO(e){return{key:(0,Y.assertNotEmpty)(e.key),value:e.value??""}}function xO(e){return(0,Y.assertArray)(e).map(XO)}function Jy(e){return{type:e.type,attributes:e.attributes?xO(e.attributes):[]}}wn.decodeEvent=Jy;function tc(e){return(0,Y.assertArray)(e).map(Jy)}function Pi(e){return{code:(0,oe.apiToSmallInt)((0,Y.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,Y.may)(se.fromBase64,e.data),events:e.events?tc(e.events):[],gasWanted:(0,oe.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,oe.apiToBigInt)(e.gas_used??"0")}}function Zc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,Uy.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,se.fromBase64)((0,Y.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,se.fromBase64)((0,Y.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,se.fromBase64)((0,Y.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function jO(e){return{maxBytes:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_bytes)),maxGas:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_gas))}}function e0(e){return{maxAgeNumBlocks:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_age_duration))}}function Dy(e){return{block:jO((0,Y.assertObject)(e.block)),evidence:e0((0,Y.assertObject)(e.evidence))}}function My(e){return{pubkey:Zc((0,Y.assertObject)(e.pub_key)),votingPower:(0,oe.apiToBigInt)(e.power??"0")}}wn.decodeValidatorUpdate=My;function n0(e){return{height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(Pi),validatorUpdates:(e.validator_updates||[]).map(My),consensusUpdates:(0,Y.may)(Dy,e.consensus_param_updates),beginBlockEvents:tc(e.begin_block_events||[]),endBlockEvents:tc(e.end_block_events||[])}}function qs(e){return{hash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.hash)),parts:{total:(0,Y.assertNotEmpty)(e.parts.total),hash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.parts.hash))}}}function t0(e){return{block:(0,oe.apiToSmallInt)(e.block),app:(0,oe.apiToSmallInt)(e.app??0)}}function Hs(e){return{version:t0(e.version),chainId:(0,Y.assertNotEmpty)(e.chain_id),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),time:(0,so.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?qs(e.last_block_id):null,lastCommitHash:(0,se.fromHex)((0,Y.assertSet)(e.last_commit_hash)),dataHash:(0,se.fromHex)((0,Y.assertSet)(e.data_hash)),validatorsHash:(0,se.fromHex)((0,Y.assertSet)(e.validators_hash)),nextValidatorsHash:(0,se.fromHex)((0,Y.assertSet)(e.next_validators_hash)),consensusHash:(0,se.fromHex)((0,Y.assertSet)(e.consensus_hash)),appHash:(0,se.fromHex)((0,Y.assertSet)(e.app_hash)),lastResultsHash:(0,se.fromHex)((0,Y.assertSet)(e.last_results_hash)),evidenceHash:(0,se.fromHex)((0,Y.assertSet)(e.evidence_hash)),proposerAddress:(0,se.fromHex)((0,Y.assertNotEmpty)(e.proposer_address))}}function r0(e){return{blockId:qs(e.block_id),blockSize:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.block_size)),header:Hs(e.header),numTxs:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.num_txs))}}function i0(e){return{lastHeight:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.last_height)),blockMetas:(0,Y.assertArray)(e.block_metas).map(r0)}}function o0(e){return{...Pi(e),hash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.hash))}}function a0(e){return{height:(0,oe.apiToSmallInt)(e.height),hash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.hash)),checkTx:Pi((0,Y.assertObject)(e.check_tx)),deliverTx:(0,Y.may)(Pi,e.deliver_tx)}}function s0(e){return(0,Uy.assert)(e in $O.BlockIdFlag),e}function d0(e){return{blockIdFlag:s0(e.block_id_flag),validatorAddress:e.validator_address?(0,se.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,so.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,se.fromBase64)(e.signature):void 0}}function qy(e){return{blockId:qs((0,Y.assertObject)(e.block_id)),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),round:(0,oe.apiToSmallInt)(e.round),signatures:(0,Y.assertArray)(e.signatures).map(d0)}}function u0(e){return{canonical:(0,Y.assertBoolean)(e.canonical),header:Hs(e.signed_header.header),commit:qy(e.signed_header.commit)}}function Hy(e){return{address:(0,se.fromHex)((0,Y.assertNotEmpty)(e.address)),pubkey:Zc((0,Y.assertObject)(e.pub_key)),votingPower:(0,oe.apiToBigInt)((0,Y.assertNotEmpty)(e.power))}}wn.decodeValidatorGenesis=Hy;function c0(e){return{genesisTime:(0,so.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.genesis_time)),chainId:(0,Y.assertNotEmpty)(e.chain_id),consensusParams:Dy(e.consensus_params),validators:e.validators?(0,Y.assertArray)(e.validators).map(Hy):[],appHash:(0,se.fromHex)((0,Y.assertSet)(e.app_hash)),appState:e.app_state}}function Xc(e){return{pubkey:Zc((0,Y.assertObject)(e.pub_key)),votingPower:(0,oe.apiToBigInt)((0,Y.assertNotEmpty)(e.voting_power)),address:(0,se.fromHex)((0,Y.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,oe.apiToSmallInt)(e.proposer_priority):void 0}}wn.decodeValidatorInfo=Xc;function l0(e){return{id:(0,se.fromHex)((0,Y.assertNotEmpty)(e.id)),listenAddr:(0,Y.assertNotEmpty)(e.listen_addr),network:(0,Y.assertNotEmpty)(e.network),version:(0,Y.assertString)(e.version),channels:(0,Y.assertNotEmpty)(e.channels),moniker:(0,Y.assertNotEmpty)(e.moniker),other:(0,Y.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.app)),block:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.block)),p2p:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.p2p))}}}function f0(e){const n=e.earliest_block_height?(0,oe.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,so.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,se.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,se.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,so.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,Y.assertBoolean)(e.catching_up)}}function p0(e){return{nodeInfo:l0(e.node_info),syncInfo:f0(e.sync_info),validatorInfo:Xc(e.validator_info)}}function m0(e){return{data:(0,se.fromBase64)((0,Y.assertNotEmpty)(e.data)),rootHash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.root_hash)),proof:{total:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.proof.total)),index:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.proof.index)),leafHash:(0,se.fromBase64)((0,Y.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,Y.assertArray)(e.proof.aunts).map(se.fromBase64)}}}function Vy(e){return{tx:(0,se.fromBase64)((0,Y.assertNotEmpty)(e.tx)),result:Pi((0,Y.assertObject)(e.tx_result)),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),index:(0,oe.apiToSmallInt)((0,Y.assertNumber)(e.index)),hash:(0,se.fromHex)((0,Y.assertNotEmpty)(e.hash)),proof:(0,Y.may)(m0,e.proof)}}function y0(e){return{totalCount:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_count)),txs:(0,Y.assertArray)(e.txs).map(Vy)}}function h0(e){const n=(0,se.fromBase64)((0,Y.assertNotEmpty)(e.tx));return{tx:n,hash:(0,KO.hashTx)(n),result:Pi(e.result),height:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.height))}}function g0(e){return{blockHeight:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.block_height)),validators:(0,Y.assertArray)(e.validators).map(Xc),count:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.count)),total:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total))}}function Qy(e){var n;return{header:Hs((0,Y.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?qy((0,Y.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,Y.assertArray)(e.data.txs).map(se.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function Wy(e){return{blockId:qs(e.block_id),block:Qy(e.block)}}function S0(e){return{totalCount:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_count)),blocks:(0,Y.assertArray)(e.blocks).map(Wy)}}function k0(e){return{total:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total)),totalBytes:(0,oe.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_bytes))}}class xc{static decodeAbciInfo(n){return zO((0,Y.assertObject)(n.result.response))}static decodeAbciQuery(n){return ZO((0,Y.assertObject)(n.result.response))}static decodeBlock(n){return Wy(n.result)}static decodeBlockResults(n){return n0(n.result)}static decodeBlockSearch(n){return S0(n.result)}static decodeBlockchain(n){return i0(n.result)}static decodeBroadcastTxSync(n){return o0(n.result)}static decodeBroadcastTxAsync(n){return xc.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return a0(n.result)}static decodeCommit(n){return u0(n.result)}static decodeGenesis(n){return c0((0,Y.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return k0(n.result)}static decodeStatus(n){return p0(n.result)}static decodeNewBlockEvent(n){return Qy(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return Hs(n.data.value.header)}static decodeTxEvent(n){return h0(n.data.value.TxResult)}static decodeTx(n){return Vy(n.result)}static decodeTxSearch(n){return y0(n.result)}static decodeValidators(n){return g0(n.result)}}wn.Responses=xc;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=Ms;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=wn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(_y);var P0=x&&x.__createBinding||(Object.create?function(e,n,t,r){r===void 0&&(r=t);var o=Object.getOwnPropertyDescriptor(n,t);(!o||("get"in o?!n.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return n[t]}}),Object.defineProperty(e,r,o)}:function(e,n,t,r){r===void 0&&(r=t),e[r]=n[t]}),R0=x&&x.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),v0=x&&x.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var t in e)t!=="default"&&Object.prototype.hasOwnProperty.call(e,t)&&P0(n,e,t);return R0(n,e),n};Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Tendermint37Client=void 0;const B0=mt,Lo=ko,fe=_y,ke=v0(Js);class Pa{static async connect(n){let t;return typeof n=="object"?t=new Lo.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new Lo.HttpClient(n):new Lo.WebsocketClient(n),await this.detectVersion(t),Pa.create(t)}static async create(n){return new Pa(n)}static async detectVersion(n){const t=(0,B0.createJsonRpcRequest)(ke.Method.Status),o=(await n.execute(t)).result;if(!o||!o.node_info)throw new Error("Unrecognized format for status response");const h=o.node_info.version;if(typeof h!="string")throw new Error("Unrecognized version format: must be string");return h}constructor(n){this.client=n}disconnect(){this.client.disconnect()}async abciInfo(){const n={method:ke.Method.AbciInfo};return this.doCall(n,fe.Params.encodeAbciInfo,fe.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:ke.Method.AbciQuery};return this.doCall(t,fe.Params.encodeAbciQuery,fe.Responses.decodeAbciQuery)}async block(n){const t={method:ke.Method.Block,params:{height:n}};return this.doCall(t,fe.Params.encodeBlock,fe.Responses.decodeBlock)}async blockResults(n){const t={method:ke.Method.BlockResults,params:{height:n}};return this.doCall(t,fe.Params.encodeBlockResults,fe.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:ke.Method.BlockSearch},r=await this.doCall(t,fe.Params.encodeBlockSearch,fe.Responses.decodeBlockSearch);return{...r,blocks:[...r.blocks].sort((o,h)=>o.block.header.height-h.block.header.height)}}async blockSearchAll(n){let t=n.page||1;const r=[];let o=!1;for(;!o;){const h=await this.blockSearch({...n,page:t});r.push(...h.blocks),r.length<h.totalCount?t++:o=!0}return r.sort((h,v)=>h.block.header.height-v.block.header.height),{totalCount:r.length,blocks:r}}async blockchain(n,t){const r={method:ke.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(r,fe.Params.encodeBlockchain,fe.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:ke.Method.BroadcastTxSync};return this.doCall(t,fe.Params.encodeBroadcastTx,fe.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:ke.Method.BroadcastTxAsync};return this.doCall(t,fe.Params.encodeBroadcastTx,fe.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:ke.Method.BroadcastTxCommit};return this.doCall(t,fe.Params.encodeBroadcastTx,fe.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:ke.Method.Commit,params:{height:n}};return this.doCall(t,fe.Params.encodeCommit,fe.Responses.decodeCommit)}async genesis(){const n={method:ke.Method.Genesis};return this.doCall(n,fe.Params.encodeGenesis,fe.Responses.decodeGenesis)}async health(){const n={method:ke.Method.Health};return this.doCall(n,fe.Params.encodeHealth,fe.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:ke.Method.NumUnconfirmedTxs};return this.doCall(n,fe.Params.encodeNumUnconfirmedTxs,fe.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:ke.Method.Status};return this.doCall(n,fe.Params.encodeStatus,fe.Responses.decodeStatus)}subscribeNewBlock(){const n={method:ke.Method.Subscribe,query:{type:ke.SubscriptionEventType.NewBlock}};return this.subscribe(n,fe.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:ke.Method.Subscribe,query:{type:ke.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,fe.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:ke.Method.Subscribe,query:{type:ke.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,fe.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:ke.Method.Tx};return this.doCall(t,fe.Params.encodeTx,fe.Responses.decodeTx)}async txSearch(n){const t={params:n,method:ke.Method.TxSearch};return this.doCall(t,fe.Params.encodeTxSearch,fe.Responses.decodeTxSearch)}async txSearchAll(n){let t=n.page||1;const r=[];let o=!1;for(;!o;){const h=await this.txSearch({...n,page:t});r.push(...h.txs),r.length<h.totalCount?t++:o=!0}return{totalCount:r.length,txs:r}}async validators(n){const t={method:ke.Method.Validators,params:n};return this.doCall(t,fe.Params.encodeValidators,fe.Responses.decodeValidators)}async validatorsAll(n){const t=[];let r=1,o=!1,h=n;for(;!o;){const v=await this.validators({per_page:50,height:h,page:r});t.push(...v.validators),h=h||v.blockHeight,t.length<v.total?r++:o=!0}return{blockHeight:h??0,count:t.length,total:t.length,validators:t}}async doCall(n,t,r){const o=t(n),h=await this.client.execute(o);return r(h)}subscribe(n,t){if(!(0,Lo.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=fe.Params.encodeSubscribe(n);return this.client.listen(r).map(h=>t(h))}}Ds.Tendermint37Client=Pa;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint37Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var n=Js;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var t=Ey;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return t.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return t.broadcastTxSyncSuccess}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return t.VoteType}});var r=Ds;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return r.Tendermint37Client}})})(ka);var it={};Object.defineProperty(it,"__esModule",{value:!0});it.connectComet=it.isComet38Client=it.isTendermint37Client=it.isTendermint34Client=void 0;const Fy=ya,Gy=Zi,Ly=ka;function b0(e){return e instanceof Gy.Tendermint34Client}it.isTendermint34Client=b0;function O0(e){return e instanceof Ly.Tendermint37Client}it.isTendermint37Client=O0;function A0(e){return e instanceof Fy.Comet38Client}it.isComet38Client=A0;async function I0(e){let n;const t=await Ly.Tendermint37Client.connect(e),r=(await t.status()).nodeInfo.version;return r.startsWith("0.37.")?n=t:r.startsWith("0.38.")?(t.disconnect(),n=await Fy.Comet38Client.connect(e)):(t.disconnect(),n=await Gy.Tendermint34Client.connect(e)),n}it.connectComet=I0;(function(e){var n=x&&x.__createBinding||(Object.create?function(R,B,d,s){s===void 0&&(s=d);var y=Object.getOwnPropertyDescriptor(B,d);(!y||("get"in y?!B.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return B[d]}}),Object.defineProperty(R,s,y)}:function(R,B,d,s){s===void 0&&(s=d),R[s]=B[d]}),t=x&&x.__setModuleDefault||(Object.create?function(R,B){Object.defineProperty(R,"default",{enumerable:!0,value:B})}:function(R,B){R.default=B}),r=x&&x.__importStar||function(R){if(R&&R.__esModule)return R;var B={};if(R!=null)for(var d in R)d!=="default"&&Object.prototype.hasOwnProperty.call(R,d)&&n(B,R,d);return t(B,R),B};Object.defineProperty(e,"__esModule",{value:!0}),e.BlockIdFlag=e.isTendermint37Client=e.isTendermint34Client=e.isComet38Client=e.connectComet=e.Tendermint37Client=e.tendermint37=e.Tendermint34Client=e.tendermint34=e.VoteType=e.SubscriptionEventType=e.Method=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.WebsocketClient=e.HttpClient=e.HttpBatchClient=e.Comet38Client=e.comet38=e.toSeconds=e.toRfc3339WithNanoseconds=e.fromSeconds=e.fromRfc3339WithNanoseconds=e.DateTime=e.rawSecp256k1PubkeyToRawAddress=e.rawEd25519PubkeyToRawAddress=e.pubkeyToRawAddress=e.pubkeyToAddress=void 0;var o=rt;Object.defineProperty(e,"pubkeyToAddress",{enumerable:!0,get:function(){return o.pubkeyToAddress}}),Object.defineProperty(e,"pubkeyToRawAddress",{enumerable:!0,get:function(){return o.pubkeyToRawAddress}}),Object.defineProperty(e,"rawEd25519PubkeyToRawAddress",{enumerable:!0,get:function(){return o.rawEd25519PubkeyToRawAddress}}),Object.defineProperty(e,"rawSecp256k1PubkeyToRawAddress",{enumerable:!0,get:function(){return o.rawSecp256k1PubkeyToRawAddress}});var h=$e;Object.defineProperty(e,"DateTime",{enumerable:!0,get:function(){return h.DateTime}}),Object.defineProperty(e,"fromRfc3339WithNanoseconds",{enumerable:!0,get:function(){return h.fromRfc3339WithNanoseconds}}),Object.defineProperty(e,"fromSeconds",{enumerable:!0,get:function(){return h.fromSeconds}}),Object.defineProperty(e,"toRfc3339WithNanoseconds",{enumerable:!0,get:function(){return h.toRfc3339WithNanoseconds}}),Object.defineProperty(e,"toSeconds",{enumerable:!0,get:function(){return h.toSeconds}}),e.comet38=r(ya);var v=ya;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return v.Comet38Client}});var C=ko;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return C.HttpBatchClient}}),Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return C.HttpClient}}),Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return C.WebsocketClient}});var w=Zi;Object.defineProperty(e,"broadcastTxCommitSuccess",{enumerable:!0,get:function(){return w.broadcastTxCommitSuccess}}),Object.defineProperty(e,"broadcastTxSyncSuccess",{enumerable:!0,get:function(){return w.broadcastTxSyncSuccess}}),Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return w.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return w.SubscriptionEventType}}),Object.defineProperty(e,"VoteType",{enumerable:!0,get:function(){return w.VoteType}}),e.tendermint34=r(Zi);var D=Zi;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return D.Tendermint34Client}}),e.tendermint37=r(ka);var J=ka;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return J.Tendermint37Client}});var I=it;Object.defineProperty(e,"connectComet",{enumerable:!0,get:function(){return I.connectComet}}),Object.defineProperty(e,"isComet38Client",{enumerable:!0,get:function(){return I.isComet38Client}}),Object.defineProperty(e,"isTendermint34Client",{enumerable:!0,get:function(){return I.isTendermint34Client}}),Object.defineProperty(e,"isTendermint37Client",{enumerable:!0,get:function(){return I.isTendermint37Client}});var g=Bo;Object.defineProperty(e,"BlockIdFlag",{enumerable:!0,get:function(){return g.BlockIdFlag}})})(So);var De={};Object.defineProperty(De,"__esModule",{value:!0});De.StargateClient=De.BroadcastTxError=De.assertIsDeliverTxFailure=De.assertIsDeliverTxSuccess=De.isDeliverTxSuccess=De.isDeliverTxFailure=De.TimeoutError=void 0;const T0=zn,pu=de,xl=Te,jl=So,ef=Oe,C0=hs,N0=co,w0=yo,$o=io,E0=Ke,_0=go;class $y extends Error{constructor(n,t){super(n),this.txId=t}}De.TimeoutError=$y;function jc(e){return!!e.code}De.isDeliverTxFailure=jc;function Ky(e){return!jc(e)}De.isDeliverTxSuccess=Ky;function U0(e){if(jc(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}De.assertIsDeliverTxSuccess=U0;function J0(e){if(Ky(e))throw new Error(`Transaction ${e.transactionHash} did not fail at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}De.assertIsDeliverTxFailure=J0;class zy extends Error{constructor(n,t,r){super(`Broadcasting transaction failed with code ${n} (codespace: ${t}). Log: ${r}`),this.code=n,this.codespace=t,this.log=r}}De.BroadcastTxError=zy;class Ra{static async connect(n,t={}){const r=await(0,jl.connectComet)(n);return Ra.create(r,t)}static async create(n,t={}){return new Ra(n,t)}constructor(n,t){n&&(this.cometClient=n,this.queryClient=E0.QueryClient.withExtensions(n,$o.setupAuthExtension,$o.setupBankExtension,$o.setupStakingExtension,$o.setupTxExtension));const{accountParser:r=N0.accountFromAny}=t;this.accountParser=r}getCometClient(){return this.cometClient}forceGetCometClient(){if(!this.cometClient)throw new Error("Comet client not available. You cannot use online functionality in offline mode.");return this.cometClient}getQueryClient(){return this.queryClient}forceGetQueryClient(){if(!this.queryClient)throw new Error("Query client not available. You cannot use online functionality in offline mode.");return this.queryClient}async getChainId(){if(!this.chainId){const t=(await this.forceGetCometClient().status()).nodeInfo.network;if(!t)throw new Error("Chain ID must not be empty");this.chainId=t}return this.chainId}async getHeight(){return(await this.forceGetCometClient().status()).syncInfo.latestBlockHeight}async getAccount(n){try{const t=await this.forceGetQueryClient().auth.account(n);return t?this.accountParser(t):null}catch(t){if(/rpc error: code = NotFound/i.test(t.toString()))return null;throw t}}async getSequence(n){const t=await this.getAccount(n);if(!t)throw new Error(`Account '${n}' does not exist on chain. Send some tokens there before trying to query sequence.`);return{accountNumber:t.accountNumber,sequence:t.sequence}}async getBlock(n){const t=await this.forceGetCometClient().block(n);return{id:(0,pu.toHex)(t.blockId.hash).toUpperCase(),header:{version:{block:new xl.Uint53(t.block.header.version.block).toString(),app:new xl.Uint53(t.block.header.version.app).toString()},height:t.block.header.height,chainId:t.block.header.chainId,time:(0,jl.toRfc3339WithNanoseconds)(t.block.header.time)},txs:t.block.txs}}async getBalance(n,t){return this.forceGetQueryClient().bank.balance(n,t)}async getAllBalances(n){return this.forceGetQueryClient().bank.allBalances(n)}async getBalanceStaked(n){const t=[];let r;do{const{delegationResponses:h,pagination:v}=await this.forceGetQueryClient().staking.delegatorDelegations(n,r),C=h||[];t.push(...C),r=v==null?void 0:v.nextKey}while(r!==void 0&&r.length!==0);return t.reduce((h,v)=>((0,ef.assert)(v.balance),h!==null?(0,T0.addCoins)(h,v.balance):v.balance),null)}async getDelegation(n,t){var o;let r;try{r=(o=(await this.forceGetQueryClient().staking.delegation(n,t)).delegationResponse)==null?void 0:o.balance}catch(h){if(!h.toString().includes("key not found"))throw h}return r||null}async getTx(n){return(await this.txsQuery(`tx.hash='${n}'`))[0]??null}async searchTx(n){let t;if(typeof n=="string")t=n;else if((0,_0.isSearchTxQueryArray)(n))t=n.map(r=>typeof r.value=="string"?`${r.key}='${r.value}'`:`${r.key}=${r.value}`).join(" AND ");else throw new Error("Got unsupported query type. See CosmJS 0.31 CHANGELOG for API breaking changes here.");return this.txsQuery(t)}disconnect(){this.cometClient&&this.cometClient.disconnect()}async broadcastTx(n,t=6e4,r=3e3){let o=!1;const h=setTimeout(()=>{o=!0},t),v=async w=>{if(o)throw new $y(`Transaction with ID ${w} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${t/1e3} seconds.`,w);await(0,ef.sleep)(r);const D=await this.getTx(w);return D?{code:D.code,height:D.height,txIndex:D.txIndex,events:D.events,rawLog:D.rawLog,transactionHash:w,msgResponses:D.msgResponses,gasUsed:D.gasUsed,gasWanted:D.gasWanted}:v(w)},C=await this.broadcastTxSync(n);return new Promise((w,D)=>v(C).then(J=>{clearTimeout(h),w(J)},J=>{clearTimeout(h),D(J)}))}async broadcastTxSync(n){const t=await this.forceGetCometClient().broadcastTxSync({tx:n});return t.code?Promise.reject(new zy(t.code,t.codespace??"",t.log)):(0,pu.toHex)(t.hash).toUpperCase()}async txsQuery(n){return(await this.forceGetCometClient().txSearchAll({query:n})).txs.map(r=>{const o=C0.TxMsgData.decode(r.result.data??new Uint8Array);return{height:r.height,txIndex:r.index,hash:(0,pu.toHex)(r.hash).toUpperCase(),code:r.result.code,events:r.result.events.map(w0.fromTendermintEvent),rawLog:r.result.log||"",tx:r.tx,msgResponses:o.msgResponses,gasUsed:r.result.gasUsed,gasWanted:r.result.gasWanted}})}}De.StargateClient=Ra;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningStargateClient=e.createDefaultAminoConverters=e.defaultRegistryTypes=void 0;const n=zn,t=de,r=Te,o=st,h=So,v=Oe,C=Me,w=ja,D=ps,J=uo,I=at,g=pc,R=mo,B=rr,d=io,s=io,y=De;e.defaultRegistryTypes=[["/cosmos.base.v1beta1.Coin",C.Coin],...d.authzTypes,...d.bankTypes,...d.distributionTypes,...d.feegrantTypes,...d.govTypes,...d.groupTypes,...d.stakingTypes,...d.ibcTypes,...d.vestingTypes];function E(){return{...(0,s.createAuthzAminoConverters)(),...(0,s.createBankAminoConverters)(),...(0,s.createDistributionAminoConverters)(),...(0,s.createGovAminoConverters)(),...(0,s.createStakingAminoConverters)(),...(0,s.createIbcAminoConverters)(),...(0,s.createFeegrantAminoConverters)(),...(0,s.createVestingAminoConverters)()}}e.createDefaultAminoConverters=E;class _ extends y.StargateClient{static async connectWithSigner(H,i,m={}){const N=await(0,h.connectComet)(H);return _.createWithSigner(N,i,m)}static async createWithSigner(H,i,m={}){return new _(H,i,m)}static async offline(H,i={}){return new _(void 0,H,i)}constructor(H,i,m){super(H,m);const{registry:N=new o.Registry(e.defaultRegistryTypes),aminoTypes:V=new R.AminoTypes(E())}=m;this.registry=N,this.aminoTypes=V,this.signer=i,this.broadcastTimeoutMs=m.broadcastTimeoutMs,this.broadcastPollIntervalMs=m.broadcastPollIntervalMs,this.gasPrice=m.gasPrice}async simulate(H,i,m){const N=i.map(f=>this.registry.encodeAsAny(f)),V=(await this.signer.getAccounts()).find(f=>f.address===H);if(!V)throw new Error("Failed to retrieve account from signer");const u=(0,n.encodeSecp256k1Pubkey)(V.pubkey),{sequence:l}=await this.getSequence(H),{gasInfo:T}=await this.forceGetQueryClient().tx.simulate(N,m,u,l);return(0,v.assertDefined)(T),r.Uint53.fromString(T.gasUsed.toString()).toNumber()}async sendTokens(H,i,m,N,V=""){const u={typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:{fromAddress:H,toAddress:i,amount:[...m]}};return this.signAndBroadcast(H,[u],N,V)}async delegateTokens(H,i,m,N,V=""){const u={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:D.MsgDelegate.fromPartial({delegatorAddress:H,validatorAddress:i,amount:m})};return this.signAndBroadcast(H,[u],N,V)}async undelegateTokens(H,i,m,N,V=""){const u={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:D.MsgUndelegate.fromPartial({delegatorAddress:H,validatorAddress:i,amount:m})};return this.signAndBroadcast(H,[u],N,V)}async withdrawRewards(H,i,m,N=""){const V={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:w.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:H,validatorAddress:i})};return this.signAndBroadcast(H,[V],m,N)}async sendIbcTokens(H,i,m,N,V,u,l,T,f=""){const p=l?BigInt(l)*BigInt(1e9):void 0,A={typeUrl:"/ibc.applications.transfer.v1.MsgTransfer",value:g.MsgTransfer.fromPartial({sourcePort:N,sourceChannel:V,sender:H,receiver:i,token:m,timeoutHeight:u,timeoutTimestamp:p})};return this.signAndBroadcast(H,[A],T,f)}async signAndBroadcast(H,i,m,N="",V){let u;if(m=="auto"||typeof m=="number"){(0,v.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const f=await this.simulate(H,i,N),p=typeof m=="number"?m:1.4;u=(0,B.calculateFee)(Math.round(f*p),this.gasPrice)}else u=m;const l=await this.sign(H,i,u,N,void 0,V),T=I.TxRaw.encode(l).finish();return this.broadcastTx(T,this.broadcastTimeoutMs,this.broadcastPollIntervalMs)}async signAndBroadcastSync(H,i,m,N="",V){let u;if(m=="auto"||typeof m=="number"){(0,v.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const f=await this.simulate(H,i,N),p=typeof m=="number"?m:1.3;u=(0,B.calculateFee)(Math.round(f*p),this.gasPrice)}else u=m;const l=await this.sign(H,i,u,N,void 0,V),T=I.TxRaw.encode(l).finish();return this.broadcastTxSync(T)}async sign(H,i,m,N,V,u){let l;if(V)l=V;else{const{accountNumber:T,sequence:f}=await this.getSequence(H),p=await this.getChainId();l={accountNumber:T,sequence:f,chainId:p}}return(0,o.isOfflineDirectSigner)(this.signer)?this.signDirect(H,i,m,N,l,u):this.signAmino(H,i,m,N,l,u)}async signAmino(H,i,m,N,{accountNumber:V,sequence:u,chainId:l},T){(0,v.assert)(!(0,o.isOfflineDirectSigner)(this.signer));const f=(await this.signer.getAccounts()).find(X=>X.address===H);if(!f)throw new Error("Failed to retrieve account from signer");const p=(0,o.encodePubkey)((0,n.encodeSecp256k1Pubkey)(f.pubkey)),A=J.SignMode.SIGN_MODE_LEGACY_AMINO_JSON,Q=i.map(X=>this.aminoTypes.toAmino(X)),M=(0,n.makeSignDoc)(Q,m,l,N,V,u,T),{signature:a,signed:k}=await this.signer.signAmino(H,M),P={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:k.msgs.map(X=>this.aminoTypes.fromAmino(X)),memo:k.memo,timeoutHeight:T}},O=this.registry.encode(P),W=r.Int53.fromString(k.fee.gas).toNumber(),L=r.Int53.fromString(k.sequence).toNumber(),G=(0,o.makeAuthInfoBytes)([{pubkey:p,sequence:L}],k.fee.amount,W,k.fee.granter,k.fee.payer,A);return I.TxRaw.fromPartial({bodyBytes:O,authInfoBytes:G,signatures:[(0,t.fromBase64)(a.signature)]})}async signDirect(H,i,m,N,{accountNumber:V,sequence:u,chainId:l},T){(0,v.assert)((0,o.isOfflineDirectSigner)(this.signer));const f=(await this.signer.getAccounts()).find(O=>O.address===H);if(!f)throw new Error("Failed to retrieve account from signer");const p=(0,o.encodePubkey)((0,n.encodeSecp256k1Pubkey)(f.pubkey)),A={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:i,memo:N,timeoutHeight:T}},Q=this.registry.encode(A),M=r.Int53.fromString(m.gas).toNumber(),a=(0,o.makeAuthInfoBytes)([{pubkey:p,sequence:u}],m.amount,M,m.granter,m.payer),k=(0,o.makeSignDoc)(Q,a,l,V),{signature:S,signed:P}=await this.signer.signDirect(H,k);return I.TxRaw.fromPartial({bodyBytes:P.bodyBytes,authInfoBytes:P.authInfoBytes,signatures:[(0,t.fromBase64)(S.signature)]})}}e.SigningStargateClient=_})(zm);(function(e){var n=x&&x.__createBinding||(Object.create?function(d,s,y,E){E===void 0&&(E=y);var _=Object.getOwnPropertyDescriptor(s,y);(!_||("get"in _?!s.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return s[y]}}),Object.defineProperty(d,E,_)}:function(d,s,y,E){E===void 0&&(E=y),d[E]=s[y]}),t=x&&x.__setModuleDefault||(Object.create?function(d,s){Object.defineProperty(d,"default",{enumerable:!0,value:s})}:function(d,s){d.default=s}),r=x&&x.__importStar||function(d){if(d&&d.__esModule)return d;var s={};if(d!=null)for(var y in d)y!=="default"&&Object.prototype.hasOwnProperty.call(d,y)&&n(s,d,y);return t(s,d),s};Object.defineProperty(e,"__esModule",{value:!0}),e.isMsgWithdrawDelegatorRewardEncodeObject=e.isMsgVoteWeightedEncodeObject=e.isMsgVoteEncodeObject=e.isMsgUndelegateEncodeObject=e.isMsgTransferEncodeObject=e.isMsgSubmitProposalEncodeObject=e.isMsgSendEncodeObject=e.isMsgEditValidatorEncodeObject=e.isMsgDepositEncodeObject=e.isMsgDelegateEncodeObject=e.isMsgCreateValidatorEncodeObject=e.isMsgBeginRedelegateEncodeObject=e.isAminoMsgWithdrawValidatorCommission=e.isAminoMsgWithdrawDelegatorReward=e.isAminoMsgVoteWeighted=e.isAminoMsgVote=e.isAminoMsgVerifyInvariant=e.isAminoMsgUnjail=e.isAminoMsgUndelegate=e.isAminoMsgTransfer=e.isAminoMsgSubmitProposal=e.isAminoMsgSubmitEvidence=e.isAminoMsgSetWithdrawAddress=e.isAminoMsgSend=e.isAminoMsgMultiSend=e.isAminoMsgFundCommunityPool=e.isAminoMsgEditValidator=e.isAminoMsgDeposit=e.isAminoMsgDelegate=e.isAminoMsgCreateVestingAccount=e.isAminoMsgCreateValidator=e.isAminoMsgBeginRedelegate=e.createVestingAminoConverters=e.createStakingAminoConverters=e.createSlashingAminoConverters=e.createIbcAminoConverters=e.createGroupAminoConverters=e.createGovAminoConverters=e.createFeegrantAminoConverters=e.createEvidenceAminoConverters=e.createDistributionAminoConverters=e.createCrysisAminoConverters=e.createBankAminoConverters=e.createAuthzAminoConverters=e.logs=e.GasPrice=e.calculateFee=e.fromTendermintEvent=e.AminoTypes=e.accountFromAny=void 0,e.parseCoins=e.makeCosmoshubPath=e.coins=e.coin=e.TimeoutError=e.StargateClient=e.isDeliverTxSuccess=e.isDeliverTxFailure=e.BroadcastTxError=e.assertIsDeliverTxSuccess=e.assertIsDeliverTxFailure=e.SigningStargateClient=e.defaultRegistryTypes=e.createDefaultAminoConverters=e.isSearchTxQueryArray=e.QueryClient=e.decodeCosmosSdkDecFromProto=e.createProtobufRpcClient=e.createPagination=e.makeMultisignedTxBytes=e.makeMultisignedTx=e.setupTxExtension=e.setupStakingExtension=e.setupSlashingExtension=e.setupMintExtension=e.setupIbcExtension=e.setupGovExtension=e.setupFeegrantExtension=e.setupDistributionExtension=e.setupBankExtension=e.setupAuthzExtension=e.setupAuthExtension=void 0;var o=co;Object.defineProperty(e,"accountFromAny",{enumerable:!0,get:function(){return o.accountFromAny}});var h=mo;Object.defineProperty(e,"AminoTypes",{enumerable:!0,get:function(){return h.AminoTypes}});var v=yo;Object.defineProperty(e,"fromTendermintEvent",{enumerable:!0,get:function(){return v.fromTendermintEvent}});var C=rr;Object.defineProperty(e,"calculateFee",{enumerable:!0,get:function(){return C.calculateFee}}),Object.defineProperty(e,"GasPrice",{enumerable:!0,get:function(){return C.GasPrice}}),e.logs=r(tn);var w=io;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return w.createAuthzAminoConverters}}),Object.defineProperty(e,"createBankAminoConverters",{enumerable:!0,get:function(){return w.createBankAminoConverters}}),Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return w.createCrysisAminoConverters}}),Object.defineProperty(e,"createDistributionAminoConverters",{enumerable:!0,get:function(){return w.createDistributionAminoConverters}}),Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return w.createEvidenceAminoConverters}}),Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return w.createFeegrantAminoConverters}}),Object.defineProperty(e,"createGovAminoConverters",{enumerable:!0,get:function(){return w.createGovAminoConverters}}),Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return w.createGroupAminoConverters}}),Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return w.createIbcAminoConverters}}),Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return w.createSlashingAminoConverters}}),Object.defineProperty(e,"createStakingAminoConverters",{enumerable:!0,get:function(){return w.createStakingAminoConverters}}),Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return w.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgBeginRedelegate",{enumerable:!0,get:function(){return w.isAminoMsgBeginRedelegate}}),Object.defineProperty(e,"isAminoMsgCreateValidator",{enumerable:!0,get:function(){return w.isAminoMsgCreateValidator}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return w.isAminoMsgCreateVestingAccount}}),Object.defineProperty(e,"isAminoMsgDelegate",{enumerable:!0,get:function(){return w.isAminoMsgDelegate}}),Object.defineProperty(e,"isAminoMsgDeposit",{enumerable:!0,get:function(){return w.isAminoMsgDeposit}}),Object.defineProperty(e,"isAminoMsgEditValidator",{enumerable:!0,get:function(){return w.isAminoMsgEditValidator}}),Object.defineProperty(e,"isAminoMsgFundCommunityPool",{enumerable:!0,get:function(){return w.isAminoMsgFundCommunityPool}}),Object.defineProperty(e,"isAminoMsgMultiSend",{enumerable:!0,get:function(){return w.isAminoMsgMultiSend}}),Object.defineProperty(e,"isAminoMsgSend",{enumerable:!0,get:function(){return w.isAminoMsgSend}}),Object.defineProperty(e,"isAminoMsgSetWithdrawAddress",{enumerable:!0,get:function(){return w.isAminoMsgSetWithdrawAddress}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return w.isAminoMsgSubmitEvidence}}),Object.defineProperty(e,"isAminoMsgSubmitProposal",{enumerable:!0,get:function(){return w.isAminoMsgSubmitProposal}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return w.isAminoMsgTransfer}}),Object.defineProperty(e,"isAminoMsgUndelegate",{enumerable:!0,get:function(){return w.isAminoMsgUndelegate}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return w.isAminoMsgUnjail}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return w.isAminoMsgVerifyInvariant}}),Object.defineProperty(e,"isAminoMsgVote",{enumerable:!0,get:function(){return w.isAminoMsgVote}}),Object.defineProperty(e,"isAminoMsgVoteWeighted",{enumerable:!0,get:function(){return w.isAminoMsgVoteWeighted}}),Object.defineProperty(e,"isAminoMsgWithdrawDelegatorReward",{enumerable:!0,get:function(){return w.isAminoMsgWithdrawDelegatorReward}}),Object.defineProperty(e,"isAminoMsgWithdrawValidatorCommission",{enumerable:!0,get:function(){return w.isAminoMsgWithdrawValidatorCommission}}),Object.defineProperty(e,"isMsgBeginRedelegateEncodeObject",{enumerable:!0,get:function(){return w.isMsgBeginRedelegateEncodeObject}}),Object.defineProperty(e,"isMsgCreateValidatorEncodeObject",{enumerable:!0,get:function(){return w.isMsgCreateValidatorEncodeObject}}),Object.defineProperty(e,"isMsgDelegateEncodeObject",{enumerable:!0,get:function(){return w.isMsgDelegateEncodeObject}}),Object.defineProperty(e,"isMsgDepositEncodeObject",{enumerable:!0,get:function(){return w.isMsgDepositEncodeObject}}),Object.defineProperty(e,"isMsgEditValidatorEncodeObject",{enumerable:!0,get:function(){return w.isMsgEditValidatorEncodeObject}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return w.isMsgSendEncodeObject}}),Object.defineProperty(e,"isMsgSubmitProposalEncodeObject",{enumerable:!0,get:function(){return w.isMsgSubmitProposalEncodeObject}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return w.isMsgTransferEncodeObject}}),Object.defineProperty(e,"isMsgUndelegateEncodeObject",{enumerable:!0,get:function(){return w.isMsgUndelegateEncodeObject}}),Object.defineProperty(e,"isMsgVoteEncodeObject",{enumerable:!0,get:function(){return w.isMsgVoteEncodeObject}}),Object.defineProperty(e,"isMsgVoteWeightedEncodeObject",{enumerable:!0,get:function(){return w.isMsgVoteWeightedEncodeObject}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return w.isMsgWithdrawDelegatorRewardEncodeObject}}),Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return w.setupAuthExtension}}),Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return w.setupAuthzExtension}}),Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return w.setupBankExtension}}),Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return w.setupDistributionExtension}}),Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return w.setupFeegrantExtension}}),Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return w.setupGovExtension}}),Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return w.setupIbcExtension}}),Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return w.setupMintExtension}}),Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return w.setupSlashingExtension}}),Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return w.setupStakingExtension}}),Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return w.setupTxExtension}});var D=Nt;Object.defineProperty(e,"makeMultisignedTx",{enumerable:!0,get:function(){return D.makeMultisignedTx}}),Object.defineProperty(e,"makeMultisignedTxBytes",{enumerable:!0,get:function(){return D.makeMultisignedTxBytes}});var J=Ke;Object.defineProperty(e,"createPagination",{enumerable:!0,get:function(){return J.createPagination}}),Object.defineProperty(e,"createProtobufRpcClient",{enumerable:!0,get:function(){return J.createProtobufRpcClient}}),Object.defineProperty(e,"decodeCosmosSdkDecFromProto",{enumerable:!0,get:function(){return J.decodeCosmosSdkDecFromProto}}),Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return J.QueryClient}});var I=go;Object.defineProperty(e,"isSearchTxQueryArray",{enumerable:!0,get:function(){return I.isSearchTxQueryArray}});var g=zm;Object.defineProperty(e,"createDefaultAminoConverters",{enumerable:!0,get:function(){return g.createDefaultAminoConverters}}),Object.defineProperty(e,"defaultRegistryTypes",{enumerable:!0,get:function(){return g.defaultRegistryTypes}}),Object.defineProperty(e,"SigningStargateClient",{enumerable:!0,get:function(){return g.SigningStargateClient}});var R=De;Object.defineProperty(e,"assertIsDeliverTxFailure",{enumerable:!0,get:function(){return R.assertIsDeliverTxFailure}}),Object.defineProperty(e,"assertIsDeliverTxSuccess",{enumerable:!0,get:function(){return R.assertIsDeliverTxSuccess}}),Object.defineProperty(e,"BroadcastTxError",{enumerable:!0,get:function(){return R.BroadcastTxError}}),Object.defineProperty(e,"isDeliverTxFailure",{enumerable:!0,get:function(){return R.isDeliverTxFailure}}),Object.defineProperty(e,"isDeliverTxSuccess",{enumerable:!0,get:function(){return R.isDeliverTxSuccess}}),Object.defineProperty(e,"StargateClient",{enumerable:!0,get:function(){return R.StargateClient}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return R.TimeoutError}});var B=st;Object.defineProperty(e,"coin",{enumerable:!0,get:function(){return B.coin}}),Object.defineProperty(e,"coins",{enumerable:!0,get:function(){return B.coins}}),Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return B.makeCosmoshubPath}}),Object.defineProperty(e,"parseCoins",{enumerable:!0,get:function(){return B.parseCoins}})})(er);var el={},bo={},Vs={},_t={};Object.defineProperty(_t,"__esModule",{value:!0});_t.createWasmAminoConverters=_t.accessTypeToString=_t.accessTypeFromString=void 0;const mu=zn,Pn=de,ln=mc;function Yy(e){switch(e){case"Unspecified":return ln.AccessType.ACCESS_TYPE_UNSPECIFIED;case"Nobody":return ln.AccessType.ACCESS_TYPE_NOBODY;case"OnlyAddress":return ln.AccessType.ACCESS_TYPE_ONLY_ADDRESS;case"Everybody":return ln.AccessType.ACCESS_TYPE_EVERYBODY;case"AnyOfAddresses":return ln.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES;default:return ln.AccessType.UNRECOGNIZED}}_t.accessTypeFromString=Yy;function Zy(e){switch(e){case ln.AccessType.ACCESS_TYPE_UNSPECIFIED:return"Unspecified";case ln.AccessType.ACCESS_TYPE_NOBODY:return"Nobody";case ln.AccessType.ACCESS_TYPE_ONLY_ADDRESS:return"OnlyAddress";case ln.AccessType.ACCESS_TYPE_EVERYBODY:return"Everybody";case ln.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES:return"AnyOfAddresses";case ln.AccessType.UNRECOGNIZED:default:return"UNRECOGNIZED"}}_t.accessTypeToString=Zy;function D0(){return{"/cosmwasm.wasm.v1.MsgStoreCode":{aminoType:"wasm/MsgStoreCode",toAmino:({sender:e,wasmByteCode:n,instantiatePermission:t})=>({sender:e,wasm_byte_code:(0,Pn.toBase64)(n),instantiate_permission:t?{permission:Zy(t.permission),address:t.address||void 0,addresses:t.addresses.length!==0?t.addresses:void 0}:void 0}),fromAmino:({sender:e,wasm_byte_code:n,instantiate_permission:t})=>({sender:e,wasmByteCode:(0,Pn.fromBase64)(n),instantiatePermission:t?ln.AccessConfig.fromPartial({permission:Yy(t.permission),address:t.address??"",addresses:t.addresses??[]}):void 0})},"/cosmwasm.wasm.v1.MsgInstantiateContract":{aminoType:"wasm/MsgInstantiateContract",toAmino:({sender:e,codeId:n,label:t,msg:r,funds:o,admin:h})=>({sender:e,code_id:n.toString(),label:t,msg:JSON.parse((0,Pn.fromUtf8)(r)),funds:o,admin:(0,mu.omitDefault)(h)}),fromAmino:({sender:e,code_id:n,label:t,msg:r,funds:o,admin:h})=>({sender:e,codeId:BigInt(n),label:t,msg:(0,Pn.toUtf8)(JSON.stringify(r)),funds:[...o],admin:h??""})},"/cosmwasm.wasm.v1.MsgInstantiateContract2":{aminoType:"wasm/MsgInstantiateContract2",toAmino:({sender:e,codeId:n,label:t,msg:r,funds:o,admin:h,salt:v,fixMsg:C})=>({sender:e,code_id:n.toString(),label:t,msg:JSON.parse((0,Pn.fromUtf8)(r)),funds:o,admin:(0,mu.omitDefault)(h),salt:(0,Pn.toBase64)(v),fix_msg:(0,mu.omitDefault)(C)}),fromAmino:({sender:e,code_id:n,label:t,msg:r,funds:o,admin:h,salt:v,fix_msg:C})=>({sender:e,codeId:BigInt(n),label:t,msg:(0,Pn.toUtf8)(JSON.stringify(r)),funds:[...o],admin:h??"",salt:(0,Pn.fromBase64)(v),fixMsg:C??!1})},"/cosmwasm.wasm.v1.MsgUpdateAdmin":{aminoType:"wasm/MsgUpdateAdmin",toAmino:({sender:e,newAdmin:n,contract:t})=>({sender:e,new_admin:n,contract:t}),fromAmino:({sender:e,new_admin:n,contract:t})=>({sender:e,newAdmin:n,contract:t})},"/cosmwasm.wasm.v1.MsgClearAdmin":{aminoType:"wasm/MsgClearAdmin",toAmino:({sender:e,contract:n})=>({sender:e,contract:n}),fromAmino:({sender:e,contract:n})=>({sender:e,contract:n})},"/cosmwasm.wasm.v1.MsgExecuteContract":{aminoType:"wasm/MsgExecuteContract",toAmino:({sender:e,contract:n,msg:t,funds:r})=>({sender:e,contract:n,msg:JSON.parse((0,Pn.fromUtf8)(t)),funds:r}),fromAmino:({sender:e,contract:n,msg:t,funds:r})=>({sender:e,contract:n,msg:(0,Pn.toUtf8)(JSON.stringify(t)),funds:[...r]})},"/cosmwasm.wasm.v1.MsgMigrateContract":{aminoType:"wasm/MsgMigrateContract",toAmino:({sender:e,contract:n,codeId:t,msg:r})=>({sender:e,contract:n,code_id:t.toString(),msg:JSON.parse((0,Pn.fromUtf8)(r))}),fromAmino:({sender:e,contract:n,code_id:t,msg:r})=>({sender:e,contract:n,codeId:BigInt(t),msg:(0,Pn.toUtf8)(JSON.stringify(r))})}}}_t.createWasmAminoConverters=D0;var we={};Object.defineProperty(we,"__esModule",{value:!0});we.isMsgExecuteEncodeObject=we.isMsgMigrateEncodeObject=we.isMsgClearAdminEncodeObject=we.isMsgUpdateAdminEncodeObject=we.isMsgInstantiateContract2EncodeObject=we.isMsgInstantiateContractEncodeObject=we.isMsgStoreCodeEncodeObject=we.wasmTypes=void 0;const qt=kp;we.wasmTypes=[["/cosmwasm.wasm.v1.MsgClearAdmin",qt.MsgClearAdmin],["/cosmwasm.wasm.v1.MsgExecuteContract",qt.MsgExecuteContract],["/cosmwasm.wasm.v1.MsgMigrateContract",qt.MsgMigrateContract],["/cosmwasm.wasm.v1.MsgStoreCode",qt.MsgStoreCode],["/cosmwasm.wasm.v1.MsgInstantiateContract",qt.MsgInstantiateContract],["/cosmwasm.wasm.v1.MsgInstantiateContract2",qt.MsgInstantiateContract2],["/cosmwasm.wasm.v1.MsgUpdateAdmin",qt.MsgUpdateAdmin]];function M0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgStoreCode"}we.isMsgStoreCodeEncodeObject=M0;function q0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgInstantiateContract"}we.isMsgInstantiateContractEncodeObject=q0;function H0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgInstantiateContract2"}we.isMsgInstantiateContract2EncodeObject=H0;function V0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgUpdateAdmin"}we.isMsgUpdateAdminEncodeObject=V0;function Q0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgClearAdmin"}we.isMsgClearAdminEncodeObject=Q0;function W0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgMigrateContract"}we.isMsgMigrateEncodeObject=W0;function F0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgExecuteContract"}we.isMsgExecuteEncodeObject=F0;var Qs={},Xy={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueryClientImpl=e.QueryContractsByCreatorResponse=e.QueryContractsByCreatorRequest=e.QueryParamsResponse=e.QueryParamsRequest=e.QueryPinnedCodesResponse=e.QueryPinnedCodesRequest=e.QueryCodesResponse=e.QueryCodesRequest=e.QueryCodeResponse=e.CodeInfoResponse=e.QueryCodeRequest=e.QuerySmartContractStateResponse=e.QuerySmartContractStateRequest=e.QueryRawContractStateResponse=e.QueryRawContractStateRequest=e.QueryAllContractStateResponse=e.QueryAllContractStateRequest=e.QueryContractsByCodeResponse=e.QueryContractsByCodeRequest=e.QueryContractHistoryResponse=e.QueryContractHistoryRequest=e.QueryContractInfoResponse=e.QueryContractInfoRequest=e.protobufPackage=void 0;const n=be,t=mc,r=ee,o=ne;e.protobufPackage="cosmwasm.wasm.v1";function h(){return{address:""}}e.QueryContractInfoRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractInfoRequest",encode(f,p=r.BinaryWriter.create()){return f.address!==""&&p.uint32(10).string(f.address),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=h();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.address=A.string();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=h();return(0,o.isSet)(f.address)&&(p.address=String(f.address)),p},toJSON(f){const p={};return f.address!==void 0&&(p.address=f.address),p},fromPartial(f){const p=h();return p.address=f.address??"",p}};function v(){return{address:"",contractInfo:t.ContractInfo.fromPartial({})}}e.QueryContractInfoResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractInfoResponse",encode(f,p=r.BinaryWriter.create()){return f.address!==""&&p.uint32(10).string(f.address),f.contractInfo!==void 0&&t.ContractInfo.encode(f.contractInfo,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=v();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.address=A.string();break;case 2:M.contractInfo=t.ContractInfo.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=v();return(0,o.isSet)(f.address)&&(p.address=String(f.address)),(0,o.isSet)(f.contractInfo)&&(p.contractInfo=t.ContractInfo.fromJSON(f.contractInfo)),p},toJSON(f){const p={};return f.address!==void 0&&(p.address=f.address),f.contractInfo!==void 0&&(p.contractInfo=f.contractInfo?t.ContractInfo.toJSON(f.contractInfo):void 0),p},fromPartial(f){const p=v();return p.address=f.address??"",f.contractInfo!==void 0&&f.contractInfo!==null&&(p.contractInfo=t.ContractInfo.fromPartial(f.contractInfo)),p}};function C(){return{address:"",pagination:void 0}}e.QueryContractHistoryRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractHistoryRequest",encode(f,p=r.BinaryWriter.create()){return f.address!==""&&p.uint32(10).string(f.address),f.pagination!==void 0&&n.PageRequest.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=C();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.address=A.string();break;case 2:M.pagination=n.PageRequest.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=C();return(0,o.isSet)(f.address)&&(p.address=String(f.address)),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageRequest.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.address!==void 0&&(p.address=f.address),f.pagination!==void 0&&(p.pagination=f.pagination?n.PageRequest.toJSON(f.pagination):void 0),p},fromPartial(f){const p=C();return p.address=f.address??"",f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageRequest.fromPartial(f.pagination)),p}};function w(){return{entries:[],pagination:void 0}}e.QueryContractHistoryResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractHistoryResponse",encode(f,p=r.BinaryWriter.create()){for(const A of f.entries)t.ContractCodeHistoryEntry.encode(A,p.uint32(10).fork()).ldelim();return f.pagination!==void 0&&n.PageResponse.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=w();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.entries.push(t.ContractCodeHistoryEntry.decode(A,A.uint32()));break;case 2:M.pagination=n.PageResponse.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=w();return Array.isArray(f==null?void 0:f.entries)&&(p.entries=f.entries.map(A=>t.ContractCodeHistoryEntry.fromJSON(A))),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageResponse.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.entries?p.entries=f.entries.map(A=>A?t.ContractCodeHistoryEntry.toJSON(A):void 0):p.entries=[],f.pagination!==void 0&&(p.pagination=f.pagination?n.PageResponse.toJSON(f.pagination):void 0),p},fromPartial(f){var A;const p=w();return p.entries=((A=f.entries)==null?void 0:A.map(Q=>t.ContractCodeHistoryEntry.fromPartial(Q)))||[],f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageResponse.fromPartial(f.pagination)),p}};function D(){return{codeId:BigInt(0),pagination:void 0}}e.QueryContractsByCodeRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCodeRequest",encode(f,p=r.BinaryWriter.create()){return f.codeId!==BigInt(0)&&p.uint32(8).uint64(f.codeId),f.pagination!==void 0&&n.PageRequest.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=D();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.codeId=A.uint64();break;case 2:M.pagination=n.PageRequest.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=D();return(0,o.isSet)(f.codeId)&&(p.codeId=BigInt(f.codeId.toString())),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageRequest.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.codeId!==void 0&&(p.codeId=(f.codeId||BigInt(0)).toString()),f.pagination!==void 0&&(p.pagination=f.pagination?n.PageRequest.toJSON(f.pagination):void 0),p},fromPartial(f){const p=D();return f.codeId!==void 0&&f.codeId!==null&&(p.codeId=BigInt(f.codeId.toString())),f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageRequest.fromPartial(f.pagination)),p}};function J(){return{contracts:[],pagination:void 0}}e.QueryContractsByCodeResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCodeResponse",encode(f,p=r.BinaryWriter.create()){for(const A of f.contracts)p.uint32(10).string(A);return f.pagination!==void 0&&n.PageResponse.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=J();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.contracts.push(A.string());break;case 2:M.pagination=n.PageResponse.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=J();return Array.isArray(f==null?void 0:f.contracts)&&(p.contracts=f.contracts.map(A=>String(A))),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageResponse.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.contracts?p.contracts=f.contracts.map(A=>A):p.contracts=[],f.pagination!==void 0&&(p.pagination=f.pagination?n.PageResponse.toJSON(f.pagination):void 0),p},fromPartial(f){var A;const p=J();return p.contracts=((A=f.contracts)==null?void 0:A.map(Q=>Q))||[],f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageResponse.fromPartial(f.pagination)),p}};function I(){return{address:"",pagination:void 0}}e.QueryAllContractStateRequest={typeUrl:"/cosmwasm.wasm.v1.QueryAllContractStateRequest",encode(f,p=r.BinaryWriter.create()){return f.address!==""&&p.uint32(10).string(f.address),f.pagination!==void 0&&n.PageRequest.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=I();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.address=A.string();break;case 2:M.pagination=n.PageRequest.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=I();return(0,o.isSet)(f.address)&&(p.address=String(f.address)),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageRequest.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.address!==void 0&&(p.address=f.address),f.pagination!==void 0&&(p.pagination=f.pagination?n.PageRequest.toJSON(f.pagination):void 0),p},fromPartial(f){const p=I();return p.address=f.address??"",f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageRequest.fromPartial(f.pagination)),p}};function g(){return{models:[],pagination:void 0}}e.QueryAllContractStateResponse={typeUrl:"/cosmwasm.wasm.v1.QueryAllContractStateResponse",encode(f,p=r.BinaryWriter.create()){for(const A of f.models)t.Model.encode(A,p.uint32(10).fork()).ldelim();return f.pagination!==void 0&&n.PageResponse.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=g();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.models.push(t.Model.decode(A,A.uint32()));break;case 2:M.pagination=n.PageResponse.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=g();return Array.isArray(f==null?void 0:f.models)&&(p.models=f.models.map(A=>t.Model.fromJSON(A))),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageResponse.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.models?p.models=f.models.map(A=>A?t.Model.toJSON(A):void 0):p.models=[],f.pagination!==void 0&&(p.pagination=f.pagination?n.PageResponse.toJSON(f.pagination):void 0),p},fromPartial(f){var A;const p=g();return p.models=((A=f.models)==null?void 0:A.map(Q=>t.Model.fromPartial(Q)))||[],f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageResponse.fromPartial(f.pagination)),p}};function R(){return{address:"",queryData:new Uint8Array}}e.QueryRawContractStateRequest={typeUrl:"/cosmwasm.wasm.v1.QueryRawContractStateRequest",encode(f,p=r.BinaryWriter.create()){return f.address!==""&&p.uint32(10).string(f.address),f.queryData.length!==0&&p.uint32(18).bytes(f.queryData),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=R();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.address=A.string();break;case 2:M.queryData=A.bytes();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=R();return(0,o.isSet)(f.address)&&(p.address=String(f.address)),(0,o.isSet)(f.queryData)&&(p.queryData=(0,o.bytesFromBase64)(f.queryData)),p},toJSON(f){const p={};return f.address!==void 0&&(p.address=f.address),f.queryData!==void 0&&(p.queryData=(0,o.base64FromBytes)(f.queryData!==void 0?f.queryData:new Uint8Array)),p},fromPartial(f){const p=R();return p.address=f.address??"",p.queryData=f.queryData??new Uint8Array,p}};function B(){return{data:new Uint8Array}}e.QueryRawContractStateResponse={typeUrl:"/cosmwasm.wasm.v1.QueryRawContractStateResponse",encode(f,p=r.BinaryWriter.create()){return f.data.length!==0&&p.uint32(10).bytes(f.data),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=B();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.data=A.bytes();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=B();return(0,o.isSet)(f.data)&&(p.data=(0,o.bytesFromBase64)(f.data)),p},toJSON(f){const p={};return f.data!==void 0&&(p.data=(0,o.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),p},fromPartial(f){const p=B();return p.data=f.data??new Uint8Array,p}};function d(){return{address:"",queryData:new Uint8Array}}e.QuerySmartContractStateRequest={typeUrl:"/cosmwasm.wasm.v1.QuerySmartContractStateRequest",encode(f,p=r.BinaryWriter.create()){return f.address!==""&&p.uint32(10).string(f.address),f.queryData.length!==0&&p.uint32(18).bytes(f.queryData),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=d();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.address=A.string();break;case 2:M.queryData=A.bytes();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=d();return(0,o.isSet)(f.address)&&(p.address=String(f.address)),(0,o.isSet)(f.queryData)&&(p.queryData=(0,o.bytesFromBase64)(f.queryData)),p},toJSON(f){const p={};return f.address!==void 0&&(p.address=f.address),f.queryData!==void 0&&(p.queryData=(0,o.base64FromBytes)(f.queryData!==void 0?f.queryData:new Uint8Array)),p},fromPartial(f){const p=d();return p.address=f.address??"",p.queryData=f.queryData??new Uint8Array,p}};function s(){return{data:new Uint8Array}}e.QuerySmartContractStateResponse={typeUrl:"/cosmwasm.wasm.v1.QuerySmartContractStateResponse",encode(f,p=r.BinaryWriter.create()){return f.data.length!==0&&p.uint32(10).bytes(f.data),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=s();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.data=A.bytes();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=s();return(0,o.isSet)(f.data)&&(p.data=(0,o.bytesFromBase64)(f.data)),p},toJSON(f){const p={};return f.data!==void 0&&(p.data=(0,o.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),p},fromPartial(f){const p=s();return p.data=f.data??new Uint8Array,p}};function y(){return{codeId:BigInt(0)}}e.QueryCodeRequest={typeUrl:"/cosmwasm.wasm.v1.QueryCodeRequest",encode(f,p=r.BinaryWriter.create()){return f.codeId!==BigInt(0)&&p.uint32(8).uint64(f.codeId),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=y();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.codeId=A.uint64();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=y();return(0,o.isSet)(f.codeId)&&(p.codeId=BigInt(f.codeId.toString())),p},toJSON(f){const p={};return f.codeId!==void 0&&(p.codeId=(f.codeId||BigInt(0)).toString()),p},fromPartial(f){const p=y();return f.codeId!==void 0&&f.codeId!==null&&(p.codeId=BigInt(f.codeId.toString())),p}};function E(){return{codeId:BigInt(0),creator:"",dataHash:new Uint8Array,instantiatePermission:t.AccessConfig.fromPartial({})}}e.CodeInfoResponse={typeUrl:"/cosmwasm.wasm.v1.CodeInfoResponse",encode(f,p=r.BinaryWriter.create()){return f.codeId!==BigInt(0)&&p.uint32(8).uint64(f.codeId),f.creator!==""&&p.uint32(18).string(f.creator),f.dataHash.length!==0&&p.uint32(26).bytes(f.dataHash),f.instantiatePermission!==void 0&&t.AccessConfig.encode(f.instantiatePermission,p.uint32(50).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=E();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.codeId=A.uint64();break;case 2:M.creator=A.string();break;case 3:M.dataHash=A.bytes();break;case 6:M.instantiatePermission=t.AccessConfig.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=E();return(0,o.isSet)(f.codeId)&&(p.codeId=BigInt(f.codeId.toString())),(0,o.isSet)(f.creator)&&(p.creator=String(f.creator)),(0,o.isSet)(f.dataHash)&&(p.dataHash=(0,o.bytesFromBase64)(f.dataHash)),(0,o.isSet)(f.instantiatePermission)&&(p.instantiatePermission=t.AccessConfig.fromJSON(f.instantiatePermission)),p},toJSON(f){const p={};return f.codeId!==void 0&&(p.codeId=(f.codeId||BigInt(0)).toString()),f.creator!==void 0&&(p.creator=f.creator),f.dataHash!==void 0&&(p.dataHash=(0,o.base64FromBytes)(f.dataHash!==void 0?f.dataHash:new Uint8Array)),f.instantiatePermission!==void 0&&(p.instantiatePermission=f.instantiatePermission?t.AccessConfig.toJSON(f.instantiatePermission):void 0),p},fromPartial(f){const p=E();return f.codeId!==void 0&&f.codeId!==null&&(p.codeId=BigInt(f.codeId.toString())),p.creator=f.creator??"",p.dataHash=f.dataHash??new Uint8Array,f.instantiatePermission!==void 0&&f.instantiatePermission!==null&&(p.instantiatePermission=t.AccessConfig.fromPartial(f.instantiatePermission)),p}};function _(){return{codeInfo:void 0,data:new Uint8Array}}e.QueryCodeResponse={typeUrl:"/cosmwasm.wasm.v1.QueryCodeResponse",encode(f,p=r.BinaryWriter.create()){return f.codeInfo!==void 0&&e.CodeInfoResponse.encode(f.codeInfo,p.uint32(10).fork()).ldelim(),f.data.length!==0&&p.uint32(18).bytes(f.data),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=_();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.codeInfo=e.CodeInfoResponse.decode(A,A.uint32());break;case 2:M.data=A.bytes();break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=_();return(0,o.isSet)(f.codeInfo)&&(p.codeInfo=e.CodeInfoResponse.fromJSON(f.codeInfo)),(0,o.isSet)(f.data)&&(p.data=(0,o.bytesFromBase64)(f.data)),p},toJSON(f){const p={};return f.codeInfo!==void 0&&(p.codeInfo=f.codeInfo?e.CodeInfoResponse.toJSON(f.codeInfo):void 0),f.data!==void 0&&(p.data=(0,o.base64FromBytes)(f.data!==void 0?f.data:new Uint8Array)),p},fromPartial(f){const p=_();return f.codeInfo!==void 0&&f.codeInfo!==null&&(p.codeInfo=e.CodeInfoResponse.fromPartial(f.codeInfo)),p.data=f.data??new Uint8Array,p}};function U(){return{pagination:void 0}}e.QueryCodesRequest={typeUrl:"/cosmwasm.wasm.v1.QueryCodesRequest",encode(f,p=r.BinaryWriter.create()){return f.pagination!==void 0&&n.PageRequest.encode(f.pagination,p.uint32(10).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=U();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.pagination=n.PageRequest.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=U();return(0,o.isSet)(f.pagination)&&(p.pagination=n.PageRequest.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.pagination!==void 0&&(p.pagination=f.pagination?n.PageRequest.toJSON(f.pagination):void 0),p},fromPartial(f){const p=U();return f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageRequest.fromPartial(f.pagination)),p}};function H(){return{codeInfos:[],pagination:void 0}}e.QueryCodesResponse={typeUrl:"/cosmwasm.wasm.v1.QueryCodesResponse",encode(f,p=r.BinaryWriter.create()){for(const A of f.codeInfos)e.CodeInfoResponse.encode(A,p.uint32(10).fork()).ldelim();return f.pagination!==void 0&&n.PageResponse.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=H();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.codeInfos.push(e.CodeInfoResponse.decode(A,A.uint32()));break;case 2:M.pagination=n.PageResponse.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=H();return Array.isArray(f==null?void 0:f.codeInfos)&&(p.codeInfos=f.codeInfos.map(A=>e.CodeInfoResponse.fromJSON(A))),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageResponse.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.codeInfos?p.codeInfos=f.codeInfos.map(A=>A?e.CodeInfoResponse.toJSON(A):void 0):p.codeInfos=[],f.pagination!==void 0&&(p.pagination=f.pagination?n.PageResponse.toJSON(f.pagination):void 0),p},fromPartial(f){var A;const p=H();return p.codeInfos=((A=f.codeInfos)==null?void 0:A.map(Q=>e.CodeInfoResponse.fromPartial(Q)))||[],f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageResponse.fromPartial(f.pagination)),p}};function i(){return{pagination:void 0}}e.QueryPinnedCodesRequest={typeUrl:"/cosmwasm.wasm.v1.QueryPinnedCodesRequest",encode(f,p=r.BinaryWriter.create()){return f.pagination!==void 0&&n.PageRequest.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=i();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 2:M.pagination=n.PageRequest.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=i();return(0,o.isSet)(f.pagination)&&(p.pagination=n.PageRequest.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.pagination!==void 0&&(p.pagination=f.pagination?n.PageRequest.toJSON(f.pagination):void 0),p},fromPartial(f){const p=i();return f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageRequest.fromPartial(f.pagination)),p}};function m(){return{codeIds:[],pagination:void 0}}e.QueryPinnedCodesResponse={typeUrl:"/cosmwasm.wasm.v1.QueryPinnedCodesResponse",encode(f,p=r.BinaryWriter.create()){p.uint32(10).fork();for(const A of f.codeIds)p.uint64(A);return p.ldelim(),f.pagination!==void 0&&n.PageResponse.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=m();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:if((a&7)===2){const k=A.uint32()+A.pos;for(;A.pos<k;)M.codeIds.push(A.uint64())}else M.codeIds.push(A.uint64());break;case 2:M.pagination=n.PageResponse.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=m();return Array.isArray(f==null?void 0:f.codeIds)&&(p.codeIds=f.codeIds.map(A=>BigInt(A.toString()))),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageResponse.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.codeIds?p.codeIds=f.codeIds.map(A=>(A||BigInt(0)).toString()):p.codeIds=[],f.pagination!==void 0&&(p.pagination=f.pagination?n.PageResponse.toJSON(f.pagination):void 0),p},fromPartial(f){var A;const p=m();return p.codeIds=((A=f.codeIds)==null?void 0:A.map(Q=>BigInt(Q.toString())))||[],f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageResponse.fromPartial(f.pagination)),p}};function N(){return{}}e.QueryParamsRequest={typeUrl:"/cosmwasm.wasm.v1.QueryParamsRequest",encode(f,p=r.BinaryWriter.create()){return p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=N();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){default:A.skipType(a&7);break}}return M},fromJSON(f){return N()},toJSON(f){return{}},fromPartial(f){return N()}};function V(){return{params:t.Params.fromPartial({})}}e.QueryParamsResponse={typeUrl:"/cosmwasm.wasm.v1.QueryParamsResponse",encode(f,p=r.BinaryWriter.create()){return f.params!==void 0&&t.Params.encode(f.params,p.uint32(10).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=V();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.params=t.Params.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=V();return(0,o.isSet)(f.params)&&(p.params=t.Params.fromJSON(f.params)),p},toJSON(f){const p={};return f.params!==void 0&&(p.params=f.params?t.Params.toJSON(f.params):void 0),p},fromPartial(f){const p=V();return f.params!==void 0&&f.params!==null&&(p.params=t.Params.fromPartial(f.params)),p}};function u(){return{creatorAddress:"",pagination:void 0}}e.QueryContractsByCreatorRequest={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCreatorRequest",encode(f,p=r.BinaryWriter.create()){return f.creatorAddress!==""&&p.uint32(10).string(f.creatorAddress),f.pagination!==void 0&&n.PageRequest.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=u();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.creatorAddress=A.string();break;case 2:M.pagination=n.PageRequest.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=u();return(0,o.isSet)(f.creatorAddress)&&(p.creatorAddress=String(f.creatorAddress)),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageRequest.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.creatorAddress!==void 0&&(p.creatorAddress=f.creatorAddress),f.pagination!==void 0&&(p.pagination=f.pagination?n.PageRequest.toJSON(f.pagination):void 0),p},fromPartial(f){const p=u();return p.creatorAddress=f.creatorAddress??"",f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageRequest.fromPartial(f.pagination)),p}};function l(){return{contractAddresses:[],pagination:void 0}}e.QueryContractsByCreatorResponse={typeUrl:"/cosmwasm.wasm.v1.QueryContractsByCreatorResponse",encode(f,p=r.BinaryWriter.create()){for(const A of f.contractAddresses)p.uint32(10).string(A);return f.pagination!==void 0&&n.PageResponse.encode(f.pagination,p.uint32(18).fork()).ldelim(),p},decode(f,p){const A=f instanceof r.BinaryReader?f:new r.BinaryReader(f);let Q=p===void 0?A.len:A.pos+p;const M=l();for(;A.pos<Q;){const a=A.uint32();switch(a>>>3){case 1:M.contractAddresses.push(A.string());break;case 2:M.pagination=n.PageResponse.decode(A,A.uint32());break;default:A.skipType(a&7);break}}return M},fromJSON(f){const p=l();return Array.isArray(f==null?void 0:f.contractAddresses)&&(p.contractAddresses=f.contractAddresses.map(A=>String(A))),(0,o.isSet)(f.pagination)&&(p.pagination=n.PageResponse.fromJSON(f.pagination)),p},toJSON(f){const p={};return f.contractAddresses?p.contractAddresses=f.contractAddresses.map(A=>A):p.contractAddresses=[],f.pagination!==void 0&&(p.pagination=f.pagination?n.PageResponse.toJSON(f.pagination):void 0),p},fromPartial(f){var A;const p=l();return p.contractAddresses=((A=f.contractAddresses)==null?void 0:A.map(Q=>Q))||[],f.pagination!==void 0&&f.pagination!==null&&(p.pagination=n.PageResponse.fromPartial(f.pagination)),p}};class T{constructor(p){this.rpc=p,this.ContractInfo=this.ContractInfo.bind(this),this.ContractHistory=this.ContractHistory.bind(this),this.ContractsByCode=this.ContractsByCode.bind(this),this.AllContractState=this.AllContractState.bind(this),this.RawContractState=this.RawContractState.bind(this),this.SmartContractState=this.SmartContractState.bind(this),this.Code=this.Code.bind(this),this.Codes=this.Codes.bind(this),this.PinnedCodes=this.PinnedCodes.bind(this),this.Params=this.Params.bind(this),this.ContractsByCreator=this.ContractsByCreator.bind(this)}ContractInfo(p){const A=e.QueryContractInfoRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractInfo",A).then(M=>e.QueryContractInfoResponse.decode(new r.BinaryReader(M)))}ContractHistory(p){const A=e.QueryContractHistoryRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractHistory",A).then(M=>e.QueryContractHistoryResponse.decode(new r.BinaryReader(M)))}ContractsByCode(p){const A=e.QueryContractsByCodeRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractsByCode",A).then(M=>e.QueryContractsByCodeResponse.decode(new r.BinaryReader(M)))}AllContractState(p){const A=e.QueryAllContractStateRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","AllContractState",A).then(M=>e.QueryAllContractStateResponse.decode(new r.BinaryReader(M)))}RawContractState(p){const A=e.QueryRawContractStateRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","RawContractState",A).then(M=>e.QueryRawContractStateResponse.decode(new r.BinaryReader(M)))}SmartContractState(p){const A=e.QuerySmartContractStateRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","SmartContractState",A).then(M=>e.QuerySmartContractStateResponse.decode(new r.BinaryReader(M)))}Code(p){const A=e.QueryCodeRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","Code",A).then(M=>e.QueryCodeResponse.decode(new r.BinaryReader(M)))}Codes(p={pagination:n.PageRequest.fromPartial({})}){const A=e.QueryCodesRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","Codes",A).then(M=>e.QueryCodesResponse.decode(new r.BinaryReader(M)))}PinnedCodes(p={pagination:n.PageRequest.fromPartial({})}){const A=e.QueryPinnedCodesRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","PinnedCodes",A).then(M=>e.QueryPinnedCodesResponse.decode(new r.BinaryReader(M)))}Params(p={}){const A=e.QueryParamsRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","Params",A).then(M=>e.QueryParamsResponse.decode(new r.BinaryReader(M)))}ContractsByCreator(p){const A=e.QueryContractsByCreatorRequest.encode(p).finish();return this.rpc.request("cosmwasm.wasm.v1.Query","ContractsByCreator",A).then(M=>e.QueryContractsByCreatorResponse.decode(new r.BinaryReader(M)))}}e.QueryClientImpl=T})(Xy);Object.defineProperty(Qs,"__esModule",{value:!0});Qs.setupWasmExtension=void 0;const nf=de,gr=er,yu=Xy;function G0(e){const n=(0,gr.createProtobufRpcClient)(e),t=new yu.QueryClientImpl(n);return{wasm:{listCodeInfo:async r=>{const o={pagination:(0,gr.createPagination)(r)};return t.Codes(o)},getCode:async r=>{const o=yu.QueryCodeRequest.fromPartial({codeId:BigInt(r)});return t.Code(o)},listContractsByCodeId:async(r,o)=>{const h=yu.QueryContractsByCodeRequest.fromPartial({codeId:BigInt(r),pagination:(0,gr.createPagination)(o)});return t.ContractsByCode(h)},listContractsByCreator:async(r,o)=>{const h={creatorAddress:r,pagination:(0,gr.createPagination)(o)};return t.ContractsByCreator(h)},getContractInfo:async r=>{const o={address:r};return t.ContractInfo(o)},getContractCodeHistory:async(r,o)=>{const h={address:r,pagination:(0,gr.createPagination)(o)};return t.ContractHistory(h)},getAllContractState:async(r,o)=>{const h={address:r,pagination:(0,gr.createPagination)(o)};return t.AllContractState(h)},queryContractRaw:async(r,o)=>{const h={address:r,queryData:o};return t.RawContractState(h)},queryContractSmart:async(r,o)=>{const h={address:r,queryData:(0,nf.toUtf8)(JSON.stringify(o))},{data:v}=await t.SmartContractState(h);let C;try{C=(0,nf.fromUtf8)(v)}catch(w){throw new Error(`Could not UTF-8 decode smart query response from contract: ${w}`)}try{return JSON.parse(C)}catch(w){throw new Error(`Could not JSON parse smart query response from contract: ${w}`)}}}}}Qs.setupWasmExtension=G0;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.setupWasmExtension=e.wasmTypes=e.isMsgUpdateAdminEncodeObject=e.isMsgStoreCodeEncodeObject=e.isMsgMigrateEncodeObject=e.isMsgInstantiateContractEncodeObject=e.isMsgInstantiateContract2EncodeObject=e.isMsgExecuteEncodeObject=e.isMsgClearAdminEncodeObject=e.createWasmAminoConverters=void 0;var n=_t;Object.defineProperty(e,"createWasmAminoConverters",{enumerable:!0,get:function(){return n.createWasmAminoConverters}});var t=we;Object.defineProperty(e,"isMsgClearAdminEncodeObject",{enumerable:!0,get:function(){return t.isMsgClearAdminEncodeObject}}),Object.defineProperty(e,"isMsgExecuteEncodeObject",{enumerable:!0,get:function(){return t.isMsgExecuteEncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContract2EncodeObject",{enumerable:!0,get:function(){return t.isMsgInstantiateContract2EncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContractEncodeObject",{enumerable:!0,get:function(){return t.isMsgInstantiateContractEncodeObject}}),Object.defineProperty(e,"isMsgMigrateEncodeObject",{enumerable:!0,get:function(){return t.isMsgMigrateEncodeObject}}),Object.defineProperty(e,"isMsgStoreCodeEncodeObject",{enumerable:!0,get:function(){return t.isMsgStoreCodeEncodeObject}}),Object.defineProperty(e,"isMsgUpdateAdminEncodeObject",{enumerable:!0,get:function(){return t.isMsgUpdateAdminEncodeObject}}),Object.defineProperty(e,"wasmTypes",{enumerable:!0,get:function(){return t.wasmTypes}});var r=Qs;Object.defineProperty(e,"setupWasmExtension",{enumerable:!0,get:function(){return r.setupWasmExtension}})})(Vs);Object.defineProperty(bo,"__esModule",{value:!0});bo.CosmWasmClient=void 0;const Sr=de,tf=Te,dt=er,rf=So,kr=Oe,L0=hs,hu=mc,$0=Vs;class va{static async connect(n){const t=await(0,rf.connectComet)(n);return va.create(t)}static async create(n){return new va(n)}constructor(n){this.codesCache=new Map,n&&(this.cometClient=n,this.queryClient=dt.QueryClient.withExtensions(n,dt.setupAuthExtension,dt.setupBankExtension,$0.setupWasmExtension,dt.setupTxExtension))}getCometClient(){return this.cometClient}forceGetCometClient(){if(!this.cometClient)throw new Error("Comet client not available. You cannot use online functionality in offline mode.");return this.cometClient}getQueryClient(){return this.queryClient}forceGetQueryClient(){if(!this.queryClient)throw new Error("Query client not available. You cannot use online functionality in offline mode.");return this.queryClient}async getChainId(){if(!this.chainId){const t=(await this.forceGetCometClient().status()).nodeInfo.network;if(!t)throw new Error("Chain ID must not be empty");this.chainId=t}return this.chainId}async getHeight(){return(await this.forceGetCometClient().status()).syncInfo.latestBlockHeight}async getAccount(n){try{const t=await this.forceGetQueryClient().auth.account(n);return t?(0,dt.accountFromAny)(t):null}catch(t){if(/rpc error: code = NotFound/i.test(t.toString()))return null;throw t}}async getSequence(n){const t=await this.getAccount(n);if(!t)throw new Error(`Account '${n}' does not exist on chain. Send some tokens there before trying to query sequence.`);return{accountNumber:t.accountNumber,sequence:t.sequence}}async getBlock(n){const t=await this.forceGetCometClient().block(n);return{id:(0,Sr.toHex)(t.blockId.hash).toUpperCase(),header:{version:{block:new tf.Uint53(t.block.header.version.block).toString(),app:new tf.Uint53(t.block.header.version.app).toString()},height:t.block.header.height,chainId:t.block.header.chainId,time:(0,rf.toRfc3339WithNanoseconds)(t.block.header.time)},txs:t.block.txs}}async getBalance(n,t){return this.forceGetQueryClient().bank.balance(n,t)}async getTx(n){return(await this.txsQuery(`tx.hash='${n}'`))[0]??null}async searchTx(n){let t;if(typeof n=="string")t=n;else if((0,dt.isSearchTxQueryArray)(n))t=n.map(r=>typeof r.value=="string"?`${r.key}='${r.value}'`:`${r.key}=${r.value}`).join(" AND ");else throw new Error("Got unsupported query type. See CosmJS 0.31 CHANGELOG for API breaking changes here.");return this.txsQuery(t)}disconnect(){this.cometClient&&this.cometClient.disconnect()}async broadcastTx(n,t=6e4,r=3e3){let o=!1;const h=setTimeout(()=>{o=!0},t),v=async w=>{if(o)throw new dt.TimeoutError(`Transaction with ID ${w} was submitted but was not yet found on the chain. You might want to check later. There was a wait of ${t/1e3} seconds.`,w);await(0,kr.sleep)(r);const D=await this.getTx(w);return D?{code:D.code,height:D.height,txIndex:D.txIndex,rawLog:D.rawLog,transactionHash:w,events:D.events,msgResponses:D.msgResponses,gasUsed:D.gasUsed,gasWanted:D.gasWanted}:v(w)},C=await this.broadcastTxSync(n);return new Promise((w,D)=>v(C).then(J=>{clearTimeout(h),w(J)},J=>{clearTimeout(h),D(J)}))}async broadcastTxSync(n){const t=await this.forceGetCometClient().broadcastTxSync({tx:n});return t.code?Promise.reject(new dt.BroadcastTxError(t.code,t.codespace??"",t.log)):(0,Sr.toHex)(t.hash).toUpperCase()}async getCodes(){const n=[];let t;do{const{codeInfos:r,pagination:o}=await this.forceGetQueryClient().wasm.listCodeInfo(t),h=r||[];n.push(...h),t=o==null?void 0:o.nextKey}while((t==null?void 0:t.length)!==0);return n.map(r=>((0,kr.assert)(r.creator&&r.codeId&&r.dataHash,"entry incomplete"),{id:Number(r.codeId),creator:r.creator,checksum:(0,Sr.toHex)(r.dataHash)}))}async getCodeDetails(n){const t=this.codesCache.get(n);if(t)return t;const{codeInfo:r,data:o}=await this.forceGetQueryClient().wasm.getCode(n);(0,kr.assert)(r&&r.codeId&&r.creator&&r.dataHash&&o,"codeInfo missing or incomplete");const h={id:Number(r.codeId),creator:r.creator,checksum:(0,Sr.toHex)(r.dataHash),data:o};return this.codesCache.set(n,h),h}async getContracts(n){const t=[];let r;do{const{contracts:o,pagination:h}=await this.forceGetQueryClient().wasm.listContractsByCodeId(n,r);t.push(...o),r=h==null?void 0:h.nextKey}while((r==null?void 0:r.length)!==0&&r!==void 0);return t}async getContractsByCreator(n){const t=[];let r;do{const{contractAddresses:o,pagination:h}=await this.forceGetQueryClient().wasm.listContractsByCreator(n,r);t.push(...o),r=h==null?void 0:h.nextKey}while((r==null?void 0:r.length)!==0&&r!==void 0);return t}async getContract(n){const{address:t,contractInfo:r}=await this.forceGetQueryClient().wasm.getContractInfo(n);if(!r)throw new Error(`No contract found at address "${n}"`);return(0,kr.assert)(t,"address missing"),(0,kr.assert)(r.codeId&&r.creator&&r.label,"contractInfo incomplete"),{address:t,codeId:Number(r.codeId),creator:r.creator,admin:r.admin||void 0,label:r.label,ibcPortId:r.ibcPortId||void 0}}async getContractCodeHistory(n){const t=await this.forceGetQueryClient().wasm.getContractCodeHistory(n);if(!t)throw new Error(`No contract history found for address "${n}"`);const r={[hu.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT]:"Init",[hu.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS]:"Genesis",[hu.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE]:"Migrate"};return(t.entries||[]).map(o=>((0,kr.assert)(o.operation&&o.codeId&&o.msg),{operation:r[o.operation],codeId:Number(o.codeId),msg:JSON.parse((0,Sr.fromUtf8)(o.msg))}))}async queryContractRaw(n,t){await this.getContract(n);const{data:r}=await this.forceGetQueryClient().wasm.queryContractRaw(n,t);return r??null}async queryContractSmart(n,t){try{return await this.forceGetQueryClient().wasm.queryContractSmart(n,t)}catch(r){throw r instanceof Error&&r.message.startsWith("not found: contract")?new Error(`No contract found at address "${n}"`):r}}async txsQuery(n){return(await this.forceGetCometClient().txSearchAll({query:n})).txs.map(r=>{const o=L0.TxMsgData.decode(r.result.data??new Uint8Array);return{height:r.height,txIndex:r.index,hash:(0,Sr.toHex)(r.hash).toUpperCase(),code:r.result.code,events:r.result.events.map(dt.fromTendermintEvent),rawLog:r.result.log||"",tx:r.tx,msgResponses:o.msgResponses,gasUsed:r.result.gasUsed,gasWanted:r.result.gasWanted}})}}bo.CosmWasmClient=va;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});Ri.fromBinary=Ri.toBinary=void 0;const Ba=de;function K0(e){return(0,Ba.toBase64)((0,Ba.toUtf8)(JSON.stringify(e)))}Ri.toBinary=K0;function z0(e){return JSON.parse((0,Ba.fromUtf8)((0,Ba.fromBase64)(e)))}Ri.fromBinary=z0;var vi={};Object.defineProperty(vi,"__esModule",{value:!0});vi.instantiate2Address=vi._instantiate2AddressIntermediate=void 0;const of=Ge,Ki=de,Y0=Te,Z0=Oe;function X0(e,n){return new of.Sha256((0,of.sha256)((0,Ki.toAscii)(e))).update(n).digest()}function Ko(e){return Y0.Uint64.fromNumber(e).toBytesBigEndian()}function xy(e,n,t,r,o){(0,Z0.assert)(e.length===32);const h=(0,Ki.fromBech32)(n).data,v=typeof r=="string"?(0,Ki.toUtf8)(r):new Uint8Array;if(t.length<1||t.length>64)throw new Error("Salt must be between 1 and 64 bytes");const C=new Uint8Array([...(0,Ki.toAscii)("wasm"),0,...Ko(e.length),...e,...Ko(h.length),...h,...Ko(t.length),...t,...Ko(v.length),...v]),w=X0("module",C),D=(0,Ki.toBech32)(o,w);return{key:C,addressData:w,address:D}}vi._instantiate2AddressIntermediate=xy;function x0(e,n,t,r){return xy(e,n,t,null,r).address}vi.instantiate2Address=x0;var Bi={},j0=x&&x.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.SigningCosmWasmClient=Bi.findAttribute=void 0;const zo=zn,eA=Ge,Ht=de,Vt=Te,ut=st,Ce=er,nA=So,Wi=Oe,tA=ja,af=ps,rA=uo,Yo=at,Qt=kp,iA=j0(Th),oA=bo,sf=Vs;function ra(e,n,t){const o=e.filter(h=>h.type===n).flatMap(h=>h.attributes).find(h=>h.key===t);if(!o)throw new Error(`Could not find attribute '${t}' in first event of type '${n}' in first log.`);return o}Bi.findAttribute=ra;function Wt(e){return`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`}class Xi extends oA.CosmWasmClient{static async connectWithSigner(n,t,r={}){const o=await(0,nA.connectComet)(n);return Xi.createWithSigner(o,t,r)}static async createWithSigner(n,t,r={}){return new Xi(n,t,r)}static async offline(n,t={}){return new Xi(void 0,n,t)}constructor(n,t,r){super(n);const{registry:o=new ut.Registry([...Ce.defaultRegistryTypes,...sf.wasmTypes]),aminoTypes:h=new Ce.AminoTypes({...(0,Ce.createDefaultAminoConverters)(),...(0,sf.createWasmAminoConverters)()})}=r;this.registry=o,this.aminoTypes=h,this.signer=t,this.broadcastTimeoutMs=r.broadcastTimeoutMs,this.broadcastPollIntervalMs=r.broadcastPollIntervalMs,this.gasPrice=r.gasPrice}async simulate(n,t,r){const o=t.map(D=>this.registry.encodeAsAny(D)),h=(await this.signer.getAccounts()).find(D=>D.address===n);if(!h)throw new Error("Failed to retrieve account from signer");const v=(0,zo.encodeSecp256k1Pubkey)(h.pubkey),{sequence:C}=await this.getSequence(n),{gasInfo:w}=await this.forceGetQueryClient().tx.simulate(o,r,v,C);return(0,Wi.assertDefined)(w),Vt.Uint53.fromString(w.gasUsed.toString()).toNumber()}async upload(n,t,r,o="",h){const v=iA.default.gzip(t,{level:9}),C={typeUrl:"/cosmwasm.wasm.v1.MsgStoreCode",value:Qt.MsgStoreCode.fromPartial({sender:n,wasmByteCode:v,instantiatePermission:h})},w=r=="auto"?1.1:r,D=await this.signAndBroadcast(n,[C],w,o);if((0,Ce.isDeliverTxFailure)(D))throw new Error(Wt(D));const J=ra(D.events,"store_code","code_id");return{checksum:(0,Ht.toHex)((0,eA.sha256)(t)),originalSize:t.length,compressedSize:v.length,codeId:Number.parseInt(J.value,10),logs:Ce.logs.parseRawLog(D.rawLog),height:D.height,transactionHash:D.transactionHash,events:D.events,gasWanted:D.gasWanted,gasUsed:D.gasUsed}}async instantiate(n,t,r,o,h,v={}){const C={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract",value:Qt.MsgInstantiateContract.fromPartial({sender:n,codeId:BigInt(new Vt.Uint53(t).toString()),label:o,msg:(0,Ht.toUtf8)(JSON.stringify(r)),funds:[...v.funds||[]],admin:v.admin})},w=await this.signAndBroadcast(n,[C],h,v.memo);if((0,Ce.isDeliverTxFailure)(w))throw new Error(Wt(w));return{contractAddress:ra(w.events,"instantiate","_contract_address").value,logs:Ce.logs.parseRawLog(w.rawLog),height:w.height,transactionHash:w.transactionHash,events:w.events,gasWanted:w.gasWanted,gasUsed:w.gasUsed}}async instantiate2(n,t,r,o,h,v,C={}){const w={typeUrl:"/cosmwasm.wasm.v1.MsgInstantiateContract2",value:Qt.MsgInstantiateContract2.fromPartial({sender:n,codeId:BigInt(new Vt.Uint53(t).toString()),label:h,msg:(0,Ht.toUtf8)(JSON.stringify(o)),funds:[...C.funds||[]],admin:C.admin,salt:r,fixMsg:!1})},D=await this.signAndBroadcast(n,[w],v,C.memo);if((0,Ce.isDeliverTxFailure)(D))throw new Error(Wt(D));return{contractAddress:ra(D.events,"instantiate","_contract_address").value,logs:Ce.logs.parseRawLog(D.rawLog),height:D.height,transactionHash:D.transactionHash,events:D.events,gasWanted:D.gasWanted,gasUsed:D.gasUsed}}async updateAdmin(n,t,r,o,h=""){const v={typeUrl:"/cosmwasm.wasm.v1.MsgUpdateAdmin",value:Qt.MsgUpdateAdmin.fromPartial({sender:n,contract:t,newAdmin:r})},C=await this.signAndBroadcast(n,[v],o,h);if((0,Ce.isDeliverTxFailure)(C))throw new Error(Wt(C));return{logs:Ce.logs.parseRawLog(C.rawLog),height:C.height,transactionHash:C.transactionHash,events:C.events,gasWanted:C.gasWanted,gasUsed:C.gasUsed}}async clearAdmin(n,t,r,o=""){const h={typeUrl:"/cosmwasm.wasm.v1.MsgClearAdmin",value:Qt.MsgClearAdmin.fromPartial({sender:n,contract:t})},v=await this.signAndBroadcast(n,[h],r,o);if((0,Ce.isDeliverTxFailure)(v))throw new Error(Wt(v));return{logs:Ce.logs.parseRawLog(v.rawLog),height:v.height,transactionHash:v.transactionHash,events:v.events,gasWanted:v.gasWanted,gasUsed:v.gasUsed}}async migrate(n,t,r,o,h,v=""){const C={typeUrl:"/cosmwasm.wasm.v1.MsgMigrateContract",value:Qt.MsgMigrateContract.fromPartial({sender:n,contract:t,codeId:BigInt(new Vt.Uint53(r).toString()),msg:(0,Ht.toUtf8)(JSON.stringify(o))})},w=await this.signAndBroadcast(n,[C],h,v);if((0,Ce.isDeliverTxFailure)(w))throw new Error(Wt(w));return{logs:Ce.logs.parseRawLog(w.rawLog),height:w.height,transactionHash:w.transactionHash,events:w.events,gasWanted:w.gasWanted,gasUsed:w.gasUsed}}async execute(n,t,r,o,h="",v){const C={contractAddress:t,msg:r,funds:v};return this.executeMultiple(n,[C],o,h)}async executeMultiple(n,t,r,o=""){const h=t.map(C=>({typeUrl:"/cosmwasm.wasm.v1.MsgExecuteContract",value:Qt.MsgExecuteContract.fromPartial({sender:n,contract:C.contractAddress,msg:(0,Ht.toUtf8)(JSON.stringify(C.msg)),funds:[...C.funds||[]]})})),v=await this.signAndBroadcast(n,h,r,o);if((0,Ce.isDeliverTxFailure)(v))throw new Error(Wt(v));return{logs:Ce.logs.parseRawLog(v.rawLog),height:v.height,transactionHash:v.transactionHash,events:v.events,gasWanted:v.gasWanted,gasUsed:v.gasUsed}}async sendTokens(n,t,r,o,h=""){const v={typeUrl:"/cosmos.bank.v1beta1.MsgSend",value:{fromAddress:n,toAddress:t,amount:[...r]}};return this.signAndBroadcast(n,[v],o,h)}async delegateTokens(n,t,r,o,h=""){const v={typeUrl:"/cosmos.staking.v1beta1.MsgDelegate",value:af.MsgDelegate.fromPartial({delegatorAddress:n,validatorAddress:t,amount:r})};return this.signAndBroadcast(n,[v],o,h)}async undelegateTokens(n,t,r,o,h=""){const v={typeUrl:"/cosmos.staking.v1beta1.MsgUndelegate",value:af.MsgUndelegate.fromPartial({delegatorAddress:n,validatorAddress:t,amount:r})};return this.signAndBroadcast(n,[v],o,h)}async withdrawRewards(n,t,r,o=""){const h={typeUrl:"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",value:tA.MsgWithdrawDelegatorReward.fromPartial({delegatorAddress:n,validatorAddress:t})};return this.signAndBroadcast(n,[h],r,o)}async signAndBroadcast(n,t,r,o="",h){let v;if(r=="auto"||typeof r=="number"){(0,Wi.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const D=await this.simulate(n,t,o),J=typeof r=="number"?r:1.4;v=(0,Ce.calculateFee)(Math.round(D*J),this.gasPrice)}else v=r;const C=await this.sign(n,t,v,o,void 0,h),w=Yo.TxRaw.encode(C).finish();return this.broadcastTx(w,this.broadcastTimeoutMs,this.broadcastPollIntervalMs)}async signAndBroadcastSync(n,t,r,o="",h){let v;if(r=="auto"||typeof r=="number"){(0,Wi.assertDefined)(this.gasPrice,"Gas price must be set in the client options when auto gas is used.");const D=await this.simulate(n,t,o),J=typeof r=="number"?r:1.3;v=(0,Ce.calculateFee)(Math.round(D*J),this.gasPrice)}else v=r;const C=await this.sign(n,t,v,o,void 0,h),w=Yo.TxRaw.encode(C).finish();return this.broadcastTxSync(w)}async sign(n,t,r,o,h,v){let C;if(h)C=h;else{const{accountNumber:w,sequence:D}=await this.getSequence(n),J=await this.getChainId();C={accountNumber:w,sequence:D,chainId:J}}return(0,ut.isOfflineDirectSigner)(this.signer)?this.signDirect(n,t,r,o,C,v):this.signAmino(n,t,r,o,C,v)}async signAmino(n,t,r,o,{accountNumber:h,sequence:v,chainId:C},w){(0,Wi.assert)(!(0,ut.isOfflineDirectSigner)(this.signer));const D=(await this.signer.getAccounts()).find(H=>H.address===n);if(!D)throw new Error("Failed to retrieve account from signer");const J=(0,ut.encodePubkey)((0,zo.encodeSecp256k1Pubkey)(D.pubkey)),I=rA.SignMode.SIGN_MODE_LEGACY_AMINO_JSON,g=t.map(H=>this.aminoTypes.toAmino(H)),R=(0,zo.makeSignDoc)(g,r,C,o,h,v,w),{signature:B,signed:d}=await this.signer.signAmino(n,R),s={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:d.msgs.map(H=>this.aminoTypes.fromAmino(H)),memo:d.memo,timeoutHeight:w}},y=this.registry.encode(s),E=Vt.Int53.fromString(d.fee.gas).toNumber(),_=Vt.Int53.fromString(d.sequence).toNumber(),U=(0,ut.makeAuthInfoBytes)([{pubkey:J,sequence:_}],d.fee.amount,E,d.fee.granter,d.fee.payer,I);return Yo.TxRaw.fromPartial({bodyBytes:y,authInfoBytes:U,signatures:[(0,Ht.fromBase64)(B.signature)]})}async signDirect(n,t,r,o,{accountNumber:h,sequence:v,chainId:C},w){(0,Wi.assert)((0,ut.isOfflineDirectSigner)(this.signer));const D=(await this.signer.getAccounts()).find(E=>E.address===n);if(!D)throw new Error("Failed to retrieve account from signer");const J=(0,ut.encodePubkey)((0,zo.encodeSecp256k1Pubkey)(D.pubkey)),I={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:t,memo:o,timeoutHeight:w}},g=this.registry.encode(I),R=Vt.Int53.fromString(r.gas).toNumber(),B=(0,ut.makeAuthInfoBytes)([{pubkey:J,sequence:v}],r.amount,R,r.granter,r.payer),d=(0,ut.makeSignDoc)(g,B,C,h),{signature:s,signed:y}=await this.signer.signDirect(n,d);return Yo.TxRaw.fromPartial({bodyBytes:y.bodyBytes,authInfoBytes:y.authInfoBytes,signatures:[(0,Ht.fromBase64)(s.signature)]})}}Bi.SigningCosmWasmClient=Xi;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningCosmWasmClient=e.wasmTypes=e.setupWasmExtension=e.isMsgUpdateAdminEncodeObject=e.isMsgStoreCodeEncodeObject=e.isMsgMigrateEncodeObject=e.isMsgInstantiateContractEncodeObject=e.isMsgInstantiateContract2EncodeObject=e.isMsgExecuteEncodeObject=e.isMsgClearAdminEncodeObject=e.createWasmAminoConverters=e.instantiate2Address=e._instantiate2AddressIntermediate=e.toBinary=e.fromBinary=e.CosmWasmClient=void 0;var n=bo;Object.defineProperty(e,"CosmWasmClient",{enumerable:!0,get:function(){return n.CosmWasmClient}});var t=Ri;Object.defineProperty(e,"fromBinary",{enumerable:!0,get:function(){return t.fromBinary}}),Object.defineProperty(e,"toBinary",{enumerable:!0,get:function(){return t.toBinary}});var r=vi;Object.defineProperty(e,"_instantiate2AddressIntermediate",{enumerable:!0,get:function(){return r._instantiate2AddressIntermediate}}),Object.defineProperty(e,"instantiate2Address",{enumerable:!0,get:function(){return r.instantiate2Address}});var o=Vs;Object.defineProperty(e,"createWasmAminoConverters",{enumerable:!0,get:function(){return o.createWasmAminoConverters}}),Object.defineProperty(e,"isMsgClearAdminEncodeObject",{enumerable:!0,get:function(){return o.isMsgClearAdminEncodeObject}}),Object.defineProperty(e,"isMsgExecuteEncodeObject",{enumerable:!0,get:function(){return o.isMsgExecuteEncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContract2EncodeObject",{enumerable:!0,get:function(){return o.isMsgInstantiateContract2EncodeObject}}),Object.defineProperty(e,"isMsgInstantiateContractEncodeObject",{enumerable:!0,get:function(){return o.isMsgInstantiateContractEncodeObject}}),Object.defineProperty(e,"isMsgMigrateEncodeObject",{enumerable:!0,get:function(){return o.isMsgMigrateEncodeObject}}),Object.defineProperty(e,"isMsgStoreCodeEncodeObject",{enumerable:!0,get:function(){return o.isMsgStoreCodeEncodeObject}}),Object.defineProperty(e,"isMsgUpdateAdminEncodeObject",{enumerable:!0,get:function(){return o.isMsgUpdateAdminEncodeObject}}),Object.defineProperty(e,"setupWasmExtension",{enumerable:!0,get:function(){return o.setupWasmExtension}}),Object.defineProperty(e,"wasmTypes",{enumerable:!0,get:function(){return o.wasmTypes}});var h=Bi;Object.defineProperty(e,"SigningCosmWasmClient",{enumerable:!0,get:function(){return h.SigningCosmWasmClient}})})(el);class nl extends Zh{}const un=class un extends nl{async getWrappedAsset(n){const t=await this.getTokenBridge(),r=new je(await t.getWrappedAsset(n)),o=kd.encode(r.toUniversalAddress().toUint8Array()),h=`factory/${un.gatewayAddress(this.network)}/${o}`;return new je(h)}static getGatewaySourceChannel(n,t){const r=bi.getIbcChannels(n,t);if(!r)throw new Error("No channels configured for chain "+t);if(!(un.chain in r))throw new Error("No channel configured for chain "+t);return r[un.chain]}static deriveIbcDenom(n,t,r){const o=this.getGatewaySourceChannel(n,t),h=Ch.encode(`${vp}/${o}/${r}`),v=lc.encode(Nh(h));return new je(`ibc/${v.toUpperCase()}`)}static factoryToCw20(n){if(n.denomType!=="factory")throw new Error("Invalid address type");return new je(je.encode(n.domain,kd.decode(n.denom)))}static cw20ToFactory(n,t){const r=kd.encode(t.toUniversalAddress().toUint8Array());return new je(`factory/${un.gatewayAddress(n)}/${r}`)}static makeTransferMsg(n,t,r=0n,o,h){const v=fc.encode(t.toUint8Array()),C={chain:wh(n),recipient:v,fee:r.toString(),nonce:h??Math.round(Math.random()*1e5)};return o?{gateway_transfer_with_payload:{...C,payload:o}}:{gateway_transfer:{...C}}}};me(un,"chain","Wormchain"),me(un,"gatewayAddress",n=>Sd[n].chains[un.chain].contracts.gateway),me(un,"tokenBridgeAddress",n=>Sd[n].chains[un.chain].contracts.tokenBridge),me(un,"coreAddress",n=>Sd[n].chains[un.chain].contracts.coreBridge);let rc=un;const vn=class vn extends Xh{constructor(n,t){super(n,t??Eh(n,vn._platform))}async getRpc(n){if(n in this.config&&this.config[n].rpc)return await el.CosmWasmClient.connect(this.config[n].rpc);throw new Error("No configuration available for chain: "+n)}getChain(n,t){if(!(n in this.config))throw new Error("No configuration available for chain: "+n);return new nl(n,this,t)}static getIbcChannels(n,t){return gl.has(n,t)?gl.get(n,t):null}static nativeTokenId(n,t){if(!this.isSupportedChain(t))throw new Error(`invalid chain for CosmWasm: ${t}`);return _h.chainAddress(t,this.getNativeDenom(n,t))}static isSupportedChain(n){return Uh(n)===vn._platform}static isNativeTokenId(n,t,r){return!this.isSupportedChain(t)||r.chain!==t?!1:this.nativeTokenId(n,t)==r}static async getDecimals(n,t,r){if(Pd(r))return Jh(vn._platform);let o=new je(r).toString();o.startsWith("factory")&&(o=rc.factoryToCw20(new je(o)).toString());const{decimals:h}=await t.queryContractSmart(o,{token_info:{}});return h}static async getBalance(n,t,r,o){if(Pd(o)){const[C,w]=await vn.chainFromRpc(t),{amount:D}=await t.getBalance(r,this.getNativeDenom(C,n));return BigInt(D)}const h=new je(o).toString(),{amount:v}=await t.getBalance(r,h);return BigInt(v)}static async getBalances(n,t,r,o){const v=await vn.getQueryClient(t).bank.allBalances(r),[C,w]=await vn.chainFromRpc(t);return o.map(J=>{const I=Pd(J)?this.getNativeDenom(C,n):new je(J).toString(),g=v.find(B=>B.denom===I),R=g?BigInt(g.amount):null;return{[I]:R}}).reduce((J,I)=>Object.assign(J,I),{})}static getNativeDenom(n,t){return yg.get(n,t)}static async sendWait(n,t,r){const o=[];for(const h of r){const v=await t.broadcastTx(h);if(v.code!==0)throw new Error(`Error sending transaction (${v.transactionHash}): ${v.rawLog}`);o.push(v.transactionHash)}return o}static async getLatestBlock(n){return await n.getHeight()}static async getLatestFinalizedBlock(n){throw new Error("not implemented")}static chainFromChainId(n){const t=Dh(vn._platform,n);if(t===void 0)throw new Error(`Unknown Cosmwasm chainId ${n}`);const[r,o]=t;return[r,o]}static async chainFromRpc(n){const t=await n.getChainId();return this.chainFromChainId(t)}static async getCounterpartyChannel(n,t){var h,v;return((v=(h=(await vn.getQueryClient(t).ibc.channel.channel(vp,n)).channel)==null?void 0:h.counterparty)==null?void 0:v.channelId)??null}};me(vn,"_platform",no),me(vn,"getQueryClient",n=>er.QueryClient.withExtensions(n.cometClient,er.setupBankExtension,er.setupIbcExtension));let bi=vn;function df(){return{typeUrl:"",value:new Uint8Array(0)}}const Pe={encode(e,n=j.Writer.create()){return e.typeUrl!==""&&n.uint32(10).string(e.typeUrl),e.value.length!==0&&n.uint32(18).bytes(e.value),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=df();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.typeUrl=t.string();continue;case 2:if(h!==18)break;o.value=t.bytes();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{typeUrl:uf(e.typeUrl)?globalThis.String(e.typeUrl):"",value:uf(e.value)?aA(e.value):new Uint8Array(0)}},toJSON(e){const n={};return e.typeUrl!==""&&(n.typeUrl=e.typeUrl),e.value.length!==0&&(n.value=sA(e.value)),n},create(e){return Pe.fromPartial(e??{})},fromPartial(e){var n,t;const r=df();return r.typeUrl=(n=e.typeUrl)!==null&&n!==void 0?n:"",r.value=(t=e.value)!==null&&t!==void 0?t:new Uint8Array(0),r}};function aA(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function sA(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function uf(e){return e!=null}j.util.Long!==_e&&(j.util.Long=_e,j.configure());function cf(){return{denom:"",amount:""}}const Ee={encode(e,n=j.Writer.create()){return e.denom!==""&&n.uint32(10).string(e.denom),e.amount!==""&&n.uint32(18).string(e.amount),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=cf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.denom=t.string();continue;case 2:if(h!==18)break;o.amount=t.string();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{denom:lf(e.denom)?globalThis.String(e.denom):"",amount:lf(e.amount)?globalThis.String(e.amount):""}},toJSON(e){const n={};return e.denom!==""&&(n.denom=e.denom),e.amount!==""&&(n.amount=e.amount),n},create(e){return Ee.fromPartial(e??{})},fromPartial(e){var n,t;const r=cf();return r.denom=(n=e.denom)!==null&&n!==void 0?n:"",r.amount=(t=e.amount)!==null&&t!==void 0?t:"",r}};function lf(e){return e!=null}function ff(){return{extraBitsStored:0,elems:new Uint8Array(0)}}const br={encode(e,n=j.Writer.create()){return e.extraBitsStored!==0&&n.uint32(8).uint32(e.extraBitsStored),e.elems.length!==0&&n.uint32(18).bytes(e.elems),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=ff();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==8)break;o.extraBitsStored=t.uint32();continue;case 2:if(h!==18)break;o.elems=t.bytes();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{extraBitsStored:pf(e.extraBitsStored)?globalThis.Number(e.extraBitsStored):0,elems:pf(e.elems)?dA(e.elems):new Uint8Array(0)}},toJSON(e){const n={};return e.extraBitsStored!==0&&(n.extraBitsStored=Math.round(e.extraBitsStored)),e.elems.length!==0&&(n.elems=uA(e.elems)),n},create(e){return br.fromPartial(e??{})},fromPartial(e){var n,t;const r=ff();return r.extraBitsStored=(n=e.extraBitsStored)!==null&&n!==void 0?n:0,r.elems=(t=e.elems)!==null&&t!==void 0?t:new Uint8Array(0),r}};function dA(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function uA(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function pf(e){return e!=null}function mf(){return{key:new Uint8Array(0)}}const Gt={encode(e,n=j.Writer.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=mf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.key=t.bytes();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{key:fA(e.key)?cA(e.key):new Uint8Array(0)}},toJSON(e){const n={};return e.key.length!==0&&(n.key=lA(e.key)),n},create(e){return Gt.fromPartial(e??{})},fromPartial(e){var n;const t=mf();return t.key=(n=e.key)!==null&&n!==void 0?n:new Uint8Array(0),t}};function cA(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function lA(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function fA(e){return e!=null}j.util.Long!==_e&&(j.util.Long=_e,j.configure());var Be;(function(e){e[e.SIGN_MODE_UNSPECIFIED=0]="SIGN_MODE_UNSPECIFIED",e[e.SIGN_MODE_DIRECT=1]="SIGN_MODE_DIRECT",e[e.SIGN_MODE_TEXTUAL=2]="SIGN_MODE_TEXTUAL",e[e.SIGN_MODE_DIRECT_AUX=3]="SIGN_MODE_DIRECT_AUX",e[e.SIGN_MODE_LEGACY_AMINO_JSON=127]="SIGN_MODE_LEGACY_AMINO_JSON",e[e.SIGN_MODE_EIP712_V2=128]="SIGN_MODE_EIP712_V2",e[e.SIGN_MODE_EIP_191=191]="SIGN_MODE_EIP_191",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Be||(Be={}));function pA(e){switch(e){case 0:case"SIGN_MODE_UNSPECIFIED":return Be.SIGN_MODE_UNSPECIFIED;case 1:case"SIGN_MODE_DIRECT":return Be.SIGN_MODE_DIRECT;case 2:case"SIGN_MODE_TEXTUAL":return Be.SIGN_MODE_TEXTUAL;case 3:case"SIGN_MODE_DIRECT_AUX":return Be.SIGN_MODE_DIRECT_AUX;case 127:case"SIGN_MODE_LEGACY_AMINO_JSON":return Be.SIGN_MODE_LEGACY_AMINO_JSON;case 128:case"SIGN_MODE_EIP712_V2":return Be.SIGN_MODE_EIP712_V2;case 191:case"SIGN_MODE_EIP_191":return Be.SIGN_MODE_EIP_191;case-1:case"UNRECOGNIZED":default:return Be.UNRECOGNIZED}}function mA(e){switch(e){case Be.SIGN_MODE_UNSPECIFIED:return"SIGN_MODE_UNSPECIFIED";case Be.SIGN_MODE_DIRECT:return"SIGN_MODE_DIRECT";case Be.SIGN_MODE_TEXTUAL:return"SIGN_MODE_TEXTUAL";case Be.SIGN_MODE_DIRECT_AUX:return"SIGN_MODE_DIRECT_AUX";case Be.SIGN_MODE_LEGACY_AMINO_JSON:return"SIGN_MODE_LEGACY_AMINO_JSON";case Be.SIGN_MODE_EIP712_V2:return"SIGN_MODE_EIP712_V2";case Be.SIGN_MODE_EIP_191:return"SIGN_MODE_EIP_191";case Be.UNRECOGNIZED:default:return"UNRECOGNIZED"}}j.util.Long!==_e&&(j.util.Long=_e,j.configure());function yf(){return{bodyBytes:new Uint8Array(0),authInfoBytes:new Uint8Array(0),signatures:[]}}const ba={encode(e,n=j.Writer.create()){e.bodyBytes.length!==0&&n.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&n.uint32(18).bytes(e.authInfoBytes);for(const t of e.signatures)n.uint32(26).bytes(t);return n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=yf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.bodyBytes=t.bytes();continue;case 2:if(h!==18)break;o.authInfoBytes=t.bytes();continue;case 3:if(h!==26)break;o.signatures.push(t.bytes());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{bodyBytes:Ie(e.bodyBytes)?xi(e.bodyBytes):new Uint8Array(0),authInfoBytes:Ie(e.authInfoBytes)?xi(e.authInfoBytes):new Uint8Array(0),signatures:globalThis.Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(n=>xi(n)):[]}},toJSON(e){var n;const t={};return e.bodyBytes.length!==0&&(t.bodyBytes=ji(e.bodyBytes)),e.authInfoBytes.length!==0&&(t.authInfoBytes=ji(e.authInfoBytes)),!((n=e.signatures)===null||n===void 0)&&n.length&&(t.signatures=e.signatures.map(r=>ji(r))),t},create(e){return ba.fromPartial(e??{})},fromPartial(e){var n,t,r;const o=yf();return o.bodyBytes=(n=e.bodyBytes)!==null&&n!==void 0?n:new Uint8Array(0),o.authInfoBytes=(t=e.authInfoBytes)!==null&&t!==void 0?t:new Uint8Array(0),o.signatures=((r=e.signatures)===null||r===void 0?void 0:r.map(h=>h))||[],o}};function hf(){return{bodyBytes:new Uint8Array(0),authInfoBytes:new Uint8Array(0),chainId:"",accountNumber:"0"}}const tl={encode(e,n=j.Writer.create()){return e.bodyBytes.length!==0&&n.uint32(10).bytes(e.bodyBytes),e.authInfoBytes.length!==0&&n.uint32(18).bytes(e.authInfoBytes),e.chainId!==""&&n.uint32(26).string(e.chainId),e.accountNumber!=="0"&&n.uint32(32).uint64(e.accountNumber),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=hf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.bodyBytes=t.bytes();continue;case 2:if(h!==18)break;o.authInfoBytes=t.bytes();continue;case 3:if(h!==26)break;o.chainId=t.string();continue;case 4:if(h!==32)break;o.accountNumber=Ws(t.uint64());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{bodyBytes:Ie(e.bodyBytes)?xi(e.bodyBytes):new Uint8Array(0),authInfoBytes:Ie(e.authInfoBytes)?xi(e.authInfoBytes):new Uint8Array(0),chainId:Ie(e.chainId)?globalThis.String(e.chainId):"",accountNumber:Ie(e.accountNumber)?globalThis.String(e.accountNumber):"0"}},toJSON(e){const n={};return e.bodyBytes.length!==0&&(n.bodyBytes=ji(e.bodyBytes)),e.authInfoBytes.length!==0&&(n.authInfoBytes=ji(e.authInfoBytes)),e.chainId!==""&&(n.chainId=e.chainId),e.accountNumber!=="0"&&(n.accountNumber=e.accountNumber),n},create(e){return tl.fromPartial(e??{})},fromPartial(e){var n,t,r,o;const h=hf();return h.bodyBytes=(n=e.bodyBytes)!==null&&n!==void 0?n:new Uint8Array(0),h.authInfoBytes=(t=e.authInfoBytes)!==null&&t!==void 0?t:new Uint8Array(0),h.chainId=(r=e.chainId)!==null&&r!==void 0?r:"",h.accountNumber=(o=e.accountNumber)!==null&&o!==void 0?o:"0",h}};function gf(){return{messages:[],memo:"",timeoutHeight:"0",extensionOptions:[],nonCriticalExtensionOptions:[]}}const rl={encode(e,n=j.Writer.create()){for(const t of e.messages)Pe.encode(t,n.uint32(10).fork()).ldelim();e.memo!==""&&n.uint32(18).string(e.memo),e.timeoutHeight!=="0"&&n.uint32(24).uint64(e.timeoutHeight);for(const t of e.extensionOptions)Pe.encode(t,n.uint32(8186).fork()).ldelim();for(const t of e.nonCriticalExtensionOptions)Pe.encode(t,n.uint32(16378).fork()).ldelim();return n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=gf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.messages.push(Pe.decode(t,t.uint32()));continue;case 2:if(h!==18)break;o.memo=t.string();continue;case 3:if(h!==24)break;o.timeoutHeight=Ws(t.uint64());continue;case 1023:if(h!==8186)break;o.extensionOptions.push(Pe.decode(t,t.uint32()));continue;case 2047:if(h!==16378)break;o.nonCriticalExtensionOptions.push(Pe.decode(t,t.uint32()));continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{messages:globalThis.Array.isArray(e==null?void 0:e.messages)?e.messages.map(n=>Pe.fromJSON(n)):[],memo:Ie(e.memo)?globalThis.String(e.memo):"",timeoutHeight:Ie(e.timeoutHeight)?globalThis.String(e.timeoutHeight):"0",extensionOptions:globalThis.Array.isArray(e==null?void 0:e.extensionOptions)?e.extensionOptions.map(n=>Pe.fromJSON(n)):[],nonCriticalExtensionOptions:globalThis.Array.isArray(e==null?void 0:e.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(n=>Pe.fromJSON(n)):[]}},toJSON(e){var n,t,r;const o={};return!((n=e.messages)===null||n===void 0)&&n.length&&(o.messages=e.messages.map(h=>Pe.toJSON(h))),e.memo!==""&&(o.memo=e.memo),e.timeoutHeight!=="0"&&(o.timeoutHeight=e.timeoutHeight),!((t=e.extensionOptions)===null||t===void 0)&&t.length&&(o.extensionOptions=e.extensionOptions.map(h=>Pe.toJSON(h))),!((r=e.nonCriticalExtensionOptions)===null||r===void 0)&&r.length&&(o.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(h=>Pe.toJSON(h))),o},create(e){return rl.fromPartial(e??{})},fromPartial(e){var n,t,r,o,h;const v=gf();return v.messages=((n=e.messages)===null||n===void 0?void 0:n.map(C=>Pe.fromPartial(C)))||[],v.memo=(t=e.memo)!==null&&t!==void 0?t:"",v.timeoutHeight=(r=e.timeoutHeight)!==null&&r!==void 0?r:"0",v.extensionOptions=((o=e.extensionOptions)===null||o===void 0?void 0:o.map(C=>Pe.fromPartial(C)))||[],v.nonCriticalExtensionOptions=((h=e.nonCriticalExtensionOptions)===null||h===void 0?void 0:h.map(C=>Pe.fromPartial(C)))||[],v}};function Sf(){return{signerInfos:[],fee:void 0,tip:void 0}}const il={encode(e,n=j.Writer.create()){for(const t of e.signerInfos)zt.encode(t,n.uint32(10).fork()).ldelim();return e.fee!==void 0&&Zt.encode(e.fee,n.uint32(18).fork()).ldelim(),e.tip!==void 0&&Ar.encode(e.tip,n.uint32(26).fork()).ldelim(),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Sf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.signerInfos.push(zt.decode(t,t.uint32()));continue;case 2:if(h!==18)break;o.fee=Zt.decode(t,t.uint32());continue;case 3:if(h!==26)break;o.tip=Ar.decode(t,t.uint32());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{signerInfos:globalThis.Array.isArray(e==null?void 0:e.signerInfos)?e.signerInfos.map(n=>zt.fromJSON(n)):[],fee:Ie(e.fee)?Zt.fromJSON(e.fee):void 0,tip:Ie(e.tip)?Ar.fromJSON(e.tip):void 0}},toJSON(e){var n;const t={};return!((n=e.signerInfos)===null||n===void 0)&&n.length&&(t.signerInfos=e.signerInfos.map(r=>zt.toJSON(r))),e.fee!==void 0&&(t.fee=Zt.toJSON(e.fee)),e.tip!==void 0&&(t.tip=Ar.toJSON(e.tip)),t},create(e){return il.fromPartial(e??{})},fromPartial(e){var n;const t=Sf();return t.signerInfos=((n=e.signerInfos)===null||n===void 0?void 0:n.map(r=>zt.fromPartial(r)))||[],t.fee=e.fee!==void 0&&e.fee!==null?Zt.fromPartial(e.fee):void 0,t.tip=e.tip!==void 0&&e.tip!==null?Ar.fromPartial(e.tip):void 0,t}};function kf(){return{publicKey:void 0,modeInfo:void 0,sequence:"0"}}const zt={encode(e,n=j.Writer.create()){return e.publicKey!==void 0&&Pe.encode(e.publicKey,n.uint32(10).fork()).ldelim(),e.modeInfo!==void 0&&En.encode(e.modeInfo,n.uint32(18).fork()).ldelim(),e.sequence!=="0"&&n.uint32(24).uint64(e.sequence),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=kf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.publicKey=Pe.decode(t,t.uint32());continue;case 2:if(h!==18)break;o.modeInfo=En.decode(t,t.uint32());continue;case 3:if(h!==24)break;o.sequence=Ws(t.uint64());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{publicKey:Ie(e.publicKey)?Pe.fromJSON(e.publicKey):void 0,modeInfo:Ie(e.modeInfo)?En.fromJSON(e.modeInfo):void 0,sequence:Ie(e.sequence)?globalThis.String(e.sequence):"0"}},toJSON(e){const n={};return e.publicKey!==void 0&&(n.publicKey=Pe.toJSON(e.publicKey)),e.modeInfo!==void 0&&(n.modeInfo=En.toJSON(e.modeInfo)),e.sequence!=="0"&&(n.sequence=e.sequence),n},create(e){return zt.fromPartial(e??{})},fromPartial(e){var n;const t=kf();return t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?Pe.fromPartial(e.publicKey):void 0,t.modeInfo=e.modeInfo!==void 0&&e.modeInfo!==null?En.fromPartial(e.modeInfo):void 0,t.sequence=(n=e.sequence)!==null&&n!==void 0?n:"0",t}};function Pf(){return{single:void 0,multi:void 0}}const En={encode(e,n=j.Writer.create()){return e.single!==void 0&&Yt.encode(e.single,n.uint32(10).fork()).ldelim(),e.multi!==void 0&&Or.encode(e.multi,n.uint32(18).fork()).ldelim(),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Pf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.single=Yt.decode(t,t.uint32());continue;case 2:if(h!==18)break;o.multi=Or.decode(t,t.uint32());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{single:Ie(e.single)?Yt.fromJSON(e.single):void 0,multi:Ie(e.multi)?Or.fromJSON(e.multi):void 0}},toJSON(e){const n={};return e.single!==void 0&&(n.single=Yt.toJSON(e.single)),e.multi!==void 0&&(n.multi=Or.toJSON(e.multi)),n},create(e){return En.fromPartial(e??{})},fromPartial(e){const n=Pf();return n.single=e.single!==void 0&&e.single!==null?Yt.fromPartial(e.single):void 0,n.multi=e.multi!==void 0&&e.multi!==null?Or.fromPartial(e.multi):void 0,n}};function Rf(){return{mode:0}}const Yt={encode(e,n=j.Writer.create()){return e.mode!==0&&n.uint32(8).int32(e.mode),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Rf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==8)break;o.mode=t.int32();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{mode:Ie(e.mode)?pA(e.mode):0}},toJSON(e){const n={};return e.mode!==0&&(n.mode=mA(e.mode)),n},create(e){return Yt.fromPartial(e??{})},fromPartial(e){var n;const t=Rf();return t.mode=(n=e.mode)!==null&&n!==void 0?n:0,t}};function vf(){return{bitarray:void 0,modeInfos:[]}}const Or={encode(e,n=j.Writer.create()){e.bitarray!==void 0&&br.encode(e.bitarray,n.uint32(10).fork()).ldelim();for(const t of e.modeInfos)En.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=vf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.bitarray=br.decode(t,t.uint32());continue;case 2:if(h!==18)break;o.modeInfos.push(En.decode(t,t.uint32()));continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{bitarray:Ie(e.bitarray)?br.fromJSON(e.bitarray):void 0,modeInfos:globalThis.Array.isArray(e==null?void 0:e.modeInfos)?e.modeInfos.map(n=>En.fromJSON(n)):[]}},toJSON(e){var n;const t={};return e.bitarray!==void 0&&(t.bitarray=br.toJSON(e.bitarray)),!((n=e.modeInfos)===null||n===void 0)&&n.length&&(t.modeInfos=e.modeInfos.map(r=>En.toJSON(r))),t},create(e){return Or.fromPartial(e??{})},fromPartial(e){var n;const t=vf();return t.bitarray=e.bitarray!==void 0&&e.bitarray!==null?br.fromPartial(e.bitarray):void 0,t.modeInfos=((n=e.modeInfos)===null||n===void 0?void 0:n.map(r=>En.fromPartial(r)))||[],t}};function Bf(){return{amount:[],gasLimit:"0",payer:"",granter:""}}const Zt={encode(e,n=j.Writer.create()){for(const t of e.amount)Ee.encode(t,n.uint32(10).fork()).ldelim();return e.gasLimit!=="0"&&n.uint32(16).uint64(e.gasLimit),e.payer!==""&&n.uint32(26).string(e.payer),e.granter!==""&&n.uint32(34).string(e.granter),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Bf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.amount.push(Ee.decode(t,t.uint32()));continue;case 2:if(h!==16)break;o.gasLimit=Ws(t.uint64());continue;case 3:if(h!==26)break;o.payer=t.string();continue;case 4:if(h!==34)break;o.granter=t.string();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{amount:globalThis.Array.isArray(e==null?void 0:e.amount)?e.amount.map(n=>Ee.fromJSON(n)):[],gasLimit:Ie(e.gasLimit)?globalThis.String(e.gasLimit):"0",payer:Ie(e.payer)?globalThis.String(e.payer):"",granter:Ie(e.granter)?globalThis.String(e.granter):""}},toJSON(e){var n;const t={};return!((n=e.amount)===null||n===void 0)&&n.length&&(t.amount=e.amount.map(r=>Ee.toJSON(r))),e.gasLimit!=="0"&&(t.gasLimit=e.gasLimit),e.payer!==""&&(t.payer=e.payer),e.granter!==""&&(t.granter=e.granter),t},create(e){return Zt.fromPartial(e??{})},fromPartial(e){var n,t,r,o;const h=Bf();return h.amount=((n=e.amount)===null||n===void 0?void 0:n.map(v=>Ee.fromPartial(v)))||[],h.gasLimit=(t=e.gasLimit)!==null&&t!==void 0?t:"0",h.payer=(r=e.payer)!==null&&r!==void 0?r:"",h.granter=(o=e.granter)!==null&&o!==void 0?o:"",h}};function bf(){return{amount:[],tipper:""}}const Ar={encode(e,n=j.Writer.create()){for(const t of e.amount)Ee.encode(t,n.uint32(10).fork()).ldelim();return e.tipper!==""&&n.uint32(18).string(e.tipper),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=bf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.amount.push(Ee.decode(t,t.uint32()));continue;case 2:if(h!==18)break;o.tipper=t.string();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{amount:globalThis.Array.isArray(e==null?void 0:e.amount)?e.amount.map(n=>Ee.fromJSON(n)):[],tipper:Ie(e.tipper)?globalThis.String(e.tipper):""}},toJSON(e){var n;const t={};return!((n=e.amount)===null||n===void 0)&&n.length&&(t.amount=e.amount.map(r=>Ee.toJSON(r))),e.tipper!==""&&(t.tipper=e.tipper),t},create(e){return Ar.fromPartial(e??{})},fromPartial(e){var n,t;const r=bf();return r.amount=((n=e.amount)===null||n===void 0?void 0:n.map(o=>Ee.fromPartial(o)))||[],r.tipper=(t=e.tipper)!==null&&t!==void 0?t:"",r}};function xi(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function ji(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function Ws(e){return e.toString()}j.util.Long!==_e&&(j.util.Long=_e,j.configure());function Ie(e){return e!=null}function Of(){return{revisionNumber:"0",revisionHeight:"0"}}const Xt={encode(e,n=j.Writer.create()){return e.revisionNumber!=="0"&&n.uint32(8).uint64(e.revisionNumber),e.revisionHeight!=="0"&&n.uint32(16).uint64(e.revisionHeight),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Of();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==8)break;o.revisionNumber=Af(t.uint64());continue;case 2:if(h!==16)break;o.revisionHeight=Af(t.uint64());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{revisionNumber:If(e.revisionNumber)?globalThis.String(e.revisionNumber):"0",revisionHeight:If(e.revisionHeight)?globalThis.String(e.revisionHeight):"0"}},toJSON(e){const n={};return e.revisionNumber!=="0"&&(n.revisionNumber=e.revisionNumber),e.revisionHeight!=="0"&&(n.revisionHeight=e.revisionHeight),n},create(e){return Xt.fromPartial(e??{})},fromPartial(e){var n,t;const r=Of();return r.revisionNumber=(n=e.revisionNumber)!==null&&n!==void 0?n:"0",r.revisionHeight=(t=e.revisionHeight)!==null&&t!==void 0?t:"0",r}};function Af(e){return e.toString()}j.util.Long!==_e&&(j.util.Long=_e,j.configure());function If(e){return e!=null}function Tf(){return{sourcePort:"",sourceChannel:"",token:void 0,sender:"",receiver:"",timeoutHeight:void 0,timeoutTimestamp:"0",memo:""}}const ia={encode(e,n=j.Writer.create()){return e.sourcePort!==""&&n.uint32(10).string(e.sourcePort),e.sourceChannel!==""&&n.uint32(18).string(e.sourceChannel),e.token!==void 0&&Ee.encode(e.token,n.uint32(26).fork()).ldelim(),e.sender!==""&&n.uint32(34).string(e.sender),e.receiver!==""&&n.uint32(42).string(e.receiver),e.timeoutHeight!==void 0&&Xt.encode(e.timeoutHeight,n.uint32(50).fork()).ldelim(),e.timeoutTimestamp!=="0"&&n.uint32(56).uint64(e.timeoutTimestamp),e.memo!==""&&n.uint32(66).string(e.memo),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Tf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.sourcePort=t.string();continue;case 2:if(h!==18)break;o.sourceChannel=t.string();continue;case 3:if(h!==26)break;o.token=Ee.decode(t,t.uint32());continue;case 4:if(h!==34)break;o.sender=t.string();continue;case 5:if(h!==42)break;o.receiver=t.string();continue;case 6:if(h!==50)break;o.timeoutHeight=Xt.decode(t,t.uint32());continue;case 7:if(h!==56)break;o.timeoutTimestamp=yA(t.uint64());continue;case 8:if(h!==66)break;o.memo=t.string();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{sourcePort:gt(e.sourcePort)?globalThis.String(e.sourcePort):"",sourceChannel:gt(e.sourceChannel)?globalThis.String(e.sourceChannel):"",token:gt(e.token)?Ee.fromJSON(e.token):void 0,sender:gt(e.sender)?globalThis.String(e.sender):"",receiver:gt(e.receiver)?globalThis.String(e.receiver):"",timeoutHeight:gt(e.timeoutHeight)?Xt.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:gt(e.timeoutTimestamp)?globalThis.String(e.timeoutTimestamp):"0",memo:gt(e.memo)?globalThis.String(e.memo):""}},toJSON(e){const n={};return e.sourcePort!==""&&(n.sourcePort=e.sourcePort),e.sourceChannel!==""&&(n.sourceChannel=e.sourceChannel),e.token!==void 0&&(n.token=Ee.toJSON(e.token)),e.sender!==""&&(n.sender=e.sender),e.receiver!==""&&(n.receiver=e.receiver),e.timeoutHeight!==void 0&&(n.timeoutHeight=Xt.toJSON(e.timeoutHeight)),e.timeoutTimestamp!=="0"&&(n.timeoutTimestamp=e.timeoutTimestamp),e.memo!==""&&(n.memo=e.memo),n},create(e){return ia.fromPartial(e??{})},fromPartial(e){var n,t,r,o,h,v;const C=Tf();return C.sourcePort=(n=e.sourcePort)!==null&&n!==void 0?n:"",C.sourceChannel=(t=e.sourceChannel)!==null&&t!==void 0?t:"",C.token=e.token!==void 0&&e.token!==null?Ee.fromPartial(e.token):void 0,C.sender=(r=e.sender)!==null&&r!==void 0?r:"",C.receiver=(o=e.receiver)!==null&&o!==void 0?o:"",C.timeoutHeight=e.timeoutHeight!==void 0&&e.timeoutHeight!==null?Xt.fromPartial(e.timeoutHeight):void 0,C.timeoutTimestamp=(h=e.timeoutTimestamp)!==null&&h!==void 0?h:"0",C.memo=(v=e.memo)!==null&&v!==void 0?v:"",C}};function yA(e){return e.toString()}j.util.Long!==_e&&(j.util.Long=_e,j.configure());function gt(e){return e!=null}function Cf(){return{key:new Uint8Array(0)}}const ic={encode(e,n=j.Writer.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof j.Reader?e:j.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Cf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.key=t.bytes();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{key:SA(e.key)?hA(e.key):new Uint8Array(0)}},toJSON(e){const n={};return e.key.length!==0&&(n.key=gA(e.key)),n},create(e){return ic.fromPartial(e??{})},fromPartial(e){var n;const t=Cf();return t.key=(n=e.key)!==null&&n!==void 0?n:new Uint8Array(0),t}};function hA(e){if(globalThis.Buffer)return Uint8Array.from(globalThis.Buffer.from(e,"base64"));{const n=globalThis.atob(e),t=new Uint8Array(n.length);for(let r=0;r<n.length;++r)t[r]=n.charCodeAt(r);return t}}function gA(e){if(globalThis.Buffer)return globalThis.Buffer.from(e).toString("base64");{const n=[];return e.forEach(t=>{n.push(globalThis.String.fromCharCode(t))}),globalThis.btoa(n.join(""))}}function SA(e){return e!=null}const Nf=e=>e.split("/").map(n=>n.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")).join("/"),kA=(e,n=18)=>new Fn(e).multipliedBy(new Fn(10).pow(n));class Hn extends Fn{static make(n){return new Hn(n)}minus(n,t){return new Hn(super.minus(n,t))}plus(n,t){return new Hn(super.plus(n,t))}dividedBy(n,t){return new Hn(super.dividedBy(n,t))}div(n,t){return new Hn(super.div(n,t))}multipliedBy(n,t){return new Hn(super.multipliedBy(n,t))}times(n,t){return new Hn(super.times(n,t))}pow(n,t){return new Hn(super.pow(n,t))}toWei(n=18){return kA(this,n)}}var ol={exports:{}},jy=function(n,t){return function(){for(var o=new Array(arguments.length),h=0;h<o.length;h++)o[h]=arguments[h];return n.apply(t,o)}},PA=jy,fr=Object.prototype.toString;function al(e){return fr.call(e)==="[object Array]"}function oc(e){return typeof e>"u"}function RA(e){return e!==null&&!oc(e)&&e.constructor!==null&&!oc(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function vA(e){return fr.call(e)==="[object ArrayBuffer]"}function BA(e){return typeof FormData<"u"&&e instanceof FormData}function bA(e){var n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&e.buffer instanceof ArrayBuffer,n}function OA(e){return typeof e=="string"}function AA(e){return typeof e=="number"}function eh(e){return e!==null&&typeof e=="object"}function oa(e){if(fr.call(e)!=="[object Object]")return!1;var n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function IA(e){return fr.call(e)==="[object Date]"}function TA(e){return fr.call(e)==="[object File]"}function CA(e){return fr.call(e)==="[object Blob]"}function nh(e){return fr.call(e)==="[object Function]"}function NA(e){return eh(e)&&nh(e.pipe)}function wA(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function EA(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function _A(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function sl(e,n){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),al(e))for(var t=0,r=e.length;t<r;t++)n.call(null,e[t],t,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.call(null,e[o],o,e)}function ac(){var e={};function n(o,h){oa(e[h])&&oa(o)?e[h]=ac(e[h],o):oa(o)?e[h]=ac({},o):al(o)?e[h]=o.slice():e[h]=o}for(var t=0,r=arguments.length;t<r;t++)sl(arguments[t],n);return e}function UA(e,n,t){return sl(n,function(o,h){t&&typeof o=="function"?e[h]=PA(o,t):e[h]=o}),e}function JA(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var gn={isArray:al,isArrayBuffer:vA,isBuffer:RA,isFormData:BA,isArrayBufferView:bA,isString:OA,isNumber:AA,isObject:eh,isPlainObject:oa,isUndefined:oc,isDate:IA,isFile:TA,isBlob:CA,isFunction:nh,isStream:NA,isURLSearchParams:wA,isStandardBrowserEnv:_A,forEach:sl,merge:ac,extend:UA,trim:EA,stripBOM:JA},Pr=gn;function wf(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var th=function(n,t,r){if(!t)return n;var o;if(r)o=r(t);else if(Pr.isURLSearchParams(t))o=t.toString();else{var h=[];Pr.forEach(t,function(w,D){w===null||typeof w>"u"||(Pr.isArray(w)?D=D+"[]":w=[w],Pr.forEach(w,function(I){Pr.isDate(I)?I=I.toISOString():Pr.isObject(I)&&(I=JSON.stringify(I)),h.push(wf(D)+"="+wf(I))}))}),o=h.join("&")}if(o){var v=n.indexOf("#");v!==-1&&(n=n.slice(0,v)),n+=(n.indexOf("?")===-1?"?":"&")+o}return n},DA=gn;function Fs(){this.handlers=[]}Fs.prototype.use=function(n,t,r){return this.handlers.push({fulfilled:n,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};Fs.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)};Fs.prototype.forEach=function(n){DA.forEach(this.handlers,function(r){r!==null&&n(r)})};var MA=Fs,qA=gn,HA=function(n,t){qA.forEach(n,function(o,h){h!==t&&h.toUpperCase()===t.toUpperCase()&&(n[t]=o,delete n[h])})},rh=function(n,t,r,o,h){return n.config=t,r&&(n.code=r),n.request=o,n.response=h,n.isAxiosError=!0,n.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},n},gu,Ef;function ih(){if(Ef)return gu;Ef=1;var e=rh;return gu=function(t,r,o,h,v){var C=new Error(t);return e(C,r,o,h,v)},gu}var Su,_f;function VA(){if(_f)return Su;_f=1;var e=ih();return Su=function(t,r,o){var h=o.config.validateStatus;!o.status||!h||h(o.status)?t(o):r(e("Request failed with status code "+o.status,o.config,null,o.request,o))},Su}var ku,Uf;function QA(){if(Uf)return ku;Uf=1;var e=gn;return ku=e.isStandardBrowserEnv()?function(){return{write:function(r,o,h,v,C,w){var D=[];D.push(r+"="+encodeURIComponent(o)),e.isNumber(h)&&D.push("expires="+new Date(h).toGMTString()),e.isString(v)&&D.push("path="+v),e.isString(C)&&D.push("domain="+C),w===!0&&D.push("secure"),document.cookie=D.join("; ")},read:function(r){var o=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),ku}var Pu,Jf;function WA(){return Jf||(Jf=1,Pu=function(n){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(n)}),Pu}var Ru,Df;function FA(){return Df||(Df=1,Ru=function(n,t){return t?n.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):n}),Ru}var vu,Mf;function GA(){if(Mf)return vu;Mf=1;var e=WA(),n=FA();return vu=function(r,o){return r&&!e(o)?n(r,o):o},vu}var Bu,qf;function LA(){if(qf)return Bu;qf=1;var e=gn,n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Bu=function(r){var o={},h,v,C;return r&&e.forEach(r.split(`
5
5
  `),function(D){if(C=D.indexOf(":"),h=e.trim(D.substr(0,C)).toLowerCase(),v=e.trim(D.substr(C+1)),h){if(o[h]&&n.indexOf(h)>=0)return;h==="set-cookie"?o[h]=(o[h]?o[h]:[]).concat([v]):o[h]=o[h]?o[h]+", "+v:v}}),o},Bu}var bu,Hf;function $A(){if(Hf)return bu;Hf=1;var e=gn;return bu=e.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),o;function h(v){var C=v;return t&&(r.setAttribute("href",C),C=r.href),r.setAttribute("href",C),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return o=h(window.location.href),function(C){var w=e.isString(C)?h(C):C;return w.protocol===o.protocol&&w.host===o.host}}():function(){return function(){return!0}}(),bu}var Ou,Vf;function Qf(){if(Vf)return Ou;Vf=1;var e=gn,n=VA(),t=QA(),r=th,o=GA(),h=LA(),v=$A(),C=ih();return Ou=function(D){return new Promise(function(I,g){var R=D.data,B=D.headers,d=D.responseType;e.isFormData(R)&&delete B["Content-Type"];var s=new XMLHttpRequest;if(D.auth){var y=D.auth.username||"",E=D.auth.password?unescape(encodeURIComponent(D.auth.password)):"";B.Authorization="Basic "+btoa(y+":"+E)}var _=o(D.baseURL,D.url);s.open(D.method.toUpperCase(),r(_,D.params,D.paramsSerializer),!0),s.timeout=D.timeout;function U(){if(s){var i="getAllResponseHeaders"in s?h(s.getAllResponseHeaders()):null,m=!d||d==="text"||d==="json"?s.responseText:s.response,N={data:m,status:s.status,statusText:s.statusText,headers:i,config:D,request:s};n(I,g,N),s=null}}if("onloadend"in s?s.onloadend=U:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(U)},s.onabort=function(){s&&(g(C("Request aborted",D,"ECONNABORTED",s)),s=null)},s.onerror=function(){g(C("Network Error",D,null,s)),s=null},s.ontimeout=function(){var m="timeout of "+D.timeout+"ms exceeded";D.timeoutErrorMessage&&(m=D.timeoutErrorMessage),g(C(m,D,D.transitional&&D.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",s)),s=null},e.isStandardBrowserEnv()){var H=(D.withCredentials||v(_))&&D.xsrfCookieName?t.read(D.xsrfCookieName):void 0;H&&(B[D.xsrfHeaderName]=H)}"setRequestHeader"in s&&e.forEach(B,function(m,N){typeof R>"u"&&N.toLowerCase()==="content-type"?delete B[N]:s.setRequestHeader(N,m)}),e.isUndefined(D.withCredentials)||(s.withCredentials=!!D.withCredentials),d&&d!=="json"&&(s.responseType=D.responseType),typeof D.onDownloadProgress=="function"&&s.addEventListener("progress",D.onDownloadProgress),typeof D.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",D.onUploadProgress),D.cancelToken&&D.cancelToken.promise.then(function(m){s&&(s.abort(),g(m),s=null)}),R||(R=null),s.send(R)})},Ou}var Je=gn,Wf=HA,KA=rh,zA={"Content-Type":"application/x-www-form-urlencoded"};function Ff(e,n){!Je.isUndefined(e)&&Je.isUndefined(e["Content-Type"])&&(e["Content-Type"]=n)}function YA(){var e;return(typeof XMLHttpRequest<"u"||typeof ue.process<"u"&&Object.prototype.toString.call(ue.process)==="[object process]")&&(e=Qf()),e}function ZA(e,n,t){if(Je.isString(e))try{return(n||JSON.parse)(e),Je.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}var Gs={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:YA(),transformRequest:[function(n,t){return Wf(t,"Accept"),Wf(t,"Content-Type"),Je.isFormData(n)||Je.isArrayBuffer(n)||Je.isBuffer(n)||Je.isStream(n)||Je.isFile(n)||Je.isBlob(n)?n:Je.isArrayBufferView(n)?n.buffer:Je.isURLSearchParams(n)?(Ff(t,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Je.isObject(n)||t&&t["Content-Type"]==="application/json"?(Ff(t,"application/json"),ZA(n)):n}],transformResponse:[function(n){var t=this.transitional,r=t&&t.silentJSONParsing,o=t&&t.forcedJSONParsing,h=!r&&this.responseType==="json";if(h||o&&Je.isString(n)&&n.length)try{return JSON.parse(n)}catch(v){if(h)throw v.name==="SyntaxError"?KA(v,this,"E_JSON_PARSE"):v}return n}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(n){return n>=200&&n<300}};Gs.headers={common:{Accept:"application/json, text/plain, */*"}};Je.forEach(["delete","get","head"],function(n){Gs.headers[n]={}});Je.forEach(["post","put","patch"],function(n){Gs.headers[n]=Je.merge(zA)});var dl=Gs,XA=gn,xA=dl,jA=function(n,t,r){var o=this||xA;return XA.forEach(r,function(v){n=v.call(o,n,t)}),n},Au,Gf;function oh(){return Gf||(Gf=1,Au=function(n){return!!(n&&n.__CANCEL__)}),Au}var Lf=gn,Iu=jA,eI=oh(),nI=dl;function Tu(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var tI=function(n){Tu(n),n.headers=n.headers||{},n.data=Iu.call(n,n.data,n.headers,n.transformRequest),n.headers=Lf.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),Lf.forEach(["delete","get","head","post","put","patch","common"],function(o){delete n.headers[o]});var t=n.adapter||nI.adapter;return t(n).then(function(o){return Tu(n),o.data=Iu.call(n,o.data,o.headers,n.transformResponse),o},function(o){return eI(o)||(Tu(n),o&&o.response&&(o.response.data=Iu.call(n,o.response.data,o.response.headers,n.transformResponse))),Promise.reject(o)})},Qe=gn,ah=function(n,t){t=t||{};var r={},o=["url","method","data"],h=["headers","auth","proxy","params"],v=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],C=["validateStatus"];function w(g,R){return Qe.isPlainObject(g)&&Qe.isPlainObject(R)?Qe.merge(g,R):Qe.isPlainObject(R)?Qe.merge({},R):Qe.isArray(R)?R.slice():R}function D(g){Qe.isUndefined(t[g])?Qe.isUndefined(n[g])||(r[g]=w(void 0,n[g])):r[g]=w(n[g],t[g])}Qe.forEach(o,function(R){Qe.isUndefined(t[R])||(r[R]=w(void 0,t[R]))}),Qe.forEach(h,D),Qe.forEach(v,function(R){Qe.isUndefined(t[R])?Qe.isUndefined(n[R])||(r[R]=w(void 0,n[R])):r[R]=w(void 0,t[R])}),Qe.forEach(C,function(R){R in t?r[R]=w(n[R],t[R]):R in n&&(r[R]=w(void 0,n[R]))});var J=o.concat(h).concat(v).concat(C),I=Object.keys(n).concat(Object.keys(t)).filter(function(R){return J.indexOf(R)===-1});return Qe.forEach(I,D),r};const rI="axios",iI="0.21.4",oI="Promise based HTTP client for the browser and node.js",aI="index.js",sI={test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},dI={type:"git",url:"https://github.com/axios/axios.git"},uI=["xhr","http","ajax","promise","node"],cI="Matt Zabriskie",lI="MIT",fI={url:"https://github.com/axios/axios/issues"},pI="https://axios-http.com",mI={coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},yI={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},hI="dist/axios.min.js",gI="dist/axios.min.js",SI="./index.d.ts",kI={"follow-redirects":"^1.14.0"},PI=[{path:"./dist/axios.min.js",threshold:"5kB"}],RI={name:rI,version:iI,description:oI,main:aI,scripts:sI,repository:dI,keywords:uI,author:cI,license:lI,bugs:fI,homepage:pI,devDependencies:mI,browser:yI,jsdelivr:hI,unpkg:gI,typings:SI,dependencies:kI,bundlesize:PI};var sh=RI,ul={};["object","boolean","number","function","string","symbol"].forEach(function(e,n){ul[e]=function(r){return typeof r===e||"a"+(n<1?"n ":" ")+e}});var $f={},vI=sh.version.split(".");function dh(e,n){for(var t=n?n.split("."):vI,r=e.split("."),o=0;o<3;o++){if(t[o]>r[o])return!0;if(t[o]<r[o])return!1}return!1}ul.transitional=function(n,t,r){var o=t&&dh(t);function h(v,C){return"[Axios v"+sh.version+"] Transitional option '"+v+"'"+C+(r?". "+r:"")}return function(v,C,w){if(n===!1)throw new Error(h(C," has been removed in "+t));return o&&!$f[C]&&($f[C]=!0,console.warn(h(C," has been deprecated since v"+t+" and will be removed in the near future"))),n?n(v,C,w):!0}};function BI(e,n,t){if(typeof e!="object")throw new TypeError("options must be an object");for(var r=Object.keys(e),o=r.length;o-- >0;){var h=r[o],v=n[h];if(v){var C=e[h],w=C===void 0||v(C,h,e);if(w!==!0)throw new TypeError("option "+h+" must be "+w);continue}if(t!==!0)throw Error("Unknown option "+h)}}var bI={isOlderVersion:dh,assertOptions:BI,validators:ul},uh=gn,OI=th,Kf=MA,zf=tI,Ls=ah,ch=bI,Rr=ch.validators;function Oo(e){this.defaults=e,this.interceptors={request:new Kf,response:new Kf}}Oo.prototype.request=function(n){typeof n=="string"?(n=arguments[1]||{},n.url=arguments[0]):n=n||{},n=Ls(this.defaults,n),n.method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var t=n.transitional;t!==void 0&&ch.assertOptions(t,{silentJSONParsing:Rr.transitional(Rr.boolean,"1.0.0"),forcedJSONParsing:Rr.transitional(Rr.boolean,"1.0.0"),clarifyTimeoutError:Rr.transitional(Rr.boolean,"1.0.0")},!1);var r=[],o=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(o=o&&g.synchronous,r.unshift(g.fulfilled,g.rejected))});var h=[];this.interceptors.response.forEach(function(g){h.push(g.fulfilled,g.rejected)});var v;if(!o){var C=[zf,void 0];for(Array.prototype.unshift.apply(C,r),C=C.concat(h),v=Promise.resolve(n);C.length;)v=v.then(C.shift(),C.shift());return v}for(var w=n;r.length;){var D=r.shift(),J=r.shift();try{w=D(w)}catch(I){J(I);break}}try{v=zf(w)}catch(I){return Promise.reject(I)}for(;h.length;)v=v.then(h.shift(),h.shift());return v};Oo.prototype.getUri=function(n){return n=Ls(this.defaults,n),OI(n.url,n.params,n.paramsSerializer).replace(/^\?/,"")};uh.forEach(["delete","get","head","options"],function(n){Oo.prototype[n]=function(t,r){return this.request(Ls(r||{},{method:n,url:t,data:(r||{}).data}))}});uh.forEach(["post","put","patch"],function(n){Oo.prototype[n]=function(t,r,o){return this.request(Ls(o||{},{method:n,url:t,data:r}))}});var AI=Oo,Cu,Yf;function lh(){if(Yf)return Cu;Yf=1;function e(n){this.message=n}return e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,Cu=e,Cu}var Nu,Zf;function II(){if(Zf)return Nu;Zf=1;var e=lh();function n(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(v){r=v});var o=this;t(function(v){o.reason||(o.reason=new e(v),r(o.reason))})}return n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var r,o=new n(function(v){r=v});return{token:o,cancel:r}},Nu=n,Nu}var wu,Xf;function TI(){return Xf||(Xf=1,wu=function(n){return function(r){return n.apply(null,r)}}),wu}var Eu,xf;function CI(){return xf||(xf=1,Eu=function(n){return typeof n=="object"&&n.isAxiosError===!0}),Eu}var jf=gn,NI=jy,aa=AI,wI=ah,EI=dl;function fh(e){var n=new aa(e),t=NI(aa.prototype.request,n);return jf.extend(t,aa.prototype,n),jf.extend(t,n),t}var Kn=fh(EI);Kn.Axios=aa;Kn.create=function(n){return fh(wI(Kn.defaults,n))};Kn.Cancel=lh();Kn.CancelToken=II();Kn.isCancel=oh();Kn.all=function(n){return Promise.all(n)};Kn.spread=TI();Kn.isAxiosError=CI();ol.exports=Kn;ol.exports.default=Kn;var _I=ol.exports,UI=_I;const sc=Mh(UI);class JI{constructor(n,t={headers:{"Content-Type":"application/json"}}){me(this,"client");me(this,"config",{});this.client=sc.create({baseURL:n,timeout:15e3,...t}),this.config={}}setConfig(n){return this.config=n,this}get(n,t={}){return this.client.get(n,{params:t,...this.config})}post(n,t={}){return this.client.post(n,t,this.config)}put(n,t={}){return this.client.put(n,t,this.config)}delete(n,t={}){return this.client.delete(n,{params:t,...this.config})}}const ep=(e,n)=>e.response?e.response.data?e.response.data.message||e.response.data:e.response.statusText:`The request to ${n} has failed.`;class DI{constructor(n,t={}){me(this,"client");me(this,"endpoint");this.client=new JI(n,t),this.endpoint=n}setConfig(n){return this.client.setConfig(n),this}async get(n,t={}){try{return await this.client.get(n,t)}catch(r){const o=r;if(sc.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new Qn(new Error(o.message),{code:xt.REQUEST_TOO_LONG,context:n,method:ct.Get});const h=ep(o,n);throw new Qn(new Error(h),{context:n,code:o.response?o.response.status:xt.BAD_REQUEST,method:ct.Get})}throw new Qn(new Error(o.message),{code:sa,context:n,contextModule:ct.Get})}}async post(n,t={}){try{return await this.client.post(n,t)}catch(r){const o=r;if(sc.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new Qn(new Error(o.message),{code:xt.REQUEST_TOO_LONG,method:ct.Post});const h=ep(o,n);throw new Qn(new Error(h),{code:o.response?o.response.status:xt.BAD_REQUEST,context:n,contextModule:ct.Post})}throw new Qn(new Error(o.message),{code:sa,context:n,contextModule:ct.Post})}}}var np;(function(e){e.Idle="idle",e.Loading="loading",e.Completed="completed",e.Error="error",e.Confirmed="confirmed"})(np||(np={}));const dc=4e5,Oa=16e7,ph={amount:[{amount:new Fn(dc).times(Oa).toString(),denom:"inj"}],gas:dc.toString(),payer:"",granter:"",feePayer:""},MI=e=>{if(!e)return ph;const{gas:n=dc.toString(),gasPrice:t=Oa,payer:r,granter:o,feePayer:h}=e,v=new Fn(n).toFixed(0),C=new Fn(t).toFixed(0);return{amount:[{denom:"inj",amount:new Fn(v).times(C).toFixed()}],gas:new Fn(v).toFixed(),payer:r,granter:o,feePayer:h}},qI=e=>{const n=e.match(/^([0-9.]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/);if(!n)throw new Error("Invalid gas price string");const[t,r]=n,o=new Hn(r).toWei().dividedBy(Oa).toFixed(0);return MI({gas:o,gasPrice:Oa})};Fn.clone({ROUNDING_MODE:Fn.ROUND_DOWN});const HI=e=>typeof e=="number"?!0:!isNaN(parseFloat(e)),tp=e=>new Fn(e).toFixed(18),VI="wasm/MsgExecuteContract",uc=({object:e,messageType:n,primaryType:t="MsgValue"})=>{const r=["order_mask","order_type","oracle_type","round","oracle_scale_factor","expiry","option","proposal_id","creation_height"],o=["timeout_timestamp","revision_height","revision_number"],h=["cid"],v=new Map,C=new Array;for(const w in _u(e)){const D=_u(e)[w];if(w==="@type")continue;const J=typeof D;if(J==="boolean")C.push({name:w,type:"bool"});else if(J==="number"||J==="bigint"||r.includes(w))C.push({name:w,type:QI(w)});else if(J==="string"){if(h.includes(w)&&!D)continue;if(o.includes(w)){C.push({name:w,type:WI(w)});continue}C.push({name:w,type:"string"})}else if(J==="object"){if(Array.isArray(D)&&D.length===0)throw new Gi(new Error("Array with length 0 found"));if(Array.isArray(D)&&D.length>0){const I=typeof D[0];if(I==="boolean"||I==="number"||I==="string"){for(const R in D)if(typeof R!==I)throw new Gi(new Error("Array with different types found"));I==="boolean"?C.push({name:w,type:"bool[]"}):I==="number"?C.push({name:w,type:"number[]"}):I==="string"&&C.push({name:w,type:"string[]"})}else if(I==="object"){const R=rp({property:Nf(w),parentProperty:t,messageType:n}),B=uc({object:D[0],primaryType:R,messageType:n}),d=B.get(R);C.push({name:w,type:`${R}[]`}),v.set(R,d);for(const s of B.keys())s!==t&&v.set(s,B.get(s))}else throw new Gi(new Error("Array with elements of unknown type found"))}else if(D instanceof Date)C.push({name:w,type:"string"});else{const I=rp({property:Nf(w),parentProperty:t,messageType:n}),g=uc({object:D,primaryType:I,messageType:n}),R=g.get(I);C.push({name:w,type:I}),v.set(I,R);for(const B of g.keys())B!==t&&v.set(B,g.get(B))}}else throw new Gi(new Error(`Type ${w} not found`))}return v.set(t,C),v},QI=e=>{switch(e){case"order_mask":return"int32";case"timeout_timestamp":return"timeout_timestamp";case"revision_number":return"uint64";case"revision_height":return"uint64";case"order_type":return"int32";case"oracle_type":return"int32";case"exponent":return"uint32";case"round":return"uint64";case"oracle_scale_factor":return"uint64";case"expiry":return"int64";case"creation_height":return"int64";case"option":return"int32";case"proposal_id":return"uint64";default:return"uint64"}},WI=e=>{switch(e){case"timeout_timestamp":return"uint64";case"revision_number":return"uint64";case"revision_height":return"uint64";default:return"uint64"}},cc=(e,n)=>{const t=["proposal_id","round","oracle_scale_factor","timeout_timestamp","revision_height","revision_number","expiry"],r=["min_price_tick_size","price","quantity","margin","trigger_price","min_quantity_tick_size"],o={"exchange/MsgIncreasePositionMargin":["amount"]},h={"wasmx/MsgExecuteContractCompat":["funds"]},v=["uri","uri_hash"];return Object.keys(e).reduce((C,w)=>{const D=e[w];if(!D){if(n){const J=Object.keys(h).find(I=>I===n);if(J&&h[J].includes(w))return{...C,[w]:D}}return v.includes(w)?{...C,[w]:D}:C}if(typeof D=="object")return D instanceof Date?{...C,[w]:D.toJSON().split(".")[0]+"Z"}:Array.isArray(D)?{...C,[w]:D.every(J=>typeof J=="string")?D:D.map(J=>cc(J))}:{...C,[w]:cc(D)};if(HI(D)&&t.includes(w))return{...C,[w]:D.toString()};if(typeof D=="string"){if(r.includes(w))return{...C,[w]:tp(D)};if(n){const J=Object.keys(o).find(I=>I===n);if(J&&o[J].includes(w))return{...C,[w]:tp(D)}}}return{...C,[w]:D}},{})},rp=({property:e,parentProperty:n,messageType:t})=>t===VI?FI(e,n):GI(e,n),FI=(e,n="")=>{const t="CosmwasmInnerMsgMarker",r=e.replace("Type","");return r==="Msg"?t:`${n.replace(t,"")+r}Value`},GI=(e,n="")=>{const t=e.replace("Type","");return`Type${(n==="MsgValue"?"":n.replace("Type",""))+t}`};function Aa(e){if(Array.isArray(e))return e.map(Aa);if(typeof e!="object"||e===null)return e;const n={};return Object.keys(e).sort().forEach(t=>{e[t]===void 0||e[t]===null||(n[t]=Aa(e[t]))}),n}class LI{constructor(n){me(this,"params");this.params=n}toJSON(){return JSON.stringify(Aa(this.toData()))}toEip712Types(){const n=this.toAmino();return uc({object:n.value,messageType:n.type})}toEip712(){const n=this.toAmino(),{type:t,value:r}=n;return{type:t,value:cc(r,t)}}toDirectSignJSON(){return JSON.stringify(Aa(this.toDirectSign()))}}const $I="injpub",Zo="inj",KI="injvaloper",zI="injvalcons",YI="m/44'/60'/0'/0/0";class Oi{constructor(n){me(this,"bech32Address");this.bech32Address=n}compare(n){return this.bech32Address===n.bech32Address}get address(){return this.bech32Address}static fromBech32(n,t=Zo){try{const r=ue.Buffer.from(Rn.fromWords(Rn.decode(n).words)).toString("hex"),o=r.startsWith("0x")?r:`0x${r}`,h=Xo.Address.fromString(o.toString()).toBuffer(),v=Rn.encode(t,Rn.toWords(h));return new Oi(v)}catch(r){throw new Gi(new Error(r.message),{type:Pp.ValidationError})}}static fromHex(n,t=Zo){const r=n.startsWith("0x")?n:`0x${n}`,o=Xo.Address.fromString(r.toString()).toBuffer(),h=Rn.encode(t,Rn.toWords(o));return new Oi(h)}toBech32(n=Zo){const t=this.toHex(),r=t.startsWith("0x")?t:`0x${t}`,o=Xo.Address.fromString(r).toBuffer();return Rn.encode(n,Rn.toWords(o))}toAccountAddress(){return this.toBech32(Zo)}toValidatorAddress(){return this.toBech32(KI)}toConsensusAddress(){return this.toBech32(zI)}toHex(){const{bech32Address:n}=this,t=ue.Buffer.from(Rn.fromWords(Rn.decode(n).words)).toString("hex");return t.startsWith("0x")?t:`0x${t}`}getSubaccountId(n=0){const t="0".repeat(23)+n;return`${this.toHex()}${t}`}getEthereumAddress(){return this.toHex()}}var ip;(function(e){e.UnBonded="UnBonded",e.UnBonding="UnBonding",e.Bonded="Bonded"})(ip||(ip={}));const op={...zh},ZI=e=>qh.SHA256.hash(Hh.Base64.parse(e)).toString().toUpperCase();function XI(e){return ue.Buffer.from(e).toString("hex")}function xI(e){return new Uint8Array(ue.Buffer.from(e,"hex"))}function jI(e){ue.Buffer.from(e,"hex").length===64&&(e="04"+e);let t=XI(Vh.publicKeyConvert(xI(e),!1));return t=t.substring(2),t}class cl extends LI{static fromJSON(n){return new cl(n)}toProto(){const{params:n}=this,t=Ee.create();t.denom=n.amount.denom,t.amount=n.amount.amount;const r=ia.create();if(r.receiver=n.receiver,r.sender=n.sender,r.sourceChannel=n.channelId,r.sourcePort=n.port,r.token=t,n.height){const o=Xt.create();o.revisionHeight=n.height.revisionHeight.toString(),o.revisionNumber=n.height.revisionNumber.toString(),r.timeoutHeight=o}return n.timeout&&(r.timeoutTimestamp=n.timeout.toString()),r.memo=n.memo||"",ia.fromJSON(r)}toData(){return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...this.toProto()}}toAmino(){const n=this.toProto(),t={..._u(n)};return{type:"cosmos-sdk/MsgTransfer",value:{...t,memo:t.memo||""}}}toWeb3(){const n=this.toAmino(),{value:t}=n;return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...t}}toDirectSign(){return{type:"/ibc.applications.transfer.v1.MsgTransfer",message:this.toProto()}}toBinary(){return ia.encode(this.toProto()).finish()}}class ll{static encode(n){return ue.Buffer.from(ba.encode(n).finish()).toString("base64")}static decode(n){return ba.decode(ue.Buffer.from(n,"base64"))}static hash(n){return ZI(ll.encode(n))}}const eT=e=>{const n=Pe.create();return n.typeUrl=`${e.type.startsWith("/")?"":"/"}${e.type}`,n.value=e.value,n},nT=(e,n)=>{const t=Pe.create();return t.typeUrl=n,t.value=e,t},tT=Be.SIGN_MODE_DIRECT;Be.SIGN_MODE_LEGACY_AMINO_JSON;Be.SIGN_MODE_LEGACY_AMINO_JSON;Be.SIGN_MODE_EIP712_V2;const rT=({chainId:e,key:n})=>{if(typeof n!="string")return n;let t,r,o;return e.startsWith("injective")?(t=Gt.create(),o=Gt,r="/injective.crypto.v1beta1.ethsecp256k1.PubKey"):e.startsWith("evmos")?(t=Gt.create(),o=Gt,r="/ethermint.crypto.v1.ethsecp256k1.PubKey"):(t=Gt.create(),o=Gt,r="/cosmos.crypto.secp256k1.PubKey"),t.key=ue.Buffer.from(n,"base64"),nT(o.encode(t).finish(),r)},iT=({message:e,memo:n="",timeoutHeight:t})=>{const r=Array.isArray(e)?e:[e],o=rl.create();return o.messages=r.map(h=>eT({value:h.toBinary(),type:h.toDirectSign().type})),o.memo=n,t&&(o.timeoutHeight=t.toString()),o},oT=({fee:e,payer:n,granter:t,gasLimit:r})=>{const o=Ee.create();o.amount=e.amount,o.denom=e.denom;const h=Zt.create();return h.gasLimit=r.toString(),h.amount=[o],n&&(h.payer=n),t&&(h.granter=t),h},aT=({chainId:e,mode:n,signers:t})=>t.map(r=>sT({mode:n,chainId:e,publicKey:r.pubKey,sequence:r.sequence})),sT=({chainId:e,publicKey:n,sequence:t,mode:r})=>{const o=rT({chainId:e,key:n}),h=Yt.create();h.mode=r;const v=En.create();v.single=h;const C=zt.create();return C.publicKey=o,C.sequence=t.toString(),C.modeInfo=v,C},dT=({signerInfo:e,fee:n})=>{const t=il.create();return t.signerInfos=e,t.fee=n,t},uT=({bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:r})=>{const o=tl.create();return o.accountNumber=r.toString(),o.chainId=t,o.bodyBytes=e,o.authInfoBytes=n,o};class cT extends DI{retry(n,t=3,r=1e3){const o=async(h=1)=>{try{return await n()}catch(v){if(v instanceof Qn&&v.code===xt.REQUEST_TOO_LONG||h>=t)throw v;return new Promise(C=>setTimeout(()=>C(o(h+1)),r*h))}};return o()}}class lT extends cT{async fetchAccount(n,t={}){const r=`cosmos/auth/v1beta1/accounts/${n}`;try{return(await this.retry(()=>this.get(r,t))).data}catch(o){throw o instanceof Qn?o:new Qn(new Error(o.message),{code:sa,context:`${this.endpoint}/${r}`,contextModule:op.Auth})}}async fetchCosmosAccount(n,t={}){const r=`cosmos/auth/v1beta1/accounts/${n}`;try{const o=n.startsWith("inj")||n.startsWith("evmos"),h=await this.retry(()=>this.get(r,t));return o?h.data.account.base_account:h.data.account}catch(o){throw o instanceof Qn?o:new Qn(new Error(o.message),{code:sa,context:`${this.endpoint}/${r}`,contextModule:op.Auth})}}}var fT=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof ue.global<"u")return ue.global;throw"Unable to locate global object"})();j.util.Long!==_e&&(j.util.Long=_e,j.configure());let VT=class extends fT.Error{constructor(n,t,r){super(n),this.code=t,this.metadata=r}};var ap;(function(e){e.Internal="internal",e.External="external",e.Withdraw="withdraw",e.Deposit="deposit"})(ap||(ap={}));var sp;(function(e){e[e.AccessTypeUnspecified=0]="AccessTypeUnspecified",e[e.AccessTypeNobody=1]="AccessTypeNobody",e[e.AccessTypeOnlyAddress=2]="AccessTypeOnlyAddress",e[e.AccessTypeEverybody=3]="AccessTypeEverybody",e[e.AccessTypeAnyOfAddresses=4]="AccessTypeAnyOfAddresses"})(sp||(sp={}));var dp;(function(e){e.AccessTypeUnspecified="Unspecified",e.AccessTypeNobody="Nobody",e.AccessTypeOnlyAddress="Only Address",e.AccessTypeEverybody="Everybody",e.AccessTypeAnyOfAddresses="Any of Addresses"})(dp||(dp={}));var up;(function(e){e.Proposed="proposed",e.Signed="signed",e.Missed="missed"})(up||(up={}));var cp;(function(e){e.Pending="pending",e.Disbursed="disbursed"})(cp||(cp={}));({...Yh});var lp;(function(e){e.Market="market",e.LimitFill="limitFill",e.LimitMatchRestingOrder="limitMatchRestingOrder",e.LimitMatchNewOrder="limitMatchNewOrder"})(lp||(lp={}));var fp;(function(e){e.Maker="maker",e.Taker="taker"})(fp||(fp={}));var pp;(function(e){e.Buy="buy",e.Sell="sell",e.Long="long",e.Short="short"})(pp||(pp={}));var mp;(function(e){e.Insert="insert",e.Delete="delete",e.Replace="replace",e.Update="update",e.Invalidate="invalidate"})(mp||(mp={}));new Hn(0);Rp`
@@ -37,4 +37,4 @@ Proven: ${(0,Kt.toHex)(e.key)}`);return Ft.ics23.CommitmentProof.decode(e.data)}
37
37
  blockHeight
38
38
  }
39
39
  }
40
- `;j.util.Long!==_e&&(j.util.Long=_e,j.configure());var pT=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof ue.global<"u")return ue.global;throw"Unable to locate global object"})();j.util.Long!==_e&&(j.util.Long=_e,j.configure());class WT extends pT.Error{constructor(n,t,r){super(n),this.code=t,this.metadata=r}}class eo{constructor(n,t){me(this,"type");me(this,"key");this.key=n,this.type=t||"/injective.crypto.v1beta1.ethsecp256k1.PubKey"}static fromBase64(n){return new eo(ue.Buffer.from(n,"base64"))}static fromBytes(n){return new eo(n)}static fromHex(n){const r=typeof n=="string"&&n.startsWith("0x")?n.slice(2):n,o=ue.Buffer.from(r.toString(),"hex"),h=xo.publicKeyCreate(o,!0),v="/injective.crypto.v1beta1.ethsecp256k1.PubKey";return new eo(h,v)}toPubKeyBytes(){return this.key}toBase64(){return ue.Buffer.from(this.toPubKeyBytes()).toString("base64")}toHex(){return ue.Buffer.from(this.toPubKeyBytes()).toString("hex")}toBech32(){return Rn.encode($I,Rn.toWords(ue.Buffer.from(this.toHex(),"hex")))}toAddress(){const n=this.toHex(),t=jI(n),r=ue.Buffer.from(Qh.keccak256(Xo.toBuffer(t.startsWith("0x")?t:"0x"+t)),"hex").subarray(-20);return Oi.fromHex(ue.Buffer.from(r).toString("hex").toLowerCase())}toProto(){const n=ic.create();return n.key=this.key,n}toAny(){const n=this.toProto(),t=Pe.create();return t.typeUrl=this.type,t.value=ue.Buffer.from(ic.encode(n).finish()),t}}class wr{constructor(n){me(this,"wallet");this.wallet=n}static generate(){const n=Wh.generateMnemonic();return{privateKey:wr.fromMnemonic(n),mnemonic:n}}static fromMnemonic(n,t=YI){return new wr(Rd.fromMnemonic(n,t))}static fromPrivateKey(n){return new wr(new Rd(n))}static fromHex(n){const t=typeof n=="string",r=t&&n.startsWith("0x")?n.slice(2):n,o=t?ue.Buffer.from(r.toString(),"hex"):n;return new wr(new Rd(o))}toPrivateKeyHex(){return this.wallet.privateKey.startsWith("0x")?this.wallet.privateKey:`0x${this.wallet.privateKey}`}toPublicKey(){return eo.fromHex(this.wallet.privateKey)}toHex(){return this.wallet.address.startsWith("0x")?this.wallet.address:`0x${this.wallet.address}`}toAddress(){return Oi.fromHex(this.toHex())}toBech32(){return Oi.fromHex(this.toHex()).toBech32()}async sign(n){const{wallet:t}=this,r=Uu(n),o=await t._signingKey().signDigest(r),h=fl(o);return pl(ml([h.r,h.s]))}async signEcda(n){const{wallet:t}=this,r=Uu(n),o=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,h=Uint8Array.from(ue.Buffer.from(o,"hex")),{signature:v}=xo.ecdsaSign(r,h);return v}async signHashed(n){const{wallet:t}=this,r=await t._signingKey().signDigest(n),o=fl(r);return pl(ml([o.r,o.s]))}async signHashedEcda(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(ue.Buffer.from(r,"hex")),{signature:h}=xo.ecdsaSign(n,o);return h}async signTypedData(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=yl.signTypedData({privateKey:ue.Buffer.from(r,"hex"),data:n,version:yl.SignTypedDataVersion.V4});return ue.Buffer.from(o.replace("0x",""),"hex")}async signHashedTypedData(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(ue.Buffer.from(r,"hex")),{signature:h}=xo.ecdsaSign(n,o);return h}}const mT=({signers:e,chainId:n,message:t,timeoutHeight:r,memo:o="",fee:h=ph,signMode:v=tT})=>{const C=Array.isArray(e)?e:[e],[w]=C,D=iT({message:t,memo:o,timeoutHeight:r}),J=typeof h=="string"?qI(h):h,I=oT({fee:J.amount[0],payer:J.payer,granter:J.granter,gasLimit:parseInt(J.gas,10)}),g=aT({chainId:n,mode:v,signers:C}),R=dT({signerInfo:g,fee:I}),B=rl.encode(D).finish(),d=il.encode(R).finish(),s=uT({chainId:n,bodyBytes:B,authInfoBytes:d,accountNumber:w.accountNumber}),y=tl.encode(s).finish(),E=ue.Buffer.from(y),_=Uu(ue.Buffer.from(y)),U=ba.create();return U.authInfoBytes=d,U.bodyBytes=B,{txRaw:U,signDoc:s,signers:e,signer:w,signBytes:E,signHashedBytes:_,bodyBytes:B,authInfoBytes:d}},yT=e=>mT({...e,signers:{pubKey:e.pubKey,accountNumber:e.accountNumber,sequence:e.sequence}});async function hT(e,n){const[t,r]=await bi.chainFromRpc(e);if(gg.includes(r))return new ST(r,t,n);const o=await st.DirectSecp256k1HdWallet.fromMnemonic(n,{prefix:bp(r)}),h=(await o.getAccounts())[0],v=await el.SigningCosmWasmClient.connectWithSigner(Fh(t,r),o);return new gT(r,v,h.address)}class gT{constructor(n,t,r,o){me(this,"_chain");me(this,"_signer");me(this,"_account");me(this,"_debug");this._chain=n,this._signer=t,this._account=r,this._debug=o}chain(){return this._chain}address(){return this._account}async sign(n){const t=[];for(const r of n){const{description:o,transaction:h}=r;this._debug&&(console.log(`Signing: ${o} for ${this.address()}`),console.log(h.msgs,h.fee,h.memo));const v=await this._signer.sign(this.address(),h.msgs,h.fee,h.memo),C=at.TxRaw.encode(v).finish();t.push(C)}return t}}class ST{constructor(n,t,r){me(this,"_chain");me(this,"_chainId");me(this,"key");me(this,"prefix");me(this,"_rpc");this._chain=n,this._rpc=new lT(kg(t,n)),this._chainId=Gh.get(t,n),this.prefix=bp(n),this.key=wr.fromMnemonic(r)}chain(){return this._chain}address(){return this.key.toAddress().toBech32(this.prefix)}async sign(n){const t=this.key.toPublicKey().toBase64(),{sequence:r,accountNumber:o}=await this.getSignerData(),h=[];for(const v of n){const{description:C,transaction:w}=v;console.log(`Signing ${C} for ${this.address()}`);const{signBytes:D,txRaw:J}=yT({message:w.msgs.map(I=>cl.fromJSON({port:I.value.sourcePort,amount:I.value.token,memo:I.value.memo,sender:I.value.sender,receiver:I.value.receiver,channelId:I.value.sourceChannel,timeout:I.value.timeoutTimestamp,height:I.value.timeoutHeight})),pubKey:t,sequence:r,accountNumber:o,chainId:this._chainId,memo:w.memo,fee:w.fee});J.signatures=[await this.key.sign(D)],h.push(fc.decode(ll.encode(J)))}return h}async getSignerData(){const n=this.address(),{account:t}=await this._rpc.fetchAccount(n),r=parseInt(t.base_account.account_number,10),o=parseInt(t.base_account.sequence,10);return{address:n,sequence:o,accountNumber:r}}}const kT={Address:je,Platform:bi,getSigner:hT,protocols:{WormholeCore:()=>vd(()=>import("./index-KMQj8MBB.js"),__vite__mapDeps([0,1,2,3,4,5,6])),TokenBridge:()=>vd(()=>import("./index-CRnaWQgW.js"),__vite__mapDeps([7,0,1,2,3,4,5,6,8])),IbcBridge:()=>vd(()=>import("./index-C1x31Jxk.js"),__vite__mapDeps([9,2,3,5,6,0,1,4,8]))},getChain:(e,n,t)=>new nl(n,new bi(e,Lh(e,no,{[n]:t})))},FT=Object.freeze(Object.defineProperty({__proto__:null,default:kT},Symbol.toStringTag,{value:"Module"}));export{DT as $,Em as A,_m as B,bi as C,Um as D,Jm as E,Mm as F,rc as G,qm as H,ps as I,Qm as J,Wm as K,Gm as L,Sv as M,hs as N,gl as O,AT as P,vp as Q,IT as R,TT as S,CT as T,NT as U,wT as V,ET as W,_T as X,UT as Y,JT as Z,no as _,je as a,er as a0,bT as a1,OT as a2,FT as a3,ti as b,Bt as c,Va as d,ym as e,hm as f,gm as g,ja as h,Sm as i,km as j,vt as k,Pm as l,is as m,vm as n,bm as o,be as p,lm as q,Om as r,Am as s,Oc as t,Tm as u,Tc as v,Cm as w,Nm as x,wm as y,ds as z};
40
+ `;j.util.Long!==_e&&(j.util.Long=_e,j.configure());var pT=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof ue.global<"u")return ue.global;throw"Unable to locate global object"})();j.util.Long!==_e&&(j.util.Long=_e,j.configure());class WT extends pT.Error{constructor(n,t,r){super(n),this.code=t,this.metadata=r}}class eo{constructor(n,t){me(this,"type");me(this,"key");this.key=n,this.type=t||"/injective.crypto.v1beta1.ethsecp256k1.PubKey"}static fromBase64(n){return new eo(ue.Buffer.from(n,"base64"))}static fromBytes(n){return new eo(n)}static fromHex(n){const r=typeof n=="string"&&n.startsWith("0x")?n.slice(2):n,o=ue.Buffer.from(r.toString(),"hex"),h=xo.publicKeyCreate(o,!0),v="/injective.crypto.v1beta1.ethsecp256k1.PubKey";return new eo(h,v)}toPubKeyBytes(){return this.key}toBase64(){return ue.Buffer.from(this.toPubKeyBytes()).toString("base64")}toHex(){return ue.Buffer.from(this.toPubKeyBytes()).toString("hex")}toBech32(){return Rn.encode($I,Rn.toWords(ue.Buffer.from(this.toHex(),"hex")))}toAddress(){const n=this.toHex(),t=jI(n),r=ue.Buffer.from(Qh.keccak256(Xo.toBuffer(t.startsWith("0x")?t:"0x"+t)),"hex").subarray(-20);return Oi.fromHex(ue.Buffer.from(r).toString("hex").toLowerCase())}toProto(){const n=ic.create();return n.key=this.key,n}toAny(){const n=this.toProto(),t=Pe.create();return t.typeUrl=this.type,t.value=ue.Buffer.from(ic.encode(n).finish()),t}}class wr{constructor(n){me(this,"wallet");this.wallet=n}static generate(){const n=Wh.generateMnemonic();return{privateKey:wr.fromMnemonic(n),mnemonic:n}}static fromMnemonic(n,t=YI){return new wr(Rd.fromMnemonic(n,t))}static fromPrivateKey(n){return new wr(new Rd(n))}static fromHex(n){const t=typeof n=="string",r=t&&n.startsWith("0x")?n.slice(2):n,o=t?ue.Buffer.from(r.toString(),"hex"):n;return new wr(new Rd(o))}toPrivateKeyHex(){return this.wallet.privateKey.startsWith("0x")?this.wallet.privateKey:`0x${this.wallet.privateKey}`}toPublicKey(){return eo.fromHex(this.wallet.privateKey)}toHex(){return this.wallet.address.startsWith("0x")?this.wallet.address:`0x${this.wallet.address}`}toAddress(){return Oi.fromHex(this.toHex())}toBech32(){return Oi.fromHex(this.toHex()).toBech32()}async sign(n){const{wallet:t}=this,r=Uu(n),o=await t._signingKey().signDigest(r),h=fl(o);return pl(ml([h.r,h.s]))}async signEcda(n){const{wallet:t}=this,r=Uu(n),o=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,h=Uint8Array.from(ue.Buffer.from(o,"hex")),{signature:v}=xo.ecdsaSign(r,h);return v}async signHashed(n){const{wallet:t}=this,r=await t._signingKey().signDigest(n),o=fl(r);return pl(ml([o.r,o.s]))}async signHashedEcda(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(ue.Buffer.from(r,"hex")),{signature:h}=xo.ecdsaSign(n,o);return h}async signTypedData(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=yl.signTypedData({privateKey:ue.Buffer.from(r,"hex"),data:n,version:yl.SignTypedDataVersion.V4});return ue.Buffer.from(o.replace("0x",""),"hex")}async signHashedTypedData(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=Uint8Array.from(ue.Buffer.from(r,"hex")),{signature:h}=xo.ecdsaSign(n,o);return h}}const mT=({signers:e,chainId:n,message:t,timeoutHeight:r,memo:o="",fee:h=ph,signMode:v=tT})=>{const C=Array.isArray(e)?e:[e],[w]=C,D=iT({message:t,memo:o,timeoutHeight:r}),J=typeof h=="string"?qI(h):h,I=oT({fee:J.amount[0],payer:J.payer,granter:J.granter,gasLimit:parseInt(J.gas,10)}),g=aT({chainId:n,mode:v,signers:C}),R=dT({signerInfo:g,fee:I}),B=rl.encode(D).finish(),d=il.encode(R).finish(),s=uT({chainId:n,bodyBytes:B,authInfoBytes:d,accountNumber:w.accountNumber}),y=tl.encode(s).finish(),E=ue.Buffer.from(y),_=Uu(ue.Buffer.from(y)),U=ba.create();return U.authInfoBytes=d,U.bodyBytes=B,{txRaw:U,signDoc:s,signers:e,signer:w,signBytes:E,signHashedBytes:_,bodyBytes:B,authInfoBytes:d}},yT=e=>mT({...e,signers:{pubKey:e.pubKey,accountNumber:e.accountNumber,sequence:e.sequence}});async function hT(e,n){const[t,r]=await bi.chainFromRpc(e);if(gg.includes(r))return new ST(r,t,n);const o=await st.DirectSecp256k1HdWallet.fromMnemonic(n,{prefix:bp(r)}),h=(await o.getAccounts())[0],v=await el.SigningCosmWasmClient.connectWithSigner(Fh(t,r),o);return new gT(r,v,h.address)}class gT{constructor(n,t,r,o){me(this,"_chain");me(this,"_signer");me(this,"_account");me(this,"_debug");this._chain=n,this._signer=t,this._account=r,this._debug=o}chain(){return this._chain}address(){return this._account}async sign(n){const t=[];for(const r of n){const{description:o,transaction:h}=r;this._debug&&(console.log(`Signing: ${o} for ${this.address()}`),console.log(h.msgs,h.fee,h.memo));const v=await this._signer.sign(this.address(),h.msgs,h.fee,h.memo),C=at.TxRaw.encode(v).finish();t.push(C)}return t}}class ST{constructor(n,t,r){me(this,"_chain");me(this,"_chainId");me(this,"key");me(this,"prefix");me(this,"_rpc");this._chain=n,this._rpc=new lT(kg(t,n)),this._chainId=Gh.get(t,n),this.prefix=bp(n),this.key=wr.fromMnemonic(r)}chain(){return this._chain}address(){return this.key.toAddress().toBech32(this.prefix)}async sign(n){const t=this.key.toPublicKey().toBase64(),{sequence:r,accountNumber:o}=await this.getSignerData(),h=[];for(const v of n){const{description:C,transaction:w}=v;console.log(`Signing ${C} for ${this.address()}`);const{signBytes:D,txRaw:J}=yT({message:w.msgs.map(I=>cl.fromJSON({port:I.value.sourcePort,amount:I.value.token,memo:I.value.memo,sender:I.value.sender,receiver:I.value.receiver,channelId:I.value.sourceChannel,timeout:I.value.timeoutTimestamp,height:I.value.timeoutHeight})),pubKey:t,sequence:r,accountNumber:o,chainId:this._chainId,memo:w.memo,fee:w.fee});J.signatures=[await this.key.sign(D)],h.push(fc.decode(ll.encode(J)))}return h}async getSignerData(){const n=this.address(),{account:t}=await this._rpc.fetchAccount(n),r=parseInt(t.base_account.account_number,10),o=parseInt(t.base_account.sequence,10);return{address:n,sequence:o,accountNumber:r}}}const kT={Address:je,Platform:bi,getSigner:hT,protocols:{WormholeCore:()=>vd(()=>import("./index-CV4pfIw7.js"),__vite__mapDeps([0,1,2,3,4,5,6])),TokenBridge:()=>vd(()=>import("./index-ByeOkyS8.js"),__vite__mapDeps([7,0,1,2,3,4,5,6,8])),IbcBridge:()=>vd(()=>import("./index-BjIxvQFV.js"),__vite__mapDeps([9,2,3,5,6,0,1,4,8]))},getChain:(e,n,t)=>new nl(n,new bi(e,Lh(e,no,{[n]:t})))},FT=Object.freeze(Object.defineProperty({__proto__:null,default:kT},Symbol.toStringTag,{value:"Module"}));export{DT as $,Em as A,_m as B,bi as C,Um as D,Jm as E,Mm as F,rc as G,qm as H,ps as I,Qm as J,Wm as K,Gm as L,Sv as M,hs as N,gl as O,AT as P,vp as Q,IT as R,TT as S,CT as T,NT as U,wT as V,ET as W,_T as X,UT as Y,JT as Z,no as _,je as a,er as a0,bT as a1,OT as a2,FT as a3,ti as b,Bt as c,Va as d,ym as e,hm as f,gm as g,ja as h,Sm as i,km as j,vt as k,Pm as l,is as m,vm as n,bm as o,be as p,lm as q,Om as r,Am as s,Oc as t,Tm as u,Tc as v,Cm as w,Nm as x,wm as y,ds as z};