@wormhole-foundation/wormhole-connect 0.3.19-beta.3-development → 0.3.19-beta.5-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 (115) hide show
  1. package/dist/assets/{ccip-B8sh0red.js → ccip-De5bB7ry.js} +1 -1
  2. package/dist/assets/{evm-B3YdeaCI.js → evm-DJTN7n-6.js} +4 -4
  3. package/dist/assets/{index-moDeJTxm.js → index-CdA027fm.js} +1 -1
  4. package/dist/assets/{index-1ZJmfQkw.js → index-D8xdfMo8.js} +2 -2
  5. package/dist/assets/{index.es-CXmj0UJy.js → index.es-DsPAzXeV.js} +2 -2
  6. package/dist/main.js +7 -7
  7. package/dist/src/components/ManualAddressInput.d.ts.map +1 -1
  8. package/dist/src/routes/cosmosGateway/cosmosGateway.d.ts +2 -0
  9. package/dist/src/routes/cosmosGateway/cosmosGateway.d.ts.map +1 -1
  10. package/dist/src/routes/porticoBridge/porticoBridge.d.ts +2 -0
  11. package/dist/src/routes/porticoBridge/porticoBridge.d.ts.map +1 -1
  12. package/dist/src/routes/sdkv2/route.d.ts +1 -1
  13. package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
  14. package/dist/src/routes/tbtc/tbtc.d.ts +2 -0
  15. package/dist/src/routes/tbtc/tbtc.d.ts.map +1 -1
  16. package/lib/{algorand-BDR3KPTJ.js → algorand-BizCMnCe.js} +1 -1
  17. package/lib/{algorand-CNPRWbNB.mjs → algorand-CZC9cPKi.mjs} +4 -4
  18. package/lib/{aptos-BPs26BCC.mjs → aptos-B4ng1XsR.mjs} +1 -1
  19. package/lib/{aptos-t3uXFwih.mjs → aptos-CRkEBLid.mjs} +4 -4
  20. package/lib/{aptos-tCZHrDAP.js → aptos-CXyHqFt8.js} +2 -2
  21. package/lib/{aptos-Br9Q1n2N.js → aptos-i8WEm-Fe.js} +1 -1
  22. package/lib/{browser-33Nc32cs.mjs → browser-CIwNo6kY.mjs} +2 -2
  23. package/lib/{browser-Cz60hQ-L.js → browser-DEzmpMBm.js} +1 -1
  24. package/lib/{ccip-CtmuOQGX.js → ccip-6omn1tDF.js} +1 -1
  25. package/lib/{ccip-CE49B2YD.mjs → ccip-LzzuUWf7.mjs} +1 -1
  26. package/lib/{chain-BT07YJHt.js → chain-BteoJHpg.js} +1 -1
  27. package/lib/{chain-CbwtJlkc.mjs → chain-Cc-vL0Ji.mjs} +1 -1
  28. package/lib/{cosmos-LlwNYP69.mjs → cosmos-5NiZ8EbB.mjs} +3 -3
  29. package/lib/{cosmos-t65H2NQC.js → cosmos-DM4Lrmu1.js} +1 -1
  30. package/lib/{cosmwasm-CiJ3I3AY.js → cosmwasm-8FJsT7LT.js} +2 -2
  31. package/lib/{cosmwasm-CbTKetWD.mjs → cosmwasm-BHEBPmf7.mjs} +6 -6
  32. package/lib/{create-Chqnlpoq.js → create-48Wkagqs.js} +1 -1
  33. package/lib/{create-HNw0Emrd.mjs → create-BIAJIVSg.mjs} +1 -1
  34. package/lib/{ens-validation.es6-BaZUabxu.js → ens-validation.es6-Bw--s4Qc.js} +1 -1
  35. package/lib/{ens-validation.es6-CyEOHc9J.mjs → ens-validation.es6-DQFhqeC0.mjs} +2 -2
  36. package/lib/{evm-lHNM4jqm.mjs → evm-B5hnoH2O.mjs} +6 -6
  37. package/lib/{evm-CjvzIUCn.mjs → evm-Dd33ef5o.mjs} +6 -6
  38. package/lib/{evm-CNC7JHe1.js → evm-JNEgzI8_.js} +4 -4
  39. package/lib/{evm-3AGyBI-h.js → evm-OwiMOsDg.js} +2 -2
  40. package/lib/{index-BWsL77BI.mjs → index-10BWvX1N.mjs} +3 -3
  41. package/lib/{index-DPNt5r2L.js → index-670AMJe5.js} +1 -1
  42. package/lib/{index-C4kvGnSA.mjs → index-B03MiI2p.mjs} +2 -2
  43. package/lib/{index-BpuXk_6h.js → index-B9pFbfyU.js} +1 -1
  44. package/lib/{index-35qsyZLz.js → index-BDi5PNJc.js} +1 -1
  45. package/lib/{index-BCSt_UXY.js → index-BFIX3imu.js} +1 -1
  46. package/lib/{index-CACyup9A.js → index-BHUxBugG.js} +1 -1
  47. package/lib/{index-DVVJw5ml.js → index-BHWhOqWI.js} +1 -1
  48. package/lib/{index-ztQgUCWf.js → index-BJPmRnHn.js} +1 -1
  49. package/lib/{index-BCnyHegg.mjs → index-Bg59b-Bk.mjs} +4 -4
  50. package/lib/{index-CbCfazgA.mjs → index-By8Yxkcx.mjs} +5 -5
  51. package/lib/{index-Tl7zYqHL.js → index-C1oy9Lkm.js} +6 -6
  52. package/lib/{index-DJzhcNDU.mjs → index-CHqEmT8z.mjs} +6 -6
  53. package/lib/{index-Bk7wdRtH.mjs → index-CMKVJZ8E.mjs} +3 -3
  54. package/lib/{index-DRTx-Ru8.mjs → index-CNbmckF9.mjs} +4 -4
  55. package/lib/{index-D1dHZqit.mjs → index-CU3qSQjR.mjs} +4 -4
  56. package/lib/{index-CjyrCdi_.mjs → index-CVjCpWVm.mjs} +1 -1
  57. package/lib/{index-BBtf8VGl.js → index-CYRY8C8f.js} +1 -1
  58. package/lib/{index-DfJLd65b.mjs → index-Cx7DnGQ7.mjs} +4 -4
  59. package/lib/{index-CdSy2Lfd.mjs → index-D4oa5qLu.mjs} +85 -62
  60. package/lib/{index-zKUpU-3R.mjs → index-D7DR5q91.mjs} +4 -4
  61. package/lib/{index-BH5gBrJu.mjs → index-D83yFXT3.mjs} +3 -3
  62. package/lib/{index-B6m0ovID.mjs → index-D8SeaoGs.mjs} +2 -2
  63. package/lib/{index-DGRaAUXo.mjs → index-D8l7OdtE.mjs} +2 -2
  64. package/lib/{index-Dbwiqljw.js → index-DETB2K9l.js} +1 -1
  65. package/lib/{index-abvwfKBf.js → index-DGfMxIjQ.js} +1 -1
  66. package/lib/{index-l_e-RUun.js → index-DLpTO2U3.js} +1 -1
  67. package/lib/{index-CokIAiMa.mjs → index-DX18kVfL.mjs} +4 -4
  68. package/lib/{index-dJMYtBle.mjs → index-DX6w1JtB.mjs} +4 -4
  69. package/lib/{index-B9L2kltl.mjs → index-DbMbSuyg.mjs} +4 -4
  70. package/lib/{index-DCPwTd_i.js → index-DfYaeaDv.js} +1 -1
  71. package/lib/{index-0t31FGKV.js → index-DjmghqSr.js} +1 -1
  72. package/lib/{index-UOSBfEgg.js → index-DlRC-hs-.js} +1 -1
  73. package/lib/{index-Cp5np38p.mjs → index-G7Dlm7ed.mjs} +1 -1
  74. package/lib/{index-Bp0NhDcb.js → index-Hyeca4Ym.js} +1 -1
  75. package/lib/{index-DVH-ZIP6.mjs → index-ROBBwabT.mjs} +4 -4
  76. package/lib/{index-CO9tmWap.js → index-WhcobQtR.js} +1 -1
  77. package/lib/{index-DrncQYMG.js → index-X-BikqCf.js} +1 -1
  78. package/lib/{index-BqGvvv6N.js → index-ZCZHbA1F.js} +1 -1
  79. package/lib/{index-Cofatf_w.js → index-isN8Fo1n.js} +1 -1
  80. package/lib/{index-B9gw1I6s.js → index-j8isX5f9.js} +1 -1
  81. package/lib/{index-CGLAoOXl.mjs → index-jlt17KkN.mjs} +4 -4
  82. package/lib/{index-BS1tjK_Z.mjs → index-mtuCwj6Z.mjs} +5 -5
  83. package/lib/{index-Bfw-brA6.js → index-oVIYJXdI.js} +1 -1
  84. package/lib/{index-CYap2RXm.js → index-tvG-rfJZ.js} +1 -1
  85. package/lib/{index-DvUq-nIQ.mjs → index-ybRLAtD8.mjs} +5 -5
  86. package/lib/{index.es-494n2GDU.js → index.es-B33YjOZu.js} +2 -2
  87. package/lib/{index.es-DnXnnX-i.mjs → index.es-BON8c55F.mjs} +4 -4
  88. package/lib/index.js +1 -1
  89. package/lib/index.mjs +1 -1
  90. package/lib/{libsodium-wrappers-9p7NdjLu.mjs → libsodium-wrappers-DTuXKVrZ.mjs} +1 -1
  91. package/lib/{libsodium-wrappers-Dechaffz.js → libsodium-wrappers-VihnPAqR.js} +1 -1
  92. package/lib/{sei-SWKTnPTF.mjs → sei-C6N03jzv.mjs} +2 -2
  93. package/lib/{sei-DORxBQd-.js → sei-DTeCXpXl.js} +1 -1
  94. package/lib/{solana-Bd9eRY8E.js → solana--YauUjmQ.js} +2 -2
  95. package/lib/{solana-T2pgCVfU.mjs → solana-BMm013WW.mjs} +6 -6
  96. package/lib/{solana-DvbMa7B_.mjs → solana-DdaraOHp.mjs} +3 -3
  97. package/lib/{solana-KhBV5LOd.js → solana-T3yS-Q_9.js} +1 -1
  98. package/lib/{solanaEmbed.esm-CnKFJhsj.js → solanaEmbed.esm-DMwXbxXO.js} +1 -1
  99. package/lib/{solanaEmbed.esm-8eZSo5K2.mjs → solanaEmbed.esm-D_lKLzGu.mjs} +2 -2
  100. package/lib/src/components/ManualAddressInput.d.ts.map +1 -1
  101. package/lib/src/routes/cosmosGateway/cosmosGateway.d.ts +2 -0
  102. package/lib/src/routes/cosmosGateway/cosmosGateway.d.ts.map +1 -1
  103. package/lib/src/routes/porticoBridge/porticoBridge.d.ts +2 -0
  104. package/lib/src/routes/porticoBridge/porticoBridge.d.ts.map +1 -1
  105. package/lib/src/routes/sdkv2/route.d.ts +1 -1
  106. package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
  107. package/lib/src/routes/tbtc/tbtc.d.ts +2 -0
  108. package/lib/src/routes/tbtc/tbtc.d.ts.map +1 -1
  109. package/lib/{sui-DDu4a1uc.mjs → sui-Btvc4SGv.mjs} +4 -4
  110. package/lib/{sui-CjRGl9Gg.mjs → sui-CXyWZ2Gp.mjs} +1 -1
  111. package/lib/{sui-B382sZz0.js → sui-DWLiZoeB.js} +1 -1
  112. package/lib/{sui-DwH1wYGH.js → sui-DbQOBpeH.js} +2 -2
  113. package/lib/{unsignedTransaction-BbAfXtog.mjs → unsignedTransaction-CtPR6znR.mjs} +2 -2
  114. package/lib/{unsignedTransaction-mu6HJcHt.js → unsignedTransaction-DZq5iThY.js} +1 -1
  115. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";var Ty=Object.defineProperty;var Cy=(e,n,t)=>n in e?Ty(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var le=(e,n,t)=>(Cy(e,typeof n!="symbol"?n+"":n,t),t);const G=require("./index-Tl7zYqHL.js"),j=require("./ens-validation.es6-BaZUabxu.js"),rp=require("./chain-BT07YJHt.js");class _n extends j.ConcreteException{constructor(t,r){super(t,r);le(this,"errorClass","HttpRequestException");le(this,"method",j.HttpRequestMethod.Get);this.type=j.ErrorType.HttpRequest,this.method=r&&r.method||j.HttpRequestMethod.Get}}var Wt;(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"})(Wt||(Wt={}));const{Axios:Ny,AxiosError:wy,CanceledError:Ey,isCancel:_y,CancelToken:Uy,VERSION:Jy,all:Dy,Cancel:My,isAxiosError:qy,spread:Hy,toFormData:Vy,AxiosHeaders:Qy,HttpStatusCode:Wy,formToJSON:Gy,getAdapter:Fy,mergeConfig:Ly}=G.axios,$y=Object.freeze(Object.defineProperty({__proto__:null,Axios:Ny,AxiosError:wy,AxiosHeaders:Qy,Cancel:My,CancelToken:Uy,CanceledError:Ey,HttpStatusCode:Wy,VERSION:Jy,all:Dy,default:G.axios,formToJSON:Gy,getAdapter:Fy,isAxiosError:qy,isCancel:_y,mergeConfig:Ly,spread:Hy,toFormData:Vy},Symbol.toStringTag,{value:"Module"})),Er="Cosmwasm";function ol(e){try{const n=G.bech32$1.decodeToBytes(e);return{data:n.bytes,prefix:n.prefix}}catch{}try{return{data:G.hex.decode(e)}}catch{}try{return{data:G.b64.decode(e)}}catch{}throw new Error(`Cannot decode: ${e}`)}const He=class He{constructor(n){le(this,"platform",Er);le(this,"address");le(this,"domain");le(this,"denom");le(this,"denomType");if(He.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}=ol(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}=ol(t[1]);this.address=r,this.denomType=t[0]}}else{if(!He.isValidAddress(n))throw new Error(`Invalid Cosmwasm address: ${n}`);const{bytes:t,prefix:r}=G.bech32$1.decodeToBytes(n);this.address=t,this.domain=r}}else if(n instanceof Uint8Array)this.address=n;else if(G.UniversalAddress.instanceof(n))this.address=n.toUint8Array();else throw new Error(`Invalid Cosmwasm address ${n}`);if(!He.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()}/${G.hex.encode(this.address).toUpperCase()}`:`${this.denomType}/${He.encode(this.domain,this.address)}/${this.denom}`:He.encode(this.domain,this.address)}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){const n=new Uint8Array(G.UniversalAddress.byteSize);return n.set(this.address,G.UniversalAddress.byteSize-this.address.length),new G.UniversalAddress(n)}static isValidAddress(n){try{const t=G.bech32$1.decodeToBytes(n);return He.validAddressLength(t.bytes)}catch{}return!1}static encode(n,t){return G.bech32$1.encode(n,G.bech32$1.toWords(t))}static validAddressLength(n){if(n.length!==He.contractAddressByteSize&&n.length!==He.accountAddressByteSize)throw new Error(`Invalid Cosmwasm address, expected ${He.contractAddressByteSize} or ${He.accountAddressByteSize} bytes but got ${n.length}`);return!0}static instanceof(n){return n.platform===Er}equals(n){return He.instanceof(n)?this.toString()===n.toString():n.equals(this.toUniversalAddress())}};le(He,"contractAddressByteSize",32),le(He,"accountAddressByteSize",20);let Ve=He;G.registerNative(Er,Ve);const Ky=1e6,zy="/cosmwasm.wasm.v1.MsgExecuteContract",Yy="/ibc.applications.transfer.v1.MsgTransfer",Hu="transfer",Zy="send_packet",Xy="recv_packet",xy="packet_dst_channel",jy="packet_src_channel",eh="packet_src_port",nh="packet_dst_port",th="packet_sequence",rh="packet_data",ih=60*60*1e3,ip=[["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"]],op=G.constMap(ip);G.constMap(ip,[1,[0]]);const ap=[["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"]]]],oh=G.constMap(ap);G.constMap(ap,[[0,2],[1]]);const ah=[["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"}]]]],uu=G.constMap(ah),sh=["Evmos","Injective"],dh=[["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"]]]],uh=G.constMap(dh),ch=[["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"]]]],lh=G.constMap(ch);var ct={},$i={},be={},pa={},fh=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pa,"__esModule",{value:!0});pa.Decimal=void 0;const Nn=fh(G.bnExports),al=100;class ve{static fromUserInput(n,t){ve.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 ve(v,t)}static fromAtomics(n,t){return ve.verifyFractionalDigits(t),new ve(n,t)}static zero(n){return ve.verifyFractionalDigits(n),new ve("0",n)}static one(n){return ve.verifyFractionalDigits(n),new ve("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>al)throw new Error(`Fractional digits must not exceed ${al}`)}static compare(n,t){if(n.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return n.data.atomics.cmp(new Nn.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 Nn.default(n),fractionalDigits:t}}clone(){return new ve(this.atomics,this.fractionalDigits)}floor(){const n=new Nn.default(10).pow(new Nn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():ve.fromAtomics(t.mul(n).toString(),this.fractionalDigits)}ceil(){const n=new Nn.default(10).pow(new Nn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():ve.fromAtomics(t.addn(1).mul(n).toString(),this.fractionalDigits)}toString(){const n=new Nn.default(10).pow(new Nn.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 Nn.default(n.atomics));return new ve(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 Nn.default(n.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new ve(t.toString(),this.fractionalDigits)}multiply(n){const t=this.data.atomics.mul(new Nn.default(n.toString()));return new ve(t.toString(),this.fractionalDigits)}equals(n){return ve.compare(this,n)===0}isLessThan(n){return ve.compare(this,n)<0}isLessThanOrEqual(n){return ve.compare(this,n)<=0}isGreaterThan(n){return ve.compare(this,n)>0}isGreaterThanOrEqual(n){return ve.compare(this,n)>=0}}pa.Decimal=ve;var Gn={},ph=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Uint64=Gn.Uint53=Gn.Int53=Gn.Uint32=void 0;const Ho=ph(G.bnExports),mh=new Ho.default("18446744073709551615",10,"be");class _i{static fromBigEndianBytes(n){return _i.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 _i(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 _i(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()}}Gn.Uint32=_i;class Vi{static fromString(n){if(!n.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new Vi(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()}}Gn.Int53=Vi;class Vu{static fromString(n){const t=Vi.fromString(n);return new Vu(t.toNumber())}constructor(n){const t=new Vi(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()}}Gn.Uint53=Vu;class yr{static fromBytesBigEndian(n){return yr.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 yr(new Ho.default(r))}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new yr(new Ho.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 Ho.default(n)}catch{throw new Error("Input is not a safe integer")}return new yr(t)}constructor(n){if(n.isNeg())throw new Error("Input is negative");if(n.gt(mh))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()}}Gn.Uint64=yr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var n=pa;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var t=Gn;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}})})(be);var Xn={},ma={};Object.defineProperty(ma,"__esModule",{value:!0});ma.decodeTxRaw=void 0;const js=j.tx;function yh(e){const n=js.TxRaw.decode(e);return{authInfo:js.AuthInfo.decode(n.authInfoBytes),body:js.TxBody.decode(n.bodyBytes),signatures:n.signatures}}ma.decodeTxRaw=yh;var _r={},Hn={},dn={},qe={},Fn={},ae={},Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.fromAscii=Ur.toAscii=void 0;function hh(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))}Ur.toAscii=hh;function gh(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("")}Ur.fromAscii=gh;var Jr={},Sh=G.commonjsGlobal&&G.commonjsGlobal.__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]}),kh=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Ph=G.commonjsGlobal&&G.commonjsGlobal.__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)&&Sh(n,e,t);return kh(n,e),n};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.fromBase64=Jr.toBase64=void 0;const sp=Ph(G.base64Js);function Rh(e){return sp.fromByteArray(e)}Jr.toBase64=Rh;function vh(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return sp.toByteArray(e)}Jr.fromBase64=vh;var lt={},Ko="qpzry9x8gf2tvdw0s3jn54khce6mua7l",cu={};for(var yo=0;yo<Ko.length;yo++){var ed=Ko.charAt(yo);if(cu[ed]!==void 0)throw new TypeError(ed+" is ambiguous");cu[ed]=yo}function Pr(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 dp(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=Pr(n)^r>>5}for(n=Pr(n),t=0;t<e.length;++t){var o=e.charCodeAt(t);n=Pr(n)^o&31}return n}function Bh(e,n,t){if(t=t||90,e.length+7+n.length>t)throw new TypeError("Exceeds length limit");e=e.toLowerCase();var r=dp(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=Pr(r)^v,o+=Ko.charAt(v)}for(h=0;h<6;++h)r=Pr(r);for(r^=1,h=0;h<6;++h){var C=r>>(5-h)*5&31;o+=Ko.charAt(C)}return o}function up(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=dp(h);if(typeof C=="string")return C;for(var w=[],D=0;D<v.length;++D){var J=v.charAt(D),I=cu[J];if(I===void 0)return"Unknown character "+J;C=Pr(C)^I,!(D+6>=v.length)&&w.push(I)}return C!==1?"Invalid checksum for "+e:{prefix:h,words:w}}function bh(){var e=up.apply(null,arguments);if(typeof e=="object")return e}function Oh(e){var n=up.apply(null,arguments);if(typeof n=="object")return n;throw new Error(n)}function ya(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 Ah(e){var n=ya(e,8,5,!0);if(Array.isArray(n))return n}function Ih(e){var n=ya(e,8,5,!0);if(Array.isArray(n))return n;throw new Error(n)}function Th(e){var n=ya(e,5,8,!1);if(Array.isArray(n))return n}function Ch(e){var n=ya(e,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}var Nh={decodeUnsafe:bh,decode:Oh,encode:Bh,toWordsUnsafe:Ah,toWords:Ih,fromWordsUnsafe:Th,fromWords:Ch},wh=G.commonjsGlobal&&G.commonjsGlobal.__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]}),Eh=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),_h=G.commonjsGlobal&&G.commonjsGlobal.__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)&&wh(n,e,t);return Eh(n,e),n};Object.defineProperty(lt,"__esModule",{value:!0});lt.normalizeBech32=lt.fromBech32=lt.toBech32=void 0;const zo=_h(Nh);function cp(e,n,t){return zo.encode(e,zo.toWords(n),t)}lt.toBech32=cp;function lp(e,n=1/0){const t=zo.decode(e,n);return{prefix:t.prefix,data:new Uint8Array(zo.fromWords(t.words))}}lt.fromBech32=lp;function Uh(e){const{prefix:n,data:t}=lp(e);return cp(n,t)}lt.normalizeBech32=Uh;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.fromHex=Dr.toHex=void 0;function Jh(e){let n="";for(const t of e)n+=("0"+t.toString(16)).slice(-2);return n}Dr.toHex=Jh;function Dh(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}Dr.fromHex=Dh;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.toRfc3339=Mr.fromRfc3339=void 0;const Mh=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function nr(e,n=2){return e.toString().padStart(n,"0")}function qh(e){const n=Mh.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)}Mr.fromRfc3339=qh;function Hh(e){const n=e.getUTCFullYear(),t=nr(e.getUTCMonth()+1),r=nr(e.getUTCDate()),o=nr(e.getUTCHours()),h=nr(e.getUTCMinutes()),v=nr(e.getUTCSeconds()),C=nr(e.getUTCMilliseconds(),3);return`${n}-${t}-${r}T${o}:${h}:${v}.${C}Z`}Mr.toRfc3339=Hh;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.fromUtf8=qr.toUtf8=void 0;function Vh(e){return new TextEncoder().encode(e)}qr.toUtf8=Vh;function Qh(e,n=!1){const t=!n;return new TextDecoder("utf-8",{fatal:t}).decode(e)}qr.fromUtf8=Qh;(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=Ur;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var t=Jr;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return t.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return t.toBase64}});var r=lt;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=Dr;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var h=Mr;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return h.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return h.toRfc3339}});var v=qr;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return v.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return v.toUtf8}})})(ae);var ze={},Re={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.arrayContentStartsWith=Hr.arrayContentEquals=void 0;function Wh(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}Hr.arrayContentEquals=Wh;function Gh(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}Hr.arrayContentStartsWith=Gh;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.assertDefinedAndNotNull=ft.assertDefined=ft.assert=void 0;function Fh(e,n){if(!e)throw new Error(n||"condition is not truthy")}ft.assert=Fh;function Lh(e,n){if(e===void 0)throw new Error(n??"value is undefined")}ft.assertDefined=Lh;function $h(e,n){if(e==null)throw new Error(n??"value is undefined or null")}ft.assertDefinedAndNotNull=$h;var ha={};Object.defineProperty(ha,"__esModule",{value:!0});ha.sleep=void 0;async function Kh(e){return new Promise(n=>setTimeout(n,e))}ha.sleep=Kh;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.isDefined=pt.isUint8Array=pt.isNonNullObject=void 0;function fp(e){return typeof e=="object"&&e!==null}pt.isNonNullObject=fp;function zh(e){return!(!fp(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof G.dist.Buffer<"u"&&typeof G.dist.Buffer.isBuffer<"u"&&G.dist.Buffer.isBuffer(e))}pt.isUint8Array=zh;function Yh(e){return e!==void 0}pt.isDefined=Yh;(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=Hr;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return n.arrayContentStartsWith}});var t=ft;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=ha;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return r.sleep}});var o=pt;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}})})(Re);var Zh=G.commonjsGlobal&&G.commonjsGlobal.__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]}),Xh=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),xh=G.commonjsGlobal&&G.commonjsGlobal.__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)&&Zh(n,e,t);return Xh(n,e),n};Object.defineProperty(ze,"__esModule",{value:!0});ze.pbkdf2Sha512=ze.pbkdf2Sha512Noble=ze.pbkdf2Sha512NodeCrypto=ze.pbkdf2Sha512Subtle=ze.getSubtle=ze.getNodeCrypto=void 0;const Gt=Re,jh=G.require$$1,eg=G.require$$1$1;async function pp(){try{const e=await Promise.resolve().then(()=>xh(G.requireCryptoBrowserify()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}ze.getNodeCrypto=pp;async function mp(){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}ze.getSubtle=mp;async function yp(e,n,t,r,o){return(0,Gt.assert)(e,"Argument subtle is falsy"),(0,Gt.assert)(typeof e=="object","Argument subtle is not of type object"),(0,Gt.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,Gt.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)))}ze.pbkdf2Sha512Subtle=yp;async function hp(e,n,t,r,o){return(0,Gt.assert)(e,"Argument nodeCrypto is falsy"),(0,Gt.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,Gt.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))})})}ze.pbkdf2Sha512NodeCrypto=hp;async function gp(e,n,t,r){return(0,jh.pbkdf2Async)(eg.sha512,e,n,{c:t,dkLen:r})}ze.pbkdf2Sha512Noble=gp;async function ng(e,n,t,r){const o=await mp();if(o)return yp(o,e,n,t,r);{const h=await pp();return h?hp(h,e,n,t,r):gp(e,n,t,r)}}ze.pbkdf2Sha512=ng;var An={},pi={};Object.defineProperty(pi,"__esModule",{value:!0});pi.toRealUint8Array=void 0;function tg(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}pi.toRealUint8Array=tg;Object.defineProperty(An,"__esModule",{value:!0});An.sha512=An.Sha512=An.sha256=An.Sha256=void 0;const rg=G.require$$0,ig=G.require$$1$1,Sp=pi;class kp{constructor(n){this.blockSize=512/8,this.impl=rg.sha256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Sp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}An.Sha256=kp;function og(e){return new kp(e).digest()}An.sha256=og;class Pp{constructor(n){this.blockSize=1024/8,this.impl=ig.sha512.create(),n&&this.update(n)}update(n){return this.impl.update((0,Sp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}An.Sha512=Pp;function ag(e){return new Pp(e).digest()}An.sha512=ag;Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Bip39=Fn.EnglishMnemonic=Fn.mnemonicToEntropy=Fn.entropyToMnemonic=void 0;const sl=ae,sg=ze,dg=An,Qu=["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 Rp(e){return Array.from(e).map(n=>n.toString(2).padStart(8,"0")).join("")}function vp(e){const t=e.length*8/32,r=(0,dg.sha256)(e);return Rp(r).slice(0,t)}function Bp(e){return parseInt(e,2)}const ug=[16,20,24,28,32],cg=[12,15,18,21,24];function bp(e){if(ug.indexOf(e.length)===-1)throw new Error("invalid input length");const n=Rp(e),t=vp(e);return(n+t).match(/(.{11})/g).map(v=>{const C=Bp(v);return Qu[C]}).join(" ")}Fn.entropyToMnemonic=bp;const lg="Invalid number of words",fg="Found word that is not in the wordlist",pg="Invalid entropy",mg="Invalid mnemonic checksum";function lu(e){return e.normalize("NFKD")}function Wu(e){const n=lu(e).split(" ");if(!cg.includes(n.length))throw new Error(lg);const t=n.map(D=>{const J=Qu.indexOf(D);if(J===-1)throw new Error(fg);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(Bp);if(v.length<16||v.length>32||v.length%4!==0)throw new Error(pg);const C=Uint8Array.from(v);if(vp(C)!==h)throw new Error(mg);return C}Fn.mnemonicToEntropy=Wu;class Ft{constructor(n){if(!Ft.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(Ft.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");Wu(n),this.data=n}toString(){return this.data}}Fn.EnglishMnemonic=Ft;Ft.wordlist=Qu;Ft.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class yg{static encode(n){return new Ft(bp(n))}static decode(n){return Wu(n.toString())}static async mnemonicToSeed(n,t){const r=(0,sl.toUtf8)(lu(n.toString())),o="mnemonic"+(t?lu(t):""),h=(0,sl.toUtf8)(o);return(0,sg.pbkdf2Sha512)(r,h,2048,64)}}Fn.Bip39=yg;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Hmac=void 0;class hg{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]))}}Ki.Hmac=hg;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.keccak256=Vr.Keccak256=void 0;const gg=G.require$$0$1,Sg=pi;class Op{constructor(n){this.blockSize=512/8,this.impl=gg.keccak_256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Sg.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}Vr.Keccak256=Op;function kg(e){return new Op(e).digest()}Vr.keccak256=kg;var Ye={},Pg=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Xchacha20poly1305Ietf=Ye.xchacha20NonceLength=Ye.Ed25519=Ye.Ed25519Keypair=Ye.Argon2id=Ye.isArgon2idOptions=void 0;const Rg=Re,rn=Pg(G.libsodiumWrappers);function vg(e){return!(!(0,Rg.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}Ye.isArgon2idOptions=vg;class Bg{static async execute(n,t,r){return await rn.default.ready,rn.default.crypto_pwhash(r.outputLength,n,t,r.opsLimit,r.memLimitKib*1024,rn.default.crypto_pwhash_ALG_ARGON2ID13)}}Ye.Argon2id=Bg;class ga{static fromLibsodiumPrivkey(n){if(n.length!==64)throw new Error(`Unexpected key length ${n.length}. Must be 64.`);return new ga(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])}}Ye.Ed25519Keypair=ga;class bg{static async makeKeypair(n){await rn.default.ready;const t=rn.default.crypto_sign_seed_keypair(n);return ga.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(n,t){return await rn.default.ready,rn.default.crypto_sign_detached(n,t.toLibsodiumPrivkey())}static async verifySignature(n,t,r){return await rn.default.ready,rn.default.crypto_sign_verify_detached(n,t,r)}}Ye.Ed25519=bg;Ye.xchacha20NonceLength=24;class Og{static async encrypt(n,t,r){return await rn.default.ready,rn.default.crypto_aead_xchacha20poly1305_ietf_encrypt(n,null,null,r,t)}static async decrypt(n,t,r){return await rn.default.ready,rn.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,n,null,r,t)}}Ye.Xchacha20poly1305Ietf=Og;var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.Random=void 0;class Ag{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=G.requireCryptoBrowserify();return new Uint8Array([...t.randomBytes(n)])}catch{throw new Error("No secure random number generator found")}}}}Sa.Random=Ag;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.ripemd160=Qr.Ripemd160=void 0;const Ig=G.require$$0$2,Tg=pi;class Ap{constructor(n){this.blockSize=512/8,this.impl=Ig.ripemd160.create(),n&&this.update(n)}update(n){return this.impl.update((0,Tg.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}Qr.Ripemd160=Ap;function Cg(e){return new Ap(e).digest()}Qr.ripemd160=Cg;var ka={},Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ExtendedSecp256k1Signature=Lt.Secp256k1Signature=void 0;function hr(e){let n=0;for(const t of e)if(t===0)n++;else break;return e.slice(n)}const ho=2;class Qi{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 Qi(hr(n.slice(0,32)),hr(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++]!==ho)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++]!==ho)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 Qi(hr(v),hr(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([ho,r,...n,ho,o,...t]);return new Uint8Array([48,h.length,...h])}}Lt.Secp256k1Signature=Qi;class Gu extends Qi{static fromFixedLength(n){if(n.length!==65)throw new Error(`Got invalid data length ${n.length}. Expected 32 + 32 + 1`);return new Gu(hr(n.slice(0,32)),hr(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])}}Lt.ExtendedSecp256k1Signature=Gu;var Ip=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ka,"__esModule",{value:!0});ka.Secp256k1=void 0;const go=ae,Tp=Ip(G.bnExports),Ng=Ip(G.requireElliptic()),wg=Lt,Ot=new Ng.default.ec("secp256k1"),Eg=new Tp.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class _g{static async makeKeypair(n){if(n.length!==32)throw new Error("input data is not a valid secp256k1 private key");const t=Ot.keyFromPrivate(n);if(t.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new Tp.default(n).gte(Eg))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,go.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=Ot.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 wg.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=Ot.keyFromPublic(r);try{return o.verify(t,n.toDer())}catch{return!1}}static recoverPubkey(n,t){const r={r:(0,go.toHex)(n.r()),s:(0,go.toHex)(n.s())},o=Ot.recoverPubKey(t,r,n.recovery),h=Ot.keyFromPublic(o);return(0,go.fromHex)(h.getPublic(!1,"hex"))}static compressPubkey(n){switch(n.length){case 33:return n;case 65:return Uint8Array.from(Ot.keyFromPublic(n).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(n){switch(n.length){case 33:return Uint8Array.from(Ot.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")}}}ka.Secp256k1=_g;var Cp={};(function(e){var n=G.commonjsGlobal&&G.commonjsGlobal.__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=ae,r=be,o=n(G.bnExports),h=n(G.requireElliptic()),v=Ki,C=An;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})(Cp);(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=Fn;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return n.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return n.EnglishMnemonic}});var t=Ki;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return t.Hmac}});var r=Vr;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return r.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return r.keccak256}});var o=Ye;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=Sa;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return h.Random}});var v=Qr;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return v.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return v.ripemd160}});var C=ka;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return C.Secp256k1}});var w=Lt;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return w.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return w.Secp256k1Signature}});var D=An;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=Cp;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}})})(qe);var Me={},zi={};(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})(zi);Object.defineProperty(Me,"__esModule",{value:!0});Me.encodeBech32Pubkey=Me.encodeAminoPubkey=Me.decodeBech32Pubkey=Me.decodeAminoPubkey=Me.encodeEd25519Pubkey=Me.encodeSecp256k1Pubkey=void 0;const xe=ae,Ug=be,Ni=Re,et=zi;function Jg(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:et.pubkeyType.secp256k1,value:(0,xe.toBase64)(e)}}Me.encodeSecp256k1Pubkey=Jg;function Dg(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:et.pubkeyType.ed25519,value:(0,xe.toBase64)(e)}}Me.encodeEd25519Pubkey=Dg;const fu=(0,xe.fromHex)("eb5ae98721"),pu=(0,xe.fromHex)("1624de6420"),dl=(0,xe.fromHex)("0dfb100520"),Yo=(0,xe.fromHex)("22c1f7e2");function Fu(e){if((0,Ni.arrayContentStartsWith)(e,fu)){const n=e.slice(fu.length);if(n.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:et.pubkeyType.secp256k1,value:(0,xe.toBase64)(n)}}else if((0,Ni.arrayContentStartsWith)(e,pu)){const n=e.slice(pu.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:et.pubkeyType.ed25519,value:(0,xe.toBase64)(n)}}else if((0,Ni.arrayContentStartsWith)(e,dl)){const n=e.slice(dl.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:et.pubkeyType.sr25519,value:(0,xe.toBase64)(n)}}else{if((0,Ni.arrayContentStartsWith)(e,Yo))return qg(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,xe.toHex)(e.slice(0,5)))}}Me.decodeAminoPubkey=Fu;function Mg(e){const{data:n}=(0,xe.fromBech32)(e);return Fu(n)}Me.decodeBech32Pubkey=Mg;function ul(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 qg(e){const n=Array.from(e),t=n.splice(0,Yo.length);if(!(0,Ni.arrayContentStartsWith)(t,Yo))throw new Error("Invalid multisig prefix.");if(n.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[r,o]=ul(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]=ul(n);if(n.splice(0,C),n.length<v)throw new Error("Invalid multisig data length.");const w=n.splice(0,v),D=Fu(Uint8Array.from(w));h.push(D)}return{type:et.pubkeyType.multisigThreshold,value:{threshold:r.toString(),pubkeys:h}}}function cl(e){const n=Ug.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 Lu(e){if((0,et.isMultisigThresholdPubkey)(e)){const n=Array.from(Yo);n.push(8),n.push(...cl(e.value.threshold));for(const t of e.value.pubkeys.map(r=>Lu(r)))n.push(18),n.push(...cl(t.length)),n.push(...t);return new Uint8Array(n)}else{if((0,et.isEd25519Pubkey)(e))return new Uint8Array([...pu,...(0,xe.fromBase64)(e.value)]);if((0,et.isSecp256k1Pubkey)(e))return new Uint8Array([...fu,...(0,xe.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}Me.encodeAminoPubkey=Lu;function Hg(e,n){return(0,xe.toBech32)(n,Lu(e))}Me.encodeBech32Pubkey=Hg;Object.defineProperty(dn,"__esModule",{value:!0});dn.pubkeyToAddress=dn.pubkeyToRawAddress=dn.rawSecp256k1PubkeyToRawAddress=dn.rawEd25519PubkeyToRawAddress=void 0;const Zo=qe,mu=ae,Vg=Me,nd=zi;function Np(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Zo.sha256)(e).slice(0,20)}dn.rawEd25519PubkeyToRawAddress=Np;function wp(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Zo.ripemd160)((0,Zo.sha256)(e))}dn.rawSecp256k1PubkeyToRawAddress=wp;function Ep(e){if((0,nd.isSecp256k1Pubkey)(e)){const n=(0,mu.fromBase64)(e.value);return wp(n)}else if((0,nd.isEd25519Pubkey)(e)){const n=(0,mu.fromBase64)(e.value);return Np(n)}else if((0,nd.isMultisigThresholdPubkey)(e)){const n=(0,Vg.encodeAminoPubkey)(e);return(0,Zo.sha256)(n).slice(0,20)}else throw new Error("Unsupported public key type")}dn.pubkeyToRawAddress=Ep;function Qg(e,n){return(0,mu.toBech32)(n,Ep(e))}dn.pubkeyToAddress=Qg;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.addCoins=Ln.parseCoins=Ln.coins=Ln.coin=void 0;const yu=be;function _p(e,n){let t;if(typeof e=="number")try{t=new yu.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}}Ln.coin=_p;function Wg(e,n){return[_p(e,n)]}Ln.coins=Wg;function Gg(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]}})}Ln.parseCoins=Gg;function Fg(e,n){if(e.denom!==n.denom)throw new Error("Trying to add two coins with different denoms");return{amount:yu.Decimal.fromAtomics(e.amount,0).plus(yu.Decimal.fromAtomics(n.amount,0)).atomics,denom:e.denom}}Ln.addCoins=Fg;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createMultisigThresholdPubkey=Wr.compareArrays=void 0;const ll=ae,Lg=be,fl=dn;function Up(e,n){const t=(0,ll.toHex)(e),r=(0,ll.toHex)(n);return t===r?0:t<r?-1:1}Wr.compareArrays=Up;function $g(e,n,t=!1){const r=new Lg.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,fl.pubkeyToRawAddress)(h),w=(0,fl.pubkeyToRawAddress)(v);return Up(C,w)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:r.toString(),pubkeys:o}}}Wr.createMultisigThresholdPubkey=$g;var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.omitDefault=void 0;function Kg(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}'`)}}Pa.omitDefault=Kg;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.makeCosmoshubPath=void 0;const mi=qe;function zg(e){return[mi.Slip10RawIndex.hardened(44),mi.Slip10RawIndex.hardened(118),mi.Slip10RawIndex.hardened(0),mi.Slip10RawIndex.normal(0),mi.Slip10RawIndex.normal(e)]}Yi.makeCosmoshubPath=zg;var Gr={},bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.decodeSignature=bt.encodeSecp256k1Signature=void 0;const hu=ae,Yg=Me,Zg=zi;function Xg(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,Yg.encodeSecp256k1Pubkey)(e),signature:(0,hu.toBase64)(n)}}bt.encodeSecp256k1Signature=Xg;function xg(e){switch(e.pub_key.type){case Zg.pubkeyType.secp256k1:return{pubkey:(0,hu.fromBase64)(e.pub_key.value),signature:(0,hu.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}bt.decodeSignature=xg;var In={};Object.defineProperty(In,"__esModule",{value:!0});In.serializeSignDoc=In.escapeCharacters=In.makeSignDoc=In.sortedJsonStringify=void 0;const jg=ae,pl=be;function gu(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(gu);const n=Object.keys(e).sort(),t={};return n.forEach(r=>{t[r]=gu(e[r])}),t}function Jp(e){return JSON.stringify(gu(e))}In.sortedJsonStringify=Jp;function eS(e,n,t,r,o,h,v){return{chain_id:t,account_number:pl.Uint53.fromString(o.toString()).toString(),sequence:pl.Uint53.fromString(h.toString()).toString(),fee:n,msgs:e,memo:r||"",...v&&{timeout_height:v.toString()}}}In.makeSignDoc=eS;function Dp(e){const n=/&/g,t=/</g,r=/>/g;return e.replace(n,"\\u0026").replace(t,"\\u003c").replace(r,"\\u003e")}In.escapeCharacters=Dp;function nS(e){const n=Dp(Jp(e));return(0,jg.toUtf8)(n)}In.serializeSignDoc=nS;var $u={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=qe,t=ae;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})($u);Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Secp256k1HdWallet=Gr.extractKdfConfiguration=void 0;const fn=qe,yi=ae,gr=Re,tS=dn,rS=Yi,iS=bt,oS=In,hi=$u,Vo="secp256k1wallet-v1",aS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function sS(e){return!(!(0,gr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function dS(e){return e.kdf}function uS(e){const n=JSON.parse(e);if(!(0,gr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case Vo:return dS(n);default:throw new Error("Unsupported serialization type")}}Gr.extractKdfConfiguration=uS;const ml={bip39Password:"",hdPaths:[(0,rS.makeCosmoshubPath)(0)],prefix:"cosmos"};class Jt{static async fromMnemonic(n,t={}){const r=new fn.EnglishMnemonic(n),o=await fn.Bip39.mnemonicToSeed(r,t.bip39Password);return new Jt(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=fn.Random.getBytes(r),h=fn.Bip39.encode(o);return Jt.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,gr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Vo:return Jt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,gr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Vo:{const h=await(0,hi.decrypt)((0,yi.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,yi.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,gr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>sS(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,fn.stringToPath)(I));return Jt.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,gr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,hi.executeKdf)(t,r.kdf);return Jt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.hdPaths??ml.hdPaths,o=t.prefix??ml.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,fn.sha256)((0,oS.serializeSignDoc)(t)),w=await fn.Secp256k1.createSignature(C,h),D=new Uint8Array([...w.r(32),...w.s(32)]);return{signed:t,signature:(0,iS.encodeSecp256k1Signature)(v,D)}}async serialize(n){const t=aS,r=await(0,hi.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,fn.pathToString)(w),prefix:D}))},o=(0,yi.toUtf8)(JSON.stringify(r)),h={algorithm:hi.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,hi.encrypt)(o,n,h),C={type:Vo,kdf:t,encryption:h,data:(0,yi.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=fn.Slip10.derivePath(fn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await fn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:fn.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,yi.toBech32)(t,(0,tS.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}Gr.Secp256k1HdWallet=Jt;var Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});Ra.Secp256k1Wallet=void 0;const So=qe,cS=ae,lS=dn,fS=bt,pS=In;class Ku{static async fromKey(n,t="cosmos"){const r=(await So.Secp256k1.makeKeypair(n)).pubkey;return new Ku(n,So.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,cS.toBech32)(this.prefix,(0,lS.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 So.Sha256((0,pS.serializeSignDoc)(t)).digest(),o=await So.Secp256k1.createSignature(r,this.privkey),h=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:t,signature:(0,fS.encodeSecp256k1Signature)(this.pubkey,h)}}}Ra.Secp256k1Wallet=Ku;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.makeStdTx=Fr.isStdTx=void 0;function mS(e){const{memo:n,msg:t,fee:r,signatures:o}=e;return typeof n=="string"&&Array.isArray(t)&&typeof r=="object"&&Array.isArray(o)}Fr.isStdTx=mS;function yS(e,n){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(n)?n:[n]}}Fr.makeStdTx=yS;(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=dn;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=Ln;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=Me;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=Wr;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var h=Pa;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return h.omitDefault}});var v=Yi;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return v.makeCosmoshubPath}});var C=zi;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=Gr;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return w.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return w.Secp256k1HdWallet}});var D=Ra;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return D.Secp256k1Wallet}});var J=bt;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return J.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return J.encodeSecp256k1Signature}});var I=In;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return I.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return I.serializeSignDoc}});var g=Fr;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return g.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return g.makeStdTx}});var R=$u;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return R.executeKdf}})})(Hn);var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.makeSignBytes=Zn.makeSignDoc=Zn.makeAuthInfoBytes=void 0;const yl=Re,hS=j.signing,Xo=j.tx;function gS(e,n){return e.map(({pubkey:t,sequence:r})=>({publicKey:t,modeInfo:{single:{mode:n}},sequence:BigInt(r)}))}function SS(e,n,t,r,o,h=hS.SignMode.SIGN_MODE_DIRECT){(0,yl.assert)(r===void 0||typeof r=="string","feeGranter must be undefined or string"),(0,yl.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const v=Xo.AuthInfo.fromPartial({signerInfos:gS(e,h),fee:{amount:[...n],gasLimit:BigInt(t),granter:r,payer:o}});return Xo.AuthInfo.encode(v).finish()}Zn.makeAuthInfoBytes=SS;function kS(e,n,t,r){return{bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:BigInt(r)}}Zn.makeSignDoc=kS;function PS({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r}){const o=Xo.SignDoc.fromPartial({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r});return Xo.SignDoc.encode(o).finish()}Zn.makeSignBytes=PS;var zu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=qe,t=ae;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})(zu);Object.defineProperty(_r,"__esModule",{value:!0});_r.DirectSecp256k1HdWallet=_r.extractKdfConfiguration=void 0;const Su=Hn,pn=qe,gi=ae,Sr=Re,RS=Zn,Si=zu,Qo="directsecp256k1hdwallet-v1",vS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function BS(e){return!(!(0,Sr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function bS(e){return e.kdf}function OS(e){const n=JSON.parse(e);if(!(0,Sr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case Qo:return bS(n);default:throw new Error("Unsupported serialization type")}}_r.extractKdfConfiguration=OS;const hl={bip39Password:"",hdPaths:[(0,Su.makeCosmoshubPath)(0)],prefix:"cosmos"};class Dt{static async fromMnemonic(n,t={}){const r=new pn.EnglishMnemonic(n),o=await pn.Bip39.mnemonicToSeed(r,t.bip39Password);return new Dt(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=pn.Random.getBytes(r),h=pn.Bip39.encode(o);return Dt.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,Sr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Qo:return Dt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,Sr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Qo:{const h=await(0,Si.decrypt)((0,gi.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,gi.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,Sr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>BS(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,pn.stringToPath)(I));return Dt.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,Sr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,Si.executeKdf)(t,r.kdf);return Dt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.prefix??hl.prefix,o=t.hdPaths??hl.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,RS.makeSignBytes)(t),w=(0,pn.sha256)(C),D=await pn.Secp256k1.createSignature(w,h),J=new Uint8Array([...D.r(32),...D.s(32)]),I=(0,Su.encodeSecp256k1Signature)(v,J);return{signed:t,signature:I}}async serialize(n){const t=vS,r=await(0,Si.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,pn.pathToString)(w),prefix:D}))},o=(0,gi.toUtf8)(JSON.stringify(r)),h={algorithm:Si.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,Si.encrypt)(o,n,h),C={type:Qo,kdf:t,encryption:h,data:(0,gi.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=pn.Slip10.derivePath(pn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await pn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:pn.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,gi.toBech32)(t,(0,Su.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}_r.DirectSecp256k1HdWallet=Dt;var va={};Object.defineProperty(va,"__esModule",{value:!0});va.DirectSecp256k1Wallet=void 0;const gl=Hn,ko=qe,AS=ae,IS=Zn;class Yu{static async fromKey(n,t="cosmos"){const r=(await ko.Secp256k1.makeKeypair(n)).pubkey;return new Yu(n,ko.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,AS.toBech32)(this.prefix,(0,gl.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(n,t){const r=(0,IS.makeSignBytes)(t);if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const o=(0,ko.sha256)(r),h=await ko.Secp256k1.createSignature(o,this.privkey),v=new Uint8Array([...h.r(32),...h.s(32)]),C=(0,gl.encodeSecp256k1Signature)(this.pubkey,v);return{signed:t,signature:C}}}va.DirectSecp256k1Wallet=Yu;var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.makeCosmoshubPath=void 0;const ki=qe;function TS(e){return[ki.Slip10RawIndex.hardened(44),ki.Slip10RawIndex.hardened(118),ki.Slip10RawIndex.hardened(0),ki.Slip10RawIndex.normal(0),ki.Slip10RawIndex.normal(e)]}Ba.makeCosmoshubPath=TS;var $n={},nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.PrivKey=nt.PubKey=nt.protobufPackage=void 0;const Rr=G.binary,vr=G.helpers;nt.protobufPackage="cosmos.crypto.ed25519";function td(){return{key:new Uint8Array}}nt.PubKey={typeUrl:"/cosmos.crypto.ed25519.PubKey",encode(e,n=Rr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Rr.BinaryReader?e:new Rr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=td();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=td();return(0,vr.isSet)(e.key)&&(n.key=(0,vr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,vr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=td();return n.key=e.key??new Uint8Array,n}};function rd(){return{key:new Uint8Array}}nt.PrivKey={typeUrl:"/cosmos.crypto.ed25519.PrivKey",encode(e,n=Rr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Rr.BinaryReader?e:new Rr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=rd();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=rd();return(0,vr.isSet)(e.key)&&(n.key=(0,vr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,vr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=rd();return n.key=e.key??new Uint8Array,n}};var $t={};Object.defineProperty($t,"__esModule",{value:!0});$t.LegacyAminoPubKey=$t.protobufPackage=void 0;const Pi=G.any,id=G.binary,CS=G.helpers;$t.protobufPackage="cosmos.crypto.multisig";function od(){return{threshold:0,publicKeys:[]}}$t.LegacyAminoPubKey={typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",encode(e,n=id.BinaryWriter.create()){e.threshold!==0&&n.uint32(8).uint32(e.threshold);for(const t of e.publicKeys)Pi.Any.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof id.BinaryReader?e:new id.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=od();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.threshold=t.uint32();break;case 2:o.publicKeys.push(Pi.Any.decode(t,t.uint32()));break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=od();return(0,CS.isSet)(e.threshold)&&(n.threshold=Number(e.threshold)),Array.isArray(e==null?void 0:e.publicKeys)&&(n.publicKeys=e.publicKeys.map(t=>Pi.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?Pi.Any.toJSON(t):void 0):n.publicKeys=[],n},fromPartial(e){var t;const n=od();return n.threshold=e.threshold??0,n.publicKeys=((t=e.publicKeys)==null?void 0:t.map(r=>Pi.Any.fromPartial(r)))||[],n}};var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.PrivKey=tt.PubKey=tt.protobufPackage=void 0;const Br=G.binary,br=G.helpers;tt.protobufPackage="cosmos.crypto.secp256k1";function ad(){return{key:new Uint8Array}}tt.PubKey={typeUrl:"/cosmos.crypto.secp256k1.PubKey",encode(e,n=Br.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Br.BinaryReader?e:new Br.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,br.isSet)(e.key)&&(n.key=(0,br.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,br.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=ad();return n.key=e.key??new Uint8Array,n}};function sd(){return{key:new Uint8Array}}tt.PrivKey={typeUrl:"/cosmos.crypto.secp256k1.PrivKey",encode(e,n=Br.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Br.BinaryReader?e:new Br.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=sd();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=sd();return(0,br.isSet)(e.key)&&(n.key=(0,br.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,br.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=sd();return n.key=e.key??new Uint8Array,n}};Object.defineProperty($n,"__esModule",{value:!0});$n.decodeOptionalPubkey=$n.decodePubkey=$n.anyToSinglePubkey=$n.encodePubkey=void 0;const Ui=Hn,Sl=ae,NS=be,ku=nt,Pu=$t,Ru=tt,dd=G.any;function Mp(e){if((0,Ui.isSecp256k1Pubkey)(e)){const n=Ru.PubKey.fromPartial({key:(0,Sl.fromBase64)(e.value)});return dd.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(Ru.PubKey.encode(n).finish())})}else if((0,Ui.isEd25519Pubkey)(e)){const n=ku.PubKey.fromPartial({key:(0,Sl.fromBase64)(e.value)});return dd.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(ku.PubKey.encode(n).finish())})}else if((0,Ui.isMultisigThresholdPubkey)(e)){const n=Pu.LegacyAminoPubKey.fromPartial({threshold:NS.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(Mp)});return dd.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(Pu.LegacyAminoPubKey.encode(n).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}$n.encodePubkey=Mp;function vu(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:n}=Ru.PubKey.decode(e.value);return(0,Ui.encodeSecp256k1Pubkey)(n)}case"/cosmos.crypto.ed25519.PubKey":{const{key:n}=ku.PubKey.decode(e.value);return(0,Ui.encodeEd25519Pubkey)(n)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}$n.anyToSinglePubkey=vu;function qp(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return vu(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:n,publicKeys:t}=Pu.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:n.toString(),pubkeys:t.map(vu)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}$n.decodePubkey=qp;function wS(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return qp(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}}$n.decodeOptionalPubkey=wS;var hn={},ba={},Zu={};(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=G.coin,t=G.binary,r=G.helpers;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}}})(Zu);(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=G.coin,t=Zu,r=G.binary,o=G.helpers;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})(ba);Object.defineProperty(hn,"__esModule",{value:!0});hn.Registry=hn.isTxBodyEncodeObject=hn.isPbjsGeneratedType=hn.isTsProtoGeneratedType=hn.isTelescopeGeneratedType=void 0;const ES=ba,_S=G.coin,ud=j.tx,US=G.any;function Hp(e){const n=e;return typeof n.fromPartial=="function"&&typeof n.typeUrl=="string"}hn.isTelescopeGeneratedType=Hp;function Xu(e){return typeof e.fromPartial=="function"}hn.isTsProtoGeneratedType=Xu;function JS(e){return!Xu(e)}hn.isPbjsGeneratedType=JS;const kl={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function Vp(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}hn.isTxBodyEncodeObject=Vp;class DS{constructor(n){const{cosmosCoin:t,cosmosMsgSend:r}=kl;this.types=n?new Map([...n]):new Map([[t,_S.Coin],[r,ES.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(Vp(n))return this.encodeTxBody(t);const o=this.lookupTypeWithError(r),h=Hp(o)||Xu(o)?o.fromPartial(t):o.create(t);return o.encode(h).finish()}encodeAsAny(n){const t=this.encode(n);return US.Any.fromPartial({typeUrl:n.typeUrl,value:t})}encodeTxBody(n){var o;const t=n.messages.map(h=>this.encodeAsAny(h)),r=ud.TxBody.fromPartial({...n,timeoutHeight:BigInt(((o=n.timeoutHeight)==null?void 0:o.toString())??"0"),messages:t});return ud.TxBody.encode(r).finish()}decode({typeUrl:n,value:t}){if(n===kl.cosmosTxBody)return this.decodeTxBody(t);const o=this.lookupTypeWithError(n).decode(t);return Object.entries(o).forEach(([h,v])=>{typeof G.dist.Buffer<"u"&&typeof G.dist.Buffer.isBuffer<"u"&&G.dist.Buffer.isBuffer(v)&&(o[h]=Uint8Array.from(v))}),o}decodeTxBody(n){const t=ud.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})})}}}hn.Registry=DS;var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.isOfflineDirectSigner=void 0;function MS(e){return e.signDirect!==void 0}Oa.isOfflineDirectSigner=MS;(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=ma;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return n.decodeTxRaw}});var t=_r;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return t.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return t.extractKdfConfiguration}});var r=va;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return r.DirectSecp256k1Wallet}});var o=Ba;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var h=$n;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=hn;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=Oa;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return C.isOfflineDirectSigner}});var w=Zn;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=zu;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return D.executeKdf}});var J=Hn;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}})})(Xn);var Zi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.ModuleCredential=e.ModuleAccount=e.BaseAccount=e.protobufPackage=void 0;const n=G.any,t=G.binary,r=G.helpers;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}}})(Zi);var Aa={};(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=Zi,t=G.coin,r=G.binary,o=G.helpers;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}}})(Aa);Object.defineProperty($i,"__esModule",{value:!0});$i.accountFromAny=void 0;const qS=be,HS=Xn,Ri=Re,Pl=Zi,Po=Aa;function Rl(e){return qS.Uint64.fromString(e.toString())}function tr(e){const{address:n,pubKey:t,accountNumber:r,sequence:o}=e,h=(0,HS.decodeOptionalPubkey)(t);return{address:n,pubkey:h,accountNumber:Rl(r).toNumber(),sequence:Rl(o).toNumber()}}function VS(e){var r,o,h,v,C,w,D;const{typeUrl:n,value:t}=e;switch(n){case"/cosmos.auth.v1beta1.BaseAccount":return tr(Pl.BaseAccount.decode(t));case"/cosmos.auth.v1beta1.ModuleAccount":{const J=Pl.ModuleAccount.decode(t).baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const J=(r=Po.BaseVestingAccount.decode(t))==null?void 0:r.baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const J=(h=(o=Po.ContinuousVestingAccount.decode(t))==null?void 0:o.baseVestingAccount)==null?void 0:h.baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const J=(C=(v=Po.DelayedVestingAccount.decode(t))==null?void 0:v.baseVestingAccount)==null?void 0:C.baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const J=(D=(w=Po.PeriodicVestingAccount.decode(t))==null?void 0:w.baseVestingAccount)==null?void 0:D.baseAccount;return(0,Ri.assert)(J),tr(J)}default:throw new Error(`Unsupported type: '${n}'`)}}$i.accountFromAny=VS;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.AminoTypes=void 0;class QS{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.")}}}Xi.AminoTypes=QS;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.fromTendermintEvent=void 0;const vl=ae;function WS(e){return{type:e.type,attributes:e.attributes.map(n=>({key:typeof n.key=="string"?n.key:(0,vl.fromUtf8)(n.key,!0),value:typeof n.value=="string"?n.value:(0,vl.fromUtf8)(n.value,!0)}))}}xi.fromTendermintEvent=WS;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.calculateFee=Kt.GasPrice=void 0;const Qp=be,GS=Xn;function FS(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Ia{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;FS(h);const C=Qp.Decimal.fromUserInput(o,18);return new Ia(C,h)}toString(){return this.amount.toString()+this.denom}}Kt.GasPrice=Ia;function LS(e,n){const t=typeof n=="string"?Ia.fromString(n):n,{denom:r,amount:o}=t,h=o.multiply(new Qp.Uint53(e)).ceil().toString();return{amount:(0,GS.coins)(h,r),gas:e.toString()}}Kt.calculateFee=LS;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.findAttribute=Ze.parseRawLog=Ze.parseLogs=Ze.parseLog=Ze.parseEvent=Ze.parseAttribute=void 0;const xu=Re;function Wp(e){if(!(0,xu.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||""}}Ze.parseAttribute=Wp;function Gp(e){if(!(0,xu.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(Wp)}}Ze.parseEvent=Gp;function Fp(e){if(!(0,xu.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(Gp)}}Ze.parseLog=Fp;function Lp(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(Fp)}Ze.parseLogs=Lp;function $S(e){if(!e)return[];const n=JSON.parse(e).map(({events:t},r)=>({msg_index:r,events:t,log:""}));return Lp(n)}Ze.parseRawLog=$S;function KS(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}Ze.findAttribute=KS;var Wi={},Ta={},ju={},Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.PageResponse=Se.PageRequest=Se.protobufPackage=void 0;const Or=G.binary,En=G.helpers;Se.protobufPackage="cosmos.base.query.v1beta1";function cd(){return{key:new Uint8Array,offset:BigInt(0),limit:BigInt(0),countTotal:!1,reverse:!1}}Se.PageRequest={typeUrl:"/cosmos.base.query.v1beta1.PageRequest",encode(e,n=Or.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 Or.BinaryReader?e:new Or.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.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=cd();return(0,En.isSet)(e.key)&&(n.key=(0,En.bytesFromBase64)(e.key)),(0,En.isSet)(e.offset)&&(n.offset=BigInt(e.offset.toString())),(0,En.isSet)(e.limit)&&(n.limit=BigInt(e.limit.toString())),(0,En.isSet)(e.countTotal)&&(n.countTotal=!!e.countTotal),(0,En.isSet)(e.reverse)&&(n.reverse=!!e.reverse),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,En.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=cd();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 ld(){return{nextKey:new Uint8Array,total:BigInt(0)}}Se.PageResponse={typeUrl:"/cosmos.base.query.v1beta1.PageResponse",encode(e,n=Or.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 Or.BinaryReader?e:new Or.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.nextKey=t.bytes();break;case 2:o.total=t.uint64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=ld();return(0,En.isSet)(e.nextKey)&&(n.nextKey=(0,En.bytesFromBase64)(e.nextKey)),(0,En.isSet)(e.total)&&(n.total=BigInt(e.total.toString())),n},toJSON(e){const n={};return e.nextKey!==void 0&&(n.nextKey=(0,En.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=ld();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=Se,t=G.any,r=Zi,o=G.binary,h=G.helpers;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})(ju);var We={},Ca={},ji={},Na={};Object.defineProperty(Na,"__esModule",{value:!0});Na.concat=void 0;const zS=G.xstream;function YS(...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 zS.Stream.create(v)}Na.concat=YS;var wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.DefaultValueProducer=void 0;class ZS{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}}wa.DefaultValueProducer=ZS;var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.dropDuplicates=void 0;function XS(e){return t=>{const r=new Set;return t.filter(h=>!r.has(e(h))).debug(h=>r.add(e(h)))}}Ea.dropDuplicates=XS;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.firstEvent=mt.toListPromise=mt.fromListPromise=void 0;const xS=G.xstream;function jS(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 xS.Stream.create(n)}mt.fromListPromise=jS;async function $p(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)})})}mt.toListPromise=$p;async function ek(e){return(await $p(e,1))[0]}mt.firstEvent=ek;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.lastValue=Kn.asArray=Kn.countStream=Kn.Reducer=void 0;class _a{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}}Kn.Reducer=_a;function nk(e,n){return e+1}function tk(e){return new _a(e,nk,0)}Kn.countStream=tk;function rk(e,n){return[...e,n]}function ik(e){return new _a(e,rk,[])}Kn.asArray=ik;function ok(e,n){return n}function ak(e){return new _a(e,ok,void 0)}Kn.lastValue=ak;var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.ValueAndUpdates=void 0;const sk=G.xstream;class dk{get value(){return this.producer.value}constructor(n){this.producer=n,this.updates=sk.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)}})})}}Ua.ValueAndUpdates=dk;(function(e){var n=G.commonjsGlobal&&G.commonjsGlobal.__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=G.commonjsGlobal&&G.commonjsGlobal.__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=Na;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return r.concat}});var o=wa;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var h=Ea;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return h.dropDuplicates}});var v=mt;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(Kn,e);var C=Ua;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return C.ValueAndUpdates}})})(ji);Object.defineProperty(Ca,"__esModule",{value:!0});Ca.QueryClient=void 0;const _t=G.build$3,Mt=ae,uk=ji,Ke=Re;function Ro(e,n,t){if(e.type!==n)throw new Error(`Op expected to be ${n}, got "${e.type}`);if(!(0,Ke.arrayContentEquals)(t,e.key))throw new Error(`Proven key different than queried key.
1
+ "use strict";var Ty=Object.defineProperty;var Cy=(e,n,t)=>n in e?Ty(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var le=(e,n,t)=>(Cy(e,typeof n!="symbol"?n+"":n,t),t);const G=require("./index-C1oy9Lkm.js"),j=require("./ens-validation.es6-Bw--s4Qc.js"),rp=require("./chain-BteoJHpg.js");class _n extends j.ConcreteException{constructor(t,r){super(t,r);le(this,"errorClass","HttpRequestException");le(this,"method",j.HttpRequestMethod.Get);this.type=j.ErrorType.HttpRequest,this.method=r&&r.method||j.HttpRequestMethod.Get}}var Wt;(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"})(Wt||(Wt={}));const{Axios:Ny,AxiosError:wy,CanceledError:Ey,isCancel:_y,CancelToken:Uy,VERSION:Jy,all:Dy,Cancel:My,isAxiosError:qy,spread:Hy,toFormData:Vy,AxiosHeaders:Qy,HttpStatusCode:Wy,formToJSON:Gy,getAdapter:Fy,mergeConfig:Ly}=G.axios,$y=Object.freeze(Object.defineProperty({__proto__:null,Axios:Ny,AxiosError:wy,AxiosHeaders:Qy,Cancel:My,CancelToken:Uy,CanceledError:Ey,HttpStatusCode:Wy,VERSION:Jy,all:Dy,default:G.axios,formToJSON:Gy,getAdapter:Fy,isAxiosError:qy,isCancel:_y,mergeConfig:Ly,spread:Hy,toFormData:Vy},Symbol.toStringTag,{value:"Module"})),Er="Cosmwasm";function ol(e){try{const n=G.bech32$1.decodeToBytes(e);return{data:n.bytes,prefix:n.prefix}}catch{}try{return{data:G.hex.decode(e)}}catch{}try{return{data:G.b64.decode(e)}}catch{}throw new Error(`Cannot decode: ${e}`)}const He=class He{constructor(n){le(this,"platform",Er);le(this,"address");le(this,"domain");le(this,"denom");le(this,"denomType");if(He.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}=ol(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}=ol(t[1]);this.address=r,this.denomType=t[0]}}else{if(!He.isValidAddress(n))throw new Error(`Invalid Cosmwasm address: ${n}`);const{bytes:t,prefix:r}=G.bech32$1.decodeToBytes(n);this.address=t,this.domain=r}}else if(n instanceof Uint8Array)this.address=n;else if(G.UniversalAddress.instanceof(n))this.address=n.toUint8Array();else throw new Error(`Invalid Cosmwasm address ${n}`);if(!He.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()}/${G.hex.encode(this.address).toUpperCase()}`:`${this.denomType}/${He.encode(this.domain,this.address)}/${this.denom}`:He.encode(this.domain,this.address)}toNative(){return this}toUint8Array(){return this.address}toUniversalAddress(){const n=new Uint8Array(G.UniversalAddress.byteSize);return n.set(this.address,G.UniversalAddress.byteSize-this.address.length),new G.UniversalAddress(n)}static isValidAddress(n){try{const t=G.bech32$1.decodeToBytes(n);return He.validAddressLength(t.bytes)}catch{}return!1}static encode(n,t){return G.bech32$1.encode(n,G.bech32$1.toWords(t))}static validAddressLength(n){if(n.length!==He.contractAddressByteSize&&n.length!==He.accountAddressByteSize)throw new Error(`Invalid Cosmwasm address, expected ${He.contractAddressByteSize} or ${He.accountAddressByteSize} bytes but got ${n.length}`);return!0}static instanceof(n){return n.platform===Er}equals(n){return He.instanceof(n)?this.toString()===n.toString():n.equals(this.toUniversalAddress())}};le(He,"contractAddressByteSize",32),le(He,"accountAddressByteSize",20);let Ve=He;G.registerNative(Er,Ve);const Ky=1e6,zy="/cosmwasm.wasm.v1.MsgExecuteContract",Yy="/ibc.applications.transfer.v1.MsgTransfer",Hu="transfer",Zy="send_packet",Xy="recv_packet",xy="packet_dst_channel",jy="packet_src_channel",eh="packet_src_port",nh="packet_dst_port",th="packet_sequence",rh="packet_data",ih=60*60*1e3,ip=[["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"]],op=G.constMap(ip);G.constMap(ip,[1,[0]]);const ap=[["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"]]]],oh=G.constMap(ap);G.constMap(ap,[[0,2],[1]]);const ah=[["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"}]]]],uu=G.constMap(ah),sh=["Evmos","Injective"],dh=[["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"]]]],uh=G.constMap(dh),ch=[["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"]]]],lh=G.constMap(ch);var ct={},$i={},be={},pa={},fh=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pa,"__esModule",{value:!0});pa.Decimal=void 0;const Nn=fh(G.bnExports),al=100;class ve{static fromUserInput(n,t){ve.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 ve(v,t)}static fromAtomics(n,t){return ve.verifyFractionalDigits(t),new ve(n,t)}static zero(n){return ve.verifyFractionalDigits(n),new ve("0",n)}static one(n){return ve.verifyFractionalDigits(n),new ve("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>al)throw new Error(`Fractional digits must not exceed ${al}`)}static compare(n,t){if(n.fractionalDigits!==t.fractionalDigits)throw new Error("Fractional digits do not match");return n.data.atomics.cmp(new Nn.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 Nn.default(n),fractionalDigits:t}}clone(){return new ve(this.atomics,this.fractionalDigits)}floor(){const n=new Nn.default(10).pow(new Nn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():ve.fromAtomics(t.mul(n).toString(),this.fractionalDigits)}ceil(){const n=new Nn.default(10).pow(new Nn.default(this.data.fractionalDigits)),t=this.data.atomics.div(n);return this.data.atomics.mod(n).isZero()?this.clone():ve.fromAtomics(t.addn(1).mul(n).toString(),this.fractionalDigits)}toString(){const n=new Nn.default(10).pow(new Nn.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 Nn.default(n.atomics));return new ve(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 Nn.default(n.atomics));if(t.ltn(0))throw new Error("Difference must not be negative");return new ve(t.toString(),this.fractionalDigits)}multiply(n){const t=this.data.atomics.mul(new Nn.default(n.toString()));return new ve(t.toString(),this.fractionalDigits)}equals(n){return ve.compare(this,n)===0}isLessThan(n){return ve.compare(this,n)<0}isLessThanOrEqual(n){return ve.compare(this,n)<=0}isGreaterThan(n){return ve.compare(this,n)>0}isGreaterThanOrEqual(n){return ve.compare(this,n)>=0}}pa.Decimal=ve;var Gn={},ph=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gn,"__esModule",{value:!0});Gn.Uint64=Gn.Uint53=Gn.Int53=Gn.Uint32=void 0;const Ho=ph(G.bnExports),mh=new Ho.default("18446744073709551615",10,"be");class _i{static fromBigEndianBytes(n){return _i.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 _i(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 _i(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()}}Gn.Uint32=_i;class Vi{static fromString(n){if(!n.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return new Vi(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()}}Gn.Int53=Vi;class Vu{static fromString(n){const t=Vi.fromString(n);return new Vu(t.toNumber())}constructor(n){const t=new Vi(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()}}Gn.Uint53=Vu;class yr{static fromBytesBigEndian(n){return yr.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 yr(new Ho.default(r))}static fromString(n){if(!n.match(/^[0-9]+$/))throw new Error("Invalid string format");return new yr(new Ho.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 Ho.default(n)}catch{throw new Error("Input is not a safe integer")}return new yr(t)}constructor(n){if(n.isNeg())throw new Error("Input is negative");if(n.gt(mh))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()}}Gn.Uint64=yr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Uint64=e.Uint53=e.Uint32=e.Int53=e.Decimal=void 0;var n=pa;Object.defineProperty(e,"Decimal",{enumerable:!0,get:function(){return n.Decimal}});var t=Gn;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}})})(be);var Xn={},ma={};Object.defineProperty(ma,"__esModule",{value:!0});ma.decodeTxRaw=void 0;const js=j.tx;function yh(e){const n=js.TxRaw.decode(e);return{authInfo:js.AuthInfo.decode(n.authInfoBytes),body:js.TxBody.decode(n.bodyBytes),signatures:n.signatures}}ma.decodeTxRaw=yh;var _r={},Hn={},dn={},qe={},Fn={},ae={},Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.fromAscii=Ur.toAscii=void 0;function hh(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))}Ur.toAscii=hh;function gh(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("")}Ur.fromAscii=gh;var Jr={},Sh=G.commonjsGlobal&&G.commonjsGlobal.__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]}),kh=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Ph=G.commonjsGlobal&&G.commonjsGlobal.__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)&&Sh(n,e,t);return kh(n,e),n};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.fromBase64=Jr.toBase64=void 0;const sp=Ph(G.base64Js);function Rh(e){return sp.fromByteArray(e)}Jr.toBase64=Rh;function vh(e){if(!e.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new Error("Invalid base64 string format");return sp.toByteArray(e)}Jr.fromBase64=vh;var lt={},Ko="qpzry9x8gf2tvdw0s3jn54khce6mua7l",cu={};for(var yo=0;yo<Ko.length;yo++){var ed=Ko.charAt(yo);if(cu[ed]!==void 0)throw new TypeError(ed+" is ambiguous");cu[ed]=yo}function Pr(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 dp(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=Pr(n)^r>>5}for(n=Pr(n),t=0;t<e.length;++t){var o=e.charCodeAt(t);n=Pr(n)^o&31}return n}function Bh(e,n,t){if(t=t||90,e.length+7+n.length>t)throw new TypeError("Exceeds length limit");e=e.toLowerCase();var r=dp(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=Pr(r)^v,o+=Ko.charAt(v)}for(h=0;h<6;++h)r=Pr(r);for(r^=1,h=0;h<6;++h){var C=r>>(5-h)*5&31;o+=Ko.charAt(C)}return o}function up(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=dp(h);if(typeof C=="string")return C;for(var w=[],D=0;D<v.length;++D){var J=v.charAt(D),I=cu[J];if(I===void 0)return"Unknown character "+J;C=Pr(C)^I,!(D+6>=v.length)&&w.push(I)}return C!==1?"Invalid checksum for "+e:{prefix:h,words:w}}function bh(){var e=up.apply(null,arguments);if(typeof e=="object")return e}function Oh(e){var n=up.apply(null,arguments);if(typeof n=="object")return n;throw new Error(n)}function ya(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 Ah(e){var n=ya(e,8,5,!0);if(Array.isArray(n))return n}function Ih(e){var n=ya(e,8,5,!0);if(Array.isArray(n))return n;throw new Error(n)}function Th(e){var n=ya(e,5,8,!1);if(Array.isArray(n))return n}function Ch(e){var n=ya(e,5,8,!1);if(Array.isArray(n))return n;throw new Error(n)}var Nh={decodeUnsafe:bh,decode:Oh,encode:Bh,toWordsUnsafe:Ah,toWords:Ih,fromWordsUnsafe:Th,fromWords:Ch},wh=G.commonjsGlobal&&G.commonjsGlobal.__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]}),Eh=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),_h=G.commonjsGlobal&&G.commonjsGlobal.__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)&&wh(n,e,t);return Eh(n,e),n};Object.defineProperty(lt,"__esModule",{value:!0});lt.normalizeBech32=lt.fromBech32=lt.toBech32=void 0;const zo=_h(Nh);function cp(e,n,t){return zo.encode(e,zo.toWords(n),t)}lt.toBech32=cp;function lp(e,n=1/0){const t=zo.decode(e,n);return{prefix:t.prefix,data:new Uint8Array(zo.fromWords(t.words))}}lt.fromBech32=lp;function Uh(e){const{prefix:n,data:t}=lp(e);return cp(n,t)}lt.normalizeBech32=Uh;var Dr={};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.fromHex=Dr.toHex=void 0;function Jh(e){let n="";for(const t of e)n+=("0"+t.toString(16)).slice(-2);return n}Dr.toHex=Jh;function Dh(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}Dr.fromHex=Dh;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.toRfc3339=Mr.fromRfc3339=void 0;const Mh=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(\.\d{1,9})?((?:[+-]\d{2}:\d{2})|Z)$/;function nr(e,n=2){return e.toString().padStart(n,"0")}function qh(e){const n=Mh.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)}Mr.fromRfc3339=qh;function Hh(e){const n=e.getUTCFullYear(),t=nr(e.getUTCMonth()+1),r=nr(e.getUTCDate()),o=nr(e.getUTCHours()),h=nr(e.getUTCMinutes()),v=nr(e.getUTCSeconds()),C=nr(e.getUTCMilliseconds(),3);return`${n}-${t}-${r}T${o}:${h}:${v}.${C}Z`}Mr.toRfc3339=Hh;var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.fromUtf8=qr.toUtf8=void 0;function Vh(e){return new TextEncoder().encode(e)}qr.toUtf8=Vh;function Qh(e,n=!1){const t=!n;return new TextDecoder("utf-8",{fatal:t}).decode(e)}qr.fromUtf8=Qh;(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=Ur;Object.defineProperty(e,"fromAscii",{enumerable:!0,get:function(){return n.fromAscii}}),Object.defineProperty(e,"toAscii",{enumerable:!0,get:function(){return n.toAscii}});var t=Jr;Object.defineProperty(e,"fromBase64",{enumerable:!0,get:function(){return t.fromBase64}}),Object.defineProperty(e,"toBase64",{enumerable:!0,get:function(){return t.toBase64}});var r=lt;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=Dr;Object.defineProperty(e,"fromHex",{enumerable:!0,get:function(){return o.fromHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.toHex}});var h=Mr;Object.defineProperty(e,"fromRfc3339",{enumerable:!0,get:function(){return h.fromRfc3339}}),Object.defineProperty(e,"toRfc3339",{enumerable:!0,get:function(){return h.toRfc3339}});var v=qr;Object.defineProperty(e,"fromUtf8",{enumerable:!0,get:function(){return v.fromUtf8}}),Object.defineProperty(e,"toUtf8",{enumerable:!0,get:function(){return v.toUtf8}})})(ae);var ze={},Re={},Hr={};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.arrayContentStartsWith=Hr.arrayContentEquals=void 0;function Wh(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}Hr.arrayContentEquals=Wh;function Gh(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}Hr.arrayContentStartsWith=Gh;var ft={};Object.defineProperty(ft,"__esModule",{value:!0});ft.assertDefinedAndNotNull=ft.assertDefined=ft.assert=void 0;function Fh(e,n){if(!e)throw new Error(n||"condition is not truthy")}ft.assert=Fh;function Lh(e,n){if(e===void 0)throw new Error(n??"value is undefined")}ft.assertDefined=Lh;function $h(e,n){if(e==null)throw new Error(n??"value is undefined or null")}ft.assertDefinedAndNotNull=$h;var ha={};Object.defineProperty(ha,"__esModule",{value:!0});ha.sleep=void 0;async function Kh(e){return new Promise(n=>setTimeout(n,e))}ha.sleep=Kh;var pt={};Object.defineProperty(pt,"__esModule",{value:!0});pt.isDefined=pt.isUint8Array=pt.isNonNullObject=void 0;function fp(e){return typeof e=="object"&&e!==null}pt.isNonNullObject=fp;function zh(e){return!(!fp(e)||Object.prototype.toString.call(e)!=="[object Uint8Array]"||typeof G.dist.Buffer<"u"&&typeof G.dist.Buffer.isBuffer<"u"&&G.dist.Buffer.isBuffer(e))}pt.isUint8Array=zh;function Yh(e){return e!==void 0}pt.isDefined=Yh;(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=Hr;Object.defineProperty(e,"arrayContentEquals",{enumerable:!0,get:function(){return n.arrayContentEquals}}),Object.defineProperty(e,"arrayContentStartsWith",{enumerable:!0,get:function(){return n.arrayContentStartsWith}});var t=ft;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=ha;Object.defineProperty(e,"sleep",{enumerable:!0,get:function(){return r.sleep}});var o=pt;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}})})(Re);var Zh=G.commonjsGlobal&&G.commonjsGlobal.__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]}),Xh=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),xh=G.commonjsGlobal&&G.commonjsGlobal.__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)&&Zh(n,e,t);return Xh(n,e),n};Object.defineProperty(ze,"__esModule",{value:!0});ze.pbkdf2Sha512=ze.pbkdf2Sha512Noble=ze.pbkdf2Sha512NodeCrypto=ze.pbkdf2Sha512Subtle=ze.getSubtle=ze.getNodeCrypto=void 0;const Gt=Re,jh=G.require$$1,eg=G.require$$1$1;async function pp(){try{const e=await Promise.resolve().then(()=>xh(G.requireCryptoBrowserify()));return typeof e=="object"&&Object.keys(e).length<=1?void 0:e}catch{return}}ze.getNodeCrypto=pp;async function mp(){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}ze.getSubtle=mp;async function yp(e,n,t,r,o){return(0,Gt.assert)(e,"Argument subtle is falsy"),(0,Gt.assert)(typeof e=="object","Argument subtle is not of type object"),(0,Gt.assert)(typeof e.importKey=="function","subtle.importKey is not a function"),(0,Gt.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)))}ze.pbkdf2Sha512Subtle=yp;async function hp(e,n,t,r,o){return(0,Gt.assert)(e,"Argument nodeCrypto is falsy"),(0,Gt.assert)(typeof e=="object","Argument nodeCrypto is not of type object"),(0,Gt.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))})})}ze.pbkdf2Sha512NodeCrypto=hp;async function gp(e,n,t,r){return(0,jh.pbkdf2Async)(eg.sha512,e,n,{c:t,dkLen:r})}ze.pbkdf2Sha512Noble=gp;async function ng(e,n,t,r){const o=await mp();if(o)return yp(o,e,n,t,r);{const h=await pp();return h?hp(h,e,n,t,r):gp(e,n,t,r)}}ze.pbkdf2Sha512=ng;var An={},pi={};Object.defineProperty(pi,"__esModule",{value:!0});pi.toRealUint8Array=void 0;function tg(e){return e instanceof Uint8Array?e:Uint8Array.from(e)}pi.toRealUint8Array=tg;Object.defineProperty(An,"__esModule",{value:!0});An.sha512=An.Sha512=An.sha256=An.Sha256=void 0;const rg=G.require$$0,ig=G.require$$1$1,Sp=pi;class kp{constructor(n){this.blockSize=512/8,this.impl=rg.sha256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Sp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}An.Sha256=kp;function og(e){return new kp(e).digest()}An.sha256=og;class Pp{constructor(n){this.blockSize=1024/8,this.impl=ig.sha512.create(),n&&this.update(n)}update(n){return this.impl.update((0,Sp.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}An.Sha512=Pp;function ag(e){return new Pp(e).digest()}An.sha512=ag;Object.defineProperty(Fn,"__esModule",{value:!0});Fn.Bip39=Fn.EnglishMnemonic=Fn.mnemonicToEntropy=Fn.entropyToMnemonic=void 0;const sl=ae,sg=ze,dg=An,Qu=["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 Rp(e){return Array.from(e).map(n=>n.toString(2).padStart(8,"0")).join("")}function vp(e){const t=e.length*8/32,r=(0,dg.sha256)(e);return Rp(r).slice(0,t)}function Bp(e){return parseInt(e,2)}const ug=[16,20,24,28,32],cg=[12,15,18,21,24];function bp(e){if(ug.indexOf(e.length)===-1)throw new Error("invalid input length");const n=Rp(e),t=vp(e);return(n+t).match(/(.{11})/g).map(v=>{const C=Bp(v);return Qu[C]}).join(" ")}Fn.entropyToMnemonic=bp;const lg="Invalid number of words",fg="Found word that is not in the wordlist",pg="Invalid entropy",mg="Invalid mnemonic checksum";function lu(e){return e.normalize("NFKD")}function Wu(e){const n=lu(e).split(" ");if(!cg.includes(n.length))throw new Error(lg);const t=n.map(D=>{const J=Qu.indexOf(D);if(J===-1)throw new Error(fg);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(Bp);if(v.length<16||v.length>32||v.length%4!==0)throw new Error(pg);const C=Uint8Array.from(v);if(vp(C)!==h)throw new Error(mg);return C}Fn.mnemonicToEntropy=Wu;class Ft{constructor(n){if(!Ft.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(Ft.wordlist.indexOf(o)===-1)throw new Error("Mnemonic contains invalid word");Wu(n),this.data=n}toString(){return this.data}}Fn.EnglishMnemonic=Ft;Ft.wordlist=Qu;Ft.mnemonicMatcher=/^[a-z]+( [a-z]+)*$/;class yg{static encode(n){return new Ft(bp(n))}static decode(n){return Wu(n.toString())}static async mnemonicToSeed(n,t){const r=(0,sl.toUtf8)(lu(n.toString())),o="mnemonic"+(t?lu(t):""),h=(0,sl.toUtf8)(o);return(0,sg.pbkdf2Sha512)(r,h,2048,64)}}Fn.Bip39=yg;var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Hmac=void 0;class hg{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]))}}Ki.Hmac=hg;var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.keccak256=Vr.Keccak256=void 0;const gg=G.require$$0$1,Sg=pi;class Op{constructor(n){this.blockSize=512/8,this.impl=gg.keccak_256.create(),n&&this.update(n)}update(n){return this.impl.update((0,Sg.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}Vr.Keccak256=Op;function kg(e){return new Op(e).digest()}Vr.keccak256=kg;var Ye={},Pg=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Xchacha20poly1305Ietf=Ye.xchacha20NonceLength=Ye.Ed25519=Ye.Ed25519Keypair=Ye.Argon2id=Ye.isArgon2idOptions=void 0;const Rg=Re,rn=Pg(G.libsodiumWrappers);function vg(e){return!(!(0,Rg.isNonNullObject)(e)||typeof e.outputLength!="number"||typeof e.opsLimit!="number"||typeof e.memLimitKib!="number")}Ye.isArgon2idOptions=vg;class Bg{static async execute(n,t,r){return await rn.default.ready,rn.default.crypto_pwhash(r.outputLength,n,t,r.opsLimit,r.memLimitKib*1024,rn.default.crypto_pwhash_ALG_ARGON2ID13)}}Ye.Argon2id=Bg;class ga{static fromLibsodiumPrivkey(n){if(n.length!==64)throw new Error(`Unexpected key length ${n.length}. Must be 64.`);return new ga(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])}}Ye.Ed25519Keypair=ga;class bg{static async makeKeypair(n){await rn.default.ready;const t=rn.default.crypto_sign_seed_keypair(n);return ga.fromLibsodiumPrivkey(t.privateKey)}static async createSignature(n,t){return await rn.default.ready,rn.default.crypto_sign_detached(n,t.toLibsodiumPrivkey())}static async verifySignature(n,t,r){return await rn.default.ready,rn.default.crypto_sign_verify_detached(n,t,r)}}Ye.Ed25519=bg;Ye.xchacha20NonceLength=24;class Og{static async encrypt(n,t,r){return await rn.default.ready,rn.default.crypto_aead_xchacha20poly1305_ietf_encrypt(n,null,null,r,t)}static async decrypt(n,t,r){return await rn.default.ready,rn.default.crypto_aead_xchacha20poly1305_ietf_decrypt(null,n,null,r,t)}}Ye.Xchacha20poly1305Ietf=Og;var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0});Sa.Random=void 0;class Ag{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=G.requireCryptoBrowserify();return new Uint8Array([...t.randomBytes(n)])}catch{throw new Error("No secure random number generator found")}}}}Sa.Random=Ag;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.ripemd160=Qr.Ripemd160=void 0;const Ig=G.require$$0$2,Tg=pi;class Ap{constructor(n){this.blockSize=512/8,this.impl=Ig.ripemd160.create(),n&&this.update(n)}update(n){return this.impl.update((0,Tg.toRealUint8Array)(n)),this}digest(){return this.impl.digest()}}Qr.Ripemd160=Ap;function Cg(e){return new Ap(e).digest()}Qr.ripemd160=Cg;var ka={},Lt={};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.ExtendedSecp256k1Signature=Lt.Secp256k1Signature=void 0;function hr(e){let n=0;for(const t of e)if(t===0)n++;else break;return e.slice(n)}const ho=2;class Qi{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 Qi(hr(n.slice(0,32)),hr(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++]!==ho)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++]!==ho)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 Qi(hr(v),hr(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([ho,r,...n,ho,o,...t]);return new Uint8Array([48,h.length,...h])}}Lt.Secp256k1Signature=Qi;class Gu extends Qi{static fromFixedLength(n){if(n.length!==65)throw new Error(`Got invalid data length ${n.length}. Expected 32 + 32 + 1`);return new Gu(hr(n.slice(0,32)),hr(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])}}Lt.ExtendedSecp256k1Signature=Gu;var Ip=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ka,"__esModule",{value:!0});ka.Secp256k1=void 0;const go=ae,Tp=Ip(G.bnExports),Ng=Ip(G.requireElliptic()),wg=Lt,Ot=new Ng.default.ec("secp256k1"),Eg=new Tp.default("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex");class _g{static async makeKeypair(n){if(n.length!==32)throw new Error("input data is not a valid secp256k1 private key");const t=Ot.keyFromPrivate(n);if(t.validate().result!==!0)throw new Error("input data is not a valid secp256k1 private key");if(new Tp.default(n).gte(Eg))throw new Error("input data is not a valid secp256k1 private key");return{privkey:(0,go.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=Ot.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 wg.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=Ot.keyFromPublic(r);try{return o.verify(t,n.toDer())}catch{return!1}}static recoverPubkey(n,t){const r={r:(0,go.toHex)(n.r()),s:(0,go.toHex)(n.s())},o=Ot.recoverPubKey(t,r,n.recovery),h=Ot.keyFromPublic(o);return(0,go.fromHex)(h.getPublic(!1,"hex"))}static compressPubkey(n){switch(n.length){case 33:return n;case 65:return Uint8Array.from(Ot.keyFromPublic(n).getPublic(!0,"array"));default:throw new Error("Invalid pubkey length")}}static uncompressPubkey(n){switch(n.length){case 33:return Uint8Array.from(Ot.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")}}}ka.Secp256k1=_g;var Cp={};(function(e){var n=G.commonjsGlobal&&G.commonjsGlobal.__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=ae,r=be,o=n(G.bnExports),h=n(G.requireElliptic()),v=Ki,C=An;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})(Cp);(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=Fn;Object.defineProperty(e,"Bip39",{enumerable:!0,get:function(){return n.Bip39}}),Object.defineProperty(e,"EnglishMnemonic",{enumerable:!0,get:function(){return n.EnglishMnemonic}});var t=Ki;Object.defineProperty(e,"Hmac",{enumerable:!0,get:function(){return t.Hmac}});var r=Vr;Object.defineProperty(e,"Keccak256",{enumerable:!0,get:function(){return r.Keccak256}}),Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return r.keccak256}});var o=Ye;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=Sa;Object.defineProperty(e,"Random",{enumerable:!0,get:function(){return h.Random}});var v=Qr;Object.defineProperty(e,"Ripemd160",{enumerable:!0,get:function(){return v.Ripemd160}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return v.ripemd160}});var C=ka;Object.defineProperty(e,"Secp256k1",{enumerable:!0,get:function(){return C.Secp256k1}});var w=Lt;Object.defineProperty(e,"ExtendedSecp256k1Signature",{enumerable:!0,get:function(){return w.ExtendedSecp256k1Signature}}),Object.defineProperty(e,"Secp256k1Signature",{enumerable:!0,get:function(){return w.Secp256k1Signature}});var D=An;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=Cp;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}})})(qe);var Me={},zi={};(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})(zi);Object.defineProperty(Me,"__esModule",{value:!0});Me.encodeBech32Pubkey=Me.encodeAminoPubkey=Me.decodeBech32Pubkey=Me.decodeAminoPubkey=Me.encodeEd25519Pubkey=Me.encodeSecp256k1Pubkey=void 0;const xe=ae,Ug=be,Ni=Re,et=zi;function Jg(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:et.pubkeyType.secp256k1,value:(0,xe.toBase64)(e)}}Me.encodeSecp256k1Pubkey=Jg;function Dg(e){if(e.length!==32)throw new Error("Ed25519 public key must be 32 bytes long");return{type:et.pubkeyType.ed25519,value:(0,xe.toBase64)(e)}}Me.encodeEd25519Pubkey=Dg;const fu=(0,xe.fromHex)("eb5ae98721"),pu=(0,xe.fromHex)("1624de6420"),dl=(0,xe.fromHex)("0dfb100520"),Yo=(0,xe.fromHex)("22c1f7e2");function Fu(e){if((0,Ni.arrayContentStartsWith)(e,fu)){const n=e.slice(fu.length);if(n.length!==33)throw new Error("Invalid rest data length. Expected 33 bytes (compressed secp256k1 pubkey).");return{type:et.pubkeyType.secp256k1,value:(0,xe.toBase64)(n)}}else if((0,Ni.arrayContentStartsWith)(e,pu)){const n=e.slice(pu.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Ed25519 pubkey).");return{type:et.pubkeyType.ed25519,value:(0,xe.toBase64)(n)}}else if((0,Ni.arrayContentStartsWith)(e,dl)){const n=e.slice(dl.length);if(n.length!==32)throw new Error("Invalid rest data length. Expected 32 bytes (Sr25519 pubkey).");return{type:et.pubkeyType.sr25519,value:(0,xe.toBase64)(n)}}else{if((0,Ni.arrayContentStartsWith)(e,Yo))return qg(e);throw new Error("Unsupported public key type. Amino data starts with: "+(0,xe.toHex)(e.slice(0,5)))}}Me.decodeAminoPubkey=Fu;function Mg(e){const{data:n}=(0,xe.fromBech32)(e);return Fu(n)}Me.decodeBech32Pubkey=Mg;function ul(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 qg(e){const n=Array.from(e),t=n.splice(0,Yo.length);if(!(0,Ni.arrayContentStartsWith)(t,Yo))throw new Error("Invalid multisig prefix.");if(n.shift()!=8)throw new Error("Invalid multisig data. Expecting 0x08 prefix before threshold.");const[r,o]=ul(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]=ul(n);if(n.splice(0,C),n.length<v)throw new Error("Invalid multisig data length.");const w=n.splice(0,v),D=Fu(Uint8Array.from(w));h.push(D)}return{type:et.pubkeyType.multisigThreshold,value:{threshold:r.toString(),pubkeys:h}}}function cl(e){const n=Ug.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 Lu(e){if((0,et.isMultisigThresholdPubkey)(e)){const n=Array.from(Yo);n.push(8),n.push(...cl(e.value.threshold));for(const t of e.value.pubkeys.map(r=>Lu(r)))n.push(18),n.push(...cl(t.length)),n.push(...t);return new Uint8Array(n)}else{if((0,et.isEd25519Pubkey)(e))return new Uint8Array([...pu,...(0,xe.fromBase64)(e.value)]);if((0,et.isSecp256k1Pubkey)(e))return new Uint8Array([...fu,...(0,xe.fromBase64)(e.value)]);throw new Error("Unsupported pubkey type")}}Me.encodeAminoPubkey=Lu;function Hg(e,n){return(0,xe.toBech32)(n,Lu(e))}Me.encodeBech32Pubkey=Hg;Object.defineProperty(dn,"__esModule",{value:!0});dn.pubkeyToAddress=dn.pubkeyToRawAddress=dn.rawSecp256k1PubkeyToRawAddress=dn.rawEd25519PubkeyToRawAddress=void 0;const Zo=qe,mu=ae,Vg=Me,nd=zi;function Np(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,Zo.sha256)(e).slice(0,20)}dn.rawEd25519PubkeyToRawAddress=Np;function wp(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,Zo.ripemd160)((0,Zo.sha256)(e))}dn.rawSecp256k1PubkeyToRawAddress=wp;function Ep(e){if((0,nd.isSecp256k1Pubkey)(e)){const n=(0,mu.fromBase64)(e.value);return wp(n)}else if((0,nd.isEd25519Pubkey)(e)){const n=(0,mu.fromBase64)(e.value);return Np(n)}else if((0,nd.isMultisigThresholdPubkey)(e)){const n=(0,Vg.encodeAminoPubkey)(e);return(0,Zo.sha256)(n).slice(0,20)}else throw new Error("Unsupported public key type")}dn.pubkeyToRawAddress=Ep;function Qg(e,n){return(0,mu.toBech32)(n,Ep(e))}dn.pubkeyToAddress=Qg;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.addCoins=Ln.parseCoins=Ln.coins=Ln.coin=void 0;const yu=be;function _p(e,n){let t;if(typeof e=="number")try{t=new yu.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}}Ln.coin=_p;function Wg(e,n){return[_p(e,n)]}Ln.coins=Wg;function Gg(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]}})}Ln.parseCoins=Gg;function Fg(e,n){if(e.denom!==n.denom)throw new Error("Trying to add two coins with different denoms");return{amount:yu.Decimal.fromAtomics(e.amount,0).plus(yu.Decimal.fromAtomics(n.amount,0)).atomics,denom:e.denom}}Ln.addCoins=Fg;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.createMultisigThresholdPubkey=Wr.compareArrays=void 0;const ll=ae,Lg=be,fl=dn;function Up(e,n){const t=(0,ll.toHex)(e),r=(0,ll.toHex)(n);return t===r?0:t<r?-1:1}Wr.compareArrays=Up;function $g(e,n,t=!1){const r=new Lg.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,fl.pubkeyToRawAddress)(h),w=(0,fl.pubkeyToRawAddress)(v);return Up(C,w)});return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:r.toString(),pubkeys:o}}}Wr.createMultisigThresholdPubkey=$g;var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.omitDefault=void 0;function Kg(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}'`)}}Pa.omitDefault=Kg;var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.makeCosmoshubPath=void 0;const mi=qe;function zg(e){return[mi.Slip10RawIndex.hardened(44),mi.Slip10RawIndex.hardened(118),mi.Slip10RawIndex.hardened(0),mi.Slip10RawIndex.normal(0),mi.Slip10RawIndex.normal(e)]}Yi.makeCosmoshubPath=zg;var Gr={},bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.decodeSignature=bt.encodeSecp256k1Signature=void 0;const hu=ae,Yg=Me,Zg=zi;function Xg(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,Yg.encodeSecp256k1Pubkey)(e),signature:(0,hu.toBase64)(n)}}bt.encodeSecp256k1Signature=Xg;function xg(e){switch(e.pub_key.type){case Zg.pubkeyType.secp256k1:return{pubkey:(0,hu.fromBase64)(e.pub_key.value),signature:(0,hu.fromBase64)(e.signature)};default:throw new Error("Unsupported pubkey type")}}bt.decodeSignature=xg;var In={};Object.defineProperty(In,"__esModule",{value:!0});In.serializeSignDoc=In.escapeCharacters=In.makeSignDoc=In.sortedJsonStringify=void 0;const jg=ae,pl=be;function gu(e){if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(gu);const n=Object.keys(e).sort(),t={};return n.forEach(r=>{t[r]=gu(e[r])}),t}function Jp(e){return JSON.stringify(gu(e))}In.sortedJsonStringify=Jp;function eS(e,n,t,r,o,h,v){return{chain_id:t,account_number:pl.Uint53.fromString(o.toString()).toString(),sequence:pl.Uint53.fromString(h.toString()).toString(),fee:n,msgs:e,memo:r||"",...v&&{timeout_height:v.toString()}}}In.makeSignDoc=eS;function Dp(e){const n=/&/g,t=/</g,r=/>/g;return e.replace(n,"\\u0026").replace(t,"\\u003c").replace(r,"\\u003e")}In.escapeCharacters=Dp;function nS(e){const n=Dp(Jp(e));return(0,jg.toUtf8)(n)}In.serializeSignDoc=nS;var $u={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=qe,t=ae;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})($u);Object.defineProperty(Gr,"__esModule",{value:!0});Gr.Secp256k1HdWallet=Gr.extractKdfConfiguration=void 0;const fn=qe,yi=ae,gr=Re,tS=dn,rS=Yi,iS=bt,oS=In,hi=$u,Vo="secp256k1wallet-v1",aS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function sS(e){return!(!(0,gr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function dS(e){return e.kdf}function uS(e){const n=JSON.parse(e);if(!(0,gr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case Vo:return dS(n);default:throw new Error("Unsupported serialization type")}}Gr.extractKdfConfiguration=uS;const ml={bip39Password:"",hdPaths:[(0,rS.makeCosmoshubPath)(0)],prefix:"cosmos"};class Jt{static async fromMnemonic(n,t={}){const r=new fn.EnglishMnemonic(n),o=await fn.Bip39.mnemonicToSeed(r,t.bip39Password);return new Jt(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=fn.Random.getBytes(r),h=fn.Bip39.encode(o);return Jt.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,gr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Vo:return Jt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,gr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Vo:{const h=await(0,hi.decrypt)((0,yi.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,yi.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,gr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>sS(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,fn.stringToPath)(I));return Jt.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,gr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,hi.executeKdf)(t,r.kdf);return Jt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.hdPaths??ml.hdPaths,o=t.prefix??ml.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,fn.sha256)((0,oS.serializeSignDoc)(t)),w=await fn.Secp256k1.createSignature(C,h),D=new Uint8Array([...w.r(32),...w.s(32)]);return{signed:t,signature:(0,iS.encodeSecp256k1Signature)(v,D)}}async serialize(n){const t=aS,r=await(0,hi.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,fn.pathToString)(w),prefix:D}))},o=(0,yi.toUtf8)(JSON.stringify(r)),h={algorithm:hi.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,hi.encrypt)(o,n,h),C={type:Vo,kdf:t,encryption:h,data:(0,yi.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=fn.Slip10.derivePath(fn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await fn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:fn.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,yi.toBech32)(t,(0,tS.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}Gr.Secp256k1HdWallet=Jt;var Ra={};Object.defineProperty(Ra,"__esModule",{value:!0});Ra.Secp256k1Wallet=void 0;const So=qe,cS=ae,lS=dn,fS=bt,pS=In;class Ku{static async fromKey(n,t="cosmos"){const r=(await So.Secp256k1.makeKeypair(n)).pubkey;return new Ku(n,So.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,cS.toBech32)(this.prefix,(0,lS.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 So.Sha256((0,pS.serializeSignDoc)(t)).digest(),o=await So.Secp256k1.createSignature(r,this.privkey),h=new Uint8Array([...o.r(32),...o.s(32)]);return{signed:t,signature:(0,fS.encodeSecp256k1Signature)(this.pubkey,h)}}}Ra.Secp256k1Wallet=Ku;var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.makeStdTx=Fr.isStdTx=void 0;function mS(e){const{memo:n,msg:t,fee:r,signatures:o}=e;return typeof n=="string"&&Array.isArray(t)&&typeof r=="object"&&Array.isArray(o)}Fr.isStdTx=mS;function yS(e,n){return{msg:e.msgs,fee:e.fee,memo:e.memo,signatures:Array.isArray(n)?n:[n]}}Fr.makeStdTx=yS;(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=dn;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=Ln;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=Me;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=Wr;Object.defineProperty(e,"createMultisigThresholdPubkey",{enumerable:!0,get:function(){return o.createMultisigThresholdPubkey}});var h=Pa;Object.defineProperty(e,"omitDefault",{enumerable:!0,get:function(){return h.omitDefault}});var v=Yi;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return v.makeCosmoshubPath}});var C=zi;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=Gr;Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return w.extractKdfConfiguration}}),Object.defineProperty(e,"Secp256k1HdWallet",{enumerable:!0,get:function(){return w.Secp256k1HdWallet}});var D=Ra;Object.defineProperty(e,"Secp256k1Wallet",{enumerable:!0,get:function(){return D.Secp256k1Wallet}});var J=bt;Object.defineProperty(e,"decodeSignature",{enumerable:!0,get:function(){return J.decodeSignature}}),Object.defineProperty(e,"encodeSecp256k1Signature",{enumerable:!0,get:function(){return J.encodeSecp256k1Signature}});var I=In;Object.defineProperty(e,"makeSignDoc",{enumerable:!0,get:function(){return I.makeSignDoc}}),Object.defineProperty(e,"serializeSignDoc",{enumerable:!0,get:function(){return I.serializeSignDoc}});var g=Fr;Object.defineProperty(e,"isStdTx",{enumerable:!0,get:function(){return g.isStdTx}}),Object.defineProperty(e,"makeStdTx",{enumerable:!0,get:function(){return g.makeStdTx}});var R=$u;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return R.executeKdf}})})(Hn);var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.makeSignBytes=Zn.makeSignDoc=Zn.makeAuthInfoBytes=void 0;const yl=Re,hS=j.signing,Xo=j.tx;function gS(e,n){return e.map(({pubkey:t,sequence:r})=>({publicKey:t,modeInfo:{single:{mode:n}},sequence:BigInt(r)}))}function SS(e,n,t,r,o,h=hS.SignMode.SIGN_MODE_DIRECT){(0,yl.assert)(r===void 0||typeof r=="string","feeGranter must be undefined or string"),(0,yl.assert)(o===void 0||typeof o=="string","feePayer must be undefined or string");const v=Xo.AuthInfo.fromPartial({signerInfos:gS(e,h),fee:{amount:[...n],gasLimit:BigInt(t),granter:r,payer:o}});return Xo.AuthInfo.encode(v).finish()}Zn.makeAuthInfoBytes=SS;function kS(e,n,t,r){return{bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:BigInt(r)}}Zn.makeSignDoc=kS;function PS({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r}){const o=Xo.SignDoc.fromPartial({accountNumber:e,authInfoBytes:n,bodyBytes:t,chainId:r});return Xo.SignDoc.encode(o).finish()}Zn.makeSignBytes=PS;var zu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decrypt=e.encrypt=e.supportedAlgorithms=e.executeKdf=e.cosmjsSalt=void 0;const n=qe,t=ae;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})(zu);Object.defineProperty(_r,"__esModule",{value:!0});_r.DirectSecp256k1HdWallet=_r.extractKdfConfiguration=void 0;const Su=Hn,pn=qe,gi=ae,Sr=Re,RS=Zn,Si=zu,Qo="directsecp256k1hdwallet-v1",vS={algorithm:"argon2id",params:{outputLength:32,opsLimit:24,memLimitKib:12*1024}};function BS(e){return!(!(0,Sr.isNonNullObject)(e)||typeof e.hdPath!="string"||typeof e.prefix!="string")}function bS(e){return e.kdf}function OS(e){const n=JSON.parse(e);if(!(0,Sr.isNonNullObject)(n))throw new Error("Root document is not an object.");switch(n.type){case Qo:return bS(n);default:throw new Error("Unsupported serialization type")}}_r.extractKdfConfiguration=OS;const hl={bip39Password:"",hdPaths:[(0,Su.makeCosmoshubPath)(0)],prefix:"cosmos"};class Dt{static async fromMnemonic(n,t={}){const r=new pn.EnglishMnemonic(n),o=await pn.Bip39.mnemonicToSeed(r,t.bip39Password);return new Dt(r,{...t,seed:o})}static async generate(n=12,t={}){const r=4*Math.floor(11*n/33),o=pn.Random.getBytes(r),h=pn.Bip39.encode(o);return Dt.fromMnemonic(h.toString(),t)}static async deserialize(n,t){const r=JSON.parse(n);if(!(0,Sr.isNonNullObject)(r))throw new Error("Root document is not an object.");switch(r.type){case Qo:return Dt.deserializeTypeV1(n,t);default:throw new Error("Unsupported serialization type")}}static async deserializeWithEncryptionKey(n,t){const r=JSON.parse(n);if(!(0,Sr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=r;switch(o.type){case Qo:{const h=await(0,Si.decrypt)((0,gi.fromBase64)(o.data),t,o.encryption),v=JSON.parse((0,gi.fromUtf8)(h)),{mnemonic:C,accounts:w}=v;if((0,Sr.assert)(typeof C=="string"),!Array.isArray(w))throw new Error("Property 'accounts' is not an array");if(!w.every(I=>BS(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,pn.stringToPath)(I));return Dt.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,Sr.isNonNullObject)(r))throw new Error("Root document is not an object.");const o=await(0,Si.executeKdf)(t,r.kdf);return Dt.deserializeWithEncryptionKey(n,o)}constructor(n,t){const r=t.prefix??hl.prefix,o=t.hdPaths??hl.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,RS.makeSignBytes)(t),w=(0,pn.sha256)(C),D=await pn.Secp256k1.createSignature(w,h),J=new Uint8Array([...D.r(32),...D.s(32)]),I=(0,Su.encodeSecp256k1Signature)(v,J);return{signed:t,signature:I}}async serialize(n){const t=vS,r=await(0,Si.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,pn.pathToString)(w),prefix:D}))},o=(0,gi.toUtf8)(JSON.stringify(r)),h={algorithm:Si.supportedAlgorithms.xchacha20poly1305Ietf},v=await(0,Si.encrypt)(o,n,h),C={type:Qo,kdf:t,encryption:h,data:(0,gi.toBase64)(v)};return JSON.stringify(C)}async getKeyPair(n){const{privkey:t}=pn.Slip10.derivePath(pn.Slip10Curve.Secp256k1,this.seed,n),{pubkey:r}=await pn.Secp256k1.makeKeypair(t);return{privkey:t,pubkey:pn.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,gi.toBech32)(t,(0,Su.rawSecp256k1PubkeyToRawAddress)(o));return{algo:"secp256k1",privkey:r,pubkey:o,address:h}}))}}_r.DirectSecp256k1HdWallet=Dt;var va={};Object.defineProperty(va,"__esModule",{value:!0});va.DirectSecp256k1Wallet=void 0;const gl=Hn,ko=qe,AS=ae,IS=Zn;class Yu{static async fromKey(n,t="cosmos"){const r=(await ko.Secp256k1.makeKeypair(n)).pubkey;return new Yu(n,ko.Secp256k1.compressPubkey(r),t)}constructor(n,t,r){this.privkey=n,this.pubkey=t,this.prefix=r}get address(){return(0,AS.toBech32)(this.prefix,(0,gl.rawSecp256k1PubkeyToRawAddress)(this.pubkey))}async getAccounts(){return[{algo:"secp256k1",address:this.address,pubkey:this.pubkey}]}async signDirect(n,t){const r=(0,IS.makeSignBytes)(t);if(n!==this.address)throw new Error(`Address ${n} not found in wallet`);const o=(0,ko.sha256)(r),h=await ko.Secp256k1.createSignature(o,this.privkey),v=new Uint8Array([...h.r(32),...h.s(32)]),C=(0,gl.encodeSecp256k1Signature)(this.pubkey,v);return{signed:t,signature:C}}}va.DirectSecp256k1Wallet=Yu;var Ba={};Object.defineProperty(Ba,"__esModule",{value:!0});Ba.makeCosmoshubPath=void 0;const ki=qe;function TS(e){return[ki.Slip10RawIndex.hardened(44),ki.Slip10RawIndex.hardened(118),ki.Slip10RawIndex.hardened(0),ki.Slip10RawIndex.normal(0),ki.Slip10RawIndex.normal(e)]}Ba.makeCosmoshubPath=TS;var $n={},nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.PrivKey=nt.PubKey=nt.protobufPackage=void 0;const Rr=G.binary,vr=G.helpers;nt.protobufPackage="cosmos.crypto.ed25519";function td(){return{key:new Uint8Array}}nt.PubKey={typeUrl:"/cosmos.crypto.ed25519.PubKey",encode(e,n=Rr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Rr.BinaryReader?e:new Rr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=td();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=td();return(0,vr.isSet)(e.key)&&(n.key=(0,vr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,vr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=td();return n.key=e.key??new Uint8Array,n}};function rd(){return{key:new Uint8Array}}nt.PrivKey={typeUrl:"/cosmos.crypto.ed25519.PrivKey",encode(e,n=Rr.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Rr.BinaryReader?e:new Rr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=rd();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=rd();return(0,vr.isSet)(e.key)&&(n.key=(0,vr.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,vr.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=rd();return n.key=e.key??new Uint8Array,n}};var $t={};Object.defineProperty($t,"__esModule",{value:!0});$t.LegacyAminoPubKey=$t.protobufPackage=void 0;const Pi=G.any,id=G.binary,CS=G.helpers;$t.protobufPackage="cosmos.crypto.multisig";function od(){return{threshold:0,publicKeys:[]}}$t.LegacyAminoPubKey={typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",encode(e,n=id.BinaryWriter.create()){e.threshold!==0&&n.uint32(8).uint32(e.threshold);for(const t of e.publicKeys)Pi.Any.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof id.BinaryReader?e:new id.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=od();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.threshold=t.uint32();break;case 2:o.publicKeys.push(Pi.Any.decode(t,t.uint32()));break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=od();return(0,CS.isSet)(e.threshold)&&(n.threshold=Number(e.threshold)),Array.isArray(e==null?void 0:e.publicKeys)&&(n.publicKeys=e.publicKeys.map(t=>Pi.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?Pi.Any.toJSON(t):void 0):n.publicKeys=[],n},fromPartial(e){var t;const n=od();return n.threshold=e.threshold??0,n.publicKeys=((t=e.publicKeys)==null?void 0:t.map(r=>Pi.Any.fromPartial(r)))||[],n}};var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.PrivKey=tt.PubKey=tt.protobufPackage=void 0;const Br=G.binary,br=G.helpers;tt.protobufPackage="cosmos.crypto.secp256k1";function ad(){return{key:new Uint8Array}}tt.PubKey={typeUrl:"/cosmos.crypto.secp256k1.PubKey",encode(e,n=Br.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Br.BinaryReader?e:new Br.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,br.isSet)(e.key)&&(n.key=(0,br.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,br.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=ad();return n.key=e.key??new Uint8Array,n}};function sd(){return{key:new Uint8Array}}tt.PrivKey={typeUrl:"/cosmos.crypto.secp256k1.PrivKey",encode(e,n=Br.BinaryWriter.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof Br.BinaryReader?e:new Br.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=sd();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=sd();return(0,br.isSet)(e.key)&&(n.key=(0,br.bytesFromBase64)(e.key)),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,br.base64FromBytes)(e.key!==void 0?e.key:new Uint8Array)),n},fromPartial(e){const n=sd();return n.key=e.key??new Uint8Array,n}};Object.defineProperty($n,"__esModule",{value:!0});$n.decodeOptionalPubkey=$n.decodePubkey=$n.anyToSinglePubkey=$n.encodePubkey=void 0;const Ui=Hn,Sl=ae,NS=be,ku=nt,Pu=$t,Ru=tt,dd=G.any;function Mp(e){if((0,Ui.isSecp256k1Pubkey)(e)){const n=Ru.PubKey.fromPartial({key:(0,Sl.fromBase64)(e.value)});return dd.Any.fromPartial({typeUrl:"/cosmos.crypto.secp256k1.PubKey",value:Uint8Array.from(Ru.PubKey.encode(n).finish())})}else if((0,Ui.isEd25519Pubkey)(e)){const n=ku.PubKey.fromPartial({key:(0,Sl.fromBase64)(e.value)});return dd.Any.fromPartial({typeUrl:"/cosmos.crypto.ed25519.PubKey",value:Uint8Array.from(ku.PubKey.encode(n).finish())})}else if((0,Ui.isMultisigThresholdPubkey)(e)){const n=Pu.LegacyAminoPubKey.fromPartial({threshold:NS.Uint53.fromString(e.value.threshold).toNumber(),publicKeys:e.value.pubkeys.map(Mp)});return dd.Any.fromPartial({typeUrl:"/cosmos.crypto.multisig.LegacyAminoPubKey",value:Uint8Array.from(Pu.LegacyAminoPubKey.encode(n).finish())})}else throw new Error(`Pubkey type ${e.type} not recognized`)}$n.encodePubkey=Mp;function vu(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":{const{key:n}=Ru.PubKey.decode(e.value);return(0,Ui.encodeSecp256k1Pubkey)(n)}case"/cosmos.crypto.ed25519.PubKey":{const{key:n}=ku.PubKey.decode(e.value);return(0,Ui.encodeEd25519Pubkey)(n)}default:throw new Error(`Pubkey type_url ${e.typeUrl} not recognized as single public key type`)}}$n.anyToSinglePubkey=vu;function qp(e){switch(e.typeUrl){case"/cosmos.crypto.secp256k1.PubKey":case"/cosmos.crypto.ed25519.PubKey":return vu(e);case"/cosmos.crypto.multisig.LegacyAminoPubKey":{const{threshold:n,publicKeys:t}=Pu.LegacyAminoPubKey.decode(e.value);return{type:"tendermint/PubKeyMultisigThreshold",value:{threshold:n.toString(),pubkeys:t.map(vu)}}}default:throw new Error(`Pubkey type URL '${e.typeUrl}' not recognized`)}}$n.decodePubkey=qp;function wS(e){if(!e)return null;if(e.typeUrl){if(e.value.length)return qp(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}}$n.decodeOptionalPubkey=wS;var hn={},ba={},Zu={};(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=G.coin,t=G.binary,r=G.helpers;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}}})(Zu);(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=G.coin,t=Zu,r=G.binary,o=G.helpers;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})(ba);Object.defineProperty(hn,"__esModule",{value:!0});hn.Registry=hn.isTxBodyEncodeObject=hn.isPbjsGeneratedType=hn.isTsProtoGeneratedType=hn.isTelescopeGeneratedType=void 0;const ES=ba,_S=G.coin,ud=j.tx,US=G.any;function Hp(e){const n=e;return typeof n.fromPartial=="function"&&typeof n.typeUrl=="string"}hn.isTelescopeGeneratedType=Hp;function Xu(e){return typeof e.fromPartial=="function"}hn.isTsProtoGeneratedType=Xu;function JS(e){return!Xu(e)}hn.isPbjsGeneratedType=JS;const kl={cosmosCoin:"/cosmos.base.v1beta1.Coin",cosmosMsgSend:"/cosmos.bank.v1beta1.MsgSend",cosmosTxBody:"/cosmos.tx.v1beta1.TxBody",googleAny:"/google.protobuf.Any"};function Vp(e){return e.typeUrl==="/cosmos.tx.v1beta1.TxBody"}hn.isTxBodyEncodeObject=Vp;class DS{constructor(n){const{cosmosCoin:t,cosmosMsgSend:r}=kl;this.types=n?new Map([...n]):new Map([[t,_S.Coin],[r,ES.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(Vp(n))return this.encodeTxBody(t);const o=this.lookupTypeWithError(r),h=Hp(o)||Xu(o)?o.fromPartial(t):o.create(t);return o.encode(h).finish()}encodeAsAny(n){const t=this.encode(n);return US.Any.fromPartial({typeUrl:n.typeUrl,value:t})}encodeTxBody(n){var o;const t=n.messages.map(h=>this.encodeAsAny(h)),r=ud.TxBody.fromPartial({...n,timeoutHeight:BigInt(((o=n.timeoutHeight)==null?void 0:o.toString())??"0"),messages:t});return ud.TxBody.encode(r).finish()}decode({typeUrl:n,value:t}){if(n===kl.cosmosTxBody)return this.decodeTxBody(t);const o=this.lookupTypeWithError(n).decode(t);return Object.entries(o).forEach(([h,v])=>{typeof G.dist.Buffer<"u"&&typeof G.dist.Buffer.isBuffer<"u"&&G.dist.Buffer.isBuffer(v)&&(o[h]=Uint8Array.from(v))}),o}decodeTxBody(n){const t=ud.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})})}}}hn.Registry=DS;var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0});Oa.isOfflineDirectSigner=void 0;function MS(e){return e.signDirect!==void 0}Oa.isOfflineDirectSigner=MS;(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=ma;Object.defineProperty(e,"decodeTxRaw",{enumerable:!0,get:function(){return n.decodeTxRaw}});var t=_r;Object.defineProperty(e,"DirectSecp256k1HdWallet",{enumerable:!0,get:function(){return t.DirectSecp256k1HdWallet}}),Object.defineProperty(e,"extractKdfConfiguration",{enumerable:!0,get:function(){return t.extractKdfConfiguration}});var r=va;Object.defineProperty(e,"DirectSecp256k1Wallet",{enumerable:!0,get:function(){return r.DirectSecp256k1Wallet}});var o=Ba;Object.defineProperty(e,"makeCosmoshubPath",{enumerable:!0,get:function(){return o.makeCosmoshubPath}});var h=$n;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=hn;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=Oa;Object.defineProperty(e,"isOfflineDirectSigner",{enumerable:!0,get:function(){return C.isOfflineDirectSigner}});var w=Zn;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=zu;Object.defineProperty(e,"executeKdf",{enumerable:!0,get:function(){return D.executeKdf}});var J=Hn;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}})})(Xn);var Zi={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Params=e.ModuleCredential=e.ModuleAccount=e.BaseAccount=e.protobufPackage=void 0;const n=G.any,t=G.binary,r=G.helpers;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}}})(Zi);var Aa={};(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=Zi,t=G.coin,r=G.binary,o=G.helpers;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}}})(Aa);Object.defineProperty($i,"__esModule",{value:!0});$i.accountFromAny=void 0;const qS=be,HS=Xn,Ri=Re,Pl=Zi,Po=Aa;function Rl(e){return qS.Uint64.fromString(e.toString())}function tr(e){const{address:n,pubKey:t,accountNumber:r,sequence:o}=e,h=(0,HS.decodeOptionalPubkey)(t);return{address:n,pubkey:h,accountNumber:Rl(r).toNumber(),sequence:Rl(o).toNumber()}}function VS(e){var r,o,h,v,C,w,D;const{typeUrl:n,value:t}=e;switch(n){case"/cosmos.auth.v1beta1.BaseAccount":return tr(Pl.BaseAccount.decode(t));case"/cosmos.auth.v1beta1.ModuleAccount":{const J=Pl.ModuleAccount.decode(t).baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.BaseVestingAccount":{const J=(r=Po.BaseVestingAccount.decode(t))==null?void 0:r.baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.ContinuousVestingAccount":{const J=(h=(o=Po.ContinuousVestingAccount.decode(t))==null?void 0:o.baseVestingAccount)==null?void 0:h.baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.DelayedVestingAccount":{const J=(C=(v=Po.DelayedVestingAccount.decode(t))==null?void 0:v.baseVestingAccount)==null?void 0:C.baseAccount;return(0,Ri.assert)(J),tr(J)}case"/cosmos.vesting.v1beta1.PeriodicVestingAccount":{const J=(D=(w=Po.PeriodicVestingAccount.decode(t))==null?void 0:w.baseVestingAccount)==null?void 0:D.baseAccount;return(0,Ri.assert)(J),tr(J)}default:throw new Error(`Unsupported type: '${n}'`)}}$i.accountFromAny=VS;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.AminoTypes=void 0;class QS{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.")}}}Xi.AminoTypes=QS;var xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.fromTendermintEvent=void 0;const vl=ae;function WS(e){return{type:e.type,attributes:e.attributes.map(n=>({key:typeof n.key=="string"?n.key:(0,vl.fromUtf8)(n.key,!0),value:typeof n.value=="string"?n.value:(0,vl.fromUtf8)(n.value,!0)}))}}xi.fromTendermintEvent=WS;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.calculateFee=Kt.GasPrice=void 0;const Qp=be,GS=Xn;function FS(e){if(e.length<3||e.length>128)throw new Error("Denom must be between 3 and 128 characters")}class Ia{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;FS(h);const C=Qp.Decimal.fromUserInput(o,18);return new Ia(C,h)}toString(){return this.amount.toString()+this.denom}}Kt.GasPrice=Ia;function LS(e,n){const t=typeof n=="string"?Ia.fromString(n):n,{denom:r,amount:o}=t,h=o.multiply(new Qp.Uint53(e)).ceil().toString();return{amount:(0,GS.coins)(h,r),gas:e.toString()}}Kt.calculateFee=LS;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.findAttribute=Ze.parseRawLog=Ze.parseLogs=Ze.parseLog=Ze.parseEvent=Ze.parseAttribute=void 0;const xu=Re;function Wp(e){if(!(0,xu.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||""}}Ze.parseAttribute=Wp;function Gp(e){if(!(0,xu.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(Wp)}}Ze.parseEvent=Gp;function Fp(e){if(!(0,xu.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(Gp)}}Ze.parseLog=Fp;function Lp(e){if(!Array.isArray(e))throw new Error("Logs must be an array");return e.map(Fp)}Ze.parseLogs=Lp;function $S(e){if(!e)return[];const n=JSON.parse(e).map(({events:t},r)=>({msg_index:r,events:t,log:""}));return Lp(n)}Ze.parseRawLog=$S;function KS(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}Ze.findAttribute=KS;var Wi={},Ta={},ju={},Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.PageResponse=Se.PageRequest=Se.protobufPackage=void 0;const Or=G.binary,En=G.helpers;Se.protobufPackage="cosmos.base.query.v1beta1";function cd(){return{key:new Uint8Array,offset:BigInt(0),limit:BigInt(0),countTotal:!1,reverse:!1}}Se.PageRequest={typeUrl:"/cosmos.base.query.v1beta1.PageRequest",encode(e,n=Or.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 Or.BinaryReader?e:new Or.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.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=cd();return(0,En.isSet)(e.key)&&(n.key=(0,En.bytesFromBase64)(e.key)),(0,En.isSet)(e.offset)&&(n.offset=BigInt(e.offset.toString())),(0,En.isSet)(e.limit)&&(n.limit=BigInt(e.limit.toString())),(0,En.isSet)(e.countTotal)&&(n.countTotal=!!e.countTotal),(0,En.isSet)(e.reverse)&&(n.reverse=!!e.reverse),n},toJSON(e){const n={};return e.key!==void 0&&(n.key=(0,En.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=cd();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 ld(){return{nextKey:new Uint8Array,total:BigInt(0)}}Se.PageResponse={typeUrl:"/cosmos.base.query.v1beta1.PageResponse",encode(e,n=Or.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 Or.BinaryReader?e:new Or.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.nextKey=t.bytes();break;case 2:o.total=t.uint64();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=ld();return(0,En.isSet)(e.nextKey)&&(n.nextKey=(0,En.bytesFromBase64)(e.nextKey)),(0,En.isSet)(e.total)&&(n.total=BigInt(e.total.toString())),n},toJSON(e){const n={};return e.nextKey!==void 0&&(n.nextKey=(0,En.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=ld();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=Se,t=G.any,r=Zi,o=G.binary,h=G.helpers;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})(ju);var We={},Ca={},ji={},Na={};Object.defineProperty(Na,"__esModule",{value:!0});Na.concat=void 0;const zS=G.xstream;function YS(...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 zS.Stream.create(v)}Na.concat=YS;var wa={};Object.defineProperty(wa,"__esModule",{value:!0});wa.DefaultValueProducer=void 0;class ZS{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}}wa.DefaultValueProducer=ZS;var Ea={};Object.defineProperty(Ea,"__esModule",{value:!0});Ea.dropDuplicates=void 0;function XS(e){return t=>{const r=new Set;return t.filter(h=>!r.has(e(h))).debug(h=>r.add(e(h)))}}Ea.dropDuplicates=XS;var mt={};Object.defineProperty(mt,"__esModule",{value:!0});mt.firstEvent=mt.toListPromise=mt.fromListPromise=void 0;const xS=G.xstream;function jS(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 xS.Stream.create(n)}mt.fromListPromise=jS;async function $p(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)})})}mt.toListPromise=$p;async function ek(e){return(await $p(e,1))[0]}mt.firstEvent=ek;var Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.lastValue=Kn.asArray=Kn.countStream=Kn.Reducer=void 0;class _a{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}}Kn.Reducer=_a;function nk(e,n){return e+1}function tk(e){return new _a(e,nk,0)}Kn.countStream=tk;function rk(e,n){return[...e,n]}function ik(e){return new _a(e,rk,[])}Kn.asArray=ik;function ok(e,n){return n}function ak(e){return new _a(e,ok,void 0)}Kn.lastValue=ak;var Ua={};Object.defineProperty(Ua,"__esModule",{value:!0});Ua.ValueAndUpdates=void 0;const sk=G.xstream;class dk{get value(){return this.producer.value}constructor(n){this.producer=n,this.updates=sk.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)}})})}}Ua.ValueAndUpdates=dk;(function(e){var n=G.commonjsGlobal&&G.commonjsGlobal.__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=G.commonjsGlobal&&G.commonjsGlobal.__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=Na;Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return r.concat}});var o=wa;Object.defineProperty(e,"DefaultValueProducer",{enumerable:!0,get:function(){return o.DefaultValueProducer}});var h=Ea;Object.defineProperty(e,"dropDuplicates",{enumerable:!0,get:function(){return h.dropDuplicates}});var v=mt;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(Kn,e);var C=Ua;Object.defineProperty(e,"ValueAndUpdates",{enumerable:!0,get:function(){return C.ValueAndUpdates}})})(ji);Object.defineProperty(Ca,"__esModule",{value:!0});Ca.QueryClient=void 0;const _t=G.build$3,Mt=ae,uk=ji,Ke=Re;function Ro(e,n,t){if(e.type!==n)throw new Error(`Op expected to be ${n}, got "${e.type}`);if(!(0,Ke.arrayContentEquals)(t,e.key))throw new Error(`Proven key different than queried key.
2
2
  Query: ${(0,Mt.toHex)(t)}
3
3
  Proven: ${(0,Mt.toHex)(e.key)}`);return _t.ics23.CommitmentProof.decode(e.data)}class ec{static withExtensions(n,...t){const r=new ec(n),o=t.map(h=>h(r));for(const h of o){(0,Ke.assert)((0,Ke.isNonNullObject)(h),"Extension must be a non-null object");for(const[v,C]of Object.entries(h)){(0,Ke.assert)((0,Ke.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=Ro(h.ops[0],"ics23:iavl",t),D=Ro(h.ops[1],"ics23:simple",(0,Mt.toAscii)(n));(0,Ke.assert)(D.exist),(0,Ke.assert)(D.exist.value),!C||C.length===0?((0,Ke.assert)(w.nonexist),(0,_t.verifyNonExistence)(w.nonexist,_t.iavlSpec,D.exist.value,t)):((0,Ke.assert)(w.exist),(0,Ke.assert)(w.exist.value),(0,_t.verifyExistence)(w.exist,_t.iavlSpec,D.exist.value,t,C));const J=await this.getNextHeader(o);return(0,_t.verifyExistence)(D.exist,_t.tendermintSpec,J.appHash,(0,Mt.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,Ke.arrayContentEquals)(t,o))throw new Error(`Response key ${(0,Mt.toHex)(o)} doesn't match query key ${(0,Mt.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 Ro(C.ops[0],"ics23:iavl",o),Ro(C.ops[1],"ics23:simple",(0,Mt.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,Ke.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,uk.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,Ke.sleep)(1e3)}return(0,Ke.assert)(r.height===t,"Got wrong header. This is a bug in the logic above."),r}}Ca.QueryClient=ec;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});gn.decodeCosmosSdkDecFromProto=gn.longify=gn.createProtobufRpcClient=gn.createPagination=gn.toAccAddress=void 0;const Kp=ae,zp=be,Bl=Se;function ck(e){return(0,Kp.fromBech32)(e).data}gn.toAccAddress=ck;function lk(e){return e?Bl.PageRequest.fromPartial({key:e}):Bl.PageRequest.fromPartial({})}gn.createPagination=lk;function fk(e){return{request:async(n,t,r)=>{const o=`/${n}/${t}`;return(await e.queryAbci(o,r,void 0)).value}}}gn.createProtobufRpcClient=fk;function pk(e){const n=zp.Uint64.fromString(e.toString());return BigInt(n.toString())}gn.longify=pk;function mk(e){const n=typeof e=="string"?e:(0,Kp.fromAscii)(e);return zp.Decimal.fromAtomics(n,18)}gn.decodeCosmosSdkDecFromProto=mk;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.longify=e.decodeCosmosSdkDecFromProto=e.createProtobufRpcClient=e.createPagination=e.QueryClient=void 0;var n=Ca;Object.defineProperty(e,"QueryClient",{enumerable:!0,get:function(){return n.QueryClient}});var t=gn;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}})})(We);Object.defineProperty(Ta,"__esModule",{value:!0});Ta.setupAuthExtension=void 0;const yk=ju,hk=We;function gk(e){const n=(0,hk.createProtobufRpcClient)(e),t=new yk.QueryClientImpl(n);return{auth:{account:async r=>{const{account:o}=await t.Account({address:r});return o??null}}}}Ta.setupAuthExtension=gk;var Ja={};Object.defineProperty(Ja,"__esModule",{value:!0});Ja.createAuthzAminoConverters=void 0;function Sk(){return{}}Ja.createAuthzAminoConverters=Sk;var Da={},nc={},an={};Object.defineProperty(an,"__esModule",{value:!0});an.GrantQueueItem=an.GrantAuthorization=an.Grant=an.GenericAuthorization=an.protobufPackage=void 0;const Wn=G.any,Ar=G.timestamp,Tn=G.binary,Un=G.helpers;an.protobufPackage="cosmos.authz.v1beta1";function fd(){return{msg:""}}an.GenericAuthorization={typeUrl:"/cosmos.authz.v1beta1.GenericAuthorization",encode(e,n=Tn.BinaryWriter.create()){return e.msg!==""&&n.uint32(10).string(e.msg),n},decode(e,n){const t=e instanceof Tn.BinaryReader?e:new Tn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=fd();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=fd();return(0,Un.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=fd();return n.msg=e.msg??"",n}};function pd(){return{authorization:void 0,expiration:void 0}}an.Grant={typeUrl:"/cosmos.authz.v1beta1.Grant",encode(e,n=Tn.BinaryWriter.create()){return e.authorization!==void 0&&Wn.Any.encode(e.authorization,n.uint32(10).fork()).ldelim(),e.expiration!==void 0&&Ar.Timestamp.encode(e.expiration,n.uint32(18).fork()).ldelim(),n},decode(e,n){const t=e instanceof Tn.BinaryReader?e:new Tn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=pd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.authorization=Wn.Any.decode(t,t.uint32());break;case 2:o.expiration=Ar.Timestamp.decode(t,t.uint32());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=pd();return(0,Un.isSet)(e.authorization)&&(n.authorization=Wn.Any.fromJSON(e.authorization)),(0,Un.isSet)(e.expiration)&&(n.expiration=(0,Un.fromJsonTimestamp)(e.expiration)),n},toJSON(e){const n={};return e.authorization!==void 0&&(n.authorization=e.authorization?Wn.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(n.expiration=(0,Un.fromTimestamp)(e.expiration).toISOString()),n},fromPartial(e){const n=pd();return e.authorization!==void 0&&e.authorization!==null&&(n.authorization=Wn.Any.fromPartial(e.authorization)),e.expiration!==void 0&&e.expiration!==null&&(n.expiration=Ar.Timestamp.fromPartial(e.expiration)),n}};function md(){return{granter:"",grantee:"",authorization:void 0,expiration:void 0}}an.GrantAuthorization={typeUrl:"/cosmos.authz.v1beta1.GrantAuthorization",encode(e,n=Tn.BinaryWriter.create()){return e.granter!==""&&n.uint32(10).string(e.granter),e.grantee!==""&&n.uint32(18).string(e.grantee),e.authorization!==void 0&&Wn.Any.encode(e.authorization,n.uint32(26).fork()).ldelim(),e.expiration!==void 0&&Ar.Timestamp.encode(e.expiration,n.uint32(34).fork()).ldelim(),n},decode(e,n){const t=e instanceof Tn.BinaryReader?e:new Tn.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.granter=t.string();break;case 2:o.grantee=t.string();break;case 3:o.authorization=Wn.Any.decode(t,t.uint32());break;case 4:o.expiration=Ar.Timestamp.decode(t,t.uint32());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=md();return(0,Un.isSet)(e.granter)&&(n.granter=String(e.granter)),(0,Un.isSet)(e.grantee)&&(n.grantee=String(e.grantee)),(0,Un.isSet)(e.authorization)&&(n.authorization=Wn.Any.fromJSON(e.authorization)),(0,Un.isSet)(e.expiration)&&(n.expiration=(0,Un.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?Wn.Any.toJSON(e.authorization):void 0),e.expiration!==void 0&&(n.expiration=(0,Un.fromTimestamp)(e.expiration).toISOString()),n},fromPartial(e){const n=md();return n.granter=e.granter??"",n.grantee=e.grantee??"",e.authorization!==void 0&&e.authorization!==null&&(n.authorization=Wn.Any.fromPartial(e.authorization)),e.expiration!==void 0&&e.expiration!==null&&(n.expiration=Ar.Timestamp.fromPartial(e.expiration)),n}};function yd(){return{msgTypeUrls:[]}}an.GrantQueueItem={typeUrl:"/cosmos.authz.v1beta1.GrantQueueItem",encode(e,n=Tn.BinaryWriter.create()){for(const t of e.msgTypeUrls)n.uint32(10).string(t);return n},decode(e,n){const t=e instanceof Tn.BinaryReader?e:new Tn.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.msgTypeUrls.push(t.string());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=yd();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=yd();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=an,t=G.any,r=G.binary,o=G.helpers;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})(nc);Object.defineProperty(Da,"__esModule",{value:!0});Da.authzTypes=void 0;const hd=nc;Da.authzTypes=[["/cosmos.authz.v1beta1.MsgExec",hd.MsgExec],["/cosmos.authz.v1beta1.MsgGrant",hd.MsgGrant],["/cosmos.authz.v1beta1.MsgRevoke",hd.MsgRevoke]];var Ma={},tc={};(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=Se,t=an,r=G.binary,o=G.helpers;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})(tc);Object.defineProperty(Ma,"__esModule",{value:!0});Ma.setupAuthzExtension=void 0;const kk=tc,vo=We;function Pk(e){const n=(0,vo.createProtobufRpcClient)(e),t=new kk.QueryClientImpl(n);return{authz:{grants:async(r,o,h,v)=>await t.Grants({granter:r,grantee:o,msgTypeUrl:h,pagination:(0,vo.createPagination)(v)}),granteeGrants:async(r,o)=>await t.GranteeGrants({grantee:r,pagination:(0,vo.createPagination)(o)}),granterGrants:async(r,o)=>await t.GranterGrants({granter:r,pagination:(0,vo.createPagination)(o)})}}}Ma.setupAuthzExtension=Pk;var yt={};Object.defineProperty(yt,"__esModule",{value:!0});yt.createBankAminoConverters=yt.isAminoMsgMultiSend=yt.isAminoMsgSend=void 0;function Rk(e){return e.type==="cosmos-sdk/MsgSend"}yt.isAminoMsgSend=Rk;function vk(e){return e.type==="cosmos-sdk/MsgMultiSend"}yt.isAminoMsgMultiSend=vk;function Bk(){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]}))})}}}yt.createBankAminoConverters=Bk;var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0});Lr.isMsgSendEncodeObject=Lr.bankTypes=void 0;const bl=ba;Lr.bankTypes=[["/cosmos.bank.v1beta1.MsgMultiSend",bl.MsgMultiSend],["/cosmos.bank.v1beta1.MsgSend",bl.MsgSend]];function bk(e){return e.typeUrl==="/cosmos.bank.v1beta1.MsgSend"}Lr.isMsgSendEncodeObject=bk;var qa={},rc={};(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=Se,t=G.coin,r=Zu,o=G.binary,h=G.helpers;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})(rc);Object.defineProperty(qa,"__esModule",{value:!0});qa.setupBankExtension=void 0;const gd=Re,Sd=rc,Ol=We;function Ok(e){const n=(0,Ol.createProtobufRpcClient)(e),t=new Sd.QueryClientImpl(n);return{bank:{balance:async(r,o)=>{const{balance:h}=await t.Balance({address:r,denom:o});return(0,gd.assert)(h),h},allBalances:async r=>{const{balances:o}=await t.AllBalances(Sd.QueryAllBalancesRequest.fromPartial({address:r}));return o},totalSupply:async r=>await t.TotalSupply({pagination:(0,Ol.createPagination)(r)}),supplyOf:async r=>{const{amount:o}=await t.SupplyOf({denom:r});return(0,gd.assert)(o),o},denomMetadata:async r=>{const{metadata:o}=await t.DenomMetadata({denom:r});return(0,gd.assert)(o),o},denomsMetadata:async()=>{const{metadatas:r}=await t.DenomsMetadata(Sd.QueryDenomsMetadataRequest.fromPartial({pagination:void 0}));return r}}}}qa.setupBankExtension=Ok;var $r={};Object.defineProperty($r,"__esModule",{value:!0});$r.createCrysisAminoConverters=$r.isAminoMsgVerifyInvariant=void 0;function Ak(e){return e.type==="cosmos-sdk/MsgVerifyInvariant"}$r.isAminoMsgVerifyInvariant=Ak;function Ik(){throw new Error("Not implemented")}$r.createCrysisAminoConverters=Ik;var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.createDistributionAminoConverters=Sn.isAminoMsgFundCommunityPool=Sn.isAminoMsgWithdrawValidatorCommission=Sn.isAminoMsgWithdrawDelegatorReward=Sn.isAminoMsgSetWithdrawAddress=void 0;function Tk(e){return e.type==="cosmos-sdk/MsgModifyWithdrawAddress"}Sn.isAminoMsgSetWithdrawAddress=Tk;function Ck(e){return e.type==="cosmos-sdk/MsgWithdrawDelegationReward"}Sn.isAminoMsgWithdrawDelegatorReward=Ck;function Nk(e){return e.type==="cosmos-sdk/MsgWithdrawValidatorCommission"}Sn.isAminoMsgWithdrawValidatorCommission=Nk;function wk(e){return e.type==="cosmos-sdk/MsgFundCommunityPool"}Sn.isAminoMsgFundCommunityPool=wk;function Ek(){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})}}}Sn.createDistributionAminoConverters=Ek;var Kr={},eo={},ic={};(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=G.coin,t=G.binary,r=G.helpers;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}}})(ic);(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=G.coin,t=ic,r=G.binary,o=G.helpers;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})(eo);Object.defineProperty(Kr,"__esModule",{value:!0});Kr.isMsgWithdrawDelegatorRewardEncodeObject=Kr.distributionTypes=void 0;const Bo=eo;Kr.distributionTypes=[["/cosmos.distribution.v1beta1.MsgFundCommunityPool",Bo.MsgFundCommunityPool],["/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",Bo.MsgSetWithdrawAddress],["/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",Bo.MsgWithdrawDelegatorReward],["/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission",Bo.MsgWithdrawValidatorCommission]];function _k(e){return e.typeUrl==="/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward"}Kr.isMsgWithdrawDelegatorRewardEncodeObject=_k;var Ha={},oc={};(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=Se,t=ic,r=G.coin,o=G.binary,h=G.helpers;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})(oc);Object.defineProperty(Ha,"__esModule",{value:!0});Ha.setupDistributionExtension=void 0;const Uk=oc,Al=We;function Jk(e){const n=(0,Al.createProtobufRpcClient)(e),t=new Uk.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,Al.createPagination)(v)})}}}Ha.setupDistributionExtension=Jk;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});zr.createEvidenceAminoConverters=zr.isAminoMsgSubmitEvidence=void 0;function Dk(e){return e.type==="cosmos-sdk/MsgSubmitEvidence"}zr.isAminoMsgSubmitEvidence=Dk;function Mk(){throw new Error("Not implemented")}zr.createEvidenceAminoConverters=Mk;var Va={};Object.defineProperty(Va,"__esModule",{value:!0});Va.createFeegrantAminoConverters=void 0;function qk(){return{}}Va.createFeegrantAminoConverters=qk;var Qa={},ac={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MsgClientImpl=e.MsgRevokeAllowanceResponse=e.MsgRevokeAllowance=e.MsgGrantAllowanceResponse=e.MsgGrantAllowance=e.protobufPackage=void 0;const n=G.any,t=G.binary,r=G.helpers;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})(ac);Object.defineProperty(Qa,"__esModule",{value:!0});Qa.feegrantTypes=void 0;const Il=ac;Qa.feegrantTypes=[["/cosmos.feegrant.v1beta1.MsgGrantAllowance",Il.MsgGrantAllowance],["/cosmos.feegrant.v1beta1.MsgRevokeAllowance",Il.MsgRevokeAllowance]];var Wa={},sc={},Yp={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.Duration=cn.protobufPackage=void 0;const kd=G.binary,Tl=G.helpers;cn.protobufPackage="google.protobuf";function Pd(){return{seconds:BigInt(0),nanos:0}}cn.Duration={typeUrl:"/google.protobuf.Duration",encode(e,n=kd.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 kd.BinaryReader?e:new kd.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Pd();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=Pd();return(0,Tl.isSet)(e.seconds)&&(n.seconds=BigInt(e.seconds.toString())),(0,Tl.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=Pd();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=G.coin,t=G.timestamp,r=cn,o=G.any,h=G.binary,v=G.helpers;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}}})(Yp);(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=Se,t=Yp,r=G.binary,o=G.helpers;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})(sc);Object.defineProperty(Wa,"__esModule",{value:!0});Wa.setupFeegrantExtension=void 0;const Hk=sc,Cl=We;function Vk(e){const n=(0,Cl.createProtobufRpcClient)(e),t=new Hk.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,Cl.createPagination)(o)})}}}Wa.setupFeegrantExtension=Vk;var kn={},no={};(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=G.coin,t=G.any,r=G.timestamp,o=cn,h=G.binary,v=G.helpers;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}}})(no);Object.defineProperty(kn,"__esModule",{value:!0});kn.createGovAminoConverters=kn.isAminoMsgDeposit=kn.isAminoMsgVoteWeighted=kn.isAminoMsgVote=kn.isAminoMsgSubmitProposal=void 0;const Qk=be,vi=Re,Bi=no,Wk=G.any,Gk=We;function Fk(e){return e.type==="cosmos-sdk/MsgSubmitProposal"}kn.isAminoMsgSubmitProposal=Fk;function Lk(e){return e.type==="cosmos-sdk/MsgVote"}kn.isAminoMsgVote=Lk;function $k(e){return e.type==="cosmos-sdk/MsgVoteWeighted"}kn.isAminoMsgVoteWeighted=$k;function Kk(e){return e.type==="cosmos-sdk/MsgDeposit"}kn.isAminoMsgDeposit=Kk;function zk(){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,Bi.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,Gk.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,Bi.voteOptionFromJSON)(r.option),weight:Qk.Decimal.fromUserInput(r.weight,18).atomics}))})},"/cosmos.gov.v1beta1.MsgSubmitProposal":{aminoType:"cosmos-sdk/MsgSubmitProposal",toAmino:({initialDeposit:e,proposer:n,content:t})=>{(0,vi.assertDefinedAndNotNull)(t);let r;switch(t.typeUrl){case"/cosmos.gov.v1beta1.TextProposal":{const o=Bi.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,vi.assert)((0,vi.isNonNullObject)(o));const{title:h,description:v}=o;(0,vi.assert)(typeof h=="string"),(0,vi.assert)(typeof v=="string"),r=Wk.Any.fromPartial({typeUrl:"/cosmos.gov.v1beta1.TextProposal",value:Bi.TextProposal.encode(Bi.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}}}}}kn.createGovAminoConverters=zk;var Pn={},dc={},Zp={};(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=G.coin,t=G.any,r=G.timestamp,o=cn,h=G.binary,v=G.helpers;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}}})(Zp);(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=G.any,t=G.coin,r=Zp,o=G.binary,h=G.helpers;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})(dc);var uc={};(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=G.any,t=G.coin,r=no,o=G.binary,h=G.helpers;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})(uc);Object.defineProperty(Pn,"__esModule",{value:!0});Pn.isMsgVoteWeightedEncodeObject=Pn.isMsgVoteEncodeObject=Pn.isMsgSubmitProposalEncodeObject=Pn.isMsgDepositEncodeObject=Pn.govTypes=void 0;const bi=dc,bo=uc;Pn.govTypes=[["/cosmos.gov.v1.MsgDeposit",bi.MsgDeposit],["/cosmos.gov.v1.MsgSubmitProposal",bi.MsgSubmitProposal],["/cosmos.gov.v1.MsgUpdateParams",bi.MsgUpdateParams],["/cosmos.gov.v1.MsgVote",bi.MsgVote],["/cosmos.gov.v1.MsgVoteWeighted",bi.MsgVoteWeighted],["/cosmos.gov.v1beta1.MsgDeposit",bo.MsgDeposit],["/cosmos.gov.v1beta1.MsgSubmitProposal",bo.MsgSubmitProposal],["/cosmos.gov.v1beta1.MsgVote",bo.MsgVote],["/cosmos.gov.v1beta1.MsgVoteWeighted",bo.MsgVoteWeighted]];function Yk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgDeposit"}Pn.isMsgDepositEncodeObject=Yk;function Zk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgSubmitProposal"}Pn.isMsgSubmitProposalEncodeObject=Zk;function Xk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVote"}Pn.isMsgVoteEncodeObject=Xk;function xk(e){return e.typeUrl==="/cosmos.gov.v1beta1.MsgVoteWeighted"}Pn.isMsgVoteWeightedEncodeObject=xk;var Ga={},cc={};(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=no,t=Se,r=G.binary,o=G.helpers;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})(cc);Object.defineProperty(Ga,"__esModule",{value:!0});Ga.setupGovExtension=void 0;const jk=cc,Vn=We;function eP(e){const n=(0,Vn.createProtobufRpcClient)(e),t=new jk.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,Vn.createPagination)(v)}),proposal:async r=>await t.Proposal({proposalId:(0,Vn.longify)(r)}),deposits:async(r,o)=>await t.Deposits({proposalId:(0,Vn.longify)(r),pagination:(0,Vn.createPagination)(o)}),deposit:async(r,o)=>await t.Deposit({proposalId:(0,Vn.longify)(r),depositor:o}),tally:async r=>await t.TallyResult({proposalId:(0,Vn.longify)(r)}),votes:async(r,o)=>await t.Votes({proposalId:(0,Vn.longify)(r),pagination:(0,Vn.createPagination)(o)}),vote:async(r,o)=>await t.Vote({proposalId:(0,Vn.longify)(r),voter:o})}}}Ga.setupGovExtension=eP;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});Fa.createGroupAminoConverters=void 0;function nP(){return{}}Fa.createGroupAminoConverters=nP;var La={},lc={},Xp={};(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=G.timestamp,t=cn,r=G.any,o=G.binary,h=G.helpers;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}}})(Xp);(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=Xp,t=G.any,r=G.binary,o=G.helpers;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 $=O===void 0?W.len:W.pos+O;const L=w();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.members.push(n.MemberRequest.decode(W,W.uint32()));break;case 3:L.metadata=W.string();break;default:W.skipType(x&7);break}}return L},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($=>n.MemberRequest.fromPartial($)))||[],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 $=O===void 0?W.len:W.pos+O;const L=D();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.groupId=W.uint64();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=J();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupId=W.uint64();break;case 3:L.memberUpdates.push(n.MemberRequest.decode(W,W.uint32()));break;default:W.skipType(x&7);break}}return L},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($=>n.MemberRequest.fromPartial($)))||[],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 $=O===void 0?W.len:W.pos+O;const L=I();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=g();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupId=W.uint64();break;case 3:L.newAdmin=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=R();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=B();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupId=W.uint64();break;case 3:L.metadata=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=d();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=s();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupId=W.uint64();break;case 3:L.metadata=W.string();break;case 4:L.decisionPolicy=t.Any.decode(W,W.uint32());break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=y();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.address=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=E();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupPolicyAddress=W.string();break;case 3:L.newAdmin=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=_();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=U();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.members.push(n.MemberRequest.decode(W,W.uint32()));break;case 3:L.groupMetadata=W.string();break;case 4:L.groupPolicyMetadata=W.string();break;case 5:L.groupPolicyAsAdmin=W.bool();break;case 6:L.decisionPolicy=t.Any.decode(W,W.uint32());break;default:W.skipType(x&7);break}}return L},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($=>n.MemberRequest.fromPartial($)))||[],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 $=O===void 0?W.len:W.pos+O;const L=H();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.groupId=W.uint64();break;case 2:L.groupPolicyAddress=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=i();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupPolicyAddress=W.string();break;case 3:L.decisionPolicy=t.Any.decode(W,W.uint32());break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=m();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=N();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.admin=W.string();break;case 2:L.groupPolicyAddress=W.string();break;case 3:L.metadata=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=V();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=u();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.groupPolicyAddress=W.string();break;case 2:L.proposers.push(W.string());break;case 3:L.metadata=W.string();break;case 4:L.messages.push(t.Any.decode(W,W.uint32()));break;case 5:L.exec=W.int32();break;case 6:L.title=W.string();break;case 7:L.summary=W.string();break;default:W.skipType(x&7);break}}return L},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,$;const O=u();return O.groupPolicyAddress=P.groupPolicyAddress??"",O.proposers=((W=P.proposers)==null?void 0:W.map(L=>L))||[],O.metadata=P.metadata??"",O.messages=(($=P.messages)==null?void 0:$.map(L=>t.Any.fromPartial(L)))||[],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 $=O===void 0?W.len:W.pos+O;const L=l();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.proposalId=W.uint64();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=T();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.proposalId=W.uint64();break;case 2:L.address=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=f();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=p();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.proposalId=W.uint64();break;case 2:L.voter=W.string();break;case 3:L.option=W.int32();break;case 4:L.metadata=W.string();break;case 5:L.exec=W.int32();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=A();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=Q();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.proposalId=W.uint64();break;case 2:L.executor=W.string();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=M();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 2:L.result=W.int32();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=a();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){case 1:L.address=W.string();break;case 2:L.groupId=W.uint64();break;default:W.skipType(x&7);break}}return L},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 $=O===void 0?W.len:W.pos+O;const L=k();for(;W.pos<$;){const x=W.uint32();switch(x>>>3){default:W.skipType(x&7);break}}return L},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(L=>e.MsgCreateGroupResponse.decode(new r.BinaryReader(L)))}UpdateGroupMembers(O){const W=e.MsgUpdateGroupMembers.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupMembers",W).then(L=>e.MsgUpdateGroupMembersResponse.decode(new r.BinaryReader(L)))}UpdateGroupAdmin(O){const W=e.MsgUpdateGroupAdmin.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupAdmin",W).then(L=>e.MsgUpdateGroupAdminResponse.decode(new r.BinaryReader(L)))}UpdateGroupMetadata(O){const W=e.MsgUpdateGroupMetadata.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupMetadata",W).then(L=>e.MsgUpdateGroupMetadataResponse.decode(new r.BinaryReader(L)))}CreateGroupPolicy(O){const W=e.MsgCreateGroupPolicy.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroupPolicy",W).then(L=>e.MsgCreateGroupPolicyResponse.decode(new r.BinaryReader(L)))}CreateGroupWithPolicy(O){const W=e.MsgCreateGroupWithPolicy.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","CreateGroupWithPolicy",W).then(L=>e.MsgCreateGroupWithPolicyResponse.decode(new r.BinaryReader(L)))}UpdateGroupPolicyAdmin(O){const W=e.MsgUpdateGroupPolicyAdmin.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyAdmin",W).then(L=>e.MsgUpdateGroupPolicyAdminResponse.decode(new r.BinaryReader(L)))}UpdateGroupPolicyDecisionPolicy(O){const W=e.MsgUpdateGroupPolicyDecisionPolicy.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyDecisionPolicy",W).then(L=>e.MsgUpdateGroupPolicyDecisionPolicyResponse.decode(new r.BinaryReader(L)))}UpdateGroupPolicyMetadata(O){const W=e.MsgUpdateGroupPolicyMetadata.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","UpdateGroupPolicyMetadata",W).then(L=>e.MsgUpdateGroupPolicyMetadataResponse.decode(new r.BinaryReader(L)))}SubmitProposal(O){const W=e.MsgSubmitProposal.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","SubmitProposal",W).then(L=>e.MsgSubmitProposalResponse.decode(new r.BinaryReader(L)))}WithdrawProposal(O){const W=e.MsgWithdrawProposal.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","WithdrawProposal",W).then(L=>e.MsgWithdrawProposalResponse.decode(new r.BinaryReader(L)))}Vote(O){const W=e.MsgVote.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","Vote",W).then(L=>e.MsgVoteResponse.decode(new r.BinaryReader(L)))}Exec(O){const W=e.MsgExec.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","Exec",W).then(L=>e.MsgExecResponse.decode(new r.BinaryReader(L)))}LeaveGroup(O){const W=e.MsgLeaveGroup.encode(O).finish();return this.rpc.request("cosmos.group.v1.Msg","LeaveGroup",W).then(L=>e.MsgLeaveGroupResponse.decode(new r.BinaryReader(L)))}}e.MsgClientImpl=S})(lc);Object.defineProperty(La,"__esModule",{value:!0});La.groupTypes=void 0;const Ge=lc;La.groupTypes=[["/cosmos.group.v1.MsgCreateGroup",Ge.MsgCreateGroup],["/cosmos.group.v1.MsgCreateGroupPolicy",Ge.MsgCreateGroupPolicy],["/cosmos.group.v1.MsgCreateGroupWithPolicy",Ge.MsgCreateGroupWithPolicy],["/cosmos.group.v1.MsgExec",Ge.MsgExec],["/cosmos.group.v1.MsgLeaveGroup",Ge.MsgLeaveGroup],["/cosmos.group.v1.MsgSubmitProposal",Ge.MsgSubmitProposal],["/cosmos.group.v1.MsgUpdateGroupAdmin",Ge.MsgUpdateGroupAdmin],["/cosmos.group.v1.MsgUpdateGroupMembers",Ge.MsgUpdateGroupMembers],["/cosmos.group.v1.MsgUpdateGroupMetadata",Ge.MsgUpdateGroupMetadata],["/cosmos.group.v1.MsgUpdateGroupPolicyAdmin",Ge.MsgUpdateGroupPolicyAdmin],["/cosmos.group.v1.MsgUpdateGroupPolicyDecisionPolicy",Ge.MsgUpdateGroupPolicyDecisionPolicy],["/cosmos.group.v1.MsgUpdateGroupPolicyMetadata",Ge.MsgUpdateGroupPolicyMetadata],["/cosmos.group.v1.MsgVote",Ge.MsgVote],["/cosmos.group.v1.MsgWithdrawProposal",Ge.MsgWithdrawProposal]];var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.createIbcAminoConverters=Yr.isAminoMsgTransfer=void 0;const Oo=Hn,tP=G.tx;function rP(e){return e.type==="cosmos-sdk/MsgTransfer"}Yr.isAminoMsgTransfer=rP;function iP(){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,Oo.omitDefault)(h.revisionHeight))==null?void 0:w.toString(),revision_number:(D=(0,Oo.omitDefault)(h.revisionNumber))==null?void 0:D.toString()}:{},timeout_timestamp:(J=(0,Oo.omitDefault)(v))==null?void 0:J.toString(),memo:(0,Oo.omitDefault)(C)}},fromAmino:({source_port:e,source_channel:n,token:t,sender:r,receiver:o,timeout_height:h,timeout_timestamp:v,memo:C})=>tP.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??""})}}}Yr.createIbcAminoConverters=iP;var Zr={},fc={},to={};(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=G.client,t=G.binary,r=G.helpers;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}}})(to);(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=to,t=G.client,r=G.binary,o=G.helpers;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})(fc);var pc={};(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=G.any,t=G.binary,r=G.helpers;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})(pc);var mc={},yc={},sn={},hc={};(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=G.binary,t=G.helpers;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}}})(hc);Object.defineProperty(sn,"__esModule",{value:!0});sn.MerkleProof=sn.MerklePath=sn.MerklePrefix=sn.MerkleRoot=sn.protobufPackage=void 0;const Oi=hc,Cn=G.binary,Ir=G.helpers;sn.protobufPackage="ibc.core.commitment.v1";function Rd(){return{hash:new Uint8Array}}sn.MerkleRoot={typeUrl:"/ibc.core.commitment.v1.MerkleRoot",encode(e,n=Cn.BinaryWriter.create()){return e.hash.length!==0&&n.uint32(10).bytes(e.hash),n},decode(e,n){const t=e instanceof Cn.BinaryReader?e:new Cn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Rd();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=Rd();return(0,Ir.isSet)(e.hash)&&(n.hash=(0,Ir.bytesFromBase64)(e.hash)),n},toJSON(e){const n={};return e.hash!==void 0&&(n.hash=(0,Ir.base64FromBytes)(e.hash!==void 0?e.hash:new Uint8Array)),n},fromPartial(e){const n=Rd();return n.hash=e.hash??new Uint8Array,n}};function vd(){return{keyPrefix:new Uint8Array}}sn.MerklePrefix={typeUrl:"/ibc.core.commitment.v1.MerklePrefix",encode(e,n=Cn.BinaryWriter.create()){return e.keyPrefix.length!==0&&n.uint32(10).bytes(e.keyPrefix),n},decode(e,n){const t=e instanceof Cn.BinaryReader?e:new Cn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=vd();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=vd();return(0,Ir.isSet)(e.keyPrefix)&&(n.keyPrefix=(0,Ir.bytesFromBase64)(e.keyPrefix)),n},toJSON(e){const n={};return e.keyPrefix!==void 0&&(n.keyPrefix=(0,Ir.base64FromBytes)(e.keyPrefix!==void 0?e.keyPrefix:new Uint8Array)),n},fromPartial(e){const n=vd();return n.keyPrefix=e.keyPrefix??new Uint8Array,n}};function Bd(){return{keyPath:[]}}sn.MerklePath={typeUrl:"/ibc.core.commitment.v1.MerklePath",encode(e,n=Cn.BinaryWriter.create()){for(const t of e.keyPath)n.uint32(10).string(t);return n},decode(e,n){const t=e instanceof Cn.BinaryReader?e:new Cn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Bd();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=Bd();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=Bd();return n.keyPath=((t=e.keyPath)==null?void 0:t.map(r=>r))||[],n}};function bd(){return{proofs:[]}}sn.MerkleProof={typeUrl:"/ibc.core.commitment.v1.MerkleProof",encode(e,n=Cn.BinaryWriter.create()){for(const t of e.proofs)Oi.CommitmentProof.encode(t,n.uint32(10).fork()).ldelim();return n},decode(e,n){const t=e instanceof Cn.BinaryReader?e:new Cn.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=bd();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:o.proofs.push(Oi.CommitmentProof.decode(t,t.uint32()));break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=bd();return Array.isArray(e==null?void 0:e.proofs)&&(n.proofs=e.proofs.map(t=>Oi.CommitmentProof.fromJSON(t))),n},toJSON(e){const n={};return e.proofs?n.proofs=e.proofs.map(t=>t?Oi.CommitmentProof.toJSON(t):void 0):n.proofs=[],n},fromPartial(e){var t;const n=bd();return n.proofs=((t=e.proofs)==null?void 0:t.map(r=>Oi.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=sn,t=G.binary,r=G.helpers;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}}})(yc);(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=yc,t=G.any,r=G.client,o=G.binary,h=G.helpers;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})(mc);Object.defineProperty(Zr,"__esModule",{value:!0});Zr.isMsgTransferEncodeObject=Zr.ibcTypes=void 0;const oP=G.tx,Qn=fc,Ao=pc,Io=mc;Zr.ibcTypes=[["/ibc.applications.transfer.v1.MsgTransfer",oP.MsgTransfer],["/ibc.core.channel.v1.MsgAcknowledgement",Qn.MsgAcknowledgement],["/ibc.core.channel.v1.MsgChannelCloseConfirm",Qn.MsgChannelCloseConfirm],["/ibc.core.channel.v1.MsgChannelCloseInit",Qn.MsgChannelCloseInit],["/ibc.core.channel.v1.MsgChannelOpenAck",Qn.MsgChannelOpenAck],["/ibc.core.channel.v1.MsgChannelOpenConfirm",Qn.MsgChannelOpenConfirm],["/ibc.core.channel.v1.MsgChannelOpenInit",Qn.MsgChannelOpenInit],["/ibc.core.channel.v1.MsgChannelOpenTry",Qn.MsgChannelOpenTry],["/ibc.core.channel.v1.MsgRecvPacket",Qn.MsgRecvPacket],["/ibc.core.channel.v1.MsgTimeout",Qn.MsgTimeout],["/ibc.core.channel.v1.MsgTimeoutOnClose",Qn.MsgTimeoutOnClose],["/ibc.core.client.v1.MsgCreateClient",Ao.MsgCreateClient],["/ibc.core.client.v1.MsgSubmitMisbehaviour",Ao.MsgSubmitMisbehaviour],["/ibc.core.client.v1.MsgUpdateClient",Ao.MsgUpdateClient],["/ibc.core.client.v1.MsgUpgradeClient",Ao.MsgUpgradeClient],["/ibc.core.connection.v1.MsgConnectionOpenAck",Io.MsgConnectionOpenAck],["/ibc.core.connection.v1.MsgConnectionOpenConfirm",Io.MsgConnectionOpenConfirm],["/ibc.core.connection.v1.MsgConnectionOpenInit",Io.MsgConnectionOpenInit],["/ibc.core.connection.v1.MsgConnectionOpenTry",Io.MsgConnectionOpenTry]];function aP(e){return e.typeUrl==="/ibc.applications.transfer.v1.MsgTransfer"}Zr.isMsgTransferEncodeObject=aP;var $a={},gc={},ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.Params=ht.DenomTrace=ht.protobufPackage=void 0;const Tr=G.binary,xo=G.helpers;ht.protobufPackage="ibc.applications.transfer.v1";function Od(){return{path:"",baseDenom:""}}ht.DenomTrace={typeUrl:"/ibc.applications.transfer.v1.DenomTrace",encode(e,n=Tr.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 Tr.BinaryReader?e:new Tr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Od();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=Od();return(0,xo.isSet)(e.path)&&(n.path=String(e.path)),(0,xo.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=Od();return n.path=e.path??"",n.baseDenom=e.baseDenom??"",n}};function Ad(){return{sendEnabled:!1,receiveEnabled:!1}}ht.Params={typeUrl:"/ibc.applications.transfer.v1.Params",encode(e,n=Tr.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 Tr.BinaryReader?e:new Tr.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.sendEnabled=t.bool();break;case 2:o.receiveEnabled=t.bool();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Ad();return(0,xo.isSet)(e.sendEnabled)&&(n.sendEnabled=!!e.sendEnabled),(0,xo.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=Ad();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=Se,t=ht,r=G.binary,o=G.helpers;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})(gc);var Sc={};(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=Se,t=to,r=G.client,o=G.any,h=G.binary,v=G.helpers;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 $=S.uint32()+S.pos;for(;S.pos<$;)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 $=S.uint32()+S.pos;for(;S.pos<$;)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 $=S.uint32()+S.pos;for(;S.pos<$;)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 $=S.uint32()+S.pos;for(;S.pos<$;)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 $=S.uint32()+S.pos;for(;S.pos<$;)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})(Sc);var kc={};(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=Se,t=G.any,r=G.client,o=G.binary,h=G.helpers;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})(kc);var Pc={};(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=Se,t=yc,r=G.client,o=G.any,h=G.binary,v=G.helpers;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=_})(Pc);var Rc={},Zt={},vc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProofOps=e.ProofOp=e.DominoOp=e.ValueOp=e.Proof=e.protobufPackage=void 0;const n=G.binary,t=G.helpers;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}}})(vc);var gt={};Object.defineProperty(gt,"__esModule",{value:!0});gt.Consensus=gt.App=gt.protobufPackage=void 0;const Cr=G.binary,jo=G.helpers;gt.protobufPackage="tendermint.version";function Id(){return{protocol:BigInt(0),software:""}}gt.App={typeUrl:"/tendermint.version.App",encode(e,n=Cr.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 Cr.BinaryReader?e:new Cr.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.protocol=t.uint64();break;case 2:o.software=t.string();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Id();return(0,jo.isSet)(e.protocol)&&(n.protocol=BigInt(e.protocol.toString())),(0,jo.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=Id();return e.protocol!==void 0&&e.protocol!==null&&(n.protocol=BigInt(e.protocol.toString())),n.software=e.software??"",n}};function Td(){return{block:BigInt(0),app:BigInt(0)}}gt.Consensus={typeUrl:"/tendermint.version.Consensus",encode(e,n=Cr.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 Cr.BinaryReader?e:new Cr.BinaryReader(e);let r=n===void 0?t.len:t.pos+n;const o=Td();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=Td();return(0,jo.isSet)(e.block)&&(n.block=BigInt(e.block.toString())),(0,jo.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=Td();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 Ka={},zt={};Object.defineProperty(zt,"__esModule",{value:!0});zt.PublicKey=zt.protobufPackage=void 0;const Cd=G.binary,rr=G.helpers;zt.protobufPackage="tendermint.crypto";function Nd(){return{ed25519:void 0,secp256k1:void 0}}zt.PublicKey={typeUrl:"/tendermint.crypto.PublicKey",encode(e,n=Cd.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 Cd.BinaryReader?e:new Cd.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.ed25519=t.bytes();break;case 2:o.secp256k1=t.bytes();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=Nd();return(0,rr.isSet)(e.ed25519)&&(n.ed25519=(0,rr.bytesFromBase64)(e.ed25519)),(0,rr.isSet)(e.secp256k1)&&(n.secp256k1=(0,rr.bytesFromBase64)(e.secp256k1)),n},toJSON(e){const n={};return e.ed25519!==void 0&&(n.ed25519=e.ed25519!==void 0?(0,rr.base64FromBytes)(e.ed25519):void 0),e.secp256k1!==void 0&&(n.secp256k1=e.secp256k1!==void 0?(0,rr.base64FromBytes)(e.secp256k1):void 0),n},fromPartial(e){const n=Nd();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=zt,t=G.binary,r=G.helpers;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}}})(Ka);(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=vc,t=gt,r=G.timestamp,o=Ka,h=G.binary,v=G.helpers;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}}})(Zt);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Fraction=e.Header=e.Misbehaviour=e.ConsensusState=e.ClientState=e.protobufPackage=void 0;const n=cn,t=G.client,r=hc,o=G.timestamp,h=sn,v=Zt,C=Ka,w=G.binary,D=G.helpers;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}}})(Rc);Object.defineProperty($a,"__esModule",{value:!0});$a.setupIbcExtension=void 0;const To=ae,sP=be,Nl=gc,dP=to,At=Sc,Ai=kc,wd=Pc,xp=Rc,ke=We;function Ed(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 xp.ClientState.decode(e.value)}function uP(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 xp.ConsensusState.decode(e.value)}function cP(e){const n=(0,ke.createProtobufRpcClient)(e),t=new At.QueryClientImpl(n),r=new Ai.QueryClientImpl(n),o=new wd.QueryClientImpl(n),h=new Nl.QueryClientImpl(n);return{ibc:{channel:{channel:async(v,C)=>t.Channel({portId:v,channelId:C}),channels:async v=>t.Channels({pagination:(0,ke.createPagination)(v)}),allChannels:async()=>{var D;const v=[];let C,w;do C=await t.Channels({pagination:(0,ke.createPagination)(w)}),v.push(...C.channels),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return At.QueryChannelsResponse.fromPartial({channels:v,height:C.height})},connectionChannels:async(v,C)=>t.ConnectionChannels({connection:v,pagination:(0,ke.createPagination)(C)}),allConnectionChannels:async v=>{var J;const C=[];let w,D;do w=await t.ConnectionChannels({connection:v,pagination:(0,ke.createPagination)(D)}),C.push(...w.channels),D=(J=w.pagination)==null?void 0:J.nextKey;while(D&&D.length);return At.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,ke.longify)(w)}),packetCommitments:async(v,C,w)=>t.PacketCommitments({channelId:C,portId:v,pagination:(0,ke.createPagination)(w)}),allPacketCommitments:async(v,C)=>{var I;const w=[];let D,J;do D=await t.PacketCommitments({channelId:C,portId:v,pagination:(0,ke.createPagination)(J)}),w.push(...D.commitments),J=(I=D.pagination)==null?void 0:I.nextKey;while(J&&J.length);return At.QueryPacketCommitmentsResponse.fromPartial({commitments:w,height:D.height})},packetReceipt:async(v,C,w)=>t.PacketReceipt({portId:v,channelId:C,sequence:(0,ke.longify)(w)}),packetAcknowledgement:async(v,C,w)=>t.PacketAcknowledgement({portId:v,channelId:C,sequence:(0,ke.longify)(w)}),packetAcknowledgements:async(v,C,w)=>{const D=At.QueryPacketAcknowledgementsRequest.fromPartial({portId:v,channelId:C,pagination:(0,ke.createPagination)(w)});return t.PacketAcknowledgements(D)},allPacketAcknowledgements:async(v,C)=>{var I;const w=[];let D,J;do{const g=At.QueryPacketAcknowledgementsRequest.fromPartial({channelId:C,portId:v,pagination:(0,ke.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 At.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,ke.createPagination)(v)}),allStates:async()=>{var D;const v=[];let C,w;do C=await r.ClientStates({pagination:(0,ke.createPagination)(w)}),v.push(...C.clientStates),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return Ai.QueryClientStatesResponse.fromPartial({clientStates:v})},consensusState:async(v,C)=>r.ConsensusState(Ai.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,ke.createPagination)(C)}),allConsensusStates:async v=>{var J;const C=[];let w,D;do w=await r.ConsensusStates({clientId:v,pagination:(0,ke.createPagination)(D)}),C.push(...w.consensusStates),D=(J=w.pagination)==null?void 0:J.nextKey;while(D&&D.length);return Ai.QueryConsensusStatesResponse.fromPartial({consensusStates:C})},params:async()=>r.ClientParams({}),stateTm:async v=>{const C=await r.ClientState({clientId:v});return Ed(C.clientState)},statesTm:async v=>{const{clientStates:C}=await r.ClientStates({pagination:(0,ke.createPagination)(v)});return C.map(({clientState:w})=>Ed(w))},allStatesTm:async()=>{var D;const v=[];let C,w;do C=await r.ClientStates({pagination:(0,ke.createPagination)(w)}),v.push(...C.clientStates),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return v.map(({clientState:J})=>Ed(J))},consensusStateTm:async(v,C)=>{const w=await r.ConsensusState(Ai.QueryConsensusStateRequest.fromPartial({clientId:v,revisionHeight:C==null?void 0:C.revisionHeight,revisionNumber:C==null?void 0:C.revisionNumber,latestHeight:C===void 0}));return uP(w.consensusState)}},connection:{connection:async v=>o.Connection({connectionId:v}),connections:async v=>o.Connections({pagination:(0,ke.createPagination)(v)}),allConnections:async()=>{var D;const v=[];let C,w;do C=await o.Connections({pagination:(0,ke.createPagination)(w)}),v.push(...C.connections),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return wd.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(wd.QueryConnectionConsensusStateRequest.fromPartial({connectionId:v,revisionHeight:BigInt(C)}))},transfer:{denomTrace:async v=>h.DenomTrace({hash:v}),denomTraces:async v=>h.DenomTraces({pagination:(0,ke.createPagination)(v)}),allDenomTraces:async()=>{var D;const v=[];let C,w;do C=await h.DenomTraces({pagination:(0,ke.createPagination)(w)}),v.push(...C.denomTraces),w=(D=C.pagination)==null?void 0:D.nextKey;while(w&&w.length);return Nl.QueryDenomTracesResponse.fromPartial({denomTraces:v})},params:async()=>h.Params({})},verified:{channel:{channel:async(v,C)=>{const w=(0,To.toAscii)(`channelEnds/ports/${v}/channels/${C}`),{value:D}=await e.queryStoreVerified("ibc",w);return D.length?dP.Channel.decode(D):null},packetCommitment:async(v,C,w)=>{const D=(0,To.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,To.toAscii)(`acks/ports/${v}/channels/${C}/acknowledgements/${w}`),{value:J}=await e.queryStoreVerified("ibc",D);return J},nextSequenceReceive:async(v,C)=>{const w=(0,To.toAscii)(`seqAcks/ports/${v}/channels/${C}/nextSequenceAck`),{value:D}=await e.queryStoreVerified("ibc",w);return D.length?sP.Uint64.fromBytes(D).toNumber():null}}}}}}$a.setupIbcExtension=cP;var za={},Bc={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.Params=St.Minter=St.protobufPackage=void 0;const Nr=G.binary,ut=G.helpers;St.protobufPackage="cosmos.mint.v1beta1";function _d(){return{inflation:"",annualProvisions:""}}St.Minter={typeUrl:"/cosmos.mint.v1beta1.Minter",encode(e,n=Nr.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 Nr.BinaryReader?e:new Nr.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.inflation=t.string();break;case 2:o.annualProvisions=t.string();break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=_d();return(0,ut.isSet)(e.inflation)&&(n.inflation=String(e.inflation)),(0,ut.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=_d();return n.inflation=e.inflation??"",n.annualProvisions=e.annualProvisions??"",n}};function Ud(){return{mintDenom:"",inflationRateChange:"",inflationMax:"",inflationMin:"",goalBonded:"",blocksPerYear:BigInt(0)}}St.Params={typeUrl:"/cosmos.mint.v1beta1.Params",encode(e,n=Nr.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 Nr.BinaryReader?e:new Nr.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.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=Ud();return(0,ut.isSet)(e.mintDenom)&&(n.mintDenom=String(e.mintDenom)),(0,ut.isSet)(e.inflationRateChange)&&(n.inflationRateChange=String(e.inflationRateChange)),(0,ut.isSet)(e.inflationMax)&&(n.inflationMax=String(e.inflationMax)),(0,ut.isSet)(e.inflationMin)&&(n.inflationMin=String(e.inflationMin)),(0,ut.isSet)(e.goalBonded)&&(n.goalBonded=String(e.goalBonded)),(0,ut.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=Ud();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=St,t=G.binary,r=G.helpers;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})(Bc);Object.defineProperty(za,"__esModule",{value:!0});za.setupMintExtension=void 0;const lP=Re,fP=Bc,It=We;function pP(e){const n=(0,It.createProtobufRpcClient)(e),t=new fP.QueryClientImpl(n);return{mint:{params:async()=>{const{params:r}=await t.Params({});return(0,lP.assert)(r),{blocksPerYear:r.blocksPerYear,goalBonded:(0,It.decodeCosmosSdkDecFromProto)(r.goalBonded),inflationMin:(0,It.decodeCosmosSdkDecFromProto)(r.inflationMin),inflationMax:(0,It.decodeCosmosSdkDecFromProto)(r.inflationMax),inflationRateChange:(0,It.decodeCosmosSdkDecFromProto)(r.inflationRateChange),mintDenom:r.mintDenom}},inflation:async()=>{const{inflation:r}=await t.Inflation({});return(0,It.decodeCosmosSdkDecFromProto)(r)},annualProvisions:async()=>{const{annualProvisions:r}=await t.AnnualProvisions({});return(0,It.decodeCosmosSdkDecFromProto)(r)}}}}za.setupMintExtension=pP;var Xr={};Object.defineProperty(Xr,"__esModule",{value:!0});Xr.createSlashingAminoConverters=Xr.isAminoMsgUnjail=void 0;function mP(e){return e.type==="cosmos-sdk/MsgUnjail"}Xr.isAminoMsgUnjail=mP;function yP(){throw new Error("Not implemented")}Xr.createSlashingAminoConverters=yP;var Ya={},bc={},kt={};Object.defineProperty(kt,"__esModule",{value:!0});kt.Params=kt.ValidatorSigningInfo=kt.protobufPackage=void 0;const Wo=G.timestamp,cr=cn,wr=G.binary,Ae=G.helpers;kt.protobufPackage="cosmos.slashing.v1beta1";function Jd(){return{address:"",startHeight:BigInt(0),indexOffset:BigInt(0),jailedUntil:Wo.Timestamp.fromPartial({}),tombstoned:!1,missedBlocksCounter:BigInt(0)}}kt.ValidatorSigningInfo={typeUrl:"/cosmos.slashing.v1beta1.ValidatorSigningInfo",encode(e,n=wr.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&&Wo.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 wr.BinaryReader?e:new wr.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.address=t.string();break;case 2:o.startHeight=t.int64();break;case 3:o.indexOffset=t.int64();break;case 4:o.jailedUntil=Wo.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=Jd();return(0,Ae.isSet)(e.address)&&(n.address=String(e.address)),(0,Ae.isSet)(e.startHeight)&&(n.startHeight=BigInt(e.startHeight.toString())),(0,Ae.isSet)(e.indexOffset)&&(n.indexOffset=BigInt(e.indexOffset.toString())),(0,Ae.isSet)(e.jailedUntil)&&(n.jailedUntil=(0,Ae.fromJsonTimestamp)(e.jailedUntil)),(0,Ae.isSet)(e.tombstoned)&&(n.tombstoned=!!e.tombstoned),(0,Ae.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,Ae.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=Jd();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=Wo.Timestamp.fromPartial(e.jailedUntil)),n.tombstoned=e.tombstoned??!1,e.missedBlocksCounter!==void 0&&e.missedBlocksCounter!==null&&(n.missedBlocksCounter=BigInt(e.missedBlocksCounter.toString())),n}};function Dd(){return{signedBlocksWindow:BigInt(0),minSignedPerWindow:new Uint8Array,downtimeJailDuration:cr.Duration.fromPartial({}),slashFractionDoubleSign:new Uint8Array,slashFractionDowntime:new Uint8Array}}kt.Params={typeUrl:"/cosmos.slashing.v1beta1.Params",encode(e,n=wr.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&&cr.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 wr.BinaryReader?e:new wr.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.signedBlocksWindow=t.int64();break;case 2:o.minSignedPerWindow=t.bytes();break;case 3:o.downtimeJailDuration=cr.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=Dd();return(0,Ae.isSet)(e.signedBlocksWindow)&&(n.signedBlocksWindow=BigInt(e.signedBlocksWindow.toString())),(0,Ae.isSet)(e.minSignedPerWindow)&&(n.minSignedPerWindow=(0,Ae.bytesFromBase64)(e.minSignedPerWindow)),(0,Ae.isSet)(e.downtimeJailDuration)&&(n.downtimeJailDuration=cr.Duration.fromJSON(e.downtimeJailDuration)),(0,Ae.isSet)(e.slashFractionDoubleSign)&&(n.slashFractionDoubleSign=(0,Ae.bytesFromBase64)(e.slashFractionDoubleSign)),(0,Ae.isSet)(e.slashFractionDowntime)&&(n.slashFractionDowntime=(0,Ae.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,Ae.base64FromBytes)(e.minSignedPerWindow!==void 0?e.minSignedPerWindow:new Uint8Array)),e.downtimeJailDuration!==void 0&&(n.downtimeJailDuration=e.downtimeJailDuration?cr.Duration.toJSON(e.downtimeJailDuration):void 0),e.slashFractionDoubleSign!==void 0&&(n.slashFractionDoubleSign=(0,Ae.base64FromBytes)(e.slashFractionDoubleSign!==void 0?e.slashFractionDoubleSign:new Uint8Array)),e.slashFractionDowntime!==void 0&&(n.slashFractionDowntime=(0,Ae.base64FromBytes)(e.slashFractionDowntime!==void 0?e.slashFractionDowntime:new Uint8Array)),n},fromPartial(e){const n=Dd();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=cr.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=Se,t=kt,r=G.binary,o=G.helpers;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})(bc);Object.defineProperty(Ya,"__esModule",{value:!0});Ya.setupSlashingExtension=void 0;const hP=bc,wl=We;function gP(e){const n=(0,wl.createProtobufRpcClient)(e),t=new hP.QueryClientImpl(n);return{slashing:{signingInfo:async r=>await t.SigningInfo({consAddress:r}),signingInfos:async r=>await t.SigningInfos({pagination:(0,wl.createPagination)(r)}),params:async()=>await t.Params({})}}}Ya.setupSlashingExtension=gP;var De={};Object.defineProperty(De,"__esModule",{value:!0});De.createStakingAminoConverters=De.isAminoMsgUndelegate=De.isAminoMsgBeginRedelegate=De.isAminoMsgDelegate=De.isAminoMsgEditValidator=De.isAminoMsgCreateValidator=De.protoDecimalToJson=void 0;const jp=be,El=Xn,at=Re;function wi(e){const n=jp.Decimal.fromAtomics(e,18),[t,r]=n.toString().split(".");return`${t}.${(r??"").padEnd(18,"0")}`}De.protoDecimalToJson=wi;function Co(e){return jp.Decimal.fromUserInput(e,18).atomics}function SP(e){return e.type==="cosmos-sdk/MsgCreateValidator"}De.isAminoMsgCreateValidator=SP;function kP(e){return e.type==="cosmos-sdk/MsgEditValidator"}De.isAminoMsgEditValidator=kP;function PP(e){return e.type==="cosmos-sdk/MsgDelegate"}De.isAminoMsgDelegate=PP;function RP(e){return e.type==="cosmos-sdk/MsgBeginRedelegate"}De.isAminoMsgBeginRedelegate=RP;function vP(e){return e.type==="cosmos-sdk/MsgUndelegate"}De.isAminoMsgUndelegate=vP;function BP(){return{"/cosmos.staking.v1beta1.MsgBeginRedelegate":{aminoType:"cosmos-sdk/MsgBeginRedelegate",toAmino:({delegatorAddress:e,validatorSrcAddress:n,validatorDstAddress:t,amount:r})=>((0,at.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,at.assertDefinedAndNotNull)(e,"missing description"),(0,at.assertDefinedAndNotNull)(n,"missing commission"),(0,at.assertDefinedAndNotNull)(h,"missing pubkey"),(0,at.assertDefinedAndNotNull)(v,"missing value"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission:{rate:wi(n.rate),max_rate:wi(n.maxRate),max_change_rate:wi(n.maxChangeRate)},min_self_delegation:t,delegator_address:r,validator_address:o,pubkey:(0,El.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:Co(n.rate),maxRate:Co(n.max_rate),maxChangeRate:Co(n.max_change_rate)},minSelfDelegation:t,delegatorAddress:r,validatorAddress:o,pubkey:(0,El.encodePubkey)(h),value:v})},"/cosmos.staking.v1beta1.MsgDelegate":{aminoType:"cosmos-sdk/MsgDelegate",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t})=>((0,at.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,at.assertDefinedAndNotNull)(e,"missing description"),{description:{moniker:e.moniker,identity:e.identity,website:e.website,security_contact:e.securityContact,details:e.details},commission_rate:n?wi(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?Co(n):"",minSelfDelegation:t??"",validatorAddress:r})},"/cosmos.staking.v1beta1.MsgUndelegate":{aminoType:"cosmos-sdk/MsgUndelegate",toAmino:({delegatorAddress:e,validatorAddress:n,amount:t})=>((0,at.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})}}}De.createStakingAminoConverters=BP;var Xe={},ro={},Oc={},Ac={},em={};(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=cn,t=G.binary,r=G.helpers;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}}})(em);(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=G.timestamp,t=em,r=Zt,o=vc,h=zt,v=G.binary,C=G.helpers;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 K=b===void 0?q.len:q.pos+b;const F=m();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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 K=b===void 0?q.len:q.pos+b;const F=N();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.message=q.string();break;default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=V();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=u();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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 K=b===void 0?q.len:q.pos+b;const F=l();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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(K=>e.ValidatorUpdate.fromPartial(K)))||[],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 K=b===void 0?q.len:q.pos+b;const F=T();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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 K=b===void 0?q.len:q.pos+b;const F=f();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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(K=>e.Misbehavior.fromPartial(K)))||[],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 K=b===void 0?q.len:q.pos+b;const F=p();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.tx=q.bytes();break;case 2:F.type=q.int32();break;default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=A();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.tx=q.bytes();break;default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=Q();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.height=q.int64();break;default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=M();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=a();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=k();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.snapshot=e.Snapshot.decode(q,q.uint32());break;case 2:F.appHash=q.bytes();break;default:q.skipType(z&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 K=b===void 0?q.len:q.pos+b;const F=S();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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 K=b===void 0?q.len:q.pos+b;const F=P();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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 K=b===void 0?q.len:q.pos+b;const F=O();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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,K;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=((K=c.misbehavior)==null?void 0:K.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 K=b===void 0?q.len:q.pos+b;const F=W();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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,K;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=((K=c.misbehavior)==null?void 0:K.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 $(){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 K=b===void 0?q.len:q.pos+b;const F=$();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=$();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=$();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 L(){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 K=b===void 0?q.len:q.pos+b;const F=L();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.error=q.string();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=L();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=L();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 K=b===void 0?q.len:q.pos+b;const F=x();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.message=q.string();break;default:q.skipType(z&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 Is(){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 K=b===void 0?q.len:q.pos+b;const F=Is();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){default:q.skipType(z&7);break}}return F},fromJSON(c){return Is()},toJSON(c){return{}},fromPartial(c){return Is()}};function Ts(){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 K=b===void 0?q.len:q.pos+b;const F=Ts();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Ts();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=Ts();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 Cs(){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 K=b===void 0?q.len:q.pos+b;const F=Cs();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Cs();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=Cs();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(K=>e.ValidatorUpdate.fromPartial(K)))||[],b.appHash=c.appHash??new Uint8Array,b}};function Ns(){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 K=b===void 0?q.len:q.pos+b;const F=Ns();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Ns();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=Ns();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 ws(){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 K=b===void 0?q.len:q.pos+b;const F=ws();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.events.push(e.Event.decode(q,q.uint32()));break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=ws();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=ws();return b.events=((q=c.events)==null?void 0:q.map(K=>e.Event.fromPartial(K)))||[],b}};function Es(){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 K=b===void 0?q.len:q.pos+b;const F=Es();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Es();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=Es();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(K=>e.Event.fromPartial(K)))||[],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 _s(){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 K=b===void 0?q.len:q.pos+b;const F=_s();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=_s();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=_s();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(K=>e.Event.fromPartial(K)))||[],b.codespace=c.codespace??"",b}};function Us(){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 K=b===void 0?q.len:q.pos+b;const F=Us();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Us();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,K;const b=Us();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=((K=c.events)==null?void 0:K.map(F=>e.Event.fromPartial(F)))||[],b}};function Js(){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 K=b===void 0?q.len:q.pos+b;const F=Js();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 2:F.data=q.bytes();break;case 3:F.retainHeight=q.int64();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Js();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=Js();return b.data=c.data??new Uint8Array,c.retainHeight!==void 0&&c.retainHeight!==null&&(b.retainHeight=BigInt(c.retainHeight.toString())),b}};function Ds(){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 K=b===void 0?q.len:q.pos+b;const F=Ds();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.snapshots.push(e.Snapshot.decode(q,q.uint32()));break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Ds();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=Ds();return b.snapshots=((q=c.snapshots)==null?void 0:q.map(K=>e.Snapshot.fromPartial(K)))||[],b}};function Ms(){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 K=b===void 0?q.len:q.pos+b;const F=Ms();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.result=q.int32();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Ms();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=Ms();return b.result=c.result??0,b}};function qs(){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 K=b===void 0?q.len:q.pos+b;const F=qs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.chunk=q.bytes();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=qs();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=qs();return b.chunk=c.chunk??new Uint8Array,b}};function Hs(){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 K=b===void 0?q.len:q.pos+b;const F=Hs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.result=q.int32();break;case 2:if((z&7)===2){const Iy=q.uint32()+q.pos;for(;q.pos<Iy;)F.refetchChunks.push(q.uint32())}else F.refetchChunks.push(q.uint32());break;case 3:F.rejectSenders.push(q.string());break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Hs();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,K;const b=Hs();return b.result=c.result??0,b.refetchChunks=((q=c.refetchChunks)==null?void 0:q.map(F=>F))||[],b.rejectSenders=((K=c.rejectSenders)==null?void 0:K.map(F=>F))||[],b}};function Vs(){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 K=b===void 0?q.len:q.pos+b;const F=Vs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.txs.push(q.bytes());break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Vs();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=Vs();return b.txs=((q=c.txs)==null?void 0:q.map(K=>K))||[],b}};function Qs(){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 K=b===void 0?q.len:q.pos+b;const F=Qs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.status=q.int32();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Qs();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=Qs();return b.status=c.status??0,b}};function Ws(){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 K=b===void 0?q.len:q.pos+b;const F=Ws();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.round=q.int32();break;case 2:F.votes.push(e.VoteInfo.decode(q,q.uint32()));break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Ws();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=Ws();return b.round=c.round??0,b.votes=((q=c.votes)==null?void 0:q.map(K=>e.VoteInfo.fromPartial(K)))||[],b}};function Gs(){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 K=b===void 0?q.len:q.pos+b;const F=Gs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.round=q.int32();break;case 2:F.votes.push(e.ExtendedVoteInfo.decode(q,q.uint32()));break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Gs();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=Gs();return b.round=c.round??0,b.votes=((q=c.votes)==null?void 0:q.map(K=>e.ExtendedVoteInfo.fromPartial(K)))||[],b}};function Fs(){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 K=b===void 0?q.len:q.pos+b;const F=Fs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.type=q.string();break;case 2:F.attributes.push(e.EventAttribute.decode(q,q.uint32()));break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Fs();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=Fs();return b.type=c.type??"",b.attributes=((q=c.attributes)==null?void 0:q.map(K=>e.EventAttribute.fromPartial(K)))||[],b}};function Ls(){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 K=b===void 0?q.len:q.pos+b;const F=Ls();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Ls();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=Ls();return b.key=c.key??"",b.value=c.value??"",b.index=c.index??!1,b}};function $s(){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 K=b===void 0?q.len:q.pos+b;const F=$s();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&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.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=$s();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 Ks(){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 K=b===void 0?q.len:q.pos+b;const F=Ks();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.address=q.bytes();break;case 3:F.power=q.int64();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Ks();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=Ks();return b.address=c.address??new Uint8Array,c.power!==void 0&&c.power!==null&&(b.power=BigInt(c.power.toString())),b}};function zs(){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 K=b===void 0?q.len:q.pos+b;const F=zs();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.pubKey=h.PublicKey.decode(q,q.uint32());break;case 2:F.power=q.int64();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=zs();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=zs();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 Ys(){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 K=b===void 0?q.len:q.pos+b;const F=Ys();for(;q.pos<K;){const z=q.uint32();switch(z>>>3){case 1:F.validator=e.Validator.decode(q,q.uint32());break;case 2:F.signedLastBlock=q.bool();break;default:q.skipType(z&7);break}}return F},fromJSON(c){const b=Ys();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=Ys();return c.validator!==void 0&&c.validator!==null&&(b.validator=e.Validator.fromPartial(c.validator)),b.signedLastBlock=c.signedLastBlock??!1,b}};function Zs(){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 K=b===void 0?q.len:q.pos+b;const F=Zs();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Zs();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=Zs();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 Xs(){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 K=b===void 0?q.len:q.pos+b;const F=Xs();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=Xs();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=Xs();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 xs(){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 K=b===void 0?q.len:q.pos+b;const F=xs();for(;q.pos<K;){const z=q.uint32();switch(z>>>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(z&7);break}}return F},fromJSON(c){const b=xs();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=xs();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 Ay{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=Ay})(Ac);(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=Zt,t=G.timestamp,r=G.any,o=cn,h=G.coin,v=Ac,C=G.binary,w=G.helpers;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 $=d();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.header=n.Header.decode(O,O.uint32());break;case 2:$.valset.push(e.Validator.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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 $=s();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.rate=O.string();break;case 2:$.maxRate=O.string();break;case 3:$.maxChangeRate=O.string();break;default:O.skipType(L&7);break}}return $},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 $=y();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.commissionRates=e.CommissionRates.decode(O,O.uint32());break;case 2:$.updateTime=t.Timestamp.decode(O,O.uint32());break;default:O.skipType(L&7);break}}return $},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 $=E();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.moniker=O.string();break;case 2:$.identity=O.string();break;case 3:$.website=O.string();break;case 4:$.securityContact=O.string();break;case 5:$.details=O.string();break;default:O.skipType(L&7);break}}return $},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 $=_();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.operatorAddress=O.string();break;case 2:$.consensusPubkey=r.Any.decode(O,O.uint32());break;case 3:$.jailed=O.bool();break;case 4:$.status=O.int32();break;case 5:$.tokens=O.string();break;case 6:$.delegatorShares=O.string();break;case 7:$.description=e.Description.decode(O,O.uint32());break;case 8:$.unbondingHeight=O.int64();break;case 9:$.unbondingTime=t.Timestamp.decode(O,O.uint32());break;case 10:$.commission=e.Commission.decode(O,O.uint32());break;case 11:$.minSelfDelegation=O.string();break;case 12:$.unbondingOnHoldRefCount=O.int64();break;case 13:if((L&7)===2){const x=O.uint32()+O.pos;for(;O.pos<x;)$.unbondingIds.push(O.uint64())}else $.unbondingIds.push(O.uint64());break;default:O.skipType(L&7);break}}return $},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 $=U();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.addresses.push(O.string());break;default:O.skipType(L&7);break}}return $},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 $=H();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.delegatorAddress=O.string();break;case 2:$.validatorAddress=O.string();break;default:O.skipType(L&7);break}}return $},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 $=i();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.pairs.push(e.DVPair.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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 $=m();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.delegatorAddress=O.string();break;case 2:$.validatorSrcAddress=O.string();break;case 3:$.validatorDstAddress=O.string();break;default:O.skipType(L&7);break}}return $},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 $=N();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.triplets.push(e.DVVTriplet.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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 $=V();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.delegatorAddress=O.string();break;case 2:$.validatorAddress=O.string();break;case 3:$.shares=O.string();break;default:O.skipType(L&7);break}}return $},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 $=u();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.delegatorAddress=O.string();break;case 2:$.validatorAddress=O.string();break;case 3:$.entries.push(e.UnbondingDelegationEntry.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.creationHeight=O.int64();break;case 2:$.completionTime=t.Timestamp.decode(O,O.uint32());break;case 3:$.initialBalance=O.string();break;case 4:$.balance=O.string();break;case 5:$.unbondingId=O.uint64();break;case 6:$.unbondingOnHoldRefCount=O.int64();break;default:O.skipType(L&7);break}}return $},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 $=T();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.creationHeight=O.int64();break;case 2:$.completionTime=t.Timestamp.decode(O,O.uint32());break;case 3:$.initialBalance=O.string();break;case 4:$.sharesDst=O.string();break;case 5:$.unbondingId=O.uint64();break;case 6:$.unbondingOnHoldRefCount=O.int64();break;default:O.skipType(L&7);break}}return $},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 $=f();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.delegatorAddress=O.string();break;case 2:$.validatorSrcAddress=O.string();break;case 3:$.validatorDstAddress=O.string();break;case 4:$.entries.push(e.RedelegationEntry.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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 $=p();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.unbondingTime=o.Duration.decode(O,O.uint32());break;case 2:$.maxValidators=O.uint32();break;case 3:$.maxEntries=O.uint32();break;case 4:$.historicalEntries=O.uint32();break;case 5:$.bondDenom=O.string();break;case 6:$.minCommissionRate=O.string();break;default:O.skipType(L&7);break}}return $},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 $=A();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.delegation=e.Delegation.decode(O,O.uint32());break;case 2:$.balance=h.Coin.decode(O,O.uint32());break;default:O.skipType(L&7);break}}return $},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 $=Q();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.redelegationEntry=e.RedelegationEntry.decode(O,O.uint32());break;case 4:$.balance=O.string();break;default:O.skipType(L&7);break}}return $},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 $=M();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.redelegation=e.Redelegation.decode(O,O.uint32());break;case 2:$.entries.push(e.RedelegationEntryResponse.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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 $=a();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.notBondedTokens=O.string();break;case 2:$.bondedTokens=O.string();break;default:O.skipType(L&7);break}}return $},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 $=k();for(;O.pos<W;){const L=O.uint32();switch(L>>>3){case 1:$.updates.push(v.ValidatorUpdate.decode(O,O.uint32()));break;default:O.skipType(L&7);break}}return $},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}}})(Oc);(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=Oc,t=G.any,r=G.coin,o=G.timestamp,h=G.binary,v=G.helpers;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})(ro);Object.defineProperty(Xe,"__esModule",{value:!0});Xe.isMsgUndelegateEncodeObject=Xe.isMsgEditValidatorEncodeObject=Xe.isMsgDelegateEncodeObject=Xe.isMsgCreateValidatorEncodeObject=Xe.isMsgBeginRedelegateEncodeObject=Xe.stakingTypes=void 0;const Ii=ro;Xe.stakingTypes=[["/cosmos.staking.v1beta1.MsgBeginRedelegate",Ii.MsgBeginRedelegate],["/cosmos.staking.v1beta1.MsgCreateValidator",Ii.MsgCreateValidator],["/cosmos.staking.v1beta1.MsgDelegate",Ii.MsgDelegate],["/cosmos.staking.v1beta1.MsgEditValidator",Ii.MsgEditValidator],["/cosmos.staking.v1beta1.MsgUndelegate",Ii.MsgUndelegate]];function bP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgBeginRedelegate"}Xe.isMsgBeginRedelegateEncodeObject=bP;function OP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgCreateValidator"}Xe.isMsgCreateValidatorEncodeObject=OP;function AP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgDelegate"}Xe.isMsgDelegateEncodeObject=AP;function IP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgEditValidator"}Xe.isMsgEditValidatorEncodeObject=IP;function TP(e){return e.typeUrl==="/cosmos.staking.v1beta1.MsgUndelegate"}Xe.isMsgUndelegateEncodeObject=TP;var Za={},Ic={};(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=Se,t=Oc,r=G.binary,o=G.helpers;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})(Ic);Object.defineProperty(Za,"__esModule",{value:!0});Za.setupStakingExtension=void 0;const CP=Ic,st=We;function NP(e){const n=(0,st.createProtobufRpcClient)(e),t=new CP.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,st.createPagination)(o)}),delegatorUnbondingDelegations:async(r,o)=>await t.DelegatorUnbondingDelegations({delegatorAddr:r,pagination:(0,st.createPagination)(o)}),delegatorValidator:async(r,o)=>await t.DelegatorValidator({delegatorAddr:r,validatorAddr:o}),delegatorValidators:async(r,o)=>await t.DelegatorValidators({delegatorAddr:r,pagination:(0,st.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,st.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,st.createPagination)(o)}),validators:async(r,o)=>await t.Validators({status:r,pagination:(0,st.createPagination)(o)}),validatorUnbondingDelegations:async(r,o)=>await t.ValidatorUnbondingDelegations({validatorAddr:r,pagination:(0,st.createPagination)(o)})}}}Za.setupStakingExtension=NP;var Xa={},Tc={},io={};(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=G.any,t=Ac,r=G.binary,o=G.helpers;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}}})(io);var xr={},nm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EvidenceList=e.LightClientAttackEvidence=e.DuplicateVoteEvidence=e.Evidence=e.protobufPackage=void 0;const n=Zt,t=G.timestamp,r=Ka,o=G.binary,h=G.helpers;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}}})(nm);Object.defineProperty(xr,"__esModule",{value:!0});xr.Block=xr.protobufPackage=void 0;const Ce=Zt,lr=nm,Md=G.binary,No=G.helpers;xr.protobufPackage="tendermint.types";function qd(){return{header:Ce.Header.fromPartial({}),data:Ce.Data.fromPartial({}),evidence:lr.EvidenceList.fromPartial({}),lastCommit:void 0}}xr.Block={typeUrl:"/tendermint.types.Block",encode(e,n=Md.BinaryWriter.create()){return e.header!==void 0&&Ce.Header.encode(e.header,n.uint32(10).fork()).ldelim(),e.data!==void 0&&Ce.Data.encode(e.data,n.uint32(18).fork()).ldelim(),e.evidence!==void 0&&lr.EvidenceList.encode(e.evidence,n.uint32(26).fork()).ldelim(),e.lastCommit!==void 0&&Ce.Commit.encode(e.lastCommit,n.uint32(34).fork()).ldelim(),n},decode(e,n){const t=e instanceof Md.BinaryReader?e:new Md.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.header=Ce.Header.decode(t,t.uint32());break;case 2:o.data=Ce.Data.decode(t,t.uint32());break;case 3:o.evidence=lr.EvidenceList.decode(t,t.uint32());break;case 4:o.lastCommit=Ce.Commit.decode(t,t.uint32());break;default:t.skipType(h&7);break}}return o},fromJSON(e){const n=qd();return(0,No.isSet)(e.header)&&(n.header=Ce.Header.fromJSON(e.header)),(0,No.isSet)(e.data)&&(n.data=Ce.Data.fromJSON(e.data)),(0,No.isSet)(e.evidence)&&(n.evidence=lr.EvidenceList.fromJSON(e.evidence)),(0,No.isSet)(e.lastCommit)&&(n.lastCommit=Ce.Commit.fromJSON(e.lastCommit)),n},toJSON(e){const n={};return e.header!==void 0&&(n.header=e.header?Ce.Header.toJSON(e.header):void 0),e.data!==void 0&&(n.data=e.data?Ce.Data.toJSON(e.data):void 0),e.evidence!==void 0&&(n.evidence=e.evidence?lr.EvidenceList.toJSON(e.evidence):void 0),e.lastCommit!==void 0&&(n.lastCommit=e.lastCommit?Ce.Commit.toJSON(e.lastCommit):void 0),n},fromPartial(e){const n=qd();return e.header!==void 0&&e.header!==null&&(n.header=Ce.Header.fromPartial(e.header)),e.data!==void 0&&e.data!==null&&(n.data=Ce.Data.fromPartial(e.data)),e.evidence!==void 0&&e.evidence!==null&&(n.evidence=lr.EvidenceList.fromPartial(e.evidence)),e.lastCommit!==void 0&&e.lastCommit!==null&&(n.lastCommit=Ce.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=j.tx,t=Se,r=io,o=Zt,h=xr,v=G.binary,C=G.helpers;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})(Tc);Object.defineProperty(Xa,"__esModule",{value:!0});Xa.setupTxExtension=void 0;const wP=Xn,EP=j.signing,_l=Tc,Ti=j.tx,_P=We;function UP(e){const n=(0,_P.createProtobufRpcClient)(e),t=new _l.ServiceClientImpl(n);return{tx:{getTx:async r=>{const o={hash:r};return await t.GetTx(o)},simulate:async(r,o,h,v)=>{const C=Ti.Tx.fromPartial({authInfo:Ti.AuthInfo.fromPartial({fee:Ti.Fee.fromPartial({}),signerInfos:[{publicKey:(0,wP.encodePubkey)(h),sequence:BigInt(v),modeInfo:{single:{mode:EP.SignMode.SIGN_MODE_UNSPECIFIED}}}]}),body:Ti.TxBody.fromPartial({messages:Array.from(r),memo:o}),signatures:[new Uint8Array]}),w=_l.SimulateRequest.fromPartial({txBytes:Ti.Tx.encode(C).finish()});return await t.Simulate(w)}}}}Xa.setupTxExtension=UP;var jr={};Object.defineProperty(jr,"__esModule",{value:!0});jr.createVestingAminoConverters=jr.isAminoMsgCreateVestingAccount=void 0;function JP(e){return e.type==="cosmos-sdk/MsgCreateVestingAccount"}jr.isAminoMsgCreateVestingAccount=JP;function DP(){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})}}}jr.createVestingAminoConverters=DP;var xa={},Cc={};(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=G.coin,t=Aa,r=G.binary,o=G.helpers;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})(Cc);Object.defineProperty(xa,"__esModule",{value:!0});xa.vestingTypes=void 0;const MP=Cc;xa.vestingTypes=[["/cosmos.vesting.v1beta1.MsgCreateVestingAccount",MP.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=Ta;Object.defineProperty(e,"setupAuthExtension",{enumerable:!0,get:function(){return n.setupAuthExtension}});var t=Ja;Object.defineProperty(e,"createAuthzAminoConverters",{enumerable:!0,get:function(){return t.createAuthzAminoConverters}});var r=Da;Object.defineProperty(e,"authzTypes",{enumerable:!0,get:function(){return r.authzTypes}});var o=Ma;Object.defineProperty(e,"setupAuthzExtension",{enumerable:!0,get:function(){return o.setupAuthzExtension}});var h=yt;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=Lr;Object.defineProperty(e,"bankTypes",{enumerable:!0,get:function(){return v.bankTypes}}),Object.defineProperty(e,"isMsgSendEncodeObject",{enumerable:!0,get:function(){return v.isMsgSendEncodeObject}});var C=qa;Object.defineProperty(e,"setupBankExtension",{enumerable:!0,get:function(){return C.setupBankExtension}});var w=$r;Object.defineProperty(e,"createCrysisAminoConverters",{enumerable:!0,get:function(){return w.createCrysisAminoConverters}}),Object.defineProperty(e,"isAminoMsgVerifyInvariant",{enumerable:!0,get:function(){return w.isAminoMsgVerifyInvariant}});var D=Sn;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=Kr;Object.defineProperty(e,"distributionTypes",{enumerable:!0,get:function(){return J.distributionTypes}}),Object.defineProperty(e,"isMsgWithdrawDelegatorRewardEncodeObject",{enumerable:!0,get:function(){return J.isMsgWithdrawDelegatorRewardEncodeObject}});var I=Ha;Object.defineProperty(e,"setupDistributionExtension",{enumerable:!0,get:function(){return I.setupDistributionExtension}});var g=zr;Object.defineProperty(e,"createEvidenceAminoConverters",{enumerable:!0,get:function(){return g.createEvidenceAminoConverters}}),Object.defineProperty(e,"isAminoMsgSubmitEvidence",{enumerable:!0,get:function(){return g.isAminoMsgSubmitEvidence}});var R=Va;Object.defineProperty(e,"createFeegrantAminoConverters",{enumerable:!0,get:function(){return R.createFeegrantAminoConverters}});var B=Qa;Object.defineProperty(e,"feegrantTypes",{enumerable:!0,get:function(){return B.feegrantTypes}});var d=Wa;Object.defineProperty(e,"setupFeegrantExtension",{enumerable:!0,get:function(){return d.setupFeegrantExtension}});var s=kn;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=Pn;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=Ga;Object.defineProperty(e,"setupGovExtension",{enumerable:!0,get:function(){return E.setupGovExtension}});var _=Fa;Object.defineProperty(e,"createGroupAminoConverters",{enumerable:!0,get:function(){return _.createGroupAminoConverters}});var U=La;Object.defineProperty(e,"groupTypes",{enumerable:!0,get:function(){return U.groupTypes}});var H=Yr;Object.defineProperty(e,"createIbcAminoConverters",{enumerable:!0,get:function(){return H.createIbcAminoConverters}}),Object.defineProperty(e,"isAminoMsgTransfer",{enumerable:!0,get:function(){return H.isAminoMsgTransfer}});var i=Zr;Object.defineProperty(e,"ibcTypes",{enumerable:!0,get:function(){return i.ibcTypes}}),Object.defineProperty(e,"isMsgTransferEncodeObject",{enumerable:!0,get:function(){return i.isMsgTransferEncodeObject}});var m=$a;Object.defineProperty(e,"setupIbcExtension",{enumerable:!0,get:function(){return m.setupIbcExtension}});var N=za;Object.defineProperty(e,"setupMintExtension",{enumerable:!0,get:function(){return N.setupMintExtension}});var V=Xr;Object.defineProperty(e,"createSlashingAminoConverters",{enumerable:!0,get:function(){return V.createSlashingAminoConverters}}),Object.defineProperty(e,"isAminoMsgUnjail",{enumerable:!0,get:function(){return V.isAminoMsgUnjail}});var u=Ya;Object.defineProperty(e,"setupSlashingExtension",{enumerable:!0,get:function(){return u.setupSlashingExtension}});var l=De;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=Xe;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=Za;Object.defineProperty(e,"setupStakingExtension",{enumerable:!0,get:function(){return f.setupStakingExtension}});var p=Xa;Object.defineProperty(e,"setupTxExtension",{enumerable:!0,get:function(){return p.setupTxExtension}});var A=jr;Object.defineProperty(e,"createVestingAminoConverters",{enumerable:!0,get:function(){return A.createVestingAminoConverters}}),Object.defineProperty(e,"isAminoMsgCreateVestingAccount",{enumerable:!0,get:function(){return A.isAminoMsgCreateVestingAccount}});var Q=xa;Object.defineProperty(e,"vestingTypes",{enumerable:!0,get:function(){return Q.vestingTypes}})})(Wi);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.makeMultisignedTxBytes=Pt.makeMultisignedTx=Pt.makeCompactBitArray=void 0;const qP=Hn,HP=ae,VP=Xn,Bu=j.multisig,QP=j.signing,Ul=j.tx,tm=j.tx;function rm(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)}),Bu.CompactBitArray.fromPartial({elems:r,extraBitsStored:t})}Pt.makeCompactBitArray=rm;function im(e,n,t,r,o){const h=Array.from(o.keys()),v=(0,HP.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,qP.pubkeyToAddress)(e.value.pubkeys[R],v),d=o.get(B);d&&(C[R]=!0,w.push(d))}const D={publicKey:(0,VP.encodePubkey)(e),modeInfo:{multi:{bitarray:rm(C),modeInfos:w.map(R=>({single:{mode:QP.SignMode.SIGN_MODE_LEGACY_AMINO_JSON}}))}},sequence:BigInt(n)},J=Ul.AuthInfo.fromPartial({signerInfos:[D],fee:{amount:[...t.amount],gasLimit:BigInt(t.gas)}}),I=Ul.AuthInfo.encode(J).finish();return tm.TxRaw.fromPartial({bodyBytes:r,authInfoBytes:I,signatures:[Bu.MultiSignature.encode(Bu.MultiSignature.fromPartial({signatures:w})).finish()]})}Pt.makeMultisignedTx=im;function WP(e,n,t,r,o){const h=im(e,n,t,r,o);return Uint8Array.from(tm.TxRaw.encode(h).finish())}Pt.makeMultisignedTxBytes=WP;var oo={};Object.defineProperty(oo,"__esModule",{value:!0});oo.isSearchTxQueryArray=void 0;function GP(e){return Array.isArray(e)}oo.isSearchTxQueryArray=GP;var om={},ao={},zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.pubkeyToAddress=zn.pubkeyToRawAddress=zn.rawSecp256k1PubkeyToRawAddress=zn.rawEd25519PubkeyToRawAddress=void 0;const bu=qe,FP=ae;function am(e){if(e.length!==32)throw new Error(`Invalid Ed25519 pubkey length: ${e.length}`);return(0,bu.sha256)(e).slice(0,20)}zn.rawEd25519PubkeyToRawAddress=am;function sm(e){if(e.length!==33)throw new Error(`Invalid Secp256k1 pubkey length (compressed): ${e.length}`);return(0,bu.ripemd160)((0,bu.sha256)(e))}zn.rawSecp256k1PubkeyToRawAddress=sm;function dm(e,n){switch(e){case"ed25519":return am(n);case"secp256k1":return sm(n);default:throw new Error(`Pubkey type ${e} not supported`)}}zn.pubkeyToRawAddress=dm;function LP(e,n){return(0,FP.toHex)(dm(e,n)).toUpperCase()}zn.pubkeyToAddress=LP;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.DateTime=Qe.toSeconds=Qe.fromSeconds=Qe.toRfc3339WithNanoseconds=Qe.fromRfc3339WithNanoseconds=void 0;const $P=ae,KP=be;function um(e){const n=(0,$P.fromRfc3339)(e),t=e.match(/\.(\d+)Z$/),r=t?t[1].slice(3):"";return n.nanoseconds=parseInt(r.padEnd(6,"0"),10),n}Qe.fromRfc3339WithNanoseconds=um;function cm(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`}Qe.toRfc3339WithNanoseconds=cm;function zP(e,n=0){const t=new KP.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}Qe.fromSeconds=zP;function YP(e){return{seconds:Math.floor(e.getTime()/1e3),nanos:e.getTime()%1e3*1e6+(e.nanoseconds??0)}}Qe.toSeconds=YP;class ZP{static decode(n){return um(n)}static encode(n){return cm(n)}}Qe.DateTime=ZP;var ea={},ja={},ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.createJsonRpcRequest=void 0;const Jl="123456789";function XP(){return Jl[Math.floor(Math.random()*Jl.length)]}function xP(){return parseInt(Array.from({length:12}).map(()=>XP()).join(""),10)}function jP(e,n){const t=n?{...n}:{};return{jsonrpc:"2.0",id:xP(),method:e,params:t}}ot.createJsonRpcRequest=jP;var so={},es={},ns={},ts={};Object.defineProperty(ts,"__esModule",{value:!0});ts.makeJsonRpcId=void 0;let eR=1e4;function nR(){return eR+=1}ts.makeJsonRpcId=nR;var rs={},rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.jsonRpcCode=rt.isJsonRpcSuccessResponse=rt.isJsonRpcErrorResponse=void 0;function lm(e){return typeof e.error=="object"}rt.isJsonRpcErrorResponse=lm;function tR(e){return!lm(e)}rt.isJsonRpcSuccessResponse=tR;rt.jsonRpcCode={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:{default:-32e3}};Object.defineProperty(rs,"__esModule",{value:!0});rs.JsonRpcClient=void 0;const rR=ji,iR=rt;class oR{constructor(n){this.connection=n}async run(n){const t=this.connection.responseStream.filter(h=>h.id===n.id),r=(0,rR.firstEvent)(t);this.connection.sendRequest(n);const o=await r;if((0,iR.isJsonRpcErrorResponse)(o)){const h=o.error;throw new Error(`JSON RPC error: code=${h.code}; message='${h.message}'`)}return o}}rs.JsonRpcClient=oR;var Rn={},Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.isJsonCompatibleDictionary=Rt.isJsonCompatibleArray=Rt.isJsonCompatibleValue=void 0;function Nc(e){return!!(typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e===null||fm(e)||pm(e))}Rt.isJsonCompatibleValue=Nc;function fm(e){if(!Array.isArray(e))return!1;for(const n of e)if(!Nc(n))return!1;return!0}Rt.isJsonCompatibleArray=fm;function pm(e){return typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]"?!1:Object.values(e).every(Nc)}Rt.isJsonCompatibleDictionary=pm;Object.defineProperty(Rn,"__esModule",{value:!0});Rn.parseJsonRpcResponse=Rn.parseJsonRpcSuccessResponse=Rn.parseJsonRpcErrorResponse=Rn.parseJsonRpcRequest=Rn.parseJsonRpcId=void 0;const vt=Rt;function mm(e){if(!(0,vt.isJsonCompatibleDictionary)(e))throw new Error("Data must be JSON compatible dictionary");const n=e.id;return typeof n!="number"&&typeof n!="string"?null:n}Rn.parseJsonRpcId=mm;function aR(e){if(!(0,vt.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=mm(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,vt.isJsonCompatibleArray)(e.params)&&!(0,vt.isJsonCompatibleDictionary)(e.params))throw new Error("Invalid params field");return{jsonrpc:"2.0",id:n,method:t,params:e.params}}Rn.parseJsonRpcRequest=aR;function sR(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,vt.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 ym(e){if(!(0,vt.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,vt.isJsonCompatibleDictionary)(e.error))throw new Error("Invalid error field");return{jsonrpc:"2.0",id:n,error:sR(e.error)}}Rn.parseJsonRpcErrorResponse=ym;function hm(e){if(!(0,vt.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}}Rn.parseJsonRpcSuccessResponse=hm;function dR(e){let n;try{n=ym(e)}catch{n=hm(e)}return n}Rn.parseJsonRpcResponse=dR;(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=ts;Object.defineProperty(e,"makeJsonRpcId",{enumerable:!0,get:function(){return n.makeJsonRpcId}});var t=rs;Object.defineProperty(e,"JsonRpcClient",{enumerable:!0,get:function(){return t.JsonRpcClient}});var r=Rn;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=rt;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}})})(ns);var uo={};const gm=G.getAugmentedNamespace($y);var uR=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(uo,"__esModule",{value:!0});uo.http=void 0;const cR=uR(gm);function lR(e){if(e.status>=400)throw new Error(`Bad status on response: ${e.status}`);return e}function fR(e){return e.toString().includes("emitExperimentalWarning")}async function pR(e,n,t,r){if(typeof fetch=="function"&&!fR(fetch)){const o={method:e,body:r?JSON.stringify(r):void 0,headers:{"Content-Type":"application/json",...t}};return fetch(n,o).then(lR).then(h=>h.json())}else return cR.default.request({url:n,method:e,data:r,headers:t}).then(o=>o.data)}uo.http=pR;var it={};Object.defineProperty(it,"__esModule",{value:!0});it.hasProtocol=it.instanceOfRpcStreamingClient=void 0;function mR(e){return typeof e.listen=="function"}it.instanceOfRpcStreamingClient=mR;function yR(e){return e.search("://")!==-1}it.hasProtocol=yR;Object.defineProperty(es,"__esModule",{value:!0});es.HttpBatchClient=void 0;const Dl=ns,hR=uo,gR=it,Ml={dispatchInterval:20,batchSizeLimit:20};class SR{constructor(n,t={}){if(this.queue=[],this.options={batchSizeLimit:t.batchSizeLimit??Ml.batchSizeLimit,dispatchInterval:t.dispatchInterval??Ml.dispatchInterval},typeof n=="string"){if(!(0,gR.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,hR.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,Dl.parseJsonRpcResponse)(v);(0,Dl.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)}})}}es.HttpBatchClient=SR;var is={};Object.defineProperty(is,"__esModule",{value:!0});is.HttpClient=void 0;const ql=ns,kR=uo,PR=it;let RR=class{constructor(n){if(typeof n=="string"){if(!(0,PR.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,ql.parseJsonRpcResponse)(await(0,kR.http)("POST",this.url,this.headers,n));if((0,ql.isJsonRpcErrorResponse)(t))throw new Error(JSON.stringify(t.error));return t}};is.HttpClient=RR;var os={},Sm={},wc={},co={},lo={},vR=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(lo,"__esModule",{value:!0});lo.SocketWrapper=void 0;const ir=vR(G.browser);function BR(){return typeof G.dist.process<"u"&&typeof G.dist.process.versions<"u"&&typeof G.dist.process.versions.node<"u"}class bR{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 ir.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 ir.default.OPEN:this.socket.close(1e3);break;case ir.default.CLOSED:break;case ir.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 ir.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!==ir.default.OPEN)throw new Error("Websocket is not open");BR()?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)}}lo.SocketWrapper=bR;Object.defineProperty(co,"__esModule",{value:!0});co.StreamingSocket=void 0;const OR=G.xstream,AR=lo;class IR{constructor(n,t=1e4){this.socket=new AR.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=OR.Stream.create(r)}connect(){this.socket.connect()}disconnect(){this.socket.disconnect()}async send(n){return this.socket.send(n)}}co.StreamingSocket=IR;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QueueingStreamingSocket=e.ConnectionStatus=void 0;const n=ji,t=G.xstream,r=co;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})(wc);var as={};Object.defineProperty(as,"__esModule",{value:!0});as.ReconnectingSocket=void 0;const TR=G.xstream,Hd=wc;class Ec{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=TR.Stream.create(o),this.socket=new Hd.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===Hd.ConnectionStatus.Connected&&(this.timeoutIndex=0),h===Hd.ConnectionStatus.Disconnected&&(this.reconnectTimeout&&(clearTimeout(this.reconnectTimeout),this.reconnectTimeout=null),this.reconnectTimeout=setTimeout(()=>this.socket.reconnect(),Ec.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)}}as.ReconnectingSocket=Ec;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamingSocket=e.SocketWrapper=e.ReconnectingSocket=e.QueueingStreamingSocket=e.ConnectionStatus=void 0;var n=wc;Object.defineProperty(e,"ConnectionStatus",{enumerable:!0,get:function(){return n.ConnectionStatus}}),Object.defineProperty(e,"QueueingStreamingSocket",{enumerable:!0,get:function(){return n.QueueingStreamingSocket}});var t=as;Object.defineProperty(e,"ReconnectingSocket",{enumerable:!0,get:function(){return t.ReconnectingSocket}});var r=lo;Object.defineProperty(e,"SocketWrapper",{enumerable:!0,get:function(){return r.SocketWrapper}});var o=co;Object.defineProperty(e,"StreamingSocket",{enumerable:!0,get:function(){return o.StreamingSocket}})})(Sm);Object.defineProperty(os,"__esModule",{value:!0});os.WebsocketClient=void 0;const na=ns,Hl=Sm,CR=ji,NR=G.xstream,wR=it;function ER(e){throw e}function km(e){if(e.type!=="message")throw new Error(`Unexcepted message type on websocket: ${e.type}`);return(0,na.parseJsonRpcResponse)(JSON.parse(e.data))}class _R{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(km),r=t.filter(v=>v.id===this.request.id).subscribe({next:v=>{(0,na.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,na.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 UR{constructor(n,t=ER){if(this.subscriptionStreams=new Map,!(0,wR.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 Hl.ReconnectingSocket(this.url);const o=this.socket.events.subscribe({error:h=>{t(h),o.unsubscribe()}});this.jsonRpcResponseStream=this.socket.events.map(km),this.socket.connect()}async execute(n){const t=this.responseForRequestId(n.id);this.socket.queueRequest(JSON.stringify(n));const r=await t;if((0,na.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 _R(n,this.socket),o=NR.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(Hl.ConnectionStatus.Connected)}disconnect(){this.socket.disconnect()}async responseForRequestId(n){return(0,CR.firstEvent)(this.jsonRpcResponseStream.filter(t=>t.id===n))}}os.WebsocketClient=UR;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WebsocketClient=e.instanceOfRpcStreamingClient=e.HttpClient=e.HttpBatchClient=void 0;var n=es;Object.defineProperty(e,"HttpBatchClient",{enumerable:!0,get:function(){return n.HttpBatchClient}});var t=is;Object.defineProperty(e,"HttpClient",{enumerable:!0,get:function(){return t.HttpClient}});var r=it;Object.defineProperty(e,"instanceOfRpcStreamingClient",{enumerable:!0,get:function(){return r.instanceOfRpcStreamingClient}});var o=os;Object.defineProperty(e,"WebsocketClient",{enumerable:!0,get:function(){return o.WebsocketClient}})})(so);var Pm={},ss={},un={},ce={};Object.defineProperty(ce,"__esModule",{value:!0});ce.encodeBlockId=ce.encodeVersion=ce.encodeBytes=ce.encodeTime=ce.encodeUvarint=ce.encodeString=ce.dictionaryToStringMap=ce.may=ce.assertNotEmpty=ce.assertObject=ce.assertArray=ce.assertNumber=ce.assertString=ce.assertBoolean=ce.assertSet=void 0;const JR=ae;function Xt(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}ce.assertSet=Xt;function DR(e){if(Xt(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}ce.assertBoolean=DR;function MR(e){if(Xt(e),typeof e!="string")throw new Error("Value must be a string");return e}ce.assertString=MR;function qR(e){if(Xt(e),typeof e!="number")throw new Error("Value must be a number");return e}ce.assertNumber=qR;function HR(e){if(Xt(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}ce.assertArray=HR;function VR(e){if(Xt(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}ce.assertObject=VR;function QR(e){if(Xt(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}ce.assertNotEmpty=QR;function WR(e,n){return n==null?void 0:e(n)}ce.may=WR;function GR(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}ce.dictionaryToStringMap=GR;function FR(e){const n=(0,JR.toUtf8)(e);return Uint8Array.from([n.length,...n])}ce.encodeString=FR;function ei(e){return e>=128?Uint8Array.from([e&255|128,...ei(e>>7)]):Uint8Array.from([e&255])}ce.encodeUvarint=ei;function LR(e){const n=e.getTime(),t=Math.floor(n/1e3),r=t?[8,...ei(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,h=o?[16,...ei(o)]:new Uint8Array;return Uint8Array.from([...r,...h])}ce.encodeTime=LR;function $R(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}ce.encodeBytes=$R;function KR(e){const n=e.block?Uint8Array.from([8,...ei(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...ei(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}ce.encodeVersion=KR;function zR(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])}ce.encodeBlockId=zR;Object.defineProperty(un,"__esModule",{value:!0});un.smallIntToApi=un.apiToBigInt=un.apiToSmallInt=void 0;const Ou=be,YR=ce;function ZR(e){return(typeof e=="number"?new Ou.Int53(e):Ou.Int53.fromString(e)).toNumber()}un.apiToSmallInt=ZR;function XR(e){if((0,YR.assertString)(e),!e.match(/^-?[0-9]+$/))throw new Error("Invalid string format");return BigInt(e)}un.apiToBigInt=XR;function xR(e){return new Ou.Int53(e).toString()}un.smallIntToApi=xR;var fe={};Object.defineProperty(fe,"__esModule",{value:!0});fe.encodeBlockId=fe.encodeVersion=fe.encodeBytes=fe.encodeTime=fe.encodeUvarint=fe.encodeString=fe.dictionaryToStringMap=fe.may=fe.assertNotEmpty=fe.assertObject=fe.assertArray=fe.assertNumber=fe.assertString=fe.assertBoolean=fe.assertSet=void 0;const jR=ae;function xt(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}fe.assertSet=xt;function ev(e){if(xt(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}fe.assertBoolean=ev;function nv(e){if(xt(e),typeof e!="string")throw new Error("Value must be a string");return e}fe.assertString=nv;function tv(e){if(xt(e),typeof e!="number")throw new Error("Value must be a number");return e}fe.assertNumber=tv;function rv(e){if(xt(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}fe.assertArray=rv;function iv(e){if(xt(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}fe.assertObject=iv;function ov(e){if(xt(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}fe.assertNotEmpty=ov;function av(e,n){return n==null?void 0:e(n)}fe.may=av;function sv(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}fe.dictionaryToStringMap=sv;function dv(e){const n=(0,jR.toUtf8)(e);return Uint8Array.from([n.length,...n])}fe.encodeString=dv;function ni(e){return e>=128?Uint8Array.from([e&255|128,...ni(e>>7)]):Uint8Array.from([e&255])}fe.encodeUvarint=ni;function uv(e){const n=e.getTime(),t=Math.floor(n/1e3),r=t?[8,...ni(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,h=o?[16,...ni(o)]:new Uint8Array;return Uint8Array.from([...r,...h])}fe.encodeTime=uv;function cv(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}fe.encodeBytes=cv;function lv(e){const n=e.block?Uint8Array.from([8,...ni(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...ni(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}fe.encodeVersion=lv;function fv(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])}fe.encodeBlockId=fv;var ds={};(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})(ds);var pv=G.commonjsGlobal&&G.commonjsGlobal.__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]}),mv=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),yv=G.commonjsGlobal&&G.commonjsGlobal.__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)&&pv(n,e,t);return mv(n,e),n};Object.defineProperty(ss,"__esModule",{value:!0});ss.Params=void 0;const _c=ae,Jn=un,Ee=ot,je=fe,hv=yv(ds);function Vd(e){return{height:(0,je.may)(Jn.smallIntToApi,e.height)}}function gv(e){return{minHeight:(0,je.may)(Jn.smallIntToApi,e.minHeight),maxHeight:(0,je.may)(Jn.smallIntToApi,e.maxHeight)}}function Sv(e){return{query:e.query,page:(0,je.may)(Jn.smallIntToApi,e.page),per_page:(0,je.may)(Jn.smallIntToApi,e.per_page),order_by:e.order_by}}function kv(e){return{path:(0,je.assertNotEmpty)(e.path),data:(0,_c.toHex)(e.data),height:(0,je.may)(Jn.smallIntToApi,e.height),prove:e.prove}}function Pv(e){return{tx:(0,_c.toBase64)((0,je.assertNotEmpty)(e.tx))}}function Rv(e){return{hash:(0,_c.toBase64)((0,je.assertNotEmpty)(e.hash)),prove:e.prove}}function vv(e){return{query:e.query,prove:e.prove,page:(0,je.may)(Jn.smallIntToApi,e.page),per_page:(0,je.may)(Jn.smallIntToApi,e.per_page),order_by:e.order_by}}function Bv(e){return{height:(0,je.may)(Jn.smallIntToApi,e.height),page:(0,je.may)(Jn.smallIntToApi,e.page),per_page:(0,je.may)(Jn.smallIntToApi,e.per_page)}}let bv=class{static encodeAbciInfo(n){return(0,Ee.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,Ee.createJsonRpcRequest)(n.method,kv(n.params))}static encodeBlock(n){return(0,Ee.createJsonRpcRequest)(n.method,Vd(n.params))}static encodeBlockchain(n){return(0,Ee.createJsonRpcRequest)(n.method,gv(n.params))}static encodeBlockResults(n){return(0,Ee.createJsonRpcRequest)(n.method,Vd(n.params))}static encodeBlockSearch(n){return(0,Ee.createJsonRpcRequest)(n.method,Sv(n.params))}static encodeBroadcastTx(n){return(0,Ee.createJsonRpcRequest)(n.method,Pv(n.params))}static encodeCommit(n){return(0,Ee.createJsonRpcRequest)(n.method,Vd(n.params))}static encodeGenesis(n){return(0,Ee.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,Ee.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,Ee.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,Ee.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},r=hv.buildQuery({tags:[t],raw:n.query.raw});return(0,Ee.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(n){return(0,Ee.createJsonRpcRequest)(n.method,Rv(n.params))}static encodeTxSearch(n){return(0,Ee.createJsonRpcRequest)(n.method,vv(n.params))}static encodeValidators(n){return(0,Ee.createJsonRpcRequest)(n.method,Bv(n.params))}};ss.Params=bv;var vn={},fo={};(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={}))})(fo);var ti={};Object.defineProperty(ti,"__esModule",{value:!0});ti.hashBlock=ti.hashTx=void 0;const Uc=qe,Fe=fe;function Ov(e){return(0,Uc.sha256)(e)}ti.hashTx=Ov;function Av(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 Iv(e){const n=new Uc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function Tv(e,n){const t=new Uc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function Au(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return Iv(e[0]);default:{const n=Av(e.length),t=Au(e.slice(0,n)),r=Au(e.slice(n));return Tv(t,r)}}}function Cv(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,Fe.encodeVersion)(e.version),(0,Fe.encodeString)(e.chainId),(0,Fe.encodeUvarint)(e.height),(0,Fe.encodeTime)(e.time),(0,Fe.encodeBlockId)(e.lastBlockId),(0,Fe.encodeBytes)(e.lastCommitHash),(0,Fe.encodeBytes)(e.dataHash),(0,Fe.encodeBytes)(e.validatorsHash),(0,Fe.encodeBytes)(e.nextValidatorsHash),(0,Fe.encodeBytes)(e.consensusHash),(0,Fe.encodeBytes)(e.appHash),(0,Fe.encodeBytes)(e.lastResultsHash),(0,Fe.encodeBytes)(e.evidenceHash),(0,Fe.encodeBytes)(e.proposerAddress)];return Au(n)}ti.hashBlock=Cv;Object.defineProperty(vn,"__esModule",{value:!0});vn.Responses=vn.decodeValidatorInfo=vn.decodeValidatorGenesis=vn.decodeValidatorUpdate=vn.decodeEvent=void 0;const ie=ae,Rm=Re,Gi=Qe,ne=un,Nv=fo,X=fe,wv=ti;function Ev(e){return{data:e.data,lastBlockHeight:(0,X.may)(ne.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,X.may)(ie.fromBase64,e.last_block_app_hash)}}function _v(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,ie.fromBase64)(n.key),data:(0,ie.fromBase64)(n.data)}))}}function Uv(e){return{key:(0,ie.fromBase64)((0,X.assertString)(e.key??"")),value:(0,ie.fromBase64)((0,X.assertString)(e.value??"")),proof:(0,X.may)(_v,e.proofOps),height:(0,X.may)(ne.apiToSmallInt,e.height),code:(0,X.may)(ne.apiToSmallInt,e.code),codespace:(0,X.assertString)(e.codespace??""),index:(0,X.may)(ne.apiToSmallInt,e.index),log:e.log,info:(0,X.assertString)(e.info??"")}}function Jv(e){return{key:(0,X.assertNotEmpty)(e.key),value:e.value??""}}function Dv(e){return(0,X.assertArray)(e).map(Jv)}function vm(e){return{type:e.type,attributes:e.attributes?Dv(e.attributes):[]}}vn.decodeEvent=vm;function Iu(e){return(0,X.assertArray)(e).map(vm)}function ri(e){return{code:(0,ne.apiToSmallInt)((0,X.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,X.may)(ie.fromBase64,e.data),events:e.events?Iu(e.events):[],gasWanted:(0,ne.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,ne.apiToBigInt)(e.gas_used??"0")}}function Jc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,Rm.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,ie.fromBase64)((0,X.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,ie.fromBase64)((0,X.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,ie.fromBase64)((0,X.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function Mv(e){return{maxBytes:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.max_bytes)),maxGas:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.max_gas))}}function qv(e){return{maxAgeNumBlocks:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.max_age_duration))}}function Bm(e){return{block:Mv((0,X.assertObject)(e.block)),evidence:qv((0,X.assertObject)(e.evidence))}}function bm(e){return{pubkey:Jc((0,X.assertObject)(e.pub_key)),votingPower:(0,ne.apiToBigInt)(e.power??"0")}}vn.decodeValidatorUpdate=bm;function Hv(e){return{height:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(ri),validatorUpdates:(e.validator_updates||[]).map(bm),consensusUpdates:(0,X.may)(Bm,e.consensus_param_updates),beginBlockEvents:Iu(e.begin_block_events||[]),endBlockEvents:Iu(e.end_block_events||[])}}function us(e){return{hash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.hash)),parts:{total:(0,X.assertNotEmpty)(e.parts.total),hash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.parts.hash))}}}function Vv(e){return{block:(0,ne.apiToSmallInt)(e.block),app:(0,ne.apiToSmallInt)(e.app??0)}}function cs(e){return{version:Vv(e.version),chainId:(0,X.assertNotEmpty)(e.chain_id),height:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),time:(0,Gi.fromRfc3339WithNanoseconds)((0,X.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?us(e.last_block_id):null,lastCommitHash:(0,ie.fromHex)((0,X.assertSet)(e.last_commit_hash)),dataHash:(0,ie.fromHex)((0,X.assertSet)(e.data_hash)),validatorsHash:(0,ie.fromHex)((0,X.assertSet)(e.validators_hash)),nextValidatorsHash:(0,ie.fromHex)((0,X.assertSet)(e.next_validators_hash)),consensusHash:(0,ie.fromHex)((0,X.assertSet)(e.consensus_hash)),appHash:(0,ie.fromHex)((0,X.assertSet)(e.app_hash)),lastResultsHash:(0,ie.fromHex)((0,X.assertSet)(e.last_results_hash)),evidenceHash:(0,ie.fromHex)((0,X.assertSet)(e.evidence_hash)),proposerAddress:(0,ie.fromHex)((0,X.assertNotEmpty)(e.proposer_address))}}function Qv(e){return{blockId:us(e.block_id),blockSize:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.block_size)),header:cs(e.header),numTxs:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.num_txs))}}function Wv(e){return{lastHeight:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.last_height)),blockMetas:(0,X.assertArray)(e.block_metas).map(Qv)}}function Gv(e){return{...ri(e),hash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.hash))}}function Fv(e){const n=e.tx_result?ri(e.tx_result):void 0;return{height:(0,ne.apiToSmallInt)(e.height),hash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.hash)),checkTx:ri((0,X.assertObject)(e.check_tx)),deliverTx:n,txResult:n}}function Lv(e){return(0,Rm.assert)(e in Nv.BlockIdFlag),e}function $v(e){return{blockIdFlag:Lv(e.block_id_flag),validatorAddress:e.validator_address?(0,ie.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,Gi.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,ie.fromBase64)(e.signature):void 0}}function Om(e){return{blockId:us((0,X.assertObject)(e.block_id)),height:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),round:(0,ne.apiToSmallInt)(e.round),signatures:(0,X.assertArray)(e.signatures).map($v)}}function Kv(e){return{canonical:(0,X.assertBoolean)(e.canonical),header:cs(e.signed_header.header),commit:Om(e.signed_header.commit)}}function Am(e){return{address:(0,ie.fromHex)((0,X.assertNotEmpty)(e.address)),pubkey:Jc((0,X.assertObject)(e.pub_key)),votingPower:(0,ne.apiToBigInt)((0,X.assertNotEmpty)(e.power))}}vn.decodeValidatorGenesis=Am;function zv(e){return{genesisTime:(0,Gi.fromRfc3339WithNanoseconds)((0,X.assertNotEmpty)(e.genesis_time)),chainId:(0,X.assertNotEmpty)(e.chain_id),consensusParams:Bm(e.consensus_params),validators:e.validators?(0,X.assertArray)(e.validators).map(Am):[],appHash:(0,ie.fromHex)((0,X.assertSet)(e.app_hash)),appState:e.app_state}}function Dc(e){return{pubkey:Jc((0,X.assertObject)(e.pub_key)),votingPower:(0,ne.apiToBigInt)((0,X.assertNotEmpty)(e.voting_power)),address:(0,ie.fromHex)((0,X.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,ne.apiToSmallInt)(e.proposer_priority):void 0}}vn.decodeValidatorInfo=Dc;function Yv(e){return{id:(0,ie.fromHex)((0,X.assertNotEmpty)(e.id)),listenAddr:(0,X.assertNotEmpty)(e.listen_addr),network:(0,X.assertNotEmpty)(e.network),version:(0,X.assertString)(e.version),channels:(0,X.assertNotEmpty)(e.channels),moniker:(0,X.assertNotEmpty)(e.moniker),other:(0,X.dictionaryToStringMap)(e.other),protocolVersion:{app:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.protocol_version.app)),block:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.protocol_version.block)),p2p:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.protocol_version.p2p))}}}function Zv(e){const n=e.earliest_block_height?(0,ne.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,Gi.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,ie.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,ie.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,Gi.fromRfc3339WithNanoseconds)((0,X.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,X.assertBoolean)(e.catching_up)}}function Xv(e){return{nodeInfo:Yv(e.node_info),syncInfo:Zv(e.sync_info),validatorInfo:Dc(e.validator_info)}}function xv(e){return{data:(0,ie.fromBase64)((0,X.assertNotEmpty)(e.data)),rootHash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.root_hash)),proof:{total:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.proof.total)),index:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.proof.index)),leafHash:(0,ie.fromBase64)((0,X.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,X.assertArray)(e.proof.aunts).map(ie.fromBase64)}}}function Im(e){return{tx:(0,ie.fromBase64)((0,X.assertNotEmpty)(e.tx)),result:ri((0,X.assertObject)(e.tx_result)),height:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.height)),index:(0,ne.apiToSmallInt)((0,X.assertNumber)(e.index)),hash:(0,ie.fromHex)((0,X.assertNotEmpty)(e.hash)),proof:(0,X.may)(xv,e.proof)}}function jv(e){return{totalCount:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.total_count)),txs:(0,X.assertArray)(e.txs).map(Im)}}function eB(e){const n=(0,ie.fromBase64)((0,X.assertNotEmpty)(e.tx));return{tx:n,hash:(0,wv.hashTx)(n),result:ri(e.result),height:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.height))}}function nB(e){return{blockHeight:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.block_height)),validators:(0,X.assertArray)(e.validators).map(Dc),count:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.count)),total:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.total))}}function Tm(e){var n;return{header:cs((0,X.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?Om((0,X.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,X.assertArray)(e.data.txs).map(ie.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function Cm(e){return{blockId:us(e.block_id),block:Tm(e.block)}}function tB(e){return{totalCount:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.total_count)),blocks:(0,X.assertArray)(e.blocks).map(Cm)}}function rB(e){return{total:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.total)),totalBytes:(0,ne.apiToSmallInt)((0,X.assertNotEmpty)(e.total_bytes))}}let iB=class Nm{static decodeAbciInfo(n){return Ev((0,X.assertObject)(n.result.response))}static decodeAbciQuery(n){return Uv((0,X.assertObject)(n.result.response))}static decodeBlock(n){return Cm(n.result)}static decodeBlockResults(n){return Hv(n.result)}static decodeBlockSearch(n){return tB(n.result)}static decodeBlockchain(n){return Wv(n.result)}static decodeBroadcastTxSync(n){return Gv(n.result)}static decodeBroadcastTxAsync(n){return Nm.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return Fv(n.result)}static decodeCommit(n){return Kv(n.result)}static decodeGenesis(n){return zv((0,X.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return rB(n.result)}static decodeStatus(n){return Xv(n.result)}static decodeNewBlockEvent(n){return Tm(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return cs(n.data.value.header)}static decodeTxEvent(n){return eB(n.data.value.TxResult)}static decodeTx(n){return Im(n.result)}static decodeTxSearch(n){return jv(n.result)}static decodeValidators(n){return nB(n.result)}};vn.Responses=iB;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=ss;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=vn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(Pm);var oB=G.commonjsGlobal&&G.commonjsGlobal.__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]}),aB=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),sB=G.commonjsGlobal&&G.commonjsGlobal.__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)&&oB(n,e,t);return aB(n,e),n};Object.defineProperty(ja,"__esModule",{value:!0});ja.Comet38Client=void 0;const dB=ot,wo=so,se=Pm,me=sB(ds);class ta{static async connect(n){let t;return typeof n=="object"?t=new wo.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new wo.HttpClient(n):new wo.WebsocketClient(n),await this.detectVersion(t),ta.create(t)}static async create(n){return new ta(n)}static async detectVersion(n){const t=(0,dB.createJsonRpcRequest)(me.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:me.Method.AbciInfo};return this.doCall(n,se.Params.encodeAbciInfo,se.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:me.Method.AbciQuery};return this.doCall(t,se.Params.encodeAbciQuery,se.Responses.decodeAbciQuery)}async block(n){const t={method:me.Method.Block,params:{height:n}};return this.doCall(t,se.Params.encodeBlock,se.Responses.decodeBlock)}async blockResults(n){const t={method:me.Method.BlockResults,params:{height:n}};return this.doCall(t,se.Params.encodeBlockResults,se.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:me.Method.BlockSearch},r=await this.doCall(t,se.Params.encodeBlockSearch,se.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:me.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(r,se.Params.encodeBlockchain,se.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:me.Method.BroadcastTxSync};return this.doCall(t,se.Params.encodeBroadcastTx,se.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:me.Method.BroadcastTxAsync};return this.doCall(t,se.Params.encodeBroadcastTx,se.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:me.Method.BroadcastTxCommit};return this.doCall(t,se.Params.encodeBroadcastTx,se.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:me.Method.Commit,params:{height:n}};return this.doCall(t,se.Params.encodeCommit,se.Responses.decodeCommit)}async genesis(){const n={method:me.Method.Genesis};return this.doCall(n,se.Params.encodeGenesis,se.Responses.decodeGenesis)}async health(){const n={method:me.Method.Health};return this.doCall(n,se.Params.encodeHealth,se.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:me.Method.NumUnconfirmedTxs};return this.doCall(n,se.Params.encodeNumUnconfirmedTxs,se.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:me.Method.Status};return this.doCall(n,se.Params.encodeStatus,se.Responses.decodeStatus)}subscribeNewBlock(){const n={method:me.Method.Subscribe,query:{type:me.SubscriptionEventType.NewBlock}};return this.subscribe(n,se.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:me.Method.Subscribe,query:{type:me.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,se.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:me.Method.Subscribe,query:{type:me.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,se.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:me.Method.Tx};return this.doCall(t,se.Params.encodeTx,se.Responses.decodeTx)}async txSearch(n){const t={params:n,method:me.Method.TxSearch};return this.doCall(t,se.Params.encodeTxSearch,se.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:me.Method.Validators,params:n};return this.doCall(t,se.Params.encodeValidators,se.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,wo.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=se.Params.encodeSubscribe(n);return this.client.listen(r).map(h=>t(h))}}ja.Comet38Client=ta;var wm={};(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={}))})(wm);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=e.Comet38Client=void 0;var n=ja;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return n.Comet38Client}});var t=ds;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return t.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return t.SubscriptionEventType}});var r=wm;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}})})(ea);var Ji={},ls={};(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})(ls);var Em={};(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={}))})(Em);var fs={},_m={},ps={},uB=G.commonjsGlobal&&G.commonjsGlobal.__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]}),cB=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),lB=G.commonjsGlobal&&G.commonjsGlobal.__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)&&uB(n,e,t);return cB(n,e),n};Object.defineProperty(ps,"__esModule",{value:!0});ps.Params=void 0;const Mc=ae,Dn=un,_e=ot,en=ce,fB=lB(ls);function Qd(e){return{height:(0,en.may)(Dn.smallIntToApi,e.height)}}function pB(e){return{minHeight:(0,en.may)(Dn.smallIntToApi,e.minHeight),maxHeight:(0,en.may)(Dn.smallIntToApi,e.maxHeight)}}function mB(e){return{query:e.query,page:(0,en.may)(Dn.smallIntToApi,e.page),per_page:(0,en.may)(Dn.smallIntToApi,e.per_page),order_by:e.order_by}}function yB(e){return{path:(0,en.assertNotEmpty)(e.path),data:(0,Mc.toHex)(e.data),height:(0,en.may)(Dn.smallIntToApi,e.height),prove:e.prove}}function hB(e){return{tx:(0,Mc.toBase64)((0,en.assertNotEmpty)(e.tx))}}function gB(e){return{hash:(0,Mc.toBase64)((0,en.assertNotEmpty)(e.hash)),prove:e.prove}}function SB(e){return{query:e.query,prove:e.prove,page:(0,en.may)(Dn.smallIntToApi,e.page),per_page:(0,en.may)(Dn.smallIntToApi,e.per_page),order_by:e.order_by}}function kB(e){return{height:(0,en.may)(Dn.smallIntToApi,e.height),page:(0,en.may)(Dn.smallIntToApi,e.page),per_page:(0,en.may)(Dn.smallIntToApi,e.per_page)}}let PB=class{static encodeAbciInfo(n){return(0,_e.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,_e.createJsonRpcRequest)(n.method,yB(n.params))}static encodeBlock(n){return(0,_e.createJsonRpcRequest)(n.method,Qd(n.params))}static encodeBlockchain(n){return(0,_e.createJsonRpcRequest)(n.method,pB(n.params))}static encodeBlockResults(n){return(0,_e.createJsonRpcRequest)(n.method,Qd(n.params))}static encodeBlockSearch(n){return(0,_e.createJsonRpcRequest)(n.method,mB(n.params))}static encodeBroadcastTx(n){return(0,_e.createJsonRpcRequest)(n.method,hB(n.params))}static encodeCommit(n){return(0,_e.createJsonRpcRequest)(n.method,Qd(n.params))}static encodeGenesis(n){return(0,_e.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,_e.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,_e.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,_e.createJsonRpcRequest)(n.method)}static encodeSubscribe(n){const t={key:"tm.event",value:n.query.type},r=fB.buildQuery({tags:[t],raw:n.query.raw});return(0,_e.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(n){return(0,_e.createJsonRpcRequest)(n.method,gB(n.params))}static encodeTxSearch(n){return(0,_e.createJsonRpcRequest)(n.method,SB(n.params))}static encodeValidators(n){return(0,_e.createJsonRpcRequest)(n.method,kB(n.params))}};ps.Params=PB;var Bn={},ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.hashBlock=ii.hashTx=void 0;const qc=qe,Le=ce;function RB(e){return(0,qc.sha256)(e)}ii.hashTx=RB;function vB(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 BB(e){const n=new qc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function bB(e,n){const t=new qc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function Tu(e){switch(e.length){case 0:throw new Error("Cannot hash empty tree");case 1:return BB(e[0]);default:{const n=vB(e.length),t=Tu(e.slice(0,n)),r=Tu(e.slice(n));return bB(t,r)}}}function OB(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,Le.encodeVersion)(e.version),(0,Le.encodeString)(e.chainId),(0,Le.encodeUvarint)(e.height),(0,Le.encodeTime)(e.time),(0,Le.encodeBlockId)(e.lastBlockId),(0,Le.encodeBytes)(e.lastCommitHash),(0,Le.encodeBytes)(e.dataHash),(0,Le.encodeBytes)(e.validatorsHash),(0,Le.encodeBytes)(e.nextValidatorsHash),(0,Le.encodeBytes)(e.consensusHash),(0,Le.encodeBytes)(e.appHash),(0,Le.encodeBytes)(e.lastResultsHash),(0,Le.encodeBytes)(e.evidenceHash),(0,Le.encodeBytes)(e.proposerAddress)];return Tu(n)}ii.hashBlock=OB;Object.defineProperty(Bn,"__esModule",{value:!0});Bn.Responses=Bn.decodeValidatorInfo=Bn.decodeValidatorGenesis=Bn.decodeValidatorUpdate=Bn.decodeEvent=void 0;const ee=ae,Um=Re,Fi=Qe,te=un,AB=fo,Y=ce,IB=ii;function TB(e){return{data:e.data,lastBlockHeight:(0,Y.may)(te.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,Y.may)(ee.fromBase64,e.last_block_app_hash)}}function CB(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,ee.fromBase64)(n.key),data:(0,ee.fromBase64)(n.data)}))}}function NB(e){return{key:(0,ee.fromBase64)((0,Y.assertString)(e.key??"")),value:(0,ee.fromBase64)((0,Y.assertString)(e.value??"")),proof:(0,Y.may)(CB,e.proofOps),height:(0,Y.may)(te.apiToSmallInt,e.height),code:(0,Y.may)(te.apiToSmallInt,e.code),codespace:(0,Y.assertString)(e.codespace??""),index:(0,Y.may)(te.apiToSmallInt,e.index),log:e.log,info:(0,Y.assertString)(e.info??"")}}function wB(e){return{key:(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.key)),value:(0,ee.fromBase64)((0,Y.assertString)(e.value??""))}}function EB(e){return(0,Y.assertArray)(e).map(wB)}function Jm(e){return{type:e.type,attributes:e.attributes?EB(e.attributes):[]}}Bn.decodeEvent=Jm;function Cu(e){return(0,Y.assertArray)(e).map(Jm)}function oi(e){return{code:(0,te.apiToSmallInt)((0,Y.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,Y.may)(ee.fromBase64,e.data),events:e.events?Cu(e.events):[],gasWanted:(0,te.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,te.apiToBigInt)(e.gas_used??"0")}}function Hc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,Um.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,ee.fromBase64)((0,Y.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function _B(e){return{maxBytes:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_bytes)),maxGas:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_gas))}}function UB(e){return{maxAgeNumBlocks:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_age_num_blocks)),maxAgeDuration:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.max_age_duration))}}function Dm(e){return{block:_B((0,Y.assertObject)(e.block)),evidence:UB((0,Y.assertObject)(e.evidence))}}function Mm(e){return{pubkey:Hc((0,Y.assertObject)(e.pub_key)),votingPower:(0,te.apiToBigInt)(e.power??"0")}}Bn.decodeValidatorUpdate=Mm;function JB(e){return{height:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(oi),validatorUpdates:(e.validator_updates||[]).map(Mm),consensusUpdates:(0,Y.may)(Dm,e.consensus_param_updates),beginBlockEvents:Cu(e.begin_block_events||[]),endBlockEvents:Cu(e.end_block_events||[])}}function ms(e){return{hash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.hash)),parts:{total:(0,Y.assertNotEmpty)(e.parts.total),hash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.parts.hash))}}}function DB(e){return{block:(0,te.apiToSmallInt)(e.block),app:(0,te.apiToSmallInt)(e.app??0)}}function ys(e){return{version:DB(e.version),chainId:(0,Y.assertNotEmpty)(e.chain_id),height:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),time:(0,Fi.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?ms(e.last_block_id):null,lastCommitHash:(0,ee.fromHex)((0,Y.assertSet)(e.last_commit_hash)),dataHash:(0,ee.fromHex)((0,Y.assertSet)(e.data_hash)),validatorsHash:(0,ee.fromHex)((0,Y.assertSet)(e.validators_hash)),nextValidatorsHash:(0,ee.fromHex)((0,Y.assertSet)(e.next_validators_hash)),consensusHash:(0,ee.fromHex)((0,Y.assertSet)(e.consensus_hash)),appHash:(0,ee.fromHex)((0,Y.assertSet)(e.app_hash)),lastResultsHash:(0,ee.fromHex)((0,Y.assertSet)(e.last_results_hash)),evidenceHash:(0,ee.fromHex)((0,Y.assertSet)(e.evidence_hash)),proposerAddress:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.proposer_address))}}function MB(e){return{blockId:ms(e.block_id),blockSize:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.block_size)),header:ys(e.header),numTxs:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.num_txs))}}function qB(e){return{lastHeight:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.last_height)),blockMetas:(0,Y.assertArray)(e.block_metas).map(MB)}}function HB(e){return{...oi(e),hash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.hash))}}function VB(e){return{height:(0,te.apiToSmallInt)(e.height),hash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.hash)),checkTx:oi((0,Y.assertObject)(e.check_tx)),deliverTx:(0,Y.may)(oi,e.deliver_tx)}}function QB(e){return(0,Um.assert)(e in AB.BlockIdFlag),e}function WB(e){return{blockIdFlag:QB(e.block_id_flag),validatorAddress:e.validator_address?(0,ee.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,Fi.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,ee.fromBase64)(e.signature):void 0}}function qm(e){return{blockId:ms((0,Y.assertObject)(e.block_id)),height:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),round:(0,te.apiToSmallInt)(e.round),signatures:(0,Y.assertArray)(e.signatures).map(WB)}}function GB(e){return{canonical:(0,Y.assertBoolean)(e.canonical),header:ys(e.signed_header.header),commit:qm(e.signed_header.commit)}}function Hm(e){return{address:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.address)),pubkey:Hc((0,Y.assertObject)(e.pub_key)),votingPower:(0,te.apiToBigInt)((0,Y.assertNotEmpty)(e.power))}}Bn.decodeValidatorGenesis=Hm;function FB(e){return{genesisTime:(0,Fi.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.genesis_time)),chainId:(0,Y.assertNotEmpty)(e.chain_id),consensusParams:Dm(e.consensus_params),validators:e.validators?(0,Y.assertArray)(e.validators).map(Hm):[],appHash:(0,ee.fromHex)((0,Y.assertSet)(e.app_hash)),appState:e.app_state}}function Vc(e){return{pubkey:Hc((0,Y.assertObject)(e.pub_key)),votingPower:(0,te.apiToBigInt)((0,Y.assertNotEmpty)(e.voting_power)),address:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,te.apiToSmallInt)(e.proposer_priority):void 0}}Bn.decodeValidatorInfo=Vc;function LB(e){return{id:(0,ee.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,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.app)),block:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.block)),p2p:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.protocol_version.p2p))}}}function $B(e){const n=e.earliest_block_height?(0,te.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,Fi.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,ee.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,ee.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,Fi.fromRfc3339WithNanoseconds)((0,Y.assertNotEmpty)(e.latest_block_time)),latestBlockHeight:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.latest_block_height)),catchingUp:(0,Y.assertBoolean)(e.catching_up)}}function KB(e){return{nodeInfo:LB(e.node_info),syncInfo:$B(e.sync_info),validatorInfo:Vc(e.validator_info)}}function zB(e){return{data:(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.data)),rootHash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.root_hash)),proof:{total:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.proof.total)),index:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.proof.index)),leafHash:(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,Y.assertArray)(e.proof.aunts).map(ee.fromBase64)}}}function Vm(e){return{tx:(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.tx)),result:oi((0,Y.assertObject)(e.tx_result)),height:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.height)),index:(0,te.apiToSmallInt)((0,Y.assertNumber)(e.index)),hash:(0,ee.fromHex)((0,Y.assertNotEmpty)(e.hash)),proof:(0,Y.may)(zB,e.proof)}}function YB(e){return{totalCount:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_count)),txs:(0,Y.assertArray)(e.txs).map(Vm)}}function ZB(e){const n=(0,ee.fromBase64)((0,Y.assertNotEmpty)(e.tx));return{tx:n,hash:(0,IB.hashTx)(n),result:oi(e.result),height:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.height))}}function XB(e){return{blockHeight:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.block_height)),validators:(0,Y.assertArray)(e.validators).map(Vc),count:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.count)),total:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.total))}}function Qm(e){var n;return{header:ys((0,Y.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?qm((0,Y.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,Y.assertArray)(e.data.txs).map(ee.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function Wm(e){return{blockId:ms(e.block_id),block:Qm(e.block)}}function xB(e){return{totalCount:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_count)),blocks:(0,Y.assertArray)(e.blocks).map(Wm)}}function jB(e){return{total:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.total)),totalBytes:(0,te.apiToSmallInt)((0,Y.assertNotEmpty)(e.total_bytes))}}let eb=class Gm{static decodeAbciInfo(n){return TB((0,Y.assertObject)(n.result.response))}static decodeAbciQuery(n){return NB((0,Y.assertObject)(n.result.response))}static decodeBlock(n){return Wm(n.result)}static decodeBlockResults(n){return JB(n.result)}static decodeBlockSearch(n){return xB(n.result)}static decodeBlockchain(n){return qB(n.result)}static decodeBroadcastTxSync(n){return HB(n.result)}static decodeBroadcastTxAsync(n){return Gm.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return VB(n.result)}static decodeCommit(n){return GB(n.result)}static decodeGenesis(n){return FB((0,Y.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return jB(n.result)}static decodeStatus(n){return KB(n.result)}static decodeNewBlockEvent(n){return Qm(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return ys(n.data.value.header)}static decodeTxEvent(n){return ZB(n.data.value.TxResult)}static decodeTx(n){return Vm(n.result)}static decodeTxSearch(n){return YB(n.result)}static decodeValidators(n){return XB(n.result)}};Bn.Responses=eb;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=ps;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=Bn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(_m);var nb=G.commonjsGlobal&&G.commonjsGlobal.__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]}),tb=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),rb=G.commonjsGlobal&&G.commonjsGlobal.__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)&&nb(n,e,t);return tb(n,e),n};Object.defineProperty(fs,"__esModule",{value:!0});fs.Tendermint34Client=void 0;const ib=ot,Eo=so,de=_m,ye=rb(ls);class ra{static async connect(n){let t;return typeof n=="object"?t=new Eo.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new Eo.HttpClient(n):new Eo.WebsocketClient(n),await this.detectVersion(t),ra.create(t)}static async create(n){return new ra(n)}static async detectVersion(n){const t=(0,ib.createJsonRpcRequest)(ye.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:ye.Method.AbciInfo};return this.doCall(n,de.Params.encodeAbciInfo,de.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:ye.Method.AbciQuery};return this.doCall(t,de.Params.encodeAbciQuery,de.Responses.decodeAbciQuery)}async block(n){const t={method:ye.Method.Block,params:{height:n}};return this.doCall(t,de.Params.encodeBlock,de.Responses.decodeBlock)}async blockResults(n){const t={method:ye.Method.BlockResults,params:{height:n}};return this.doCall(t,de.Params.encodeBlockResults,de.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:ye.Method.BlockSearch},r=await this.doCall(t,de.Params.encodeBlockSearch,de.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:ye.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(r,de.Params.encodeBlockchain,de.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:ye.Method.BroadcastTxSync};return this.doCall(t,de.Params.encodeBroadcastTx,de.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:ye.Method.BroadcastTxAsync};return this.doCall(t,de.Params.encodeBroadcastTx,de.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:ye.Method.BroadcastTxCommit};return this.doCall(t,de.Params.encodeBroadcastTx,de.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:ye.Method.Commit,params:{height:n}};return this.doCall(t,de.Params.encodeCommit,de.Responses.decodeCommit)}async genesis(){const n={method:ye.Method.Genesis};return this.doCall(n,de.Params.encodeGenesis,de.Responses.decodeGenesis)}async health(){const n={method:ye.Method.Health};return this.doCall(n,de.Params.encodeHealth,de.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:ye.Method.NumUnconfirmedTxs};return this.doCall(n,de.Params.encodeNumUnconfirmedTxs,de.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:ye.Method.Status};return this.doCall(n,de.Params.encodeStatus,de.Responses.decodeStatus)}subscribeNewBlock(){const n={method:ye.Method.Subscribe,query:{type:ye.SubscriptionEventType.NewBlock}};return this.subscribe(n,de.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:ye.Method.Subscribe,query:{type:ye.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,de.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:ye.Method.Subscribe,query:{type:ye.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,de.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:ye.Method.Tx};return this.doCall(t,de.Params.encodeTx,de.Responses.decodeTx)}async txSearch(n){const t={params:n,method:ye.Method.TxSearch};return this.doCall(t,de.Params.encodeTxSearch,de.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:ye.Method.Validators,params:n};return this.doCall(t,de.Params.encodeValidators,de.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,Eo.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=de.Params.encodeSubscribe(n);return this.client.listen(r).map(h=>t(h))}}fs.Tendermint34Client=ra;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint34Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var n=ls;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var t=Em;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=fs;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return r.Tendermint34Client}})})(Ji);var ia={},hs={};(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})(hs);var Fm={};(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={}))})(Fm);var gs={},Lm={},Ss={},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 ob=ae;function jt(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=jt;function ab(e){if(jt(e),typeof e!="boolean")throw new Error("Value must be a boolean");return e}pe.assertBoolean=ab;function sb(e){if(jt(e),typeof e!="string")throw new Error("Value must be a string");return e}pe.assertString=sb;function db(e){if(jt(e),typeof e!="number")throw new Error("Value must be a number");return e}pe.assertNumber=db;function ub(e){if(jt(e),!Array.isArray(e))throw new Error("Value must be a an array");return e}pe.assertArray=ub;function cb(e){if(jt(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=cb;function lb(e){if(jt(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=lb;function fb(e,n){return n==null?void 0:e(n)}pe.may=fb;function pb(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=pb;function mb(e){const n=(0,ob.toUtf8)(e);return Uint8Array.from([n.length,...n])}pe.encodeString=mb;function ai(e){return e>=128?Uint8Array.from([e&255|128,...ai(e>>7)]):Uint8Array.from([e&255])}pe.encodeUvarint=ai;function yb(e){const n=e.getTime(),t=Math.floor(n/1e3),r=t?[8,...ai(t)]:new Uint8Array,o=(e.nanoseconds||0)+n%1e3*1e6,h=o?[16,...ai(o)]:new Uint8Array;return Uint8Array.from([...r,...h])}pe.encodeTime=yb;function hb(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=hb;function gb(e){const n=e.block?Uint8Array.from([8,...ai(e.block)]):new Uint8Array,t=e.app?Uint8Array.from([16,...ai(e.app)]):new Uint8Array;return Uint8Array.from([...n,...t])}pe.encodeVersion=gb;function Sb(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=Sb;var kb=G.commonjsGlobal&&G.commonjsGlobal.__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=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),Rb=G.commonjsGlobal&&G.commonjsGlobal.__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(Ss,"__esModule",{value:!0});Ss.Params=void 0;const Qc=ae,Mn=un,Ue=ot,nn=pe,vb=Rb(hs);function Wd(e){return{height:(0,nn.may)(Mn.smallIntToApi,e.height)}}function Bb(e){return{minHeight:(0,nn.may)(Mn.smallIntToApi,e.minHeight),maxHeight:(0,nn.may)(Mn.smallIntToApi,e.maxHeight)}}function bb(e){return{query:e.query,page:(0,nn.may)(Mn.smallIntToApi,e.page),per_page:(0,nn.may)(Mn.smallIntToApi,e.per_page),order_by:e.order_by}}function Ob(e){return{path:(0,nn.assertNotEmpty)(e.path),data:(0,Qc.toHex)(e.data),height:(0,nn.may)(Mn.smallIntToApi,e.height),prove:e.prove}}function Ab(e){return{tx:(0,Qc.toBase64)((0,nn.assertNotEmpty)(e.tx))}}function Ib(e){return{hash:(0,Qc.toBase64)((0,nn.assertNotEmpty)(e.hash)),prove:e.prove}}function Tb(e){return{query:e.query,prove:e.prove,page:(0,nn.may)(Mn.smallIntToApi,e.page),per_page:(0,nn.may)(Mn.smallIntToApi,e.per_page),order_by:e.order_by}}function Cb(e){return{height:(0,nn.may)(Mn.smallIntToApi,e.height),page:(0,nn.may)(Mn.smallIntToApi,e.page),per_page:(0,nn.may)(Mn.smallIntToApi,e.per_page)}}class Nb{static encodeAbciInfo(n){return(0,Ue.createJsonRpcRequest)(n.method)}static encodeAbciQuery(n){return(0,Ue.createJsonRpcRequest)(n.method,Ob(n.params))}static encodeBlock(n){return(0,Ue.createJsonRpcRequest)(n.method,Wd(n.params))}static encodeBlockchain(n){return(0,Ue.createJsonRpcRequest)(n.method,Bb(n.params))}static encodeBlockResults(n){return(0,Ue.createJsonRpcRequest)(n.method,Wd(n.params))}static encodeBlockSearch(n){return(0,Ue.createJsonRpcRequest)(n.method,bb(n.params))}static encodeBroadcastTx(n){return(0,Ue.createJsonRpcRequest)(n.method,Ab(n.params))}static encodeCommit(n){return(0,Ue.createJsonRpcRequest)(n.method,Wd(n.params))}static encodeGenesis(n){return(0,Ue.createJsonRpcRequest)(n.method)}static encodeHealth(n){return(0,Ue.createJsonRpcRequest)(n.method)}static encodeNumUnconfirmedTxs(n){return(0,Ue.createJsonRpcRequest)(n.method)}static encodeStatus(n){return(0,Ue.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,Ue.createJsonRpcRequest)("subscribe",{query:r})}static encodeTx(n){return(0,Ue.createJsonRpcRequest)(n.method,Ib(n.params))}static encodeTxSearch(n){return(0,Ue.createJsonRpcRequest)(n.method,Tb(n.params))}static encodeValidators(n){return(0,Ue.createJsonRpcRequest)(n.method,Cb(n.params))}}Ss.Params=Nb;var bn={},si={};Object.defineProperty(si,"__esModule",{value:!0});si.hashBlock=si.hashTx=void 0;const Wc=qe,$e=pe;function wb(e){return(0,Wc.sha256)(e)}si.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 Wc.Sha256(Uint8Array.from([0]));return n.update(e),n.digest()}function Ub(e,n){const t=new Wc.Sha256(Uint8Array.from([1]));return t.update(e),t.update(n),t.digest()}function Nu(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=Nu(e.slice(0,n)),r=Nu(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,$e.encodeVersion)(e.version),(0,$e.encodeString)(e.chainId),(0,$e.encodeUvarint)(e.height),(0,$e.encodeTime)(e.time),(0,$e.encodeBlockId)(e.lastBlockId),(0,$e.encodeBytes)(e.lastCommitHash),(0,$e.encodeBytes)(e.dataHash),(0,$e.encodeBytes)(e.validatorsHash),(0,$e.encodeBytes)(e.nextValidatorsHash),(0,$e.encodeBytes)(e.consensusHash),(0,$e.encodeBytes)(e.appHash),(0,$e.encodeBytes)(e.lastResultsHash),(0,$e.encodeBytes)(e.evidenceHash),(0,$e.encodeBytes)(e.proposerAddress)];return Nu(n)}si.hashBlock=Jb;Object.defineProperty(bn,"__esModule",{value:!0});bn.Responses=bn.decodeValidatorInfo=bn.decodeValidatorGenesis=bn.decodeValidatorUpdate=bn.decodeEvent=void 0;const oe=ae,$m=Re,Li=Qe,re=un,Db=fo,Z=pe,Mb=si;function qb(e){return{data:e.data,lastBlockHeight:(0,Z.may)(re.apiToSmallInt,e.last_block_height),lastBlockAppHash:(0,Z.may)(oe.fromBase64,e.last_block_app_hash)}}function Hb(e){return{ops:e.ops.map(n=>({type:n.type,key:(0,oe.fromBase64)(n.key),data:(0,oe.fromBase64)(n.data)}))}}function Vb(e){return{key:(0,oe.fromBase64)((0,Z.assertString)(e.key??"")),value:(0,oe.fromBase64)((0,Z.assertString)(e.value??"")),proof:(0,Z.may)(Hb,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 Qb(e){return{key:(0,Z.assertNotEmpty)(e.key),value:e.value??""}}function Wb(e){return(0,Z.assertArray)(e).map(Qb)}function Km(e){return{type:e.type,attributes:e.attributes?Wb(e.attributes):[]}}bn.decodeEvent=Km;function wu(e){return(0,Z.assertArray)(e).map(Km)}function di(e){return{code:(0,re.apiToSmallInt)((0,Z.assertNumber)(e.code??0)),codespace:e.codespace,log:e.log,data:(0,Z.may)(oe.fromBase64,e.data),events:e.events?wu(e.events):[],gasWanted:(0,re.apiToBigInt)(e.gas_wanted??"0"),gasUsed:(0,re.apiToBigInt)(e.gas_used??"0")}}function Gc(e){if("Sum"in e){const[[n,t]]=Object.entries(e.Sum.value);return(0,$m.assert)(n==="ed25519"||n==="secp256k1",`unknown pubkey type: ${n}`),{algorithm:n,data:(0,oe.fromBase64)((0,Z.assertNotEmpty)(t))}}else switch(e.type){case"tendermint/PubKeyEd25519":return{algorithm:"ed25519",data:(0,oe.fromBase64)((0,Z.assertNotEmpty)(e.value))};case"tendermint/PubKeySecp256k1":return{algorithm:"secp256k1",data:(0,oe.fromBase64)((0,Z.assertNotEmpty)(e.value))};default:throw new Error(`unknown pubkey type: ${e.type}`)}}function Gb(e){return{maxBytes:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_bytes)),maxGas:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.max_gas))}}function Fb(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 zm(e){return{block:Gb((0,Z.assertObject)(e.block)),evidence:Fb((0,Z.assertObject)(e.evidence))}}function Ym(e){return{pubkey:Gc((0,Z.assertObject)(e.pub_key)),votingPower:(0,re.apiToBigInt)(e.power??"0")}}bn.decodeValidatorUpdate=Ym;function Lb(e){return{height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),results:(e.txs_results||[]).map(di),validatorUpdates:(e.validator_updates||[]).map(Ym),consensusUpdates:(0,Z.may)(zm,e.consensus_param_updates),beginBlockEvents:wu(e.begin_block_events||[]),endBlockEvents:wu(e.end_block_events||[])}}function ks(e){return{hash:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.hash)),parts:{total:(0,Z.assertNotEmpty)(e.parts.total),hash:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.parts.hash))}}}function $b(e){return{block:(0,re.apiToSmallInt)(e.block),app:(0,re.apiToSmallInt)(e.app??0)}}function Ps(e){return{version:$b(e.version),chainId:(0,Z.assertNotEmpty)(e.chain_id),height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height)),time:(0,Li.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.time)),lastBlockId:e.last_block_id.hash?ks(e.last_block_id):null,lastCommitHash:(0,oe.fromHex)((0,Z.assertSet)(e.last_commit_hash)),dataHash:(0,oe.fromHex)((0,Z.assertSet)(e.data_hash)),validatorsHash:(0,oe.fromHex)((0,Z.assertSet)(e.validators_hash)),nextValidatorsHash:(0,oe.fromHex)((0,Z.assertSet)(e.next_validators_hash)),consensusHash:(0,oe.fromHex)((0,Z.assertSet)(e.consensus_hash)),appHash:(0,oe.fromHex)((0,Z.assertSet)(e.app_hash)),lastResultsHash:(0,oe.fromHex)((0,Z.assertSet)(e.last_results_hash)),evidenceHash:(0,oe.fromHex)((0,Z.assertSet)(e.evidence_hash)),proposerAddress:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.proposer_address))}}function Kb(e){return{blockId:ks(e.block_id),blockSize:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.block_size)),header:Ps(e.header),numTxs:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.num_txs))}}function zb(e){return{lastHeight:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.last_height)),blockMetas:(0,Z.assertArray)(e.block_metas).map(Kb)}}function Yb(e){return{...di(e),hash:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.hash))}}function Zb(e){return{height:(0,re.apiToSmallInt)(e.height),hash:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.hash)),checkTx:di((0,Z.assertObject)(e.check_tx)),deliverTx:(0,Z.may)(di,e.deliver_tx)}}function Xb(e){return(0,$m.assert)(e in Db.BlockIdFlag),e}function xb(e){return{blockIdFlag:Xb(e.block_id_flag),validatorAddress:e.validator_address?(0,oe.fromHex)(e.validator_address):void 0,timestamp:e.timestamp?(0,Li.fromRfc3339WithNanoseconds)(e.timestamp):void 0,signature:e.signature?(0,oe.fromBase64)(e.signature):void 0}}function Zm(e){return{blockId:ks((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(xb)}}function jb(e){return{canonical:(0,Z.assertBoolean)(e.canonical),header:Ps(e.signed_header.header),commit:Zm(e.signed_header.commit)}}function Xm(e){return{address:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.address)),pubkey:Gc((0,Z.assertObject)(e.pub_key)),votingPower:(0,re.apiToBigInt)((0,Z.assertNotEmpty)(e.power))}}bn.decodeValidatorGenesis=Xm;function e0(e){return{genesisTime:(0,Li.fromRfc3339WithNanoseconds)((0,Z.assertNotEmpty)(e.genesis_time)),chainId:(0,Z.assertNotEmpty)(e.chain_id),consensusParams:zm(e.consensus_params),validators:e.validators?(0,Z.assertArray)(e.validators).map(Xm):[],appHash:(0,oe.fromHex)((0,Z.assertSet)(e.app_hash)),appState:e.app_state}}function Fc(e){return{pubkey:Gc((0,Z.assertObject)(e.pub_key)),votingPower:(0,re.apiToBigInt)((0,Z.assertNotEmpty)(e.voting_power)),address:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.address)),proposerPriority:e.proposer_priority?(0,re.apiToSmallInt)(e.proposer_priority):void 0}}bn.decodeValidatorInfo=Fc;function n0(e){return{id:(0,oe.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 t0(e){const n=e.earliest_block_height?(0,re.apiToSmallInt)(e.earliest_block_height):void 0,t=e.earliest_block_time?(0,Li.fromRfc3339WithNanoseconds)(e.earliest_block_time):void 0;return{earliestAppHash:e.earliest_app_hash?(0,oe.fromHex)(e.earliest_app_hash):void 0,earliestBlockHash:e.earliest_block_hash?(0,oe.fromHex)(e.earliest_block_hash):void 0,earliestBlockHeight:n||void 0,earliestBlockTime:t!=null&&t.getTime()?t:void 0,latestBlockHash:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.latest_block_hash)),latestAppHash:(0,oe.fromHex)((0,Z.assertNotEmpty)(e.latest_app_hash)),latestBlockTime:(0,Li.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 r0(e){return{nodeInfo:n0(e.node_info),syncInfo:t0(e.sync_info),validatorInfo:Fc(e.validator_info)}}function i0(e){return{data:(0,oe.fromBase64)((0,Z.assertNotEmpty)(e.data)),rootHash:(0,oe.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,oe.fromBase64)((0,Z.assertNotEmpty)(e.proof.leaf_hash)),aunts:(0,Z.assertArray)(e.proof.aunts).map(oe.fromBase64)}}}function xm(e){return{tx:(0,oe.fromBase64)((0,Z.assertNotEmpty)(e.tx)),result:di((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,oe.fromHex)((0,Z.assertNotEmpty)(e.hash)),proof:(0,Z.may)(i0,e.proof)}}function o0(e){return{totalCount:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_count)),txs:(0,Z.assertArray)(e.txs).map(xm)}}function a0(e){const n=(0,oe.fromBase64)((0,Z.assertNotEmpty)(e.tx));return{tx:n,hash:(0,Mb.hashTx)(n),result:di(e.result),height:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.height))}}function s0(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 jm(e){var n;return{header:Ps((0,Z.assertObject)(e.header)),lastCommit:e.last_commit.block_id.hash?Zm((0,Z.assertObject)(e.last_commit)):null,txs:e.data.txs?(0,Z.assertArray)(e.data.txs).map(oe.fromBase64):[],evidence:((n=e.evidence)==null?void 0:n.evidence)??[]}}function ey(e){return{blockId:ks(e.block_id),block:jm(e.block)}}function d0(e){return{totalCount:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_count)),blocks:(0,Z.assertArray)(e.blocks).map(ey)}}function u0(e){return{total:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total)),totalBytes:(0,re.apiToSmallInt)((0,Z.assertNotEmpty)(e.total_bytes))}}class Lc{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 ey(n.result)}static decodeBlockResults(n){return Lb(n.result)}static decodeBlockSearch(n){return d0(n.result)}static decodeBlockchain(n){return zb(n.result)}static decodeBroadcastTxSync(n){return Yb(n.result)}static decodeBroadcastTxAsync(n){return Lc.decodeBroadcastTxSync(n)}static decodeBroadcastTxCommit(n){return Zb(n.result)}static decodeCommit(n){return jb(n.result)}static decodeGenesis(n){return e0((0,Z.assertObject)(n.result.genesis))}static decodeHealth(){return null}static decodeNumUnconfirmedTxs(n){return u0(n.result)}static decodeStatus(n){return r0(n.result)}static decodeNewBlockEvent(n){return jm(n.data.value.block)}static decodeNewBlockHeaderEvent(n){return Ps(n.data.value.header)}static decodeTxEvent(n){return a0(n.data.value.TxResult)}static decodeTx(n){return xm(n.result)}static decodeTxSearch(n){return o0(n.result)}static decodeValidators(n){return s0(n.result)}}bn.Responses=Lc;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Responses=e.Params=void 0;var n=Ss;Object.defineProperty(e,"Params",{enumerable:!0,get:function(){return n.Params}});var t=bn;Object.defineProperty(e,"Responses",{enumerable:!0,get:function(){return t.Responses}})})(Lm);var c0=G.commonjsGlobal&&G.commonjsGlobal.__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]}),l0=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),f0=G.commonjsGlobal&&G.commonjsGlobal.__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)&&c0(n,e,t);return l0(n,e),n};Object.defineProperty(gs,"__esModule",{value:!0});gs.Tendermint37Client=void 0;const p0=ot,_o=so,ue=Lm,he=f0(hs);class oa{static async connect(n){let t;return typeof n=="object"?t=new _o.HttpClient(n):t=n.startsWith("http://")||n.startsWith("https://")?new _o.HttpClient(n):new _o.WebsocketClient(n),await this.detectVersion(t),oa.create(t)}static async create(n){return new oa(n)}static async detectVersion(n){const t=(0,p0.createJsonRpcRequest)(he.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:he.Method.AbciInfo};return this.doCall(n,ue.Params.encodeAbciInfo,ue.Responses.decodeAbciInfo)}async abciQuery(n){const t={params:n,method:he.Method.AbciQuery};return this.doCall(t,ue.Params.encodeAbciQuery,ue.Responses.decodeAbciQuery)}async block(n){const t={method:he.Method.Block,params:{height:n}};return this.doCall(t,ue.Params.encodeBlock,ue.Responses.decodeBlock)}async blockResults(n){const t={method:he.Method.BlockResults,params:{height:n}};return this.doCall(t,ue.Params.encodeBlockResults,ue.Responses.decodeBlockResults)}async blockSearch(n){const t={params:n,method:he.Method.BlockSearch},r=await this.doCall(t,ue.Params.encodeBlockSearch,ue.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:he.Method.Blockchain,params:{minHeight:n,maxHeight:t}};return this.doCall(r,ue.Params.encodeBlockchain,ue.Responses.decodeBlockchain)}async broadcastTxSync(n){const t={params:n,method:he.Method.BroadcastTxSync};return this.doCall(t,ue.Params.encodeBroadcastTx,ue.Responses.decodeBroadcastTxSync)}async broadcastTxAsync(n){const t={params:n,method:he.Method.BroadcastTxAsync};return this.doCall(t,ue.Params.encodeBroadcastTx,ue.Responses.decodeBroadcastTxAsync)}async broadcastTxCommit(n){const t={params:n,method:he.Method.BroadcastTxCommit};return this.doCall(t,ue.Params.encodeBroadcastTx,ue.Responses.decodeBroadcastTxCommit)}async commit(n){const t={method:he.Method.Commit,params:{height:n}};return this.doCall(t,ue.Params.encodeCommit,ue.Responses.decodeCommit)}async genesis(){const n={method:he.Method.Genesis};return this.doCall(n,ue.Params.encodeGenesis,ue.Responses.decodeGenesis)}async health(){const n={method:he.Method.Health};return this.doCall(n,ue.Params.encodeHealth,ue.Responses.decodeHealth)}async numUnconfirmedTxs(){const n={method:he.Method.NumUnconfirmedTxs};return this.doCall(n,ue.Params.encodeNumUnconfirmedTxs,ue.Responses.decodeNumUnconfirmedTxs)}async status(){const n={method:he.Method.Status};return this.doCall(n,ue.Params.encodeStatus,ue.Responses.decodeStatus)}subscribeNewBlock(){const n={method:he.Method.Subscribe,query:{type:he.SubscriptionEventType.NewBlock}};return this.subscribe(n,ue.Responses.decodeNewBlockEvent)}subscribeNewBlockHeader(){const n={method:he.Method.Subscribe,query:{type:he.SubscriptionEventType.NewBlockHeader}};return this.subscribe(n,ue.Responses.decodeNewBlockHeaderEvent)}subscribeTx(n){const t={method:he.Method.Subscribe,query:{type:he.SubscriptionEventType.Tx,raw:n}};return this.subscribe(t,ue.Responses.decodeTxEvent)}async tx(n){const t={params:n,method:he.Method.Tx};return this.doCall(t,ue.Params.encodeTx,ue.Responses.decodeTx)}async txSearch(n){const t={params:n,method:he.Method.TxSearch};return this.doCall(t,ue.Params.encodeTxSearch,ue.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:he.Method.Validators,params:n};return this.doCall(t,ue.Params.encodeValidators,ue.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,_o.instanceOfRpcStreamingClient)(this.client))throw new Error("This RPC client type cannot subscribe to events");const r=ue.Params.encodeSubscribe(n);return this.client.listen(r).map(h=>t(h))}}gs.Tendermint37Client=oa;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Tendermint37Client=e.VoteType=e.broadcastTxSyncSuccess=e.broadcastTxCommitSuccess=e.SubscriptionEventType=e.Method=void 0;var n=hs;Object.defineProperty(e,"Method",{enumerable:!0,get:function(){return n.Method}}),Object.defineProperty(e,"SubscriptionEventType",{enumerable:!0,get:function(){return n.SubscriptionEventType}});var t=Fm;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=gs;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return r.Tendermint37Client}})})(ia);var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.connectComet=Yn.isComet38Client=Yn.isTendermint37Client=Yn.isTendermint34Client=void 0;const ny=ea,ty=Ji,ry=ia;function m0(e){return e instanceof ty.Tendermint34Client}Yn.isTendermint34Client=m0;function y0(e){return e instanceof ry.Tendermint37Client}Yn.isTendermint37Client=y0;function h0(e){return e instanceof ny.Comet38Client}Yn.isComet38Client=h0;async function g0(e){let n;const t=await ry.Tendermint37Client.connect(e),r=(await t.status()).nodeInfo.version;return r.startsWith("0.37.")?n=t:r.startsWith("0.38.")?(t.disconnect(),n=await ny.Comet38Client.connect(e)):(t.disconnect(),n=await ty.Tendermint34Client.connect(e)),n}Yn.connectComet=g0;(function(e){var n=G.commonjsGlobal&&G.commonjsGlobal.__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=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(R,B){Object.defineProperty(R,"default",{enumerable:!0,value:B})}:function(R,B){R.default=B}),r=G.commonjsGlobal&&G.commonjsGlobal.__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=zn;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=Qe;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(ea);var v=ea;Object.defineProperty(e,"Comet38Client",{enumerable:!0,get:function(){return v.Comet38Client}});var C=so;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=Ji;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(Ji);var D=Ji;Object.defineProperty(e,"Tendermint34Client",{enumerable:!0,get:function(){return D.Tendermint34Client}}),e.tendermint37=r(ia);var J=ia;Object.defineProperty(e,"Tendermint37Client",{enumerable:!0,get:function(){return J.Tendermint37Client}});var I=Yn;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=fo;Object.defineProperty(e,"BlockIdFlag",{enumerable:!0,get:function(){return g.BlockIdFlag}})})(ao);var we={};Object.defineProperty(we,"__esModule",{value:!0});we.StargateClient=we.BroadcastTxError=we.assertIsDeliverTxFailure=we.assertIsDeliverTxSuccess=we.isDeliverTxSuccess=we.isDeliverTxFailure=we.TimeoutError=void 0;const S0=Hn,Gd=ae,Vl=be,Ql=ao,Wl=Re,k0=io,P0=$i,R0=xi,Uo=Wi,v0=We,B0=oo;class iy extends Error{constructor(n,t){super(n),this.txId=t}}we.TimeoutError=iy;function $c(e){return!!e.code}we.isDeliverTxFailure=$c;function oy(e){return!$c(e)}we.isDeliverTxSuccess=oy;function b0(e){if($c(e))throw new Error(`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}we.assertIsDeliverTxSuccess=b0;function O0(e){if(oy(e))throw new Error(`Transaction ${e.transactionHash} did not fail at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`)}we.assertIsDeliverTxFailure=O0;class ay 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}}we.BroadcastTxError=ay;class aa{static async connect(n,t={}){const r=await(0,Ql.connectComet)(n);return aa.create(r,t)}static async create(n,t={}){return new aa(n,t)}constructor(n,t){n&&(this.cometClient=n,this.queryClient=v0.QueryClient.withExtensions(n,Uo.setupAuthExtension,Uo.setupBankExtension,Uo.setupStakingExtension,Uo.setupTxExtension));const{accountParser:r=P0.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,Gd.toHex)(t.blockId.hash).toUpperCase(),header:{version:{block:new Vl.Uint53(t.block.header.version.block).toString(),app:new Vl.Uint53(t.block.header.version.app).toString()},height:t.block.header.height,chainId:t.block.header.chainId,time:(0,Ql.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,Wl.assert)(v.balance),h!==null?(0,S0.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,B0.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 iy(`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,Wl.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 ay(t.code,t.codespace??"",t.log)):(0,Gd.toHex)(t.hash).toUpperCase()}async txsQuery(n){return(await this.forceGetCometClient().txSearchAll({query:n})).txs.map(r=>{const o=k0.TxMsgData.decode(r.result.data??new Uint8Array);return{height:r.height,txIndex:r.index,hash:(0,Gd.toHex)(r.hash).toUpperCase(),code:r.result.code,events:r.result.events.map(R0.fromTendermintEvent),rawLog:r.result.log||"",tx:r.tx,msgResponses:o.msgResponses,gasUsed:r.result.gasUsed,gasWanted:r.result.gasWanted}})}}we.StargateClient=aa;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SigningStargateClient=e.createDefaultAminoConverters=e.defaultRegistryTypes=void 0;const n=Hn,t=ae,r=be,o=Xn,h=ao,v=Re,C=G.coin,w=eo,D=ro,J=j.signing,I=j.tx,g=G.tx,R=Xi,B=Kt,d=Wi,s=Wi,y=we;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(),$=r.Int53.fromString(k.sequence).toNumber(),L=(0,o.makeAuthInfoBytes)([{pubkey:p,sequence:$}],k.fee.amount,W,k.fee.granter,k.fee.payer,A);return I.TxRaw.fromPartial({bodyBytes:O,authInfoBytes:L,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=_})(om);(function(e){var n=G.commonjsGlobal&&G.commonjsGlobal.__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=G.commonjsGlobal&&G.commonjsGlobal.__setModuleDefault||(Object.create?function(d,s){Object.defineProperty(d,"default",{enumerable:!0,value:s})}:function(d,s){d.default=s}),r=G.commonjsGlobal&&G.commonjsGlobal.__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=$i;Object.defineProperty(e,"accountFromAny",{enumerable:!0,get:function(){return o.accountFromAny}});var h=Xi;Object.defineProperty(e,"AminoTypes",{enumerable:!0,get:function(){return h.AminoTypes}});var v=xi;Object.defineProperty(e,"fromTendermintEvent",{enumerable:!0,get:function(){return v.fromTendermintEvent}});var C=Kt;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(Ze);var w=Wi;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=Pt;Object.defineProperty(e,"makeMultisignedTx",{enumerable:!0,get:function(){return D.makeMultisignedTx}}),Object.defineProperty(e,"makeMultisignedTxBytes",{enumerable:!0,get:function(){return D.makeMultisignedTxBytes}});var J=We;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=oo;Object.defineProperty(e,"isSearchTxQueryArray",{enumerable:!0,get:function(){return I.isSearchTxQueryArray}});var g=om;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=we;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=Xn;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}})})(ct);var Kc={},po={},Rs={},Bt={};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.createWasmAminoConverters=Bt.accessTypeToString=Bt.accessTypeFromString=void 0;const Fd=Hn,mn=ae,on=G.types;function sy(e){switch(e){case"Unspecified":return on.AccessType.ACCESS_TYPE_UNSPECIFIED;case"Nobody":return on.AccessType.ACCESS_TYPE_NOBODY;case"OnlyAddress":return on.AccessType.ACCESS_TYPE_ONLY_ADDRESS;case"Everybody":return on.AccessType.ACCESS_TYPE_EVERYBODY;case"AnyOfAddresses":return on.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES;default:return on.AccessType.UNRECOGNIZED}}Bt.accessTypeFromString=sy;function dy(e){switch(e){case on.AccessType.ACCESS_TYPE_UNSPECIFIED:return"Unspecified";case on.AccessType.ACCESS_TYPE_NOBODY:return"Nobody";case on.AccessType.ACCESS_TYPE_ONLY_ADDRESS:return"OnlyAddress";case on.AccessType.ACCESS_TYPE_EVERYBODY:return"Everybody";case on.AccessType.ACCESS_TYPE_ANY_OF_ADDRESSES:return"AnyOfAddresses";case on.AccessType.UNRECOGNIZED:default:return"UNRECOGNIZED"}}Bt.accessTypeToString=dy;function A0(){return{"/cosmwasm.wasm.v1.MsgStoreCode":{aminoType:"wasm/MsgStoreCode",toAmino:({sender:e,wasmByteCode:n,instantiatePermission:t})=>({sender:e,wasm_byte_code:(0,mn.toBase64)(n),instantiate_permission:t?{permission:dy(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,mn.fromBase64)(n),instantiatePermission:t?on.AccessConfig.fromPartial({permission:sy(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,mn.fromUtf8)(r)),funds:o,admin:(0,Fd.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,mn.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,mn.fromUtf8)(r)),funds:o,admin:(0,Fd.omitDefault)(h),salt:(0,mn.toBase64)(v),fix_msg:(0,Fd.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,mn.toUtf8)(JSON.stringify(r)),funds:[...o],admin:h??"",salt:(0,mn.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,mn.fromUtf8)(t)),funds:r}),fromAmino:({sender:e,contract:n,msg:t,funds:r})=>({sender:e,contract:n,msg:(0,mn.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,mn.fromUtf8)(r))}),fromAmino:({sender:e,contract:n,code_id:t,msg:r})=>({sender:e,contract:n,codeId:BigInt(t),msg:(0,mn.toUtf8)(JSON.stringify(r))})}}}Bt.createWasmAminoConverters=A0;var Ie={};Object.defineProperty(Ie,"__esModule",{value:!0});Ie.isMsgExecuteEncodeObject=Ie.isMsgMigrateEncodeObject=Ie.isMsgClearAdminEncodeObject=Ie.isMsgUpdateAdminEncodeObject=Ie.isMsgInstantiateContract2EncodeObject=Ie.isMsgInstantiateContractEncodeObject=Ie.isMsgStoreCodeEncodeObject=Ie.wasmTypes=void 0;const Tt=G.tx$1;Ie.wasmTypes=[["/cosmwasm.wasm.v1.MsgClearAdmin",Tt.MsgClearAdmin],["/cosmwasm.wasm.v1.MsgExecuteContract",Tt.MsgExecuteContract],["/cosmwasm.wasm.v1.MsgMigrateContract",Tt.MsgMigrateContract],["/cosmwasm.wasm.v1.MsgStoreCode",Tt.MsgStoreCode],["/cosmwasm.wasm.v1.MsgInstantiateContract",Tt.MsgInstantiateContract],["/cosmwasm.wasm.v1.MsgInstantiateContract2",Tt.MsgInstantiateContract2],["/cosmwasm.wasm.v1.MsgUpdateAdmin",Tt.MsgUpdateAdmin]];function I0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgStoreCode"}Ie.isMsgStoreCodeEncodeObject=I0;function T0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgInstantiateContract"}Ie.isMsgInstantiateContractEncodeObject=T0;function C0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgInstantiateContract2"}Ie.isMsgInstantiateContract2EncodeObject=C0;function N0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgUpdateAdmin"}Ie.isMsgUpdateAdminEncodeObject=N0;function w0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgClearAdmin"}Ie.isMsgClearAdminEncodeObject=w0;function E0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgMigrateContract"}Ie.isMsgMigrateEncodeObject=E0;function _0(e){return e.typeUrl==="/cosmwasm.wasm.v1.MsgExecuteContract"}Ie.isMsgExecuteEncodeObject=_0;var vs={},uy={};(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=Se,t=G.types,r=G.binary,o=G.helpers;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})(uy);Object.defineProperty(vs,"__esModule",{value:!0});vs.setupWasmExtension=void 0;const Gl=ae,or=ct,Ld=uy;function U0(e){const n=(0,or.createProtobufRpcClient)(e),t=new Ld.QueryClientImpl(n);return{wasm:{listCodeInfo:async r=>{const o={pagination:(0,or.createPagination)(r)};return t.Codes(o)},getCode:async r=>{const o=Ld.QueryCodeRequest.fromPartial({codeId:BigInt(r)});return t.Code(o)},listContractsByCodeId:async(r,o)=>{const h=Ld.QueryContractsByCodeRequest.fromPartial({codeId:BigInt(r),pagination:(0,or.createPagination)(o)});return t.ContractsByCode(h)},listContractsByCreator:async(r,o)=>{const h={creatorAddress:r,pagination:(0,or.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,or.createPagination)(o)};return t.ContractHistory(h)},getAllContractState:async(r,o)=>{const h={address:r,pagination:(0,or.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,Gl.toUtf8)(JSON.stringify(o))},{data:v}=await t.SmartContractState(h);let C;try{C=(0,Gl.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}`)}}}}}vs.setupWasmExtension=U0;(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=Bt;Object.defineProperty(e,"createWasmAminoConverters",{enumerable:!0,get:function(){return n.createWasmAminoConverters}});var t=Ie;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=vs;Object.defineProperty(e,"setupWasmExtension",{enumerable:!0,get:function(){return r.setupWasmExtension}})})(Rs);Object.defineProperty(po,"__esModule",{value:!0});po.CosmWasmClient=void 0;const ar=ae,Fl=be,xn=ct,Ll=ao,sr=Re,J0=io,$d=G.types,D0=Rs;class sa{static async connect(n){const t=await(0,Ll.connectComet)(n);return sa.create(t)}static async create(n){return new sa(n)}constructor(n){this.codesCache=new Map,n&&(this.cometClient=n,this.queryClient=xn.QueryClient.withExtensions(n,xn.setupAuthExtension,xn.setupBankExtension,D0.setupWasmExtension,xn.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,xn.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,ar.toHex)(t.blockId.hash).toUpperCase(),header:{version:{block:new Fl.Uint53(t.block.header.version.block).toString(),app:new Fl.Uint53(t.block.header.version.app).toString()},height:t.block.header.height,chainId:t.block.header.chainId,time:(0,Ll.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,xn.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 xn.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,sr.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 xn.BroadcastTxError(t.code,t.codespace??"",t.log)):(0,ar.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,sr.assert)(r.creator&&r.codeId&&r.dataHash,"entry incomplete"),{id:Number(r.codeId),creator:r.creator,checksum:(0,ar.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,sr.assert)(r&&r.codeId&&r.creator&&r.dataHash&&o,"codeInfo missing or incomplete");const h={id:Number(r.codeId),creator:r.creator,checksum:(0,ar.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,sr.assert)(t,"address missing"),(0,sr.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={[$d.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT]:"Init",[$d.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS]:"Genesis",[$d.ContractCodeHistoryOperationType.CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE]:"Migrate"};return(t.entries||[]).map(o=>((0,sr.assert)(o.operation&&o.codeId&&o.msg),{operation:r[o.operation],codeId:Number(o.codeId),msg:JSON.parse((0,ar.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=J0.TxMsgData.decode(r.result.data??new Uint8Array);return{height:r.height,txIndex:r.index,hash:(0,ar.toHex)(r.hash).toUpperCase(),code:r.result.code,events:r.result.events.map(xn.fromTendermintEvent),rawLog:r.result.log||"",tx:r.tx,msgResponses:o.msgResponses,gasUsed:r.result.gasUsed,gasWanted:r.result.gasWanted}})}}po.CosmWasmClient=sa;var ui={};Object.defineProperty(ui,"__esModule",{value:!0});ui.fromBinary=ui.toBinary=void 0;const da=ae;function M0(e){return(0,da.toBase64)((0,da.toUtf8)(JSON.stringify(e)))}ui.toBinary=M0;function q0(e){return JSON.parse((0,da.fromUtf8)((0,da.fromBase64)(e)))}ui.fromBinary=q0;var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.instantiate2Address=ci._instantiate2AddressIntermediate=void 0;const $l=qe,Ei=ae,H0=be,V0=Re;function Q0(e,n){return new $l.Sha256((0,$l.sha256)((0,Ei.toAscii)(e))).update(n).digest()}function Jo(e){return H0.Uint64.fromNumber(e).toBytesBigEndian()}function cy(e,n,t,r,o){(0,V0.assert)(e.length===32);const h=(0,Ei.fromBech32)(n).data,v=typeof r=="string"?(0,Ei.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,Ei.toAscii)("wasm"),0,...Jo(e.length),...e,...Jo(h.length),...h,...Jo(t.length),...t,...Jo(v.length),...v]),w=Q0("module",C),D=(0,Ei.toBech32)(o,w);return{key:C,addressData:w,address:D}}ci._instantiate2AddressIntermediate=cy;function W0(e,n,t,r){return cy(e,n,t,null,r).address}ci.instantiate2Address=W0;var li={},G0=G.commonjsGlobal&&G.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(li,"__esModule",{value:!0});li.SigningCosmWasmClient=li.findAttribute=void 0;const Do=Hn,F0=qe,Ct=ae,Nt=be,jn=Xn,Oe=ct,L0=ao,Ci=Re,$0=eo,Kl=ro,K0=j.signing,Mo=j.tx,wt=G.tx$1,z0=G0(G.require$$13),Y0=po,zl=Rs;function Go(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}li.findAttribute=Go;function Et(e){return`Error when broadcasting tx ${e.transactionHash} at height ${e.height}. Code: ${e.code}; Raw log: ${e.rawLog}`}class Di extends Y0.CosmWasmClient{static async connectWithSigner(n,t,r={}){const o=await(0,L0.connectComet)(n);return Di.createWithSigner(o,t,r)}static async createWithSigner(n,t,r={}){return new Di(n,t,r)}static async offline(n,t={}){return new Di(void 0,n,t)}constructor(n,t,r){super(n);const{registry:o=new jn.Registry([...Oe.defaultRegistryTypes,...zl.wasmTypes]),aminoTypes:h=new Oe.AminoTypes({...(0,Oe.createDefaultAminoConverters)(),...(0,zl.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,Do.encodeSecp256k1Pubkey)(h.pubkey),{sequence:C}=await this.getSequence(n),{gasInfo:w}=await this.forceGetQueryClient().tx.simulate(o,r,v,C);return(0,Ci.assertDefined)(w),Nt.Uint53.fromString(w.gasUsed.toString()).toNumber()}async upload(n,t,r,o="",h){const v=z0.default.gzip(t,{level:9}),C={typeUrl:"/cosmwasm.wasm.v1.MsgStoreCode",value:wt.MsgStoreCode.fromPartial({sender:n,wasmByteCode:v,instantiatePermission:h})},w=r=="auto"?1.1:r,D=await this.signAndBroadcast(n,[C],w,o);if((0,Oe.isDeliverTxFailure)(D))throw new Error(Et(D));const J=Go(D.events,"store_code","code_id");return{checksum:(0,Ct.toHex)((0,F0.sha256)(t)),originalSize:t.length,compressedSize:v.length,codeId:Number.parseInt(J.value,10),logs:Oe.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:wt.MsgInstantiateContract.fromPartial({sender:n,codeId:BigInt(new Nt.Uint53(t).toString()),label:o,msg:(0,Ct.toUtf8)(JSON.stringify(r)),funds:[...v.funds||[]],admin:v.admin})},w=await this.signAndBroadcast(n,[C],h,v.memo);if((0,Oe.isDeliverTxFailure)(w))throw new Error(Et(w));return{contractAddress:Go(w.events,"instantiate","_contract_address").value,logs:Oe.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:wt.MsgInstantiateContract2.fromPartial({sender:n,codeId:BigInt(new Nt.Uint53(t).toString()),label:h,msg:(0,Ct.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,Oe.isDeliverTxFailure)(D))throw new Error(Et(D));return{contractAddress:Go(D.events,"instantiate","_contract_address").value,logs:Oe.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:wt.MsgUpdateAdmin.fromPartial({sender:n,contract:t,newAdmin:r})},C=await this.signAndBroadcast(n,[v],o,h);if((0,Oe.isDeliverTxFailure)(C))throw new Error(Et(C));return{logs:Oe.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:wt.MsgClearAdmin.fromPartial({sender:n,contract:t})},v=await this.signAndBroadcast(n,[h],r,o);if((0,Oe.isDeliverTxFailure)(v))throw new Error(Et(v));return{logs:Oe.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:wt.MsgMigrateContract.fromPartial({sender:n,contract:t,codeId:BigInt(new Nt.Uint53(r).toString()),msg:(0,Ct.toUtf8)(JSON.stringify(o))})},w=await this.signAndBroadcast(n,[C],h,v);if((0,Oe.isDeliverTxFailure)(w))throw new Error(Et(w));return{logs:Oe.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:wt.MsgExecuteContract.fromPartial({sender:n,contract:C.contractAddress,msg:(0,Ct.toUtf8)(JSON.stringify(C.msg)),funds:[...C.funds||[]]})})),v=await this.signAndBroadcast(n,h,r,o);if((0,Oe.isDeliverTxFailure)(v))throw new Error(Et(v));return{logs:Oe.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:Kl.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:Kl.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:$0.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,Ci.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,Oe.calculateFee)(Math.round(D*J),this.gasPrice)}else v=r;const C=await this.sign(n,t,v,o,void 0,h),w=Mo.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,Ci.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,Oe.calculateFee)(Math.round(D*J),this.gasPrice)}else v=r;const C=await this.sign(n,t,v,o,void 0,h),w=Mo.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,jn.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,Ci.assert)(!(0,jn.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,jn.encodePubkey)((0,Do.encodeSecp256k1Pubkey)(D.pubkey)),I=K0.SignMode.SIGN_MODE_LEGACY_AMINO_JSON,g=t.map(H=>this.aminoTypes.toAmino(H)),R=(0,Do.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=Nt.Int53.fromString(d.fee.gas).toNumber(),_=Nt.Int53.fromString(d.sequence).toNumber(),U=(0,jn.makeAuthInfoBytes)([{pubkey:J,sequence:_}],d.fee.amount,E,d.fee.granter,d.fee.payer,I);return Mo.TxRaw.fromPartial({bodyBytes:y,authInfoBytes:U,signatures:[(0,Ct.fromBase64)(B.signature)]})}async signDirect(n,t,r,o,{accountNumber:h,sequence:v,chainId:C},w){(0,Ci.assert)((0,jn.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,jn.encodePubkey)((0,Do.encodeSecp256k1Pubkey)(D.pubkey)),I={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{messages:t,memo:o,timeoutHeight:w}},g=this.registry.encode(I),R=Nt.Int53.fromString(r.gas).toNumber(),B=(0,jn.makeAuthInfoBytes)([{pubkey:J,sequence:v}],r.amount,R,r.granter,r.payer),d=(0,jn.makeSignDoc)(g,B,C,h),{signature:s,signed:y}=await this.signer.signDirect(n,d);return Mo.TxRaw.fromPartial({bodyBytes:y.bodyBytes,authInfoBytes:y.authInfoBytes,signatures:[(0,Ct.fromBase64)(s.signature)]})}}li.SigningCosmWasmClient=Di;(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=po;Object.defineProperty(e,"CosmWasmClient",{enumerable:!0,get:function(){return n.CosmWasmClient}});var t=ui;Object.defineProperty(e,"fromBinary",{enumerable:!0,get:function(){return t.fromBinary}}),Object.defineProperty(e,"toBinary",{enumerable:!0,get:function(){return t.toBinary}});var r=ci;Object.defineProperty(e,"_instantiate2AddressIntermediate",{enumerable:!0,get:function(){return r._instantiate2AddressIntermediate}}),Object.defineProperty(e,"instantiate2Address",{enumerable:!0,get:function(){return r.instantiate2Address}});var o=Rs;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=li;Object.defineProperty(e,"SigningCosmWasmClient",{enumerable:!0,get:function(){return h.SigningCosmWasmClient}})})(Kc);class zc extends rp.ChainContext{}const tn=class tn extends zc{async getWrappedAsset(n){const t=await this.getTokenBridge(),r=new Ve(await t.getWrappedAsset(n)),o=G.b58.encode(r.toUniversalAddress().toUint8Array()),h=`factory/${tn.gatewayAddress(this.network)}/${o}`;return new Ve(h)}static getGatewaySourceChannel(n,t){const r=Yt.getIbcChannels(n,t);if(!r)throw new Error("No channels configured for chain "+t);if(!(tn.chain in r))throw new Error("No channel configured for chain "+t);return r[tn.chain]}static deriveIbcDenom(n,t,r){const o=this.getGatewaySourceChannel(n,t),h=G.bytes.encode(`${Hu}/${o}/${r}`),v=G.hex.encode(G.sha256(h));return new Ve(`ibc/${v.toUpperCase()}`)}static factoryToCw20(n){if(n.denomType!=="factory")throw new Error("Invalid address type");return new Ve(Ve.encode(n.domain,G.b58.decode(n.denom)))}static cw20ToFactory(n,t){const r=G.b58.encode(t.toUniversalAddress().toUint8Array());return new Ve(`factory/${tn.gatewayAddress(n)}/${r}`)}static makeTransferMsg(n,t,r=0n,o,h){const v=G.b64.encode(t.toUint8Array()),C={chain:G.toChainId(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}}}};le(tn,"chain","Wormchain"),le(tn,"gatewayAddress",n=>G.CONFIG[n].chains[tn.chain].contracts.gateway),le(tn,"tokenBridgeAddress",n=>G.CONFIG[n].chains[tn.chain].contracts.tokenBridge),le(tn,"coreAddress",n=>G.CONFIG[n].chains[tn.chain].contracts.coreBridge);let ua=tn;const yn=class yn extends rp.PlatformContext{constructor(n,t){super(n,t??G.networkPlatformConfigs(n,yn._platform))}async getRpc(n){if(n in this.config&&this.config[n].rpc)return await Kc.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 zc(n,this,t)}static getIbcChannels(n,t){return uu.has(n,t)?uu.get(n,t):null}static nativeTokenId(n,t){if(!this.isSupportedChain(t))throw new Error(`invalid chain for CosmWasm: ${t}`);return G.Wormhole.chainAddress(t,this.getNativeDenom(n,t))}static isSupportedChain(n){return G.chainToPlatform(n)===yn._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(G.isNative(r))return G.nativeDecimals(yn._platform);let o=new Ve(r).toString();o.startsWith("factory")&&(o=ua.factoryToCw20(new Ve(o)).toString());const{decimals:h}=await t.queryContractSmart(o,{token_info:{}});return h}static async getBalance(n,t,r,o){if(G.isNative(o)){const[C,w]=await yn.chainFromRpc(t),{amount:D}=await t.getBalance(r,this.getNativeDenom(C,n));return BigInt(D)}const h=new Ve(o).toString(),{amount:v}=await t.getBalance(r,h);return BigInt(v)}static async getBalances(n,t,r,o){const v=await yn.getQueryClient(t).bank.allBalances(r),[C,w]=await yn.chainFromRpc(t);return o.map(J=>{const I=G.isNative(J)?this.getNativeDenom(C,n):new Ve(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 oh.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=G.platformNativeChainIdToNetworkChain(yn._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 yn.getQueryClient(t).ibc.channel.channel(Hu,n)).channel)==null?void 0:h.counterparty)==null?void 0:v.channelId)??null}};le(yn,"_platform",Er),le(yn,"getQueryClient",n=>ct.QueryClient.withExtensions(n.cometClient,ct.setupBankExtension,ct.setupIbcExtension));let Yt=yn;function Yl(){return{typeUrl:"",value:new Uint8Array(0)}}const ge={encode(e,n=G._m0.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 G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Yl();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:Zl(e.typeUrl)?globalThis.String(e.typeUrl):"",value:Zl(e.value)?Z0(e.value):new Uint8Array(0)}},toJSON(e){const n={};return e.typeUrl!==""&&(n.typeUrl=e.typeUrl),e.value.length!==0&&(n.value=X0(e.value)),n},create(e){return ge.fromPartial(e??{})},fromPartial(e){var n,t;const r=Yl();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 Z0(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 X0(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 Zl(e){return e!=null}G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());function Xl(){return{denom:"",amount:""}}const Te={encode(e,n=G._m0.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 G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=Xl();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:xl(e.denom)?globalThis.String(e.denom):"",amount:xl(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 Te.fromPartial(e??{})},fromPartial(e){var n,t;const r=Xl();return r.denom=(n=e.denom)!==null&&n!==void 0?n:"",r.amount=(t=e.amount)!==null&&t!==void 0?t:"",r}};function xl(e){return e!=null}function jl(){return{extraBitsStored:0,elems:new Uint8Array(0)}}const fr={encode(e,n=G._m0.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 G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=jl();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:ef(e.extraBitsStored)?globalThis.Number(e.extraBitsStored):0,elems:ef(e.elems)?x0(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=j0(e.elems)),n},create(e){return fr.fromPartial(e??{})},fromPartial(e){var n,t;const r=jl();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 x0(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 j0(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 ef(e){return e!=null}function nf(){return{key:new Uint8Array(0)}}const Ut={encode(e,n=G._m0.Writer.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=nf();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:tO(e.key)?eO(e.key):new Uint8Array(0)}},toJSON(e){const n={};return e.key.length!==0&&(n.key=nO(e.key)),n},create(e){return Ut.fromPartial(e??{})},fromPartial(e){var n;const t=nf();return t.key=(n=e.key)!==null&&n!==void 0?n:new Uint8Array(0),t}};function eO(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 nO(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 tO(e){return e!=null}G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());var Pe;(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"})(Pe||(Pe={}));function rO(e){switch(e){case 0:case"SIGN_MODE_UNSPECIFIED":return Pe.SIGN_MODE_UNSPECIFIED;case 1:case"SIGN_MODE_DIRECT":return Pe.SIGN_MODE_DIRECT;case 2:case"SIGN_MODE_TEXTUAL":return Pe.SIGN_MODE_TEXTUAL;case 3:case"SIGN_MODE_DIRECT_AUX":return Pe.SIGN_MODE_DIRECT_AUX;case 127:case"SIGN_MODE_LEGACY_AMINO_JSON":return Pe.SIGN_MODE_LEGACY_AMINO_JSON;case 128:case"SIGN_MODE_EIP712_V2":return Pe.SIGN_MODE_EIP712_V2;case 191:case"SIGN_MODE_EIP_191":return Pe.SIGN_MODE_EIP_191;case-1:case"UNRECOGNIZED":default:return Pe.UNRECOGNIZED}}function iO(e){switch(e){case Pe.SIGN_MODE_UNSPECIFIED:return"SIGN_MODE_UNSPECIFIED";case Pe.SIGN_MODE_DIRECT:return"SIGN_MODE_DIRECT";case Pe.SIGN_MODE_TEXTUAL:return"SIGN_MODE_TEXTUAL";case Pe.SIGN_MODE_DIRECT_AUX:return"SIGN_MODE_DIRECT_AUX";case Pe.SIGN_MODE_LEGACY_AMINO_JSON:return"SIGN_MODE_LEGACY_AMINO_JSON";case Pe.SIGN_MODE_EIP712_V2:return"SIGN_MODE_EIP712_V2";case Pe.SIGN_MODE_EIP_191:return"SIGN_MODE_EIP_191";case Pe.UNRECOGNIZED:default:return"UNRECOGNIZED"}}G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());function tf(){return{bodyBytes:new Uint8Array(0),authInfoBytes:new Uint8Array(0),signatures:[]}}const ca={encode(e,n=G._m0.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 G._m0.Reader?e:G._m0.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.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:Be(e.bodyBytes)?Mi(e.bodyBytes):new Uint8Array(0),authInfoBytes:Be(e.authInfoBytes)?Mi(e.authInfoBytes):new Uint8Array(0),signatures:globalThis.Array.isArray(e==null?void 0:e.signatures)?e.signatures.map(n=>Mi(n)):[]}},toJSON(e){var n;const t={};return e.bodyBytes.length!==0&&(t.bodyBytes=qi(e.bodyBytes)),e.authInfoBytes.length!==0&&(t.authInfoBytes=qi(e.authInfoBytes)),!((n=e.signatures)===null||n===void 0)&&n.length&&(t.signatures=e.signatures.map(r=>qi(r))),t},create(e){return ca.fromPartial(e??{})},fromPartial(e){var n,t,r;const o=tf();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 rf(){return{bodyBytes:new Uint8Array(0),authInfoBytes:new Uint8Array(0),chainId:"",accountNumber:"0"}}const Yc={encode(e,n=G._m0.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 G._m0.Reader?e:G._m0.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!==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=Bs(t.uint64());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{bodyBytes:Be(e.bodyBytes)?Mi(e.bodyBytes):new Uint8Array(0),authInfoBytes:Be(e.authInfoBytes)?Mi(e.authInfoBytes):new Uint8Array(0),chainId:Be(e.chainId)?globalThis.String(e.chainId):"",accountNumber:Be(e.accountNumber)?globalThis.String(e.accountNumber):"0"}},toJSON(e){const n={};return e.bodyBytes.length!==0&&(n.bodyBytes=qi(e.bodyBytes)),e.authInfoBytes.length!==0&&(n.authInfoBytes=qi(e.authInfoBytes)),e.chainId!==""&&(n.chainId=e.chainId),e.accountNumber!=="0"&&(n.accountNumber=e.accountNumber),n},create(e){return Yc.fromPartial(e??{})},fromPartial(e){var n,t,r,o;const h=rf();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 of(){return{messages:[],memo:"",timeoutHeight:"0",extensionOptions:[],nonCriticalExtensionOptions:[]}}const Zc={encode(e,n=G._m0.Writer.create()){for(const t of e.messages)ge.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)ge.encode(t,n.uint32(8186).fork()).ldelim();for(const t of e.nonCriticalExtensionOptions)ge.encode(t,n.uint32(16378).fork()).ldelim();return n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.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!==10)break;o.messages.push(ge.decode(t,t.uint32()));continue;case 2:if(h!==18)break;o.memo=t.string();continue;case 3:if(h!==24)break;o.timeoutHeight=Bs(t.uint64());continue;case 1023:if(h!==8186)break;o.extensionOptions.push(ge.decode(t,t.uint32()));continue;case 2047:if(h!==16378)break;o.nonCriticalExtensionOptions.push(ge.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=>ge.fromJSON(n)):[],memo:Be(e.memo)?globalThis.String(e.memo):"",timeoutHeight:Be(e.timeoutHeight)?globalThis.String(e.timeoutHeight):"0",extensionOptions:globalThis.Array.isArray(e==null?void 0:e.extensionOptions)?e.extensionOptions.map(n=>ge.fromJSON(n)):[],nonCriticalExtensionOptions:globalThis.Array.isArray(e==null?void 0:e.nonCriticalExtensionOptions)?e.nonCriticalExtensionOptions.map(n=>ge.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=>ge.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=>ge.toJSON(h))),!((r=e.nonCriticalExtensionOptions)===null||r===void 0)&&r.length&&(o.nonCriticalExtensionOptions=e.nonCriticalExtensionOptions.map(h=>ge.toJSON(h))),o},create(e){return Zc.fromPartial(e??{})},fromPartial(e){var n,t,r,o,h;const v=of();return v.messages=((n=e.messages)===null||n===void 0?void 0:n.map(C=>ge.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=>ge.fromPartial(C)))||[],v.nonCriticalExtensionOptions=((h=e.nonCriticalExtensionOptions)===null||h===void 0?void 0:h.map(C=>ge.fromPartial(C)))||[],v}};function af(){return{signerInfos:[],fee:void 0,tip:void 0}}const Xc={encode(e,n=G._m0.Writer.create()){for(const t of e.signerInfos)qt.encode(t,n.uint32(10).fork()).ldelim();return e.fee!==void 0&&Vt.encode(e.fee,n.uint32(18).fork()).ldelim(),e.tip!==void 0&&mr.encode(e.tip,n.uint32(26).fork()).ldelim(),n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=af();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.signerInfos.push(qt.decode(t,t.uint32()));continue;case 2:if(h!==18)break;o.fee=Vt.decode(t,t.uint32());continue;case 3:if(h!==26)break;o.tip=mr.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=>qt.fromJSON(n)):[],fee:Be(e.fee)?Vt.fromJSON(e.fee):void 0,tip:Be(e.tip)?mr.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=>qt.toJSON(r))),e.fee!==void 0&&(t.fee=Vt.toJSON(e.fee)),e.tip!==void 0&&(t.tip=mr.toJSON(e.tip)),t},create(e){return Xc.fromPartial(e??{})},fromPartial(e){var n;const t=af();return t.signerInfos=((n=e.signerInfos)===null||n===void 0?void 0:n.map(r=>qt.fromPartial(r)))||[],t.fee=e.fee!==void 0&&e.fee!==null?Vt.fromPartial(e.fee):void 0,t.tip=e.tip!==void 0&&e.tip!==null?mr.fromPartial(e.tip):void 0,t}};function sf(){return{publicKey:void 0,modeInfo:void 0,sequence:"0"}}const qt={encode(e,n=G._m0.Writer.create()){return e.publicKey!==void 0&&ge.encode(e.publicKey,n.uint32(10).fork()).ldelim(),e.modeInfo!==void 0&&On.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 G._m0.Reader?e:G._m0.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.publicKey=ge.decode(t,t.uint32());continue;case 2:if(h!==18)break;o.modeInfo=On.decode(t,t.uint32());continue;case 3:if(h!==24)break;o.sequence=Bs(t.uint64());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{publicKey:Be(e.publicKey)?ge.fromJSON(e.publicKey):void 0,modeInfo:Be(e.modeInfo)?On.fromJSON(e.modeInfo):void 0,sequence:Be(e.sequence)?globalThis.String(e.sequence):"0"}},toJSON(e){const n={};return e.publicKey!==void 0&&(n.publicKey=ge.toJSON(e.publicKey)),e.modeInfo!==void 0&&(n.modeInfo=On.toJSON(e.modeInfo)),e.sequence!=="0"&&(n.sequence=e.sequence),n},create(e){return qt.fromPartial(e??{})},fromPartial(e){var n;const t=sf();return t.publicKey=e.publicKey!==void 0&&e.publicKey!==null?ge.fromPartial(e.publicKey):void 0,t.modeInfo=e.modeInfo!==void 0&&e.modeInfo!==null?On.fromPartial(e.modeInfo):void 0,t.sequence=(n=e.sequence)!==null&&n!==void 0?n:"0",t}};function df(){return{single:void 0,multi:void 0}}const On={encode(e,n=G._m0.Writer.create()){return e.single!==void 0&&Ht.encode(e.single,n.uint32(10).fork()).ldelim(),e.multi!==void 0&&pr.encode(e.multi,n.uint32(18).fork()).ldelim(),n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.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.single=Ht.decode(t,t.uint32());continue;case 2:if(h!==18)break;o.multi=pr.decode(t,t.uint32());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{single:Be(e.single)?Ht.fromJSON(e.single):void 0,multi:Be(e.multi)?pr.fromJSON(e.multi):void 0}},toJSON(e){const n={};return e.single!==void 0&&(n.single=Ht.toJSON(e.single)),e.multi!==void 0&&(n.multi=pr.toJSON(e.multi)),n},create(e){return On.fromPartial(e??{})},fromPartial(e){const n=df();return n.single=e.single!==void 0&&e.single!==null?Ht.fromPartial(e.single):void 0,n.multi=e.multi!==void 0&&e.multi!==null?pr.fromPartial(e.multi):void 0,n}};function uf(){return{mode:0}}const Ht={encode(e,n=G._m0.Writer.create()){return e.mode!==0&&n.uint32(8).int32(e.mode),n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=uf();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:Be(e.mode)?rO(e.mode):0}},toJSON(e){const n={};return e.mode!==0&&(n.mode=iO(e.mode)),n},create(e){return Ht.fromPartial(e??{})},fromPartial(e){var n;const t=uf();return t.mode=(n=e.mode)!==null&&n!==void 0?n:0,t}};function cf(){return{bitarray:void 0,modeInfos:[]}}const pr={encode(e,n=G._m0.Writer.create()){e.bitarray!==void 0&&fr.encode(e.bitarray,n.uint32(10).fork()).ldelim();for(const t of e.modeInfos)On.encode(t,n.uint32(18).fork()).ldelim();return n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.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.bitarray=fr.decode(t,t.uint32());continue;case 2:if(h!==18)break;o.modeInfos.push(On.decode(t,t.uint32()));continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{bitarray:Be(e.bitarray)?fr.fromJSON(e.bitarray):void 0,modeInfos:globalThis.Array.isArray(e==null?void 0:e.modeInfos)?e.modeInfos.map(n=>On.fromJSON(n)):[]}},toJSON(e){var n;const t={};return e.bitarray!==void 0&&(t.bitarray=fr.toJSON(e.bitarray)),!((n=e.modeInfos)===null||n===void 0)&&n.length&&(t.modeInfos=e.modeInfos.map(r=>On.toJSON(r))),t},create(e){return pr.fromPartial(e??{})},fromPartial(e){var n;const t=cf();return t.bitarray=e.bitarray!==void 0&&e.bitarray!==null?fr.fromPartial(e.bitarray):void 0,t.modeInfos=((n=e.modeInfos)===null||n===void 0?void 0:n.map(r=>On.fromPartial(r)))||[],t}};function lf(){return{amount:[],gasLimit:"0",payer:"",granter:""}}const Vt={encode(e,n=G._m0.Writer.create()){for(const t of e.amount)Te.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 G._m0.Reader?e:G._m0.Reader.create(e);let r=n===void 0?t.len:t.pos+n;const o=lf();for(;t.pos<r;){const h=t.uint32();switch(h>>>3){case 1:if(h!==10)break;o.amount.push(Te.decode(t,t.uint32()));continue;case 2:if(h!==16)break;o.gasLimit=Bs(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=>Te.fromJSON(n)):[],gasLimit:Be(e.gasLimit)?globalThis.String(e.gasLimit):"0",payer:Be(e.payer)?globalThis.String(e.payer):"",granter:Be(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=>Te.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 Vt.fromPartial(e??{})},fromPartial(e){var n,t,r,o;const h=lf();return h.amount=((n=e.amount)===null||n===void 0?void 0:n.map(v=>Te.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 ff(){return{amount:[],tipper:""}}const mr={encode(e,n=G._m0.Writer.create()){for(const t of e.amount)Te.encode(t,n.uint32(10).fork()).ldelim();return e.tipper!==""&&n.uint32(18).string(e.tipper),n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.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!==10)break;o.amount.push(Te.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=>Te.fromJSON(n)):[],tipper:Be(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=>Te.toJSON(r))),e.tipper!==""&&(t.tipper=e.tipper),t},create(e){return mr.fromPartial(e??{})},fromPartial(e){var n,t;const r=ff();return r.amount=((n=e.amount)===null||n===void 0?void 0:n.map(o=>Te.fromPartial(o)))||[],r.tipper=(t=e.tipper)!==null&&t!==void 0?t:"",r}};function Mi(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 qi(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 Bs(e){return e.toString()}G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());function Be(e){return e!=null}function pf(){return{revisionNumber:"0",revisionHeight:"0"}}const Qt={encode(e,n=G._m0.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 G._m0.Reader?e:G._m0.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!==8)break;o.revisionNumber=mf(t.uint64());continue;case 2:if(h!==16)break;o.revisionHeight=mf(t.uint64());continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{revisionNumber:yf(e.revisionNumber)?globalThis.String(e.revisionNumber):"0",revisionHeight:yf(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 Qt.fromPartial(e??{})},fromPartial(e){var n,t;const r=pf();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 mf(e){return e.toString()}G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());function yf(e){return e!=null}function hf(){return{sourcePort:"",sourceChannel:"",token:void 0,sender:"",receiver:"",timeoutHeight:void 0,timeoutTimestamp:"0",memo:""}}const Fo={encode(e,n=G._m0.Writer.create()){return e.sourcePort!==""&&n.uint32(10).string(e.sourcePort),e.sourceChannel!==""&&n.uint32(18).string(e.sourceChannel),e.token!==void 0&&Te.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&&Qt.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 G._m0.Reader?e:G._m0.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.sourcePort=t.string();continue;case 2:if(h!==18)break;o.sourceChannel=t.string();continue;case 3:if(h!==26)break;o.token=Te.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=Qt.decode(t,t.uint32());continue;case 7:if(h!==56)break;o.timeoutTimestamp=oO(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:dt(e.sourcePort)?globalThis.String(e.sourcePort):"",sourceChannel:dt(e.sourceChannel)?globalThis.String(e.sourceChannel):"",token:dt(e.token)?Te.fromJSON(e.token):void 0,sender:dt(e.sender)?globalThis.String(e.sender):"",receiver:dt(e.receiver)?globalThis.String(e.receiver):"",timeoutHeight:dt(e.timeoutHeight)?Qt.fromJSON(e.timeoutHeight):void 0,timeoutTimestamp:dt(e.timeoutTimestamp)?globalThis.String(e.timeoutTimestamp):"0",memo:dt(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=Te.toJSON(e.token)),e.sender!==""&&(n.sender=e.sender),e.receiver!==""&&(n.receiver=e.receiver),e.timeoutHeight!==void 0&&(n.timeoutHeight=Qt.toJSON(e.timeoutHeight)),e.timeoutTimestamp!=="0"&&(n.timeoutTimestamp=e.timeoutTimestamp),e.memo!==""&&(n.memo=e.memo),n},create(e){return Fo.fromPartial(e??{})},fromPartial(e){var n,t,r,o,h,v;const C=hf();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?Te.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?Qt.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 oO(e){return e.toString()}G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());function dt(e){return e!=null}function gf(){return{key:new Uint8Array(0)}}const Eu={encode(e,n=G._m0.Writer.create()){return e.key.length!==0&&n.uint32(10).bytes(e.key),n},decode(e,n){const t=e instanceof G._m0.Reader?e:G._m0.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.key=t.bytes();continue}if((h&7)===4||h===0)break;t.skipType(h&7)}return o},fromJSON(e){return{key:dO(e.key)?aO(e.key):new Uint8Array(0)}},toJSON(e){const n={};return e.key.length!==0&&(n.key=sO(e.key)),n},create(e){return Eu.fromPartial(e??{})},fromPartial(e){var n;const t=gf();return t.key=(n=e.key)!==null&&n!==void 0?n:new Uint8Array(0),t}};function aO(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 sO(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 dO(e){return e!=null}const Sf=e=>e.split("/").map(n=>n.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")).join("/"),uO=(e,n=18)=>new G.BigNumber(e).multipliedBy(new G.BigNumber(10).pow(n));class wn extends G.BigNumber{static make(n){return new wn(n)}minus(n,t){return new wn(super.minus(n,t))}plus(n,t){return new wn(super.plus(n,t))}dividedBy(n,t){return new wn(super.dividedBy(n,t))}div(n,t){return new wn(super.div(n,t))}multipliedBy(n,t){return new wn(super.multipliedBy(n,t))}times(n,t){return new wn(super.times(n,t))}pow(n,t){return new wn(super.pow(n,t))}toWei(n=18){return uO(this,n)}}var xc={exports:{}},ly=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)}},cO=ly,er=Object.prototype.toString;function jc(e){return er.call(e)==="[object Array]"}function _u(e){return typeof e>"u"}function lO(e){return e!==null&&!_u(e)&&e.constructor!==null&&!_u(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function fO(e){return er.call(e)==="[object ArrayBuffer]"}function pO(e){return typeof FormData<"u"&&e instanceof FormData}function mO(e){var n;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?n=ArrayBuffer.isView(e):n=e&&e.buffer&&e.buffer instanceof ArrayBuffer,n}function yO(e){return typeof e=="string"}function hO(e){return typeof e=="number"}function fy(e){return e!==null&&typeof e=="object"}function Lo(e){if(er.call(e)!=="[object Object]")return!1;var n=Object.getPrototypeOf(e);return n===null||n===Object.prototype}function gO(e){return er.call(e)==="[object Date]"}function SO(e){return er.call(e)==="[object File]"}function kO(e){return er.call(e)==="[object Blob]"}function py(e){return er.call(e)==="[object Function]"}function PO(e){return fy(e)&&py(e.pipe)}function RO(e){return typeof URLSearchParams<"u"&&e instanceof URLSearchParams}function vO(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function BO(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function el(e,n){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),jc(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 Uu(){var e={};function n(o,h){Lo(e[h])&&Lo(o)?e[h]=Uu(e[h],o):Lo(o)?e[h]=Uu({},o):jc(o)?e[h]=o.slice():e[h]=o}for(var t=0,r=arguments.length;t<r;t++)el(arguments[t],n);return e}function bO(e,n,t){return el(n,function(o,h){t&&typeof o=="function"?e[h]=cO(o,t):e[h]=o}),e}function OO(e){return e.charCodeAt(0)===65279&&(e=e.slice(1)),e}var ln={isArray:jc,isArrayBuffer:fO,isBuffer:lO,isFormData:pO,isArrayBufferView:mO,isString:yO,isNumber:hO,isObject:fy,isPlainObject:Lo,isUndefined:_u,isDate:gO,isFile:SO,isBlob:kO,isFunction:py,isStream:PO,isURLSearchParams:RO,isStandardBrowserEnv:BO,forEach:el,merge:Uu,extend:bO,trim:vO,stripBOM:OO},dr=ln;function kf(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var my=function(n,t,r){if(!t)return n;var o;if(r)o=r(t);else if(dr.isURLSearchParams(t))o=t.toString();else{var h=[];dr.forEach(t,function(w,D){w===null||typeof w>"u"||(dr.isArray(w)?D=D+"[]":w=[w],dr.forEach(w,function(I){dr.isDate(I)?I=I.toISOString():dr.isObject(I)&&(I=JSON.stringify(I)),h.push(kf(D)+"="+kf(I))}))}),o=h.join("&")}if(o){var v=n.indexOf("#");v!==-1&&(n=n.slice(0,v)),n+=(n.indexOf("?")===-1?"?":"&")+o}return n},AO=ln;function bs(){this.handlers=[]}bs.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};bs.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)};bs.prototype.forEach=function(n){AO.forEach(this.handlers,function(r){r!==null&&n(r)})};var IO=bs,TO=ln,CO=function(n,t){TO.forEach(n,function(o,h){h!==t&&h.toUpperCase()===t.toUpperCase()&&(n[t]=o,delete n[h])})},yy=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},Kd,Pf;function hy(){if(Pf)return Kd;Pf=1;var e=yy;return Kd=function(t,r,o,h,v){var C=new Error(t);return e(C,r,o,h,v)},Kd}var zd,Rf;function NO(){if(Rf)return zd;Rf=1;var e=hy();return zd=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))},zd}var Yd,vf;function wO(){if(vf)return Yd;vf=1;var e=ln;return Yd=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(){}}}(),Yd}var Zd,Bf;function EO(){return Bf||(Bf=1,Zd=function(n){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(n)}),Zd}var Xd,bf;function _O(){return bf||(bf=1,Xd=function(n,t){return t?n.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):n}),Xd}var xd,Of;function UO(){if(Of)return xd;Of=1;var e=EO(),n=_O();return xd=function(r,o){return r&&!e(o)?n(r,o):o},xd}var jd,Af;function JO(){if(Af)return jd;Af=1;var e=ln,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 jd=function(r){var o={},h,v,C;return r&&e.forEach(r.split(`
4
4
  `),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},jd}var eu,If;function DO(){if(If)return eu;If=1;var e=ln;return eu=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}}(),eu}var nu,Tf;function Cf(){if(Tf)return nu;Tf=1;var e=ln,n=NO(),t=wO(),r=my,o=UO(),h=JO(),v=DO(),C=hy();return nu=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)})},nu}var Ne=ln,Nf=CO,MO=yy,qO={"Content-Type":"application/x-www-form-urlencoded"};function wf(e,n){!Ne.isUndefined(e)&&Ne.isUndefined(e["Content-Type"])&&(e["Content-Type"]=n)}function HO(){var e;return(typeof XMLHttpRequest<"u"||typeof G.dist.process<"u"&&Object.prototype.toString.call(G.dist.process)==="[object process]")&&(e=Cf()),e}function VO(e,n,t){if(Ne.isString(e))try{return(n||JSON.parse)(e),Ne.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}var Os={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:HO(),transformRequest:[function(n,t){return Nf(t,"Accept"),Nf(t,"Content-Type"),Ne.isFormData(n)||Ne.isArrayBuffer(n)||Ne.isBuffer(n)||Ne.isStream(n)||Ne.isFile(n)||Ne.isBlob(n)?n:Ne.isArrayBufferView(n)?n.buffer:Ne.isURLSearchParams(n)?(wf(t,"application/x-www-form-urlencoded;charset=utf-8"),n.toString()):Ne.isObject(n)||t&&t["Content-Type"]==="application/json"?(wf(t,"application/json"),VO(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&&Ne.isString(n)&&n.length)try{return JSON.parse(n)}catch(v){if(h)throw v.name==="SyntaxError"?MO(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}};Os.headers={common:{Accept:"application/json, text/plain, */*"}};Ne.forEach(["delete","get","head"],function(n){Os.headers[n]={}});Ne.forEach(["post","put","patch"],function(n){Os.headers[n]=Ne.merge(qO)});var nl=Os,QO=ln,WO=nl,GO=function(n,t,r){var o=this||WO;return QO.forEach(r,function(v){n=v.call(o,n,t)}),n},tu,Ef;function gy(){return Ef||(Ef=1,tu=function(n){return!!(n&&n.__CANCEL__)}),tu}var _f=ln,ru=GO,FO=gy(),LO=nl;function iu(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var $O=function(n){iu(n),n.headers=n.headers||{},n.data=ru.call(n,n.data,n.headers,n.transformRequest),n.headers=_f.merge(n.headers.common||{},n.headers[n.method]||{},n.headers),_f.forEach(["delete","get","head","post","put","patch","common"],function(o){delete n.headers[o]});var t=n.adapter||LO.adapter;return t(n).then(function(o){return iu(n),o.data=ru.call(n,o.data,o.headers,n.transformResponse),o},function(o){return FO(o)||(iu(n),o&&o.response&&(o.response.data=ru.call(n,o.response.data,o.response.headers,n.transformResponse))),Promise.reject(o)})},Je=ln,Sy=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 Je.isPlainObject(g)&&Je.isPlainObject(R)?Je.merge(g,R):Je.isPlainObject(R)?Je.merge({},R):Je.isArray(R)?R.slice():R}function D(g){Je.isUndefined(t[g])?Je.isUndefined(n[g])||(r[g]=w(void 0,n[g])):r[g]=w(n[g],t[g])}Je.forEach(o,function(R){Je.isUndefined(t[R])||(r[R]=w(void 0,t[R]))}),Je.forEach(h,D),Je.forEach(v,function(R){Je.isUndefined(t[R])?Je.isUndefined(n[R])||(r[R]=w(void 0,n[R])):r[R]=w(void 0,t[R])}),Je.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 Je.forEach(I,D),r};const KO="axios",zO="0.21.4",YO="Promise based HTTP client for the browser and node.js",ZO="index.js",XO={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"},xO={type:"git",url:"https://github.com/axios/axios.git"},jO=["xhr","http","ajax","promise","node"],eA="Matt Zabriskie",nA="MIT",tA={url:"https://github.com/axios/axios/issues"},rA="https://axios-http.com",iA={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"},oA={"./lib/adapters/http.js":"./lib/adapters/xhr.js"},aA="dist/axios.min.js",sA="dist/axios.min.js",dA="./index.d.ts",uA={"follow-redirects":"^1.14.0"},cA=[{path:"./dist/axios.min.js",threshold:"5kB"}],lA={name:KO,version:zO,description:YO,main:ZO,scripts:XO,repository:xO,keywords:jO,author:eA,license:nA,bugs:tA,homepage:rA,devDependencies:iA,browser:oA,jsdelivr:aA,unpkg:sA,typings:dA,dependencies:uA,bundlesize:cA};var ky=lA,tl={};["object","boolean","number","function","string","symbol"].forEach(function(e,n){tl[e]=function(r){return typeof r===e||"a"+(n<1?"n ":" ")+e}});var Uf={},fA=ky.version.split(".");function Py(e,n){for(var t=n?n.split("."):fA,r=e.split("."),o=0;o<3;o++){if(t[o]>r[o])return!0;if(t[o]<r[o])return!1}return!1}tl.transitional=function(n,t,r){var o=t&&Py(t);function h(v,C){return"[Axios v"+ky.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&&!Uf[C]&&(Uf[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 pA(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 mA={isOlderVersion:Py,assertOptions:pA,validators:tl},Ry=ln,yA=my,Jf=IO,Df=$O,As=Sy,vy=mA,ur=vy.validators;function mo(e){this.defaults=e,this.interceptors={request:new Jf,response:new Jf}}mo.prototype.request=function(n){typeof n=="string"?(n=arguments[1]||{},n.url=arguments[0]):n=n||{},n=As(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&&vy.assertOptions(t,{silentJSONParsing:ur.transitional(ur.boolean,"1.0.0"),forcedJSONParsing:ur.transitional(ur.boolean,"1.0.0"),clarifyTimeoutError:ur.transitional(ur.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=[Df,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=Df(w)}catch(I){return Promise.reject(I)}for(;h.length;)v=v.then(h.shift(),h.shift());return v};mo.prototype.getUri=function(n){return n=As(this.defaults,n),yA(n.url,n.params,n.paramsSerializer).replace(/^\?/,"")};Ry.forEach(["delete","get","head","options"],function(n){mo.prototype[n]=function(t,r){return this.request(As(r||{},{method:n,url:t,data:(r||{}).data}))}});Ry.forEach(["post","put","patch"],function(n){mo.prototype[n]=function(t,r,o){return this.request(As(o||{},{method:n,url:t,data:r}))}});var hA=mo,ou,Mf;function By(){if(Mf)return ou;Mf=1;function e(n){this.message=n}return e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},e.prototype.__CANCEL__=!0,ou=e,ou}var au,qf;function gA(){if(qf)return au;qf=1;var e=By();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}},au=n,au}var su,Hf;function SA(){return Hf||(Hf=1,su=function(n){return function(r){return n.apply(null,r)}}),su}var du,Vf;function kA(){return Vf||(Vf=1,du=function(n){return typeof n=="object"&&n.isAxiosError===!0}),du}var Qf=ln,PA=ly,$o=hA,RA=Sy,vA=nl;function by(e){var n=new $o(e),t=PA($o.prototype.request,n);return Qf.extend(t,$o.prototype,n),Qf.extend(t,n),t}var qn=by(vA);qn.Axios=$o;qn.create=function(n){return by(RA(qn.defaults,n))};qn.Cancel=By();qn.CancelToken=gA();qn.isCancel=gy();qn.all=function(n){return Promise.all(n)};qn.spread=SA();qn.isAxiosError=kA();xc.exports=qn;xc.exports.default=qn;var BA=xc.exports,bA=BA;const Ju=G.getDefaultExportFromCjs(bA);class OA{constructor(n,t={headers:{"Content-Type":"application/json"}}){le(this,"client");le(this,"config",{});this.client=Ju.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 Wf=(e,n)=>e.response?e.response.data?e.response.data.message||e.response.data:e.response.statusText:`The request to ${n} has failed.`;class AA{constructor(n,t={}){le(this,"client");le(this,"endpoint");this.client=new OA(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(Ju.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new _n(new Error(o.message),{code:Wt.REQUEST_TOO_LONG,context:n,method:j.HttpRequestMethod.Get});const h=Wf(o,n);throw new _n(new Error(h),{context:n,code:o.response?o.response.status:Wt.BAD_REQUEST,method:j.HttpRequestMethod.Get})}throw new _n(new Error(o.message),{code:j.UnspecifiedErrorCode,context:n,contextModule:j.HttpRequestMethod.Get})}}async post(n,t={}){try{return await this.client.post(n,t)}catch(r){const o=r;if(Ju.isAxiosError(o)){if(o.code==="ECONNABORTED")throw new _n(new Error(o.message),{code:Wt.REQUEST_TOO_LONG,method:j.HttpRequestMethod.Post});const h=Wf(o,n);throw new _n(new Error(h),{code:o.response?o.response.status:Wt.BAD_REQUEST,context:n,contextModule:j.HttpRequestMethod.Post})}throw new _n(new Error(o.message),{code:j.UnspecifiedErrorCode,context:n,contextModule:j.HttpRequestMethod.Post})}}}var Gf;(function(e){e.Idle="idle",e.Loading="loading",e.Completed="completed",e.Error="error",e.Confirmed="confirmed"})(Gf||(Gf={}));const Du=4e5,la=16e7,Oy={amount:[{amount:new G.BigNumber(Du).times(la).toString(),denom:"inj"}],gas:Du.toString(),payer:"",granter:"",feePayer:""},IA=e=>{if(!e)return Oy;const{gas:n=Du.toString(),gasPrice:t=la,payer:r,granter:o,feePayer:h}=e,v=new G.BigNumber(n).toFixed(0),C=new G.BigNumber(t).toFixed(0);return{amount:[{denom:"inj",amount:new G.BigNumber(v).times(C).toFixed()}],gas:new G.BigNumber(v).toFixed(),payer:r,granter:o,feePayer:h}},TA=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 wn(r).toWei().dividedBy(la).toFixed(0);return IA({gas:o,gasPrice:la})};G.BigNumber.clone({ROUNDING_MODE:G.BigNumber.ROUND_DOWN});const CA=e=>typeof e=="number"?!0:!isNaN(parseFloat(e)),Ff=e=>new G.BigNumber(e).toFixed(18),NA="wasm/MsgExecuteContract",Mu=({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 j.snakecaseKeys(e)){const D=j.snakecaseKeys(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:wA(w)});else if(J==="string"){if(h.includes(w)&&!D)continue;if(o.includes(w)){C.push({name:w,type:EA(w)});continue}C.push({name:w,type:"string"})}else if(J==="object"){if(Array.isArray(D)&&D.length===0)throw new j.GeneralException(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 j.GeneralException(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=Lf({property:Sf(w),parentProperty:t,messageType:n}),B=Mu({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 j.GeneralException(new Error("Array with elements of unknown type found"))}else if(D instanceof Date)C.push({name:w,type:"string"});else{const I=Lf({property:Sf(w),parentProperty:t,messageType:n}),g=Mu({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 j.GeneralException(new Error(`Type ${w} not found`))}return v.set(t,C),v},wA=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"}},EA=e=>{switch(e){case"timeout_timestamp":return"uint64";case"revision_number":return"uint64";case"revision_height":return"uint64";default:return"uint64"}},qu=(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=>qu(J))}:{...C,[w]:qu(D)};if(CA(D)&&t.includes(w))return{...C,[w]:D.toString()};if(typeof D=="string"){if(r.includes(w))return{...C,[w]:Ff(D)};if(n){const J=Object.keys(o).find(I=>I===n);if(J&&o[J].includes(w))return{...C,[w]:Ff(D)}}}return{...C,[w]:D}},{})},Lf=({property:e,parentProperty:n,messageType:t})=>t===NA?_A(e,n):UA(e,n),_A=(e,n="")=>{const t="CosmwasmInnerMsgMarker",r=e.replace("Type","");return r==="Msg"?t:`${n.replace(t,"")+r}Value`},UA=(e,n="")=>{const t=e.replace("Type","");return`Type${(n==="MsgValue"?"":n.replace("Type",""))+t}`};function fa(e){if(Array.isArray(e))return e.map(fa);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]=fa(e[t]))}),n}class JA{constructor(n){le(this,"params");this.params=n}toJSON(){return JSON.stringify(fa(this.toData()))}toEip712Types(){const n=this.toAmino();return Mu({object:n.value,messageType:n.type})}toEip712(){const n=this.toAmino(),{type:t,value:r}=n;return{type:t,value:qu(r,t)}}toDirectSignJSON(){return JSON.stringify(fa(this.toDirectSign()))}}const DA="injpub",qo="inj",MA="injvaloper",qA="injvalcons",HA="m/44'/60'/0'/0/0";class fi{constructor(n){le(this,"bech32Address");this.bech32Address=n}compare(n){return this.bech32Address===n.bech32Address}get address(){return this.bech32Address}static fromBech32(n,t=qo){try{const r=G.dist.Buffer.from(G.bech32.fromWords(G.bech32.decode(n).words)).toString("hex"),o=r.startsWith("0x")?r:`0x${r}`,h=G.dist_browser.Address.fromString(o.toString()).toBuffer(),v=G.bech32.encode(t,G.bech32.toWords(h));return new fi(v)}catch(r){throw new j.GeneralException(new Error(r.message),{type:j.ErrorType.ValidationError})}}static fromHex(n,t=qo){const r=n.startsWith("0x")?n:`0x${n}`,o=G.dist_browser.Address.fromString(r.toString()).toBuffer(),h=G.bech32.encode(t,G.bech32.toWords(o));return new fi(h)}toBech32(n=qo){const t=this.toHex(),r=t.startsWith("0x")?t:`0x${t}`,o=G.dist_browser.Address.fromString(r).toBuffer();return G.bech32.encode(n,G.bech32.toWords(o))}toAccountAddress(){return this.toBech32(qo)}toValidatorAddress(){return this.toBech32(MA)}toConsensusAddress(){return this.toBech32(qA)}toHex(){const{bech32Address:n}=this,t=G.dist.Buffer.from(G.bech32.fromWords(G.bech32.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 $f;(function(e){e.UnBonded="UnBonded",e.UnBonding="UnBonding",e.Bonded="Bonded"})($f||($f={}));const Kf={...j.ChainErrorModule},VA=e=>G.SHA256Exports.SHA256.hash(G.Base64Exports.Base64.parse(e)).toString().toUpperCase();function QA(e){return G.dist.Buffer.from(e).toString("hex")}function WA(e){return new Uint8Array(G.dist.Buffer.from(e,"hex"))}function GA(e){G.dist.Buffer.from(e,"hex").length===64&&(e="04"+e);let t=QA(G.elliptic.publicKeyConvert(WA(e),!1));return t=t.substring(2),t}class rl extends JA{static fromJSON(n){return new rl(n)}toProto(){const{params:n}=this,t=Te.create();t.denom=n.amount.denom,t.amount=n.amount.amount;const r=Fo.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=Qt.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||"",Fo.fromJSON(r)}toData(){return{"@type":"/ibc.applications.transfer.v1.MsgTransfer",...this.toProto()}}toAmino(){const n=this.toProto(),t={...j.snakecaseKeys(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 Fo.encode(this.toProto()).finish()}}class il{static encode(n){return G.dist.Buffer.from(ca.encode(n).finish()).toString("base64")}static decode(n){return ca.decode(G.dist.Buffer.from(n,"base64"))}static hash(n){return VA(il.encode(n))}}const FA=e=>{const n=ge.create();return n.typeUrl=`${e.type.startsWith("/")?"":"/"}${e.type}`,n.value=e.value,n},LA=(e,n)=>{const t=ge.create();return t.typeUrl=n,t.value=e,t},$A=Pe.SIGN_MODE_DIRECT;Pe.SIGN_MODE_LEGACY_AMINO_JSON;Pe.SIGN_MODE_LEGACY_AMINO_JSON;Pe.SIGN_MODE_EIP712_V2;const KA=({chainId:e,key:n})=>{if(typeof n!="string")return n;let t,r,o;return e.startsWith("injective")?(t=Ut.create(),o=Ut,r="/injective.crypto.v1beta1.ethsecp256k1.PubKey"):e.startsWith("evmos")?(t=Ut.create(),o=Ut,r="/ethermint.crypto.v1.ethsecp256k1.PubKey"):(t=Ut.create(),o=Ut,r="/cosmos.crypto.secp256k1.PubKey"),t.key=G.dist.Buffer.from(n,"base64"),LA(o.encode(t).finish(),r)},zA=({message:e,memo:n="",timeoutHeight:t})=>{const r=Array.isArray(e)?e:[e],o=Zc.create();return o.messages=r.map(h=>FA({value:h.toBinary(),type:h.toDirectSign().type})),o.memo=n,t&&(o.timeoutHeight=t.toString()),o},YA=({fee:e,payer:n,granter:t,gasLimit:r})=>{const o=Te.create();o.amount=e.amount,o.denom=e.denom;const h=Vt.create();return h.gasLimit=r.toString(),h.amount=[o],n&&(h.payer=n),t&&(h.granter=t),h},ZA=({chainId:e,mode:n,signers:t})=>t.map(r=>XA({mode:n,chainId:e,publicKey:r.pubKey,sequence:r.sequence})),XA=({chainId:e,publicKey:n,sequence:t,mode:r})=>{const o=KA({chainId:e,key:n}),h=Ht.create();h.mode=r;const v=On.create();v.single=h;const C=qt.create();return C.publicKey=o,C.sequence=t.toString(),C.modeInfo=v,C},xA=({signerInfo:e,fee:n})=>{const t=Xc.create();return t.signerInfos=e,t.fee=n,t},jA=({bodyBytes:e,authInfoBytes:n,chainId:t,accountNumber:r})=>{const o=Yc.create();return o.accountNumber=r.toString(),o.chainId=t,o.bodyBytes=e,o.authInfoBytes=n,o};class eI extends AA{retry(n,t=3,r=1e3){const o=async(h=1)=>{try{return await n()}catch(v){if(v instanceof _n&&v.code===Wt.REQUEST_TOO_LONG||h>=t)throw v;return new Promise(C=>setTimeout(()=>C(o(h+1)),r*h))}};return o()}}class nI extends eI{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 _n?o:new _n(new Error(o.message),{code:j.UnspecifiedErrorCode,context:`${this.endpoint}/${r}`,contextModule:Kf.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 _n?o:new _n(new Error(o.message),{code:j.UnspecifiedErrorCode,context:`${this.endpoint}/${r}`,contextModule:Kf.Auth})}}}var tI=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof G.dist.global<"u")return G.dist.global;throw"Unable to locate global object"})();G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());let yI=class extends tI.Error{constructor(n,t,r){super(n),this.code=t,this.metadata=r}};var zf;(function(e){e.Internal="internal",e.External="external",e.Withdraw="withdraw",e.Deposit="deposit"})(zf||(zf={}));var Yf;(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"})(Yf||(Yf={}));var Zf;(function(e){e.AccessTypeUnspecified="Unspecified",e.AccessTypeNobody="Nobody",e.AccessTypeOnlyAddress="Only Address",e.AccessTypeEverybody="Everybody",e.AccessTypeAnyOfAddresses="Any of Addresses"})(Zf||(Zf={}));var Xf;(function(e){e.Proposed="proposed",e.Signed="signed",e.Missed="missed"})(Xf||(Xf={}));var xf;(function(e){e.Pending="pending",e.Disbursed="disbursed"})(xf||(xf={}));({...j.IndexerErrorModule});var jf;(function(e){e.Market="market",e.LimitFill="limitFill",e.LimitMatchRestingOrder="limitMatchRestingOrder",e.LimitMatchNewOrder="limitMatchNewOrder"})(jf||(jf={}));var ep;(function(e){e.Maker="maker",e.Taker="taker"})(ep||(ep={}));var np;(function(e){e.Buy="buy",e.Sell="sell",e.Long="long",e.Short="short"})(np||(np={}));var tp;(function(e){e.Insert="insert",e.Delete="delete",e.Replace="replace",e.Update="update",e.Invalidate="invalidate"})(tp||(tp={}));new wn(0);j.gql`
@@ -36,4 +36,4 @@ Proven: ${(0,Mt.toHex)(e.key)}`);return _t.ics23.CommitmentProof.decode(e.data)}
36
36
  blockHeight
37
37
  }
38
38
  }
39
- `;G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());var rI=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof G.dist.global<"u")return G.dist.global;throw"Unable to locate global object"})();G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());class gI extends rI.Error{constructor(n,t,r){super(n),this.code=t,this.metadata=r}}class Hi{constructor(n,t){le(this,"type");le(this,"key");this.key=n,this.type=t||"/injective.crypto.v1beta1.ethsecp256k1.PubKey"}static fromBase64(n){return new Hi(G.dist.Buffer.from(n,"base64"))}static fromBytes(n){return new Hi(n)}static fromHex(n){const r=typeof n=="string"&&n.startsWith("0x")?n.slice(2):n,o=G.dist.Buffer.from(r.toString(),"hex"),h=G.secp256k1$1.publicKeyCreate(o,!0),v="/injective.crypto.v1beta1.ethsecp256k1.PubKey";return new Hi(h,v)}toPubKeyBytes(){return this.key}toBase64(){return G.dist.Buffer.from(this.toPubKeyBytes()).toString("base64")}toHex(){return G.dist.Buffer.from(this.toPubKeyBytes()).toString("hex")}toBech32(){return G.bech32.encode(DA,G.bech32.toWords(G.dist.Buffer.from(this.toHex(),"hex")))}toAddress(){const n=this.toHex(),t=GA(n),r=G.dist.Buffer.from(G.sha3Exports.keccak256(G.dist_browser.toBuffer(t.startsWith("0x")?t:"0x"+t)),"hex").subarray(-20);return fi.fromHex(G.dist.Buffer.from(r).toString("hex").toLowerCase())}toProto(){const n=Eu.create();return n.key=this.key,n}toAny(){const n=this.toProto(),t=ge.create();return t.typeUrl=this.type,t.value=G.dist.Buffer.from(Eu.encode(n).finish()),t}}class kr{constructor(n){le(this,"wallet");this.wallet=n}static generate(){const n=G.src.generateMnemonic();return{privateKey:kr.fromMnemonic(n),mnemonic:n}}static fromMnemonic(n,t=HA){return new kr(G.Wallet$1.fromMnemonic(n,t))}static fromPrivateKey(n){return new kr(new G.Wallet$1(n))}static fromHex(n){const t=typeof n=="string",r=t&&n.startsWith("0x")?n.slice(2):n,o=t?G.dist.Buffer.from(r.toString(),"hex"):n;return new kr(new G.Wallet$1(o))}toPrivateKeyHex(){return this.wallet.privateKey.startsWith("0x")?this.wallet.privateKey:`0x${this.wallet.privateKey}`}toPublicKey(){return Hi.fromHex(this.wallet.privateKey)}toHex(){return this.wallet.address.startsWith("0x")?this.wallet.address:`0x${this.wallet.address}`}toAddress(){return fi.fromHex(this.toHex())}toBech32(){return fi.fromHex(this.toHex()).toBech32()}async sign(n){const{wallet:t}=this,r=j.keccak256(n),o=await t._signingKey().signDigest(r),h=G.splitSignature(o);return G.arrayify(G.concat([h.r,h.s]))}async signEcda(n){const{wallet:t}=this,r=j.keccak256(n),o=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,h=Uint8Array.from(G.dist.Buffer.from(o,"hex")),{signature:v}=G.secp256k1$1.ecdsaSign(r,h);return v}async signHashed(n){const{wallet:t}=this,r=await t._signingKey().signDigest(n),o=G.splitSignature(r);return G.arrayify(G.concat([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(G.dist.Buffer.from(r,"hex")),{signature:h}=G.secp256k1$1.ecdsaSign(n,o);return h}async signTypedData(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=j.dist.signTypedData({privateKey:G.dist.Buffer.from(r,"hex"),data:n,version:j.dist.SignTypedDataVersion.V4});return G.dist.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(G.dist.Buffer.from(r,"hex")),{signature:h}=G.secp256k1$1.ecdsaSign(n,o);return h}}const iI=({signers:e,chainId:n,message:t,timeoutHeight:r,memo:o="",fee:h=Oy,signMode:v=$A})=>{const C=Array.isArray(e)?e:[e],[w]=C,D=zA({message:t,memo:o,timeoutHeight:r}),J=typeof h=="string"?TA(h):h,I=YA({fee:J.amount[0],payer:J.payer,granter:J.granter,gasLimit:parseInt(J.gas,10)}),g=ZA({chainId:n,mode:v,signers:C}),R=xA({signerInfo:g,fee:I}),B=Zc.encode(D).finish(),d=Xc.encode(R).finish(),s=jA({chainId:n,bodyBytes:B,authInfoBytes:d,accountNumber:w.accountNumber}),y=Yc.encode(s).finish(),E=G.dist.Buffer.from(y),_=j.keccak256(G.dist.Buffer.from(y)),U=ca.create();return U.authInfoBytes=d,U.bodyBytes=B,{txRaw:U,signDoc:s,signers:e,signer:w,signBytes:E,signHashedBytes:_,bodyBytes:B,authInfoBytes:d}},oI=e=>iI({...e,signers:{pubKey:e.pubKey,accountNumber:e.accountNumber,sequence:e.sequence}});async function aI(e,n){const[t,r]=await Yt.chainFromRpc(e);if(sh.includes(r))return new dI(r,t,n);const o=await Xn.DirectSecp256k1HdWallet.fromMnemonic(n,{prefix:op(r)}),h=(await o.getAccounts())[0],v=await Kc.SigningCosmWasmClient.connectWithSigner(G.rpcAddress(t,r),o);return new sI(r,v,h.address)}class sI{constructor(n,t,r,o){le(this,"_chain");le(this,"_signer");le(this,"_account");le(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=j.tx.TxRaw.encode(v).finish();t.push(C)}return t}}class dI{constructor(n,t,r){le(this,"_chain");le(this,"_chainId");le(this,"key");le(this,"prefix");le(this,"_rpc");this._chain=n,this._rpc=new nI(uh(t,n)),this._chainId=G.networkChainToNativeChainId.get(t,n),this.prefix=op(n),this.key=kr.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}=oI({message:w.msgs.map(I=>rl.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(G.b64.decode(il.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 uI={Address:Ve,Platform:Yt,getSigner:aI,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-DVVJw5ml.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-l_e-RUun.js")),IbcBridge:()=>Promise.resolve().then(()=>require("./index-DPNt5r2L.js"))},getChain:(e,n,t)=>new zc(n,new Yt(e,G.applyChainsConfigConfigOverrides(e,Er,{[n]:t})))},cI=Object.freeze(Object.defineProperty({__proto__:null,default:uI},Symbol.toStringTag,{value:"Module"}));exports.CosmwasmAddress=Ve;exports.CosmwasmPlatform=Yt;exports.DEFAULT_FEE=Ky;exports.Gateway=ua;exports.IBC_MSG_TYPE=Yy;exports.IBC_PACKET_DATA=rh;exports.IBC_PACKET_DST=xy;exports.IBC_PACKET_DST_PORT=nh;exports.IBC_PACKET_RECEIVE=Xy;exports.IBC_PACKET_SEND=Zy;exports.IBC_PACKET_SEQ=th;exports.IBC_PACKET_SRC=jy;exports.IBC_PACKET_SRC_PORT=eh;exports.IBC_TIMEOUT_MILLIS=ih;exports.IBC_TRANSFER_PORT=Hu;exports.MSG_EXECUTE_CONTRACT_TYPE_URL=zy;exports._platform=Er;exports.abci=io;exports.auth=Zi;exports.averageGasPrices=lh;exports.build=ct;exports.channel=to;exports.cosmwasm=cI;exports.gov=no;exports.keys=nt;exports.keys$1=$t;exports.keys$2=tt;exports.networkChainToChannels=uu;exports.pagination=Se;exports.query=ju;exports.query$1=tc;exports.query$10=Bc;exports.query$11=bc;exports.query$12=Ic;exports.query$2=rc;exports.query$3=oc;exports.query$4=sc;exports.query$5=cc;exports.query$6=gc;exports.query$7=Sc;exports.query$8=kc;exports.query$9=Pc;exports.require$$0=gm;exports.service=Tc;exports.tendermint=Rc;exports.tx=ba;exports.tx$1=nc;exports.tx$10=ro;exports.tx$11=Cc;exports.tx$2=eo;exports.tx$3=ac;exports.tx$4=dc;exports.tx$5=uc;exports.tx$6=lc;exports.tx$7=fc;exports.tx$8=pc;exports.tx$9=mc;exports.vesting=Aa;
39
+ `;G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());var rI=(()=>{if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof G.dist.global<"u")return G.dist.global;throw"Unable to locate global object"})();G._m0.util.Long!==G.Long&&(G._m0.util.Long=G.Long,G._m0.configure());class gI extends rI.Error{constructor(n,t,r){super(n),this.code=t,this.metadata=r}}class Hi{constructor(n,t){le(this,"type");le(this,"key");this.key=n,this.type=t||"/injective.crypto.v1beta1.ethsecp256k1.PubKey"}static fromBase64(n){return new Hi(G.dist.Buffer.from(n,"base64"))}static fromBytes(n){return new Hi(n)}static fromHex(n){const r=typeof n=="string"&&n.startsWith("0x")?n.slice(2):n,o=G.dist.Buffer.from(r.toString(),"hex"),h=G.secp256k1$1.publicKeyCreate(o,!0),v="/injective.crypto.v1beta1.ethsecp256k1.PubKey";return new Hi(h,v)}toPubKeyBytes(){return this.key}toBase64(){return G.dist.Buffer.from(this.toPubKeyBytes()).toString("base64")}toHex(){return G.dist.Buffer.from(this.toPubKeyBytes()).toString("hex")}toBech32(){return G.bech32.encode(DA,G.bech32.toWords(G.dist.Buffer.from(this.toHex(),"hex")))}toAddress(){const n=this.toHex(),t=GA(n),r=G.dist.Buffer.from(G.sha3Exports.keccak256(G.dist_browser.toBuffer(t.startsWith("0x")?t:"0x"+t)),"hex").subarray(-20);return fi.fromHex(G.dist.Buffer.from(r).toString("hex").toLowerCase())}toProto(){const n=Eu.create();return n.key=this.key,n}toAny(){const n=this.toProto(),t=ge.create();return t.typeUrl=this.type,t.value=G.dist.Buffer.from(Eu.encode(n).finish()),t}}class kr{constructor(n){le(this,"wallet");this.wallet=n}static generate(){const n=G.src.generateMnemonic();return{privateKey:kr.fromMnemonic(n),mnemonic:n}}static fromMnemonic(n,t=HA){return new kr(G.Wallet$1.fromMnemonic(n,t))}static fromPrivateKey(n){return new kr(new G.Wallet$1(n))}static fromHex(n){const t=typeof n=="string",r=t&&n.startsWith("0x")?n.slice(2):n,o=t?G.dist.Buffer.from(r.toString(),"hex"):n;return new kr(new G.Wallet$1(o))}toPrivateKeyHex(){return this.wallet.privateKey.startsWith("0x")?this.wallet.privateKey:`0x${this.wallet.privateKey}`}toPublicKey(){return Hi.fromHex(this.wallet.privateKey)}toHex(){return this.wallet.address.startsWith("0x")?this.wallet.address:`0x${this.wallet.address}`}toAddress(){return fi.fromHex(this.toHex())}toBech32(){return fi.fromHex(this.toHex()).toBech32()}async sign(n){const{wallet:t}=this,r=j.keccak256(n),o=await t._signingKey().signDigest(r),h=G.splitSignature(o);return G.arrayify(G.concat([h.r,h.s]))}async signEcda(n){const{wallet:t}=this,r=j.keccak256(n),o=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,h=Uint8Array.from(G.dist.Buffer.from(o,"hex")),{signature:v}=G.secp256k1$1.ecdsaSign(r,h);return v}async signHashed(n){const{wallet:t}=this,r=await t._signingKey().signDigest(n),o=G.splitSignature(r);return G.arrayify(G.concat([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(G.dist.Buffer.from(r,"hex")),{signature:h}=G.secp256k1$1.ecdsaSign(n,o);return h}async signTypedData(n){const{wallet:t}=this,r=t.privateKey.startsWith("0x")?t.privateKey.slice(2):t.privateKey,o=j.dist.signTypedData({privateKey:G.dist.Buffer.from(r,"hex"),data:n,version:j.dist.SignTypedDataVersion.V4});return G.dist.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(G.dist.Buffer.from(r,"hex")),{signature:h}=G.secp256k1$1.ecdsaSign(n,o);return h}}const iI=({signers:e,chainId:n,message:t,timeoutHeight:r,memo:o="",fee:h=Oy,signMode:v=$A})=>{const C=Array.isArray(e)?e:[e],[w]=C,D=zA({message:t,memo:o,timeoutHeight:r}),J=typeof h=="string"?TA(h):h,I=YA({fee:J.amount[0],payer:J.payer,granter:J.granter,gasLimit:parseInt(J.gas,10)}),g=ZA({chainId:n,mode:v,signers:C}),R=xA({signerInfo:g,fee:I}),B=Zc.encode(D).finish(),d=Xc.encode(R).finish(),s=jA({chainId:n,bodyBytes:B,authInfoBytes:d,accountNumber:w.accountNumber}),y=Yc.encode(s).finish(),E=G.dist.Buffer.from(y),_=j.keccak256(G.dist.Buffer.from(y)),U=ca.create();return U.authInfoBytes=d,U.bodyBytes=B,{txRaw:U,signDoc:s,signers:e,signer:w,signBytes:E,signHashedBytes:_,bodyBytes:B,authInfoBytes:d}},oI=e=>iI({...e,signers:{pubKey:e.pubKey,accountNumber:e.accountNumber,sequence:e.sequence}});async function aI(e,n){const[t,r]=await Yt.chainFromRpc(e);if(sh.includes(r))return new dI(r,t,n);const o=await Xn.DirectSecp256k1HdWallet.fromMnemonic(n,{prefix:op(r)}),h=(await o.getAccounts())[0],v=await Kc.SigningCosmWasmClient.connectWithSigner(G.rpcAddress(t,r),o);return new sI(r,v,h.address)}class sI{constructor(n,t,r,o){le(this,"_chain");le(this,"_signer");le(this,"_account");le(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=j.tx.TxRaw.encode(v).finish();t.push(C)}return t}}class dI{constructor(n,t,r){le(this,"_chain");le(this,"_chainId");le(this,"key");le(this,"prefix");le(this,"_rpc");this._chain=n,this._rpc=new nI(uh(t,n)),this._chainId=G.networkChainToNativeChainId.get(t,n),this.prefix=op(n),this.key=kr.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}=oI({message:w.msgs.map(I=>rl.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(G.b64.decode(il.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 uI={Address:Ve,Platform:Yt,getSigner:aI,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-BHWhOqWI.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-DLpTO2U3.js")),IbcBridge:()=>Promise.resolve().then(()=>require("./index-670AMJe5.js"))},getChain:(e,n,t)=>new zc(n,new Yt(e,G.applyChainsConfigConfigOverrides(e,Er,{[n]:t})))},cI=Object.freeze(Object.defineProperty({__proto__:null,default:uI},Symbol.toStringTag,{value:"Module"}));exports.CosmwasmAddress=Ve;exports.CosmwasmPlatform=Yt;exports.DEFAULT_FEE=Ky;exports.Gateway=ua;exports.IBC_MSG_TYPE=Yy;exports.IBC_PACKET_DATA=rh;exports.IBC_PACKET_DST=xy;exports.IBC_PACKET_DST_PORT=nh;exports.IBC_PACKET_RECEIVE=Xy;exports.IBC_PACKET_SEND=Zy;exports.IBC_PACKET_SEQ=th;exports.IBC_PACKET_SRC=jy;exports.IBC_PACKET_SRC_PORT=eh;exports.IBC_TIMEOUT_MILLIS=ih;exports.IBC_TRANSFER_PORT=Hu;exports.MSG_EXECUTE_CONTRACT_TYPE_URL=zy;exports._platform=Er;exports.abci=io;exports.auth=Zi;exports.averageGasPrices=lh;exports.build=ct;exports.channel=to;exports.cosmwasm=cI;exports.gov=no;exports.keys=nt;exports.keys$1=$t;exports.keys$2=tt;exports.networkChainToChannels=uu;exports.pagination=Se;exports.query=ju;exports.query$1=tc;exports.query$10=Bc;exports.query$11=bc;exports.query$12=Ic;exports.query$2=rc;exports.query$3=oc;exports.query$4=sc;exports.query$5=cc;exports.query$6=gc;exports.query$7=Sc;exports.query$8=kc;exports.query$9=Pc;exports.require$$0=gm;exports.service=Tc;exports.tendermint=Rc;exports.tx=ba;exports.tx$1=nc;exports.tx$10=ro;exports.tx$11=Cc;exports.tx$2=eo;exports.tx$3=ac;exports.tx$4=dc;exports.tx$5=uc;exports.tx$6=lc;exports.tx$7=fc;exports.tx$8=pc;exports.tx$9=mc;exports.vesting=Aa;