/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@adena-wallet/sdk@0.0.14/bin/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var n in t)__defProp(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of __getOwnPropNames(t))__hasOwnProp.call(e,i)||i===n||__defProp(e,i,{get:()=>t[i],enumerable:!(s=__getOwnPropDesc(t,i))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),src_exports={};__export(src_exports,{ADENA_SUCCESS_CODE:()=>ADENA_SUCCESS_CODE,AddEstablishResponseType:()=>AddEstablishResponseType,AdenaSDK:()=>AdenaSDK,AdenaWalletProvider:()=>AdenaWalletProvider,BroadcastType:()=>BroadcastType,Event:()=>Event,EventAttribute:()=>EventAttribute,GnoSocialWalletProvider:()=>GnoSocialWalletProvider,GnoWalletProvider:()=>GnoWalletProvider,SocialType:()=>SocialType,StorageDepositEvent:()=>StorageDepositEvent,StorageUnlockEvent:()=>StorageUnlockEvent,SwitchNetworkResponseType:()=>SwitchNetworkResponseType,TransactionBuilder:()=>TransactionBuilder,WalletMessageInfo:()=>WalletMessageInfo,WalletResponseExecuteType:()=>WalletResponseExecuteType,WalletResponseFailureType:()=>WalletResponseFailureType,WalletResponseRejectType:()=>WalletResponseRejectType,WalletResponseStatus:()=>WalletResponseStatus,WalletResponseSuccessType:()=>WalletResponseSuccessType,decodeTransactionMessage:()=>decodeTransactionMessage,defaultGasWanted:()=>defaultGasWanted,encodeTransaction:()=>encodeTransaction,encodeTransactionMessage:()=>encodeTransactionMessage,getSessionStorageItem:()=>getSessionStorageItem,hexToUint8Array:()=>hexToUint8Array,makeAddPackageMessage:()=>makeAddPackageMessage,makeMsgCallMessage:()=>makeMsgCallMessage,makeMsgRunMessage:()=>makeMsgRunMessage,makeMsgSendMessage:()=>makeMsgSendMessage,makeResponseMessage:()=>makeResponseMessage,protobufPackage:()=>protobufPackage,removeSessionStorageItem:()=>removeSessionStorageItem,setSessionStorageItem:()=>setSessionStorageItem}),module.exports=__toCommonJS(src_exports);var SocialType=(e=>(e.GOOGLE="GOOGLE",e.TWITTER="TWITTER",e.EMAIL="EMAIL_PASSWORDLESS",e))(SocialType||{});function varint64read(){let e=0,t=0;for(let n=0;n<28;n+=7){let s=this.buf[this.pos++];if(e|=(127&s)<<n,!(128&s))return this.assertBounds(),[e,t]}let n=this.buf[this.pos++];if(e|=(15&n)<<28,t=(112&n)>>4,!(128&n))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let s=this.buf[this.pos++];if(t|=(127&s)<<n,!(128&s))return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function varint64write(e,t,n){for(let s=0;s<28;s+=7){const i=e>>>s,r=!(i>>>7==0&&0==t),o=255&(r?128|i:i);if(n.push(o),!r)return}const s=e>>>28&15|(7&t)<<4,i=!!(t>>3);if(n.push(255&(i?128|s:s)),i){for(let e=3;e<31;e+=7){const s=t>>>e,i=!(s>>>7==0),r=255&(i?128|s:s);if(n.push(r),!i)return}n.push(t>>>31&1)}}var TWO_PWR_32_DBL=4294967296;function int64FromString(e){const t="-"===e[0];t&&(e=e.slice(1));const n=1e6;let s=0,i=0;function r(t,r){const o=Number(e.slice(t,r));i*=n,s=s*n+o,s>=TWO_PWR_32_DBL&&(i+=s/TWO_PWR_32_DBL|0,s%=TWO_PWR_32_DBL)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),t?negate(s,i):newBits(s,i)}function int64ToString(e,t){let n=newBits(e,t);const s=2147483648&n.hi;s&&(n=negate(n.lo,n.hi));const i=uInt64ToString(n.lo,n.hi);return s?"-"+i:i}function uInt64ToString(e,t){if(({lo:e,hi:t}=toUnsigned(e,t)),t<=2097151)return String(TWO_PWR_32_DBL*t+e);const n=16777215&(e>>>24|t<<8),s=t>>16&65535;let i=(16777215&e)+6777216*n+6710656*s,r=n+8147497*s,o=2*s;const a=1e7;return i>=a&&(r+=Math.floor(i/a),i%=a),r>=a&&(o+=Math.floor(r/a),r%=a),o.toString()+decimalFrom1e7WithLeadingZeros(r)+decimalFrom1e7WithLeadingZeros(i)}function toUnsigned(e,t){return{lo:e>>>0,hi:t>>>0}}function newBits(e,t){return{lo:0|e,hi:0|t}}function negate(e,t){return t=~t,e?e=1+~e:t+=1,newBits(e,t)}var decimalFrom1e7WithLeadingZeros=e=>{const t=String(e);return"0000000".slice(t.length)+t};function varint32write(e,t){if(e>=0){for(;e>127;)t.push(127&e|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(127&e|128),e>>=7;t.push(1)}}function varint32read(){let e=this.buf[this.pos++],t=127&e;if(!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<7,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<14,!(128&e))return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(127&e)<<21,!(128&e))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(15&e)<<28;for(let t=5;128&e&&t<10;t++)e=this.buf[this.pos++];if(128&e)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var protoInt64=makeInt64Support();function makeInt64Support(){const e=new DataView(new ArrayBuffer(8));if("function"==typeof BigInt&&"function"==typeof e.getBigInt64&&"function"==typeof e.getBigUint64&&"function"==typeof e.setBigInt64&&"function"==typeof e.setBigUint64&&("object"!=typeof process||"object"!=typeof process.env||"1"!==process.env.BUF_BIGINT_DISABLE)){const t=BigInt("-9223372036854775808"),n=BigInt("9223372036854775807"),s=BigInt("0"),i=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(e){const s="bigint"==typeof e?e:BigInt(e);if(s>n||s<t)throw new Error(`invalid int64: ${e}`);return s},uParse(e){const t="bigint"==typeof e?e:BigInt(e);if(t>i||t<s)throw new Error(`invalid uint64: ${e}`);return t},enc(t){return e.setBigInt64(0,this.parse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},uEnc(t){return e.setBigInt64(0,this.uParse(t),!0),{lo:e.getInt32(0,!0),hi:e.getInt32(4,!0)}},dec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigInt64(0,!0)),uDec:(t,n)=>(e.setInt32(0,t,!0),e.setInt32(4,n,!0),e.getBigUint64(0,!0))}}return{zero:"0",supported:!1,parse:e=>("string"!=typeof e&&(e=e.toString()),assertInt64String(e),e),uParse:e=>("string"!=typeof e&&(e=e.toString()),assertUInt64String(e),e),enc:e=>("string"!=typeof e&&(e=e.toString()),assertInt64String(e),int64FromString(e)),uEnc:e=>("string"!=typeof e&&(e=e.toString()),assertUInt64String(e),int64FromString(e)),dec:(e,t)=>int64ToString(e,t),uDec:(e,t)=>uInt64ToString(e,t)}}function assertInt64String(e){if(!/^-?[0-9]+$/.test(e))throw new Error("invalid int64: "+e)}function assertUInt64String(e){if(!/^[0-9]+$/.test(e))throw new Error("invalid uint64: "+e)}var WireType,symbol=Symbol.for("@bufbuild/protobuf/text-encoding");function getTextEncoding(){if(null==globalThis[symbol]){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;globalThis[symbol]={encodeUtf8:t=>e.encode(t),decodeUtf8:e=>t.decode(e),checkUtf8(e){try{return encodeURIComponent(e),!0}catch(e){return!1}}}}return globalThis[symbol]}!function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"}(WireType||(WireType={}));var FLOAT32_MAX=34028234663852886e22,FLOAT32_MIN=-34028234663852886e22,UINT32_MAX=4294967295,INT32_MAX=2147483647,INT32_MIN=-2147483648,BinaryWriter=class{constructor(e=getTextEncoding().encodeUtf8){this.encodeUtf8=e,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let e=0;for(let t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;let t=new Uint8Array(e),n=0;for(let e=0;e<this.chunks.length;e++)t.set(this.chunks[e],n),n+=this.chunks[e].length;return this.chunks=[],t}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(assertUInt32(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}int32(e){return assertInt32(e),varint32write(e,this.buf),this}bool(e){return this.buf.push(e?1:0),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){assertFloat32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){assertUInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){assertInt32(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return assertInt32(e),varint32write(e=(e<<1^e>>31)>>>0,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),s=protoInt64.enc(e);return n.setInt32(0,s.lo,!0),n.setInt32(4,s.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),s=protoInt64.uEnc(e);return n.setInt32(0,s.lo,!0),n.setInt32(4,s.hi,!0),this.raw(t)}int64(e){let t=protoInt64.enc(e);return varint64write(t.lo,t.hi,this.buf),this}sint64(e){let t=protoInt64.enc(e),n=t.hi>>31;return varint64write(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=protoInt64.uEnc(e);return varint64write(t.lo,t.hi,this.buf),this}},BinaryReader=class{constructor(e,t=getTextEncoding().decodeUtf8){this.decodeUtf8=t,this.varint64=varint64read,this.uint32=varint32read,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.uint32(),t=e>>>3,n=7&e;if(t<=0||n<0||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}skip(e,t){let n=this.pos;switch(e){case WireType.Varint:for(;128&this.buf[this.pos++];);break;case WireType.Bit64:this.pos+=4;case WireType.Bit32:this.pos+=4;break;case WireType.LengthDelimited:let n=this.uint32();this.pos+=n;break;case WireType.StartGroup:for(;;){const[e,n]=this.tag();if(n===WireType.EndGroup){if(void 0!==t&&e!==t)throw new Error("invalid end group tag");break}this.skip(n,e)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let e=this.uint32();return e>>>1^-(1&e)}int64(){return protoInt64.dec(...this.varint64())}uint64(){return protoInt64.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(1&e);return e=(e>>>1|(1&t)<<31)^n,t=t>>>1^n,protoInt64.dec(e,t)}bool(){let[e,t]=this.varint64();return 0!==e||0!==t}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return protoInt64.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return protoInt64.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(){return this.decodeUtf8(this.bytes())}};function assertInt32(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>INT32_MAX||e<INT32_MIN)throw new Error("invalid int32: "+e)}function assertUInt32(e){if("string"==typeof e)e=Number(e);else if("number"!=typeof e)throw new Error("invalid uint32: "+typeof e);if(!Number.isInteger(e)||e>UINT32_MAX||e<0)throw new Error("invalid uint32: "+e)}function assertFloat32(e){if("string"==typeof e){const t=e;if(e=Number(e),isNaN(e)&&"NaN"!==t)throw new Error("invalid float32: "+t)}else if("number"!=typeof e)throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>FLOAT32_MAX||e<FLOAT32_MIN))throw new Error("invalid float32: "+e)}var wasm=null;try{wasm=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function isLong(e){return!0===(e&&e.__isLong__)}function ctz32(e){var t=Math.clz32(e&-e);return e?31-t:t}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var INT_CACHE={},UINT_CACHE={};function fromInt(e,t){var n,s,i;return t?(i=0<=(e>>>=0)&&e<256)&&(s=UINT_CACHE[e])?s:(n=fromBits(e,0,!0),i&&(UINT_CACHE[e]=n),n):(i=-128<=(e|=0)&&e<128)&&(s=INT_CACHE[e])?s:(n=fromBits(e,e<0?-1:0,!1),i&&(INT_CACHE[e]=n),n)}function fromNumber(e,t){if(isNaN(e))return t?UZERO:ZERO;if(t){if(e<0)return UZERO;if(e>=TWO_PWR_64_DBL)return MAX_UNSIGNED_VALUE}else{if(e<=-TWO_PWR_63_DBL)return MIN_VALUE;if(e+1>=TWO_PWR_63_DBL)return MAX_VALUE}return e<0?fromNumber(-e,t).neg():fromBits(e%TWO_PWR_32_DBL2|0,e/TWO_PWR_32_DBL2|0,t)}function fromBits(e,t,n){return new Long(e,t,n)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var pow_dbl=Math.pow;function fromString(e,t,n){if(0===e.length)throw Error("empty string");if("number"==typeof t?(n=t,t=!1):t=!!t,"NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t?UZERO:ZERO;if((n=n||10)<2||36<n)throw RangeError("radix");var s;if((s=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===s)return fromString(e.substring(1),t,n).neg();for(var i=fromNumber(pow_dbl(n,8)),r=ZERO,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+a),n);if(a<8){var c=fromNumber(pow_dbl(n,a));r=r.mul(c).add(fromNumber(u))}else r=(r=r.mul(i)).add(fromNumber(u))}return r.unsigned=t,r}function fromValue(e,t){return"number"==typeof e?fromNumber(e,t):"string"==typeof e?fromString(e,t):fromBits(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var TWO_PWR_16_DBL=65536,TWO_PWR_24_DBL=1<<24,TWO_PWR_32_DBL2=TWO_PWR_16_DBL*TWO_PWR_16_DBL,TWO_PWR_64_DBL=TWO_PWR_32_DBL2*TWO_PWR_32_DBL2,TWO_PWR_63_DBL=TWO_PWR_64_DBL/2,TWO_PWR_24=fromInt(TWO_PWR_24_DBL),ZERO=fromInt(0);Long.ZERO=ZERO;var UZERO=fromInt(0,!0);Long.UZERO=UZERO;var ONE=fromInt(1);Long.ONE=ONE;var UONE=fromInt(1,!0);Long.UONE=UONE;var NEG_ONE=fromInt(-1);Long.NEG_ONE=NEG_ONE;var MAX_VALUE=fromBits(-1,2147483647,!1);Long.MAX_VALUE=MAX_VALUE;var MAX_UNSIGNED_VALUE=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=MAX_UNSIGNED_VALUE;var MIN_VALUE=fromBits(0,-2147483648,!1);Long.MIN_VALUE=MIN_VALUE;var LongPrototype=Long.prototype;LongPrototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},LongPrototype.toNumber=function(){return this.unsigned?(this.high>>>0)*TWO_PWR_32_DBL2+(this.low>>>0):this.high*TWO_PWR_32_DBL2+(this.low>>>0)},LongPrototype.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(MIN_VALUE)){var t=fromNumber(e),n=this.div(t),s=n.mul(t).sub(this);return n.toString(e)+s.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=fromNumber(pow_dbl(e,6),this.unsigned),r=this,o="";;){var a=r.div(i),u=(r.sub(a.mul(i)).toInt()>>>0).toString(e);if((r=a).isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},LongPrototype.getHighBits=function(){return this.high},LongPrototype.getHighBitsUnsigned=function(){return this.high>>>0},LongPrototype.getLowBits=function(){return this.low},LongPrototype.getLowBitsUnsigned=function(){return this.low>>>0},LongPrototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(MIN_VALUE)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},LongPrototype.isSafeInteger=function(){var e=this.high>>21;return!e||!this.unsigned&&(-1===e&&!(0===this.low&&-2097152===this.high))},LongPrototype.isZero=function(){return 0===this.high&&0===this.low},LongPrototype.eqz=LongPrototype.isZero,LongPrototype.isNegative=function(){return!this.unsigned&&this.high<0},LongPrototype.isPositive=function(){return this.unsigned||this.high>=0},LongPrototype.isOdd=function(){return!(1&~this.low)},LongPrototype.isEven=function(){return!(1&this.low)},LongPrototype.equals=function(e){return isLong(e)||(e=fromValue(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},LongPrototype.eq=LongPrototype.equals,LongPrototype.notEquals=function(e){return!this.eq(e)},LongPrototype.neq=LongPrototype.notEquals,LongPrototype.ne=LongPrototype.notEquals,LongPrototype.lessThan=function(e){return this.comp(e)<0},LongPrototype.lt=LongPrototype.lessThan,LongPrototype.lessThanOrEqual=function(e){return this.comp(e)<=0},LongPrototype.lte=LongPrototype.lessThanOrEqual,LongPrototype.le=LongPrototype.lessThanOrEqual,LongPrototype.greaterThan=function(e){return this.comp(e)>0},LongPrototype.gt=LongPrototype.greaterThan,LongPrototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},LongPrototype.gte=LongPrototype.greaterThanOrEqual,LongPrototype.ge=LongPrototype.greaterThanOrEqual,LongPrototype.compare=function(e){if(isLong(e)||(e=fromValue(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},LongPrototype.comp=LongPrototype.compare,LongPrototype.negate=function(){return!this.unsigned&&this.eq(MIN_VALUE)?MIN_VALUE:this.not().add(ONE)},LongPrototype.neg=LongPrototype.negate,LongPrototype.add=function(e){isLong(e)||(e=fromValue(e));var t=this.high>>>16,n=65535&this.high,s=this.low>>>16,i=65535&this.low,r=e.high>>>16,o=65535&e.high,a=e.low>>>16,u=0,c=0,g=0,l=0;return g+=(l+=i+(65535&e.low))>>>16,c+=(g+=s+a)>>>16,u+=(c+=n+o)>>>16,u+=t+r,fromBits((g&=65535)<<16|(l&=65535),(u&=65535)<<16|(c&=65535),this.unsigned)},LongPrototype.subtract=function(e){return isLong(e)||(e=fromValue(e)),this.add(e.neg())},LongPrototype.sub=LongPrototype.subtract,LongPrototype.multiply=function(e){if(this.isZero())return this;if(isLong(e)||(e=fromValue(e)),wasm)return fromBits(wasm.mul(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned);if(e.isZero())return this.unsigned?UZERO:ZERO;if(this.eq(MIN_VALUE))return e.isOdd()?MIN_VALUE:ZERO;if(e.eq(MIN_VALUE))return this.isOdd()?MIN_VALUE:ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(TWO_PWR_24)&&e.lt(TWO_PWR_24))return fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,s=this.low>>>16,i=65535&this.low,r=e.high>>>16,o=65535&e.high,a=e.low>>>16,u=65535&e.low,c=0,g=0,l=0,h=0;return l+=(h+=i*u)>>>16,g+=(l+=s*u)>>>16,l&=65535,g+=(l+=i*a)>>>16,c+=(g+=n*u)>>>16,g&=65535,c+=(g+=s*a)>>>16,g&=65535,c+=(g+=i*o)>>>16,c+=t*u+n*a+s*o+i*r,fromBits((l&=65535)<<16|(h&=65535),(c&=65535)<<16|(g&=65535),this.unsigned)},LongPrototype.mul=LongPrototype.multiply,LongPrototype.divide=function(e){if(isLong(e)||(e=fromValue(e)),e.isZero())throw Error("division by zero");var t,n,s;if(wasm)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?fromBits((this.unsigned?wasm.div_u:wasm.div_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?UZERO:ZERO;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return UZERO;if(e.gt(this.shru(1)))return UONE;s=UZERO}else{if(this.eq(MIN_VALUE))return e.eq(ONE)||e.eq(NEG_ONE)?MIN_VALUE:e.eq(MIN_VALUE)?ONE:(t=this.shr(1).div(e).shl(1)).eq(ZERO)?e.isNegative()?ONE:NEG_ONE:(n=this.sub(e.mul(t)),s=t.add(n.div(e)));if(e.eq(MIN_VALUE))return this.unsigned?UZERO:ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=ZERO}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var i=Math.ceil(Math.log(t)/Math.LN2),r=i<=48?1:pow_dbl(2,i-48),o=fromNumber(t),a=o.mul(e);a.isNegative()||a.gt(n);)a=(o=fromNumber(t-=r,this.unsigned)).mul(e);o.isZero()&&(o=ONE),s=s.add(o),n=n.sub(a)}return s},LongPrototype.div=LongPrototype.divide,LongPrototype.modulo=function(e){return isLong(e)||(e=fromValue(e)),wasm?fromBits((this.unsigned?wasm.rem_u:wasm.rem_s)(this.low,this.high,e.low,e.high),wasm.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},LongPrototype.mod=LongPrototype.modulo,LongPrototype.rem=LongPrototype.modulo,LongPrototype.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},LongPrototype.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},LongPrototype.clz=LongPrototype.countLeadingZeros,LongPrototype.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},LongPrototype.ctz=LongPrototype.countTrailingZeros,LongPrototype.and=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low&e.low,this.high&e.high,this.unsigned)},LongPrototype.or=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low|e.low,this.high|e.high,this.unsigned)},LongPrototype.xor=function(e){return isLong(e)||(e=fromValue(e)),fromBits(this.low^e.low,this.high^e.high,this.unsigned)},LongPrototype.shiftLeft=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):fromBits(0,this.low<<e-32,this.unsigned)},LongPrototype.shl=LongPrototype.shiftLeft,LongPrototype.shiftRight=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},LongPrototype.shr=LongPrototype.shiftRight,LongPrototype.shiftRightUnsigned=function(e){return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?fromBits(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):fromBits(32===e?this.high:this.high>>>e-32,0,this.unsigned)},LongPrototype.shru=LongPrototype.shiftRightUnsigned,LongPrototype.shr_u=LongPrototype.shiftRightUnsigned,LongPrototype.rotateLeft=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned)):(t=32-(e-=32),fromBits(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned))},LongPrototype.rotl=LongPrototype.rotateLeft,LongPrototype.rotateRight=function(e){var t;return isLong(e)&&(e=e.toInt()),0==(e&=63)?this:32===e?fromBits(this.high,this.low,this.unsigned):e<32?(t=32-e,fromBits(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned)):(t=32-(e-=32),fromBits(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned))},LongPrototype.rotr=LongPrototype.rotateRight,LongPrototype.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},LongPrototype.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},LongPrototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},LongPrototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},LongPrototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},Long.fromBytes=function(e,t,n){return n?Long.fromBytesLE(e,t):Long.fromBytesBE(e,t)},Long.fromBytesLE=function(e,t){return new Long(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},Long.fromBytesBE=function(e,t){return new Long(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)},"function"==typeof BigInt&&(Long.fromBigInt=function(e,t){return fromBits(Number(BigInt.asIntN(32,e)),Number(BigInt.asIntN(32,e>>BigInt(32))),t)},Long.fromValue=function(e,t){return"bigint"==typeof e?Long.fromBigInt(e,t):fromValue(e,t)},LongPrototype.toBigInt=function(){var e=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|e});var long_default=Long,protobufPackage="gno.bank";function createBaseEvent(){return{type:"",attrs:[],pkg_path:""}}var Event={encode(e,t=new BinaryWriter){""!==e.type&&t.uint32(10).string(e.type);for(const n of e.attrs)EventAttribute.encode(n,t.uint32(18).fork()).join();return""!==e.pkg_path&&t.uint32(26).string(e.pkg_path),t},decode(e,t){const n=e instanceof BinaryReader?e:new BinaryReader(e),s=void 0===t?n.len:n.pos+t,i=createBaseEvent();for(;n.pos<s;){const e=n.uint32();switch(e>>>3){case 1:if(10!==e)break;i.type=n.string();continue;case 2:if(18!==e)break;i.attrs.push(EventAttribute.decode(n,n.uint32()));continue;case 3:if(26!==e)break;i.pkg_path=n.string();continue}if(4==(7&e)||0===e)break;n.skip(7&e)}return i},fromJSON:e=>({type:isSet(e.type)?globalThis.String(e.type):"",attrs:globalThis.Array.isArray(e?.attrs)?e.attrs.map((e=>EventAttribute.fromJSON(e))):[],pkg_path:isSet(e.pkg_path)?globalThis.String(e.pkg_path):""}),toJSON(e){const t={};return void 0!==e.type&&(t.type=e.type),e.attrs?.length&&(t.attrs=e.attrs.map((e=>EventAttribute.toJSON(e)))),void 0!==e.pkg_path&&(t.pkg_path=e.pkg_path),t},create:e=>Event.fromPartial(e??{}),fromPartial(e){const t=createBaseEvent();return t.type=e.type??"",t.attrs=e.attrs?.map((e=>EventAttribute.fromPartial(e)))||[],t.pkg_path=e.pkg_path??"",t}};function createBaseEventAttribute(){return{key:"",value:""}}var EventAttribute={encode:(e,t=new BinaryWriter)=>(""!==e.key&&t.uint32(10).string(e.key),""!==e.value&&t.uint32(18).string(e.value),t),decode(e,t){const n=e instanceof BinaryReader?e:new BinaryReader(e),s=void 0===t?n.len:n.pos+t,i=createBaseEventAttribute();for(;n.pos<s;){const e=n.uint32();switch(e>>>3){case 1:if(10!==e)break;i.key=n.string();continue;case 2:if(18!==e)break;i.value=n.string();continue}if(4==(7&e)||0===e)break;n.skip(7&e)}return i},fromJSON:e=>({key:isSet(e.key)?globalThis.String(e.key):"",value:isSet(e.value)?globalThis.String(e.value):""}),toJSON(e){const t={};return void 0!==e.key&&(t.key=e.key),void 0!==e.value&&(t.value=e.value),t},create:e=>EventAttribute.fromPartial(e??{}),fromPartial(e){const t=createBaseEventAttribute();return t.key=e.key??"",t.value=e.value??"",t}};function createBaseStorageDepositEvent(){return{bytes_delta:long_default.ZERO,fee_delta:"",pkg_path:""}}var StorageDepositEvent={encode:(e,t=new BinaryWriter)=>(e.bytes_delta.equals(long_default.ZERO)||t.uint32(8).int64(e.bytes_delta.toString()),""!==e.fee_delta&&t.uint32(18).string(e.fee_delta),""!==e.pkg_path&&t.uint32(26).string(e.pkg_path),t),decode(e,t){const n=e instanceof BinaryReader?e:new BinaryReader(e),s=void 0===t?n.len:n.pos+t,i=createBaseStorageDepositEvent();for(;n.pos<s;){const e=n.uint32();switch(e>>>3){case 1:if(8!==e)break;i.bytes_delta=long_default.fromString(n.int64().toString());continue;case 2:if(18!==e)break;i.fee_delta=n.string();continue;case 3:if(26!==e)break;i.pkg_path=n.string();continue}if(4==(7&e)||0===e)break;n.skip(7&e)}return i},fromJSON:e=>({bytes_delta:isSet(e.bytes_delta)?long_default.fromValue(e.bytes_delta):long_default.ZERO,fee_delta:isSet(e.fee_delta)?globalThis.String(e.fee_delta):"",pkg_path:isSet(e.pkg_path)?globalThis.String(e.pkg_path):""}),toJSON(e){const t={};return void 0!==e.bytes_delta&&(t.bytes_delta=(e.bytes_delta||long_default.ZERO).toString()),void 0!==e.fee_delta&&(t.fee_delta=e.fee_delta),void 0!==e.pkg_path&&(t.pkg_path=e.pkg_path),t},create:e=>StorageDepositEvent.fromPartial(e??{}),fromPartial(e){const t=createBaseStorageDepositEvent();return t.bytes_delta=void 0!==e.bytes_delta&&null!==e.bytes_delta?long_default.fromValue(e.bytes_delta):long_default.ZERO,t.fee_delta=e.fee_delta??"",t.pkg_path=e.pkg_path??"",t}};function createBaseStorageUnlockEvent(){return{bytes_delta:long_default.ZERO,fee_refund:"",pkg_path:"",refund_withheld:!1}}var StorageUnlockEvent={encode:(e,t=new BinaryWriter)=>(e.bytes_delta.equals(long_default.ZERO)||t.uint32(8).int64(e.bytes_delta.toString()),""!==e.fee_refund&&t.uint32(18).string(e.fee_refund),""!==e.pkg_path&&t.uint32(26).string(e.pkg_path),!1!==e.refund_withheld&&t.uint32(32).bool(e.refund_withheld),t),decode(e,t){const n=e instanceof BinaryReader?e:new BinaryReader(e),s=void 0===t?n.len:n.pos+t,i=createBaseStorageUnlockEvent();for(;n.pos<s;){const e=n.uint32();switch(e>>>3){case 1:if(8!==e)break;i.bytes_delta=long_default.fromString(n.int64().toString());continue;case 2:if(18!==e)break;i.fee_refund=n.string();continue;case 3:if(26!==e)break;i.pkg_path=n.string();continue;case 4:if(32!==e)break;i.refund_withheld=n.bool();continue}if(4==(7&e)||0===e)break;n.skip(7&e)}return i},fromJSON:e=>({bytes_delta:isSet(e.bytes_delta)?long_default.fromValue(e.bytes_delta):long_default.ZERO,fee_refund:isSet(e.fee_refund)?globalThis.String(e.fee_refund):"",pkg_path:isSet(e.pkg_path)?globalThis.String(e.pkg_path):"",refund_withheld:!!isSet(e.refund_withheld)&&globalThis.Boolean(e.refund_withheld)}),toJSON(e){const t={};return void 0!==e.bytes_delta&&(t.bytes_delta=(e.bytes_delta||long_default.ZERO).toString()),void 0!==e.fee_refund&&(t.fee_refund=e.fee_refund),void 0!==e.pkg_path&&(t.pkg_path=e.pkg_path),void 0!==e.refund_withheld&&(t.refund_withheld=e.refund_withheld),t},create:e=>StorageUnlockEvent.fromPartial(e??{}),fromPartial(e){const t=createBaseStorageUnlockEvent();return t.bytes_delta=void 0!==e.bytes_delta&&null!==e.bytes_delta?long_default.fromValue(e.bytes_delta):long_default.ZERO,t.fee_refund=e.fee_refund??"",t.pkg_path=e.pkg_path??"",t.refund_withheld=e.refund_withheld??!1,t}};function isSet(e){return null!=e}var BroadcastType=(e=>(e.SYNC="SYNC",e.COMMIT="COMMIT",e))(BroadcastType||{}),WalletResponseStatus=(e=>(e.SUCCESS="success",e.FAILURE="failure",e))(WalletResponseStatus||{}),WalletResponseSuccessType=(e=>(e.CONNECTION_SUCCESS="CONNECTION_SUCCESS",e.GET_ACCOUNT_SUCCESS="GET_ACCOUNT",e.GET_NETWORK_SUCCESS="GET_NETWORK",e.SIGN_SUCCESS="SIGN_TX",e.CREATE_MULTISIG_ACCOUNT_SUCCESS="CREATE_MULTISIG_ACCOUNT",e.CREATE_MULTISIG_TRANSACTION_SUCCESS="CREATE_MULTISIG_TRANSACTION",e.SIGN_MULTISIG_TRANSACTION_SUCCESS="SIGN_MULTISIG_TRANSACTION",e.BROADCAST_MULTISIG_TRANSACTION_SUCCESS="BROADCAST_MULTISIG_TRANSACTION",e.ADD_NETWORK_SUCCESS="ADD_NETWORK_SUCCESS",e.SWITCH_NETWORK_SUCCESS="SWITCH_NETWORK_SUCCESS",e.TRANSACTION_SUCCESS="TRANSACTION_SUCCESS",e))(WalletResponseSuccessType||{}),WalletResponseFailureType=(e=>(e.NOT_CONNECTED="NOT_CONNECTED",e.UNRESOLVED_TRANSACTION_EXISTS="UNRESOLVED_TRANSACTION_EXISTS",e.INVALID_FORMAT="INVALID_FORMAT",e.WALLET_LOCKED="WALLET_LOCKED",e.ACCOUNT_MISMATCH="ACCOUNT_MISMATCH",e.NO_ACCOUNT="NO_ACCOUNT",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.SIGN_FAILED="SIGN_FAILED",e.CREATE_MULTISIG_ACCOUNT_FAILED="CREATE_MULTISIG_ACCOUNT_FAILED",e.CREATE_MULTISIG_TRANSACTION_FAILED="CREATE_MULTISIG_TRANSACTION_FAILED",e.SIGN_MULTISIG_TRANSACTION_FAILED="SIGN_MULTISIG_TRANSACTION_FAILED",e.INVALID_MULTISIG_SIGNERS="INVALID_MULTISIG_SIGNERS",e.INVALID_MULTISIG_ADDRESS="INVALID_MULTISIG_ADDRESS",e.INVALID_MULTISIG_THRESHOLD="INVALID_MULTISIG_THRESHOLD",e.BROADCAST_MULTISIG_TRANSACTION_FAILED="BROADCAST_MULTISIG_TRANSACTION_FAILED",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e.NETWORK_TIMEOUT="NETWORK_TIMEOUT",e.REDUNDANT_CHANGE_REQUEST="REDUNDANT_CHANGE_REQUEST",e.NETWORK_ALREADY_EXISTS="NETWORK_ALREADY_EXISTS",e.UNADDED_NETWORK="UNADDED_NETWORK",e.UNSUPPORTED_TYPE="UNSUPPORTED_TYPE",e.UNEXPECTED_ERROR="UNEXPECTED_ERROR",e.NOT_INITIALIZED_NETWORK="NOT_INITIALIZED_NETWORK",e))(WalletResponseFailureType||{}),WalletResponseRejectType=(e=>(e.TRANSACTION_REJECTED="TRANSACTION_REJECTED",e.SIGN_REJECTED="SIGN_REJECTED",e.CREATE_MULTISIG_ACCOUNT_REJECTED="CREATE_MULTISIG_ACCOUNT_REJECTED",e.CREATE_MULTISIG_TRANSACTION_REJECTED="CREATE_MULTISIG_TRANSACTION_REJECTED",e.SIGN_MULTISIG_TRANSACTION_REJECTED="SIGN_MULTISIG_TRANSACTION_REJECTED",e.BROADCAST_MULTISIG_TRANSACTION_REJECTED="BROADCAST_MULTISIG_TRANSACTION_REJECTED",e.CONNECTION_REJECTED="CONNECTION_REJECTED",e.SWITCH_NETWORK_REJECTED="SWITCH_NETWORK_REJECTED",e.ADD_NETWORK_REJECTED="ADD_NETWORK_REJECTED",e))(WalletResponseRejectType||{}),WalletResponseExecuteType=(e=>(e.ADD_ESTABLISH="ADD_ESTABLISH",e.DO_CONTRACT="DO_CONTRACT",e.GET_ACCOUNT="GET_ACCOUNT",e.GET_NETWORK="GET_NETWORK",e.SIGN_AMINO="SIGN_AMINO",e.SIGN_TX="SIGN_TX",e.CREATE_MULTISIG_ACCOUNT="CREATE_MULTISIG_ACCOUNT",e.CREATE_MULTISIG_TRANSACTION="CREATE_MULTISIG_TRANSACTION",e.SIGN_MULTISIG_TRANSACTION="SIGN_MULTISIG_TRANSACTION",e.BROADCAST_MULTISIG_TRANSACTION="BROADCAST_MULTISIG_TRANSACTION",e.ADD_NETWORK="ADD_NETWORK",e.SWITCH_NETWORK="SWITCH_NETWORK",e))(WalletResponseExecuteType||{}),WalletSuccessMessageInfo={CONNECTION_SUCCESS:{code:0,status:"success",type:"CONNECTION_SUCCESS",message:"The connection has been successfully established."},GET_ACCOUNT:{code:0,status:"success",type:"GET_ACCOUNT",message:"Account information has been successfully returned."},GET_NETWORK:{code:0,status:"success",type:"GET_NETWORK",message:"Network information has been successfully returned."},SIGN_TX:{code:0,status:"success",type:"SIGN_TX",message:"Signature hash has been successfully generated."},CREATE_MULTISIG_ACCOUNT:{code:0,status:"success",type:"CREATE_MULTISIG_ACCOUNT",message:"Multisig account has been successfully created."},CREATE_MULTISIG_TRANSACTION:{code:0,status:"success",type:"CREATE_MULTISIG_TRANSACTION",message:"Multisig document has been successfully created."},SIGN_MULTISIG_TRANSACTION:{code:0,status:"success",type:"SIGN_MULTISIG_TRANSACTION",message:"Signature hash has been successfully generated."},BROADCAST_MULTISIG_TRANSACTION:{code:0,status:"success",type:"BROADCAST_MULTISIG_TRANSACTION",message:"Multisig Transaction has been successfully executed."},ADD_NETWORK_SUCCESS:{code:0,status:"success",type:"ADD_NETWORK_SUCCESS",message:"The network has been successfully added."},SWITCH_NETWORK_SUCCESS:{code:0,status:"success",type:"SWITCH_NETWORK_SUCCESS",message:"The network has been successfully changed."},TRANSACTION_SUCCESS:{code:0,status:"success",type:"TRANSACTION_SUCCESS",message:"Transaction has been successfully executed."}},WalletFailureMessageInfo={NOT_CONNECTED:{code:1e3,status:"failure",type:"NOT_CONNECTED",message:"A connection has not been established."},UNRESOLVED_TRANSACTION_EXISTS:{code:1001,status:"failure",type:"UNRESOLVED_TRANSACTION_EXISTS",message:"An unresolved transaction pop-up exists."},INVALID_FORMAT:{code:1002,status:"failure",type:"INVALID_FORMAT",message:"The transaction is in an invalid format."},INVALID_MULTISIG_SIGNERS:{code:1003,status:"failure",type:"INVALID_MULTISIG_SIGNERS",message:"At least 2 signers are required for multisig."},INVALID_MULTISIG_ADDRESS:{code:1004,status:"failure",type:"INVALID_MULTISIG_ADDRESS",message:"One or more signer addresses are invalid."},INVALID_MULTISIG_THRESHOLD:{code:1005,status:"failure",type:"INVALID_MULTISIG_THRESHOLD",message:"Threshold must be between 1 and the number of signers."},WALLET_LOCKED:{code:2e3,status:"failure",type:"WALLET_LOCKED",message:"Adena is Locked."},ACCOUNT_MISMATCH:{code:3001,status:"failure",type:"ACCOUNT_MISMATCH",message:"The account does not match the caller."},NO_ACCOUNT:{code:3002,status:"failure",type:"NO_ACCOUNT",message:"No account found on Adena."},TRANSACTION_FAILED:{code:4001,status:"failure",type:"TRANSACTION_FAILED",message:"Adena could not execute the transaction."},SIGN_FAILED:{code:4001,status:"failure",type:"SIGN_FAILED",message:"Adena could not generate the signature hash."},CREATE_MULTISIG_ACCOUNT_FAILED:{code:4001,status:"failure",type:"CREATE_MULTISIG_ACCOUNT_FAILED",message:"Adena could not create the multisig account."},CREATE_MULTISIG_TRANSACTION_FAILED:{code:4001,status:"failure",type:"CREATE_MULTISIG_TRANSACTION_FAILED",message:"Adena could not create the multisig document."},SIGN_MULTISIG_TRANSACTION_FAILED:{code:4001,status:"failure",type:"SIGN_MULTISIG_TRANSACTION_FAILED",message:"Adena could not generate the signature hash."},BROADCAST_MULTISIG_TRANSACTION_FAILED:{code:4001,status:"failure",type:"BROADCAST_MULTISIG_TRANSACTION_FAILED",message:"Adena could not execute the multisig transaction."},ALREADY_CONNECTED:{code:4001,status:"failure",type:"ALREADY_CONNECTED",message:"The account is already connected to this website."},NETWORK_TIMEOUT:{code:4001,status:"failure",type:"NETWORK_TIMEOUT",message:"The network response has timed out."},REDUNDANT_CHANGE_REQUEST:{code:4001,status:"failure",type:"REDUNDANT_CHANGE_REQUEST",message:"Unable to change to the current network."},NETWORK_ALREADY_EXISTS:{code:4001,status:"failure",type:"NETWORK_ALREADY_EXISTS",message:"The network already exists."},UNADDED_NETWORK:{code:4001,status:"failure",type:"UNADDED_NETWORK",message:"The network has not been added on Adena."},NOT_INITIALIZED_NETWORK:{code:4001,status:"failure",type:"NOT_INITIALIZED_NETWORK",message:"The network has not been initialized on Wallet."},UNSUPPORTED_TYPE:{code:4005,status:"failure",type:"UNSUPPORTED_TYPE",message:"Adena does not support the requested transaction type."},UNEXPECTED_ERROR:{code:9e3,status:"failure",type:"UNEXPECTED_ERROR",message:"Adena has encountered an unexpected error."}},WalletRejectMessageInfo={TRANSACTION_REJECTED:{code:4e3,status:"failure",type:"TRANSACTION_REJECTED",message:"The transaction has been rejected by the user."},SIGN_REJECTED:{code:4e3,status:"failure",type:"SIGN_REJECTED",message:"The signature has been rejected by the user."},CREATE_MULTISIG_ACCOUNT_REJECTED:{code:4e3,status:"failure",type:"CREATE_MULTISIG_ACCOUNT_REJECTED",message:"Creating multisig account has been rejected by the user."},CREATE_MULTISIG_TRANSACTION_REJECTED:{code:4e3,status:"failure",type:"CREATE_MULTISIG_TRANSACTION_REJECTED",message:"Creating multisig document has been rejected by the user."},SIGN_MULTISIG_TRANSACTION_REJECTED:{code:4e3,status:"failure",type:"SIGN_REJECTED",message:"The signature has been rejected by the user."},BROADCAST_MULTISIG_TRANSACTION_REJECTED:{code:4e3,status:"failure",type:"BROADCAST_MULTISIG_TRANSACTION_REJECTED",message:"The multisig transaction has been rejected by the user."},CONNECTION_REJECTED:{code:4e3,status:"failure",type:"CONNECTION_REJECTED",message:"The connection request has been rejected by the user."},SWITCH_NETWORK_REJECTED:{code:4e3,status:"failure",type:"SWITCH_NETWORK_REJECTED",message:"Switching the network has been rejected by the user."},ADD_NETWORK_REJECTED:{code:4e3,status:"failure",type:"ADD_NETWORK_REJECTED",message:"Adding a network has been rejected by the user."}},WalletExecuteMessageInfo={ADD_ESTABLISH:{code:0,status:"success",type:"ADD_ESTABLISH",message:"Establish Connection."},DO_CONTRACT:{code:0,status:"success",type:"DO_CONTRACT",message:"Do Contract."},GET_ACCOUNT:{code:0,status:"success",type:"GET_ACCOUNT",message:"Get Account Information."},GET_NETWORK:{code:0,status:"success",type:"GET_NETWORK",message:"Get Network Information."},SIGN_AMINO:{code:0,status:"success",type:"SIGN_AMINO",message:"Sign Amino"},SIGN_TX:{code:0,status:"success",type:"SIGN_TX",message:"Sign Transaction"},CREATE_MULTISIG_ACCOUNT:{code:0,status:"success",type:"CREATE_MULTISIG_ACCOUNT",message:"Create Multisig Account"},CREATE_MULTISIG_TRANSACTION:{code:0,status:"success",type:"CREATE_MULTISIG_TRANSACTION",message:"Create Multisig Document"},SIGN_MULTISIG_TRANSACTION:{code:0,status:"success",type:"SIGN_MULTISIG_TRANSACTION",message:"Sign Document"},BROADCAST_MULTISIG_TRANSACTION:{code:0,status:"success",type:"BROADCAST_MULTISIG_TRANSACTION",message:"Broadcast Multisig Transaction"},ADD_NETWORK:{code:0,status:"success",type:"ADD_NETWORK",message:"Add Network"},SWITCH_NETWORK:{code:0,status:"success",type:"SWITCH_NETWORK",message:"Switch Network"}},WalletMessageInfo={...WalletSuccessMessageInfo,...WalletFailureMessageInfo,...WalletRejectMessageInfo,...WalletExecuteMessageInfo},import_gno_js_client=require("@gnolang/gno-js-client");function isSuccessType(e){const t=e.toString();return!!Object.values(WalletResponseSuccessType).find((e=>e===t))}function isFailedType(e){const t=e.toString();return!!Object.values(WalletResponseFailureType).find((e=>e===t))}function isRejectType(e){const t=e.toString();return!!Object.values(WalletResponseRejectType).find((e=>e===t))}function mapResponseStatus(e){return"success"===e?"success":"failure"}function mapResponseType(e){if(!isSuccessType(e)&&!isFailedType(e)&&!isRejectType(e))throw new Error("is not response type");return e}function mapResponseByAdenaResponse(e,t){return{code:e.code,status:mapResponseStatus(e.status),type:mapResponseType(e.type),message:e.message,data:t}}function mapTxToTransactionParams(e){const t=e.fee?.gas_wanted.toNumber()||defaultGasWanted,n=parseTokenAmount(e.fee?.gas_fee||import_gno_js_client.defaultTxFee);return{messages:e.messages.map(decodeTransactionMessage),gasFee:n,gasWanted:t,memo:e.memo}}function parseTokenAmount(e){const t=e.match(/^(\d+)/);if(!t||t.length<2)return 0;try{return parseInt(t[1])}catch(e){console.error("Error parsing token amount",e)}return 0}var AdenaWalletProvider=class{getAdena(){if(!window)throw new Error("Window not initialized");const e=window.adena;if(!e)throw new Error("Adena not installed");return e}async isConnected(){return makeResponseMessage("UNSUPPORTED_TYPE",!1)}async addEstablish(e){const t=this.getAdena(),n=e.siteName||"",s=await t.AddEstablish(n),i=isSuccessType(s.type)||s.type==="ALREADY_CONNECTED".toString();return i?makeResponseMessage("CONNECTION_SUCCESS",i):mapResponseByAdenaResponse(s,!1)}async getAccount(){const e=this.getAdena(),t=await e.GetAccount();return mapResponseByAdenaResponse(t,{...t.data})}async getNetwork(){const e=this.getAdena(),t=await e.GetNetwork();return mapResponseByAdenaResponse(t,t.data)}async switchNetwork(e){const t=this.getAdena();return mapResponseByAdenaResponse(await t.SwitchNetwork(e.chainId))}async addNetwork(e){const t=this.getAdena();return mapResponseByAdenaResponse(await t.AddNetwork(e))}async signTransaction(e){const t=this.getAdena(),n=await t.SignTx(mapTxToTransactionParams(e.tx));return mapResponseByAdenaResponse(n,n.data)}async broadcastTransaction(e){const t=this.getAdena(),n=await t.DoContract(mapTxToTransactionParams(e.tx));return mapResponseByAdenaResponse(n,n.data)}async createMultisigAccount(e){const t=this.getAdena(),n=await t.CreateMultisigAccount(e);return mapResponseByAdenaResponse(n,n.data)}async createMultisigTransaction(e){const t=this.getAdena(),n=await t.CreateMultisigTransaction(e);return mapResponseByAdenaResponse(n,n.data)}async signMultisigTransaction(e){const t=this.getAdena(),{multisigDocument:n,multisigSignatures:s}=e,i=await t.SignMultisigTransaction(n,s);return mapResponseByAdenaResponse(i,i.data)}async broadcastMultisigTransaction(e){const t=this.getAdena(),{multisigDocument:n,multisigSignatures:s}=e,i=await t.BroadcastMultisigTransaction(n,s);return mapResponseByAdenaResponse(i,i.data)}onChangeAccount(e){this.getAdena().On("changedAccount",e.callback)}onChangeNetwork(e){this.getAdena().On("changedNetwork",e.callback)}},ADENA_SUCCESS_CODE=0,AddEstablishResponseType=(e=>(e.CONNECTION_SUCCESS="CONNECTION_SUCCESS",e.ALREADY_CONNECTED="ALREADY_CONNECTED",e))(AddEstablishResponseType||{}),SwitchNetworkResponseType=(e=>(e.SWITCH_NETWORK_SUCCESS="SWITCH_NETWORK_SUCCESS",e.REDUNDANT_CHANGE_REQUEST="REDUNDANT_CHANGE_REQUEST",e.UNADDED_NETWORK="UNADDED_NETWORK",e))(SwitchNetworkResponseType||{}),import_gno_js_client3=require("@gnolang/gno-js-client"),import_base=require("@web3auth/base"),import_base_provider=require("@web3auth/base-provider"),import_no_modal=require("@web3auth/no-modal"),DEFAULT_RPC_URL="https://rpc.gno.land:443",GNO_ADDRESS_PREFIX="g",import_tm2_js_client=require("@gnolang/tm2-js-client"),hexToUint8Array=e=>{const t=e.replace("0x","");return Uint8Array.from(Buffer.from(t,"hex"))},encodeTransaction=e=>(0,import_tm2_js_client.uint8ArrayToBase64)(import_tm2_js_client.Tx.encode(e).finish()),import_gno_js_client2=require("@gnolang/gno-js-client"),import_tm2_js_client2=require("@gnolang/tm2-js-client"),makeResponseMessage=(e,t)=>({...WalletMessageInfo[e],data:t||null}),validateNetworkInput=e=>{const{chainId:t,chainName:n,rpcUrl:s}=e;return!!(t&&n&&s)&&!s.match(/\s/g)},normalizeRpcUrl=e=>e.replace(/\/$/,""),GnoWalletProvider=class{wallet;rpcUrl;networks;currentChainId;networkCallback;constructor(e,t){this.wallet=e||null,this.networks=t||[],this.currentChainId=null}get currentNetwork(){return 0===this.networks.length?null:null===this.currentChainId?this.networks[0]:this.networks.find((e=>e.chainId===this.currentChainId))||null}getWallet(){return this.wallet}async connect(){return this.connectProvider()}async disconnect(){return this.disconnectProvider()}async isConnected(){const e=null!==this.wallet;return makeResponseMessage(e?"CONNECTION_SUCCESS":"NOT_CONNECTED")}async addEstablish(){return makeResponseMessage("CONNECTION_SUCCESS",!0)}async getAccount(){if(!(null!==this.wallet))return makeResponseMessage("NOT_CONNECTED");try{const e=await this.wallet.getAddress(),t=await this.wallet.getAccountNumber(),n=await this.wallet.getAccountSequence(),s=await this.wallet.getProvider().getStatus().then((e=>e.node_info.network)),i=await this.wallet.getSigner().getPublicKey();return makeResponseMessage("GET_ACCOUNT",{address:e,accountNumber:t.toString(),sequence:n.toString(),chainId:s,coins:"",status:"ACTIVE",publicKey:{"@type":import_tm2_js_client2.Secp256k1PubKeyType,value:(0,import_tm2_js_client2.uint8ArrayToBase64)(i)}})}catch(e){return console.log(e),makeResponseMessage("NO_ACCOUNT")}}setNetworks(e){this.networks=e}async getNetwork(){return null!==this.wallet?this.currentNetwork?makeResponseMessage("GET_NETWORK",this.currentNetwork):makeResponseMessage("NOT_INITIALIZED_NETWORK"):makeResponseMessage("NOT_CONNECTED")}async switchNetwork(e){if(!e.chainId)return makeResponseMessage("INVALID_FORMAT");const t=this.networks.find((t=>t.chainId===e.chainId));return t?(this.setNetwork(t),makeResponseMessage("SWITCH_NETWORK_SUCCESS")):makeResponseMessage("UNADDED_NETWORK")}async addNetwork(e){if(!validateNetworkInput(e))return makeResponseMessage("INVALID_FORMAT");const t=normalizeRpcUrl(e.rpcUrl);if(this.isExistingNetwork(e.chainId,t))return makeResponseMessage("NETWORK_ALREADY_EXISTS");const n={chainId:e.chainId,networkName:e.chainName,rpcUrl:t,addressPrefix:GNO_ADDRESS_PREFIX,indexerUrl:null};return this.networks=[...this.networks,n],makeResponseMessage("ADD_NETWORK_SUCCESS")}async signTransaction(e){if(!(null!==this.wallet))return makeResponseMessage("NOT_CONNECTED");const t=await this.wallet.signTransaction(e.tx,import_gno_js_client2.decodeTxMessages),n=encodeTransaction(t);return makeResponseMessage("SIGN_TX",{encodedTransaction:n})}async broadcastTransaction(e){if(!(null!==this.wallet))return makeResponseMessage("NOT_CONNECTED");const t=await this.wallet.signTransaction(e.tx,import_gno_js_client2.decodeTxMessages),n="COMMIT"===e.broadcastType?import_tm2_js_client2.TransactionEndpoint.BROADCAST_TX_COMMIT:import_tm2_js_client2.TransactionEndpoint.BROADCAST_TX_SYNC,s=await this.wallet.sendTransaction(t,n);return makeResponseMessage("TRANSACTION_SUCCESS",s)}createMultisigAccount(){throw new Error("not supported")}createMultisigTransaction(){throw new Error("not supported")}signMultisigTransaction(){throw new Error("not supported")}broadcastMultisigTransaction(){throw new Error("not supported")}onChangeAccount(){throw new Error("not supported")}onChangeNetwork(e){this.networkCallback=e.callback}triggerNetworkCallback(e){this.networkCallback&&this.networkCallback(e)}connectProvider(){if(!this.wallet)return!1;const e=this.currentNetwork?.rpcUrl||DEFAULT_RPC_URL,t=new import_tm2_js_client2.JSONRPCProvider(e);return this.wallet.connect(t),!0}disconnectProvider(){return this.networkCallback=null,this.networks=[],this.currentChainId=null,this.wallet=null,!0}setNetwork(e){this.currentChainId=e.chainId,this.connectProvider(),this.triggerNetworkCallback(this.currentChainId)}isExistingNetwork(e,t){return this.networks.some((n=>n.chainId===e||normalizeRpcUrl(n.rpcUrl)===t))}async getSocialUserProfile(){throw new Error("Social user profile is not supported in GnoWalletProvider. Use GnoSocialWalletProvider instead.")}},import_auth_adapter=require("@web3auth/auth-adapter"),GnoSocialWalletProvider=class e extends GnoWalletProvider{web3auth;socialType;config;chainConfig;loginConfig;extraLoginOptions;constructor(e,t,n){super(void 0,n),this.socialType=e,this.config=t,this.chainConfig={displayName:"Gno.land",tickerName:"Gno.land",ticker:"ugnot",chainNamespace:"other",chainId:this.config.chainId,rpcTarget:this.config.rpcTarget},this.extraLoginOptions={},this.loginConfig=this.createLoginConfig(),isSocialEmailPasswordlessConfigure(t)&&(this.extraLoginOptions={login_hint:t.email})}setExtraLoginOptions(e){this.extraLoginOptions=e}createLoginConfig(){switch(this.socialType){case"GOOGLE":if(!isSocialGoogleConfigure(this.config))throw new Error("Invalid Google configuration");return{[this.socialType]:{typeOfLogin:"google",name:this.config.name,clientId:this.config.googleClientId,verifier:this.config.verifier}};case"TWITTER":if(!isSocialTwitterConfigure(this.config))throw new Error("Invalid Twitter configuration");return{[this.socialType]:{typeOfLogin:"twitter",name:this.config.name,verifier:this.config.verifier,clientId:this.config.authClientId,jwtParameters:{connection:"twitter",verifyerIdField:"sub",domain:this.config.domain}}};case"EMAIL_PASSWORDLESS":if(!isSocialEmailPasswordlessConfigure(this.config))throw new Error("Invalid Email configuration");return{[this.socialType]:{typeOfLogin:"email_passwordless",name:this.config.name,verifier:this.config.verifier,clientId:this.config.clientId}};default:throw new Error("Unsupported social type")}}async connect(){if(!this.currentNetwork)return!1;try{this.web3auth=await this.initializeWeb3Auth();const e={loginProvider:this.socialType,...this.extraLoginOptions&&{extraLoginOptions:this.extraLoginOptions}};if(this.web3auth.connected){const e=await this.web3auth.getUserInfo();if(e.typeOfLogin===this.socialType){const e=await this.requestPrivateKey(),t=hexToUint8Array(e),n=await import_gno_js_client3.GnoWallet.fromPrivateKey(t,{addressPrefix:this.currentNetwork.addressPrefix});return this.wallet=n,this.connectProvider()}{const e=[...this.networks];await this.disconnect(),this.setNetworks(e),this.web3auth=await this.initializeWeb3Auth()}}if(!await this.web3auth.connectTo(import_base.WALLET_ADAPTERS.AUTH,e))return!1;const t=await this.requestPrivateKey(),n=hexToUint8Array(t),s=await import_gno_js_client3.GnoWallet.fromPrivateKey(n,{addressPrefix:this.currentNetwork.addressPrefix});return this.wallet=s,this.connectProvider()}catch(e){return console.error("Connection failed:",e),!1}}disconnect=()=>(this.disconnectProvider(),this.web3auth.logout({cleanup:!0}).then((()=>!0)).catch((()=>!1)));async requestPrivateKey(){if(!this.web3auth.provider)throw new Error("Not initialized web3 provider.");return`${await this.web3auth.provider.request({method:"private_key"})}`}async initializeWeb3Auth(){const e=new import_base_provider.CommonPrivateKeyProvider({config:{chainConfig:this.chainConfig}}),t=new import_no_modal.Web3AuthNoModal({clientId:this.config.clientId,web3AuthNetwork:this.config.network,privateKeyProvider:e}),n=new import_auth_adapter.AuthAdapter({adapterSettings:{uxMode:"popup",loginConfig:this.loginConfig}});return t.configureAdapter(n),await t.init(),t}static async createGoogle(t){const n={chainId:t.chainId,addressPrefix:t.addressPrefix||GNO_ADDRESS_PREFIX,indexerUrl:null,networkName:t.network,rpcUrl:t.rpcTarget};return new e("GOOGLE",t,[n])}static async createTwitter(t){const n={chainId:t.chainId,addressPrefix:t.addressPrefix||GNO_ADDRESS_PREFIX,indexerUrl:null,networkName:t.network,rpcUrl:t.rpcTarget};return new e("TWITTER",t,[n])}static async createEmailPasswordless(t){const n={chainId:t.chainId,addressPrefix:t.addressPrefix||GNO_ADDRESS_PREFIX,indexerUrl:null,networkName:t.network,rpcUrl:t.rpcTarget};return new e("EMAIL_PASSWORDLESS",t,[n])}async getSocialUserProfile(){if(!this.web3auth)throw new Error("Not initialized web3 provider.");return await this.web3auth.getUserInfo()}};function isSocialGoogleConfigure(e){return null!==e&&"object"==typeof e&&("authClientId"in e&&"googleClientId"in e&&"verifier"in e)}function isSocialTwitterConfigure(e){return null!==e&&"object"==typeof e&&("verifier"in e&&"domain"in e)}function isSocialEmailPasswordlessConfigure(e){return null!==e&&"object"==typeof e&&("email"in e&&"verifier"in e&&"domain"in e)}function isTM2WalletProvider(e){return e instanceof GnoWalletProvider||e instanceof GnoSocialWalletProvider}function isGnoSocialWalletProvider(e){return e instanceof GnoSocialWalletProvider}function setSessionStorageItem(e,t){sessionStorage.setItem(e,t)}function getSessionStorageItem(e){const t=sessionStorage.getItem(e);return t||null}function removeSessionStorageItem(e){sessionStorage.removeItem(e)}var ConnectionStateManager=class e{static STORAGE_KEY="adena-sdk-connection-state";state=0;getState(){return this.state}setState(e){this.state=e,this.saveState()}loadState(){getSessionStorageItem(e.STORAGE_KEY)===2..toString()&&this.setState(2)}saveState(){setSessionStorageItem(e.STORAGE_KEY,this.state.toString())}},ConnectionManager=class{constructor(e,t){this.provider=e,this.config=t,this.listeners=[],this.stateManager=new ConnectionStateManager,this.config.isSession&&(this.stateManager.loadState(),this.connectWallet())}stateManager;listeners;async connectWallet(){return isTM2WalletProvider(this.provider)?this.connectTM2Wallet():this.connectAdenaWallet()}disconnectWallet(){this.provider instanceof GnoWalletProvider&&this.provider.disconnect(),this.disconnect()}getConnectionState(){return this.stateManager.getState()}getWalletProvider(){if(2!==this.stateManager.getState())throw new Error("not connect wallet");return this.provider}on(e){this.listeners.push(e)}off(e){this.listeners=this.listeners.filter((t=>t!==e))}async connectAdenaWallet(){2!==this.getConnectionState()&&this.stateManager.setState(1);try{if("success"===(await this.provider.isConnected()).status)return void this.connect();if("success"===(await this.provider.addEstablish({})).status)return void this.connect()}catch(e){throw this.stateManager.setState(3),e}this.stateManager.setState(0)}async connectTM2Wallet(){2!==this.getConnectionState()&&this.stateManager.setState(1);try{if(await this.provider.connect())return void this.connect()}catch(e){throw this.stateManager.setState(3),e}this.stateManager.setState(0)}connect(){this.stateManager.setState(2),this.triggerConnectionEvent("connect")}disconnect(){this.stateManager.setState(0),this.triggerConnectionEvent("disconnect")}triggerConnectionEvent(e){this.listeners?.forEach((t=>t(e)))}},addEstablish=(e,t)=>e.addEstablish(t),addNetwork=(e,t)=>e.addNetwork(t),broadcastTransaction=(e,t)=>e.broadcastTransaction(t),connect=async(e,t={})=>{try{await e.connectWallet()}catch(n){!isTM2WalletProvider(e.getWalletProvider())&&!!t.walletDownloadUrl?openLink(t.walletDownloadUrl):console.error(n.message)}},openLink=e=>{open(e,"_blank")},disconnect=e=>{e.disconnectWallet()},getAccount=e=>e.getAccount(),getConnectionState=e=>e.getConnectionState(),isConnected=e=>e.isConnected(),offConnectionChange=(e,t)=>e.off(t.callback),onChangeAccount=(e,t)=>e.onChangeAccount(t),onChangeNetwork=(e,t)=>e.onChangeNetwork(t),onConnectionChange=(e,t)=>e.on(t.callback),signTransaction=(e,t)=>e.signTransaction(t),switchNetwork=(e,t)=>e.switchNetwork(t),createMultisigAccount=(e,t)=>e.createMultisigAccount(t),createMultisigTransaction=(e,t)=>e.createMultisigTransaction(t),signMultisigTransaction=(e,t)=>e.signMultisigTransaction(t),broadcastMultisigTransaction=(e,t)=>e.broadcastMultisigTransaction(t),getSocialUserProfile=async e=>{if(!isGnoSocialWalletProvider(e))throw new Error("Wallet provider is not a GnoSocialWalletProvider");return await e.getSocialUserProfile()},DEFAULT_ADENA_URL="https://www.adena.app";function createSDKConfigure({isSession:e=!1,walletDownloadUrl:t=DEFAULT_ADENA_URL,...n}={}){return{...n,isSession:e,walletDownloadUrl:t}}var AdenaSDK=class e{connectionManager;config;constructor(e,t){this.config=createSDKConfigure(t),this.connectionManager=new ConnectionManager(e,this.config)}get walletProvider(){return this.connectionManager.getWalletProvider()}connectWallet(){return connect(this.connectionManager,this.config)}disconnectWallet(){return disconnect(this.connectionManager)}getConnectionState(){return getConnectionState(this.connectionManager)}onConnectionChange(e){return onConnectionChange(this.connectionManager,e)}offConnectionChange(e){return offConnectionChange(this.connectionManager,e)}isConnected(){return isConnected(this.walletProvider)}addEstablish(e){return addEstablish(this.walletProvider,e)}getAccount(){return getAccount(this.walletProvider)}switchNetwork(e){return switchNetwork(this.walletProvider,e)}addNetwork(e){return addNetwork(this.walletProvider,e)}signTransaction(e){return signTransaction(this.walletProvider,e)}broadcastTransaction(e){return broadcastTransaction(this.walletProvider,e)}createMultisigAccount(e){return createMultisigAccount(this.walletProvider,e)}createMultisigTransaction(e){return createMultisigTransaction(this.walletProvider,e)}signMultisigTransaction(e){return signMultisigTransaction(this.walletProvider,e)}broadcastMultisigTransaction(e){return broadcastMultisigTransaction(this.walletProvider,e)}onChangeAccount(e){return onChangeAccount(this.walletProvider,e)}onChangeNetwork(e){return onChangeNetwork(this.walletProvider,e)}getSocialUserProfile(){return getSocialUserProfile(this.walletProvider)}static createAdenaWallet(t){return new e(new AdenaWalletProvider,t)}static createGnoWallet(t,n){return new e(new GnoWalletProvider(t),n)}},import_gno_js_client4=require("@gnolang/gno-js-client");function makeAddPackageMessage(e){return{type:import_gno_js_client4.MsgEndpoint.MSG_ADD_PKG,value:e}}function makeMsgCallMessage(e){return{type:import_gno_js_client4.MsgEndpoint.MSG_CALL,value:e}}function makeMsgSendMessage(e){return{type:import_gno_js_client4.MsgEndpoint.MSG_SEND,value:e}}function makeMsgRunMessage(e){return{type:import_gno_js_client4.MsgEndpoint.MSG_RUN,value:e}}function encodeTransactionMessage(e){if(isAddPackageMessage(e))return import_gno_js_client4.MsgAddPackage.encode(e.value).finish();if(isMsgCallMessage(e))return import_gno_js_client4.MsgCall.encode(e.value).finish();if(isMsgSendMessage(e))return import_gno_js_client4.MsgSend.encode(e.value).finish();if(isMsgRunMessage(e))return import_gno_js_client4.MsgRun.encode(e.value).finish();throw new Error("Unknown message type")}function decodeTransactionMessage(e){if(e.type_url===import_gno_js_client4.MsgEndpoint.MSG_ADD_PKG)return{type:import_gno_js_client4.MsgEndpoint.MSG_ADD_PKG,value:import_gno_js_client4.MsgAddPackage.decode(e.value)};if(e.type_url===import_gno_js_client4.MsgEndpoint.MSG_CALL)return{type:import_gno_js_client4.MsgEndpoint.MSG_CALL,value:import_gno_js_client4.MsgCall.decode(e.value)};if(e.type_url===import_gno_js_client4.MsgEndpoint.MSG_SEND)return{type:import_gno_js_client4.MsgEndpoint.MSG_SEND,value:import_gno_js_client4.MsgSend.decode(e.value)};if(e.type_url===import_gno_js_client4.MsgEndpoint.MSG_RUN)return{type:import_gno_js_client4.MsgEndpoint.MSG_RUN,value:import_gno_js_client4.MsgRun.decode(e.value)};throw new Error("Unknown message type")}function isAddPackageMessage(e){return e.type===import_gno_js_client4.MsgEndpoint.MSG_ADD_PKG}function isMsgCallMessage(e){return e.type===import_gno_js_client4.MsgEndpoint.MSG_CALL}function isMsgSendMessage(e){return e.type===import_gno_js_client4.MsgEndpoint.MSG_SEND}function isMsgRunMessage(e){return e.type===import_gno_js_client4.MsgEndpoint.MSG_RUN}var import_gno_js_client5=require("@gnolang/gno-js-client"),import_tm2_js_client3=require("@gnolang/tm2-js-client"),defaultGasWanted=1e7,TransactionBuilder=class e{_messages=[];_memo="";_gasWanted=defaultGasWanted;_gasFee=import_gno_js_client5.defaultTxFee;messages(...e){return this._messages=e,this}fee(e,t){return this._gasFee=`${e}${t}`,this}gasWanted(e){return this._gasWanted=e,this}memo(e){return this._memo=e,this}get txMessages(){return this._messages.map((e=>import_gno_js_client5.Any.create({type_url:e.type,value:encodeTransactionMessage(e)})))}get txFee(){return import_tm2_js_client3.TxFee.create({gas_fee:this._gasFee,gas_wanted:this._gasWanted})}build(){return{messages:this.txMessages,fee:this.txFee,memo:this._memo,signatures:[]}}static create(){return(new e).gasWanted(defaultGasWanted)}};
/*! Bundled license information:

long/index.js:
  (**
   * @license
   * Copyright 2009 The Closure Library Authors
   * Copyright 2020 Daniel Wirtz / The long.js Authors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   *
   * SPDX-License-Identifier: Apache-2.0
   *)
*/
//# sourceMappingURL=/sm/09f6a0cca0f9e4aba5efdd2762bb7444f19764dd72b3f98e71a78a694f489d7c.map