@swapkit/toolboxes 4.0.20 → 4.0.22

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 (77) hide show
  1. package/dist/src/cosmos/index.cjs +2 -2
  2. package/dist/src/cosmos/index.cjs.map +7 -7
  3. package/dist/src/cosmos/index.js +2 -2
  4. package/dist/src/cosmos/index.js.map +7 -7
  5. package/dist/src/evm/index.cjs +2 -2
  6. package/dist/src/evm/index.cjs.map +6 -6
  7. package/dist/src/evm/index.js +2 -2
  8. package/dist/src/evm/index.js.map +6 -6
  9. package/dist/src/index.cjs +3 -3
  10. package/dist/src/index.cjs.map +21 -21
  11. package/dist/src/index.js +3 -3
  12. package/dist/src/index.js.map +21 -21
  13. package/dist/src/near/index.cjs +2 -2
  14. package/dist/src/near/index.cjs.map +6 -6
  15. package/dist/src/near/index.js +2 -2
  16. package/dist/src/near/index.js.map +6 -6
  17. package/dist/src/ripple/index.cjs +2 -2
  18. package/dist/src/ripple/index.cjs.map +3 -3
  19. package/dist/src/ripple/index.js +2 -2
  20. package/dist/src/ripple/index.js.map +3 -3
  21. package/dist/src/solana/index.cjs +2 -2
  22. package/dist/src/solana/index.cjs.map +3 -3
  23. package/dist/src/solana/index.js +2 -2
  24. package/dist/src/solana/index.js.map +3 -3
  25. package/dist/src/substrate/index.cjs +2 -2
  26. package/dist/src/substrate/index.cjs.map +3 -3
  27. package/dist/src/substrate/index.js +2 -2
  28. package/dist/src/substrate/index.js.map +3 -3
  29. package/dist/src/tron/index.cjs +2 -2
  30. package/dist/src/tron/index.cjs.map +3 -3
  31. package/dist/src/tron/index.js +2 -2
  32. package/dist/src/tron/index.js.map +3 -3
  33. package/dist/src/utxo/index.cjs +3 -3
  34. package/dist/src/utxo/index.cjs.map +6 -6
  35. package/dist/src/utxo/index.js +3 -3
  36. package/dist/src/utxo/index.js.map +6 -6
  37. package/dist/types/cosmos/thorchainUtils/messages.d.ts +7 -7
  38. package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -1
  39. package/dist/types/cosmos/thorchainUtils/registry.d.ts +2 -2
  40. package/dist/types/cosmos/thorchainUtils/registry.d.ts.map +1 -1
  41. package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -1
  42. package/dist/types/cosmos/toolbox/thorchain.d.ts +5 -5
  43. package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -1
  44. package/dist/types/cosmos/types.d.ts +3 -3
  45. package/dist/types/cosmos/types.d.ts.map +1 -1
  46. package/dist/types/cosmos/util.d.ts +1 -1
  47. package/dist/types/cosmos/util.d.ts.map +1 -1
  48. package/dist/types/evm/helpers.d.ts +1 -1
  49. package/dist/types/evm/helpers.d.ts.map +1 -1
  50. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -1
  51. package/dist/types/evm/toolbox/evm.d.ts.map +1 -1
  52. package/dist/types/evm/toolbox/index.d.ts +5 -5
  53. package/dist/types/evm/toolbox/index.d.ts.map +1 -1
  54. package/dist/types/evm/toolbox/op.d.ts +15 -13
  55. package/dist/types/evm/toolbox/op.d.ts.map +1 -1
  56. package/dist/types/near/helpers/core.d.ts.map +1 -1
  57. package/dist/types/near/toolbox.d.ts.map +1 -1
  58. package/dist/types/near/types/toolbox.d.ts +5 -13
  59. package/dist/types/near/types/toolbox.d.ts.map +1 -1
  60. package/dist/types/near/types.d.ts +2 -0
  61. package/dist/types/near/types.d.ts.map +1 -1
  62. package/dist/types/ripple/index.d.ts.map +1 -1
  63. package/dist/types/solana/toolbox.d.ts.map +1 -1
  64. package/dist/types/substrate/substrate.d.ts +3 -3
  65. package/dist/types/substrate/substrate.d.ts.map +1 -1
  66. package/dist/types/tron/toolbox.d.ts.map +1 -1
  67. package/dist/types/tron/types.d.ts +1 -0
  68. package/dist/types/tron/types.d.ts.map +1 -1
  69. package/dist/types/utils.d.ts.map +1 -1
  70. package/dist/types/utxo/toolbox/bitcoinCash.d.ts +1 -1
  71. package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -1
  72. package/dist/types/utxo/toolbox/index.d.ts +1 -1
  73. package/dist/types/utxo/toolbox/index.d.ts.map +1 -1
  74. package/dist/types/utxo/toolbox/utxo.d.ts +2 -2
  75. package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -1
  76. package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -1
  77. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- var s6=Object.create;var{getPrototypeOf:e6,defineProperty:c,getOwnPropertyNames:A6,getOwnPropertyDescriptor:z4}=Object,K6=Object.prototype.hasOwnProperty;var U=(Y,Q,X)=>{X=Y!=null?s6(e6(Y)):{};let z=Q||!Y||!Y.__esModule?c(X,"default",{value:Y,enumerable:!0}):X;for(let Z of A6(Y))if(!K6.call(z,Z))c(z,Z,{get:()=>Y[Z],enumerable:!0});return z},v6=new WeakMap,H4=(Y)=>{var Q=v6.get(Y),X;if(Q)return Q;if(Q=c({},"__esModule",{value:!0}),Y&&typeof Y==="object"||typeof Y==="function")A6(Y).map((z)=>!K6.call(Q,z)&&c(Q,z,{get:()=>Y[z],enumerable:!(X=z4(Y,z))||X.enumerable}));return v6.set(Y,Q),Q};var R6=(Y,Q)=>{for(var X in Q)c(Y,X,{get:Q[X],enumerable:!0,configurable:!0,set:(z)=>Q[X]=()=>z})};var f=(Y,Q)=>()=>(Y&&(Q=Y(Y=0)),Q);function d(Y){return S.base64.encode(Uint8Array.from(S.bech32.fromWords(S.bech32.decode(Y).words)))}function n(Y,Q="thor"){return S.bech32.encode(Q,S.bech32.toWords(S.base64.decode(Y)))}function Z4(Y){return s.fromByteArray(Y)}function Q4(Y){if(!Y.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new V6.SwapKitError("toolbox_cosmos_invalid_params",{error:"Invalid base64 string format"});return s.toByteArray(Y)}var S,V6,s;var L6=f(()=>{S=require("@scure/base"),V6=require("@swapkit/helpers"),s=require("base64-js")});function F(Y){switch(Y){case _.Chain.Maya:return{amount:[],gas:"10000000000"};case _.Chain.THORChain:return{amount:[],gas:"500000000"};case _.Chain.Kujira:return k6;case _.Chain.Noble:return F6;default:return M6}}async function y(Y){let Q=await import("@cosmjs/stargate"),X=Q.StargateClient??Q.default?.StargateClient,z=typeof window<"u"?{}:{referer:"https://sdk.swapkit.dev",referrer:"https://sdk.swapkit.dev"};return X.connect({headers:z,url:Y})}async function g(Y,Q,X={}){let z=await import("@cosmjs/stargate"),Z=z.SigningStargateClient??z.default?.SigningStargateClient,H=z.GasPrice??z.default?.GasPrice,L=typeof X==="string"?X:"0.0003uatom",J=typeof X==="string"?{}:X;return Z.connectWithSigner(Y,Q,{gasPrice:H.fromString(L),...J})}async function J6(Y,Q){let X=await import("@cosmjs/stargate");return(X.SigningStargateClient??X.default?.SigningStargateClient).offline(Y,Q)}async function q6({sender:Y,recipient:Q,assetValue:X,memo:z="",feeRate:Z,sequence:H,accountNumber:L}){let{chain:J,chainId:I}=X,N=await _.getRPCUrl(J),O=await(await y(N)).getAccount(Y);if(!O)throw new _.SwapKitError("toolbox_cosmos_account_not_found",{sender:Y});let v=_.AssetValue.from({chain:J}),V=P(v.symbol),B=F(J),A=V&&Z?{amount:[{amount:Z.toString(),denom:V}],gas:B.gas}:B,R={amount:[{amount:X.getBaseValue("string"),denom:P(X.symbol)}],fromAddress:Y,toAddress:Q};return{accountNumber:L??O.accountNumber,chainId:I,fee:A,memo:z,msgs:[{typeUrl:X4(J),value:R}],sequence:H??O.sequence}}var _,Y6="FACTORY/KUJIRA1QK00H5ATUTPSV900X202PXX42NPJR9THG58DNQPA72F2P7M2LUASE444A7/UUSK",f6="FACTORY/KUJIRA1YGFXN0ER40KLCNCK8THLTUPRDXLCK6WVNPKF2K/UYUM",M6,k6,F6,P=(Y,Q=!1)=>{if(Q)return Y.toLowerCase();switch(Y){case"uUSK":case"USK":return Y6;case"uYUM":case"YUM":return f6;case"uKUJI":case"KUJI":return"ukuji";case"ATOM":case"uATOM":return"uatom";case"uUSDC":case"USDC":return"uusdc";default:return Y}},m=({symbol:Y,chain:Q})=>{if(Q===_.Chain.Maya)return(Y.toUpperCase()!=="CACAO"?Y:`${_.Chain.Maya}.${Y}`).toUpperCase();if(Q===_.Chain.THORChain)return(["RUNE","TCY","RUJI"].includes(Y.toUpperCase())?`${_.Chain.THORChain}.${Y}`:Y).toUpperCase();return P(Y,!1)},X4=(Y)=>{switch(Y){case _.Chain.Maya:case _.Chain.THORChain:return"/types.MsgSend";case _.Chain.Cosmos:case _.Chain.Kujira:case _.Chain.Noble:return"/cosmos.bank.v1beta1.MsgSend";default:throw new _.SwapKitError("toolbox_cosmos_not_supported",{chain:Y})}},L4,W6=(Y,Q)=>{let X=L4[Y.toLowerCase()];if(!X)return _.AssetValue.from({asset:Y,fromBaseDecimal:8,value:Q});let{chain:z,asset:Z,decimals:H}=X,L=z?{chain:z}:{asset:Z};return _.AssetValue.from({...L,fromBaseDecimal:H,value:Q})};var i=f(()=>{_=require("@swapkit/helpers"),M6={amount:[{amount:"500",denom:"uatom"}],gas:"200000"},k6={amount:[{amount:"1000",denom:"ukuji"}],gas:"200000"},F6={amount:[{amount:"1000",denom:"uusdc"}],gas:"200000"};L4={atom:{chain:_.Chain.Cosmos,decimals:_.BaseDecimal[_.Chain.Cosmos]},cacao:{chain:_.Chain.Maya,decimals:10},kuji:{chain:_.Chain.Kujira,decimals:_.BaseDecimal[_.Chain.Kujira]},maya:{asset:`${_.Chain.Maya}.${_.Chain.Maya}`,decimals:4},rune:{chain:_.Chain.THORChain,decimals:_.BaseDecimal[_.Chain.THORChain]},tcy:{asset:"THOR.TCY",decimals:_.BaseDecimal[_.Chain.THORChain]},uatom:{chain:_.Chain.Cosmos,decimals:_.BaseDecimal[_.Chain.Cosmos]},ukuji:{chain:_.Chain.Kujira,decimals:_.BaseDecimal[_.Chain.Kujira]},usdc:{chain:_.Chain.Noble,decimals:_.BaseDecimal[_.Chain.Noble]},uusdc:{chain:_.Chain.Noble,decimals:_.BaseDecimal[_.Chain.Noble]},"x/kuji":{asset:"THOR.KUJI",decimals:_.BaseDecimal[_.Chain.THORChain]},[Y6.toLowerCase()]:{asset:`${_.Chain.Kujira}.USK`,decimals:_.BaseDecimal[_.Chain.Kujira]}}});var y6={};R6(y6,{$root:()=>q});var K,T,M,W,q;var D6=f(()=>{K=U(require("protobufjs/minimal.js")),T=K.default.Reader,M=K.default.Writer,W=K.default.util,q=K.default.roots.default||(K.default.roots.default={});q.common=(()=>{let Y={};return Y.Asset=(()=>{function Q(X){if(X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.chain="",Q.prototype.symbol="",Q.prototype.ticker="",Q.prototype.synth=!1,Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.chain!=null&&Object.hasOwnProperty.call(z,"chain"))Z.uint32(10).string(z.chain);if(z.symbol!=null&&Object.hasOwnProperty.call(z,"symbol"))Z.uint32(18).string(z.symbol);if(z.ticker!=null&&Object.hasOwnProperty.call(z,"ticker"))Z.uint32(26).string(z.ticker);if(z.synth!=null&&Object.hasOwnProperty.call(z,"synth"))Z.uint32(32).bool(z.synth);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.common.Asset;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:L.chain=z.string();break;case 2:L.symbol=z.string();break;case 3:L.ticker=z.string();break;case 4:L.synth=z.bool();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.chain!=null&&z.hasOwnProperty("chain")){if(!W.isString(z.chain))return"chain: string expected"}if(z.symbol!=null&&z.hasOwnProperty("symbol")){if(!W.isString(z.symbol))return"symbol: string expected"}if(z.ticker!=null&&z.hasOwnProperty("ticker")){if(!W.isString(z.ticker))return"ticker: string expected"}if(z.synth!=null&&z.hasOwnProperty("synth")){if(typeof z.synth!=="boolean")return"synth: boolean expected"}return null},Q.fromObject=function(z){if(z instanceof q.common.Asset)return z;let Z=new q.common.Asset;if(z.chain!=null)Z.chain=String(z.chain);if(z.symbol!=null)Z.symbol=String(z.symbol);if(z.ticker!=null)Z.ticker=String(z.ticker);if(z.synth!=null)Z.synth=Boolean(z.synth);return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.defaults)H.chain="",H.symbol="",H.ticker="",H.synth=!1;if(z.chain!=null&&z.hasOwnProperty("chain"))H.chain=z.chain;if(z.symbol!=null&&z.hasOwnProperty("symbol"))H.symbol=z.symbol;if(z.ticker!=null&&z.hasOwnProperty("ticker"))H.ticker=z.ticker;if(z.synth!=null&&z.hasOwnProperty("synth"))H.synth=z.synth;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.Coin=(()=>{function Q(X){if(X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.asset=null,Q.prototype.amount="",Q.prototype.decimals=W.Long?W.Long.fromBits(0,0,!1):0,Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.asset!=null&&Object.hasOwnProperty.call(z,"asset"))q.common.Asset.encode(z.asset,Z.uint32(10).fork()).ldelim();if(z.amount!=null&&Object.hasOwnProperty.call(z,"amount"))Z.uint32(18).string(z.amount);if(z.decimals!=null&&Object.hasOwnProperty.call(z,"decimals"))Z.uint32(24).int64(z.decimals);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.common.Coin;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:L.asset=q.common.Asset.decode(z,z.uint32());break;case 2:L.amount=z.string();break;case 3:L.decimals=z.int64();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.asset!=null&&z.hasOwnProperty("asset")){let Z=q.common.Asset.verify(z.asset);if(Z)return"asset."+Z}if(z.amount!=null&&z.hasOwnProperty("amount")){if(!W.isString(z.amount))return"amount: string expected"}if(z.decimals!=null&&z.hasOwnProperty("decimals")){if(!W.isInteger(z.decimals)&&!(z.decimals&&W.isInteger(z.decimals.low)&&W.isInteger(z.decimals.high)))return"decimals: integer|Long expected"}return null},Q.fromObject=function(z){if(z instanceof q.common.Coin)return z;let Z=new q.common.Coin;if(z.asset!=null){if(typeof z.asset!=="object")throw TypeError(".common.Coin.asset: object expected");Z.asset=q.common.Asset.fromObject(z.asset)}if(z.amount!=null)Z.amount=String(z.amount);if(z.decimals!=null){if(W.Long)(Z.decimals=W.Long.fromValue(z.decimals)).unsigned=!1;else if(typeof z.decimals==="string")Z.decimals=Number.parseInt(z.decimals,10);else if(typeof z.decimals==="number")Z.decimals=z.decimals;else if(typeof z.decimals==="object")Z.decimals=new W.LongBits(z.decimals.low>>>0,z.decimals.high>>>0).toNumber()}return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.defaults)if(H.asset=null,H.amount="",W.Long){let L=new W.Long(0,0,!1);H.decimals=Z.longs===String?L.toString():Z.longs===Number?L.toNumber():L}else H.decimals=Z.longs===String?"0":0;if(z.asset!=null&&z.hasOwnProperty("asset"))H.asset=q.common.Asset.toObject(z.asset,Z);if(z.amount!=null&&z.hasOwnProperty("amount"))H.amount=z.amount;if(z.decimals!=null&&z.hasOwnProperty("decimals"))if(typeof z.decimals==="number")H.decimals=Z.longs===String?String(z.decimals):z.decimals;else H.decimals=Z.longs===String?W.Long.prototype.toString.call(z.decimals):Z.longs===Number?new W.LongBits(z.decimals.low>>>0,z.decimals.high>>>0).toNumber():z.decimals;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.PubKeySet=(()=>{function Q(X){if(X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.secp256k1="",Q.prototype.ed25519="",Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.secp256k1!=null&&Object.hasOwnProperty.call(z,"secp256k1"))Z.uint32(10).string(z.secp256k1);if(z.ed25519!=null&&Object.hasOwnProperty.call(z,"ed25519"))Z.uint32(18).string(z.ed25519);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.common.PubKeySet;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:L.secp256k1=z.string();break;case 2:L.ed25519=z.string();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.secp256k1!=null&&z.hasOwnProperty("secp256k1")){if(!W.isString(z.secp256k1))return"secp256k1: string expected"}if(z.ed25519!=null&&z.hasOwnProperty("ed25519")){if(!W.isString(z.ed25519))return"ed25519: string expected"}return null},Q.fromObject=function(z){if(z instanceof q.common.PubKeySet)return z;let Z=new q.common.PubKeySet;if(z.secp256k1!=null)Z.secp256k1=String(z.secp256k1);if(z.ed25519!=null)Z.ed25519=String(z.ed25519);return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.defaults)H.secp256k1="",H.ed25519="";if(z.secp256k1!=null&&z.hasOwnProperty("secp256k1"))H.secp256k1=z.secp256k1;if(z.ed25519!=null&&z.hasOwnProperty("ed25519"))H.ed25519=z.ed25519;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.Tx=(()=>{function Q(X){if(this.coins=[],this.gas=[],X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.id="",Q.prototype.chain="",Q.prototype.fromAddress="",Q.prototype.toAddress="",Q.prototype.coins=W.emptyArray,Q.prototype.gas=W.emptyArray,Q.prototype.memo="",Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.id!=null&&Object.hasOwnProperty.call(z,"id"))Z.uint32(10).string(z.id);if(z.chain!=null&&Object.hasOwnProperty.call(z,"chain"))Z.uint32(18).string(z.chain);if(z.fromAddress!=null&&Object.hasOwnProperty.call(z,"fromAddress"))Z.uint32(26).string(z.fromAddress);if(z.toAddress!=null&&Object.hasOwnProperty.call(z,"toAddress"))Z.uint32(34).string(z.toAddress);if(z.coins?.length)for(let H=0;H<z.coins.length;++H)q.common.Coin.encode(z.coins[H],Z.uint32(42).fork()).ldelim();if(z.gas?.length)for(let H=0;H<z.gas.length;++H)q.common.Coin.encode(z.gas[H],Z.uint32(50).fork()).ldelim();if(z.memo!=null&&Object.hasOwnProperty.call(z,"memo"))Z.uint32(58).string(z.memo);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.common.Tx;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:L.id=z.string();break;case 2:L.chain=z.string();break;case 3:L.fromAddress=z.string();break;case 4:L.toAddress=z.string();break;case 5:if(!L.coins?.length)L.coins=[];L.coins.push(q.common.Coin.decode(z,z.uint32()));break;case 6:if(!L.gas?.length)L.gas=[];L.gas.push(q.common.Coin.decode(z,z.uint32()));break;case 7:L.memo=z.string();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.id!=null&&z.hasOwnProperty("id")){if(!W.isString(z.id))return"id: string expected"}if(z.chain!=null&&z.hasOwnProperty("chain")){if(!W.isString(z.chain))return"chain: string expected"}if(z.fromAddress!=null&&z.hasOwnProperty("fromAddress")){if(!W.isString(z.fromAddress))return"fromAddress: string expected"}if(z.toAddress!=null&&z.hasOwnProperty("toAddress")){if(!W.isString(z.toAddress))return"toAddress: string expected"}if(z.coins!=null&&z.hasOwnProperty("coins")){if(!Array.isArray(z.coins))return"coins: array expected";for(let Z=0;Z<z.coins.length;++Z){let H=q.common.Coin.verify(z.coins[Z]);if(H)return"coins."+H}}if(z.gas!=null&&z.hasOwnProperty("gas")){if(!Array.isArray(z.gas))return"gas: array expected";for(let Z=0;Z<z.gas.length;++Z){let H=q.common.Coin.verify(z.gas[Z]);if(H)return"gas."+H}}if(z.memo!=null&&z.hasOwnProperty("memo")){if(!W.isString(z.memo))return"memo: string expected"}return null},Q.fromObject=function(z){if(z instanceof q.common.Tx)return z;let Z=new q.common.Tx;if(z.id!=null)Z.id=String(z.id);if(z.chain!=null)Z.chain=String(z.chain);if(z.fromAddress!=null)Z.fromAddress=String(z.fromAddress);if(z.toAddress!=null)Z.toAddress=String(z.toAddress);if(z.coins){if(!Array.isArray(z.coins))throw TypeError(".common.Tx.coins: array expected");Z.coins=[];for(let H=0;H<z.coins.length;++H){if(typeof z.coins[H]!=="object")throw TypeError(".common.Tx.coins: object expected");Z.coins[H]=q.common.Coin.fromObject(z.coins[H])}}if(z.gas){if(!Array.isArray(z.gas))throw TypeError(".common.Tx.gas: array expected");Z.gas=[];for(let H=0;H<z.gas.length;++H){if(typeof z.gas[H]!=="object")throw TypeError(".common.Tx.gas: object expected");Z.gas[H]=q.common.Coin.fromObject(z.gas[H])}}if(z.memo!=null)Z.memo=String(z.memo);return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.arrays||Z.defaults)H.coins=[],H.gas=[];if(Z.defaults)H.id="",H.chain="",H.fromAddress="",H.toAddress="",H.memo="";if(z.id!=null&&z.hasOwnProperty("id"))H.id=z.id;if(z.chain!=null&&z.hasOwnProperty("chain"))H.chain=z.chain;if(z.fromAddress!=null&&z.hasOwnProperty("fromAddress"))H.fromAddress=z.fromAddress;if(z.toAddress!=null&&z.hasOwnProperty("toAddress"))H.toAddress=z.toAddress;if(z.coins?.length){H.coins=[];for(let L=0;L<z.coins.length;++L)H.coins[L]=q.common.Coin.toObject(z.coins[L],Z)}if(z.gas?.length){H.gas=[];for(let L=0;L<z.gas.length;++L)H.gas[L]=q.common.Coin.toObject(z.gas[L],Z)}if(z.memo!=null&&z.hasOwnProperty("memo"))H.memo=z.memo;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.Fee=(()=>{function Q(X){if(this.coins=[],X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.coins=W.emptyArray,Q.prototype.poolDeduct="",Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.coins?.length)for(let H=0;H<z.coins.length;++H)q.common.Coin.encode(z.coins[H],Z.uint32(10).fork()).ldelim();if(z.poolDeduct!=null&&Object.hasOwnProperty.call(z,"poolDeduct"))Z.uint32(18).string(z.poolDeduct);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.common.Fee;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:if(!L.coins?.length)L.coins=[];L.coins.push(q.common.Coin.decode(z,z.uint32()));break;case 2:L.poolDeduct=z.string();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.coins!=null&&z.hasOwnProperty("coins")){if(!Array.isArray(z.coins))return"coins: array expected";for(let Z=0;Z<z.coins.length;++Z){let H=q.common.Coin.verify(z.coins[Z]);if(H)return"coins."+H}}if(z.poolDeduct!=null&&z.hasOwnProperty("poolDeduct")){if(!W.isString(z.poolDeduct))return"poolDeduct: string expected"}return null},Q.fromObject=function(z){if(z instanceof q.common.Fee)return z;let Z=new q.common.Fee;if(z.coins){if(!Array.isArray(z.coins))throw TypeError(".common.Fee.coins: array expected");Z.coins=[];for(let H=0;H<z.coins.length;++H){if(typeof z.coins[H]!=="object")throw TypeError(".common.Fee.coins: object expected");Z.coins[H]=q.common.Coin.fromObject(z.coins[H])}}if(z.poolDeduct!=null)Z.poolDeduct=String(z.poolDeduct);return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.arrays||Z.defaults)H.coins=[];if(Z.defaults)H.poolDeduct="";if(z.coins?.length){H.coins=[];for(let L=0;L<z.coins.length;++L)H.coins[L]=q.common.Coin.toObject(z.coins[L],Z)}if(z.poolDeduct!=null&&z.hasOwnProperty("poolDeduct"))H.poolDeduct=z.poolDeduct;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.ProtoUint=(()=>{function Q(X){if(X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.value="",Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.value!=null&&Object.hasOwnProperty.call(z,"value"))Z.uint32(10).string(z.value);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.common.ProtoUint;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:L.value=z.string();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.value!=null&&z.hasOwnProperty("value")){if(!W.isString(z.value))return"value: string expected"}return null},Q.fromObject=function(z){if(z instanceof q.common.ProtoUint)return z;let Z=new q.common.ProtoUint;if(z.value!=null)Z.value=String(z.value);return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.defaults)H.value="";if(z.value!=null&&z.hasOwnProperty("value"))H.value=z.value;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y})();q.types=(()=>{let Y={};return Y.MsgDeposit=(()=>{function Q(X){if(this.coins=[],X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.coins=W.emptyArray,Q.prototype.memo="",Q.prototype.signer=W.newBuffer([]),Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.coins?.length)for(let H=0;H<z.coins.length;++H)q.common.Coin.encode(z.coins[H],Z.uint32(10).fork()).ldelim();if(z.memo!=null&&Object.hasOwnProperty.call(z,"memo"))Z.uint32(18).string(z.memo);if(z.signer!=null&&Object.hasOwnProperty.call(z,"signer"))Z.uint32(26).bytes(z.signer);return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.types.MsgDeposit;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:if(!L.coins?.length)L.coins=[];L.coins.push(q.common.Coin.decode(z,z.uint32()));break;case 2:L.memo=z.string();break;case 3:L.signer=z.bytes();break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.coins!=null&&z.hasOwnProperty("coins")){if(!Array.isArray(z.coins))return"coins: array expected";for(let Z=0;Z<z.coins.length;++Z){let H=q.common.Coin.verify(z.coins[Z]);if(H)return"coins."+H}}if(z.memo!=null&&z.hasOwnProperty("memo")){if(!W.isString(z.memo))return"memo: string expected"}if(z.signer!=null&&z.hasOwnProperty("signer")){if(!(z.signer&&typeof z.signer.length==="number"||W.isString(z.signer)))return"signer: buffer expected"}return null},Q.fromObject=function(z){if(z instanceof q.types.MsgDeposit)return z;let Z=new q.types.MsgDeposit;if(z.coins){if(!Array.isArray(z.coins))throw TypeError(".types.MsgDeposit.coins: array expected");Z.coins=[];for(let H=0;H<z.coins.length;++H){if(typeof z.coins[H]!=="object")throw TypeError(".types.MsgDeposit.coins: object expected");Z.coins[H]=q.common.Coin.fromObject(z.coins[H])}}if(z.memo!=null)Z.memo=String(z.memo);if(z.signer!=null){if(typeof z.signer==="string")W.base64.decode(z.signer,Z.signer=W.newBuffer(W.base64.length(z.signer)),0);else if(z.signer.length)Z.signer=z.signer}return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.arrays||Z.defaults)H.coins=[];if(Z.defaults){if(H.memo="",Z.bytes===String)H.signer="";else if(H.signer=[],Z.bytes!==Array)H.signer=W.newBuffer(H.signer)}if(z.coins?.length){H.coins=[];for(let L=0;L<z.coins.length;++L)H.coins[L]=q.common.Coin.toObject(z.coins[L],Z)}if(z.memo!=null&&z.hasOwnProperty("memo"))H.memo=z.memo;if(z.signer!=null&&z.hasOwnProperty("signer"))H.signer=Z.bytes===String?W.base64.encode(z.signer,0,z.signer.length):Z.bytes===Array?Array.prototype.slice.call(z.signer):z.signer;return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.MsgSend=(()=>{function Q(X){if(this.amount=[],X){for(let z=Object.keys(X),Z=0;Z<z.length;++Z)if(X[z[Z]]!=null)this[z[Z]]=X[z[Z]]}}return Q.prototype.fromAddress=W.newBuffer([]),Q.prototype.toAddress=W.newBuffer([]),Q.prototype.amount=W.emptyArray,Q.create=function(z){return new Q(z)},Q.encode=function(z,Z){if(!Z)Z=M.create();if(z.fromAddress!=null&&Object.hasOwnProperty.call(z,"fromAddress"))Z.uint32(10).bytes(z.fromAddress);if(z.toAddress!=null&&Object.hasOwnProperty.call(z,"toAddress"))Z.uint32(18).bytes(z.toAddress);if(z.amount?.length)for(let H=0;H<z.amount.length;++H)q.cosmos.base.v1beta1.Coin.encode(z.amount[H],Z.uint32(26).fork()).ldelim();return Z},Q.encodeDelimited=function(z,Z){return this.encode(z,Z).ldelim()},Q.decode=function(z,Z){if(!(z instanceof T))z=T.create(z);let H=Z===void 0?z.len:z.pos+Z,L=new q.types.MsgSend;while(z.pos<H){let J=z.uint32();switch(J>>>3){case 1:L.fromAddress=z.bytes();break;case 2:L.toAddress=z.bytes();break;case 3:if(!L.amount?.length)L.amount=[];L.amount.push(q.cosmos.base.v1beta1.Coin.decode(z,z.uint32()));break;default:z.skipType(J&7);break}}return L},Q.decodeDelimited=function(z){if(!(z instanceof T))z=new T(z);return this.decode(z,z.uint32())},Q.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.fromAddress!=null&&z.hasOwnProperty("fromAddress")){if(!(z.fromAddress&&typeof z.fromAddress.length==="number"||W.isString(z.fromAddress)))return"fromAddress: buffer expected"}if(z.toAddress!=null&&z.hasOwnProperty("toAddress")){if(!(z.toAddress&&typeof z.toAddress.length==="number"||W.isString(z.toAddress)))return"toAddress: buffer expected"}if(z.amount!=null&&z.hasOwnProperty("amount")){if(!Array.isArray(z.amount))return"amount: array expected";for(let Z=0;Z<z.amount.length;++Z){let H=q.cosmos.base.v1beta1.Coin.verify(z.amount[Z]);if(H)return"amount."+H}}return null},Q.fromObject=function(z){if(z instanceof q.types.MsgSend)return z;let Z=new q.types.MsgSend;if(z.fromAddress!=null){if(typeof z.fromAddress==="string")W.base64.decode(z.fromAddress,Z.fromAddress=W.newBuffer(W.base64.length(z.fromAddress)),0);else if(z.fromAddress.length)Z.fromAddress=z.fromAddress}if(z.toAddress!=null){if(typeof z.toAddress==="string")W.base64.decode(z.toAddress,Z.toAddress=W.newBuffer(W.base64.length(z.toAddress)),0);else if(z.toAddress.length)Z.toAddress=z.toAddress}if(z.amount){if(!Array.isArray(z.amount))throw TypeError(".types.MsgSend.amount: array expected");Z.amount=[];for(let H=0;H<z.amount.length;++H){if(typeof z.amount[H]!=="object")throw TypeError(".types.MsgSend.amount: object expected");Z.amount[H]=q.cosmos.base.v1beta1.Coin.fromObject(z.amount[H])}}return Z},Q.toObject=function(z,Z){if(!Z)Z={};let H={};if(Z.arrays||Z.defaults)H.amount=[];if(Z.defaults){if(Z.bytes===String)H.fromAddress="";else if(H.fromAddress=[],Z.bytes!==Array)H.fromAddress=W.newBuffer(H.fromAddress);if(Z.bytes===String)H.toAddress="";else if(H.toAddress=[],Z.bytes!==Array)H.toAddress=W.newBuffer(H.toAddress)}if(z.fromAddress!=null&&z.hasOwnProperty("fromAddress"))H.fromAddress=Z.bytes===String?W.base64.encode(z.fromAddress,0,z.fromAddress.length):Z.bytes===Array?Array.prototype.slice.call(z.fromAddress):z.fromAddress;if(z.toAddress!=null&&z.hasOwnProperty("toAddress"))H.toAddress=Z.bytes===String?W.base64.encode(z.toAddress,0,z.toAddress.length):Z.bytes===Array?Array.prototype.slice.call(z.toAddress):z.toAddress;if(z.amount?.length){H.amount=[];for(let L=0;L<z.amount.length;++L)H.amount[L]=q.cosmos.base.v1beta1.Coin.toObject(z.amount[L],Z)}return H},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y})();q.cosmos=(()=>{let Y={};return Y.base=(()=>{let Q={};return Q.v1beta1=(()=>{let X={};return X.Coin=(()=>{function z(Z){if(Z){for(let H=Object.keys(Z),L=0;L<H.length;++L)if(Z[H[L]]!=null)this[H[L]]=Z[H[L]]}}return z.prototype.denom="",z.prototype.amount="",z.create=function(H){return new z(H)},z.encode=function(H,L){if(!L)L=M.create();if(H.denom!=null&&Object.hasOwnProperty.call(H,"denom"))L.uint32(10).string(H.denom);if(H.amount!=null&&Object.hasOwnProperty.call(H,"amount"))L.uint32(18).string(H.amount);return L},z.encodeDelimited=function(H,L){return this.encode(H,L).ldelim()},z.decode=function(H,L){if(!(H instanceof T))H=T.create(H);let J=L===void 0?H.len:H.pos+L,I=new q.cosmos.base.v1beta1.Coin;while(H.pos<J){let N=H.uint32();switch(N>>>3){case 1:I.denom=H.string();break;case 2:I.amount=H.string();break;default:H.skipType(N&7);break}}return I},z.decodeDelimited=function(H){if(!(H instanceof T))H=new T(H);return this.decode(H,H.uint32())},z.verify=function(H){if(typeof H!=="object"||H===null)return"object expected";if(H.denom!=null&&H.hasOwnProperty("denom")){if(!W.isString(H.denom))return"denom: string expected"}if(H.amount!=null&&H.hasOwnProperty("amount")){if(!W.isString(H.amount))return"amount: string expected"}return null},z.fromObject=function(H){if(H instanceof q.cosmos.base.v1beta1.Coin)return H;let L=new q.cosmos.base.v1beta1.Coin;if(H.denom!=null)L.denom=String(H.denom);if(H.amount!=null)L.amount=String(H.amount);return L},z.toObject=function(H,L){if(!L)L={};let J={};if(L.defaults)J.denom="",J.amount="";if(H.denom!=null&&H.hasOwnProperty("denom"))J.denom=H.denom;if(H.amount!=null&&H.hasOwnProperty("amount"))J.amount=H.amount;return J},z.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},z})(),X.DecCoin=(()=>{function z(Z){if(Z){for(let H=Object.keys(Z),L=0;L<H.length;++L)if(Z[H[L]]!=null)this[H[L]]=Z[H[L]]}}return z.prototype.denom="",z.prototype.amount="",z.create=function(H){return new z(H)},z.encode=function(H,L){if(!L)L=M.create();if(H.denom!=null&&Object.hasOwnProperty.call(H,"denom"))L.uint32(10).string(H.denom);if(H.amount!=null&&Object.hasOwnProperty.call(H,"amount"))L.uint32(18).string(H.amount);return L},z.encodeDelimited=function(H,L){return this.encode(H,L).ldelim()},z.decode=function(H,L){if(!(H instanceof T))H=T.create(H);let J=L===void 0?H.len:H.pos+L,I=new q.cosmos.base.v1beta1.DecCoin;while(H.pos<J){let N=H.uint32();switch(N>>>3){case 1:I.denom=H.string();break;case 2:I.amount=H.string();break;default:H.skipType(N&7);break}}return I},z.decodeDelimited=function(H){if(!(H instanceof T))H=new T(H);return this.decode(H,H.uint32())},z.verify=function(H){if(typeof H!=="object"||H===null)return"object expected";if(H.denom!=null&&H.hasOwnProperty("denom")){if(!W.isString(H.denom))return"denom: string expected"}if(H.amount!=null&&H.hasOwnProperty("amount")){if(!W.isString(H.amount))return"amount: string expected"}return null},z.fromObject=function(H){if(H instanceof q.cosmos.base.v1beta1.DecCoin)return H;let L=new q.cosmos.base.v1beta1.DecCoin;if(H.denom!=null)L.denom=String(H.denom);if(H.amount!=null)L.amount=String(H.amount);return L},z.toObject=function(H,L){if(!L)L={};let J={};if(L.defaults)J.denom="",J.amount="";if(H.denom!=null&&H.hasOwnProperty("denom"))J.denom=H.denom;if(H.amount!=null&&H.hasOwnProperty("amount"))J.amount=H.amount;return J},z.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},z})(),X.IntProto=(()=>{function z(Z){if(Z){for(let H=Object.keys(Z),L=0;L<H.length;++L)if(Z[H[L]]!=null)this[H[L]]=Z[H[L]]}}return z.prototype.int="",z.create=function(H){return new z(H)},z.encode=function(H,L){if(!L)L=M.create();if(H.int!=null&&Object.hasOwnProperty.call(H,"int"))L.uint32(10).string(H.int);return L},z.encodeDelimited=function(H,L){return this.encode(H,L).ldelim()},z.decode=function(H,L){if(!(H instanceof T))H=T.create(H);let J=L===void 0?H.len:H.pos+L,I=new q.cosmos.base.v1beta1.IntProto;while(H.pos<J){let N=H.uint32();switch(N>>>3){case 1:I.int=H.string();break;default:H.skipType(N&7);break}}return I},z.decodeDelimited=function(H){if(!(H instanceof T))H=new T(H);return this.decode(H,H.uint32())},z.verify=function(H){if(typeof H!=="object"||H===null)return"object expected";if(H.int!=null&&H.hasOwnProperty("int")){if(!W.isString(H.int))return"int: string expected"}return null},z.fromObject=function(H){if(H instanceof q.cosmos.base.v1beta1.IntProto)return H;let L=new q.cosmos.base.v1beta1.IntProto;if(H.int!=null)L.int=String(H.int);return L},z.toObject=function(H,L){if(!L)L={};let J={};if(L.defaults)J.int="";if(H.int!=null&&H.hasOwnProperty("int"))J.int=H.int;return J},z.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},z})(),X.DecProto=(()=>{function z(Z){if(Z){for(let H=Object.keys(Z),L=0;L<H.length;++L)if(Z[H[L]]!=null)this[H[L]]=Z[H[L]]}}return z.prototype.dec="",z.create=function(H){return new z(H)},z.encode=function(H,L){if(!L)L=M.create();if(H.dec!=null&&Object.hasOwnProperty.call(H,"dec"))L.uint32(10).string(H.dec);return L},z.encodeDelimited=function(H,L){return this.encode(H,L).ldelim()},z.decode=function(H,L){if(!(H instanceof T))H=T.create(H);let J=L===void 0?H.len:H.pos+L,I=new q.cosmos.base.v1beta1.DecProto;while(H.pos<J){let N=H.uint32();switch(N>>>3){case 1:I.dec=H.string();break;default:H.skipType(N&7);break}}return I},z.decodeDelimited=function(H){if(!(H instanceof T))H=new T(H);return this.decode(H,H.uint32())},z.verify=function(H){if(typeof H!=="object"||H===null)return"object expected";if(H.dec!=null&&H.hasOwnProperty("dec")){if(!W.isString(H.dec))return"dec: string expected"}return null},z.fromObject=function(H){if(H instanceof q.cosmos.base.v1beta1.DecProto)return H;let L=new q.cosmos.base.v1beta1.DecProto;if(H.dec!=null)L.dec=String(H.dec);return L},z.toObject=function(H,L){if(!L)L={};let J={};if(L.defaults)J.dec="";if(H.dec!=null&&H.hasOwnProperty("dec"))J.dec=H.dec;return J},z.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},z})(),X})(),Q})(),Y})()});async function b(){let{$root:Y}=await Promise.resolve().then(() => (D6(),y6)),Q=await import("@cosmjs/proto-signing"),X=Q.Registry??Q.default?.Registry,z=await import("@cosmjs/stargate"),Z=z.defaultRegistryTypes??z.default?.defaultRegistryTypes;return new X([...Z,["/types.MsgSend",Y.types.MsgSend],["/types.MsgDeposit",Y.types.MsgDeposit]])}async function w(Y){let Q=await import("@cosmjs/stargate"),X=Q.AminoTypes??Q.default?.AminoTypes,z=Y===C6.Chain.THORChain?"thorchain":"mayachain";return new X({"/types.MsgDeposit":{aminoType:`${z}/MsgDeposit`,fromAmino:({signer:Z,...H})=>({...H,signer:d(Z)}),toAmino:({signer:Z,...H})=>({...H,signer:n(Z)})},"/types.MsgSend":{aminoType:`${z}/MsgSend`,fromAmino:({from_address:Z,to_address:H,...L})=>({...L,fromAddress:d(Z),toAddress:d(H)}),toAmino:({fromAddress:Z,toAddress:H,...L})=>({...L,from_address:n(Z),to_address:n(H)})}})}var C6;var G6=f(()=>{C6=require("@swapkit/helpers");L6()});function I6(Y){return function(X){let{assetValue:z,recipient:Z,memo:H,sender:L,asSignable:J,asAminoMessage:I}=X;if(Z)return P6(Y)({asAminoMessage:I,asSignable:J,assetValue:z,memo:H,recipient:Z,sender:L});return w6(Y)({asAminoMessage:I,asSignable:J,assetValue:z,memo:H,sender:L})}}function u(Y){if(Y.type==="thorchain/MsgSend"||Y.type==="mayachain/MsgSend")return Y;return{...Y,value:{...Y.value,coins:Y.value.coins.map((Q)=>{let X=k.AssetValue.from({asset:Q.asset}),z=(X.isSynthetic?X.symbol.split("/")?.[1]:X.symbol)?.toUpperCase(),Z=(X.isSynthetic?X.symbol.split("/")?.[0]:X.chain)?.toUpperCase();return{...Q,asset:{chain:Z,symbol:z,synth:X.isSynthetic,ticker:X.ticker}}})}}}async function o({chain:Y,memo:Q,msgs:X}){let z=await b(),Z=await w(Y),H={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{memo:Q,messages:X.map((L)=>Z.fromAmino(L))}};return z.encode(H)}var k,Y4,J4,_6=({sender:Y,recipient:Q,assetValue:X})=>{return{type:`${X.chain===k.Chain.Maya?"mayachain":"thorchain"}/MsgSend`,value:{amount:[{amount:X.getBaseValue("string"),denom:P(X.symbol,!0)}],from_address:Y,to_address:Q}}},T6=({sender:Y,assetValue:Q,memo:X=""})=>{return{type:`${Q.chain===k.Chain.Maya?"mayachain":"thorchain"}/MsgDeposit`,value:{coins:[{amount:Q.getBaseValue("string"),asset:m(Q)}],memo:X,signer:Y}}},e=({sender:Y,recipient:Q,assetValue:X,memo:z})=>{return!Q?T6({assetValue:X,memo:z,sender:Y}):_6({assetValue:X,recipient:Q,sender:Y})},$=async(Y,Q)=>{return(await w(Q)).fromAmino(Y)},S6=async({rpcUrl:Y,sender:Q})=>{let z=await(await y(Y)).getAccount(Q);if(!z)throw new k.SwapKitError("toolbox_cosmos_account_not_found",{sender:Q});return z},P6=(Y)=>async({sender:Q,recipient:X,assetValue:z,memo:Z="",asSignable:H=!0,asAminoMessage:L=!1,sequence:J,accountNumber:I})=>{let N=await S6({rpcUrl:Y,sender:Q}),x=z.chain,O=_6({assetValue:z,recipient:X,sender:Q}),v=H?await $(L?O:u(O),x):O;return{accountNumber:I||N.accountNumber,chainId:k.ChainToChainId[x],fee:F(z.chain),memo:Z,msgs:[v],sequence:J||N.sequence}},w6=(Y)=>async({sender:Q,assetValue:X,memo:z="",asSignable:Z=!0,asAminoMessage:H=!1,sequence:L,accountNumber:J})=>{let I=await S6({rpcUrl:Y,sender:Q}),N=X.chain,x=T6({assetValue:X,memo:z,sender:Q}),O=Z?await $(H?x:u(x),N):x;return{accountNumber:J||I.accountNumber,chainId:k.ChainToChainId[N],fee:F(X.chain),memo:z,msgs:[O],sequence:L||I.sequence}};var $6=f(()=>{k=require("@swapkit/helpers");i();G6();Y4=F(k.Chain.THORChain).gas,J4=F(k.Chain.Maya).gas});var u6=()=>{};var h6=f(()=>{u6()});var O6=f(()=>{L6();$6();G6();h6()});async function E6(Y,Q){try{let z=(await B6.SwapKitApi.getGasRate()).find((Z)=>Z.chainId===Y)?.value;return z?Number.parseFloat(z):Q}catch(X){return Q}}async function N6({phrase:Y,prefix:Q,...X}){let z=await import("@cosmjs/proto-signing"),Z=z.DirectSecp256k1HdWallet??z.default?.DirectSecp256k1HdWallet,H=await import("@cosmjs/crypto"),L=H.stringToPath??H.default?.stringToPath,J="derivationPath"in X?X.derivationPath:`${G.DerivationPath[X.chain]}/${X.index}`;return Z.fromMnemonic(Y,{hdPaths:[L(J)],prefix:Q})}async function q4({privateKey:Y,prefix:Q}){let X=await import("@cosmjs/proto-signing");return(X.DirectSecp256k1Wallet??X.default?.DirectSecp256k1Wallet).fromKey(Y,Q)}function p6(Y){return async function({signature:X,message:z,address:Z}){let H=await Y(Z);if(!H?.pubkey)throw new G.SwapKitError("toolbox_cosmos_verify_signature_no_pubkey");let L=await import("@cosmjs/crypto"),J=L.Secp256k1Signature??L.default?.Secp256k1Signature,I=L.Secp256k1??L.default?.Secp256k1,N=J.fromFixedLength(h.base64.decode(X));return I.verifySignature(N,h.base64.decode(z),H.pubkey.value)}}async function r({chain:Y,...Q}){let X=await G.getRPCUrl(Y),z=G.CosmosChainPrefixes[Y],Z="index"in Q?Q.index||0:0,H=G.derivationPathToString("derivationPath"in Q&&Q.derivationPath?Q.derivationPath:G.updateDerivationPath(G.NetworkDerivationPath[Y],{index:Z})),L=await t.match(Q).with({phrase:t.P.string},({phrase:O})=>N6({derivationPath:H,phrase:O,prefix:z})).with({signer:t.P.any},({signer:O})=>O).otherwise(()=>{return});async function J(O){return(await y(X)).getAccount(O)}async function I(){let[O]=await L?.getAccounts()||[];return O?.address}async function N(){let[O]=await L?.getAccounts()||[];if(!O?.pubkey)throw new G.SwapKitError("toolbox_cosmos_signer_not_defined");return h.base64.encode(O?.pubkey)}async function x({recipient:O,assetValue:v,memo:V="",feeRate:B,feeOptionKey:A=G.FeeOption.Fast}){let R=await I();if(!(L&&R))throw new G.SwapKitError("toolbox_cosmos_signer_not_defined");let D=G.AssetValue.from({chain:Y}),C=m(D),H6=B||I4((await j6(Y,l6[Y]))[A],C),Z6=await g(X,L),Q6=[{amount:v.getBaseValue("string"),denom:P(`u${v.symbol}`).toLowerCase()}],{transactionHash:p}=await Z6.sendTokens(R,O,Q6,H6,V);return p}return{createPrivateKeyFromPhrase:N4(H),createTransaction:q6,fetchFeeRateFromSwapKit:E6,getAccount:J,getAddress:I,getBalance:async(O,v)=>{let V=await b6(X)(O);return await Promise.all(V.filter(({denom:B})=>B&&!B.includes("IBC/")).map(({denom:B,amount:A})=>{let R=[G.Chain.THORChain,G.Chain.Maya].includes(Y)&&(B.includes("/")||B.includes("˜"))?`${Y}.${B}`:B;return W6(R,A)}))},getBalanceAsDenoms:b6(X),getFees:()=>j6(Y,l6[Y]),getPubKey:N,getSignerFromPhrase:async({phrase:O,derivationPath:v})=>N6({derivationPath:G.derivationPathToString(v),index:Z,phrase:O,prefix:z}),getSignerFromPrivateKey:async(O)=>{let v=await import("@cosmjs/proto-signing");return(v.DirectSecp256k1Wallet??v.default?.DirectSecp256k1Wallet).fromKey(O,z)},transfer:x,validateAddress:d6(z),verifySignature:p6(J)}}async function c6(Y,Q){try{let z=(await B6.SwapKitApi.getGasRate()).find((Z)=>Z.chainId===Y)?.value;return z?Number.parseFloat(z):Q}catch(X){return Q}}function G4({address:Y,chain:Q,prefix:X}){let z=X||T4(Q);if(!(z&&Y))throw new G.SwapKitError("toolbox_cosmos_validate_address_prefix_not_found");return d6(z)(Y)}function _4({assetValue:{chain:Y}}){return G.AssetValue.from({chain:Y,value:O4(Y)})}function T4(Y){let{isStagenet:Q}=G.SKConfig.get("envs"),X=Y?[G.Chain.THORChain,G.Chain.Maya].includes(Y)&&Q:!1,z=Y?G.CosmosChainPrefixes[Y]:void 0;return X?`s${z}`:z}async function j6(Y,Q){let X=await E6(G.ChainToChainId[Y],Q);return{average:G.SwapKitNumber.fromBigInt(BigInt(X),G.BaseDecimal[Y]),fast:G.SwapKitNumber.fromBigInt(BigInt(G.applyFeeMultiplier(X,G.FeeOption.Fast,!0)),G.BaseDecimal[Y]),fastest:G.SwapKitNumber.fromBigInt(BigInt(G.applyFeeMultiplier(X,G.FeeOption.Fastest,!0)),G.BaseDecimal[Y])}}function I4(Y,Q){return{amount:[{amount:Y.getBaseValue("string"),denom:Q}],gas:"200000"}}function O4(Y){return{[G.Chain.Cosmos]:0.007,[G.Chain.Kujira]:0.02,[G.Chain.Noble]:0.01,[G.Chain.THORChain]:0.02,[G.Chain.Maya]:0.02}[Y]||0}function d6(Y){return function(X){if(!X.startsWith(Y))return!1;try{let{prefix:z,words:Z}=h.bech32.decode(X);return h.bech32.encode(z,Z)===X.toLocaleLowerCase()}catch(z){return!1}}}function b6(Y){return async function(X){return(await(await y(Y)).getAllBalances(X)).map((L)=>({...L,denom:L.denom.includes("/")?L.denom.toUpperCase():L.denom}))}}function N4(Y){return async function(X){let z=await import("@cosmjs/crypto"),Z=z.stringToPath??z.default?.stringToPath,H=z.Slip10Curve??z.default?.Slip10Curve,L=z.Slip10??z.default?.Slip10,J=z.EnglishMnemonic??z.default?.EnglishMnemonic,I=z.Bip39??z.default?.Bip39,N=new J(X),x=await I.mnemonicToSeed(N),{privkey:O}=L.derivePath(H.Secp256k1,x,Z(Y));return O}}var h,G,B6,t,l6,W4;var z6=f(()=>{h=require("@scure/base"),G=require("@swapkit/helpers"),B6=require("@swapkit/helpers/api"),t=require("ts-pattern");i();l6={[G.Chain.Cosmos]:500,[G.Chain.Kujira]:1000,[G.Chain.Noble]:1000,[G.Chain.THORChain]:5000000,[G.Chain.Maya]:5000000};W4=c6});function B4({prefix:Y,derivationPath:Q}){return async function(z,Z=0){let H=await import("@cosmjs/amino"),L=H.Secp256k1HdWallet??H.default?.Secp256k1HdWallet,J=await import("@cosmjs/crypto"),I=J.stringToPath??J.default?.stringToPath;return L.fromMnemonic(z,{hdPaths:[I(`${Q}/${Z}`)],prefix:Y})}}function E4(Y){return l.base64.encode(Y)}function U4(Y){return async function({wallet:X,tx:z}){let{msgs:Z,accountNumber:H,sequence:L,chainId:J,fee:I,memo:N}=typeof z==="string"?JSON.parse(z):z,x=(await X.getAccounts())?.[0]?.address||"",O=await w(Y),v=await b(),V=await J6(X,{aminoTypes:O,registry:v}),B=[];for(let D of Z){let C=await $(D,Y);B.push(C)}let{signatures:[A]}=await V.sign(x,B,I,N,{accountNumber:H,chainId:J,sequence:L});return{bodyBytes:await o({chain:Y,memo:N,msgs:Z.map(u)}),signature:E4(A)}}}function x4({prefix:Y,rpcUrl:Q}){return async function(z,Z,H,L,J){let{encodeSecp256k1Pubkey:I,pubkeyToAddress:N}=(await import("@cosmjs/amino")).default,{makeMultisignedTxBytes:x}=(await import("@cosmjs/stargate")).default,{sequence:O,fee:v}=JSON.parse(z),V=await n6(H,L),B=Z.map((D)=>[N(I(l.base64.decode(D.pubKey)),Y),l.base64.decode(D.signature)]),A=await y(Q),{transactionHash:R}=await A.broadcastTx(x(V,O,v,J,new Map(B)));return R}}async function n6(Y,Q,X=!0){let{createMultisigThresholdPubkey:z,encodeSecp256k1Pubkey:Z}=(await import("@cosmjs/amino")).default;return z(Y.map((H)=>Z(l.base64.decode(H))),Q,X)}function v4(Y){return l.base64.decode(Y)}async function A4({privateKey:Y,message:Q}){let{Secp256k1:X}=(await import("@cosmjs/crypto")).default,z=await X.createSignature(l.base64.decode(Q),Y);return l.base64.encode(Buffer.concat([z.r(32),z.s(32)]))}async function U6({chain:Y,...Q}){let X=E.SKConfig.get("nodeUrls")[Y],z=await E.getRPCUrl(Y),{isStagenet:Z}=E.SKConfig.get("envs"),H=Y===E.Chain.THORChain,L=`${Z?"s":""}${E.CosmosChainPrefixes[Y]}`,J="index"in Q?Q.index||0:0,I="derivationPath"in Q&&Q.derivationPath?Q.derivationPath:E.updateDerivationPath(E.NetworkDerivationPath[Y],{index:J}),N=await r({chain:Y,...Q}),x=await a.match(Q).with({phrase:a.P.string},({phrase:B})=>N.getSignerFromPhrase({derivationPath:I,phrase:B})).with({signer:a.P.any},({signer:B})=>B).otherwise(()=>{return}),O=F(Y);async function v(){let B,A=`${X}/${H?"thorchain":"mayachain"}/constants`;try{let{int_64_values:{NativeTransactionFee:R}}=await E.RequestClient.get(A);if(!R||Number.isNaN(R)||R<0)throw new E.SwapKitError("toolbox_cosmos_invalid_fee",{nativeFee:R.toString()});B=new E.SwapKitNumber(R)}catch{B=new E.SwapKitNumber({decimal:E.BaseDecimal[Y],value:H?0.02:1})}return{[E.FeeOption.Average]:B,[E.FeeOption.Fast]:B,[E.FeeOption.Fastest]:B}}async function V({assetValue:B,memo:A="",recipient:R}){let{TxRaw:D}=await import("cosmjs-types/cosmos/tx/v1beta1/tx"),C=(await x?.getAccounts())?.[0]?.address;if(!(C&&x))throw new E.SwapKitError("toolbox_cosmos_no_signer");let H6="signAmino"in x,Z6=await b(),Q6=await w(Y),p=await g(z,x,{aminoTypes:Q6,registry:Z6}),X6=e({assetValue:B,memo:A,recipient:R,sender:C});if(H6){let o6=await $(X6,Y),{signatures:t6,authInfoBytes:r6}=await p.sign(C,[o6],O,A),a6=D.encode({authInfoBytes:r6,bodyBytes:await o({chain:Y,memo:A,msgs:[X6].map(u)}),signatures:t6}).finish();return(await p.broadcastTx(a6)).transactionHash}let g6=u(X6),i6=await $(g6,Y);return(await p.signAndBroadcast(C,[i6],O,A)).transactionHash}return{...N,broadcastMultisigTx:x4({prefix:L,rpcUrl:z}),buildAminoMsg:e,buildEncodedTxBody:o,convertToSignable:$,createDefaultAminoTypes:()=>w(Y),createDefaultRegistry:b,createMultisig:n6,createTransaction:I6(z),deposit:V,getFees:v,importSignature:v4,parseAminoMessageForDirectSigning:u,pubkeyToAddress:async(B)=>{let{pubkeyToAddress:A}=(await import("@cosmjs/amino")).default;return A(B,L)},secp256k1HdWalletFromMnemonic:B4({derivationPath:E.derivationPathToString(I),prefix:L}),signMultisigTx:U4(Y),signWithPrivateKey:A4,transfer:V}}var l,E,a;var x6=f(()=>{l=require("@scure/base"),E=require("@swapkit/helpers"),a=require("ts-pattern");O6();i();z6()});var j,K4=(Y,Q)=>{switch(Y){case j.Chain.Cosmos:case j.Chain.Kujira:case j.Chain.Noble:return r({chain:Y,...Q});case j.Chain.Maya:case j.Chain.THORChain:return U6({chain:Y,...Q});default:throw new j.SwapKitError("toolbox_cosmos_not_supported",{chain:Y})}};var m6=f(()=>{j=require("@swapkit/helpers");z6();x6();z6();x6()});var V4={};R6(V4,{verifySignature:()=>p6,transferMsgAmino:()=>_6,toBase64:()=>Z4,parseAminoMessageForDirectSigning:()=>u,getSignerFromPrivateKey:()=>q4,getSignerFromPhrase:()=>N6,getMsgSendDenom:()=>P,getFeeRateFromThorswap:()=>W4,getFeeRateFromSwapKit:()=>c6,getDenomWithChain:()=>m,getDefaultChainFee:()=>F,getCreateTransaction:()=>I6,getCosmosToolbox:()=>K4,getAssetFromDenom:()=>W6,fromBase64:()=>Q4,fetchFeeRateFromSwapKit:()=>E6,estimateTransactionFee:()=>_4,depositMsgAmino:()=>T6,createThorchainToolbox:()=>U6,createStargateClient:()=>y,createSigningStargateClient:()=>g,createOfflineStargateClient:()=>J6,createDefaultRegistry:()=>b,createDefaultAminoTypes:()=>w,createCosmosToolbox:()=>r,cosmosValidateAddress:()=>G4,cosmosCreateTransaction:()=>q6,convertToSignable:()=>$,buildTransferTx:()=>P6,buildEncodedTxBody:()=>o,buildDepositTx:()=>w6,buildAminoMsg:()=>e,bech32ToBase64:()=>d,base64ToBech32:()=>n,YUM_KUJIRA_FACTORY_DENOM:()=>f6,USK_KUJIRA_FACTORY_DENOM:()=>Y6,THORCHAIN_GAS_VALUE:()=>Y4,MAYA_GAS_VALUE:()=>J4,DEFAULT_NOBLE_FEE_MAINNET:()=>F6,DEFAULT_KUJI_FEE_MAINNET:()=>k6,DEFAULT_COSMOS_FEE_MAINNET:()=>M6});module.exports=H4(V4);var f4=f(()=>{O6();m6();i()});f4();
1
+ var s6=Object.create;var{getPrototypeOf:e6,defineProperty:c,getOwnPropertyNames:A6,getOwnPropertyDescriptor:L4}=Object,K6=Object.prototype.hasOwnProperty;var U=(Y,Q,H)=>{H=Y!=null?s6(e6(Y)):{};let L=Q||!Y||!Y.__esModule?c(H,"default",{value:Y,enumerable:!0}):H;for(let Z of A6(Y))if(!K6.call(L,Z))c(L,Z,{get:()=>Y[Z],enumerable:!0});return L},v6=new WeakMap,z4=(Y)=>{var Q=v6.get(Y),H;if(Q)return Q;if(Q=c({},"__esModule",{value:!0}),Y&&typeof Y==="object"||typeof Y==="function")A6(Y).map((L)=>!K6.call(Q,L)&&c(Q,L,{get:()=>Y[L],enumerable:!(H=L4(Y,L))||H.enumerable}));return v6.set(Y,Q),Q};var V6=(Y,Q)=>{for(var H in Q)c(Y,H,{get:Q[H],enumerable:!0,configurable:!0,set:(L)=>Q[H]=()=>L})};var k=(Y,Q)=>()=>(Y&&(Q=Y(Y=0)),Q);function d(Y){return C.base64.encode(Uint8Array.from(C.bech32.fromWords(C.bech32.decode(Y).words)))}function n(Y,Q="thor"){return C.bech32.encode(Q,C.bech32.toWords(C.base64.decode(Y)))}function Z4(Y){return s.fromByteArray(Y)}function Q4(Y){if(!Y.match(/^[a-zA-Z0-9+/]*={0,2}$/))throw new R6.SwapKitError("toolbox_cosmos_invalid_params",{error:"Invalid base64 string format"});return s.toByteArray(Y)}var C,R6,s;var H6=k(()=>{C=require("@scure/base"),R6=require("@swapkit/helpers"),s=require("base64-js")});function f(Y){switch(Y){case W.Chain.Maya:return{amount:[],gas:"10000000000"};case W.Chain.THORChain:return{amount:[],gas:"500000000"};case W.Chain.Kujira:return F6;case W.Chain.Noble:return f6;default:return M6}}async function y(Y){let Q=await import("@cosmjs/stargate"),H=Q.StargateClient??Q.default?.StargateClient,L=typeof window<"u"?{}:{referer:"https://sdk.swapkit.dev",referrer:"https://sdk.swapkit.dev"};return H.connect({headers:L,url:Y})}async function g(Y,Q,H={}){let L=await import("@cosmjs/stargate"),Z=L.SigningStargateClient??L.default?.SigningStargateClient,z=L.GasPrice??L.default?.GasPrice,X=typeof H==="string"?H:"0.0003uatom",J=typeof H==="string"?{}:H;return Z.connectWithSigner(Y,Q,{gasPrice:z.fromString(X),...J})}async function J6(Y,Q){let H=await import("@cosmjs/stargate");return(H.SigningStargateClient??H.default?.SigningStargateClient).offline(Y,Q)}async function q6({sender:Y,recipient:Q,assetValue:H,memo:L="",feeRate:Z,sequence:z,accountNumber:X}){let{chain:J,chainId:_}=H,N=await W.getRPCUrl(J),I=await(await y(N)).getAccount(Y);if(!I)throw new W.SwapKitError("toolbox_cosmos_account_not_found",{sender:Y});let x=W.AssetValue.from({chain:J}),V=P(x.symbol),O=f(J),A=V&&Z?{amount:[{amount:Z.toString(),denom:V}],gas:O.gas}:O,R={amount:[{amount:H.getBaseValue("string"),denom:P(H.symbol)}],fromAddress:Y,toAddress:Q};return{accountNumber:X??I.accountNumber,chainId:_,fee:A,memo:L,msgs:[{typeUrl:X4(J),value:R}],sequence:z??I.sequence}}var W,Y6="FACTORY/KUJIRA1QK00H5ATUTPSV900X202PXX42NPJR9THG58DNQPA72F2P7M2LUASE444A7/UUSK",k6="FACTORY/KUJIRA1YGFXN0ER40KLCNCK8THLTUPRDXLCK6WVNPKF2K/UYUM",M6,F6,f6,P=(Y,Q=!1)=>{if(Q)return Y.toLowerCase();switch(Y){case"uUSK":case"USK":return Y6;case"uYUM":case"YUM":return k6;case"uKUJI":case"KUJI":return"ukuji";case"ATOM":case"uATOM":return"uatom";case"uUSDC":case"USDC":return"uusdc";default:return Y}},m=({symbol:Y,chain:Q})=>{if(Q===W.Chain.Maya)return(Y.toUpperCase()!=="CACAO"?Y:`${W.Chain.Maya}.${Y}`).toUpperCase();if(Q===W.Chain.THORChain)return(["RUNE","TCY","RUJI"].includes(Y.toUpperCase())?`${W.Chain.THORChain}.${Y}`:Y).toUpperCase();return P(Y,!1)},X4=(Y)=>{switch(Y){case W.Chain.Maya:case W.Chain.THORChain:return"/types.MsgSend";case W.Chain.Cosmos:case W.Chain.Kujira:case W.Chain.Noble:return"/cosmos.bank.v1beta1.MsgSend";default:throw new W.SwapKitError("toolbox_cosmos_not_supported",{chain:Y})}},H4,T6=(Y,Q)=>{let H=H4[Y.toLowerCase()];if(!H)return W.AssetValue.from({asset:Y,fromBaseDecimal:8,value:Q});let{chain:L,asset:Z,decimals:z}=H,X=L?{chain:L}:{asset:Z};return W.AssetValue.from({...X,fromBaseDecimal:z,value:Q})};var i=k(()=>{W=require("@swapkit/helpers"),M6={amount:[{amount:"500",denom:"uatom"}],gas:"200000"},F6={amount:[{amount:"1000",denom:"ukuji"}],gas:"200000"},f6={amount:[{amount:"1000",denom:"uusdc"}],gas:"200000"};H4={atom:{chain:W.Chain.Cosmos,decimals:W.getChainConfig(W.Chain.Cosmos).baseDecimal},cacao:{chain:W.Chain.Maya,decimals:10},kuji:{chain:W.Chain.Kujira,decimals:W.getChainConfig(W.Chain.Kujira).baseDecimal},maya:{asset:`${W.Chain.Maya}.${W.Chain.Maya}`,decimals:4},rune:{chain:W.Chain.THORChain,decimals:W.getChainConfig(W.Chain.THORChain).baseDecimal},tcy:{asset:"THOR.TCY",decimals:W.getChainConfig(W.Chain.THORChain).baseDecimal},uatom:{chain:W.Chain.Cosmos,decimals:W.getChainConfig(W.Chain.Cosmos).baseDecimal},ukuji:{chain:W.Chain.Kujira,decimals:W.getChainConfig(W.Chain.Kujira).baseDecimal},usdc:{chain:W.Chain.Noble,decimals:W.getChainConfig(W.Chain.Noble).baseDecimal},uusdc:{chain:W.Chain.Noble,decimals:W.getChainConfig(W.Chain.Noble).baseDecimal},"x/kuji":{asset:"THOR.KUJI",decimals:W.getChainConfig(W.Chain.THORChain).baseDecimal},[Y6.toLowerCase()]:{asset:`${W.Chain.Kujira}.USK`,decimals:W.getChainConfig(W.Chain.Kujira).baseDecimal}}});var y6={};V6(y6,{$root:()=>q});var K,G,M,T,q;var D6=k(()=>{K=U(require("protobufjs/minimal.js")),G=K.default.Reader,M=K.default.Writer,T=K.default.util,q=K.default.roots.default||(K.default.roots.default={});q.common=(()=>{let Y={};return Y.Asset=(()=>{function Q(H){if(H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.chain="",Q.prototype.symbol="",Q.prototype.ticker="",Q.prototype.synth=!1,Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.chain!=null&&Object.hasOwnProperty.call(L,"chain"))Z.uint32(10).string(L.chain);if(L.symbol!=null&&Object.hasOwnProperty.call(L,"symbol"))Z.uint32(18).string(L.symbol);if(L.ticker!=null&&Object.hasOwnProperty.call(L,"ticker"))Z.uint32(26).string(L.ticker);if(L.synth!=null&&Object.hasOwnProperty.call(L,"synth"))Z.uint32(32).bool(L.synth);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.common.Asset;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:X.chain=L.string();break;case 2:X.symbol=L.string();break;case 3:X.ticker=L.string();break;case 4:X.synth=L.bool();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.chain!=null&&L.hasOwnProperty("chain")){if(!T.isString(L.chain))return"chain: string expected"}if(L.symbol!=null&&L.hasOwnProperty("symbol")){if(!T.isString(L.symbol))return"symbol: string expected"}if(L.ticker!=null&&L.hasOwnProperty("ticker")){if(!T.isString(L.ticker))return"ticker: string expected"}if(L.synth!=null&&L.hasOwnProperty("synth")){if(typeof L.synth!=="boolean")return"synth: boolean expected"}return null},Q.fromObject=function(L){if(L instanceof q.common.Asset)return L;let Z=new q.common.Asset;if(L.chain!=null)Z.chain=String(L.chain);if(L.symbol!=null)Z.symbol=String(L.symbol);if(L.ticker!=null)Z.ticker=String(L.ticker);if(L.synth!=null)Z.synth=Boolean(L.synth);return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.defaults)z.chain="",z.symbol="",z.ticker="",z.synth=!1;if(L.chain!=null&&L.hasOwnProperty("chain"))z.chain=L.chain;if(L.symbol!=null&&L.hasOwnProperty("symbol"))z.symbol=L.symbol;if(L.ticker!=null&&L.hasOwnProperty("ticker"))z.ticker=L.ticker;if(L.synth!=null&&L.hasOwnProperty("synth"))z.synth=L.synth;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.Coin=(()=>{function Q(H){if(H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.asset=null,Q.prototype.amount="",Q.prototype.decimals=T.Long?T.Long.fromBits(0,0,!1):0,Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.asset!=null&&Object.hasOwnProperty.call(L,"asset"))q.common.Asset.encode(L.asset,Z.uint32(10).fork()).ldelim();if(L.amount!=null&&Object.hasOwnProperty.call(L,"amount"))Z.uint32(18).string(L.amount);if(L.decimals!=null&&Object.hasOwnProperty.call(L,"decimals"))Z.uint32(24).int64(L.decimals);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.common.Coin;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:X.asset=q.common.Asset.decode(L,L.uint32());break;case 2:X.amount=L.string();break;case 3:X.decimals=L.int64();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.asset!=null&&L.hasOwnProperty("asset")){let Z=q.common.Asset.verify(L.asset);if(Z)return"asset."+Z}if(L.amount!=null&&L.hasOwnProperty("amount")){if(!T.isString(L.amount))return"amount: string expected"}if(L.decimals!=null&&L.hasOwnProperty("decimals")){if(!T.isInteger(L.decimals)&&!(L.decimals&&T.isInteger(L.decimals.low)&&T.isInteger(L.decimals.high)))return"decimals: integer|Long expected"}return null},Q.fromObject=function(L){if(L instanceof q.common.Coin)return L;let Z=new q.common.Coin;if(L.asset!=null){if(typeof L.asset!=="object")throw TypeError(".common.Coin.asset: object expected");Z.asset=q.common.Asset.fromObject(L.asset)}if(L.amount!=null)Z.amount=String(L.amount);if(L.decimals!=null){if(T.Long)(Z.decimals=T.Long.fromValue(L.decimals)).unsigned=!1;else if(typeof L.decimals==="string")Z.decimals=Number.parseInt(L.decimals,10);else if(typeof L.decimals==="number")Z.decimals=L.decimals;else if(typeof L.decimals==="object")Z.decimals=new T.LongBits(L.decimals.low>>>0,L.decimals.high>>>0).toNumber()}return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.defaults)if(z.asset=null,z.amount="",T.Long){let X=new T.Long(0,0,!1);z.decimals=Z.longs===String?X.toString():Z.longs===Number?X.toNumber():X}else z.decimals=Z.longs===String?"0":0;if(L.asset!=null&&L.hasOwnProperty("asset"))z.asset=q.common.Asset.toObject(L.asset,Z);if(L.amount!=null&&L.hasOwnProperty("amount"))z.amount=L.amount;if(L.decimals!=null&&L.hasOwnProperty("decimals"))if(typeof L.decimals==="number")z.decimals=Z.longs===String?String(L.decimals):L.decimals;else z.decimals=Z.longs===String?T.Long.prototype.toString.call(L.decimals):Z.longs===Number?new T.LongBits(L.decimals.low>>>0,L.decimals.high>>>0).toNumber():L.decimals;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.PubKeySet=(()=>{function Q(H){if(H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.secp256k1="",Q.prototype.ed25519="",Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.secp256k1!=null&&Object.hasOwnProperty.call(L,"secp256k1"))Z.uint32(10).string(L.secp256k1);if(L.ed25519!=null&&Object.hasOwnProperty.call(L,"ed25519"))Z.uint32(18).string(L.ed25519);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.common.PubKeySet;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:X.secp256k1=L.string();break;case 2:X.ed25519=L.string();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.secp256k1!=null&&L.hasOwnProperty("secp256k1")){if(!T.isString(L.secp256k1))return"secp256k1: string expected"}if(L.ed25519!=null&&L.hasOwnProperty("ed25519")){if(!T.isString(L.ed25519))return"ed25519: string expected"}return null},Q.fromObject=function(L){if(L instanceof q.common.PubKeySet)return L;let Z=new q.common.PubKeySet;if(L.secp256k1!=null)Z.secp256k1=String(L.secp256k1);if(L.ed25519!=null)Z.ed25519=String(L.ed25519);return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.defaults)z.secp256k1="",z.ed25519="";if(L.secp256k1!=null&&L.hasOwnProperty("secp256k1"))z.secp256k1=L.secp256k1;if(L.ed25519!=null&&L.hasOwnProperty("ed25519"))z.ed25519=L.ed25519;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.Tx=(()=>{function Q(H){if(this.coins=[],this.gas=[],H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.id="",Q.prototype.chain="",Q.prototype.fromAddress="",Q.prototype.toAddress="",Q.prototype.coins=T.emptyArray,Q.prototype.gas=T.emptyArray,Q.prototype.memo="",Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.id!=null&&Object.hasOwnProperty.call(L,"id"))Z.uint32(10).string(L.id);if(L.chain!=null&&Object.hasOwnProperty.call(L,"chain"))Z.uint32(18).string(L.chain);if(L.fromAddress!=null&&Object.hasOwnProperty.call(L,"fromAddress"))Z.uint32(26).string(L.fromAddress);if(L.toAddress!=null&&Object.hasOwnProperty.call(L,"toAddress"))Z.uint32(34).string(L.toAddress);if(L.coins?.length)for(let z=0;z<L.coins.length;++z)q.common.Coin.encode(L.coins[z],Z.uint32(42).fork()).ldelim();if(L.gas?.length)for(let z=0;z<L.gas.length;++z)q.common.Coin.encode(L.gas[z],Z.uint32(50).fork()).ldelim();if(L.memo!=null&&Object.hasOwnProperty.call(L,"memo"))Z.uint32(58).string(L.memo);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.common.Tx;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:X.id=L.string();break;case 2:X.chain=L.string();break;case 3:X.fromAddress=L.string();break;case 4:X.toAddress=L.string();break;case 5:if(!X.coins?.length)X.coins=[];X.coins.push(q.common.Coin.decode(L,L.uint32()));break;case 6:if(!X.gas?.length)X.gas=[];X.gas.push(q.common.Coin.decode(L,L.uint32()));break;case 7:X.memo=L.string();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.id!=null&&L.hasOwnProperty("id")){if(!T.isString(L.id))return"id: string expected"}if(L.chain!=null&&L.hasOwnProperty("chain")){if(!T.isString(L.chain))return"chain: string expected"}if(L.fromAddress!=null&&L.hasOwnProperty("fromAddress")){if(!T.isString(L.fromAddress))return"fromAddress: string expected"}if(L.toAddress!=null&&L.hasOwnProperty("toAddress")){if(!T.isString(L.toAddress))return"toAddress: string expected"}if(L.coins!=null&&L.hasOwnProperty("coins")){if(!Array.isArray(L.coins))return"coins: array expected";for(let Z=0;Z<L.coins.length;++Z){let z=q.common.Coin.verify(L.coins[Z]);if(z)return"coins."+z}}if(L.gas!=null&&L.hasOwnProperty("gas")){if(!Array.isArray(L.gas))return"gas: array expected";for(let Z=0;Z<L.gas.length;++Z){let z=q.common.Coin.verify(L.gas[Z]);if(z)return"gas."+z}}if(L.memo!=null&&L.hasOwnProperty("memo")){if(!T.isString(L.memo))return"memo: string expected"}return null},Q.fromObject=function(L){if(L instanceof q.common.Tx)return L;let Z=new q.common.Tx;if(L.id!=null)Z.id=String(L.id);if(L.chain!=null)Z.chain=String(L.chain);if(L.fromAddress!=null)Z.fromAddress=String(L.fromAddress);if(L.toAddress!=null)Z.toAddress=String(L.toAddress);if(L.coins){if(!Array.isArray(L.coins))throw TypeError(".common.Tx.coins: array expected");Z.coins=[];for(let z=0;z<L.coins.length;++z){if(typeof L.coins[z]!=="object")throw TypeError(".common.Tx.coins: object expected");Z.coins[z]=q.common.Coin.fromObject(L.coins[z])}}if(L.gas){if(!Array.isArray(L.gas))throw TypeError(".common.Tx.gas: array expected");Z.gas=[];for(let z=0;z<L.gas.length;++z){if(typeof L.gas[z]!=="object")throw TypeError(".common.Tx.gas: object expected");Z.gas[z]=q.common.Coin.fromObject(L.gas[z])}}if(L.memo!=null)Z.memo=String(L.memo);return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.arrays||Z.defaults)z.coins=[],z.gas=[];if(Z.defaults)z.id="",z.chain="",z.fromAddress="",z.toAddress="",z.memo="";if(L.id!=null&&L.hasOwnProperty("id"))z.id=L.id;if(L.chain!=null&&L.hasOwnProperty("chain"))z.chain=L.chain;if(L.fromAddress!=null&&L.hasOwnProperty("fromAddress"))z.fromAddress=L.fromAddress;if(L.toAddress!=null&&L.hasOwnProperty("toAddress"))z.toAddress=L.toAddress;if(L.coins?.length){z.coins=[];for(let X=0;X<L.coins.length;++X)z.coins[X]=q.common.Coin.toObject(L.coins[X],Z)}if(L.gas?.length){z.gas=[];for(let X=0;X<L.gas.length;++X)z.gas[X]=q.common.Coin.toObject(L.gas[X],Z)}if(L.memo!=null&&L.hasOwnProperty("memo"))z.memo=L.memo;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.Fee=(()=>{function Q(H){if(this.coins=[],H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.coins=T.emptyArray,Q.prototype.poolDeduct="",Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.coins?.length)for(let z=0;z<L.coins.length;++z)q.common.Coin.encode(L.coins[z],Z.uint32(10).fork()).ldelim();if(L.poolDeduct!=null&&Object.hasOwnProperty.call(L,"poolDeduct"))Z.uint32(18).string(L.poolDeduct);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.common.Fee;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:if(!X.coins?.length)X.coins=[];X.coins.push(q.common.Coin.decode(L,L.uint32()));break;case 2:X.poolDeduct=L.string();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.coins!=null&&L.hasOwnProperty("coins")){if(!Array.isArray(L.coins))return"coins: array expected";for(let Z=0;Z<L.coins.length;++Z){let z=q.common.Coin.verify(L.coins[Z]);if(z)return"coins."+z}}if(L.poolDeduct!=null&&L.hasOwnProperty("poolDeduct")){if(!T.isString(L.poolDeduct))return"poolDeduct: string expected"}return null},Q.fromObject=function(L){if(L instanceof q.common.Fee)return L;let Z=new q.common.Fee;if(L.coins){if(!Array.isArray(L.coins))throw TypeError(".common.Fee.coins: array expected");Z.coins=[];for(let z=0;z<L.coins.length;++z){if(typeof L.coins[z]!=="object")throw TypeError(".common.Fee.coins: object expected");Z.coins[z]=q.common.Coin.fromObject(L.coins[z])}}if(L.poolDeduct!=null)Z.poolDeduct=String(L.poolDeduct);return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.arrays||Z.defaults)z.coins=[];if(Z.defaults)z.poolDeduct="";if(L.coins?.length){z.coins=[];for(let X=0;X<L.coins.length;++X)z.coins[X]=q.common.Coin.toObject(L.coins[X],Z)}if(L.poolDeduct!=null&&L.hasOwnProperty("poolDeduct"))z.poolDeduct=L.poolDeduct;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.ProtoUint=(()=>{function Q(H){if(H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.value="",Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.value!=null&&Object.hasOwnProperty.call(L,"value"))Z.uint32(10).string(L.value);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.common.ProtoUint;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:X.value=L.string();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.value!=null&&L.hasOwnProperty("value")){if(!T.isString(L.value))return"value: string expected"}return null},Q.fromObject=function(L){if(L instanceof q.common.ProtoUint)return L;let Z=new q.common.ProtoUint;if(L.value!=null)Z.value=String(L.value);return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.defaults)z.value="";if(L.value!=null&&L.hasOwnProperty("value"))z.value=L.value;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y})();q.types=(()=>{let Y={};return Y.MsgDeposit=(()=>{function Q(H){if(this.coins=[],H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.coins=T.emptyArray,Q.prototype.memo="",Q.prototype.signer=T.newBuffer([]),Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.coins?.length)for(let z=0;z<L.coins.length;++z)q.common.Coin.encode(L.coins[z],Z.uint32(10).fork()).ldelim();if(L.memo!=null&&Object.hasOwnProperty.call(L,"memo"))Z.uint32(18).string(L.memo);if(L.signer!=null&&Object.hasOwnProperty.call(L,"signer"))Z.uint32(26).bytes(L.signer);return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.types.MsgDeposit;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:if(!X.coins?.length)X.coins=[];X.coins.push(q.common.Coin.decode(L,L.uint32()));break;case 2:X.memo=L.string();break;case 3:X.signer=L.bytes();break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.coins!=null&&L.hasOwnProperty("coins")){if(!Array.isArray(L.coins))return"coins: array expected";for(let Z=0;Z<L.coins.length;++Z){let z=q.common.Coin.verify(L.coins[Z]);if(z)return"coins."+z}}if(L.memo!=null&&L.hasOwnProperty("memo")){if(!T.isString(L.memo))return"memo: string expected"}if(L.signer!=null&&L.hasOwnProperty("signer")){if(!(L.signer&&typeof L.signer.length==="number"||T.isString(L.signer)))return"signer: buffer expected"}return null},Q.fromObject=function(L){if(L instanceof q.types.MsgDeposit)return L;let Z=new q.types.MsgDeposit;if(L.coins){if(!Array.isArray(L.coins))throw TypeError(".types.MsgDeposit.coins: array expected");Z.coins=[];for(let z=0;z<L.coins.length;++z){if(typeof L.coins[z]!=="object")throw TypeError(".types.MsgDeposit.coins: object expected");Z.coins[z]=q.common.Coin.fromObject(L.coins[z])}}if(L.memo!=null)Z.memo=String(L.memo);if(L.signer!=null){if(typeof L.signer==="string")T.base64.decode(L.signer,Z.signer=T.newBuffer(T.base64.length(L.signer)),0);else if(L.signer.length)Z.signer=L.signer}return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.arrays||Z.defaults)z.coins=[];if(Z.defaults){if(z.memo="",Z.bytes===String)z.signer="";else if(z.signer=[],Z.bytes!==Array)z.signer=T.newBuffer(z.signer)}if(L.coins?.length){z.coins=[];for(let X=0;X<L.coins.length;++X)z.coins[X]=q.common.Coin.toObject(L.coins[X],Z)}if(L.memo!=null&&L.hasOwnProperty("memo"))z.memo=L.memo;if(L.signer!=null&&L.hasOwnProperty("signer"))z.signer=Z.bytes===String?T.base64.encode(L.signer,0,L.signer.length):Z.bytes===Array?Array.prototype.slice.call(L.signer):L.signer;return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y.MsgSend=(()=>{function Q(H){if(this.amount=[],H){for(let L=Object.keys(H),Z=0;Z<L.length;++Z)if(H[L[Z]]!=null)this[L[Z]]=H[L[Z]]}}return Q.prototype.fromAddress=T.newBuffer([]),Q.prototype.toAddress=T.newBuffer([]),Q.prototype.amount=T.emptyArray,Q.create=function(L){return new Q(L)},Q.encode=function(L,Z){if(!Z)Z=M.create();if(L.fromAddress!=null&&Object.hasOwnProperty.call(L,"fromAddress"))Z.uint32(10).bytes(L.fromAddress);if(L.toAddress!=null&&Object.hasOwnProperty.call(L,"toAddress"))Z.uint32(18).bytes(L.toAddress);if(L.amount?.length)for(let z=0;z<L.amount.length;++z)q.cosmos.base.v1beta1.Coin.encode(L.amount[z],Z.uint32(26).fork()).ldelim();return Z},Q.encodeDelimited=function(L,Z){return this.encode(L,Z).ldelim()},Q.decode=function(L,Z){if(!(L instanceof G))L=G.create(L);let z=Z===void 0?L.len:L.pos+Z,X=new q.types.MsgSend;while(L.pos<z){let J=L.uint32();switch(J>>>3){case 1:X.fromAddress=L.bytes();break;case 2:X.toAddress=L.bytes();break;case 3:if(!X.amount?.length)X.amount=[];X.amount.push(q.cosmos.base.v1beta1.Coin.decode(L,L.uint32()));break;default:L.skipType(J&7);break}}return X},Q.decodeDelimited=function(L){if(!(L instanceof G))L=new G(L);return this.decode(L,L.uint32())},Q.verify=function(L){if(typeof L!=="object"||L===null)return"object expected";if(L.fromAddress!=null&&L.hasOwnProperty("fromAddress")){if(!(L.fromAddress&&typeof L.fromAddress.length==="number"||T.isString(L.fromAddress)))return"fromAddress: buffer expected"}if(L.toAddress!=null&&L.hasOwnProperty("toAddress")){if(!(L.toAddress&&typeof L.toAddress.length==="number"||T.isString(L.toAddress)))return"toAddress: buffer expected"}if(L.amount!=null&&L.hasOwnProperty("amount")){if(!Array.isArray(L.amount))return"amount: array expected";for(let Z=0;Z<L.amount.length;++Z){let z=q.cosmos.base.v1beta1.Coin.verify(L.amount[Z]);if(z)return"amount."+z}}return null},Q.fromObject=function(L){if(L instanceof q.types.MsgSend)return L;let Z=new q.types.MsgSend;if(L.fromAddress!=null){if(typeof L.fromAddress==="string")T.base64.decode(L.fromAddress,Z.fromAddress=T.newBuffer(T.base64.length(L.fromAddress)),0);else if(L.fromAddress.length)Z.fromAddress=L.fromAddress}if(L.toAddress!=null){if(typeof L.toAddress==="string")T.base64.decode(L.toAddress,Z.toAddress=T.newBuffer(T.base64.length(L.toAddress)),0);else if(L.toAddress.length)Z.toAddress=L.toAddress}if(L.amount){if(!Array.isArray(L.amount))throw TypeError(".types.MsgSend.amount: array expected");Z.amount=[];for(let z=0;z<L.amount.length;++z){if(typeof L.amount[z]!=="object")throw TypeError(".types.MsgSend.amount: object expected");Z.amount[z]=q.cosmos.base.v1beta1.Coin.fromObject(L.amount[z])}}return Z},Q.toObject=function(L,Z){if(!Z)Z={};let z={};if(Z.arrays||Z.defaults)z.amount=[];if(Z.defaults){if(Z.bytes===String)z.fromAddress="";else if(z.fromAddress=[],Z.bytes!==Array)z.fromAddress=T.newBuffer(z.fromAddress);if(Z.bytes===String)z.toAddress="";else if(z.toAddress=[],Z.bytes!==Array)z.toAddress=T.newBuffer(z.toAddress)}if(L.fromAddress!=null&&L.hasOwnProperty("fromAddress"))z.fromAddress=Z.bytes===String?T.base64.encode(L.fromAddress,0,L.fromAddress.length):Z.bytes===Array?Array.prototype.slice.call(L.fromAddress):L.fromAddress;if(L.toAddress!=null&&L.hasOwnProperty("toAddress"))z.toAddress=Z.bytes===String?T.base64.encode(L.toAddress,0,L.toAddress.length):Z.bytes===Array?Array.prototype.slice.call(L.toAddress):L.toAddress;if(L.amount?.length){z.amount=[];for(let X=0;X<L.amount.length;++X)z.amount[X]=q.cosmos.base.v1beta1.Coin.toObject(L.amount[X],Z)}return z},Q.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},Q})(),Y})();q.cosmos=(()=>{let Y={};return Y.base=(()=>{let Q={};return Q.v1beta1=(()=>{let H={};return H.Coin=(()=>{function L(Z){if(Z){for(let z=Object.keys(Z),X=0;X<z.length;++X)if(Z[z[X]]!=null)this[z[X]]=Z[z[X]]}}return L.prototype.denom="",L.prototype.amount="",L.create=function(z){return new L(z)},L.encode=function(z,X){if(!X)X=M.create();if(z.denom!=null&&Object.hasOwnProperty.call(z,"denom"))X.uint32(10).string(z.denom);if(z.amount!=null&&Object.hasOwnProperty.call(z,"amount"))X.uint32(18).string(z.amount);return X},L.encodeDelimited=function(z,X){return this.encode(z,X).ldelim()},L.decode=function(z,X){if(!(z instanceof G))z=G.create(z);let J=X===void 0?z.len:z.pos+X,_=new q.cosmos.base.v1beta1.Coin;while(z.pos<J){let N=z.uint32();switch(N>>>3){case 1:_.denom=z.string();break;case 2:_.amount=z.string();break;default:z.skipType(N&7);break}}return _},L.decodeDelimited=function(z){if(!(z instanceof G))z=new G(z);return this.decode(z,z.uint32())},L.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.denom!=null&&z.hasOwnProperty("denom")){if(!T.isString(z.denom))return"denom: string expected"}if(z.amount!=null&&z.hasOwnProperty("amount")){if(!T.isString(z.amount))return"amount: string expected"}return null},L.fromObject=function(z){if(z instanceof q.cosmos.base.v1beta1.Coin)return z;let X=new q.cosmos.base.v1beta1.Coin;if(z.denom!=null)X.denom=String(z.denom);if(z.amount!=null)X.amount=String(z.amount);return X},L.toObject=function(z,X){if(!X)X={};let J={};if(X.defaults)J.denom="",J.amount="";if(z.denom!=null&&z.hasOwnProperty("denom"))J.denom=z.denom;if(z.amount!=null&&z.hasOwnProperty("amount"))J.amount=z.amount;return J},L.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},L})(),H.DecCoin=(()=>{function L(Z){if(Z){for(let z=Object.keys(Z),X=0;X<z.length;++X)if(Z[z[X]]!=null)this[z[X]]=Z[z[X]]}}return L.prototype.denom="",L.prototype.amount="",L.create=function(z){return new L(z)},L.encode=function(z,X){if(!X)X=M.create();if(z.denom!=null&&Object.hasOwnProperty.call(z,"denom"))X.uint32(10).string(z.denom);if(z.amount!=null&&Object.hasOwnProperty.call(z,"amount"))X.uint32(18).string(z.amount);return X},L.encodeDelimited=function(z,X){return this.encode(z,X).ldelim()},L.decode=function(z,X){if(!(z instanceof G))z=G.create(z);let J=X===void 0?z.len:z.pos+X,_=new q.cosmos.base.v1beta1.DecCoin;while(z.pos<J){let N=z.uint32();switch(N>>>3){case 1:_.denom=z.string();break;case 2:_.amount=z.string();break;default:z.skipType(N&7);break}}return _},L.decodeDelimited=function(z){if(!(z instanceof G))z=new G(z);return this.decode(z,z.uint32())},L.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.denom!=null&&z.hasOwnProperty("denom")){if(!T.isString(z.denom))return"denom: string expected"}if(z.amount!=null&&z.hasOwnProperty("amount")){if(!T.isString(z.amount))return"amount: string expected"}return null},L.fromObject=function(z){if(z instanceof q.cosmos.base.v1beta1.DecCoin)return z;let X=new q.cosmos.base.v1beta1.DecCoin;if(z.denom!=null)X.denom=String(z.denom);if(z.amount!=null)X.amount=String(z.amount);return X},L.toObject=function(z,X){if(!X)X={};let J={};if(X.defaults)J.denom="",J.amount="";if(z.denom!=null&&z.hasOwnProperty("denom"))J.denom=z.denom;if(z.amount!=null&&z.hasOwnProperty("amount"))J.amount=z.amount;return J},L.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},L})(),H.IntProto=(()=>{function L(Z){if(Z){for(let z=Object.keys(Z),X=0;X<z.length;++X)if(Z[z[X]]!=null)this[z[X]]=Z[z[X]]}}return L.prototype.int="",L.create=function(z){return new L(z)},L.encode=function(z,X){if(!X)X=M.create();if(z.int!=null&&Object.hasOwnProperty.call(z,"int"))X.uint32(10).string(z.int);return X},L.encodeDelimited=function(z,X){return this.encode(z,X).ldelim()},L.decode=function(z,X){if(!(z instanceof G))z=G.create(z);let J=X===void 0?z.len:z.pos+X,_=new q.cosmos.base.v1beta1.IntProto;while(z.pos<J){let N=z.uint32();switch(N>>>3){case 1:_.int=z.string();break;default:z.skipType(N&7);break}}return _},L.decodeDelimited=function(z){if(!(z instanceof G))z=new G(z);return this.decode(z,z.uint32())},L.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.int!=null&&z.hasOwnProperty("int")){if(!T.isString(z.int))return"int: string expected"}return null},L.fromObject=function(z){if(z instanceof q.cosmos.base.v1beta1.IntProto)return z;let X=new q.cosmos.base.v1beta1.IntProto;if(z.int!=null)X.int=String(z.int);return X},L.toObject=function(z,X){if(!X)X={};let J={};if(X.defaults)J.int="";if(z.int!=null&&z.hasOwnProperty("int"))J.int=z.int;return J},L.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},L})(),H.DecProto=(()=>{function L(Z){if(Z){for(let z=Object.keys(Z),X=0;X<z.length;++X)if(Z[z[X]]!=null)this[z[X]]=Z[z[X]]}}return L.prototype.dec="",L.create=function(z){return new L(z)},L.encode=function(z,X){if(!X)X=M.create();if(z.dec!=null&&Object.hasOwnProperty.call(z,"dec"))X.uint32(10).string(z.dec);return X},L.encodeDelimited=function(z,X){return this.encode(z,X).ldelim()},L.decode=function(z,X){if(!(z instanceof G))z=G.create(z);let J=X===void 0?z.len:z.pos+X,_=new q.cosmos.base.v1beta1.DecProto;while(z.pos<J){let N=z.uint32();switch(N>>>3){case 1:_.dec=z.string();break;default:z.skipType(N&7);break}}return _},L.decodeDelimited=function(z){if(!(z instanceof G))z=new G(z);return this.decode(z,z.uint32())},L.verify=function(z){if(typeof z!=="object"||z===null)return"object expected";if(z.dec!=null&&z.hasOwnProperty("dec")){if(!T.isString(z.dec))return"dec: string expected"}return null},L.fromObject=function(z){if(z instanceof q.cosmos.base.v1beta1.DecProto)return z;let X=new q.cosmos.base.v1beta1.DecProto;if(z.dec!=null)X.dec=String(z.dec);return X},L.toObject=function(z,X){if(!X)X={};let J={};if(X.defaults)J.dec="";if(z.dec!=null&&z.hasOwnProperty("dec"))J.dec=z.dec;return J},L.prototype.toJSON=function(){return this.constructor.toObject(this,K.default.util.toJSONOptions)},L})(),H})(),Q})(),Y})()});async function b(){let{$root:Y}=await Promise.resolve().then(() => (D6(),y6)),Q=await import("@cosmjs/proto-signing"),H=Q.Registry??Q.default?.Registry,L=await import("@cosmjs/stargate"),Z=L.defaultRegistryTypes??L.default?.defaultRegistryTypes;return new H([...Z,["/types.MsgSend",Y.types.MsgSend],["/types.MsgDeposit",Y.types.MsgDeposit]])}async function w(Y){let Q=await import("@cosmjs/stargate"),H=Q.AminoTypes??Q.default?.AminoTypes,L=Y===S6.Chain.THORChain?"thorchain":"mayachain";return new H({"/types.MsgDeposit":{aminoType:`${L}/MsgDeposit`,fromAmino:({signer:Z,...z})=>({...z,signer:d(Z)}),toAmino:({signer:Z,...z})=>({...z,signer:n(Z)})},"/types.MsgSend":{aminoType:`${L}/MsgSend`,fromAmino:({from_address:Z,to_address:z,...X})=>({...X,fromAddress:d(Z),toAddress:d(z)}),toAmino:({fromAddress:Z,toAddress:z,...X})=>({...X,from_address:n(Z),to_address:n(z)})}})}var S6;var W6=k(()=>{S6=require("@swapkit/helpers");H6()});function _6(Y){return function(H){let{assetValue:L,recipient:Z,memo:z,sender:X,asSignable:J,asAminoMessage:_}=H;if(Z)return P6(Y)({asAminoMessage:_,asSignable:J,assetValue:L,memo:z,recipient:Z,sender:X});return w6(Y)({asAminoMessage:_,asSignable:J,assetValue:L,memo:z,sender:X})}}function u(Y){if(Y.type==="thorchain/MsgSend"||Y.type==="mayachain/MsgSend")return Y;return{...Y,value:{...Y.value,coins:Y.value.coins.map((Q)=>{let H=F.AssetValue.from({asset:Q.asset}),L=(H.isSynthetic?H.symbol.split("/")?.[1]:H.symbol)?.toUpperCase(),Z=(H.isSynthetic?H.symbol.split("/")?.[0]:H.chain)?.toUpperCase();return{...Q,asset:{chain:Z,symbol:L,synth:H.isSynthetic,ticker:H.ticker}}})}}}async function o({chain:Y,memo:Q,msgs:H}){let L=await b(),Z=await w(Y),z={typeUrl:"/cosmos.tx.v1beta1.TxBody",value:{memo:Q,messages:H.map((X)=>Z.fromAmino(X))}};return L.encode(z)}var F,Y4,J4,B6=({sender:Y,recipient:Q,assetValue:H})=>{return{type:`${H.chain===F.Chain.Maya?"mayachain":"thorchain"}/MsgSend`,value:{amount:[{amount:H.getBaseValue("string"),denom:P(H.symbol,!0)}],from_address:Y,to_address:Q}}},G6=({sender:Y,assetValue:Q,memo:H=""})=>{return{type:`${Q.chain===F.Chain.Maya?"mayachain":"thorchain"}/MsgDeposit`,value:{coins:[{amount:Q.getBaseValue("string"),asset:m(Q)}],memo:H,signer:Y}}},e=({sender:Y,recipient:Q,assetValue:H,memo:L})=>{return!Q?G6({assetValue:H,memo:L,sender:Y}):B6({assetValue:H,recipient:Q,sender:Y})},$=async(Y,Q)=>{return(await w(Q)).fromAmino(Y)},C6=async({rpcUrl:Y,sender:Q})=>{let L=await(await y(Y)).getAccount(Q);if(!L)throw new F.SwapKitError("toolbox_cosmos_account_not_found",{sender:Q});return L},P6=(Y)=>async({sender:Q,recipient:H,assetValue:L,memo:Z="",asSignable:z=!0,asAminoMessage:X=!1,sequence:J,accountNumber:_})=>{let N=await C6({rpcUrl:Y,sender:Q}),v=L.chain,{chainId:I}=F.getChainConfig(v),x=B6({assetValue:L,recipient:H,sender:Q}),V=z?await $(X?x:u(x),v):x;return{accountNumber:_||N.accountNumber,chainId:I,fee:f(v),memo:Z,msgs:[V],sequence:J||N.sequence}},w6=(Y)=>async({sender:Q,assetValue:H,memo:L="",asSignable:Z=!0,asAminoMessage:z=!1,sequence:X,accountNumber:J})=>{let _=await C6({rpcUrl:Y,sender:Q}),N=H.chain,{chainId:v}=F.getChainConfig(N),I=G6({assetValue:H,memo:L,sender:Q}),x=Z?await $(z?I:u(I),N):I;return{accountNumber:J||_.accountNumber,chainId:v,fee:f(N),memo:L,msgs:[x],sequence:X||_.sequence}};var $6=k(()=>{F=require("@swapkit/helpers");i();W6();Y4=f(F.Chain.THORChain).gas,J4=f(F.Chain.Maya).gas});var u6=()=>{};var h6=k(()=>{u6()});var I6=k(()=>{H6();$6();W6();h6()});async function E6(Y,Q){try{let L=(await O6.SwapKitApi.getGasRate()).find((Z)=>Z.chainId===Y)?.value;return L?Number.parseFloat(L):Q}catch(H){return Q}}async function N6({phrase:Y,prefix:Q,...H}){let L=await import("@cosmjs/proto-signing"),Z=L.DirectSecp256k1HdWallet??L.default?.DirectSecp256k1HdWallet,z=await import("@cosmjs/crypto"),X=z.stringToPath??z.default?.stringToPath,J="derivationPath"in H?H.derivationPath:`${B.DerivationPath[H.chain]}/${H.index}`;return Z.fromMnemonic(Y,{hdPaths:[X(J)],prefix:Q})}async function q4({privateKey:Y,prefix:Q}){let H=await import("@cosmjs/proto-signing");return(H.DirectSecp256k1Wallet??H.default?.DirectSecp256k1Wallet).fromKey(Y,Q)}function p6(Y){return async function({signature:H,message:L,address:Z}){let z=await Y(Z);if(!z?.pubkey)throw new B.SwapKitError("toolbox_cosmos_verify_signature_no_pubkey");let X=await import("@cosmjs/crypto"),J=X.Secp256k1Signature??X.default?.Secp256k1Signature,_=X.Secp256k1??X.default?.Secp256k1,N=J.fromFixedLength(h.base64.decode(H));return _.verifySignature(N,h.base64.decode(L),z.pubkey.value)}}async function r({chain:Y,...Q}){let H=await B.getRPCUrl(Y),L=B.CosmosChainPrefixes[Y],Z="index"in Q?Q.index||0:0,z=B.derivationPathToString("derivationPath"in Q&&Q.derivationPath?Q.derivationPath:B.updateDerivationPath(B.NetworkDerivationPath[Y],{index:Z})),X=await t.match(Q).with({phrase:t.P.string},({phrase:I})=>N6({derivationPath:z,phrase:I,prefix:L})).with({signer:t.P.any},({signer:I})=>I).otherwise(()=>{return});async function J(I){return(await y(H)).getAccount(I)}async function _(){let[I]=await X?.getAccounts()||[];return I?.address}async function N(){let[I]=await X?.getAccounts()||[];if(!I?.pubkey)throw new B.SwapKitError("toolbox_cosmos_signer_not_defined");return h.base64.encode(I?.pubkey)}async function v({recipient:I,assetValue:x,memo:V="",feeRate:O,feeOptionKey:A=B.FeeOption.Fast}){let R=await _();if(!(X&&R))throw new B.SwapKitError("toolbox_cosmos_signer_not_defined");let D=B.AssetValue.from({chain:Y}),S=m(D),z6=O||_4((await j6(Y,l6[Y]))[A],S),Z6=await g(H,X),Q6=[{amount:x.getBaseValue("string"),denom:P(`u${x.symbol}`).toLowerCase()}],{transactionHash:p}=await Z6.sendTokens(R,I,Q6,z6,V);return p}return{createPrivateKeyFromPhrase:N4(z),createTransaction:q6,fetchFeeRateFromSwapKit:E6,getAccount:J,getAddress:_,getBalance:async(I,x)=>{let V=await b6(H)(I);return await Promise.all(V.filter(({denom:O})=>O&&!O.includes("IBC/")).map(({denom:O,amount:A})=>{let R=[B.Chain.THORChain,B.Chain.Maya].includes(Y)&&(O.includes("/")||O.includes("˜"))?`${Y}.${O}`:O;return T6(R,A)}))},getBalanceAsDenoms:b6(H),getFees:()=>j6(Y,l6[Y]),getPubKey:N,getSignerFromPhrase:async({phrase:I,derivationPath:x})=>N6({derivationPath:B.derivationPathToString(x),index:Z,phrase:I,prefix:L}),getSignerFromPrivateKey:async(I)=>{let x=await import("@cosmjs/proto-signing");return(x.DirectSecp256k1Wallet??x.default?.DirectSecp256k1Wallet).fromKey(I,L)},transfer:v,validateAddress:d6(L),verifySignature:p6(J)}}async function c6(Y,Q){try{let L=(await O6.SwapKitApi.getGasRate()).find((Z)=>Z.chainId===Y)?.value;return L?Number.parseFloat(L):Q}catch(H){return Q}}function W4({address:Y,chain:Q,prefix:H}){let L=H||G4(Q);if(!(L&&Y))throw new B.SwapKitError("toolbox_cosmos_validate_address_prefix_not_found");return d6(L)(Y)}function B4({assetValue:{chain:Y}}){return B.AssetValue.from({chain:Y,value:I4(Y)})}function G4(Y){let{isStagenet:Q}=B.SKConfig.get("envs"),H=Y?[B.Chain.THORChain,B.Chain.Maya].includes(Y)&&Q:!1,L=Y?B.CosmosChainPrefixes[Y]:void 0;return H?`s${L}`:L}async function j6(Y,Q){let{chainId:H,baseDecimal:L}=B.getChainConfig(Y),Z=await E6(H,Q);return{average:B.SwapKitNumber.fromBigInt(BigInt(Z),L),fast:B.SwapKitNumber.fromBigInt(BigInt(B.applyFeeMultiplier(Z,B.FeeOption.Fast,!0)),L),fastest:B.SwapKitNumber.fromBigInt(BigInt(B.applyFeeMultiplier(Z,B.FeeOption.Fastest,!0)),L)}}function _4(Y,Q){return{amount:[{amount:Y.getBaseValue("string"),denom:Q}],gas:"200000"}}function I4(Y){return{[B.Chain.Cosmos]:0.007,[B.Chain.Kujira]:0.02,[B.Chain.Noble]:0.01,[B.Chain.THORChain]:0.02,[B.Chain.Maya]:0.02}[Y]||0}function d6(Y){return function(H){if(!H.startsWith(Y))return!1;try{let{prefix:L,words:Z}=h.bech32.decode(H);return h.bech32.encode(L,Z)===H.toLocaleLowerCase()}catch(L){return!1}}}function b6(Y){return async function(H){return(await(await y(Y)).getAllBalances(H)).map((X)=>({...X,denom:X.denom.includes("/")?X.denom.toUpperCase():X.denom}))}}function N4(Y){return async function(H){let L=await import("@cosmjs/crypto"),Z=L.stringToPath??L.default?.stringToPath,z=L.Slip10Curve??L.default?.Slip10Curve,X=L.Slip10??L.default?.Slip10,J=L.EnglishMnemonic??L.default?.EnglishMnemonic,_=L.Bip39??L.default?.Bip39,N=new J(H),v=await _.mnemonicToSeed(N),{privkey:I}=X.derivePath(z.Secp256k1,v,Z(Y));return I}}var h,B,O6,t,l6,T4;var L6=k(()=>{h=require("@scure/base"),B=require("@swapkit/helpers"),O6=require("@swapkit/helpers/api"),t=require("ts-pattern");i();l6={[B.Chain.Cosmos]:500,[B.Chain.Kujira]:1000,[B.Chain.Noble]:1000,[B.Chain.THORChain]:5000000,[B.Chain.Maya]:5000000};T4=c6});function O4({prefix:Y,derivationPath:Q}){return async function(L,Z=0){let z=await import("@cosmjs/amino"),X=z.Secp256k1HdWallet??z.default?.Secp256k1HdWallet,J=await import("@cosmjs/crypto"),_=J.stringToPath??J.default?.stringToPath;return X.fromMnemonic(L,{hdPaths:[_(`${Q}/${Z}`)],prefix:Y})}}function E4(Y){return l.base64.encode(Y)}function x4(Y){return async function({wallet:H,tx:L}){let{msgs:Z,accountNumber:z,sequence:X,chainId:J,fee:_,memo:N}=typeof L==="string"?JSON.parse(L):L,v=(await H.getAccounts())?.[0]?.address||"",I=await w(Y),x=await b(),V=await J6(H,{aminoTypes:I,registry:x}),O=[];for(let D of Z){let S=await $(D,Y);O.push(S)}let{signatures:[A]}=await V.sign(v,O,_,N,{accountNumber:z,chainId:J,sequence:X});return{bodyBytes:await o({chain:Y,memo:N,msgs:Z.map(u)}),signature:E4(A)}}}function U4({prefix:Y,rpcUrl:Q}){return async function(L,Z,z,X,J){let{encodeSecp256k1Pubkey:_,pubkeyToAddress:N}=(await import("@cosmjs/amino")).default,{makeMultisignedTxBytes:v}=(await import("@cosmjs/stargate")).default,{sequence:I,fee:x}=JSON.parse(L),V=await n6(z,X),O=Z.map((D)=>[N(_(l.base64.decode(D.pubKey)),Y),l.base64.decode(D.signature)]),A=await y(Q),{transactionHash:R}=await A.broadcastTx(v(V,I,x,J,new Map(O)));return R}}async function n6(Y,Q,H=!0){let{createMultisigThresholdPubkey:L,encodeSecp256k1Pubkey:Z}=(await import("@cosmjs/amino")).default;return L(Y.map((z)=>Z(l.base64.decode(z))),Q,H)}function v4(Y){return l.base64.decode(Y)}async function A4({privateKey:Y,message:Q}){let{Secp256k1:H}=(await import("@cosmjs/crypto")).default,L=await H.createSignature(l.base64.decode(Q),Y);return l.base64.encode(Buffer.concat([L.r(32),L.s(32)]))}async function x6({chain:Y,...Q}){let H=E.SKConfig.get("nodeUrls")[Y],L=await E.getRPCUrl(Y),{isStagenet:Z}=E.SKConfig.get("envs"),z=Y===E.Chain.THORChain,X=`${Z?"s":""}${E.CosmosChainPrefixes[Y]}`,J="index"in Q?Q.index||0:0,_="derivationPath"in Q&&Q.derivationPath?Q.derivationPath:E.updateDerivationPath(E.NetworkDerivationPath[Y],{index:J}),N=await r({chain:Y,...Q}),v=await a.match(Q).with({phrase:a.P.string},({phrase:O})=>N.getSignerFromPhrase({derivationPath:_,phrase:O})).with({signer:a.P.any},({signer:O})=>O).otherwise(()=>{return}),I=f(Y);async function x(){let O,A=`${H}/${z?"thorchain":"mayachain"}/constants`;try{let{int_64_values:{NativeTransactionFee:R}}=await E.RequestClient.get(A);if(!R||Number.isNaN(R)||R<0)throw new E.SwapKitError("toolbox_cosmos_invalid_fee",{nativeFee:R.toString()});O=new E.SwapKitNumber(R)}catch{O=new E.SwapKitNumber({decimal:E.getChainConfig(Y).baseDecimal,value:z?0.02:1})}return{[E.FeeOption.Average]:O,[E.FeeOption.Fast]:O,[E.FeeOption.Fastest]:O}}async function V({assetValue:O,memo:A="",recipient:R}){let{TxRaw:D}=await import("cosmjs-types/cosmos/tx/v1beta1/tx"),S=(await v?.getAccounts())?.[0]?.address;if(!(S&&v))throw new E.SwapKitError("toolbox_cosmos_no_signer");let z6="signAmino"in v,Z6=await b(),Q6=await w(Y),p=await g(L,v,{aminoTypes:Q6,registry:Z6}),X6=e({assetValue:O,memo:A,recipient:R,sender:S});if(z6){let o6=await $(X6,Y),{signatures:t6,authInfoBytes:r6}=await p.sign(S,[o6],I,A),a6=D.encode({authInfoBytes:r6,bodyBytes:await o({chain:Y,memo:A,msgs:[X6].map(u)}),signatures:t6}).finish();return(await p.broadcastTx(a6)).transactionHash}let g6=u(X6),i6=await $(g6,Y);return(await p.signAndBroadcast(S,[i6],I,A)).transactionHash}return{...N,broadcastMultisigTx:U4({prefix:X,rpcUrl:L}),buildAminoMsg:e,buildEncodedTxBody:o,convertToSignable:$,createDefaultAminoTypes:()=>w(Y),createDefaultRegistry:b,createMultisig:n6,createTransaction:_6(L),deposit:V,getFees:x,importSignature:v4,parseAminoMessageForDirectSigning:u,pubkeyToAddress:async(O)=>{let{pubkeyToAddress:A}=(await import("@cosmjs/amino")).default;return A(O,X)},secp256k1HdWalletFromMnemonic:O4({derivationPath:E.derivationPathToString(_),prefix:X}),signMultisigTx:x4(Y),signWithPrivateKey:A4,transfer:V}}var l,E,a;var U6=k(()=>{l=require("@scure/base"),E=require("@swapkit/helpers"),a=require("ts-pattern");I6();i();L6()});var j,K4=(Y,Q)=>{switch(Y){case j.Chain.Cosmos:case j.Chain.Kujira:case j.Chain.Noble:return r({chain:Y,...Q});case j.Chain.Maya:case j.Chain.THORChain:return x6({chain:Y,...Q});default:throw new j.SwapKitError("toolbox_cosmos_not_supported",{chain:Y})}};var m6=k(()=>{j=require("@swapkit/helpers");L6();U6();L6();U6()});var R4={};V6(R4,{verifySignature:()=>p6,transferMsgAmino:()=>B6,toBase64:()=>Z4,parseAminoMessageForDirectSigning:()=>u,getSignerFromPrivateKey:()=>q4,getSignerFromPhrase:()=>N6,getMsgSendDenom:()=>P,getFeeRateFromThorswap:()=>T4,getFeeRateFromSwapKit:()=>c6,getDenomWithChain:()=>m,getDefaultChainFee:()=>f,getCreateTransaction:()=>_6,getCosmosToolbox:()=>K4,getAssetFromDenom:()=>T6,fromBase64:()=>Q4,fetchFeeRateFromSwapKit:()=>E6,estimateTransactionFee:()=>B4,depositMsgAmino:()=>G6,createThorchainToolbox:()=>x6,createStargateClient:()=>y,createSigningStargateClient:()=>g,createOfflineStargateClient:()=>J6,createDefaultRegistry:()=>b,createDefaultAminoTypes:()=>w,createCosmosToolbox:()=>r,cosmosValidateAddress:()=>W4,cosmosCreateTransaction:()=>q6,convertToSignable:()=>$,buildTransferTx:()=>P6,buildEncodedTxBody:()=>o,buildDepositTx:()=>w6,buildAminoMsg:()=>e,bech32ToBase64:()=>d,base64ToBech32:()=>n,YUM_KUJIRA_FACTORY_DENOM:()=>k6,USK_KUJIRA_FACTORY_DENOM:()=>Y6,THORCHAIN_GAS_VALUE:()=>Y4,MAYA_GAS_VALUE:()=>J4,DEFAULT_NOBLE_FEE_MAINNET:()=>f6,DEFAULT_KUJI_FEE_MAINNET:()=>F6,DEFAULT_COSMOS_FEE_MAINNET:()=>M6});module.exports=z4(R4);var k4=k(()=>{I6();m6();i()});k4();
2
2
 
3
- //# debugId=6C7CD9AC88C85E6764756E2164756E21
3
+ //# debugId=6EECD52A150583B464756E2164756E21
4
4
  //# sourceMappingURL=index.cjs.map