edge-currency-accountbased 0.23.0 → 0.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/android/src/main/assets/edge-currency-accountbased/234.chunk.js +2 -2
- package/android/src/main/assets/edge-currency-accountbased/edge-currency-accountbased.js +1 -1
- package/android/src/main/assets/edge-currency-accountbased/eos.chunk.js +8 -8
- package/android/src/main/assets/piratesaplingtree/mainnet/2300000.json +7 -0
- package/android/src/main/assets/piratesaplingtree/mainnet/2310000.json +7 -0
- package/android/src/main/assets/piratesaplingtree/mainnet/2320000.json +7 -0
- package/android/src/main/assets/piratesaplingtree/mainnet/2330000.json +7 -0
- package/android/src/main/assets/saplingtree/mainnet/2010000.json +7 -0
- package/android/src/main/assets/saplingtree/mainnet/2020000.json +7 -0
- package/android/src/main/assets/saplingtree/mainnet/2030000.json +7 -0
- package/lib/eos/eosEngine.js +0 -9
- package/lib/eos/eosPlugin.js +23 -19
- package/lib/eos/eosTypes.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[234],{45234:function(er,Pe,L){L.d(Pe,{AQ:function(){return Ne},AU:function(){return i},Hx:function(){return we},VG:function(){return I},YW:function(){return ct},_q:function(){return Te},c6:function(){return Xe},f1:function(){return z},lP:function(){return tr},pB:function(){return d},uQ:function(){return pt},xR:function(){return V},zM:function(){return f}});var Zt=L(29931),Be=L.n(Zt),ut=L(33715),rr=L.n(ut),Re=L(13550),et=L.n(Re),ve=L(86266),nr=L.n(ve),s=L(70655);/**
|
|
1
|
+
"use strict";(self.webpackChunkedge_currency_accountbased=self.webpackChunkedge_currency_accountbased||[]).push([[234],{45234:function(er,Pe,L){L.d(Pe,{AQ:function(){return Ne},AU:function(){return i},Hx:function(){return we},Jj:function(){return S},Jz:function(){return x},VG:function(){return I},YW:function(){return ct},_q:function(){return Te},c6:function(){return Xe},f1:function(){return z},lP:function(){return tr},pB:function(){return d},uQ:function(){return pt},xR:function(){return V},zM:function(){return f}});var Zt=L(29931),Be=L.n(Zt),ut=L(33715),rr=L.n(ut),Re=L(13550),et=L.n(Re),ve=L(86266),nr=L.n(ve),s=L(70655);/**
|
|
2
2
|
* EOSIO Core v0.6.8
|
|
3
3
|
* https://github.com/greymass/eosio-core
|
|
4
4
|
*
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
*
|
|
33
33
|
* YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED, LICENSED OR INTENDED FOR USE
|
|
34
34
|
* IN THE DESIGN, CONSTRUCTION, OPERATION OR MAINTENANCE OF ANY MILITARY FACILITY.
|
|
35
|
-
*/function Yt(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(r[n]!==t[n])return!1;return!0}function qe(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(!r[n].equals(t[n]))return!1;return!0}const ft={};function Ae(){ft.enc=new Array(255),ft.dec={};for(let r=0;r<=255;++r){const t=r.toString(16).padStart(2,"0");ft.enc[r]=t,ft.dec[t]=r}}function Qt(r){ft.enc||Ae();const t=r.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=ft.enc[r[n]];return e.join("")}function Le(r){if(ft.dec||Ae(),typeof r!="string")throw new Error("Expected string containing hex digits");if(r.length%2)throw new Error("Odd number of hex digits");r=r.toLowerCase();const t=r.length/2,e=new Uint8Array(t);for(let n=0;n<t;n++){const o=ft.dec[r[n*2]+r[n*2+1]];if(o===void 0)throw new Error("Expected hex string");e[n]=o}return e}function vt(r){return Be()(r)}let Xt=!1;function A(r,t){if(r instanceof t)return!0;if(r==null||typeof r!="object")return!1;const e=t.__className||t.abiName;if(!e)return!1;let n=r.constructor,o=!1;for(;n&&!o;){const a=n.__className||n.abiName;if(!a)break;o=e==a,n=Object.getPrototypeOf(n)}return o&&!Xt&&(console.warn(`Detected alien instance of ${e}, this usually means more than one version of @greymass/eosio has been included in your bundle.`),Xt=!0),o}class S{constructor(t=new Uint8Array){this.array=t}static from(t,e){return A(t,this)?t:typeof t=="string"?this.fromString(t,e):ArrayBuffer.isView(t)?new this(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):A(t.array,Uint8Array)?new this(t.array):new this(new Uint8Array(t))}static fromString(t,e="hex"){if(e==="hex"){const n=Le(t);return new this(n)}else if(e=="utf8"){const n=new TextEncoder;return new this(n.encode(t))}else throw new Error(`Unknown encoding: ${e}`)}static fromABI(t){const e=t.readVaruint32();return new this(t.readArray(e))}static abiDefault(){return new S}static equal(t,e){return this.from(t).equals(this.from(e))}static random(t){return new this(vt(t))}static isBytes(t){return!!(A(t,S)||A(t,Uint8Array)||Array.isArray(t)&&t.every(e=>typeof e=="number")||typeof t=="string"&&(/[\da-f]/i.test(t)||t===""))}get length(){return this.array.byteLength}get hexString(){return Qt(this.array)}get utf8String(){return new TextDecoder().decode(this.array)}append(t){t=S.from(t);const e=this.array.byteLength+t.array.byteLength,n=new ArrayBuffer(e),o=new Uint8Array(n);o.set(this.array),o.set(t.array,this.array.byteLength),this.array=o}appending(t){const e=new S(this.array);return e.append(t),e}zeropad(t,e=!1){const n=e?t:Math.max(t,this.array.byteLength),o=new ArrayBuffer(n),a=new Uint8Array(o);a.fill(0),e&&this.array.byteLength>n?a.set(this.array.slice(0,n),0):a.set(this.array,n-this.array.byteLength),this.array=a}zeropadded(t,e=!1){const n=new S(this.array);return n.zeropad(t,e),n}dropFirst(t=1){this.array=this.array.subarray(t)}droppingFirst(t=1){return new S(this.array.subarray(t))}copy(){const t=new ArrayBuffer(this.array.byteLength),e=new Uint8Array(t);return e.set(this.array),new S(e)}equals(t){return Yt(this.array,S.from(t).array)}toString(t="hex"){if(t==="hex")return this.hexString;if(t==="utf8")return this.utf8String;throw new Error(`Unknown encoding: ${t}`)}toABI(t){t.writeVaruint32(this.array.byteLength),t.writeArray(this.array)}toJSON(){return this.hexString}}S.abiName="bytes";class At{constructor(t){const e=this.constructor.byteSize;if(t.byteLength!==e)throw new Error(`Checksum size mismatch, expected ${e} bytes got ${t.byteLength}`);this.array=t}static from(t){return A(t,this)?t:A(t,At)?new this(t.array):new this(S.from(t).array)}static fromABI(t){return new this(t.readArray(this.byteSize))}static abiDefault(){return new this(new Uint8Array(this.byteSize))}equals(t){const e=this.constructor;try{return Yt(this.array,e.from(t).array)}catch{return!1}}get hexString(){return Qt(this.array)}toABI(t){t.writeArray(this.array)}toString(){return this.hexString}toJSON(){return this.toString()}}At.abiName="__checksum";class B extends At{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,ut.sha256)().update(S.from(t).array).digest());return new B(e)}}B.abiName="checksum256",B.byteSize=32;class St extends At{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,ut.sha512)().update(S.from(t).array).digest());return new St(e)}}St.abiName="checksum512",St.byteSize=64;class kt extends At{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,ut.ripemd160)().update(S.from(t).array).digest());return new kt(e)}}kt.abiName="checksum160",kt.byteSize=20;var E;(function(r){r.K1="K1",r.R1="R1",r.WA="WA"})(E||(E={})),function(r){function t(n){switch(n){case r.K1:return 0;case r.R1:return 1;case r.WA:return 2;default:throw new Error(`Unknown curve type: ${n}`)}}r.indexFor=t;function e(n){let o;switch(typeof n!="number"?o=r.indexFor(n):o=n,o){case 0:return r.K1;case 1:return r.R1;case 2:return r.WA;default:throw new Error("Unknown curve type")}}r.from=e}(E||(E={}));class N{constructor(t){const e=this.constructor;if(e.isSigned===void 0||e.byteWidth===void 0)throw new Error("Cannot instantiate abstract class Int");if(t.gt(e.max))throw new Error(`Number ${t} overflows ${e.abiName}`);if(t.lt(e.min))throw new Error(`Number ${t} underflows ${e.abiName}`);this.value=t}static get max(){return new(et())(2).pow(new(et())(this.byteWidth*8-(this.isSigned?1:0))).isubn(1)}static get min(){return this.isSigned?this.max.ineg().isubn(1):new(et())(0)}static add(t,e,n="truncate"){return N.operator(t,e,n,(o,a)=>o.add(a))}static sub(t,e,n){return N.operator(t,e,n,(o,a)=>o.sub(a))}static mul(t,e,n){return N.operator(t,e,n,(o,a)=>o.mul(a))}static div(t,e,n){return N.operator(t,e,n,(o,a)=>{if(a.isZero())throw new Error("Division by zero");return o.div(a)})}static divRound(t,e,n){return N.operator(t,e,n,(o,a)=>{if(a.isZero())throw new Error("Division by zero");return o.divRound(a)})}static divCeil(t,e,n){return N.operator(t,e,n,(o,a)=>{if(a.isZero())throw new Error("Division by zero");const l=o.divmod(a);return l.mod.isZero()?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)})}static operator(t,e,n="truncate",o){const{a,b:l}=J(t,e),h=a.constructor,p=o(a.value,l.value);return h.from(p,n)}static from(t,e){if(A(t,this))return t;let n=this,o;if(A(t,N))n=t.constructor,o=t.value.clone();else if(t instanceof Uint8Array)o=new(et())(t,void 0,"le"),n.isSigned&&(o=o.fromTwos(n.byteWidth*8));else{if(typeof t=="string"&&!/[0-9]+/.test(t)||typeof t=="number"&&!Number.isFinite(t))throw new Error("Invalid number");o=et().isBN(t)?t.clone():new(et())(t,10),o.isNeg()&&!n.isSigned&&(n={byteWidth:n.byteWidth,isSigned:!0})}switch(e){case"clamp":o=_(o,this.min,this.max);break;case"truncate":o=P(o,n,this);break}return new this(o)}static fromABI(t){return this.from(t.readArray(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){return this.from(vt(this.byteWidth))}cast(t,e="truncate"){return this.constructor===t?this:t.from(this,e)}get byteArray(){const t=this.constructor;return(t.isSigned?this.value.toTwos(t.byteWidth*8):this.value).toArrayLike(Uint8Array,"le",t.byteWidth)}equals(t,e=!1){const n=this.constructor;if(e===!0&&A(t,N)){const o=t.constructor;if(n.byteWidth!==o.byteWidth||n.isSigned!==o.isSigned)return!1}try{return this.value.eq(n.from(t).value)}catch{return!1}}add(t){this.value=this.operator(t,N.add).value}adding(t){return this.operator(t,N.add)}subtract(t){this.value=this.operator(t,N.sub).value}subtracting(t){return this.operator(t,N.sub)}multiply(t){this.value=this.operator(t,N.mul).value}multiplying(t){return this.operator(t,N.mul)}divide(t,e){this.value=this.dividing(t,e).value}dividing(t,e){let n=N.div;switch(e){case"ceil":n=N.divCeil;break;case"round":n=N.divRound;break}return this.operator(t,n)}operator(t,e){let n;return A(t,N)?n=t:n=G.from(t,"truncate"),e(this,n).cast(this.constructor)}toNumber(){return this.value.toNumber()}toString(){return this.value.toString()}[Symbol.toPrimitive](t){return t==="number"?this.toNumber():this.toString()}toABI(t){t.writeArray(this.byteArray)}toJSON(){return this.value.bitLength()>32?this.value.toString():this.value.toNumber()}}N.abiName="__int";class Wt extends N{}Wt.abiName="int8",Wt.byteWidth=1,Wt.isSigned=!0;class te extends N{}te.abiName="int16",te.byteWidth=2,te.isSigned=!0;class lt extends N{}lt.abiName="int32",lt.byteWidth=4,lt.isSigned=!0;class G extends N{}G.abiName="int64",G.byteWidth=8,G.isSigned=!0;class ee extends N{}ee.abiName="int128",ee.byteWidth=16,ee.isSigned=!0;class re extends N{}re.abiName="uint8",re.byteWidth=1,re.isSigned=!1;class u extends N{}u.abiName="uint16",u.byteWidth=2,u.isSigned=!1;class c extends N{}c.abiName="uint32",c.byteWidth=4,c.isSigned=!1;class f extends N{}f.abiName="uint64",f.byteWidth=8,f.isSigned=!1;class d extends N{}d.abiName="uint128",d.byteWidth=16,d.isSigned=!1;class m extends N{static fromABI(t){return new this(new(et())(t.readVarint32()))}toABI(t){t.writeVarint32(Number(this))}}m.abiName="varint32",m.byteWidth=32,m.isSigned=!0;class y extends N{static fromABI(t){return new this(new(et())(t.readVaruint32()))}toABI(t){t.writeVaruint32(Number(this))}}y.abiName="varuint32",y.byteWidth=32,y.isSigned=!1;function _(r,t,e){return et().min(et().max(r,t),e)}function P(r,t,e){const n=r.isNeg()?255:0,a=(t.isSigned?r.toTwos(t.byteWidth*8):r).toArrayLike(Uint8Array,"le"),l=new Uint8Array(e.byteWidth);l.fill(n),l.set(a.slice(0,e.byteWidth));const h=new(et())(l,void 0,"le");return e.isSigned?h.fromTwos(e.byteWidth*8):h}function J(r,t){r=v(r),t=v(t);const e=r.constructor,n=t.constructor;return e!==n&&(e.isSigned===n.isSigned?e.byteWidth>n.byteWidth?t=t.cast(e):n.byteWidth>e.byteWidth&&(r=r.cast(n)):e.isSigned===!1&&e.byteWidth>=n.byteWidth?t=t.cast(e):n.isSigned===!1&&n.byteWidth>=e.byteWidth?r=r.cast(n):e.isSigned===!0&&e.max.gte(n.max)&&e.min.lte(n.min)?t=t.cast(e):n.isSigned===!0&&n.max.gte(e.max)&&n.min.lte(e.min)&&(r=r.cast(n))),{a:r,b:t}}function v(r){let t=r;return r.constructor.byteWidth<4&&(t=r.cast(lt)),t}function O(r){const t=[],e=[],n=[],o=new Set,a=p=>{let w;return typeof p.type!="string"?w=l(p.type):w=p.type,p.array===!0&&(w+="[]"),p.optional===!0&&(w+="?"),p.extension===!0&&(w+="$"),w},l=p=>{if(p.abiName){if(p.abiName==="__struct")throw new Error("Misconfigured Struct subclass, did you forget @Struct.type?")}else throw new Error("Encountered non-conforming type");if(o.has(p))return p.abiName;if(o.add(p),p.abiAlias)n.push({new_type_name:p.abiName,type:a(p.abiAlias)});else if(p.abiFields){const w=p.abiFields.map(q=>({name:q.name,type:a(q)})),K={base:p.abiBase?l(p.abiBase):"",name:p.abiName,fields:w};t.push(K)}else if(p.abiVariant){const w={name:p.abiName,types:p.abiVariant.map(a)};e.push(w)}return p.abiName},h=l(r);return{abi:W.from({structs:t,variants:e,types:n}),types:Array.from(o),root:h}}function j(r){let t=typeof r.type=="string"?r.type:r.type.abiName;return r.array===!0&&(t+="[]"),r.optional===!0&&(t+="?"),r.extension===!0&&(t+="$"),t}function U(r){return typeof r!="string"&&r.abiName===void 0&&r.type!==void 0}function Y(r){return typeof r=="string"?{type:r}:typeof r.abiName<"u"?{type:r}:r}const ot={abiName:"string",abiDefault:()=>"",fromABI:r=>r.readString(),from:r=>r,toABI:(r,t)=>{t.writeString(r)}},st={abiName:"bool",abiDefault:()=>!1,fromABI:r=>r.readByte()===1,from:r=>r,toABI:(r,t)=>{t.writeByte(r===!0?1:0)}};function gt(){return[st,ot,V,V.Symbol,V.SymbolCode,Ie,S,kt,B,St,ae,Ee,De,xe,ee,te,lt,G,Wt,I,Z,at,Je,Ne,d,u,c,f,re,m,y]}function bt(r=[]){const t={},e=gt();for(const n of e)t[n.abiName]=n;for(const n of r){if(!n.abiName)throw new Error("Invalid type");t[n.abiName]=n}return t}function Oe(r){if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor.abiName;if(Array.isArray(r)){const t=r.map(Oe),e=t[0];return!e||!t.every(n=>n===e)?void 0:e+"[]"}switch(typeof r){case"boolean":return"bool";case"string":return"string"}}function Ce(r,t="jsobj"){var e;if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor;if(Array.isArray(r)){const o=r.map(l=>Ce(l,t)),a=o[0];return!a||!o.every(l=>l&&l.abiName===a.abiName)?void 0:a}const n=typeof r;if(n==="object"&&r!==null){const o=Object.keys(r).map(a=>({name:a,type:Ce(r[a],t+"_nested")}));return o.find(a=>!a.type)?void 0:(e=class extends i{},e.abiName=t,e.abiFields=o,e)}switch(n){case"boolean":return st;case"string":return ot}}class Ge extends Error{constructor(t,e){const n=t.codingPath.map(({field:o,type:a})=>typeof o=="number"?o:`${o}<${a.typeName}>`).join(".");super(`Decoding error at ${n}: ${e.message}`),this.stack=e.stack,this.ctx=t,this.underlyingError=e}}Ge.__className="DecodingError";function Ct(r){const t=Y(r.type),e=j(t),n=r.customTypes||[];let o;if(r.abi)o=W.from(r.abi);else try{let h;if(typeof t.type=="string"){const w=bt(n),K=new W.ResolvedType(t.type).name;if(h=w[K],!h)throw new Error(`Unknown type: ${t.type}`)}else h=t.type;const p=O(h);o=p.abi,n.push(...p.types)}catch(h){throw Error(`Unable to synthesize ABI for: ${e} (${h.message}). To decode non-class types you need to pass the ABI definition manually.`)}const a=o.resolveType(e);typeof t.type!="string"&&n.unshift(t.type);const l={types:bt(n),strictExtensions:r.strictExtensions||!1,codingPath:[{field:"root",type:a}]};try{if(r.data||r.data===""){let h;if(A(r.data,oe))h=r.data;else{const p=S.from(r.data);h=new oe(p.array)}return r.metadata&&(h.metadata=r.metadata),Se(a,h,l)}else{if(r.object!==void 0)return ne(r.object,a,l);if(r.json)return ne(JSON.parse(r.json),a,l);throw new Error("Nothing to decode, you must set one of data, json, object")}}catch(h){throw new Ge(l,h)}}const Dt=Symbol("Resolved");function Se(r,t,e){if(e.codingPath.length>32)throw new Error("Maximum decoding depth exceeded");if(r.isExtension&&!t.canRead())return e.strictExtensions?ie(r,e):null;if(r.isOptional&&t.readByte()===0)return null;if(r.isArray){const o=t.readVaruint32(),a=[];for(let l=0;l<o;l++)e.codingPath.push({field:l,type:r}),a.push(n()),e.codingPath.pop();return a}else return n();function n(){const o=e.types[r.name];if(o&&o.fromABI)return o.fromABI(t);if(r.ref){e.codingPath.push({field:"",type:r.ref});const a=Se(r.ref,t,e);return e.codingPath.pop(),a}else if(r.fields){const a=r.allFields;if(!a)throw new Error("Invalid struct fields");const l={};for(const h of a)e.codingPath.push({field:h.name,type:h.type}),l[h.name]=Se(h.type,t,e),e.codingPath.pop();return o?(l[Dt]=!0,o.from(l)):l}else if(r.variant){const a=t.readByte(),l=r.variant[a];if(!l)throw new Error(`Unknown variant idx: ${a}`);e.codingPath.push({field:`v${a}`,type:l});const h=[l.typeName,Se(l,t,e)];return e.codingPath.pop(),o?o.from(h):h}else throw o?new Error("Invalid type"):new Error(r.name==="any"?"Unable to decode 'any' type from binary":"Unknown type")}}function ne(r,t,e){if(r==null){if(t.isOptional)return null;if(t.isExtension)return e.strictExtensions?ie(t,e):null;throw new Error(`Unexpectedly encountered ${r} for non-optional`)}else if(t.isArray){if(!Array.isArray(r))throw new Error("Expected array");const o=[],a=r.length;for(let l=0;l<a;l++)e.codingPath.push({field:l,type:t}),o.push(n(r[l])),e.codingPath.pop();return o}else return n(r);function n(o){const a=e.types[t.name];if(t.ref&&!a)return ne(o,t.ref,e);if(t.fields){if(typeof o!="object")throw new Error("Expected object");if(typeof a=="function"&&A(o,a))return o;const l=t.allFields;if(!l)throw new Error("Invalid struct fields");const h={};for(const p of l)e.codingPath.push({field:p.name,type:p.type}),h[p.name]=ne(o[p.name],p.type,e),e.codingPath.pop();return a?(h[Dt]=!0,a.from(h)):h}else if(t.variant){let l;Array.isArray(o)&&o.length===2&&typeof o[0]=="string"?(l=o[0],o=o[1]):A(o,Ft)?(l=o.variantName,o=o.value):l=Oe(o);const h=t.variant.findIndex(K=>K.typeName===l);if(h===-1)throw new Error(`Unknown variant type: ${l}`);const p=t.variant[h];e.codingPath.push({field:`v${h}`,type:p});const w=[p.typeName,ne(o,p,e)];return e.codingPath.pop(),a?(w[Dt]=!0,a.from(w)):w}else{if(!a){if(t.name==="any")return o;throw new Error("Unknown type")}return a.from(o)}}}function ie(r,t,e=new Set){if(r.isArray)return[];if(r.isOptional)return null;const n=t.types[r.name];if(n&&n.abiDefault)return n.abiDefault();if(e.has(r.name))throw new Error("Circular type reference");if(e.add(r.name),r.allFields){const o={};for(const a of r.allFields)t.codingPath.push({field:a.name,type:a.type}),o[a.name]=ie(a.type,t,e),t.codingPath.pop();return n?(o[Dt]=!0,n.from(o)):o}if(r.variant&&r.variant.length>0){const o=[r.variant[0].typeName,ie(r.variant[0],t)];return n?(o[Dt]=!0,n.from(o)):o}if(r.ref){t.codingPath.push({field:"",type:r.ref});const o=ie(r.ref,t,e);return t.codingPath.pop(),o}throw new Error("Unable to determine default value")}class oe{constructor(t){this.array=t,this.pos=0,this.textDecoder=new TextDecoder("utf-8",{fatal:!0}),this.metadata={},this.data=new DataView(t.buffer,t.byteOffset,t.byteLength)}canRead(t=1){return!(this.pos+t>this.array.byteLength)}ensure(t){if(!this.canRead(t))throw new Error("Read past end of buffer")}setPosition(t){if(t<0||t>this.array.byteLength)throw new Error("Invalid position");this.pos=t}getPosition(){return this.pos}advance(t){this.ensure(t),this.pos+=t}readByte(){return this.ensure(1),this.array[this.pos++]}readFloat(t){this.ensure(t);let e;switch(t){case 4:e=this.data.getFloat32(this.pos,!0);break;case 8:e=this.data.getFloat64(this.pos,!0);break;default:throw new Error("Invalid float size")}return this.pos+=t,e}readVaruint32(){let t=0,e=0;for(;;){const n=this.readByte();if(t|=(n&127)<<e,e+=7,!(n&128))break}return t>>>0}readVarint32(){const t=this.readVaruint32();return t&1?~t>>1|2147483648:t>>>1}readArray(t){this.ensure(t);const e=this.array.subarray(this.pos,this.pos+t);return this.pos+=t,e}readString(){const t=this.readVaruint32();return this.textDecoder.decode(this.readArray(t))}}oe.__className="ABIDecoder";class ze extends Error{constructor(t,e){const n=t.codingPath.map(({field:o,type:a})=>typeof o=="number"?o:`${o}<${a.typeName}>`).join(".");super(`Encoding error at ${n}: ${e.message}`),this.stack=e.stack,this.ctx=t,this.underlyingError=e}}ze.__className="EncodingError";function rt(r){let t,e;typeof r.type=="string"?e=r.type:r.type&&U(r.type)?(typeof r.type.type!="string"&&(t=r.type.type),e=j(r.type)):r.type&&r.type.abiName!==void 0?(t=r.type,e=r.type.abiName):(t=Ce(r.object),t&&(e=t.abiName,Array.isArray(r.object)&&(e+="[]")));const n=r.customTypes?r.customTypes.slice():[];if(t)n.unshift(t);else if(e){const p=new W.ResolvedType(e).name;t=n.find(w=>w.abiName===p)}let o;if(r.abi&&e)o=W.from(r.abi).resolveType(e);else if(t){const p=O(t);o=p.abi.resolveType(e||t.abiName),n.push(...p.types)}else if(e)o=new W.ResolvedType(e);else throw new Error("Unable to determine the type of the object to be encoded. To encode custom ABI types you must pass the type argument.");const a=bt(n),l=r.encoder||new Ke;r.metadata&&(l.metadata=r.metadata);const h={types:a,encoder:l,codingPath:[{field:"root",type:o}]};try{ke(r.object,o,h)}catch(p){throw new ze(h,p)}return S.from(l.getData())}function ke(r,t,e){const n=r!=null;if(t.isOptional&&(e.encoder.writeByte(n?1:0),!n))return;if(t.isArray){if(!Array.isArray(r))throw new Error(`Expected array for: ${t.typeName}`);const a=r.length;e.encoder.writeVaruint32(a);for(let l=0;l<a;l++)e.codingPath.push({field:l,type:t}),o(r[l]),e.codingPath.pop()}else o(r);function o(a){const l=e.types[t.name];if(t.ref&&!l){ke(a,t.ref,e);return}if(!n){if(t.isExtension)return;throw new Error(`Found ${a} for non-optional type: ${t.typeName}`)}if(l&&l.toABI)l.toABI(a,e.encoder);else if(typeof a.toABI=="function"&&a.constructor.abiName===t.name)a.toABI(e.encoder);else if(t.fields){if(typeof a!="object")throw new Error(`Expected object for: ${t.name}`);const h=t.allFields;if(!h)throw new Error("Invalid struct fields");for(const p of h)e.codingPath.push({field:p.name,type:p.type}),ke(a[p.name],p.type,e),e.codingPath.pop()}else if(t.variant){let h;Array.isArray(a)&&a.length===2&&typeof a[0]=="string"?(h=a[0],a=a[1]):A(a,Ft)?(h=a.variantName,a=a.value):h=Oe(a);const p=t.variant.findIndex(K=>K.typeName===h);if(p===-1){const K=t.variant.map(q=>`'${q.typeName}'`).join(", ");throw new Error(`Unknown variant type '${h}', expected one of ${K}`)}const w=t.variant[p];e.encoder.writeVaruint32(p),e.codingPath.push({field:`v${p}`,type:w}),ke(a,w,e),e.codingPath.pop()}else{if(!l)throw new Error(t.name==="any"?"Unable to encode any type to binary":"Unknown type");const h=l.from(a);if(!h.toABI)throw new Error(`Invalid type ${t.name}, no encoding methods implemented`);h.toABI(e.encoder)}}}class Ke{constructor(t=1024){this.pageSize=t,this.pos=0,this.textEncoder=new TextEncoder,this.metadata={};const e=new ArrayBuffer(t);this.data=new DataView(e),this.array=new Uint8Array(e)}ensure(t){if(this.data.byteLength>=this.pos+t)return;const e=Math.ceil(t/this.pageSize),n=this.data.byteLength+this.pageSize*e,o=new ArrayBuffer(n),a=new DataView(o),l=new Uint8Array(o);l.set(this.array),this.data=a,this.array=l}writeByte(t){this.ensure(1),this.array[this.pos++]=t}writeArray(t){const e=t.length;this.ensure(e),this.array.set(t,this.pos),this.pos+=e}writeFloat(t,e){switch(this.ensure(e),e){case 4:this.data.setFloat32(this.pos,t,!0);break;case 8:this.data.setFloat64(this.pos,t,!0);break;default:throw new Error("Invalid float size")}this.pos+=e}writeVaruint32(t){for(this.ensure(4);;)if(t>>>7)this.array[this.pos++]=128|t&127,t=t>>>7;else{this.array[this.pos++]=t;break}}writeVarint32(t){this.writeVaruint32(t<<1^t>>31)}writeString(t){const e=this.textEncoder.encode(t);this.writeVaruint32(e.byteLength),this.writeArray(e)}getData(){return new Uint8Array(this.array.buffer,this.array.byteOffset,this.pos)}getBytes(){return new S(this.getData())}}Ke.__className="ABIEncoder";class i{constructor(t){const e=this.constructor;for(const n of e.structFields)this[n.name]=t[n.name]}static from(t){return t[Dt]===!0?new this(t):A(t,this)?t:Ct({object:t,type:this})}static get structFields(){const t=[],e=n=>{n.abiBase&&e(n.abiBase);for(const o of n.abiFields||[])t.push(o)};return e(this),t}equals(t){const e=this.constructor;return t.constructor&&typeof t.constructor.abiName=="string"&&t.constructor.abiName!==e.abiName?!1:rt({object:this}).equals(rt({object:e.from(t)}))}toJSON(){const t=this.constructor,e={};for(const n of t.structFields)e[n.name]=this[n.name];return e}}i.abiName="__struct",function(r){const t=Symbol("FieldsOwner");function e(o){return function(a){return a.abiName=o,a}}r.type=e;function n(o,a={}){return(l,h)=>{const p=l.constructor;p.abiFields?p.abiFields[t]!==p&&(p.abiBase=p.abiFields[t],p.abiFields=[],p.abiFields[t]=p):(p.abiFields=[],p.abiFields[t]=p),p.abiFields.push({...a,name:h,type:o})}}r.field=n}(i||(i={}));function ir(r){return function(t){return t.abiAlias={type:Object.getPrototypeOf(t.prototype).constructor},t.abiName=r,t}}class Ft{constructor(t){const e=this.constructor.abiVariant;this.value=t[1];const n=e.map(j).findIndex(o=>o===t[0]);if(0>n||e.length<=n)throw new Error(`Unknown variant ${t[0]}`);this.variantIdx=n}static from(t){return t[Dt]?new this(t):A(t,this)?t:Ct({object:t,type:this})}equals(t){const n=this.constructor.from(t);return this.variantIdx!==n.variantIdx?!1:rt({object:this}).equals(rt({object:n}))}get variantName(){const t=this.constructor.abiVariant[this.variantIdx];return j(t)}toJSON(){return[this.variantName,this.value]}}Ft.abiName="__variant",Ft.abiVariant=[],function(r){function t(e,n){return function(o){return o.abiName=e,o.abiVariant=n.map(Y),o}}r.type=t}(Ft||(Ft={}));class se{constructor(t){if(!Number.isFinite(t))throw new Error("Invalid number");this.value=t}static from(t){return A(t,this)?t:(typeof t=="string"?t=Number.parseFloat(t):A(t,se)&&(t=t.value),new this(t))}static fromABI(t){return new this(t.readFloat(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){const t=vt(this.byteWidth),e=new oe(t);return this.fromABI(e)}equals(t){const e=this.constructor;return this.value===e.from(t).value}toABI(t){const e=this.constructor;t.writeFloat(this.value,e.byteWidth)}toString(){return this.value.toString()}toJSON(){return this.toString()}}se.abiName="__float";class De extends se{toString(){return this.value.toFixed(7)}}De.abiName="float32",De.byteWidth=4;class xe extends se{}xe.abiName="float64",xe.byteWidth=8;class Ee{constructor(t){if(t.array.length!==16)throw new Error("Invalid float128");this.data=t}static from(t){return A(t,this)?t:(typeof t=="string"&&t.startsWith("0x")&&(t=t.slice(2)),new this(S.from(t)))}static fromABI(t){return new this(new S(t.readArray(this.byteWidth)))}static random(){const t=vt(16),e=new oe(t);return this.fromABI(e)}equals(t){const e=this.constructor;return this.data.equals(e.from(t).data)}toABI(t){t.writeArray(this.data.array)}toString(){return"0x"+this.data.hexString}toJSON(){return this.toString()}}Ee.abiName="float128",Ee.byteWidth=16;class I{constructor(t){this.value=t}get rawValue(){return this.value}static from(t){if(A(t,I))return t;if(typeof t=="string")return new I(or(t));if(A(t,f))return new I(t);throw new Error("Invalid name")}static fromABI(t){return new I(f.fromABI(t))}static abiDefault(){return new this(f.from(0))}equals(t){return this.value.equals(I.from(t).value)}toString(){return sr(this.value)}toABI(t){this.value.toABI(t)}toJSON(){return this.toString()}}I.abiName="name",I.pattern=/^[a-z1-5.]{0,13}$/;function or(r){function t(o){return o>="a".charCodeAt(0)&&o<="z".charCodeAt(0)?o-"a".charCodeAt(0)+6:o>="1".charCodeAt(0)&&o<="5".charCodeAt(0)?o-"1".charCodeAt(0)+1:0}const e=new Uint8Array(8);let n=63;for(let o=0;o<r.length;++o){let a=t(r.charCodeAt(o));n<5&&(a=a<<1);for(let l=4;l>=0;--l)n>=0&&(e[Math.floor(n/8)]|=(a>>l&1)<<n%8,--n)}return f.from(e)}function sr(r){const t=r.value.toArray("le",8);let e="";for(let n=63;n>=0;){let o=0;for(let a=0;a<5;++a)n>=0&&(o=o<<1|t[Math.floor(n/8)]>>n%8&1,--n);o>=6?e+=String.fromCharCode(o+"a".charCodeAt(0)-6):o>=1?e+=String.fromCharCode(o+"1".charCodeAt(0)-1):e+="."}for(;e.endsWith(".");)e=e.substr(0,e.length-1);return e}class Mt{static from(t){return A(t,this)?t:A(t,Mt)?this.fromMilliseconds(t.toMilliseconds()):A(t,Date)?this.fromDate(t):typeof t=="string"?this.fromString(t):this.fromInteger(t)}static fromString(t){const e=Date.parse(t+"Z");if(!Number.isFinite(e))throw new Error("Invalid date string");return this.fromMilliseconds(e)}static fromDate(t){return this.fromMilliseconds(t.getTime())}static abiDefault(){return this.from(0)}toABI(t){this.value.toABI(t)}equals(t){const e=this.constructor;return this.toMilliseconds()===e.from(t).toMilliseconds()}toMilliseconds(){throw new Error("Not implemented")}toDate(){return new Date(this.toMilliseconds())}toJSON(){return this.toString()}}Mt.abiName="__time_point_base";class Je extends Mt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(G.from(Math.round(t*1e3)))}static fromInteger(t){return new this(G.from(t))}static fromABI(t){return new this(G.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.dividing(1e3,"round"))}}Je.abiName="time_point";class Ne extends Mt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(c.from(Math.round(t/1e3)))}static fromInteger(t){return new this(c.from(t))}static fromABI(t){return new this(c.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-5)}toMilliseconds(){return Number(this.value.cast(f).multiplying(1e3))}}Ne.abiName="time_point_sec";class Ie extends Mt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(c.from(Math.round((t-9466848e5)/500)))}static fromInteger(t){return new this(c.from(t))}static fromABI(t){return new this(c.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.cast(f).multiplying(500).adding(9466848e5))}}Ie.abiName="block_timestamp_type";class W{constructor(t){this.version=t.version||W.version,this.types=t.types||[],this.variants=t.variants||[],this.structs=t.structs||[],this.actions=t.actions||[],this.tables=t.tables||[],this.ricardian_clauses=t.ricardian_clauses||[]}static from(t){return A(t,W)?t:typeof t=="string"?new W(JSON.parse(t)):new W(t)}static fromABI(t){const e=t.readString(),n=[],o=t.readVaruint32();for(let g=0;g<o;g++)n.push({new_type_name:t.readString(),type:t.readString()});const a=[],l=t.readVaruint32();for(let g=0;g<l;g++){const x=t.readString(),T=t.readString(),R=t.readVaruint32(),it=[];for(let Ot=0;Ot<R;Ot++)it.push({name:t.readString(),type:t.readString()});a.push({base:T,name:x,fields:it})}const h=[],p=t.readVaruint32();for(let g=0;g<p;g++){const x=I.fromABI(t),T=t.readString(),R=t.readString();h.push({name:x,type:T,ricardian_contract:R})}const w=[],K=t.readVaruint32();for(let g=0;g<K;g++){const x=I.fromABI(t),T=t.readString(),R=[],it=t.readVaruint32();for(let _e=0;_e<it;_e++)R.push(t.readString());const Ot=[],wr=t.readVaruint32();for(let _e=0;_e<wr;_e++)Ot.push(t.readString());const _r=t.readString();w.push({name:x,index_type:T,key_names:R,key_types:Ot,type:_r})}const q=[],Rt=t.readVaruint32();for(let g=0;g<Rt;g++){const x=t.readString(),T=t.readString();q.push({id:x,body:T})}const C=t.readVaruint32();for(let g=0;g<C;g++)t.advance(8),t.advance(t.readVaruint32());const b=t.readVaruint32();for(let g=0;g<b;g++)t.advance(2),t.advance(t.readVaruint32());const k=[];if(t.canRead()){const g=t.readVaruint32();for(let x=0;x<g;x++){const T=t.readString(),R=[],it=t.readVaruint32();for(let Ot=0;Ot<it;Ot++)R.push(t.readString());k.push({name:T,types:R})}}return new W({version:e,types:n,structs:a,actions:h,tables:w,ricardian_clauses:q,variants:k})}toABI(t){t.writeString(this.version),t.writeVaruint32(this.types.length);for(const e of this.types)t.writeString(e.new_type_name),t.writeString(e.type);t.writeVaruint32(this.structs.length);for(const e of this.structs){t.writeString(e.name),t.writeString(e.base),t.writeVaruint32(e.fields.length);for(const n of e.fields)t.writeString(n.name),t.writeString(n.type)}t.writeVaruint32(this.actions.length);for(const e of this.actions)I.from(e.name).toABI(t),t.writeString(e.type),t.writeString(e.ricardian_contract);t.writeVaruint32(this.tables.length);for(const e of this.tables){I.from(e.name).toABI(t),t.writeString(e.index_type),t.writeVaruint32(e.key_names.length);for(const n of e.key_names)t.writeString(n);t.writeVaruint32(e.key_types.length);for(const n of e.key_types)t.writeString(n);t.writeString(e.type)}t.writeVaruint32(this.ricardian_clauses.length);for(const e of this.ricardian_clauses)t.writeString(e.id),t.writeString(e.body);t.writeVaruint32(0),t.writeVaruint32(0),t.writeVaruint32(this.variants.length);for(const e of this.variants){t.writeString(e.name),t.writeVaruint32(e.types.length);for(const n of e.types)t.writeString(n)}}resolveType(t){const e={};return this.resolve({name:t,types:e},{id:0})}resolveAll(){const t={},e={id:0};return{types:this.types.map(n=>this.resolve({name:n.new_type_name,types:t},e)),variants:this.variants.map(n=>this.resolve({name:n.name,types:t},e)),structs:this.structs.map(n=>this.resolve({name:n.name,types:t},e))}}resolve({name:t,types:e},n){const o=e[t];if(o)return o;const a=new W.ResolvedType(t,++n.id);e[a.typeName]=a;const l=this.types.find(w=>w.new_type_name==a.name);if(l)return a.ref=this.resolve({name:l.type,types:e},n),a;const h=this.getStruct(a.name);if(h)return h.base&&(a.base=this.resolve({name:h.base,types:e},n)),a.fields=h.fields.map(w=>({name:w.name,type:this.resolve({name:w.type,types:e},n)})),a;const p=this.getVariant(a.name);return p&&(a.variant=p.types.map(w=>this.resolve({name:w,types:e},n))),a}getStruct(t){return this.structs.find(e=>e.name==t)}getVariant(t){return this.variants.find(e=>e.name==t)}getActionType(t){const e=I.from(t).toString(),n=this.actions.find(o=>o.name.toString()===e);if(n)return n.type}equals(t){const e=W.from(t);return this.version!=e.version||this.types.length!=e.types.length||this.structs.length!=e.structs.length||this.actions.length!=e.actions.length||this.tables.length!=e.tables.length||this.ricardian_clauses.length!=e.ricardian_clauses.length||this.variants.length!=e.variants.length?!1:rt({object:this}).equals(rt({object:e}))}toJSON(){return{version:this.version,types:this.types,structs:this.structs,actions:this.actions,tables:this.tables,ricardian_clauses:this.ricardian_clauses,error_messages:[],abi_extensions:[],variants:this.variants}}}W.abiName="abi",W.version="eosio::abi/1.1",function(r){class t{constructor(n,o=0){let a=n;a.endsWith("$")?(a=a.slice(0,-1),this.isExtension=!0):this.isExtension=!1,a.endsWith("?")?(a=a.slice(0,-1),this.isOptional=!0):this.isOptional=!1,a.endsWith("[]")?(a=a.slice(0,-2),this.isArray=!0):this.isArray=!1,this.id=o,this.name=a}get typeName(){let n=this.name;return this.isArray&&(n+="[]"),this.isOptional&&(n+="?"),this.isExtension&&(n+="$"),n}get allFields(){let n=this;const o=[],a=new Set;do{if(!n.fields||a.has(n.name))return;for(let l=n.fields.length-1;l>=0;l--)o.unshift(n.fields[l]);a.add(n.name),n=n.base}while(n!==void 0);return o}}r.ResolvedType=t}(W||(W={}));class V{constructor(t,e){this.units=t,this.symbol=e}static from(t,e){if(A(t,V))return t;switch(typeof t){case"number":if(!e)throw new Error("Symbol is required when creating Asset from number");return this.fromFloat(t,e);case"string":return this.fromString(t);default:throw new Error("Invalid asset")}}static fromString(t){const e=(typeof t=="string"?t:"").split(" ");if(e.length!==2)throw new Error("Invalid asset string");const n=e[0].replace(".",""),o=(e[0].split(".")[1]||"").length,a=V.Symbol.fromParts(e[1],o);return new V(G.from(n),a)}static fromFloat(t,e){const n=V.Symbol.from(e);return new V(n.convertFloat(t),n)}static fromUnits(t,e){return new V(G.from(t),V.Symbol.from(e))}static fromABI(t){const e=G.fromABI(t),n=V.Symbol.fromABI(t);return new V(e,n)}static abiDefault(){return new this(G.from(0),V.Symbol.abiDefault())}equals(t){const{symbol:e,units:n}=V.from(t);return this.symbol.value.equals(e.value)&&this.units.equals(n)}get value(){return this.symbol.convertUnits(this.units)}set value(t){this.units=this.symbol.convertFloat(t)}toABI(t){this.units.toABI(t),this.symbol.toABI(t)}toString(){const t=this.units.toString().split("");let e=!1;t[0]==="-"&&(e=!0,t.shift());const n=this.symbol.precision;for(;t.length<=n;)t.unshift("0");n>0&&t.splice(t.length-n,0,".");let o=t.join("");return e&&(o="-"+o),o+" "+this.symbol.name}toJSON(){return this.toString()}}V.abiName="asset",function(r){class t{constructor(o){if(He(o)>t.maxPrecision)throw new Error("Invalid asset symbol, precision too large");if(!t.symbolNamePattern.test(Ze(o)))throw new Error("Invalid asset symbol, name must be uppercase A-Z");this.value=o}static from(o){if(A(o,t))return o;if(A(o,f))return new t(o);const a=o.split(",");if(a.length!==2)throw new Error("Invalid symbol string");const l=Number.parseInt(a[0]);return t.fromParts(a[1],l)}static fromParts(o,a){return new t(ar(o,a))}static fromABI(o){return new t(f.fromABI(o))}static abiDefault(){return this.from("4,SYS")}equals(o){return this.value.equals(t.from(o).value)}get name(){return Ze(this.value)}get precision(){return He(this.value)}get code(){return new e(f.from(this.value.value.clone().iushrn(8)))}toABI(o){this.value.toABI(o)}convertUnits(o){return o.value.toNumber()/Math.pow(10,this.precision)}convertFloat(o){return G.from(o.toFixed(this.precision).replace(".",""))}toString(){return`${this.precision},${this.name}`}toJSON(){return this.toString()}}t.abiName="symbol",t.symbolNamePattern=/^[A-Z]{0,7}$/,t.maxPrecision=18,r.Symbol=t;class e{constructor(o){this.value=o}static from(o){return A(o,e)?o:(typeof o=="string"&&(o=f.from(Qe(o))),new this(f.from(o)))}static fromABI(o){return new e(f.fromABI(o))}static abiDefault(){return this.from("SYS")}equals(o){return this.value.equals(e.from(o).value)}toABI(o){this.value.toABI(o)}toString(){return Ye(this.value.value.toArray("be"))}toJSON(){return this.toString()}}e.abiName="symbol_code",r.SymbolCode=e}(V||(V={}));class ae{constructor(t,e){this.quantity=t,this.contract=e}static from(t){return A(t,ae)?t:new this(V.from(t.quantity),I.from(t.contract))}static fromABI(t){return new ae(V.fromABI(t),I.fromABI(t))}equals(t){return this.quantity.equals(t.quantity)&&this.contract.equals(t.contract)}toABI(t){this.quantity.toABI(t),this.contract.toABI(t)}toJSON(){return{quantity:this.quantity,contract:this.contract}}}ae.abiName="extended_asset";function He(r){return r.value.and(f.from(255).value).toNumber()}function Ze(r){const t=r.value.toArray("be").slice(0,-1);return Ye(t)}function Ye(r){return r.map(t=>String.fromCharCode(t)).reverse().join("")}function ar(r,t){const e=Qe(r),n=new Uint8Array(e.length+1);return n[0]=t,n.set(e,1),f.from(n)}function Qe(r){const t=Math.min(r.length,7),e=new Uint8Array(t);for(let n=0;n<t;n++)e[n]=r.charCodeAt(n);return e}var H;(function(r){let t;(function(b){b.E_CHECKSUM="E_CHECKSUM",b.E_INVALID="E_INVALID"})(t=r.ErrorCode||(r.ErrorCode={}));class e extends Error{constructor(k,g,x={}){super(k),this.code=g,this.info=x}}e.__className="DecodingError",r.DecodingError=e;const n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",o=new Int16Array(255).fill(-1);for(let b=0;b<58;++b)o[n.charCodeAt(b)]=b;function a(b,k){if(k==null)return q(b);const g=new Uint8Array(k);for(let x=0;x<b.length;++x){let T=o[b.charCodeAt(x)];if(T<0)throw new e("Invalid Base58 character encountered",t.E_INVALID,{char:b[x]});for(let R=0;R<k;++R){const it=g[R]*58+T;g[R]=it,T=it>>8}if(T)throw new e("Base58 value is out of range",t.E_INVALID)}return g.reverse(),new S(g)}r.decode=a;function l(b,k){const g=a(b,k!=null?k+4:k),x=g.array.subarray(0,-4),T=g.array.subarray(-4),R=C(x);if(!Yt(T,R))throw new e("Checksum mismatch",t.E_CHECKSUM,{actual:R,expected:T,data:x,hash:"double_sha256"});return new S(x)}r.decodeCheck=l;function h(b,k,g){const x=a(b,k!=null?k+4:k),T=x.array.subarray(0,-4),R=x.array.subarray(-4),it=Rt(T,g);if(!Yt(R,it))throw new e("Checksum mismatch",t.E_CHECKSUM,{actual:it,expected:R,data:T,hash:"ripemd160"});return new S(T)}r.decodeRipemd160Check=h;function p(b){b=S.from(b);const k=[];for(const g of b.array){let x=g;for(let T=0;T<k.length;++T){const R=(o[k[T]]<<8)+x;k[T]=n.charCodeAt(R%58),x=R/58|0}for(;x;)k.push(n.charCodeAt(x%58)),x=x/58|0}for(const g of b.array){if(g)break;k.push("1".charCodeAt(0))}return k.reverse(),String.fromCharCode(...k)}r.encode=p;function w(b){return b=S.from(b),b=b.appending(C(b.array)),p(b)}r.encodeCheck=w;function K(b,k){return b=S.from(b),b=b.appending(Rt(b.array,k)),p(b)}r.encodeRipemd160Check=K;function q(b){const k=[];for(let g=0;g<b.length;++g){let x=o[b.charCodeAt(g)];if(x<0)throw new e("Invalid Base58 character encountered",t.E_INVALID,{char:b[g]});for(let T=0;T<k.length;++T){const R=k[T]*58+x;k[T]=R&255,x=R>>8}x&&k.push(x)}for(const g of b)if(g==="1")k.push(0);else break;return k.reverse(),S.from(k)}function Rt(b,k){const g=(0,ut.ripemd160)().update(b);return k&&g.update(k),new Uint8Array(g.digest().slice(0,4))}function C(b){const k=(0,ut.sha256)().update(b).digest(),g=(0,ut.sha256)().update(k).digest();return new Uint8Array(g.slice(0,4))}})(H||(H={}));class Z{constructor(t,e){this.type=t,this.data=e}static from(t){if(A(t,Z))return t;if(typeof t=="object"&&t.type&&t.compressed)return new Z(E.from(t.type),new S(t.compressed));if(typeof t!="string")throw new Error("Invalid public key");if(t.startsWith("PUB_")){const e=t.split("_");if(e.length!==3)throw new Error("Invalid public key string");const n=E.from(e[1]),o=n===E.K1||n===E.R1?33:void 0,a=H.decodeRipemd160Check(e[2],o,n);return new Z(n,a)}else if(t.length>=50){const e=H.decodeRipemd160Check(t.slice(-50));return new Z(E.K1,e)}else throw new Error("Invalid public key string")}static fromABI(t){const e=E.from(t.readByte());if(e==E.WA){const n=t.getPosition();t.advance(33),t.advance(1),t.advance(t.readVaruint32());const o=t.getPosition()-n;t.setPosition(n);const a=S.from(t.readArray(o));return new Z(E.WA,a)}return new Z(e,new S(t.readArray(33)))}equals(t){const e=Z.from(t);return this.type===e.type&&this.data.equals(e.data)}toLegacyString(t="EOS"){if(this.type!==E.K1)throw new Error("Unable to create legacy formatted string for non-K1 key");return`${t}${H.encodeRipemd160Check(this.data)}`}toString(){return`PUB_${this.type}_${H.encodeRipemd160Check(this.data,this.type)}`}toABI(t){t.writeByte(E.indexFor(this.type)),t.writeArray(this.data.array)}toJSON(){return this.toString()}}Z.abiName="public_key";const je={};function $t(r){let t=je[r];if(!t)if(r==="K1")t=je[r]=new ve.ec("secp256k1");else if(r==="R1")t=je[r]=new ve.ec("p256");else throw new Error(`Unknown curve type: ${r}`);return t}function cr(r,t,e){const n=$t(e),o=r[0]-31,a=r.subarray(1,33),l=r.subarray(33),h=n.recoverPubKey(t,{r:a,s:l},o);return new Uint8Array(h.encodeCompressed())}function ur(r,t,e,n){const o=$t(n),a=r.subarray(1,33),l=r.subarray(33);return o.verify(t,{r:a,s:l},e)}class at{constructor(t,e){this.type=t,this.data=e}static from(t){if(A(t,at))return t;if(typeof t=="object"&&t.r&&t.s){const e=new Uint8Array(65);let n=t.recid;const o=E.from(t.type);return(t.type===E.K1||t.type===E.R1)&&(n+=31),e[0]=n,e.set(t.r,1),e.set(t.s,33),new at(o,new S(e))}if(typeof t!="string")throw new Error("Invalid signature");if(t.startsWith("SIG_")){const e=t.split("_");if(e.length!==3)throw new Error("Invalid signature string");const n=E.from(e[1]),o=n===E.K1||n===E.R1?65:void 0,a=H.decodeRipemd160Check(e[2],o,n);return new at(n,a)}else throw new Error("Invalid signature string")}static fromABI(t){const e=E.from(t.readByte());if(e===E.WA){const n=t.getPosition();t.advance(65),t.advance(t.readVaruint32()),t.advance(t.readVaruint32());const o=t.getPosition()-n;t.setPosition(n);const a=S.from(t.readArray(o));return new at(E.WA,a)}return new at(e,new S(t.readArray(65)))}equals(t){const e=at.from(t);return this.type===e.type&&this.data.equals(e.data)}recoverDigest(t){t=B.from(t);const e=cr(this.data.array,t.array,this.type);return Z.from({compressed:e,type:this.type})}recoverMessage(t){return this.recoverDigest(B.hash(t))}verifyDigest(t,e){return t=B.from(t),ur(this.data.array,t.array,e.data.array,this.type)}verifyMessage(t,e){return this.verifyDigest(B.hash(t),e)}toString(){return`SIG_${this.type}_${H.encodeRipemd160Check(this.data,this.type)}`}toABI(t){t.writeByte(E.indexFor(this.type)),t.writeArray(this.data.array)}toJSON(){return this.toString()}}at.abiName="signature";function fr(r,t){const o=$t(t).keyFromPrivate(r).getPublic();return new Uint8Array(o.encodeCompressed())}function lr(r,t,e){const n=$t(e),o=n.keyFromPrivate(r),a=n.keyFromPublic(t).getPublic();return o.derive(a).toArrayLike(Uint8Array,"be")}function dr(r,t,e){const o=$t(e).keyFromPrivate(r);let a,l,h;if(e==="K1"){let p=1;do a=o.sign(t,{canonical:!0,pers:[p++]}),l=a.r.toArrayLike(Uint8Array,"be",32),h=a.s.toArrayLike(Uint8Array,"be",32);while(!pr(l,h))}else a=o.sign(t,{canonical:!0}),l=a.r.toArrayLike(Uint8Array,"be",32),h=a.s.toArrayLike(Uint8Array,"be",32);return{type:e,r:l,s:h,recid:a.recoveryParam||0}}function pr(r,t){return!(r[0]&128)&&!(r[0]===0&&!(r[1]&128))&&!(t[0]&128)&&!(t[0]===0&&!(t[1]&128))}function hr(r){return $t(r).genKeyPair().getPrivate().toArrayLike(Uint8Array,"be",32)}class Te{constructor(t,e){if((t===E.K1||t===E.R1)&&e.length!==32)throw new Error("Invalid private key length");this.type=t,this.data=e}static from(t){return A(t,Te)?t:this.fromString(t)}static fromString(t,e=!1){try{const{type:n,data:o}=yr(t);return new this(n,o)}catch(n){if(n.message=`Invalid private key (${n.message})`,e&&A(n,H.DecodingError)&&n.code===H.ErrorCode.E_CHECKSUM){const o=t.startsWith("PVT_R1")?E.R1:E.K1,a=new S(n.info.data);return a.length===33&&a.dropFirst(),a.zeropad(32,!0),new this(o,a)}throw n}}static generate(t){return new Te(E.from(t),new S(hr(t)))}signDigest(t){return t=B.from(t),at.from(dr(this.data.array,t.array,this.type))}signMessage(t){return this.signDigest(B.hash(t))}sharedSecret(t){const e=lr(this.data.array,t.data.array,this.type);return St.hash(e)}toPublic(){const t=fr(this.data.array,this.type);return Z.from({compressed:t,type:this.type})}toWif(){if(this.type!==E.K1)throw new Error("Unable to generate WIF for non-k1 key");return H.encodeCheck(S.from([128]).appending(this.data))}toString(){return`PVT_${this.type}_${H.encodeRipemd160Check(this.data,this.type)}`}toJSON(){return this.toString()}}function yr(r){const t=typeof r;if(t!=="string")throw new Error(`Expected string, got ${t}`);if(r.startsWith("PVT_")){const e=r.split("_");if(e.length!==3)throw new Error("Invalid PVT format");const n=E.from(e[1]);let o;switch(n){case E.K1:case E.R1:o=32;break}const a=H.decodeRipemd160Check(e[2],o,n);return{type:n,data:a}}else{const e=E.K1,n=H.decodeCheck(r);if(n.array[0]!==128)throw new Error("Invalid WIF");return{type:e,data:n.droppingFirst()}}}var Ue;let qt=Ue=class extends i{static from(t){if(typeof t=="string"){const e=t.split("@");if(e.length!==2&&e[0].length>0&&e[1].length>0)throw new Error("Invalid permission level string, should be in the format <actor>@<permission>");t={actor:e[0],permission:e[1]}}return super.from(t)}equals(t){const e=Ue.from(t);return this.actor.equals(e.actor)&&this.permission.equals(e.permission)}toString(){return`${this.actor}@${this.permission}`}};(0,s.gn)([i.field("name")],qt.prototype,"actor",void 0),(0,s.gn)([i.field("name")],qt.prototype,"permission",void 0),qt=Ue=(0,s.gn)([i.type("permission_level")],qt);var Ve;let wt=Ve=class extends i{static from(t,e){const n=t.data;if(!S.isBytes(n)){let o;if(e)o=W.from(e).getActionType(t.name);else if(!n.constructor||n.constructor.abiName===void 0)throw new Error("Missing ABI definition when creating action with untyped action data");t={...t,data:rt({object:n,type:o,abi:e})}}return super.from(t)}equals(t){const e=Ve.from(t);return this.account.equals(e.account)&&this.name.equals(e.name)&&qe(this.authorization,e.authorization)&&this.data.equals(e.data)}decodeData(t){if(typeof t=="string"||t.abiName)return Ct({data:this.data,type:t});{const e=W.from(t),n=e.getActionType(this.name);if(!n)throw new Error(`Action ${this.name} does not exist in provided ABI`);return Ct({data:this.data,type:n,abi:e})}}};(0,s.gn)([i.field("name")],wt.prototype,"account",void 0),(0,s.gn)([i.field("name")],wt.prototype,"name",void 0),(0,s.gn)([i.field(qt,{array:!0})],wt.prototype,"authorization",void 0),(0,s.gn)([i.field("bytes")],wt.prototype,"data",void 0),wt=Ve=(0,s.gn)([i.type("action")],wt);var We;let ce=class extends i{};(0,s.gn)([i.field("uint16")],ce.prototype,"type",void 0),(0,s.gn)([i.field("bytes")],ce.prototype,"data",void 0),ce=(0,s.gn)([i.type("transaction_extension")],ce);let dt=class extends i{static from(t){return super.from({max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,...t})}};(0,s.gn)([i.field("time_point_sec")],dt.prototype,"expiration",void 0),(0,s.gn)([i.field("uint16")],dt.prototype,"ref_block_num",void 0),(0,s.gn)([i.field("uint32")],dt.prototype,"ref_block_prefix",void 0),(0,s.gn)([i.field("varuint32")],dt.prototype,"max_net_usage_words",void 0),(0,s.gn)([i.field("uint8")],dt.prototype,"max_cpu_usage_ms",void 0),(0,s.gn)([i.field("varuint32")],dt.prototype,"delay_sec",void 0),dt=(0,s.gn)([i.type("transaction_header")],dt);let ct=We=class extends dt{static from(t,e){const n=p=>{if(e)return Array.isArray(e)?e.filter(w=>I.from(w.contract).equals(p)).map(({abi:w})=>w)[0]:e},o=p=>wt.from(p,n(p.account)),a=(t.actions||[]).map(o),l=(t.context_free_actions||[]).map(o),h={transaction_extensions:[],...t,context_free_actions:l,actions:a};return super.from(h)}equals(t){const e=We.from(t);return this.id.equals(e.id)}get id(){return B.hash(rt({object:this}))}signingDigest(t){const e=this.signingData(t);return B.hash(e)}signingData(t){let e=S.from(B.from(t).array);return e=e.appending(rt({object:this})),e=e.appending(new Uint8Array(32)),e}};(0,s.gn)([i.field(wt,{array:!0})],ct.prototype,"context_free_actions",void 0),(0,s.gn)([i.field(wt,{array:!0})],ct.prototype,"actions",void 0),(0,s.gn)([i.field(ce,{array:!0})],ct.prototype,"transaction_extensions",void 0),ct=We=(0,s.gn)([i.type("transaction")],ct);let pt=class extends ct{get transaction(){return ct.from({...this,signatures:void 0,context_free_data:void 0})}get id(){return this.transaction.id}static from(t){return super.from({signatures:[],context_free_data:[],...t})}};(0,s.gn)([i.field("signature[]")],pt.prototype,"signatures",void 0),(0,s.gn)([i.field("bytes[]")],pt.prototype,"context_free_data",void 0),pt=(0,s.gn)([i.type("signed_transaction")],pt);let z=class extends i{static from(t){return super.from({signatures:[],packed_context_free_data:"",compression:0,...t})}static fromSigned(t){const e=ct.from(t);return this.from({signatures:t.signatures,packed_context_free_data:rt({object:t.context_free_data,type:"bytes[]"}),packed_trx:rt({object:e})})}getTransaction(){if(Number(this.compression)!==0)throw new Error("Transaction compression not supported yet");return Ct({data:this.packed_trx,type:ct})}getSignedTransaction(){const t=this.getTransaction();return pt.from({...t,signatures:this.signatures})}};(0,s.gn)([i.field("signature[]")],z.prototype,"signatures",void 0),(0,s.gn)([i.field("uint8")],z.prototype,"compression",void 0),(0,s.gn)([i.field("bytes")],z.prototype,"packed_context_free_data",void 0),(0,s.gn)([i.field("bytes")],z.prototype,"packed_trx",void 0),z=(0,s.gn)([i.type("packed_transaction")],z);let jt=class extends i{};(0,s.gn)([i.field("string")],jt.prototype,"status",void 0),(0,s.gn)([i.field("uint32")],jt.prototype,"cpu_usage_us",void 0),(0,s.gn)([i.field("uint32")],jt.prototype,"net_usage_words",void 0),jt=(0,s.gn)([i.type("transaction_receipt")],jt);var Fe;let ue=class extends u{};ue=(0,s.gn)([ir("weight_type")],ue);let fe=class extends i{};(0,s.gn)([i.field(Z)],fe.prototype,"key",void 0),(0,s.gn)([i.field(ue)],fe.prototype,"weight",void 0),fe=(0,s.gn)([i.type("key_weight")],fe);let le=class extends i{};(0,s.gn)([i.field(qt)],le.prototype,"permission",void 0),(0,s.gn)([i.field(ue)],le.prototype,"weight",void 0),le=(0,s.gn)([i.type("permission_level_weight")],le);let de=class extends i{};(0,s.gn)([i.field(c)],de.prototype,"wait_sec",void 0),(0,s.gn)([i.field(ue)],de.prototype,"weight",void 0),de=(0,s.gn)([i.type("wait_weight")],de);let Ut=Fe=class extends i{static from(t){if(A(t,Fe))return t;const e=super.from({keys:[],accounts:[],waits:[],...t});return e.sort(),e}get waitThreshold(){return this.waits.reduce((t,e)=>t+e.weight.toNumber(),0)}get keyThreshold(){return this.threshold.toNumber()-this.waitThreshold}keyWeight(t){const e=this.keys.find(({key:n})=>n.equals(t));return e?e.weight.toNumber():0}hasPermission(t,e=!1){const n=e?1:this.keyThreshold;return this.keyWeight(t)>=n}sort(){this.keys.sort((t,e)=>String(t.key).localeCompare(String(e.key))),this.accounts.sort((t,e)=>String(t.permission).localeCompare(String(e.permission))),this.waits.sort((t,e)=>String(t.wait_sec).localeCompare(String(e.wait_sec)))}};(0,s.gn)([i.field(c)],Ut.prototype,"threshold",void 0),(0,s.gn)([i.field(fe,{array:!0})],Ut.prototype,"keys",void 0),(0,s.gn)([i.field(le,{array:!0})],Ut.prototype,"accounts",void 0),(0,s.gn)([i.field(de,{array:!0})],Ut.prototype,"waits",void 0),Ut=Fe=(0,s.gn)([i.type("authority")],Ut);var xt;(function(r){r.encode=rt,r.decode=Ct;function t(o){return O(o).abi}r.synthesize=t;function e(o){return JSON.stringify(o)}r.stringify=e;function n(o){const a=l=>{switch(typeof l){case"boolean":case"number":case"string":return l;case"object":{if(l===null)return l;if(typeof l.toJSON=="function")return a(l.toJSON());if(Array.isArray(l))return l.map(a);const h={};for(const p of Object.keys(l))h[p]=a(l[p]);return h}}};return a(o)}r.objectify=n})(xt||(xt={}));class Xe{constructor(t,e={}){if(t=t.trim(),t.endsWith("/")&&(t=t.slice(0,-1)),this.url=t,e.fetch)this.fetch=e.fetch;else if(typeof window<"u"&&window.fetch)this.fetch=window.fetch.bind(window);else if(typeof L.g<"u"&&L.g.fetch)this.fetch=L.g.fetch.bind(L.g);else throw new Error("Missing fetch")}async call(t,e){const n=this.url+t,o=await this.fetch(n,{method:"POST",body:e!==void 0?JSON.stringify(e):void 0}),a=await o.text();let l;try{l=JSON.parse(a)}catch{}const h={};for(const[p,w]of Object.entries(o.headers))h[p]=w;return{headers:h,status:o.status,json:l,text:a}}}let Vt=class extends i{};(0,s.gn)([i.field("name")],Vt.prototype,"perm_name",void 0),(0,s.gn)([i.field("name")],Vt.prototype,"parent",void 0),(0,s.gn)([i.field(Ut)],Vt.prototype,"required_auth",void 0),Vt=(0,s.gn)([i.type("account_permission")],Vt);let Et=class extends i{};(0,s.gn)([i.field("int64")],Et.prototype,"used",void 0),(0,s.gn)([i.field("int64")],Et.prototype,"available",void 0),(0,s.gn)([i.field("int64")],Et.prototype,"max",void 0),Et=(0,s.gn)([i.type("account_resource_limit")],Et);let Nt=class extends i{};(0,s.gn)([i.field("name")],Nt.prototype,"owner",void 0),(0,s.gn)([i.field("asset")],Nt.prototype,"net_weight",void 0),(0,s.gn)([i.field("asset")],Nt.prototype,"cpu_weight",void 0),(0,s.gn)([i.field("uint64")],Nt.prototype,"ram_bytes",void 0),Nt=(0,s.gn)([i.type("account_total_resources")],Nt);let It=class extends i{};(0,s.gn)([i.field("name")],It.prototype,"from",void 0),(0,s.gn)([i.field("name")],It.prototype,"to",void 0),(0,s.gn)([i.field("asset")],It.prototype,"net_weight",void 0),(0,s.gn)([i.field("asset")],It.prototype,"cpu_weight",void 0),It=(0,s.gn)([i.type("account_self_delegated_bandwidth")],It);let Tt=class extends i{};(0,s.gn)([i.field("name")],Tt.prototype,"owner",void 0),(0,s.gn)([i.field("time_point")],Tt.prototype,"request_time",void 0),(0,s.gn)([i.field("asset")],Tt.prototype,"net_amount",void 0),(0,s.gn)([i.field("asset")],Tt.prototype,"cpu_amount",void 0),Tt=(0,s.gn)([i.type("account_refund_request")],Tt);let nt=class extends i{};(0,s.gn)([i.field("name")],nt.prototype,"owner",void 0),(0,s.gn)([i.field("name")],nt.prototype,"proxy",void 0),(0,s.gn)([i.field("name",{array:!0})],nt.prototype,"producers",void 0),(0,s.gn)([i.field("int64",{optional:!0})],nt.prototype,"staked",void 0),(0,s.gn)([i.field("bool")],nt.prototype,"is_proxy",void 0),(0,s.gn)([i.field("uint32",{optional:!0})],nt.prototype,"flags1",void 0),(0,s.gn)([i.field("uint32")],nt.prototype,"reserved2",void 0),(0,s.gn)([i.field("string")],nt.prototype,"reserved3",void 0),nt=(0,s.gn)([i.type("account_voter_info")],nt);let Pt=class extends i{};(0,s.gn)([i.field("time_point",{optional:!0})],Pt.prototype,"key",void 0),(0,s.gn)([i.field("int64",{optional:!0})],Pt.prototype,"value",void 0),(0,s.gn)([i.field("time_point",{optional:!0})],Pt.prototype,"first",void 0),(0,s.gn)([i.field("int64",{optional:!0})],Pt.prototype,"second",void 0),Pt=(0,s.gn)([i.type("account_rex_info_maturities")],Pt);let ht=class extends i{};(0,s.gn)([i.field("uint32")],ht.prototype,"version",void 0),(0,s.gn)([i.field("name")],ht.prototype,"owner",void 0),(0,s.gn)([i.field("asset")],ht.prototype,"vote_stake",void 0),(0,s.gn)([i.field("asset")],ht.prototype,"rex_balance",void 0),(0,s.gn)([i.field("int64")],ht.prototype,"matured_rex",void 0),(0,s.gn)([i.field(Pt,{array:!0})],ht.prototype,"rex_maturities",void 0),ht=(0,s.gn)([i.type("account_rex_info")],ht);let D=class extends i{getPermission(t){const e=I.from(t),n=this.permissions.find(o=>o.perm_name.equals(e));if(!n)throw new Error(`Unknown permission ${e} on account ${this.account_name}.`);return n}};(0,s.gn)([i.field("name")],D.prototype,"account_name",void 0),(0,s.gn)([i.field("uint32")],D.prototype,"head_block_num",void 0),(0,s.gn)([i.field("time_point")],D.prototype,"head_block_time",void 0),(0,s.gn)([i.field("bool")],D.prototype,"privileged",void 0),(0,s.gn)([i.field("time_point")],D.prototype,"last_code_update",void 0),(0,s.gn)([i.field("time_point")],D.prototype,"created",void 0),(0,s.gn)([i.field("asset?")],D.prototype,"core_liquid_balance",void 0),(0,s.gn)([i.field("int64")],D.prototype,"ram_quota",void 0),(0,s.gn)([i.field("int64")],D.prototype,"net_weight",void 0),(0,s.gn)([i.field("int64")],D.prototype,"cpu_weight",void 0),(0,s.gn)([i.field(Et)],D.prototype,"net_limit",void 0),(0,s.gn)([i.field(Et)],D.prototype,"cpu_limit",void 0),(0,s.gn)([i.field("uint64")],D.prototype,"ram_usage",void 0),(0,s.gn)([i.field(Vt,{array:!0})],D.prototype,"permissions",void 0),(0,s.gn)([i.field(Nt,{optional:!0})],D.prototype,"total_resources",void 0),(0,s.gn)([i.field(It,{optional:!0})],D.prototype,"self_delegated_bandwidth",void 0),(0,s.gn)([i.field(Tt,{optional:!0})],D.prototype,"refund_request",void 0),(0,s.gn)([i.field(nt,{optional:!0})],D.prototype,"voter_info",void 0),(0,s.gn)([i.field(ht,{optional:!0})],D.prototype,"rex_info",void 0),D=(0,s.gn)([i.type("account_object")],D);let Lt=class extends i{};(0,s.gn)([i.field("name")],Lt.prototype,"producer_name",void 0),(0,s.gn)([i.field("public_key")],Lt.prototype,"block_signing_key",void 0),Lt=(0,s.gn)([i.type("new_producers_entry")],Lt);let Gt=class extends i{};(0,s.gn)([i.field("uint32")],Gt.prototype,"version",void 0),(0,s.gn)([i.field(Lt,{array:!0})],Gt.prototype,"producers",void 0),Gt=(0,s.gn)([i.type("new_producers")],Gt);let pe=class extends i{};(0,s.gn)([i.field("uint16")],pe.prototype,"type",void 0),(0,s.gn)([i.field("bytes")],pe.prototype,"data",void 0),pe=(0,s.gn)([i.type("block_extension")],pe);let zt=class extends i{};(0,s.gn)([i.field("uint16")],zt.prototype,"type",void 0),(0,s.gn)([i.field("bytes")],zt.prototype,"data",void 0),zt=(0,s.gn)([i.type("header_extension")],zt);class Me{constructor(t,e){this.id=t,this.extra=e}static from(t){let e,n;return typeof t=="string"?(e=B.from(t),n={}):(e=B.from(t.id),n=t),new this(e,n)}get transaction(){if(this.extra.packed_trx)return xt.decode({data:this.extra.packed_trx,type:ct})}get signatures(){if(this.extra.signatures)return this.extra.signatures.map(at.from)}equals(t){return this.id.equals(t.id)}toJSON(){return this.id}}Me.abiName="trx_variant";let he=class extends jt{get id(){return this.trx.id}};(0,s.gn)([i.field(Me)],he.prototype,"trx",void 0),he=(0,s.gn)([i.type("get_block_response_receipt")],he);let F=class extends i{};(0,s.gn)([i.field("time_point")],F.prototype,"timestamp",void 0),(0,s.gn)([i.field("name")],F.prototype,"producer",void 0),(0,s.gn)([i.field("uint16")],F.prototype,"confirmed",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"previous",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"transaction_mroot",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"action_mroot",void 0),(0,s.gn)([i.field("uint32")],F.prototype,"schedule_version",void 0),(0,s.gn)([i.field(Gt,{optional:!0})],F.prototype,"new_producers",void 0),(0,s.gn)([i.field("header_extension",{optional:!0})],F.prototype,"header_extensions",void 0),(0,s.gn)([i.field("any",{optional:!0})],F.prototype,"new_protocol_features",void 0),(0,s.gn)([i.field("signature")],F.prototype,"producer_signature",void 0),(0,s.gn)([i.field(he,{array:!0})],F.prototype,"transactions",void 0),(0,s.gn)([i.field("block_extension",{optional:!0})],F.prototype,"block_extensions",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"id",void 0),(0,s.gn)([i.field("uint32")],F.prototype,"block_num",void 0),(0,s.gn)([i.field("uint32")],F.prototype,"ref_block_prefix",void 0),F=(0,s.gn)([i.type("get_block_response")],F);let Kt=class extends i{};(0,s.gn)([i.field("name")],Kt.prototype,"producer_name",void 0),(0,s.gn)([i.field("any")],Kt.prototype,"authority",void 0),Kt=(0,s.gn)([i.type("active_schedule_producer_authority")],Kt);let Jt=class extends i{};(0,s.gn)([i.field("name")],Jt.prototype,"producer_name",void 0),(0,s.gn)([i.field(Kt)],Jt.prototype,"authority",void 0),Jt=(0,s.gn)([i.type("active_schedule_producer")],Jt);let ye=class extends i{};(0,s.gn)([i.field("uint32")],ye.prototype,"version",void 0),(0,s.gn)([i.field(Jt,{array:!0})],ye.prototype,"producers",void 0),ye=(0,s.gn)([i.type("active_schedule")],ye);let Q=class extends i{};(0,s.gn)([i.field("time_point")],Q.prototype,"timestamp",void 0),(0,s.gn)([i.field("name")],Q.prototype,"producer",void 0),(0,s.gn)([i.field("uint16")],Q.prototype,"confirmed",void 0),(0,s.gn)([i.field("checksum256")],Q.prototype,"previous",void 0),(0,s.gn)([i.field("checksum256")],Q.prototype,"transaction_mroot",void 0),(0,s.gn)([i.field("checksum256")],Q.prototype,"action_mroot",void 0),(0,s.gn)([i.field("uint32")],Q.prototype,"schedule_version",void 0),(0,s.gn)([i.field(zt,{array:!0,optional:!0})],Q.prototype,"header_extensions",void 0),(0,s.gn)([i.field("signature")],Q.prototype,"producer_signature",void 0),Q=(0,s.gn)([i.type("block_state_header")],Q);let $=class extends i{};(0,s.gn)([i.field("uint32")],$.prototype,"block_num",void 0),(0,s.gn)([i.field("uint32")],$.prototype,"dpos_proposed_irreversible_blocknum",void 0),(0,s.gn)([i.field("uint32")],$.prototype,"dpos_irreversible_blocknum",void 0),(0,s.gn)([i.field("checksum256")],$.prototype,"id",void 0),(0,s.gn)([i.field(Q)],$.prototype,"header",void 0),(0,s.gn)([i.field("any")],$.prototype,"active_schedule",void 0),(0,s.gn)([i.field("any")],$.prototype,"blockroot_merkle",void 0),(0,s.gn)([i.field("any")],$.prototype,"producer_to_last_produced",void 0),(0,s.gn)([i.field("any")],$.prototype,"producer_to_last_implied_irb",void 0),(0,s.gn)([i.field("any")],$.prototype,"valid_block_signing_authority",void 0),(0,s.gn)([i.field("any")],$.prototype,"confirm_count",void 0),(0,s.gn)([i.field("any")],$.prototype,"pending_schedule",void 0),(0,s.gn)([i.field("any")],$.prototype,"activated_protocol_features",void 0),(0,s.gn)([i.field("any")],$.prototype,"additional_signatures",void 0),$=(0,s.gn)([i.type("get_block_header_state_response")],$);let M=class extends i{getTransactionHeader(t=120){const e=Ne.fromMilliseconds(this.head_block_time.toMilliseconds()+t*1e3),o=this.last_irreversible_block_id.array.subarray(8,12),a=new Uint32Array(o.buffer,o.byteOffset,1)[0];return dt.from({expiration:e,ref_block_num:Number(this.last_irreversible_block_num)&65535,ref_block_prefix:a})}};(0,s.gn)([i.field("string")],M.prototype,"server_version",void 0),(0,s.gn)([i.field("checksum256")],M.prototype,"chain_id",void 0),(0,s.gn)([i.field("uint32")],M.prototype,"head_block_num",void 0),(0,s.gn)([i.field("uint32")],M.prototype,"last_irreversible_block_num",void 0),(0,s.gn)([i.field("checksum256")],M.prototype,"last_irreversible_block_id",void 0),(0,s.gn)([i.field("checksum256")],M.prototype,"head_block_id",void 0),(0,s.gn)([i.field("time_point")],M.prototype,"head_block_time",void 0),(0,s.gn)([i.field("name")],M.prototype,"head_block_producer",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"virtual_block_cpu_limit",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"virtual_block_net_limit",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"block_cpu_limit",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"block_net_limit",void 0),(0,s.gn)([i.field("string?")],M.prototype,"server_version_string",void 0),(0,s.gn)([i.field("uint32?")],M.prototype,"fork_db_head_block_num",void 0),(0,s.gn)([i.field("checksum256?")],M.prototype,"fork_db_head_block_id",void 0),M=(0,s.gn)([i.type("get_info_response")],M);let _t=class extends i{};(0,s.gn)([i.field("name")],_t.prototype,"code",void 0),(0,s.gn)([i.field("name")],_t.prototype,"scope",void 0),(0,s.gn)([i.field("name")],_t.prototype,"table",void 0),(0,s.gn)([i.field("name")],_t.prototype,"payer",void 0),(0,s.gn)([i.field("uint32")],_t.prototype,"count",void 0),_t=(0,s.gn)([i.type("get_table_by_scope_response_row")],_t);let Ht=class extends i{};(0,s.gn)([i.field(_t,{array:!0})],Ht.prototype,"rows",void 0),(0,s.gn)([i.field("string")],Ht.prototype,"more",void 0),Ht=(0,s.gn)([i.type("get_table_by_scope_response")],Ht);let yt=class extends i{};(0,s.gn)([i.field(f)],yt.prototype,"global_action_seq",void 0),(0,s.gn)([i.field(G)],yt.prototype,"account_action_seq",void 0),(0,s.gn)([i.field(c)],yt.prototype,"block_num",void 0),(0,s.gn)([i.field(Ie)],yt.prototype,"block_time",void 0),(0,s.gn)([i.field("any")],yt.prototype,"action_trace",void 0),(0,s.gn)([i.field("boolean?")],yt.prototype,"irrevirsible",void 0),yt=(0,s.gn)([i.type("ordered_action_result")],yt);let Bt=class extends i{};(0,s.gn)([i.field(yt,{array:!0})],Bt.prototype,"actions",void 0),(0,s.gn)([i.field(lt)],Bt.prototype,"last_irreversible_block",void 0),(0,s.gn)([i.field(lt)],Bt.prototype,"head_block_num",void 0),(0,s.gn)([i.field("boolean?")],Bt.prototype,"time_limit_exceeded_error",void 0),Bt=(0,s.gn)([i.type("get_actions_response")],Bt);let $e=class extends i{};$e=(0,s.gn)([i.type("transaction_trace")],$e);let X=class extends i{};(0,s.gn)([i.field("any")],X.prototype,"actions",void 0),(0,s.gn)([i.field("any")],X.prototype,"context_free_actions",void 0),(0,s.gn)([i.field("any")],X.prototype,"context_free_data",void 0),(0,s.gn)([i.field("number")],X.prototype,"delay_sec",void 0),(0,s.gn)([i.field("string")],X.prototype,"expiration",void 0),(0,s.gn)([i.field("number")],X.prototype,"max_cpu_usage_ms",void 0),(0,s.gn)([i.field("number")],X.prototype,"max_net_usage_words",void 0),(0,s.gn)([i.field("number")],X.prototype,"ref_block_num",void 0),(0,s.gn)([i.field("number")],X.prototype,"ref_block_prefix",void 0),(0,s.gn)([i.field("string",{array:!0})],X.prototype,"signatures",void 0),X=(0,s.gn)([i.type("trx")],X);let me=class extends i{};(0,s.gn)([i.field(jt)],me.prototype,"receipt",void 0),(0,s.gn)([i.field("trx")],me.prototype,"trx",void 0),me=(0,s.gn)([i.type("transaction_info")],me);let mt=class extends i{};(0,s.gn)([i.field(B)],mt.prototype,"id",void 0),(0,s.gn)([i.field(c)],mt.prototype,"block_num",void 0),(0,s.gn)([i.field(Ie)],mt.prototype,"block_time",void 0),(0,s.gn)([i.field(c)],mt.prototype,"last_irreversible_block",void 0),(0,s.gn)([i.field("any?")],mt.prototype,"traces",void 0),(0,s.gn)([i.field("any")],mt.prototype,"trx",void 0),mt=(0,s.gn)([i.type("get_transaction_response")],mt);let ge=class extends i{};(0,s.gn)([i.field("name",{array:!0})],ge.prototype,"account_names",void 0),ge=(0,s.gn)([i.type("get_key_accounts_response")],ge);let be=class extends i{};(0,s.gn)([i.field("name",{array:!0})],be.prototype,"controlled_accounts",void 0),be=(0,s.gn)([i.type("get_controlled_accounts_response")],be);let tt=class extends i{};(0,s.gn)([i.field("string")],tt.prototype,"state",void 0),(0,s.gn)([i.field("uint32")],tt.prototype,"head_number",void 0),(0,s.gn)([i.field("checksum256")],tt.prototype,"head_id",void 0),(0,s.gn)([i.field("time_point")],tt.prototype,"head_timestamp",void 0),(0,s.gn)([i.field("uint32")],tt.prototype,"irreversible_number",void 0),(0,s.gn)([i.field("checksum256")],tt.prototype,"irreversible_id",void 0),(0,s.gn)([i.field("time_point")],tt.prototype,"irreversible_timestamp",void 0),(0,s.gn)([i.field("checksum256")],tt.prototype,"earliest_tracked_block_id",void 0),(0,s.gn)([i.field("uint32")],tt.prototype,"earliest_tracked_block_number",void 0),tt=(0,s.gn)([i.type("get_transaction_status_response")],tt);var mr=Object.freeze({__proto__:null,get AccountPermission(){return Vt},get AccountResourceLimit(){return Et},get AccountTotalResources(){return Nt},get AccountSelfDelegatedBandwidth(){return It},get AccountRefundRequest(){return Tt},get AccountVoterInfo(){return nt},get AccountRexInfoMaturities(){return Pt},get AccountRexInfo(){return ht},get AccountObject(){return D},get NewProducersEntry(){return Lt},get NewProducers(){return Gt},get BlockExtension(){return pe},get HeaderExtension(){return zt},TrxVariant:Me,get GetBlockResponseTransactionReceipt(){return he},get GetBlockResponse(){return F},get ActiveScheduleProducerAuthority(){return Kt},get ActiveScheduleProducer(){return Jt},get ActiveSchedule(){return ye},get BlockStateHeader(){return Q},get GetBlockHeaderStateResponse(){return $},get GetInfoResponse(){return M},get GetTableByScopeResponseRow(){return _t},get GetTableByScopeResponse(){return Ht},get OrderedActionsResult(){return yt},get GetActionsResponse(){return Bt},get TransactionTrace(){return $e},get Trx(){return X},get TransactionInfo(){return me},get GetTransactionResponse(){return mt},get GetKeyAccountsResponse(){return ge},get GetControlledAccountsResponse(){return be},get GetTransactionStatusResponse(){return tt}});class gr{constructor(t){this.client=t}async get_abi(t){return this.client.call({path:"/v1/chain/get_abi",params:{account_name:I.from(t)}})}async get_account(t){return this.client.call({path:"/v1/chain/get_account",params:{account_name:I.from(t)},responseType:D})}async get_block(t){return this.client.call({path:"/v1/chain/get_block",params:{block_num_or_id:t},responseType:F})}async get_block_header_state(t){return this.client.call({path:"/v1/chain/get_block_header_state",params:{block_num_or_id:t},responseType:$})}async get_currency_balance(t,e,n){const o={account:I.from(e),code:I.from(t)};return n&&(o.symbol=n),this.client.call({path:"/v1/chain/get_currency_balance",params:o,responseType:"asset[]"})}async get_info(){return this.client.call({path:"/v1/chain/get_info",responseType:M})}async compute_transaction(t){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/compute_transaction",params:{transaction:t}})}async push_transaction(t){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/push_transaction",params:t})}async send_transaction(t){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/send_transaction",params:t})}async send_transaction2(t,e){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/send_transaction2",params:{return_failure_trace:!0,retry_trx:!1,retry_trx_num_blocks:0,transaction:t,...e}})}async get_table_rows(t){const e=t.type;let n=t.key_type;const o=t.lower_bound||t.upper_bound;!n&&o&&(A(o,f)?n="i64":A(o,d)?n="i128":A(o,B)?n="sha256":A(o,kt)&&(n="ripemd160")),n||(n="name");let a=t.json;a===void 0&&(a=e===void 0);let l=t.upper_bound;l&&typeof l!="string"&&(l=String(l));let h=t.lower_bound;h&&typeof h!="string"&&(h=String(h));let p=t.scope;typeof p>"u"?p=String(I.from(t.code)):typeof p!="string"&&(p=String(p));let{rows:w,more:K,next_key:q}=await this.client.call({path:"/v1/chain/get_table_rows",params:{...t,code:I.from(t.code),table:I.from(t.table),limit:t.limit!==void 0?c.from(t.limit):void 0,scope:p,key_type:n,json:a,upper_bound:l,lower_bound:h}}),Rt;if(t.show_payer&&(Rt=[],w=w.map(({data:C,payer:b})=>(Rt.push(I.from(b)),C))),e&&(a?w=w.map(C=>typeof C=="string"&&S.isBytes(C)?xt.decode({data:S.from(C),type:e}):xt.decode({object:C,type:e})):w=w.map(C=>S.from(C)).map(C=>xt.decode({data:C,type:e}))),q&&q.length>0){let C;switch(n){case"i64":C=f;break;case"i128":C=d;break;case"name":C=I;break;case"float64":C=xe;break;case"float128":C=Ee;break;case"sha256":C=B;break;case"ripemd160":C=kt;break;default:throw new Error(`Unsupported key type: ${n}`)}C===I?q=I.from(xt.decode({object:q,type:f})):q=xt.decode({object:q,type:C})}else q=void 0;return{rows:w,more:K,next_key:q,ram_payers:Rt}}async get_table_by_scope(t){return this.client.call({path:"/v1/chain/get_table_by_scope",params:t,responseType:Ht})}async get_transaction_status(t){return this.client.call({path:"/v1/chain/get_transaction_status",params:{id:B.from(t)},responseType:tt})}}class br{constructor(t){this.client=t}async get_actions(t,e,n){return this.client.call({path:"/v1/history/get_actions",params:{account_name:I.from(t),pos:lt.from(e),offset:lt.from(n)},responseType:Bt})}async get_transaction(t,e={}){return this.client.call({path:"/v1/history/get_transaction",params:{id:B.from(t),block_num_hint:e.blockNumHint&&c.from(e.blockNumHint),traces:e.excludeTraces===!0?!1:void 0},responseType:mt})}async get_key_accounts(t){return this.client.call({path:"/v1/history/get_key_accounts",params:{public_key:Z.from(t)},responseType:ge})}async get_controlled_accounts(t){return this.client.call({path:"/v1/history/get_controlled_accounts",params:{controlling_account:I.from(t)},responseType:be})}}class we extends Error{constructor(t,e){let n;e.json&&e.json.error?n=`${we.formatError(e.json.error)} at ${t}`:n=`HTTP ${e.status} at ${t}`,super(n),this.path=t,this.response=e}static formatError(t){return t.what==="unspecified"&&t.details[0].file&&t.details[0].file==="http_plugin.cpp"&&t.details[0].message.slice(0,11)==="unknown key"?"Account not found":t.what==="unspecified"&&t.details&&t.details.length>0?t.details[0].message:t.what&&t.what.length>0?t.what:"Unknown API error"}get error(){const{json:t}=this.response;return t?t.error:void 0}get name(){const{error:t}=this;return t?t.name:"unspecified"}get code(){const{error:t}=this;return t?t.code:0}get details(){const{error:t}=this;return t?t.details:[]}}we.__className="APIError";class tr{constructor(t){if(this.v1={chain:new gr(this),history:new br(this)},t.provider)this.provider=t.provider;else if(t.url)this.provider=new Xe(t.url,t);else throw new Error("Missing url or provider")}async call(t){const e=await this.provider.call(t.path,t.params),{json:n}=e;if(Math.floor(e.status/100)!==2||n&&typeof n.error=="object")throw new we(t.path,e);return t.responseType?Ct({type:t.responseType,object:e.json}):e.json||e.text}}tr.__className="APIClient";var vr=Object.freeze({__proto__:null,v1:mr})},70655:function(er,Pe,L){L.d(Pe,{CR:function(){return Xt},FC:function(){return St},Jh:function(){return Ae},KL:function(){return E},XA:function(){return vt},ZT:function(){return Be},ev:function(){return At},gn:function(){return Re},mG:function(){return ft},qq:function(){return B}});var Zt=function(u,c){return Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(f[m]=d[m])},Zt(u,c)};function Be(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");Zt(u,c);function f(){this.constructor=u}u.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}var ut=function(){return ut=Object.assign||function(c){for(var f,d=1,m=arguments.length;d<m;d++){f=arguments[d];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(c[y]=f[y])}return c},ut.apply(this,arguments)};function rr(u,c){var f={};for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&c.indexOf(d)<0&&(f[d]=u[d]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,d=Object.getOwnPropertySymbols(u);m<d.length;m++)c.indexOf(d[m])<0&&Object.prototype.propertyIsEnumerable.call(u,d[m])&&(f[d[m]]=u[d[m]]);return f}function Re(u,c,f,d){var m=arguments.length,y=m<3?c:d===null?d=Object.getOwnPropertyDescriptor(c,f):d,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,c,f,d);else for(var P=u.length-1;P>=0;P--)(_=u[P])&&(y=(m<3?_(y):m>3?_(c,f,y):_(c,f))||y);return m>3&&y&&Object.defineProperty(c,f,y),y}function et(u,c){return function(f,d){c(f,d,u)}}function ve(u,c,f,d,m,y){function _(bt){if(bt!==void 0&&typeof bt!="function")throw new TypeError("Function expected");return bt}for(var P=d.kind,J=P==="getter"?"get":P==="setter"?"set":"value",v=!c&&u?d.static?u:u.prototype:null,O=c||(v?Object.getOwnPropertyDescriptor(v,d.name):{}),j,U=!1,Y=f.length-1;Y>=0;Y--){var ot={};for(var st in d)ot[st]=st==="access"?{}:d[st];for(var st in d.access)ot.access[st]=d.access[st];ot.addInitializer=function(bt){if(U)throw new TypeError("Cannot add initializers after decoration has completed");y.push(_(bt||null))};var gt=(0,f[Y])(P==="accessor"?{get:O.get,set:O.set}:O[J],ot);if(P==="accessor"){if(gt===void 0)continue;if(gt===null||typeof gt!="object")throw new TypeError("Object expected");(j=_(gt.get))&&(O.get=j),(j=_(gt.set))&&(O.set=j),(j=_(gt.init))&&m.push(j)}else(j=_(gt))&&(P==="field"?m.push(j):O[J]=j)}v&&Object.defineProperty(v,d.name,O),U=!0}function nr(u,c,f){for(var d=arguments.length>2,m=0;m<c.length;m++)f=d?c[m].call(u,f):c[m].call(u);return d?f:void 0}function s(u){return typeof u=="symbol"?u:"".concat(u)}function Yt(u,c,f){return typeof c=="symbol"&&(c=c.description?"[".concat(c.description,"]"):""),Object.defineProperty(u,"name",{configurable:!0,value:f?"".concat(f," ",c):c})}function qe(u,c){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(u,c)}function ft(u,c,f,d){function m(y){return y instanceof f?y:new f(function(_){_(y)})}return new(f||(f=Promise))(function(y,_){function P(O){try{v(d.next(O))}catch(j){_(j)}}function J(O){try{v(d.throw(O))}catch(j){_(j)}}function v(O){O.done?y(O.value):m(O.value).then(P,J)}v((d=d.apply(u,c||[])).next())})}function Ae(u,c){var f={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},d,m,y,_;return _={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function P(v){return function(O){return J([v,O])}}function J(v){if(d)throw new TypeError("Generator is already executing.");for(;_&&(_=0,v[0]&&(f=0)),f;)try{if(d=1,m&&(y=v[0]&2?m.return:v[0]?m.throw||((y=m.return)&&y.call(m),0):m.next)&&!(y=y.call(m,v[1])).done)return y;switch(m=0,y&&(v=[v[0]&2,y.value]),v[0]){case 0:case 1:y=v;break;case 4:return f.label++,{value:v[1],done:!1};case 5:f.label++,m=v[1],v=[0];continue;case 7:v=f.ops.pop(),f.trys.pop();continue;default:if(y=f.trys,!(y=y.length>0&&y[y.length-1])&&(v[0]===6||v[0]===2)){f=0;continue}if(v[0]===3&&(!y||v[1]>y[0]&&v[1]<y[3])){f.label=v[1];break}if(v[0]===6&&f.label<y[1]){f.label=y[1],y=v;break}if(y&&f.label<y[2]){f.label=y[2],f.ops.push(v);break}y[2]&&f.ops.pop(),f.trys.pop();continue}v=c.call(u,f)}catch(O){v=[6,O],m=0}finally{d=y=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}var Qt=Object.create?function(u,c,f,d){d===void 0&&(d=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(u,d,m)}:function(u,c,f,d){d===void 0&&(d=f),u[d]=c[f]};function Le(u,c){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&Qt(c,u,f)}function vt(u){var c=typeof Symbol=="function"&&Symbol.iterator,f=c&&u[c],d=0;if(f)return f.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&d>=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(u,c){var f=typeof Symbol=="function"&&u[Symbol.iterator];if(!f)return u;var d=f.call(u),m,y=[],_;try{for(;(c===void 0||c-- >0)&&!(m=d.next()).done;)y.push(m.value)}catch(P){_={error:P}}finally{try{m&&!m.done&&(f=d.return)&&f.call(d)}finally{if(_)throw _.error}}return y}function A(){for(var u=[],c=0;c<arguments.length;c++)u=u.concat(Xt(arguments[c]));return u}function S(){for(var u=0,c=0,f=arguments.length;c<f;c++)u+=arguments[c].length;for(var d=Array(u),m=0,c=0;c<f;c++)for(var y=arguments[c],_=0,P=y.length;_<P;_++,m++)d[m]=y[_];return d}function At(u,c,f){if(f||arguments.length===2)for(var d=0,m=c.length,y;d<m;d++)(y||!(d in c))&&(y||(y=Array.prototype.slice.call(c,0,d)),y[d]=c[d]);return u.concat(y||Array.prototype.slice.call(c))}function B(u){return this instanceof B?(this.v=u,this):new B(u)}function St(u,c,f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d=f.apply(u,c||[]),m,y=[];return m={},_("next"),_("throw"),_("return"),m[Symbol.asyncIterator]=function(){return this},m;function _(U){d[U]&&(m[U]=function(Y){return new Promise(function(ot,st){y.push([U,Y,ot,st])>1||P(U,Y)})})}function P(U,Y){try{J(d[U](Y))}catch(ot){j(y[0][3],ot)}}function J(U){U.value instanceof B?Promise.resolve(U.value.v).then(v,O):j(y[0][2],U)}function v(U){P("next",U)}function O(U){P("throw",U)}function j(U,Y){U(Y),y.shift(),y.length&&P(y[0][0],y[0][1])}}function kt(u){var c,f;return c={},d("next"),d("throw",function(m){throw m}),d("return"),c[Symbol.iterator]=function(){return this},c;function d(m,y){c[m]=u[m]?function(_){return(f=!f)?{value:B(u[m](_)),done:!1}:y?y(_):_}:y}}function E(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=u[Symbol.asyncIterator],f;return c?c.call(u):(u=typeof vt=="function"?vt(u):u[Symbol.iterator](),f={},d("next"),d("throw"),d("return"),f[Symbol.asyncIterator]=function(){return this},f);function d(y){f[y]=u[y]&&function(_){return new Promise(function(P,J){_=u[y](_),m(P,J,_.done,_.value)})}}function m(y,_,P,J){Promise.resolve(J).then(function(v){y({value:v,done:P})},_)}}function N(u,c){return Object.defineProperty?Object.defineProperty(u,"raw",{value:c}):u.raw=c,u}var Wt=Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c};function te(u){if(u&&u.__esModule)return u;var c={};if(u!=null)for(var f in u)f!=="default"&&Object.prototype.hasOwnProperty.call(u,f)&&Qt(c,u,f);return Wt(c,u),c}function lt(u){return u&&u.__esModule?u:{default:u}}function G(u,c,f,d){if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof c=="function"?u!==c||!d:!c.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?d:f==="a"?d.call(u):d?d.value:c.get(u)}function ee(u,c,f,d,m){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!m)throw new TypeError("Private accessor was defined without a setter");if(typeof c=="function"?u!==c||!m:!c.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?m.call(u,f):m?m.value=f:c.set(u,f),f}function re(u,c){if(c===null||typeof c!="object"&&typeof c!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof u=="function"?c===u:u.has(c)}}}]);
|
|
35
|
+
*/function Yt(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(r[n]!==t[n])return!1;return!0}function qe(r,t){const e=r.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(!r[n].equals(t[n]))return!1;return!0}const ft={};function Ae(){ft.enc=new Array(255),ft.dec={};for(let r=0;r<=255;++r){const t=r.toString(16).padStart(2,"0");ft.enc[r]=t,ft.dec[t]=r}}function Qt(r){ft.enc||Ae();const t=r.length,e=new Array(t);for(let n=0;n<t;++n)e[n]=ft.enc[r[n]];return e.join("")}function Le(r){if(ft.dec||Ae(),typeof r!="string")throw new Error("Expected string containing hex digits");if(r.length%2)throw new Error("Odd number of hex digits");r=r.toLowerCase();const t=r.length/2,e=new Uint8Array(t);for(let n=0;n<t;n++){const o=ft.dec[r[n*2]+r[n*2+1]];if(o===void 0)throw new Error("Expected hex string");e[n]=o}return e}function vt(r){return Be()(r)}let Xt=!1;function A(r,t){if(r instanceof t)return!0;if(r==null||typeof r!="object")return!1;const e=t.__className||t.abiName;if(!e)return!1;let n=r.constructor,o=!1;for(;n&&!o;){const a=n.__className||n.abiName;if(!a)break;o=e==a,n=Object.getPrototypeOf(n)}return o&&!Xt&&(console.warn(`Detected alien instance of ${e}, this usually means more than one version of @greymass/eosio has been included in your bundle.`),Xt=!0),o}class S{constructor(t=new Uint8Array){this.array=t}static from(t,e){return A(t,this)?t:typeof t=="string"?this.fromString(t,e):ArrayBuffer.isView(t)?new this(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)):A(t.array,Uint8Array)?new this(t.array):new this(new Uint8Array(t))}static fromString(t,e="hex"){if(e==="hex"){const n=Le(t);return new this(n)}else if(e=="utf8"){const n=new TextEncoder;return new this(n.encode(t))}else throw new Error(`Unknown encoding: ${e}`)}static fromABI(t){const e=t.readVaruint32();return new this(t.readArray(e))}static abiDefault(){return new S}static equal(t,e){return this.from(t).equals(this.from(e))}static random(t){return new this(vt(t))}static isBytes(t){return!!(A(t,S)||A(t,Uint8Array)||Array.isArray(t)&&t.every(e=>typeof e=="number")||typeof t=="string"&&(/[\da-f]/i.test(t)||t===""))}get length(){return this.array.byteLength}get hexString(){return Qt(this.array)}get utf8String(){return new TextDecoder().decode(this.array)}append(t){t=S.from(t);const e=this.array.byteLength+t.array.byteLength,n=new ArrayBuffer(e),o=new Uint8Array(n);o.set(this.array),o.set(t.array,this.array.byteLength),this.array=o}appending(t){const e=new S(this.array);return e.append(t),e}zeropad(t,e=!1){const n=e?t:Math.max(t,this.array.byteLength),o=new ArrayBuffer(n),a=new Uint8Array(o);a.fill(0),e&&this.array.byteLength>n?a.set(this.array.slice(0,n),0):a.set(this.array,n-this.array.byteLength),this.array=a}zeropadded(t,e=!1){const n=new S(this.array);return n.zeropad(t,e),n}dropFirst(t=1){this.array=this.array.subarray(t)}droppingFirst(t=1){return new S(this.array.subarray(t))}copy(){const t=new ArrayBuffer(this.array.byteLength),e=new Uint8Array(t);return e.set(this.array),new S(e)}equals(t){return Yt(this.array,S.from(t).array)}toString(t="hex"){if(t==="hex")return this.hexString;if(t==="utf8")return this.utf8String;throw new Error(`Unknown encoding: ${t}`)}toABI(t){t.writeVaruint32(this.array.byteLength),t.writeArray(this.array)}toJSON(){return this.hexString}}S.abiName="bytes";class At{constructor(t){const e=this.constructor.byteSize;if(t.byteLength!==e)throw new Error(`Checksum size mismatch, expected ${e} bytes got ${t.byteLength}`);this.array=t}static from(t){return A(t,this)?t:A(t,At)?new this(t.array):new this(S.from(t).array)}static fromABI(t){return new this(t.readArray(this.byteSize))}static abiDefault(){return new this(new Uint8Array(this.byteSize))}equals(t){const e=this.constructor;try{return Yt(this.array,e.from(t).array)}catch{return!1}}get hexString(){return Qt(this.array)}toABI(t){t.writeArray(this.array)}toString(){return this.hexString}toJSON(){return this.toString()}}At.abiName="__checksum";class B extends At{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,ut.sha256)().update(S.from(t).array).digest());return new B(e)}}B.abiName="checksum256",B.byteSize=32;class St extends At{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,ut.sha512)().update(S.from(t).array).digest());return new St(e)}}St.abiName="checksum512",St.byteSize=64;class kt extends At{static from(t){return super.from(t)}static hash(t){const e=new Uint8Array((0,ut.ripemd160)().update(S.from(t).array).digest());return new kt(e)}}kt.abiName="checksum160",kt.byteSize=20;var x;(function(r){r.K1="K1",r.R1="R1",r.WA="WA"})(x||(x={})),function(r){function t(n){switch(n){case r.K1:return 0;case r.R1:return 1;case r.WA:return 2;default:throw new Error(`Unknown curve type: ${n}`)}}r.indexFor=t;function e(n){let o;switch(typeof n!="number"?o=r.indexFor(n):o=n,o){case 0:return r.K1;case 1:return r.R1;case 2:return r.WA;default:throw new Error("Unknown curve type")}}r.from=e}(x||(x={}));class N{constructor(t){const e=this.constructor;if(e.isSigned===void 0||e.byteWidth===void 0)throw new Error("Cannot instantiate abstract class Int");if(t.gt(e.max))throw new Error(`Number ${t} overflows ${e.abiName}`);if(t.lt(e.min))throw new Error(`Number ${t} underflows ${e.abiName}`);this.value=t}static get max(){return new(et())(2).pow(new(et())(this.byteWidth*8-(this.isSigned?1:0))).isubn(1)}static get min(){return this.isSigned?this.max.ineg().isubn(1):new(et())(0)}static add(t,e,n="truncate"){return N.operator(t,e,n,(o,a)=>o.add(a))}static sub(t,e,n){return N.operator(t,e,n,(o,a)=>o.sub(a))}static mul(t,e,n){return N.operator(t,e,n,(o,a)=>o.mul(a))}static div(t,e,n){return N.operator(t,e,n,(o,a)=>{if(a.isZero())throw new Error("Division by zero");return o.div(a)})}static divRound(t,e,n){return N.operator(t,e,n,(o,a)=>{if(a.isZero())throw new Error("Division by zero");return o.divRound(a)})}static divCeil(t,e,n){return N.operator(t,e,n,(o,a)=>{if(a.isZero())throw new Error("Division by zero");const l=o.divmod(a);return l.mod.isZero()?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)})}static operator(t,e,n="truncate",o){const{a,b:l}=K(t,e),h=a.constructor,p=o(a.value,l.value);return h.from(p,n)}static from(t,e){if(A(t,this))return t;let n=this,o;if(A(t,N))n=t.constructor,o=t.value.clone();else if(t instanceof Uint8Array)o=new(et())(t,void 0,"le"),n.isSigned&&(o=o.fromTwos(n.byteWidth*8));else{if(typeof t=="string"&&!/[0-9]+/.test(t)||typeof t=="number"&&!Number.isFinite(t))throw new Error("Invalid number");o=et().isBN(t)?t.clone():new(et())(t,10),o.isNeg()&&!n.isSigned&&(n={byteWidth:n.byteWidth,isSigned:!0})}switch(e){case"clamp":o=_(o,this.min,this.max);break;case"truncate":o=P(o,n,this);break}return new this(o)}static fromABI(t){return this.from(t.readArray(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){return this.from(vt(this.byteWidth))}cast(t,e="truncate"){return this.constructor===t?this:t.from(this,e)}get byteArray(){const t=this.constructor;return(t.isSigned?this.value.toTwos(t.byteWidth*8):this.value).toArrayLike(Uint8Array,"le",t.byteWidth)}equals(t,e=!1){const n=this.constructor;if(e===!0&&A(t,N)){const o=t.constructor;if(n.byteWidth!==o.byteWidth||n.isSigned!==o.isSigned)return!1}try{return this.value.eq(n.from(t).value)}catch{return!1}}add(t){this.value=this.operator(t,N.add).value}adding(t){return this.operator(t,N.add)}subtract(t){this.value=this.operator(t,N.sub).value}subtracting(t){return this.operator(t,N.sub)}multiply(t){this.value=this.operator(t,N.mul).value}multiplying(t){return this.operator(t,N.mul)}divide(t,e){this.value=this.dividing(t,e).value}dividing(t,e){let n=N.div;switch(e){case"ceil":n=N.divCeil;break;case"round":n=N.divRound;break}return this.operator(t,n)}operator(t,e){let n;return A(t,N)?n=t:n=G.from(t,"truncate"),e(this,n).cast(this.constructor)}toNumber(){return this.value.toNumber()}toString(){return this.value.toString()}[Symbol.toPrimitive](t){return t==="number"?this.toNumber():this.toString()}toABI(t){t.writeArray(this.byteArray)}toJSON(){return this.value.bitLength()>32?this.value.toString():this.value.toNumber()}}N.abiName="__int";class Wt extends N{}Wt.abiName="int8",Wt.byteWidth=1,Wt.isSigned=!0;class te extends N{}te.abiName="int16",te.byteWidth=2,te.isSigned=!0;class lt extends N{}lt.abiName="int32",lt.byteWidth=4,lt.isSigned=!0;class G extends N{}G.abiName="int64",G.byteWidth=8,G.isSigned=!0;class ee extends N{}ee.abiName="int128",ee.byteWidth=16,ee.isSigned=!0;class re extends N{}re.abiName="uint8",re.byteWidth=1,re.isSigned=!1;class u extends N{}u.abiName="uint16",u.byteWidth=2,u.isSigned=!1;class c extends N{}c.abiName="uint32",c.byteWidth=4,c.isSigned=!1;class f extends N{}f.abiName="uint64",f.byteWidth=8,f.isSigned=!1;class d extends N{}d.abiName="uint128",d.byteWidth=16,d.isSigned=!1;class m extends N{static fromABI(t){return new this(new(et())(t.readVarint32()))}toABI(t){t.writeVarint32(Number(this))}}m.abiName="varint32",m.byteWidth=32,m.isSigned=!0;class y extends N{static fromABI(t){return new this(new(et())(t.readVaruint32()))}toABI(t){t.writeVaruint32(Number(this))}}y.abiName="varuint32",y.byteWidth=32,y.isSigned=!1;function _(r,t,e){return et().min(et().max(r,t),e)}function P(r,t,e){const n=r.isNeg()?255:0,a=(t.isSigned?r.toTwos(t.byteWidth*8):r).toArrayLike(Uint8Array,"le"),l=new Uint8Array(e.byteWidth);l.fill(n),l.set(a.slice(0,e.byteWidth));const h=new(et())(l,void 0,"le");return e.isSigned?h.fromTwos(e.byteWidth*8):h}function K(r,t){r=v(r),t=v(t);const e=r.constructor,n=t.constructor;return e!==n&&(e.isSigned===n.isSigned?e.byteWidth>n.byteWidth?t=t.cast(e):n.byteWidth>e.byteWidth&&(r=r.cast(n)):e.isSigned===!1&&e.byteWidth>=n.byteWidth?t=t.cast(e):n.isSigned===!1&&n.byteWidth>=e.byteWidth?r=r.cast(n):e.isSigned===!0&&e.max.gte(n.max)&&e.min.lte(n.min)?t=t.cast(e):n.isSigned===!0&&n.max.gte(e.max)&&n.min.lte(e.min)&&(r=r.cast(n))),{a:r,b:t}}function v(r){let t=r;return r.constructor.byteWidth<4&&(t=r.cast(lt)),t}function O(r){const t=[],e=[],n=[],o=new Set,a=p=>{let w;return typeof p.type!="string"?w=l(p.type):w=p.type,p.array===!0&&(w+="[]"),p.optional===!0&&(w+="?"),p.extension===!0&&(w+="$"),w},l=p=>{if(p.abiName){if(p.abiName==="__struct")throw new Error("Misconfigured Struct subclass, did you forget @Struct.type?")}else throw new Error("Encountered non-conforming type");if(o.has(p))return p.abiName;if(o.add(p),p.abiAlias)n.push({new_type_name:p.abiName,type:a(p.abiAlias)});else if(p.abiFields){const w=p.abiFields.map(q=>({name:q.name,type:a(q)})),J={base:p.abiBase?l(p.abiBase):"",name:p.abiName,fields:w};t.push(J)}else if(p.abiVariant){const w={name:p.abiName,types:p.abiVariant.map(a)};e.push(w)}return p.abiName},h=l(r);return{abi:W.from({structs:t,variants:e,types:n}),types:Array.from(o),root:h}}function j(r){let t=typeof r.type=="string"?r.type:r.type.abiName;return r.array===!0&&(t+="[]"),r.optional===!0&&(t+="?"),r.extension===!0&&(t+="$"),t}function U(r){return typeof r!="string"&&r.abiName===void 0&&r.type!==void 0}function Y(r){return typeof r=="string"?{type:r}:typeof r.abiName<"u"?{type:r}:r}const ot={abiName:"string",abiDefault:()=>"",fromABI:r=>r.readString(),from:r=>r,toABI:(r,t)=>{t.writeString(r)}},st={abiName:"bool",abiDefault:()=>!1,fromABI:r=>r.readByte()===1,from:r=>r,toABI:(r,t)=>{t.writeByte(r===!0?1:0)}};function gt(){return[st,ot,V,V.Symbol,V.SymbolCode,Ie,S,kt,B,St,ae,Ee,De,xe,ee,te,lt,G,Wt,I,Z,at,Ke,Ne,d,u,c,f,re,m,y]}function bt(r=[]){const t={},e=gt();for(const n of e)t[n.abiName]=n;for(const n of r){if(!n.abiName)throw new Error("Invalid type");t[n.abiName]=n}return t}function Oe(r){if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor.abiName;if(Array.isArray(r)){const t=r.map(Oe),e=t[0];return!e||!t.every(n=>n===e)?void 0:e+"[]"}switch(typeof r){case"boolean":return"bool";case"string":return"string"}}function Ce(r,t="jsobj"){var e;if(r.constructor&&r.constructor.abiName!==void 0)return r.constructor;if(Array.isArray(r)){const o=r.map(l=>Ce(l,t)),a=o[0];return!a||!o.every(l=>l&&l.abiName===a.abiName)?void 0:a}const n=typeof r;if(n==="object"&&r!==null){const o=Object.keys(r).map(a=>({name:a,type:Ce(r[a],t+"_nested")}));return o.find(a=>!a.type)?void 0:(e=class extends i{},e.abiName=t,e.abiFields=o,e)}switch(n){case"boolean":return st;case"string":return ot}}class Ge extends Error{constructor(t,e){const n=t.codingPath.map(({field:o,type:a})=>typeof o=="number"?o:`${o}<${a.typeName}>`).join(".");super(`Decoding error at ${n}: ${e.message}`),this.stack=e.stack,this.ctx=t,this.underlyingError=e}}Ge.__className="DecodingError";function Ct(r){const t=Y(r.type),e=j(t),n=r.customTypes||[];let o;if(r.abi)o=W.from(r.abi);else try{let h;if(typeof t.type=="string"){const w=bt(n),J=new W.ResolvedType(t.type).name;if(h=w[J],!h)throw new Error(`Unknown type: ${t.type}`)}else h=t.type;const p=O(h);o=p.abi,n.push(...p.types)}catch(h){throw Error(`Unable to synthesize ABI for: ${e} (${h.message}). To decode non-class types you need to pass the ABI definition manually.`)}const a=o.resolveType(e);typeof t.type!="string"&&n.unshift(t.type);const l={types:bt(n),strictExtensions:r.strictExtensions||!1,codingPath:[{field:"root",type:a}]};try{if(r.data||r.data===""){let h;if(A(r.data,oe))h=r.data;else{const p=S.from(r.data);h=new oe(p.array)}return r.metadata&&(h.metadata=r.metadata),Se(a,h,l)}else{if(r.object!==void 0)return ne(r.object,a,l);if(r.json)return ne(JSON.parse(r.json),a,l);throw new Error("Nothing to decode, you must set one of data, json, object")}}catch(h){throw new Ge(l,h)}}const Dt=Symbol("Resolved");function Se(r,t,e){if(e.codingPath.length>32)throw new Error("Maximum decoding depth exceeded");if(r.isExtension&&!t.canRead())return e.strictExtensions?ie(r,e):null;if(r.isOptional&&t.readByte()===0)return null;if(r.isArray){const o=t.readVaruint32(),a=[];for(let l=0;l<o;l++)e.codingPath.push({field:l,type:r}),a.push(n()),e.codingPath.pop();return a}else return n();function n(){const o=e.types[r.name];if(o&&o.fromABI)return o.fromABI(t);if(r.ref){e.codingPath.push({field:"",type:r.ref});const a=Se(r.ref,t,e);return e.codingPath.pop(),a}else if(r.fields){const a=r.allFields;if(!a)throw new Error("Invalid struct fields");const l={};for(const h of a)e.codingPath.push({field:h.name,type:h.type}),l[h.name]=Se(h.type,t,e),e.codingPath.pop();return o?(l[Dt]=!0,o.from(l)):l}else if(r.variant){const a=t.readByte(),l=r.variant[a];if(!l)throw new Error(`Unknown variant idx: ${a}`);e.codingPath.push({field:`v${a}`,type:l});const h=[l.typeName,Se(l,t,e)];return e.codingPath.pop(),o?o.from(h):h}else throw o?new Error("Invalid type"):new Error(r.name==="any"?"Unable to decode 'any' type from binary":"Unknown type")}}function ne(r,t,e){if(r==null){if(t.isOptional)return null;if(t.isExtension)return e.strictExtensions?ie(t,e):null;throw new Error(`Unexpectedly encountered ${r} for non-optional`)}else if(t.isArray){if(!Array.isArray(r))throw new Error("Expected array");const o=[],a=r.length;for(let l=0;l<a;l++)e.codingPath.push({field:l,type:t}),o.push(n(r[l])),e.codingPath.pop();return o}else return n(r);function n(o){const a=e.types[t.name];if(t.ref&&!a)return ne(o,t.ref,e);if(t.fields){if(typeof o!="object")throw new Error("Expected object");if(typeof a=="function"&&A(o,a))return o;const l=t.allFields;if(!l)throw new Error("Invalid struct fields");const h={};for(const p of l)e.codingPath.push({field:p.name,type:p.type}),h[p.name]=ne(o[p.name],p.type,e),e.codingPath.pop();return a?(h[Dt]=!0,a.from(h)):h}else if(t.variant){let l;Array.isArray(o)&&o.length===2&&typeof o[0]=="string"?(l=o[0],o=o[1]):A(o,Ft)?(l=o.variantName,o=o.value):l=Oe(o);const h=t.variant.findIndex(J=>J.typeName===l);if(h===-1)throw new Error(`Unknown variant type: ${l}`);const p=t.variant[h];e.codingPath.push({field:`v${h}`,type:p});const w=[p.typeName,ne(o,p,e)];return e.codingPath.pop(),a?(w[Dt]=!0,a.from(w)):w}else{if(!a){if(t.name==="any")return o;throw new Error("Unknown type")}return a.from(o)}}}function ie(r,t,e=new Set){if(r.isArray)return[];if(r.isOptional)return null;const n=t.types[r.name];if(n&&n.abiDefault)return n.abiDefault();if(e.has(r.name))throw new Error("Circular type reference");if(e.add(r.name),r.allFields){const o={};for(const a of r.allFields)t.codingPath.push({field:a.name,type:a.type}),o[a.name]=ie(a.type,t,e),t.codingPath.pop();return n?(o[Dt]=!0,n.from(o)):o}if(r.variant&&r.variant.length>0){const o=[r.variant[0].typeName,ie(r.variant[0],t)];return n?(o[Dt]=!0,n.from(o)):o}if(r.ref){t.codingPath.push({field:"",type:r.ref});const o=ie(r.ref,t,e);return t.codingPath.pop(),o}throw new Error("Unable to determine default value")}class oe{constructor(t){this.array=t,this.pos=0,this.textDecoder=new TextDecoder("utf-8",{fatal:!0}),this.metadata={},this.data=new DataView(t.buffer,t.byteOffset,t.byteLength)}canRead(t=1){return!(this.pos+t>this.array.byteLength)}ensure(t){if(!this.canRead(t))throw new Error("Read past end of buffer")}setPosition(t){if(t<0||t>this.array.byteLength)throw new Error("Invalid position");this.pos=t}getPosition(){return this.pos}advance(t){this.ensure(t),this.pos+=t}readByte(){return this.ensure(1),this.array[this.pos++]}readFloat(t){this.ensure(t);let e;switch(t){case 4:e=this.data.getFloat32(this.pos,!0);break;case 8:e=this.data.getFloat64(this.pos,!0);break;default:throw new Error("Invalid float size")}return this.pos+=t,e}readVaruint32(){let t=0,e=0;for(;;){const n=this.readByte();if(t|=(n&127)<<e,e+=7,!(n&128))break}return t>>>0}readVarint32(){const t=this.readVaruint32();return t&1?~t>>1|2147483648:t>>>1}readArray(t){this.ensure(t);const e=this.array.subarray(this.pos,this.pos+t);return this.pos+=t,e}readString(){const t=this.readVaruint32();return this.textDecoder.decode(this.readArray(t))}}oe.__className="ABIDecoder";class ze extends Error{constructor(t,e){const n=t.codingPath.map(({field:o,type:a})=>typeof o=="number"?o:`${o}<${a.typeName}>`).join(".");super(`Encoding error at ${n}: ${e.message}`),this.stack=e.stack,this.ctx=t,this.underlyingError=e}}ze.__className="EncodingError";function rt(r){let t,e;typeof r.type=="string"?e=r.type:r.type&&U(r.type)?(typeof r.type.type!="string"&&(t=r.type.type),e=j(r.type)):r.type&&r.type.abiName!==void 0?(t=r.type,e=r.type.abiName):(t=Ce(r.object),t&&(e=t.abiName,Array.isArray(r.object)&&(e+="[]")));const n=r.customTypes?r.customTypes.slice():[];if(t)n.unshift(t);else if(e){const p=new W.ResolvedType(e).name;t=n.find(w=>w.abiName===p)}let o;if(r.abi&&e)o=W.from(r.abi).resolveType(e);else if(t){const p=O(t);o=p.abi.resolveType(e||t.abiName),n.push(...p.types)}else if(e)o=new W.ResolvedType(e);else throw new Error("Unable to determine the type of the object to be encoded. To encode custom ABI types you must pass the type argument.");const a=bt(n),l=r.encoder||new Je;r.metadata&&(l.metadata=r.metadata);const h={types:a,encoder:l,codingPath:[{field:"root",type:o}]};try{ke(r.object,o,h)}catch(p){throw new ze(h,p)}return S.from(l.getData())}function ke(r,t,e){const n=r!=null;if(t.isOptional&&(e.encoder.writeByte(n?1:0),!n))return;if(t.isArray){if(!Array.isArray(r))throw new Error(`Expected array for: ${t.typeName}`);const a=r.length;e.encoder.writeVaruint32(a);for(let l=0;l<a;l++)e.codingPath.push({field:l,type:t}),o(r[l]),e.codingPath.pop()}else o(r);function o(a){const l=e.types[t.name];if(t.ref&&!l){ke(a,t.ref,e);return}if(!n){if(t.isExtension)return;throw new Error(`Found ${a} for non-optional type: ${t.typeName}`)}if(l&&l.toABI)l.toABI(a,e.encoder);else if(typeof a.toABI=="function"&&a.constructor.abiName===t.name)a.toABI(e.encoder);else if(t.fields){if(typeof a!="object")throw new Error(`Expected object for: ${t.name}`);const h=t.allFields;if(!h)throw new Error("Invalid struct fields");for(const p of h)e.codingPath.push({field:p.name,type:p.type}),ke(a[p.name],p.type,e),e.codingPath.pop()}else if(t.variant){let h;Array.isArray(a)&&a.length===2&&typeof a[0]=="string"?(h=a[0],a=a[1]):A(a,Ft)?(h=a.variantName,a=a.value):h=Oe(a);const p=t.variant.findIndex(J=>J.typeName===h);if(p===-1){const J=t.variant.map(q=>`'${q.typeName}'`).join(", ");throw new Error(`Unknown variant type '${h}', expected one of ${J}`)}const w=t.variant[p];e.encoder.writeVaruint32(p),e.codingPath.push({field:`v${p}`,type:w}),ke(a,w,e),e.codingPath.pop()}else{if(!l)throw new Error(t.name==="any"?"Unable to encode any type to binary":"Unknown type");const h=l.from(a);if(!h.toABI)throw new Error(`Invalid type ${t.name}, no encoding methods implemented`);h.toABI(e.encoder)}}}class Je{constructor(t=1024){this.pageSize=t,this.pos=0,this.textEncoder=new TextEncoder,this.metadata={};const e=new ArrayBuffer(t);this.data=new DataView(e),this.array=new Uint8Array(e)}ensure(t){if(this.data.byteLength>=this.pos+t)return;const e=Math.ceil(t/this.pageSize),n=this.data.byteLength+this.pageSize*e,o=new ArrayBuffer(n),a=new DataView(o),l=new Uint8Array(o);l.set(this.array),this.data=a,this.array=l}writeByte(t){this.ensure(1),this.array[this.pos++]=t}writeArray(t){const e=t.length;this.ensure(e),this.array.set(t,this.pos),this.pos+=e}writeFloat(t,e){switch(this.ensure(e),e){case 4:this.data.setFloat32(this.pos,t,!0);break;case 8:this.data.setFloat64(this.pos,t,!0);break;default:throw new Error("Invalid float size")}this.pos+=e}writeVaruint32(t){for(this.ensure(4);;)if(t>>>7)this.array[this.pos++]=128|t&127,t=t>>>7;else{this.array[this.pos++]=t;break}}writeVarint32(t){this.writeVaruint32(t<<1^t>>31)}writeString(t){const e=this.textEncoder.encode(t);this.writeVaruint32(e.byteLength),this.writeArray(e)}getData(){return new Uint8Array(this.array.buffer,this.array.byteOffset,this.pos)}getBytes(){return new S(this.getData())}}Je.__className="ABIEncoder";class i{constructor(t){const e=this.constructor;for(const n of e.structFields)this[n.name]=t[n.name]}static from(t){return t[Dt]===!0?new this(t):A(t,this)?t:Ct({object:t,type:this})}static get structFields(){const t=[],e=n=>{n.abiBase&&e(n.abiBase);for(const o of n.abiFields||[])t.push(o)};return e(this),t}equals(t){const e=this.constructor;return t.constructor&&typeof t.constructor.abiName=="string"&&t.constructor.abiName!==e.abiName?!1:rt({object:this}).equals(rt({object:e.from(t)}))}toJSON(){const t=this.constructor,e={};for(const n of t.structFields)e[n.name]=this[n.name];return e}}i.abiName="__struct",function(r){const t=Symbol("FieldsOwner");function e(o){return function(a){return a.abiName=o,a}}r.type=e;function n(o,a={}){return(l,h)=>{const p=l.constructor;p.abiFields?p.abiFields[t]!==p&&(p.abiBase=p.abiFields[t],p.abiFields=[],p.abiFields[t]=p):(p.abiFields=[],p.abiFields[t]=p),p.abiFields.push({...a,name:h,type:o})}}r.field=n}(i||(i={}));function ir(r){return function(t){return t.abiAlias={type:Object.getPrototypeOf(t.prototype).constructor},t.abiName=r,t}}class Ft{constructor(t){const e=this.constructor.abiVariant;this.value=t[1];const n=e.map(j).findIndex(o=>o===t[0]);if(0>n||e.length<=n)throw new Error(`Unknown variant ${t[0]}`);this.variantIdx=n}static from(t){return t[Dt]?new this(t):A(t,this)?t:Ct({object:t,type:this})}equals(t){const n=this.constructor.from(t);return this.variantIdx!==n.variantIdx?!1:rt({object:this}).equals(rt({object:n}))}get variantName(){const t=this.constructor.abiVariant[this.variantIdx];return j(t)}toJSON(){return[this.variantName,this.value]}}Ft.abiName="__variant",Ft.abiVariant=[],function(r){function t(e,n){return function(o){return o.abiName=e,o.abiVariant=n.map(Y),o}}r.type=t}(Ft||(Ft={}));class se{constructor(t){if(!Number.isFinite(t))throw new Error("Invalid number");this.value=t}static from(t){return A(t,this)?t:(typeof t=="string"?t=Number.parseFloat(t):A(t,se)&&(t=t.value),new this(t))}static fromABI(t){return new this(t.readFloat(this.byteWidth))}static abiDefault(){return this.from(0)}static random(){const t=vt(this.byteWidth),e=new oe(t);return this.fromABI(e)}equals(t){const e=this.constructor;return this.value===e.from(t).value}toABI(t){const e=this.constructor;t.writeFloat(this.value,e.byteWidth)}toString(){return this.value.toString()}toJSON(){return this.toString()}}se.abiName="__float";class De extends se{toString(){return this.value.toFixed(7)}}De.abiName="float32",De.byteWidth=4;class xe extends se{}xe.abiName="float64",xe.byteWidth=8;class Ee{constructor(t){if(t.array.length!==16)throw new Error("Invalid float128");this.data=t}static from(t){return A(t,this)?t:(typeof t=="string"&&t.startsWith("0x")&&(t=t.slice(2)),new this(S.from(t)))}static fromABI(t){return new this(new S(t.readArray(this.byteWidth)))}static random(){const t=vt(16),e=new oe(t);return this.fromABI(e)}equals(t){const e=this.constructor;return this.data.equals(e.from(t).data)}toABI(t){t.writeArray(this.data.array)}toString(){return"0x"+this.data.hexString}toJSON(){return this.toString()}}Ee.abiName="float128",Ee.byteWidth=16;class I{constructor(t){this.value=t}get rawValue(){return this.value}static from(t){if(A(t,I))return t;if(typeof t=="string")return new I(or(t));if(A(t,f))return new I(t);throw new Error("Invalid name")}static fromABI(t){return new I(f.fromABI(t))}static abiDefault(){return new this(f.from(0))}equals(t){return this.value.equals(I.from(t).value)}toString(){return sr(this.value)}toABI(t){this.value.toABI(t)}toJSON(){return this.toString()}}I.abiName="name",I.pattern=/^[a-z1-5.]{0,13}$/;function or(r){function t(o){return o>="a".charCodeAt(0)&&o<="z".charCodeAt(0)?o-"a".charCodeAt(0)+6:o>="1".charCodeAt(0)&&o<="5".charCodeAt(0)?o-"1".charCodeAt(0)+1:0}const e=new Uint8Array(8);let n=63;for(let o=0;o<r.length;++o){let a=t(r.charCodeAt(o));n<5&&(a=a<<1);for(let l=4;l>=0;--l)n>=0&&(e[Math.floor(n/8)]|=(a>>l&1)<<n%8,--n)}return f.from(e)}function sr(r){const t=r.value.toArray("le",8);let e="";for(let n=63;n>=0;){let o=0;for(let a=0;a<5;++a)n>=0&&(o=o<<1|t[Math.floor(n/8)]>>n%8&1,--n);o>=6?e+=String.fromCharCode(o+"a".charCodeAt(0)-6):o>=1?e+=String.fromCharCode(o+"1".charCodeAt(0)-1):e+="."}for(;e.endsWith(".");)e=e.substr(0,e.length-1);return e}class Mt{static from(t){return A(t,this)?t:A(t,Mt)?this.fromMilliseconds(t.toMilliseconds()):A(t,Date)?this.fromDate(t):typeof t=="string"?this.fromString(t):this.fromInteger(t)}static fromString(t){const e=Date.parse(t+"Z");if(!Number.isFinite(e))throw new Error("Invalid date string");return this.fromMilliseconds(e)}static fromDate(t){return this.fromMilliseconds(t.getTime())}static abiDefault(){return this.from(0)}toABI(t){this.value.toABI(t)}equals(t){const e=this.constructor;return this.toMilliseconds()===e.from(t).toMilliseconds()}toMilliseconds(){throw new Error("Not implemented")}toDate(){return new Date(this.toMilliseconds())}toJSON(){return this.toString()}}Mt.abiName="__time_point_base";class Ke extends Mt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(G.from(Math.round(t*1e3)))}static fromInteger(t){return new this(G.from(t))}static fromABI(t){return new this(G.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.dividing(1e3,"round"))}}Ke.abiName="time_point";class Ne extends Mt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(c.from(Math.round(t/1e3)))}static fromInteger(t){return new this(c.from(t))}static fromABI(t){return new this(c.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-5)}toMilliseconds(){return Number(this.value.cast(f).multiplying(1e3))}}Ne.abiName="time_point_sec";class Ie extends Mt{constructor(t){super(),this.value=t}static fromMilliseconds(t){return new this(c.from(Math.round((t-9466848e5)/500)))}static fromInteger(t){return new this(c.from(t))}static fromABI(t){return new this(c.fromABI(t))}toString(){return this.toDate().toISOString().slice(0,-1)}toMilliseconds(){return Number(this.value.cast(f).multiplying(500).adding(9466848e5))}}Ie.abiName="block_timestamp_type";class W{constructor(t){this.version=t.version||W.version,this.types=t.types||[],this.variants=t.variants||[],this.structs=t.structs||[],this.actions=t.actions||[],this.tables=t.tables||[],this.ricardian_clauses=t.ricardian_clauses||[]}static from(t){return A(t,W)?t:typeof t=="string"?new W(JSON.parse(t)):new W(t)}static fromABI(t){const e=t.readString(),n=[],o=t.readVaruint32();for(let g=0;g<o;g++)n.push({new_type_name:t.readString(),type:t.readString()});const a=[],l=t.readVaruint32();for(let g=0;g<l;g++){const E=t.readString(),T=t.readString(),R=t.readVaruint32(),it=[];for(let Ot=0;Ot<R;Ot++)it.push({name:t.readString(),type:t.readString()});a.push({base:T,name:E,fields:it})}const h=[],p=t.readVaruint32();for(let g=0;g<p;g++){const E=I.fromABI(t),T=t.readString(),R=t.readString();h.push({name:E,type:T,ricardian_contract:R})}const w=[],J=t.readVaruint32();for(let g=0;g<J;g++){const E=I.fromABI(t),T=t.readString(),R=[],it=t.readVaruint32();for(let _e=0;_e<it;_e++)R.push(t.readString());const Ot=[],wr=t.readVaruint32();for(let _e=0;_e<wr;_e++)Ot.push(t.readString());const _r=t.readString();w.push({name:E,index_type:T,key_names:R,key_types:Ot,type:_r})}const q=[],Rt=t.readVaruint32();for(let g=0;g<Rt;g++){const E=t.readString(),T=t.readString();q.push({id:E,body:T})}const C=t.readVaruint32();for(let g=0;g<C;g++)t.advance(8),t.advance(t.readVaruint32());const b=t.readVaruint32();for(let g=0;g<b;g++)t.advance(2),t.advance(t.readVaruint32());const k=[];if(t.canRead()){const g=t.readVaruint32();for(let E=0;E<g;E++){const T=t.readString(),R=[],it=t.readVaruint32();for(let Ot=0;Ot<it;Ot++)R.push(t.readString());k.push({name:T,types:R})}}return new W({version:e,types:n,structs:a,actions:h,tables:w,ricardian_clauses:q,variants:k})}toABI(t){t.writeString(this.version),t.writeVaruint32(this.types.length);for(const e of this.types)t.writeString(e.new_type_name),t.writeString(e.type);t.writeVaruint32(this.structs.length);for(const e of this.structs){t.writeString(e.name),t.writeString(e.base),t.writeVaruint32(e.fields.length);for(const n of e.fields)t.writeString(n.name),t.writeString(n.type)}t.writeVaruint32(this.actions.length);for(const e of this.actions)I.from(e.name).toABI(t),t.writeString(e.type),t.writeString(e.ricardian_contract);t.writeVaruint32(this.tables.length);for(const e of this.tables){I.from(e.name).toABI(t),t.writeString(e.index_type),t.writeVaruint32(e.key_names.length);for(const n of e.key_names)t.writeString(n);t.writeVaruint32(e.key_types.length);for(const n of e.key_types)t.writeString(n);t.writeString(e.type)}t.writeVaruint32(this.ricardian_clauses.length);for(const e of this.ricardian_clauses)t.writeString(e.id),t.writeString(e.body);t.writeVaruint32(0),t.writeVaruint32(0),t.writeVaruint32(this.variants.length);for(const e of this.variants){t.writeString(e.name),t.writeVaruint32(e.types.length);for(const n of e.types)t.writeString(n)}}resolveType(t){const e={};return this.resolve({name:t,types:e},{id:0})}resolveAll(){const t={},e={id:0};return{types:this.types.map(n=>this.resolve({name:n.new_type_name,types:t},e)),variants:this.variants.map(n=>this.resolve({name:n.name,types:t},e)),structs:this.structs.map(n=>this.resolve({name:n.name,types:t},e))}}resolve({name:t,types:e},n){const o=e[t];if(o)return o;const a=new W.ResolvedType(t,++n.id);e[a.typeName]=a;const l=this.types.find(w=>w.new_type_name==a.name);if(l)return a.ref=this.resolve({name:l.type,types:e},n),a;const h=this.getStruct(a.name);if(h)return h.base&&(a.base=this.resolve({name:h.base,types:e},n)),a.fields=h.fields.map(w=>({name:w.name,type:this.resolve({name:w.type,types:e},n)})),a;const p=this.getVariant(a.name);return p&&(a.variant=p.types.map(w=>this.resolve({name:w,types:e},n))),a}getStruct(t){return this.structs.find(e=>e.name==t)}getVariant(t){return this.variants.find(e=>e.name==t)}getActionType(t){const e=I.from(t).toString(),n=this.actions.find(o=>o.name.toString()===e);if(n)return n.type}equals(t){const e=W.from(t);return this.version!=e.version||this.types.length!=e.types.length||this.structs.length!=e.structs.length||this.actions.length!=e.actions.length||this.tables.length!=e.tables.length||this.ricardian_clauses.length!=e.ricardian_clauses.length||this.variants.length!=e.variants.length?!1:rt({object:this}).equals(rt({object:e}))}toJSON(){return{version:this.version,types:this.types,structs:this.structs,actions:this.actions,tables:this.tables,ricardian_clauses:this.ricardian_clauses,error_messages:[],abi_extensions:[],variants:this.variants}}}W.abiName="abi",W.version="eosio::abi/1.1",function(r){class t{constructor(n,o=0){let a=n;a.endsWith("$")?(a=a.slice(0,-1),this.isExtension=!0):this.isExtension=!1,a.endsWith("?")?(a=a.slice(0,-1),this.isOptional=!0):this.isOptional=!1,a.endsWith("[]")?(a=a.slice(0,-2),this.isArray=!0):this.isArray=!1,this.id=o,this.name=a}get typeName(){let n=this.name;return this.isArray&&(n+="[]"),this.isOptional&&(n+="?"),this.isExtension&&(n+="$"),n}get allFields(){let n=this;const o=[],a=new Set;do{if(!n.fields||a.has(n.name))return;for(let l=n.fields.length-1;l>=0;l--)o.unshift(n.fields[l]);a.add(n.name),n=n.base}while(n!==void 0);return o}}r.ResolvedType=t}(W||(W={}));class V{constructor(t,e){this.units=t,this.symbol=e}static from(t,e){if(A(t,V))return t;switch(typeof t){case"number":if(!e)throw new Error("Symbol is required when creating Asset from number");return this.fromFloat(t,e);case"string":return this.fromString(t);default:throw new Error("Invalid asset")}}static fromString(t){const e=(typeof t=="string"?t:"").split(" ");if(e.length!==2)throw new Error("Invalid asset string");const n=e[0].replace(".",""),o=(e[0].split(".")[1]||"").length,a=V.Symbol.fromParts(e[1],o);return new V(G.from(n),a)}static fromFloat(t,e){const n=V.Symbol.from(e);return new V(n.convertFloat(t),n)}static fromUnits(t,e){return new V(G.from(t),V.Symbol.from(e))}static fromABI(t){const e=G.fromABI(t),n=V.Symbol.fromABI(t);return new V(e,n)}static abiDefault(){return new this(G.from(0),V.Symbol.abiDefault())}equals(t){const{symbol:e,units:n}=V.from(t);return this.symbol.value.equals(e.value)&&this.units.equals(n)}get value(){return this.symbol.convertUnits(this.units)}set value(t){this.units=this.symbol.convertFloat(t)}toABI(t){this.units.toABI(t),this.symbol.toABI(t)}toString(){const t=this.units.toString().split("");let e=!1;t[0]==="-"&&(e=!0,t.shift());const n=this.symbol.precision;for(;t.length<=n;)t.unshift("0");n>0&&t.splice(t.length-n,0,".");let o=t.join("");return e&&(o="-"+o),o+" "+this.symbol.name}toJSON(){return this.toString()}}V.abiName="asset",function(r){class t{constructor(o){if(He(o)>t.maxPrecision)throw new Error("Invalid asset symbol, precision too large");if(!t.symbolNamePattern.test(Ze(o)))throw new Error("Invalid asset symbol, name must be uppercase A-Z");this.value=o}static from(o){if(A(o,t))return o;if(A(o,f))return new t(o);const a=o.split(",");if(a.length!==2)throw new Error("Invalid symbol string");const l=Number.parseInt(a[0]);return t.fromParts(a[1],l)}static fromParts(o,a){return new t(ar(o,a))}static fromABI(o){return new t(f.fromABI(o))}static abiDefault(){return this.from("4,SYS")}equals(o){return this.value.equals(t.from(o).value)}get name(){return Ze(this.value)}get precision(){return He(this.value)}get code(){return new e(f.from(this.value.value.clone().iushrn(8)))}toABI(o){this.value.toABI(o)}convertUnits(o){return o.value.toNumber()/Math.pow(10,this.precision)}convertFloat(o){return G.from(o.toFixed(this.precision).replace(".",""))}toString(){return`${this.precision},${this.name}`}toJSON(){return this.toString()}}t.abiName="symbol",t.symbolNamePattern=/^[A-Z]{0,7}$/,t.maxPrecision=18,r.Symbol=t;class e{constructor(o){this.value=o}static from(o){return A(o,e)?o:(typeof o=="string"&&(o=f.from(Qe(o))),new this(f.from(o)))}static fromABI(o){return new e(f.fromABI(o))}static abiDefault(){return this.from("SYS")}equals(o){return this.value.equals(e.from(o).value)}toABI(o){this.value.toABI(o)}toString(){return Ye(this.value.value.toArray("be"))}toJSON(){return this.toString()}}e.abiName="symbol_code",r.SymbolCode=e}(V||(V={}));class ae{constructor(t,e){this.quantity=t,this.contract=e}static from(t){return A(t,ae)?t:new this(V.from(t.quantity),I.from(t.contract))}static fromABI(t){return new ae(V.fromABI(t),I.fromABI(t))}equals(t){return this.quantity.equals(t.quantity)&&this.contract.equals(t.contract)}toABI(t){this.quantity.toABI(t),this.contract.toABI(t)}toJSON(){return{quantity:this.quantity,contract:this.contract}}}ae.abiName="extended_asset";function He(r){return r.value.and(f.from(255).value).toNumber()}function Ze(r){const t=r.value.toArray("be").slice(0,-1);return Ye(t)}function Ye(r){return r.map(t=>String.fromCharCode(t)).reverse().join("")}function ar(r,t){const e=Qe(r),n=new Uint8Array(e.length+1);return n[0]=t,n.set(e,1),f.from(n)}function Qe(r){const t=Math.min(r.length,7),e=new Uint8Array(t);for(let n=0;n<t;n++)e[n]=r.charCodeAt(n);return e}var H;(function(r){let t;(function(b){b.E_CHECKSUM="E_CHECKSUM",b.E_INVALID="E_INVALID"})(t=r.ErrorCode||(r.ErrorCode={}));class e extends Error{constructor(k,g,E={}){super(k),this.code=g,this.info=E}}e.__className="DecodingError",r.DecodingError=e;const n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",o=new Int16Array(255).fill(-1);for(let b=0;b<58;++b)o[n.charCodeAt(b)]=b;function a(b,k){if(k==null)return q(b);const g=new Uint8Array(k);for(let E=0;E<b.length;++E){let T=o[b.charCodeAt(E)];if(T<0)throw new e("Invalid Base58 character encountered",t.E_INVALID,{char:b[E]});for(let R=0;R<k;++R){const it=g[R]*58+T;g[R]=it,T=it>>8}if(T)throw new e("Base58 value is out of range",t.E_INVALID)}return g.reverse(),new S(g)}r.decode=a;function l(b,k){const g=a(b,k!=null?k+4:k),E=g.array.subarray(0,-4),T=g.array.subarray(-4),R=C(E);if(!Yt(T,R))throw new e("Checksum mismatch",t.E_CHECKSUM,{actual:R,expected:T,data:E,hash:"double_sha256"});return new S(E)}r.decodeCheck=l;function h(b,k,g){const E=a(b,k!=null?k+4:k),T=E.array.subarray(0,-4),R=E.array.subarray(-4),it=Rt(T,g);if(!Yt(R,it))throw new e("Checksum mismatch",t.E_CHECKSUM,{actual:it,expected:R,data:T,hash:"ripemd160"});return new S(T)}r.decodeRipemd160Check=h;function p(b){b=S.from(b);const k=[];for(const g of b.array){let E=g;for(let T=0;T<k.length;++T){const R=(o[k[T]]<<8)+E;k[T]=n.charCodeAt(R%58),E=R/58|0}for(;E;)k.push(n.charCodeAt(E%58)),E=E/58|0}for(const g of b.array){if(g)break;k.push("1".charCodeAt(0))}return k.reverse(),String.fromCharCode(...k)}r.encode=p;function w(b){return b=S.from(b),b=b.appending(C(b.array)),p(b)}r.encodeCheck=w;function J(b,k){return b=S.from(b),b=b.appending(Rt(b.array,k)),p(b)}r.encodeRipemd160Check=J;function q(b){const k=[];for(let g=0;g<b.length;++g){let E=o[b.charCodeAt(g)];if(E<0)throw new e("Invalid Base58 character encountered",t.E_INVALID,{char:b[g]});for(let T=0;T<k.length;++T){const R=k[T]*58+E;k[T]=R&255,E=R>>8}E&&k.push(E)}for(const g of b)if(g==="1")k.push(0);else break;return k.reverse(),S.from(k)}function Rt(b,k){const g=(0,ut.ripemd160)().update(b);return k&&g.update(k),new Uint8Array(g.digest().slice(0,4))}function C(b){const k=(0,ut.sha256)().update(b).digest(),g=(0,ut.sha256)().update(k).digest();return new Uint8Array(g.slice(0,4))}})(H||(H={}));class Z{constructor(t,e){this.type=t,this.data=e}static from(t){if(A(t,Z))return t;if(typeof t=="object"&&t.type&&t.compressed)return new Z(x.from(t.type),new S(t.compressed));if(typeof t!="string")throw new Error("Invalid public key");if(t.startsWith("PUB_")){const e=t.split("_");if(e.length!==3)throw new Error("Invalid public key string");const n=x.from(e[1]),o=n===x.K1||n===x.R1?33:void 0,a=H.decodeRipemd160Check(e[2],o,n);return new Z(n,a)}else if(t.length>=50){const e=H.decodeRipemd160Check(t.slice(-50));return new Z(x.K1,e)}else throw new Error("Invalid public key string")}static fromABI(t){const e=x.from(t.readByte());if(e==x.WA){const n=t.getPosition();t.advance(33),t.advance(1),t.advance(t.readVaruint32());const o=t.getPosition()-n;t.setPosition(n);const a=S.from(t.readArray(o));return new Z(x.WA,a)}return new Z(e,new S(t.readArray(33)))}equals(t){const e=Z.from(t);return this.type===e.type&&this.data.equals(e.data)}toLegacyString(t="EOS"){if(this.type!==x.K1)throw new Error("Unable to create legacy formatted string for non-K1 key");return`${t}${H.encodeRipemd160Check(this.data)}`}toString(){return`PUB_${this.type}_${H.encodeRipemd160Check(this.data,this.type)}`}toABI(t){t.writeByte(x.indexFor(this.type)),t.writeArray(this.data.array)}toJSON(){return this.toString()}}Z.abiName="public_key";const je={};function $t(r){let t=je[r];if(!t)if(r==="K1")t=je[r]=new ve.ec("secp256k1");else if(r==="R1")t=je[r]=new ve.ec("p256");else throw new Error(`Unknown curve type: ${r}`);return t}function cr(r,t,e){const n=$t(e),o=r[0]-31,a=r.subarray(1,33),l=r.subarray(33),h=n.recoverPubKey(t,{r:a,s:l},o);return new Uint8Array(h.encodeCompressed())}function ur(r,t,e,n){const o=$t(n),a=r.subarray(1,33),l=r.subarray(33);return o.verify(t,{r:a,s:l},e)}class at{constructor(t,e){this.type=t,this.data=e}static from(t){if(A(t,at))return t;if(typeof t=="object"&&t.r&&t.s){const e=new Uint8Array(65);let n=t.recid;const o=x.from(t.type);return(t.type===x.K1||t.type===x.R1)&&(n+=31),e[0]=n,e.set(t.r,1),e.set(t.s,33),new at(o,new S(e))}if(typeof t!="string")throw new Error("Invalid signature");if(t.startsWith("SIG_")){const e=t.split("_");if(e.length!==3)throw new Error("Invalid signature string");const n=x.from(e[1]),o=n===x.K1||n===x.R1?65:void 0,a=H.decodeRipemd160Check(e[2],o,n);return new at(n,a)}else throw new Error("Invalid signature string")}static fromABI(t){const e=x.from(t.readByte());if(e===x.WA){const n=t.getPosition();t.advance(65),t.advance(t.readVaruint32()),t.advance(t.readVaruint32());const o=t.getPosition()-n;t.setPosition(n);const a=S.from(t.readArray(o));return new at(x.WA,a)}return new at(e,new S(t.readArray(65)))}equals(t){const e=at.from(t);return this.type===e.type&&this.data.equals(e.data)}recoverDigest(t){t=B.from(t);const e=cr(this.data.array,t.array,this.type);return Z.from({compressed:e,type:this.type})}recoverMessage(t){return this.recoverDigest(B.hash(t))}verifyDigest(t,e){return t=B.from(t),ur(this.data.array,t.array,e.data.array,this.type)}verifyMessage(t,e){return this.verifyDigest(B.hash(t),e)}toString(){return`SIG_${this.type}_${H.encodeRipemd160Check(this.data,this.type)}`}toABI(t){t.writeByte(x.indexFor(this.type)),t.writeArray(this.data.array)}toJSON(){return this.toString()}}at.abiName="signature";function fr(r,t){const o=$t(t).keyFromPrivate(r).getPublic();return new Uint8Array(o.encodeCompressed())}function lr(r,t,e){const n=$t(e),o=n.keyFromPrivate(r),a=n.keyFromPublic(t).getPublic();return o.derive(a).toArrayLike(Uint8Array,"be")}function dr(r,t,e){const o=$t(e).keyFromPrivate(r);let a,l,h;if(e==="K1"){let p=1;do a=o.sign(t,{canonical:!0,pers:[p++]}),l=a.r.toArrayLike(Uint8Array,"be",32),h=a.s.toArrayLike(Uint8Array,"be",32);while(!pr(l,h))}else a=o.sign(t,{canonical:!0}),l=a.r.toArrayLike(Uint8Array,"be",32),h=a.s.toArrayLike(Uint8Array,"be",32);return{type:e,r:l,s:h,recid:a.recoveryParam||0}}function pr(r,t){return!(r[0]&128)&&!(r[0]===0&&!(r[1]&128))&&!(t[0]&128)&&!(t[0]===0&&!(t[1]&128))}function hr(r){return $t(r).genKeyPair().getPrivate().toArrayLike(Uint8Array,"be",32)}class Te{constructor(t,e){if((t===x.K1||t===x.R1)&&e.length!==32)throw new Error("Invalid private key length");this.type=t,this.data=e}static from(t){return A(t,Te)?t:this.fromString(t)}static fromString(t,e=!1){try{const{type:n,data:o}=yr(t);return new this(n,o)}catch(n){if(n.message=`Invalid private key (${n.message})`,e&&A(n,H.DecodingError)&&n.code===H.ErrorCode.E_CHECKSUM){const o=t.startsWith("PVT_R1")?x.R1:x.K1,a=new S(n.info.data);return a.length===33&&a.dropFirst(),a.zeropad(32,!0),new this(o,a)}throw n}}static generate(t){return new Te(x.from(t),new S(hr(t)))}signDigest(t){return t=B.from(t),at.from(dr(this.data.array,t.array,this.type))}signMessage(t){return this.signDigest(B.hash(t))}sharedSecret(t){const e=lr(this.data.array,t.data.array,this.type);return St.hash(e)}toPublic(){const t=fr(this.data.array,this.type);return Z.from({compressed:t,type:this.type})}toWif(){if(this.type!==x.K1)throw new Error("Unable to generate WIF for non-k1 key");return H.encodeCheck(S.from([128]).appending(this.data))}toString(){return`PVT_${this.type}_${H.encodeRipemd160Check(this.data,this.type)}`}toJSON(){return this.toString()}}function yr(r){const t=typeof r;if(t!=="string")throw new Error(`Expected string, got ${t}`);if(r.startsWith("PVT_")){const e=r.split("_");if(e.length!==3)throw new Error("Invalid PVT format");const n=x.from(e[1]);let o;switch(n){case x.K1:case x.R1:o=32;break}const a=H.decodeRipemd160Check(e[2],o,n);return{type:n,data:a}}else{const e=x.K1,n=H.decodeCheck(r);if(n.array[0]!==128)throw new Error("Invalid WIF");return{type:e,data:n.droppingFirst()}}}var Ue;let qt=Ue=class extends i{static from(t){if(typeof t=="string"){const e=t.split("@");if(e.length!==2&&e[0].length>0&&e[1].length>0)throw new Error("Invalid permission level string, should be in the format <actor>@<permission>");t={actor:e[0],permission:e[1]}}return super.from(t)}equals(t){const e=Ue.from(t);return this.actor.equals(e.actor)&&this.permission.equals(e.permission)}toString(){return`${this.actor}@${this.permission}`}};(0,s.gn)([i.field("name")],qt.prototype,"actor",void 0),(0,s.gn)([i.field("name")],qt.prototype,"permission",void 0),qt=Ue=(0,s.gn)([i.type("permission_level")],qt);var Ve;let wt=Ve=class extends i{static from(t,e){const n=t.data;if(!S.isBytes(n)){let o;if(e)o=W.from(e).getActionType(t.name);else if(!n.constructor||n.constructor.abiName===void 0)throw new Error("Missing ABI definition when creating action with untyped action data");t={...t,data:rt({object:n,type:o,abi:e})}}return super.from(t)}equals(t){const e=Ve.from(t);return this.account.equals(e.account)&&this.name.equals(e.name)&&qe(this.authorization,e.authorization)&&this.data.equals(e.data)}decodeData(t){if(typeof t=="string"||t.abiName)return Ct({data:this.data,type:t});{const e=W.from(t),n=e.getActionType(this.name);if(!n)throw new Error(`Action ${this.name} does not exist in provided ABI`);return Ct({data:this.data,type:n,abi:e})}}};(0,s.gn)([i.field("name")],wt.prototype,"account",void 0),(0,s.gn)([i.field("name")],wt.prototype,"name",void 0),(0,s.gn)([i.field(qt,{array:!0})],wt.prototype,"authorization",void 0),(0,s.gn)([i.field("bytes")],wt.prototype,"data",void 0),wt=Ve=(0,s.gn)([i.type("action")],wt);var We;let ce=class extends i{};(0,s.gn)([i.field("uint16")],ce.prototype,"type",void 0),(0,s.gn)([i.field("bytes")],ce.prototype,"data",void 0),ce=(0,s.gn)([i.type("transaction_extension")],ce);let dt=class extends i{static from(t){return super.from({max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,...t})}};(0,s.gn)([i.field("time_point_sec")],dt.prototype,"expiration",void 0),(0,s.gn)([i.field("uint16")],dt.prototype,"ref_block_num",void 0),(0,s.gn)([i.field("uint32")],dt.prototype,"ref_block_prefix",void 0),(0,s.gn)([i.field("varuint32")],dt.prototype,"max_net_usage_words",void 0),(0,s.gn)([i.field("uint8")],dt.prototype,"max_cpu_usage_ms",void 0),(0,s.gn)([i.field("varuint32")],dt.prototype,"delay_sec",void 0),dt=(0,s.gn)([i.type("transaction_header")],dt);let ct=We=class extends dt{static from(t,e){const n=p=>{if(e)return Array.isArray(e)?e.filter(w=>I.from(w.contract).equals(p)).map(({abi:w})=>w)[0]:e},o=p=>wt.from(p,n(p.account)),a=(t.actions||[]).map(o),l=(t.context_free_actions||[]).map(o),h={transaction_extensions:[],...t,context_free_actions:l,actions:a};return super.from(h)}equals(t){const e=We.from(t);return this.id.equals(e.id)}get id(){return B.hash(rt({object:this}))}signingDigest(t){const e=this.signingData(t);return B.hash(e)}signingData(t){let e=S.from(B.from(t).array);return e=e.appending(rt({object:this})),e=e.appending(new Uint8Array(32)),e}};(0,s.gn)([i.field(wt,{array:!0})],ct.prototype,"context_free_actions",void 0),(0,s.gn)([i.field(wt,{array:!0})],ct.prototype,"actions",void 0),(0,s.gn)([i.field(ce,{array:!0})],ct.prototype,"transaction_extensions",void 0),ct=We=(0,s.gn)([i.type("transaction")],ct);let pt=class extends ct{get transaction(){return ct.from({...this,signatures:void 0,context_free_data:void 0})}get id(){return this.transaction.id}static from(t){return super.from({signatures:[],context_free_data:[],...t})}};(0,s.gn)([i.field("signature[]")],pt.prototype,"signatures",void 0),(0,s.gn)([i.field("bytes[]")],pt.prototype,"context_free_data",void 0),pt=(0,s.gn)([i.type("signed_transaction")],pt);let z=class extends i{static from(t){return super.from({signatures:[],packed_context_free_data:"",compression:0,...t})}static fromSigned(t){const e=ct.from(t);return this.from({signatures:t.signatures,packed_context_free_data:rt({object:t.context_free_data,type:"bytes[]"}),packed_trx:rt({object:e})})}getTransaction(){if(Number(this.compression)!==0)throw new Error("Transaction compression not supported yet");return Ct({data:this.packed_trx,type:ct})}getSignedTransaction(){const t=this.getTransaction();return pt.from({...t,signatures:this.signatures})}};(0,s.gn)([i.field("signature[]")],z.prototype,"signatures",void 0),(0,s.gn)([i.field("uint8")],z.prototype,"compression",void 0),(0,s.gn)([i.field("bytes")],z.prototype,"packed_context_free_data",void 0),(0,s.gn)([i.field("bytes")],z.prototype,"packed_trx",void 0),z=(0,s.gn)([i.type("packed_transaction")],z);let jt=class extends i{};(0,s.gn)([i.field("string")],jt.prototype,"status",void 0),(0,s.gn)([i.field("uint32")],jt.prototype,"cpu_usage_us",void 0),(0,s.gn)([i.field("uint32")],jt.prototype,"net_usage_words",void 0),jt=(0,s.gn)([i.type("transaction_receipt")],jt);var Fe;let ue=class extends u{};ue=(0,s.gn)([ir("weight_type")],ue);let fe=class extends i{};(0,s.gn)([i.field(Z)],fe.prototype,"key",void 0),(0,s.gn)([i.field(ue)],fe.prototype,"weight",void 0),fe=(0,s.gn)([i.type("key_weight")],fe);let le=class extends i{};(0,s.gn)([i.field(qt)],le.prototype,"permission",void 0),(0,s.gn)([i.field(ue)],le.prototype,"weight",void 0),le=(0,s.gn)([i.type("permission_level_weight")],le);let de=class extends i{};(0,s.gn)([i.field(c)],de.prototype,"wait_sec",void 0),(0,s.gn)([i.field(ue)],de.prototype,"weight",void 0),de=(0,s.gn)([i.type("wait_weight")],de);let Ut=Fe=class extends i{static from(t){if(A(t,Fe))return t;const e=super.from({keys:[],accounts:[],waits:[],...t});return e.sort(),e}get waitThreshold(){return this.waits.reduce((t,e)=>t+e.weight.toNumber(),0)}get keyThreshold(){return this.threshold.toNumber()-this.waitThreshold}keyWeight(t){const e=this.keys.find(({key:n})=>n.equals(t));return e?e.weight.toNumber():0}hasPermission(t,e=!1){const n=e?1:this.keyThreshold;return this.keyWeight(t)>=n}sort(){this.keys.sort((t,e)=>String(t.key).localeCompare(String(e.key))),this.accounts.sort((t,e)=>String(t.permission).localeCompare(String(e.permission))),this.waits.sort((t,e)=>String(t.wait_sec).localeCompare(String(e.wait_sec)))}};(0,s.gn)([i.field(c)],Ut.prototype,"threshold",void 0),(0,s.gn)([i.field(fe,{array:!0})],Ut.prototype,"keys",void 0),(0,s.gn)([i.field(le,{array:!0})],Ut.prototype,"accounts",void 0),(0,s.gn)([i.field(de,{array:!0})],Ut.prototype,"waits",void 0),Ut=Fe=(0,s.gn)([i.type("authority")],Ut);var xt;(function(r){r.encode=rt,r.decode=Ct;function t(o){return O(o).abi}r.synthesize=t;function e(o){return JSON.stringify(o)}r.stringify=e;function n(o){const a=l=>{switch(typeof l){case"boolean":case"number":case"string":return l;case"object":{if(l===null)return l;if(typeof l.toJSON=="function")return a(l.toJSON());if(Array.isArray(l))return l.map(a);const h={};for(const p of Object.keys(l))h[p]=a(l[p]);return h}}};return a(o)}r.objectify=n})(xt||(xt={}));class Xe{constructor(t,e={}){if(t=t.trim(),t.endsWith("/")&&(t=t.slice(0,-1)),this.url=t,e.fetch)this.fetch=e.fetch;else if(typeof window<"u"&&window.fetch)this.fetch=window.fetch.bind(window);else if(typeof L.g<"u"&&L.g.fetch)this.fetch=L.g.fetch.bind(L.g);else throw new Error("Missing fetch")}async call(t,e){const n=this.url+t,o=await this.fetch(n,{method:"POST",body:e!==void 0?JSON.stringify(e):void 0}),a=await o.text();let l;try{l=JSON.parse(a)}catch{}const h={};for(const[p,w]of Object.entries(o.headers))h[p]=w;return{headers:h,status:o.status,json:l,text:a}}}let Vt=class extends i{};(0,s.gn)([i.field("name")],Vt.prototype,"perm_name",void 0),(0,s.gn)([i.field("name")],Vt.prototype,"parent",void 0),(0,s.gn)([i.field(Ut)],Vt.prototype,"required_auth",void 0),Vt=(0,s.gn)([i.type("account_permission")],Vt);let Et=class extends i{};(0,s.gn)([i.field("int64")],Et.prototype,"used",void 0),(0,s.gn)([i.field("int64")],Et.prototype,"available",void 0),(0,s.gn)([i.field("int64")],Et.prototype,"max",void 0),Et=(0,s.gn)([i.type("account_resource_limit")],Et);let Nt=class extends i{};(0,s.gn)([i.field("name")],Nt.prototype,"owner",void 0),(0,s.gn)([i.field("asset")],Nt.prototype,"net_weight",void 0),(0,s.gn)([i.field("asset")],Nt.prototype,"cpu_weight",void 0),(0,s.gn)([i.field("uint64")],Nt.prototype,"ram_bytes",void 0),Nt=(0,s.gn)([i.type("account_total_resources")],Nt);let It=class extends i{};(0,s.gn)([i.field("name")],It.prototype,"from",void 0),(0,s.gn)([i.field("name")],It.prototype,"to",void 0),(0,s.gn)([i.field("asset")],It.prototype,"net_weight",void 0),(0,s.gn)([i.field("asset")],It.prototype,"cpu_weight",void 0),It=(0,s.gn)([i.type("account_self_delegated_bandwidth")],It);let Tt=class extends i{};(0,s.gn)([i.field("name")],Tt.prototype,"owner",void 0),(0,s.gn)([i.field("time_point")],Tt.prototype,"request_time",void 0),(0,s.gn)([i.field("asset")],Tt.prototype,"net_amount",void 0),(0,s.gn)([i.field("asset")],Tt.prototype,"cpu_amount",void 0),Tt=(0,s.gn)([i.type("account_refund_request")],Tt);let nt=class extends i{};(0,s.gn)([i.field("name")],nt.prototype,"owner",void 0),(0,s.gn)([i.field("name")],nt.prototype,"proxy",void 0),(0,s.gn)([i.field("name",{array:!0})],nt.prototype,"producers",void 0),(0,s.gn)([i.field("int64",{optional:!0})],nt.prototype,"staked",void 0),(0,s.gn)([i.field("bool")],nt.prototype,"is_proxy",void 0),(0,s.gn)([i.field("uint32",{optional:!0})],nt.prototype,"flags1",void 0),(0,s.gn)([i.field("uint32")],nt.prototype,"reserved2",void 0),(0,s.gn)([i.field("string")],nt.prototype,"reserved3",void 0),nt=(0,s.gn)([i.type("account_voter_info")],nt);let Pt=class extends i{};(0,s.gn)([i.field("time_point",{optional:!0})],Pt.prototype,"key",void 0),(0,s.gn)([i.field("int64",{optional:!0})],Pt.prototype,"value",void 0),(0,s.gn)([i.field("time_point",{optional:!0})],Pt.prototype,"first",void 0),(0,s.gn)([i.field("int64",{optional:!0})],Pt.prototype,"second",void 0),Pt=(0,s.gn)([i.type("account_rex_info_maturities")],Pt);let ht=class extends i{};(0,s.gn)([i.field("uint32")],ht.prototype,"version",void 0),(0,s.gn)([i.field("name")],ht.prototype,"owner",void 0),(0,s.gn)([i.field("asset")],ht.prototype,"vote_stake",void 0),(0,s.gn)([i.field("asset")],ht.prototype,"rex_balance",void 0),(0,s.gn)([i.field("int64")],ht.prototype,"matured_rex",void 0),(0,s.gn)([i.field(Pt,{array:!0})],ht.prototype,"rex_maturities",void 0),ht=(0,s.gn)([i.type("account_rex_info")],ht);let D=class extends i{getPermission(t){const e=I.from(t),n=this.permissions.find(o=>o.perm_name.equals(e));if(!n)throw new Error(`Unknown permission ${e} on account ${this.account_name}.`);return n}};(0,s.gn)([i.field("name")],D.prototype,"account_name",void 0),(0,s.gn)([i.field("uint32")],D.prototype,"head_block_num",void 0),(0,s.gn)([i.field("time_point")],D.prototype,"head_block_time",void 0),(0,s.gn)([i.field("bool")],D.prototype,"privileged",void 0),(0,s.gn)([i.field("time_point")],D.prototype,"last_code_update",void 0),(0,s.gn)([i.field("time_point")],D.prototype,"created",void 0),(0,s.gn)([i.field("asset?")],D.prototype,"core_liquid_balance",void 0),(0,s.gn)([i.field("int64")],D.prototype,"ram_quota",void 0),(0,s.gn)([i.field("int64")],D.prototype,"net_weight",void 0),(0,s.gn)([i.field("int64")],D.prototype,"cpu_weight",void 0),(0,s.gn)([i.field(Et)],D.prototype,"net_limit",void 0),(0,s.gn)([i.field(Et)],D.prototype,"cpu_limit",void 0),(0,s.gn)([i.field("uint64")],D.prototype,"ram_usage",void 0),(0,s.gn)([i.field(Vt,{array:!0})],D.prototype,"permissions",void 0),(0,s.gn)([i.field(Nt,{optional:!0})],D.prototype,"total_resources",void 0),(0,s.gn)([i.field(It,{optional:!0})],D.prototype,"self_delegated_bandwidth",void 0),(0,s.gn)([i.field(Tt,{optional:!0})],D.prototype,"refund_request",void 0),(0,s.gn)([i.field(nt,{optional:!0})],D.prototype,"voter_info",void 0),(0,s.gn)([i.field(ht,{optional:!0})],D.prototype,"rex_info",void 0),D=(0,s.gn)([i.type("account_object")],D);let Lt=class extends i{};(0,s.gn)([i.field("name")],Lt.prototype,"producer_name",void 0),(0,s.gn)([i.field("public_key")],Lt.prototype,"block_signing_key",void 0),Lt=(0,s.gn)([i.type("new_producers_entry")],Lt);let Gt=class extends i{};(0,s.gn)([i.field("uint32")],Gt.prototype,"version",void 0),(0,s.gn)([i.field(Lt,{array:!0})],Gt.prototype,"producers",void 0),Gt=(0,s.gn)([i.type("new_producers")],Gt);let pe=class extends i{};(0,s.gn)([i.field("uint16")],pe.prototype,"type",void 0),(0,s.gn)([i.field("bytes")],pe.prototype,"data",void 0),pe=(0,s.gn)([i.type("block_extension")],pe);let zt=class extends i{};(0,s.gn)([i.field("uint16")],zt.prototype,"type",void 0),(0,s.gn)([i.field("bytes")],zt.prototype,"data",void 0),zt=(0,s.gn)([i.type("header_extension")],zt);class Me{constructor(t,e){this.id=t,this.extra=e}static from(t){let e,n;return typeof t=="string"?(e=B.from(t),n={}):(e=B.from(t.id),n=t),new this(e,n)}get transaction(){if(this.extra.packed_trx)return xt.decode({data:this.extra.packed_trx,type:ct})}get signatures(){if(this.extra.signatures)return this.extra.signatures.map(at.from)}equals(t){return this.id.equals(t.id)}toJSON(){return this.id}}Me.abiName="trx_variant";let he=class extends jt{get id(){return this.trx.id}};(0,s.gn)([i.field(Me)],he.prototype,"trx",void 0),he=(0,s.gn)([i.type("get_block_response_receipt")],he);let F=class extends i{};(0,s.gn)([i.field("time_point")],F.prototype,"timestamp",void 0),(0,s.gn)([i.field("name")],F.prototype,"producer",void 0),(0,s.gn)([i.field("uint16")],F.prototype,"confirmed",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"previous",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"transaction_mroot",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"action_mroot",void 0),(0,s.gn)([i.field("uint32")],F.prototype,"schedule_version",void 0),(0,s.gn)([i.field(Gt,{optional:!0})],F.prototype,"new_producers",void 0),(0,s.gn)([i.field("header_extension",{optional:!0})],F.prototype,"header_extensions",void 0),(0,s.gn)([i.field("any",{optional:!0})],F.prototype,"new_protocol_features",void 0),(0,s.gn)([i.field("signature")],F.prototype,"producer_signature",void 0),(0,s.gn)([i.field(he,{array:!0})],F.prototype,"transactions",void 0),(0,s.gn)([i.field("block_extension",{optional:!0})],F.prototype,"block_extensions",void 0),(0,s.gn)([i.field("checksum256")],F.prototype,"id",void 0),(0,s.gn)([i.field("uint32")],F.prototype,"block_num",void 0),(0,s.gn)([i.field("uint32")],F.prototype,"ref_block_prefix",void 0),F=(0,s.gn)([i.type("get_block_response")],F);let Jt=class extends i{};(0,s.gn)([i.field("name")],Jt.prototype,"producer_name",void 0),(0,s.gn)([i.field("any")],Jt.prototype,"authority",void 0),Jt=(0,s.gn)([i.type("active_schedule_producer_authority")],Jt);let Kt=class extends i{};(0,s.gn)([i.field("name")],Kt.prototype,"producer_name",void 0),(0,s.gn)([i.field(Jt)],Kt.prototype,"authority",void 0),Kt=(0,s.gn)([i.type("active_schedule_producer")],Kt);let ye=class extends i{};(0,s.gn)([i.field("uint32")],ye.prototype,"version",void 0),(0,s.gn)([i.field(Kt,{array:!0})],ye.prototype,"producers",void 0),ye=(0,s.gn)([i.type("active_schedule")],ye);let Q=class extends i{};(0,s.gn)([i.field("time_point")],Q.prototype,"timestamp",void 0),(0,s.gn)([i.field("name")],Q.prototype,"producer",void 0),(0,s.gn)([i.field("uint16")],Q.prototype,"confirmed",void 0),(0,s.gn)([i.field("checksum256")],Q.prototype,"previous",void 0),(0,s.gn)([i.field("checksum256")],Q.prototype,"transaction_mroot",void 0),(0,s.gn)([i.field("checksum256")],Q.prototype,"action_mroot",void 0),(0,s.gn)([i.field("uint32")],Q.prototype,"schedule_version",void 0),(0,s.gn)([i.field(zt,{array:!0,optional:!0})],Q.prototype,"header_extensions",void 0),(0,s.gn)([i.field("signature")],Q.prototype,"producer_signature",void 0),Q=(0,s.gn)([i.type("block_state_header")],Q);let $=class extends i{};(0,s.gn)([i.field("uint32")],$.prototype,"block_num",void 0),(0,s.gn)([i.field("uint32")],$.prototype,"dpos_proposed_irreversible_blocknum",void 0),(0,s.gn)([i.field("uint32")],$.prototype,"dpos_irreversible_blocknum",void 0),(0,s.gn)([i.field("checksum256")],$.prototype,"id",void 0),(0,s.gn)([i.field(Q)],$.prototype,"header",void 0),(0,s.gn)([i.field("any")],$.prototype,"active_schedule",void 0),(0,s.gn)([i.field("any")],$.prototype,"blockroot_merkle",void 0),(0,s.gn)([i.field("any")],$.prototype,"producer_to_last_produced",void 0),(0,s.gn)([i.field("any")],$.prototype,"producer_to_last_implied_irb",void 0),(0,s.gn)([i.field("any")],$.prototype,"valid_block_signing_authority",void 0),(0,s.gn)([i.field("any")],$.prototype,"confirm_count",void 0),(0,s.gn)([i.field("any")],$.prototype,"pending_schedule",void 0),(0,s.gn)([i.field("any")],$.prototype,"activated_protocol_features",void 0),(0,s.gn)([i.field("any")],$.prototype,"additional_signatures",void 0),$=(0,s.gn)([i.type("get_block_header_state_response")],$);let M=class extends i{getTransactionHeader(t=120){const e=Ne.fromMilliseconds(this.head_block_time.toMilliseconds()+t*1e3),o=this.last_irreversible_block_id.array.subarray(8,12),a=new Uint32Array(o.buffer,o.byteOffset,1)[0];return dt.from({expiration:e,ref_block_num:Number(this.last_irreversible_block_num)&65535,ref_block_prefix:a})}};(0,s.gn)([i.field("string")],M.prototype,"server_version",void 0),(0,s.gn)([i.field("checksum256")],M.prototype,"chain_id",void 0),(0,s.gn)([i.field("uint32")],M.prototype,"head_block_num",void 0),(0,s.gn)([i.field("uint32")],M.prototype,"last_irreversible_block_num",void 0),(0,s.gn)([i.field("checksum256")],M.prototype,"last_irreversible_block_id",void 0),(0,s.gn)([i.field("checksum256")],M.prototype,"head_block_id",void 0),(0,s.gn)([i.field("time_point")],M.prototype,"head_block_time",void 0),(0,s.gn)([i.field("name")],M.prototype,"head_block_producer",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"virtual_block_cpu_limit",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"virtual_block_net_limit",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"block_cpu_limit",void 0),(0,s.gn)([i.field("uint64")],M.prototype,"block_net_limit",void 0),(0,s.gn)([i.field("string?")],M.prototype,"server_version_string",void 0),(0,s.gn)([i.field("uint32?")],M.prototype,"fork_db_head_block_num",void 0),(0,s.gn)([i.field("checksum256?")],M.prototype,"fork_db_head_block_id",void 0),M=(0,s.gn)([i.type("get_info_response")],M);let _t=class extends i{};(0,s.gn)([i.field("name")],_t.prototype,"code",void 0),(0,s.gn)([i.field("name")],_t.prototype,"scope",void 0),(0,s.gn)([i.field("name")],_t.prototype,"table",void 0),(0,s.gn)([i.field("name")],_t.prototype,"payer",void 0),(0,s.gn)([i.field("uint32")],_t.prototype,"count",void 0),_t=(0,s.gn)([i.type("get_table_by_scope_response_row")],_t);let Ht=class extends i{};(0,s.gn)([i.field(_t,{array:!0})],Ht.prototype,"rows",void 0),(0,s.gn)([i.field("string")],Ht.prototype,"more",void 0),Ht=(0,s.gn)([i.type("get_table_by_scope_response")],Ht);let yt=class extends i{};(0,s.gn)([i.field(f)],yt.prototype,"global_action_seq",void 0),(0,s.gn)([i.field(G)],yt.prototype,"account_action_seq",void 0),(0,s.gn)([i.field(c)],yt.prototype,"block_num",void 0),(0,s.gn)([i.field(Ie)],yt.prototype,"block_time",void 0),(0,s.gn)([i.field("any")],yt.prototype,"action_trace",void 0),(0,s.gn)([i.field("boolean?")],yt.prototype,"irrevirsible",void 0),yt=(0,s.gn)([i.type("ordered_action_result")],yt);let Bt=class extends i{};(0,s.gn)([i.field(yt,{array:!0})],Bt.prototype,"actions",void 0),(0,s.gn)([i.field(lt)],Bt.prototype,"last_irreversible_block",void 0),(0,s.gn)([i.field(lt)],Bt.prototype,"head_block_num",void 0),(0,s.gn)([i.field("boolean?")],Bt.prototype,"time_limit_exceeded_error",void 0),Bt=(0,s.gn)([i.type("get_actions_response")],Bt);let $e=class extends i{};$e=(0,s.gn)([i.type("transaction_trace")],$e);let X=class extends i{};(0,s.gn)([i.field("any")],X.prototype,"actions",void 0),(0,s.gn)([i.field("any")],X.prototype,"context_free_actions",void 0),(0,s.gn)([i.field("any")],X.prototype,"context_free_data",void 0),(0,s.gn)([i.field("number")],X.prototype,"delay_sec",void 0),(0,s.gn)([i.field("string")],X.prototype,"expiration",void 0),(0,s.gn)([i.field("number")],X.prototype,"max_cpu_usage_ms",void 0),(0,s.gn)([i.field("number")],X.prototype,"max_net_usage_words",void 0),(0,s.gn)([i.field("number")],X.prototype,"ref_block_num",void 0),(0,s.gn)([i.field("number")],X.prototype,"ref_block_prefix",void 0),(0,s.gn)([i.field("string",{array:!0})],X.prototype,"signatures",void 0),X=(0,s.gn)([i.type("trx")],X);let me=class extends i{};(0,s.gn)([i.field(jt)],me.prototype,"receipt",void 0),(0,s.gn)([i.field("trx")],me.prototype,"trx",void 0),me=(0,s.gn)([i.type("transaction_info")],me);let mt=class extends i{};(0,s.gn)([i.field(B)],mt.prototype,"id",void 0),(0,s.gn)([i.field(c)],mt.prototype,"block_num",void 0),(0,s.gn)([i.field(Ie)],mt.prototype,"block_time",void 0),(0,s.gn)([i.field(c)],mt.prototype,"last_irreversible_block",void 0),(0,s.gn)([i.field("any?")],mt.prototype,"traces",void 0),(0,s.gn)([i.field("any")],mt.prototype,"trx",void 0),mt=(0,s.gn)([i.type("get_transaction_response")],mt);let ge=class extends i{};(0,s.gn)([i.field("name",{array:!0})],ge.prototype,"account_names",void 0),ge=(0,s.gn)([i.type("get_key_accounts_response")],ge);let be=class extends i{};(0,s.gn)([i.field("name",{array:!0})],be.prototype,"controlled_accounts",void 0),be=(0,s.gn)([i.type("get_controlled_accounts_response")],be);let tt=class extends i{};(0,s.gn)([i.field("string")],tt.prototype,"state",void 0),(0,s.gn)([i.field("uint32")],tt.prototype,"head_number",void 0),(0,s.gn)([i.field("checksum256")],tt.prototype,"head_id",void 0),(0,s.gn)([i.field("time_point")],tt.prototype,"head_timestamp",void 0),(0,s.gn)([i.field("uint32")],tt.prototype,"irreversible_number",void 0),(0,s.gn)([i.field("checksum256")],tt.prototype,"irreversible_id",void 0),(0,s.gn)([i.field("time_point")],tt.prototype,"irreversible_timestamp",void 0),(0,s.gn)([i.field("checksum256")],tt.prototype,"earliest_tracked_block_id",void 0),(0,s.gn)([i.field("uint32")],tt.prototype,"earliest_tracked_block_number",void 0),tt=(0,s.gn)([i.type("get_transaction_status_response")],tt);var mr=Object.freeze({__proto__:null,get AccountPermission(){return Vt},get AccountResourceLimit(){return Et},get AccountTotalResources(){return Nt},get AccountSelfDelegatedBandwidth(){return It},get AccountRefundRequest(){return Tt},get AccountVoterInfo(){return nt},get AccountRexInfoMaturities(){return Pt},get AccountRexInfo(){return ht},get AccountObject(){return D},get NewProducersEntry(){return Lt},get NewProducers(){return Gt},get BlockExtension(){return pe},get HeaderExtension(){return zt},TrxVariant:Me,get GetBlockResponseTransactionReceipt(){return he},get GetBlockResponse(){return F},get ActiveScheduleProducerAuthority(){return Jt},get ActiveScheduleProducer(){return Kt},get ActiveSchedule(){return ye},get BlockStateHeader(){return Q},get GetBlockHeaderStateResponse(){return $},get GetInfoResponse(){return M},get GetTableByScopeResponseRow(){return _t},get GetTableByScopeResponse(){return Ht},get OrderedActionsResult(){return yt},get GetActionsResponse(){return Bt},get TransactionTrace(){return $e},get Trx(){return X},get TransactionInfo(){return me},get GetTransactionResponse(){return mt},get GetKeyAccountsResponse(){return ge},get GetControlledAccountsResponse(){return be},get GetTransactionStatusResponse(){return tt}});class gr{constructor(t){this.client=t}async get_abi(t){return this.client.call({path:"/v1/chain/get_abi",params:{account_name:I.from(t)}})}async get_account(t){return this.client.call({path:"/v1/chain/get_account",params:{account_name:I.from(t)},responseType:D})}async get_block(t){return this.client.call({path:"/v1/chain/get_block",params:{block_num_or_id:t},responseType:F})}async get_block_header_state(t){return this.client.call({path:"/v1/chain/get_block_header_state",params:{block_num_or_id:t},responseType:$})}async get_currency_balance(t,e,n){const o={account:I.from(e),code:I.from(t)};return n&&(o.symbol=n),this.client.call({path:"/v1/chain/get_currency_balance",params:o,responseType:"asset[]"})}async get_info(){return this.client.call({path:"/v1/chain/get_info",responseType:M})}async compute_transaction(t){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/compute_transaction",params:{transaction:t}})}async push_transaction(t){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/push_transaction",params:t})}async send_transaction(t){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/send_transaction",params:t})}async send_transaction2(t,e){return A(t,z)||(t=z.fromSigned(pt.from(t))),this.client.call({path:"/v1/chain/send_transaction2",params:{return_failure_trace:!0,retry_trx:!1,retry_trx_num_blocks:0,transaction:t,...e}})}async get_table_rows(t){const e=t.type;let n=t.key_type;const o=t.lower_bound||t.upper_bound;!n&&o&&(A(o,f)?n="i64":A(o,d)?n="i128":A(o,B)?n="sha256":A(o,kt)&&(n="ripemd160")),n||(n="name");let a=t.json;a===void 0&&(a=e===void 0);let l=t.upper_bound;l&&typeof l!="string"&&(l=String(l));let h=t.lower_bound;h&&typeof h!="string"&&(h=String(h));let p=t.scope;typeof p>"u"?p=String(I.from(t.code)):typeof p!="string"&&(p=String(p));let{rows:w,more:J,next_key:q}=await this.client.call({path:"/v1/chain/get_table_rows",params:{...t,code:I.from(t.code),table:I.from(t.table),limit:t.limit!==void 0?c.from(t.limit):void 0,scope:p,key_type:n,json:a,upper_bound:l,lower_bound:h}}),Rt;if(t.show_payer&&(Rt=[],w=w.map(({data:C,payer:b})=>(Rt.push(I.from(b)),C))),e&&(a?w=w.map(C=>typeof C=="string"&&S.isBytes(C)?xt.decode({data:S.from(C),type:e}):xt.decode({object:C,type:e})):w=w.map(C=>S.from(C)).map(C=>xt.decode({data:C,type:e}))),q&&q.length>0){let C;switch(n){case"i64":C=f;break;case"i128":C=d;break;case"name":C=I;break;case"float64":C=xe;break;case"float128":C=Ee;break;case"sha256":C=B;break;case"ripemd160":C=kt;break;default:throw new Error(`Unsupported key type: ${n}`)}C===I?q=I.from(xt.decode({object:q,type:f})):q=xt.decode({object:q,type:C})}else q=void 0;return{rows:w,more:J,next_key:q,ram_payers:Rt}}async get_table_by_scope(t){return this.client.call({path:"/v1/chain/get_table_by_scope",params:t,responseType:Ht})}async get_transaction_status(t){return this.client.call({path:"/v1/chain/get_transaction_status",params:{id:B.from(t)},responseType:tt})}}class br{constructor(t){this.client=t}async get_actions(t,e,n){return this.client.call({path:"/v1/history/get_actions",params:{account_name:I.from(t),pos:lt.from(e),offset:lt.from(n)},responseType:Bt})}async get_transaction(t,e={}){return this.client.call({path:"/v1/history/get_transaction",params:{id:B.from(t),block_num_hint:e.blockNumHint&&c.from(e.blockNumHint),traces:e.excludeTraces===!0?!1:void 0},responseType:mt})}async get_key_accounts(t){return this.client.call({path:"/v1/history/get_key_accounts",params:{public_key:Z.from(t)},responseType:ge})}async get_controlled_accounts(t){return this.client.call({path:"/v1/history/get_controlled_accounts",params:{controlling_account:I.from(t)},responseType:be})}}class we extends Error{constructor(t,e){let n;e.json&&e.json.error?n=`${we.formatError(e.json.error)} at ${t}`:n=`HTTP ${e.status} at ${t}`,super(n),this.path=t,this.response=e}static formatError(t){return t.what==="unspecified"&&t.details[0].file&&t.details[0].file==="http_plugin.cpp"&&t.details[0].message.slice(0,11)==="unknown key"?"Account not found":t.what==="unspecified"&&t.details&&t.details.length>0?t.details[0].message:t.what&&t.what.length>0?t.what:"Unknown API error"}get error(){const{json:t}=this.response;return t?t.error:void 0}get name(){const{error:t}=this;return t?t.name:"unspecified"}get code(){const{error:t}=this;return t?t.code:0}get details(){const{error:t}=this;return t?t.details:[]}}we.__className="APIError";class tr{constructor(t){if(this.v1={chain:new gr(this),history:new br(this)},t.provider)this.provider=t.provider;else if(t.url)this.provider=new Xe(t.url,t);else throw new Error("Missing url or provider")}async call(t){const e=await this.provider.call(t.path,t.params),{json:n}=e;if(Math.floor(e.status/100)!==2||n&&typeof n.error=="object")throw new we(t.path,e);return t.responseType?Ct({type:t.responseType,object:e.json}):e.json||e.text}}tr.__className="APIClient";var vr=Object.freeze({__proto__:null,v1:mr})},70655:function(er,Pe,L){L.d(Pe,{CR:function(){return Xt},FC:function(){return St},Jh:function(){return Ae},KL:function(){return x},XA:function(){return vt},ZT:function(){return Be},ev:function(){return At},gn:function(){return Re},mG:function(){return ft},qq:function(){return B}});var Zt=function(u,c){return Zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,d){f.__proto__=d}||function(f,d){for(var m in d)Object.prototype.hasOwnProperty.call(d,m)&&(f[m]=d[m])},Zt(u,c)};function Be(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");Zt(u,c);function f(){this.constructor=u}u.prototype=c===null?Object.create(c):(f.prototype=c.prototype,new f)}var ut=function(){return ut=Object.assign||function(c){for(var f,d=1,m=arguments.length;d<m;d++){f=arguments[d];for(var y in f)Object.prototype.hasOwnProperty.call(f,y)&&(c[y]=f[y])}return c},ut.apply(this,arguments)};function rr(u,c){var f={};for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&c.indexOf(d)<0&&(f[d]=u[d]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,d=Object.getOwnPropertySymbols(u);m<d.length;m++)c.indexOf(d[m])<0&&Object.prototype.propertyIsEnumerable.call(u,d[m])&&(f[d[m]]=u[d[m]]);return f}function Re(u,c,f,d){var m=arguments.length,y=m<3?c:d===null?d=Object.getOwnPropertyDescriptor(c,f):d,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(u,c,f,d);else for(var P=u.length-1;P>=0;P--)(_=u[P])&&(y=(m<3?_(y):m>3?_(c,f,y):_(c,f))||y);return m>3&&y&&Object.defineProperty(c,f,y),y}function et(u,c){return function(f,d){c(f,d,u)}}function ve(u,c,f,d,m,y){function _(bt){if(bt!==void 0&&typeof bt!="function")throw new TypeError("Function expected");return bt}for(var P=d.kind,K=P==="getter"?"get":P==="setter"?"set":"value",v=!c&&u?d.static?u:u.prototype:null,O=c||(v?Object.getOwnPropertyDescriptor(v,d.name):{}),j,U=!1,Y=f.length-1;Y>=0;Y--){var ot={};for(var st in d)ot[st]=st==="access"?{}:d[st];for(var st in d.access)ot.access[st]=d.access[st];ot.addInitializer=function(bt){if(U)throw new TypeError("Cannot add initializers after decoration has completed");y.push(_(bt||null))};var gt=(0,f[Y])(P==="accessor"?{get:O.get,set:O.set}:O[K],ot);if(P==="accessor"){if(gt===void 0)continue;if(gt===null||typeof gt!="object")throw new TypeError("Object expected");(j=_(gt.get))&&(O.get=j),(j=_(gt.set))&&(O.set=j),(j=_(gt.init))&&m.push(j)}else(j=_(gt))&&(P==="field"?m.push(j):O[K]=j)}v&&Object.defineProperty(v,d.name,O),U=!0}function nr(u,c,f){for(var d=arguments.length>2,m=0;m<c.length;m++)f=d?c[m].call(u,f):c[m].call(u);return d?f:void 0}function s(u){return typeof u=="symbol"?u:"".concat(u)}function Yt(u,c,f){return typeof c=="symbol"&&(c=c.description?"[".concat(c.description,"]"):""),Object.defineProperty(u,"name",{configurable:!0,value:f?"".concat(f," ",c):c})}function qe(u,c){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(u,c)}function ft(u,c,f,d){function m(y){return y instanceof f?y:new f(function(_){_(y)})}return new(f||(f=Promise))(function(y,_){function P(O){try{v(d.next(O))}catch(j){_(j)}}function K(O){try{v(d.throw(O))}catch(j){_(j)}}function v(O){O.done?y(O.value):m(O.value).then(P,K)}v((d=d.apply(u,c||[])).next())})}function Ae(u,c){var f={label:0,sent:function(){if(y[0]&1)throw y[1];return y[1]},trys:[],ops:[]},d,m,y,_;return _={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function P(v){return function(O){return K([v,O])}}function K(v){if(d)throw new TypeError("Generator is already executing.");for(;_&&(_=0,v[0]&&(f=0)),f;)try{if(d=1,m&&(y=v[0]&2?m.return:v[0]?m.throw||((y=m.return)&&y.call(m),0):m.next)&&!(y=y.call(m,v[1])).done)return y;switch(m=0,y&&(v=[v[0]&2,y.value]),v[0]){case 0:case 1:y=v;break;case 4:return f.label++,{value:v[1],done:!1};case 5:f.label++,m=v[1],v=[0];continue;case 7:v=f.ops.pop(),f.trys.pop();continue;default:if(y=f.trys,!(y=y.length>0&&y[y.length-1])&&(v[0]===6||v[0]===2)){f=0;continue}if(v[0]===3&&(!y||v[1]>y[0]&&v[1]<y[3])){f.label=v[1];break}if(v[0]===6&&f.label<y[1]){f.label=y[1],y=v;break}if(y&&f.label<y[2]){f.label=y[2],f.ops.push(v);break}y[2]&&f.ops.pop(),f.trys.pop();continue}v=c.call(u,f)}catch(O){v=[6,O],m=0}finally{d=y=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}var Qt=Object.create?function(u,c,f,d){d===void 0&&(d=f);var m=Object.getOwnPropertyDescriptor(c,f);(!m||("get"in m?!c.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(u,d,m)}:function(u,c,f,d){d===void 0&&(d=f),u[d]=c[f]};function Le(u,c){for(var f in u)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&Qt(c,u,f)}function vt(u){var c=typeof Symbol=="function"&&Symbol.iterator,f=c&&u[c],d=0;if(f)return f.call(u);if(u&&typeof u.length=="number")return{next:function(){return u&&d>=u.length&&(u=void 0),{value:u&&u[d++],done:!u}}};throw new TypeError(c?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(u,c){var f=typeof Symbol=="function"&&u[Symbol.iterator];if(!f)return u;var d=f.call(u),m,y=[],_;try{for(;(c===void 0||c-- >0)&&!(m=d.next()).done;)y.push(m.value)}catch(P){_={error:P}}finally{try{m&&!m.done&&(f=d.return)&&f.call(d)}finally{if(_)throw _.error}}return y}function A(){for(var u=[],c=0;c<arguments.length;c++)u=u.concat(Xt(arguments[c]));return u}function S(){for(var u=0,c=0,f=arguments.length;c<f;c++)u+=arguments[c].length;for(var d=Array(u),m=0,c=0;c<f;c++)for(var y=arguments[c],_=0,P=y.length;_<P;_++,m++)d[m]=y[_];return d}function At(u,c,f){if(f||arguments.length===2)for(var d=0,m=c.length,y;d<m;d++)(y||!(d in c))&&(y||(y=Array.prototype.slice.call(c,0,d)),y[d]=c[d]);return u.concat(y||Array.prototype.slice.call(c))}function B(u){return this instanceof B?(this.v=u,this):new B(u)}function St(u,c,f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d=f.apply(u,c||[]),m,y=[];return m={},_("next"),_("throw"),_("return"),m[Symbol.asyncIterator]=function(){return this},m;function _(U){d[U]&&(m[U]=function(Y){return new Promise(function(ot,st){y.push([U,Y,ot,st])>1||P(U,Y)})})}function P(U,Y){try{K(d[U](Y))}catch(ot){j(y[0][3],ot)}}function K(U){U.value instanceof B?Promise.resolve(U.value.v).then(v,O):j(y[0][2],U)}function v(U){P("next",U)}function O(U){P("throw",U)}function j(U,Y){U(Y),y.shift(),y.length&&P(y[0][0],y[0][1])}}function kt(u){var c,f;return c={},d("next"),d("throw",function(m){throw m}),d("return"),c[Symbol.iterator]=function(){return this},c;function d(m,y){c[m]=u[m]?function(_){return(f=!f)?{value:B(u[m](_)),done:!1}:y?y(_):_}:y}}function x(u){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=u[Symbol.asyncIterator],f;return c?c.call(u):(u=typeof vt=="function"?vt(u):u[Symbol.iterator](),f={},d("next"),d("throw"),d("return"),f[Symbol.asyncIterator]=function(){return this},f);function d(y){f[y]=u[y]&&function(_){return new Promise(function(P,K){_=u[y](_),m(P,K,_.done,_.value)})}}function m(y,_,P,K){Promise.resolve(K).then(function(v){y({value:v,done:P})},_)}}function N(u,c){return Object.defineProperty?Object.defineProperty(u,"raw",{value:c}):u.raw=c,u}var Wt=Object.create?function(u,c){Object.defineProperty(u,"default",{enumerable:!0,value:c})}:function(u,c){u.default=c};function te(u){if(u&&u.__esModule)return u;var c={};if(u!=null)for(var f in u)f!=="default"&&Object.prototype.hasOwnProperty.call(u,f)&&Qt(c,u,f);return Wt(c,u),c}function lt(u){return u&&u.__esModule?u:{default:u}}function G(u,c,f,d){if(f==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof c=="function"?u!==c||!d:!c.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?d:f==="a"?d.call(u):d?d.value:c.get(u)}function ee(u,c,f,d,m){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!m)throw new TypeError("Private accessor was defined without a setter");if(typeof c=="function"?u!==c||!m:!c.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?m.call(u,f):m?m.value=f:c.set(u,f),f}function re(u,c){if(c===null||typeof c!="object"&&typeof c!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof u=="function"?c===u:u.has(c)}}}]);
|