From bd2d1887cac3065f4ec467566cd6e406166161fd Mon Sep 17 00:00:00 2001 From: Aaron Caswell Date: Tue, 10 Dec 2019 09:44:25 -0800 Subject: [PATCH] v0.0.8 --- CHANGELOG.md | 13 ++++++++++++- dist-web/waxjs.js | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f7ea07..c899f58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Pending (v0.0.8) +## Pending BREAKING CHANGES: @@ -8,6 +8,17 @@ FEATURES: IMPROVEMENTS: +BUG FIXES: + +## v0.0.8 + +BREAKING CHANGES: + +FEATURES: + +IMPROVEMENTS: +- [KEW-1801] Only autologin on chrome + BUG FIXES: - Fix for whitelists not getting set by some browsers. Ex Brave diff --git a/dist-web/waxjs.js b/dist-web/waxjs.js index 9030753..9748e5d 100644 --- a/dist-web/waxjs.js +++ b/dist-web/waxjs.js @@ -1 +1 @@ -var waxjs=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(6).RIPEMD160.hash,s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var c=function(){for(var t=Array(256).fill(-1),e=0;e"9".charCodeAt(0))throw new Error("invalid number");for(var o=i-"0".charCodeAt(0),a=0;a>8}if(o)throw new Error("number is out of range")}return n}function y(t,e){void 0===e&&(e=1);for(var n=Array(e).fill("0".charCodeAt(0)),r=t.length-1;r>=0;--r){for(var o=t[r],a=0;a>8}if(i)throw new Error("base-58 value is out of range")}return n.reverse(),n}function g(t,e){var n,r,a,u;void 0===e&&(e=1);var l=[];try{for(var f=o(t),h=f.next();!h.done;h=f.next()){for(var p=h.value,d=0;d>2,r=3*n;e>0&&"="===t[e-1]&&("="===t[e-2]?r-=2:r-=1);for(var i=new Uint8Array(r),o=0;o>4,3*o+1>2),3*o+20)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),u=function(t){void 0===t&&(t={}),this.skippedBinaryExtension=!1,this.options=t};e.SerializerState=u;var c=function(){function t(t){var e=void 0===t?{}:t,n=e.textEncoder,r=e.textDecoder,i=e.array;this.readPos=0,this.array=i||new Uint8Array(1024),this.length=i?i.length:0,this.textEncoder=n||new TextEncoder,this.textDecoder=r||new TextDecoder("utf-8",{fatal:!0})}return t.prototype.reserve=function(t){if(!(this.length+t<=this.array.length)){for(var e=this.array.length;this.length+t>e;)e=Math.ceil(1.5*e);var n=new Uint8Array(e);n.set(this.array),this.array=n}},t.prototype.haveReadData=function(){return this.readPosthis.length)throw new Error("Read past end of buffer");var e=new Uint8Array(this.array.buffer,this.array.byteOffset+this.readPos,t);return this.readPos+=t,e},t.prototype.pushUint16=function(t){this.push(t>>0&255,t>>8&255)},t.prototype.getUint16=function(){var t=0;return t|=this.get()<<0,t|=this.get()<<8},t.prototype.pushUint32=function(t){this.push(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},t.prototype.getUint32=function(){var t=0;return t|=this.get()<<0,t|=this.get()<<8,t|=this.get()<<16,(t|=this.get()<<24)>>>0},t.prototype.pushNumberAsUint64=function(t){this.pushUint32(t>>>0),this.pushUint32(Math.floor(t/4294967296)>>>0)},t.prototype.getUint64AsNumber=function(){var t=this.getUint32();return 4294967296*(this.getUint32()>>>0)+(t>>>0)},t.prototype.pushVaruint32=function(t){for(;;){if(!(t>>>7)){this.push(t);break}this.push(128|127&t),t>>>=7}},t.prototype.getVaruint32=function(){for(var t=0,e=0;;){var n=this.get();if(t|=(127&n)<>>0},t.prototype.pushVarint32=function(t){this.pushVaruint32(t<<1^t>>31)},t.prototype.getVarint32=function(){var t=this.getVaruint32();return 1&t?~t>>1|2147483648:t>>>1},t.prototype.pushFloat32=function(t){this.pushArray(new Uint8Array(new Float32Array([t]).buffer))},t.prototype.getFloat32=function(){return new Float32Array(this.getUint8Array(4).slice().buffer)[0]},t.prototype.pushFloat64=function(t){this.pushArray(new Uint8Array(new Float64Array([t]).buffer))},t.prototype.getFloat64=function(){return new Float64Array(this.getUint8Array(8).slice().buffer)[0]},t.prototype.pushName=function(t){if("string"!=typeof t)throw new Error("Expected string containing name");function e(t){return t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)?t-"a".charCodeAt(0)+6:t>="1".charCodeAt(0)&&t<="5".charCodeAt(0)?t-"1".charCodeAt(0)+1:0}for(var n=new Uint8Array(8),r=63,i=0;i=0;--a)r>=0&&(n[Math.floor(r/8)]|=(o>>a&1)<=0;){for(var r=0,i=0;i<5;++i)n>=0&&(r=r<<1|t[Math.floor(n/8)]>>n%8&1,--n);e+=r>=6?String.fromCharCode(r+"a".charCodeAt(0)-6):r>=1?String.fromCharCode(r+"1".charCodeAt(0)-1):"."}for(;e.endsWith(".");)e=e.substr(0,e.length-1);return e},t.prototype.pushBytes=function(t){this.pushVaruint32(t.length),this.pushArray(t)},t.prototype.getBytes=function(){return this.getUint8Array(this.getVaruint32())},t.prototype.pushString=function(t){this.pushBytes(this.textEncoder.encode(t))},t.prototype.getString=function(){return this.textDecoder.decode(this.getBytes())},t.prototype.pushSymbolCode=function(t){if("string"!=typeof t)throw new Error("Expected string containing symbol_code");var e=[];for(e.push.apply(e,o(this.textEncoder.encode(t)));e.length<8;)e.push(0);this.pushArray(e.slice(0,8))},t.prototype.getSymbolCode=function(){var t,e=this.getUint8Array(8);for(t=0;t="0".charCodeAt(0)&&t.charCodeAt(e)<="9".charCodeAt(0);)i=!0,n+=t[e],++e;if(!i)throw new Error("Asset must begin with a number");if("."===t[e])for(++e;e="0".charCodeAt(0)&&t.charCodeAt(e)<="9".charCodeAt(0);)n+=t[e],++r,++e;var o=t.substr(e).trim();this.pushArray(s.signedDecimalToBinary(8,n)),this.pushSymbol({name:o,precision:r})},t.prototype.getAsset=function(){var t=this.getUint8Array(8),e=this.getSymbol(),n=e.name,r=e.precision,i=s.signedBinaryToDecimal(t,r+1);return r&&(i=i.substr(0,i.length-r)+"."+i.substr(i.length-r)),i+" "+n},t.prototype.pushPublicKey=function(t){var e=s.stringToPublicKey(t);this.push(e.type),this.pushArray(e.data)},t.prototype.getPublicKey=function(){var t=this.get(),e=this.getUint8Array(s.publicKeyDataSize);return s.publicKeyToString({type:t,data:e})},t.prototype.pushPrivateKey=function(t){var e=s.stringToPrivateKey(t);this.push(e.type),this.pushArray(e.data)},t.prototype.getPrivateKey=function(){var t=this.get(),e=this.getUint8Array(s.privateKeyDataSize);return s.privateKeyToString({type:t,data:e})},t.prototype.pushSignature=function(t){var e=s.stringToSignature(t);this.push(e.type),this.pushArray(e.data)},t.prototype.getSignature=function(){var t=this.get(),e=this.getUint8Array(s.signatureDataSize);return s.signatureToString({type:t,data:e})},t}();function l(t){var e=Date.parse(t);if(Number.isNaN(e))throw new Error("Invalid time format");return e}function f(t){return Math.round(1e3*l(t+"Z"))}function h(t){var e=new Date(t/1e3).toISOString();return e.substr(0,e.length-1)}function p(t){return Math.round(l(t+"Z")/1e3)}function d(t){var e=new Date(1e3*t).toISOString();return e.substr(0,e.length-1)}function y(t){return Math.round((l(t+"Z")-9466848e5)/500)}function v(t){var e=new Date(500*t+9466848e5).toISOString();return e.substr(0,e.length-1)}function g(t){if("string"!=typeof t)throw new Error("Expected string containing symbol");var e=t.match(/^([0-9]+),([A-Z]+)$/);if(!e)throw new Error("Invalid symbol");return{name:e[2],precision:+e[1]}}function b(t){var e=t.name;return t.precision+","+e}function m(t){var e,n,r="";try{for(var i=a(t),o=i.next();!o.done;o=i.next()){r+=("00"+o.value.toString(16)).slice(-2)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.toUpperCase()}function w(t){if("string"!=typeof t)throw new Error("Expected string containing hex digits");if(t.length%2)throw new Error("Odd number of hex digits");for(var e=t.length/2,n=new Uint8Array(e),r=0;r=this.fields.length)throw new Error("type index "+r+" is not valid for variant");var i=this.fields[r];return[i.name,i.type.deserialize(t,e,n)]}function k(t,e,n,r){var i,o;t.pushVaruint32(e.length);try{for(var s=a(e),u=s.next();!u.done;u=s.next()){var c=u.value;this.arrayOf.serialize(t,c,n,!1)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}}function T(t,e,n){for(var r=t.getVaruint32(),i=[],o=0;o",aliasOfName:"",arrayOf:null,optionalOf:null,extensionOf:null,baseName:"",base:null,fields:[],serialize:_,deserialize:x},t)}function K(t,e){if(Number.isNaN(+t)||Number.isNaN(+e)||"number"!=typeof t&&"string"!=typeof t)throw new Error("Expected number");if(+t!=+e)throw new Error("Number is out of range");return+t}function R(t,e){var n=t.get(e);if(n&&n.aliasOfName)return R(t,n.aliasOfName);if(n)return n;if(e.endsWith("[]"))return D({name:e,arrayOf:R(t,e.substr(0,e.length-2)),serialize:k,deserialize:T});if(e.endsWith("?"))return D({name:e,optionalOf:R(t,e.substr(0,e.length-1)),serialize:U,deserialize:P});if(e.endsWith("$"))return D({name:e,extensionOf:R(t,e.substr(0,e.length-1)),serialize:O,deserialize:C});throw new Error("Unknown type: "+e)}function N(t,e,n,r,i,o){var a=t.actions.get(n);if(!a)throw new Error("Unknown action "+n+" in contract "+e);var s=new c({textEncoder:i,textDecoder:o});return a.serialize(s,r),m(s.asUint8Array())}function j(t,e,n,r,i,o){var a=t.actions.get(n);if("string"==typeof r&&(r=w(r)),!a)throw new Error("Unknown action "+n+" in contract "+e);var s=new c({textDecoder:o,textEncoder:i});return s.pushArray(r),a.deserialize(s)}e.SerialBuffer=c,e.supportedAbiVersion=function(t){return t.startsWith("eosio::abi/1.")},e.dateToTimePoint=f,e.timePointToDate=h,e.dateToTimePointSec=p,e.timePointSecToDate=d,e.dateToBlockTimestamp=y,e.blockTimestampToDate=v,e.stringToSymbol=g,e.symbolToString=b,e.arrayToHex=m,e.hexToUint8Array=w,e.createInitialTypes=function(){var t=new Map(Object.entries({bool:D({name:"bool",serialize:function(t,e){if("boolean"!=typeof e)throw new Error("Expected true or false");t.push(e?1:0)},deserialize:function(t){return!!t.get()}}),uint8:D({name:"uint8",serialize:function(t,e){t.push(K(e,255&e))},deserialize:function(t){return t.get()}}),int8:D({name:"int8",serialize:function(t,e){t.push(K(e,e<<24>>24))},deserialize:function(t){return t.get()<<24>>24}}),uint16:D({name:"uint16",serialize:function(t,e){t.pushUint16(K(e,65535&e))},deserialize:function(t){return t.getUint16()}}),int16:D({name:"int16",serialize:function(t,e){t.pushUint16(K(e,e<<16>>16))},deserialize:function(t){return t.getUint16()<<16>>16}}),uint32:D({name:"uint32",serialize:function(t,e){t.pushUint32(K(e,e>>>0))},deserialize:function(t){return t.getUint32()}}),uint64:D({name:"uint64",serialize:function(t,e){t.pushArray(s.decimalToBinary(8,""+e))},deserialize:function(t){return s.binaryToDecimal(t.getUint8Array(8))}}),int64:D({name:"int64",serialize:function(t,e){t.pushArray(s.signedDecimalToBinary(8,""+e))},deserialize:function(t){return s.signedBinaryToDecimal(t.getUint8Array(8))}}),int32:D({name:"int32",serialize:function(t,e){t.pushUint32(K(e,0|e))},deserialize:function(t){return 0|t.getUint32()}}),varuint32:D({name:"varuint32",serialize:function(t,e){t.pushVaruint32(K(e,e>>>0))},deserialize:function(t){return t.getVaruint32()}}),varint32:D({name:"varint32",serialize:function(t,e){t.pushVarint32(K(e,0|e))},deserialize:function(t){return t.getVarint32()}}),uint128:D({name:"uint128",serialize:function(t,e){t.pushArray(s.decimalToBinary(16,""+e))},deserialize:function(t){return s.binaryToDecimal(t.getUint8Array(16))}}),int128:D({name:"int128",serialize:function(t,e){t.pushArray(s.signedDecimalToBinary(16,""+e))},deserialize:function(t){return s.signedBinaryToDecimal(t.getUint8Array(16))}}),float32:D({name:"float32",serialize:function(t,e){t.pushFloat32(e)},deserialize:function(t){return t.getFloat32()}}),float64:D({name:"float64",serialize:function(t,e){t.pushFloat64(e)},deserialize:function(t){return t.getFloat64()}}),float128:D({name:"float128",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),16)},deserialize:function(t){return m(t.getUint8Array(16))}}),bytes:D({name:"bytes",serialize:function(t,e){e instanceof Uint8Array||Array.isArray(e)?t.pushBytes(e):t.pushBytes(w(e))},deserialize:function(t,e){return e&&e.options.bytesAsUint8Array?t.getBytes():m(t.getBytes())}}),string:D({name:"string",serialize:function(t,e){t.pushString(e)},deserialize:function(t){return t.getString()}}),name:D({name:"name",serialize:function(t,e){t.pushName(e)},deserialize:function(t){return t.getName()}}),time_point:D({name:"time_point",serialize:function(t,e){t.pushNumberAsUint64(f(e))},deserialize:function(t){return h(t.getUint64AsNumber())}}),time_point_sec:D({name:"time_point_sec",serialize:function(t,e){t.pushUint32(p(e))},deserialize:function(t){return d(t.getUint32())}}),block_timestamp_type:D({name:"block_timestamp_type",serialize:function(t,e){t.pushUint32(y(e))},deserialize:function(t){return v(t.getUint32())}}),symbol_code:D({name:"symbol_code",serialize:function(t,e){t.pushSymbolCode(e)},deserialize:function(t){return t.getSymbolCode()}}),symbol:D({name:"symbol",serialize:function(t,e){t.pushSymbol(g(e))},deserialize:function(t){return b(t.getSymbol())}}),asset:D({name:"asset",serialize:function(t,e){t.pushAsset(e)},deserialize:function(t){return t.getAsset()}}),checksum160:D({name:"checksum160",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),20)},deserialize:function(t){return m(t.getUint8Array(20))}}),checksum256:D({name:"checksum256",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),32)},deserialize:function(t){return m(t.getUint8Array(32))}}),checksum512:D({name:"checksum512",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),64)},deserialize:function(t){return m(t.getUint8Array(64))}}),public_key:D({name:"public_key",serialize:function(t,e){t.pushPublicKey(e)},deserialize:function(t){return t.getPublicKey()}}),private_key:D({name:"private_key",serialize:function(t,e){t.pushPrivateKey(e)},deserialize:function(t){return t.getPrivateKey()}}),signature:D({name:"signature",serialize:function(t,e){t.pushSignature(e)},deserialize:function(t){return t.getSignature()}})}));return t.set("extended_asset",D({name:"extended_asset",baseName:"",fields:[{name:"quantity",typeName:"asset",type:t.get("asset")},{name:"contract",typeName:"name",type:t.get("name")}],serialize:A,deserialize:z})),t},e.getType=R,e.getTypesFromAbi=function(t,e){var n,r,o,s,u,c,l,f,h,p,d=new Map(t);if(e.types)try{for(var y=a(e.types),v=y.next();!v.done;v=y.next()){var g=v.value,b=g.new_type_name,m=g.type;d.set(b,D({name:b,aliasOfName:m}))}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}if(e.structs)try{for(var w=a(e.structs),_=w.next();!_.done;_=w.next()){var x=_.value,k=x.name,T=x.base,U=x.fields;d.set(k,D({name:k,baseName:T,fields:U.map((function(t){return{name:t.name,typeName:t.type,type:null}})),serialize:A,deserialize:z}))}}catch(t){o={error:t}}finally{try{_&&!_.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}if(e.variants)try{for(var P=a(e.variants),O=P.next();!O.done;O=P.next()){var C=O.value,K=C.name,N=C.types;d.set(K,D({name:K,fields:N.map((function(t){return{name:t,typeName:t,type:null}})),serialize:S,deserialize:E}))}}catch(t){u={error:t}}finally{try{O&&!O.done&&(c=P.return)&&c.call(P)}finally{if(u)throw u.error}}try{for(var j=a(d),B=j.next();!B.done;B=j.next()){var V=i(B.value,2);V[0];(m=V[1]).baseName&&(m.base=R(d,m.baseName));try{for(var M=a(m.fields),I=M.next();!I.done;I=M.next()){var L=I.value;L.type=R(d,L.typeName)}}catch(t){h={error:t}}finally{try{I&&!I.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}catch(t){l={error:t}}finally{try{B&&!B.done&&(f=j.return)&&f.call(j)}finally{if(l)throw l.error}}return d},e.transactionHeader=function(t,e){return{expiration:d(p(t.timestamp)+e),ref_block_num:65535&t.block_num,ref_block_prefix:t.ref_block_prefix}},e.serializeActionData=N,e.serializeAction=function(t,e,n,r,i,o,a){return{account:e,name:n,authorization:r,data:N(t,e,n,i,o,a)}},e.deserializeActionData=j,e.deserializeAction=function(t,e,n,r,i,o,a){return{account:e,name:n,authorization:r,data:j(t,e,n,i,o,a)}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(n){var r=this;return r=n.error&&n.error.details&&n.error.details.length&&n.error.details[0].message?t.call(this,n.error.details[0].message)||this:n.processed&&n.processed.except&&n.processed.except.message?t.call(this,n.processed.except.message)||this:t.call(this,n.message)||this,Object.setPrototypeOf(r,e.prototype),r.json=n,r}return i(e,t),e}(Error);e.RpcError=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},u=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(1),f=n(7),h=n(8),p=function(){function t(t){this.contracts=new Map,this.cachedAbis=new Map,this.rpc=t.rpc,this.authorityProvider=t.authorityProvider||t.rpc,this.abiProvider=t.abiProvider||t.rpc,this.signatureProvider=t.signatureProvider,this.chainId=t.chainId,this.textEncoder=t.textEncoder,this.textDecoder=t.textDecoder,this.abiTypes=l.getTypesFromAbi(l.createInitialTypes(),f),this.transactionTypes=l.getTypesFromAbi(l.createInitialTypes(),h)}return t.prototype.rawAbiToJson=function(t){var e=new l.SerialBuffer({textEncoder:this.textEncoder,textDecoder:this.textDecoder,array:t});if(!l.supportedAbiVersion(e.getString()))throw new Error("Unsupported abi version");return e.restartRead(),this.abiTypes.get("abi_def").deserialize(e)},t.prototype.getCachedAbi=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var n,r,i,a;return o(this,(function(o){switch(o.label){case 0:if(!e&&this.cachedAbis.get(t))return[2,this.cachedAbis.get(t)];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.abiProvider.getRawAbi(t)];case 2:return r=o.sent().abi,i=this.rawAbiToJson(r),n={rawAbi:r,abi:i},[3,4];case 3:throw(a=o.sent()).message="fetching abi for "+t+": "+a.message,a;case 4:if(!n)throw new Error("Missing abi for "+t);return this.cachedAbis.set(t,n),[2,n]}}))}))},t.prototype.getAbi=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.getCachedAbi(t,e)];case 1:return[2,n.sent().abi]}}))}))},t.prototype.getTransactionAbis=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var n,r,a,s=this;return o(this,(function(c){return n=t.actions.map((function(t){return t.account})),r=new Set(n),a=u(r).map((function(t){return i(s,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return n={accountName:t},[4,this.getCachedAbi(t,e)];case 1:return[2,(n.abi=r.sent().rawAbi,n)]}}))}))})),[2,Promise.all(a)]}))}))},t.prototype.getContract=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var n,r,i,a,s,u,f,h,p,d,y;return o(this,(function(o){switch(o.label){case 0:return!e&&this.contracts.get(t)?[2,this.contracts.get(t)]:[4,this.getAbi(t,e)];case 1:i=o.sent(),a=l.getTypesFromAbi(l.createInitialTypes(),i),s=new Map;try{for(u=c(i.actions),f=u.next();!f.done;f=u.next())h=f.value,p=h.name,d=h.type,s.set(p,l.getType(a,d))}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return y={types:a,actions:s},this.contracts.set(t,y),[2,y]}}))}))},t.prototype.serialize=function(t,e,n){this.transactionTypes.get(e).serialize(t,n)},t.prototype.deserialize=function(t,e){return this.transactionTypes.get(e).deserialize(t)},t.prototype.serializeTransaction=function(t){var e=new l.SerialBuffer({textEncoder:this.textEncoder,textDecoder:this.textDecoder});return this.serialize(e,"transaction",r({max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,context_free_actions:[],actions:[],transaction_extensions:[]},t)),e.asUint8Array()},t.prototype.deserializeTransaction=function(t){var e=new l.SerialBuffer({textEncoder:this.textEncoder,textDecoder:this.textDecoder});return e.pushArray(t),this.deserialize(e,"transaction")},t.prototype.serializeActions=function(t){return i(this,void 0,void 0,(function(){var e=this;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){var n=t.account,r=t.name,a=t.authorization,s=t.data;return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.getContract(n)];case 1:return t=e.sent(),[2,l.serializeAction(t,n,r,a,s,this.textEncoder,this.textDecoder)]}}))}))})))];case 1:return[2,n.sent()]}}))}))},t.prototype.deserializeActions=function(t){return i(this,void 0,void 0,(function(){var e=this;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){var n=t.account,r=t.name,a=t.authorization,s=t.data;return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.getContract(n)];case 1:return t=e.sent(),[2,l.deserializeAction(t,n,r,a,s,this.textEncoder,this.textDecoder)]}}))}))})))];case 1:return[2,n.sent()]}}))}))},t.prototype.deserializeTransactionWithActions=function(t){return i(this,void 0,void 0,(function(){var e,n;return o(this,(function(i){switch(i.label){case 0:return"string"==typeof t&&(t=l.hexToUint8Array(t)),e=this.deserializeTransaction(t),[4,this.deserializeActions(e.actions)];case 1:return n=i.sent(),[2,r({},e,{actions:n})]}}))}))},t.prototype.transact=function(t,e){var n=void 0===e?{}:e,a=n.broadcast,s=void 0===a||a,u=n.sign,c=void 0===u||u,f=n.blocksBehind,h=n.expireSeconds;return i(this,void 0,void 0,(function(){var e,n,i,a,u,p,d,y,v;return o(this,(function(o){switch(o.label){case 0:return this.chainId?[3,2]:[4,this.rpc.get_info()];case 1:e=o.sent(),this.chainId=e.chain_id,o.label=2;case 2:return"number"==typeof f&&h?e?[3,4]:[4,this.rpc.get_info()]:[3,6];case 3:e=o.sent(),o.label=4;case 4:return[4,this.rpc.get_block(e.head_block_num-f)];case 5:n=o.sent(),t=r({},l.transactionHeader(n,h),t),o.label=6;case 6:if(!this.hasRequiredTaposFields(t))throw new Error("Required configuration or TAPOS fields are not present");return[4,this.getTransactionAbis(t)];case 7:return i=o.sent(),a=[{},t],u={},[4,this.serializeActions(t.actions)];case 8:return t=r.apply(void 0,a.concat([(u.actions=o.sent(),u)])),p=this.serializeTransaction(t),d={serializedTransaction:p,signatures:[]},c?[4,this.signatureProvider.getAvailableKeys()]:[3,12];case 9:return y=o.sent(),[4,this.authorityProvider.getRequiredKeys({transaction:t,availableKeys:y})];case 10:return v=o.sent(),[4,this.signatureProvider.sign({chainId:this.chainId,requiredKeys:v,serializedTransaction:p,abis:i})];case 11:d=o.sent(),o.label=12;case 12:return s?[2,this.pushSignedTransaction(d)]:[2,d]}}))}))},t.prototype.pushSignedTransaction=function(t){var e=t.signatures,n=t.serializedTransaction;return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.rpc.push_transaction({signatures:e,serializedTransaction:n})]}))}))},t.prototype.hasRequiredTaposFields=function(t){var e=t.expiration,n=t.ref_block_num,r=t.ref_block_prefix;a(t,["expiration","ref_block_num","ref_block_prefix"]);return!!(e&&n&&r)},t}();e.Api=p},function(t,e,n){"use strict";var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n>>32-e}},{key:"hash",value:function(e){for(var n=t.pad(e),r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],i=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],o=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],a=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],s=n.byteLength/64,u=new Array(s).fill(void 0).map((function(t,e){return function(t){return new DataView(n,64*e,64).getUint32(4*t,!0)}})),c=[1732584193,4023233417,2562383102,271733878,3285377520],l=0;l0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(0),s=n(2);function u(t){var e,n,r="";try{for(var i=o(t),a=i.next();!a.done;a=i.next()){r+=("00"+a.value.toString(16)).slice(-2)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}var c=function(){function e(e,n){void 0===n&&(n={}),this.endpoint=e,n.fetch?this.fetchBuiltin=n.fetch:this.fetchBuiltin=t.fetch}return e.prototype.fetch=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,(0,this.fetchBuiltin)(this.endpoint+t,{body:JSON.stringify(e),method:"POST"})];case 1:return[4,(n=i.sent()).json()];case 2:if((r=i.sent()).processed&&r.processed.except)throw new s.RpcError(r);return[3,4];case 3:throw(o=i.sent()).isFetchError=!0,o;case 4:if(!n.ok)throw new s.RpcError(r);return[2,r]}}))}))},e.prototype.get_abi=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_abi",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_account=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_account",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_block_header_state=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_block_header_state",{block_num_or_id:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_block=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_block",{block_num_or_id:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_code=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_code",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_currency_balance=function(t,e,n){return void 0===n&&(n=null),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.fetch("/v1/chain/get_currency_balance",{code:t,account:e,symbol:n})];case 1:return[2,r.sent()]}}))}))},e.prototype.get_currency_stats=function(t,e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.fetch("/v1/chain/get_currency_stats",{code:t,symbol:e})];case 1:return[2,n.sent()]}}))}))},e.prototype.get_info=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_info",{})];case 1:return[2,t.sent()]}}))}))},e.prototype.get_producer_schedule=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_producer_schedule",{})];case 1:return[2,t.sent()]}}))}))},e.prototype.get_producers=function(t,e,n){return void 0===t&&(t=!0),void 0===e&&(e=""),void 0===n&&(n=50),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.fetch("/v1/chain/get_producers",{json:t,lower_bound:e,limit:n})];case 1:return[2,r.sent()]}}))}))},e.prototype.get_raw_code_and_abi=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_raw_code_and_abi",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.getRawAbi=function(t){return r(this,void 0,void 0,(function(){var e,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.get_raw_code_and_abi(t)];case 1:return e=r.sent(),n=a.base64ToBinary(e.abi),[2,{accountName:e.account_name,abi:n}]}}))}))},e.prototype.get_table_rows=function(t){var e=t.json,n=void 0===e||e,o=t.code,a=t.scope,s=t.table,u=t.table_key,c=void 0===u?"":u,l=t.lower_bound,f=void 0===l?"":l,h=t.upper_bound,p=void 0===h?"":h,d=t.index_position,y=void 0===d?1:d,v=t.key_type,g=void 0===v?"":v,b=t.limit,m=void 0===b?10:b,w=t.reverse,_=void 0!==w&&w,x=t.show_payer,A=void 0!==x&&x;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_table_rows",{json:n,code:o,scope:a,table:s,table_key:c,lower_bound:f,upper_bound:p,index_position:y,key_type:g,limit:m,reverse:_,show_payer:A})];case 1:return[2,t.sent()]}}))}))},e.prototype.get_table_by_scope=function(t){var e=t.code,n=t.table,o=t.lower_bound,a=void 0===o?"":o,s=t.upper_bound,u=void 0===s?"":s,c=t.limit,l=void 0===c?10:c;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_table_by_scope",{code:e,table:n,lower_bound:a,upper_bound:u,limit:l})];case 1:return[2,t.sent()]}}))}))},e.prototype.getRequiredKeys=function(t){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return e=a.convertLegacyPublicKeys,[4,this.fetch("/v1/chain/get_required_keys",{transaction:t.transaction,available_keys:t.availableKeys})];case 1:return[2,e.apply(void 0,[n.sent().required_keys])]}}))}))},e.prototype.push_transaction=function(t){var e=t.signatures,n=t.serializedTransaction;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/push_transaction",{signatures:e,compression:0,packed_context_free_data:"",packed_trx:u(n)})];case 1:return[2,t.sent()]}}))}))},e.prototype.db_size_get=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/db_size/get",{})];case 1:return[2,t.sent()]}}))}))},e.prototype.history_get_actions=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.fetch("/v1/history/get_actions",{account_name:t,pos:e,offset:n})];case 1:return[2,r.sent()]}}))}))},e.prototype.history_get_transaction=function(t,e){return void 0===e&&(e=null),r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.fetch("/v1/history/get_transaction",{id:t,block_num_hint:e})];case 1:return[2,n.sent()]}}))}))},e.prototype.history_get_key_accounts=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/history/get_key_accounts",{public_key:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.history_get_controlled_accounts=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/history/get_controlled_accounts",{controlling_account:t})];case 1:return[2,e.sent()]}}))}))},e}();e.JsonRpc=c}).call(this,n(11))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},i=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(6).RIPEMD160.hash,s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var c=function(){for(var t=Array(256).fill(-1),e=0;e"9".charCodeAt(0))throw new Error("invalid number");for(var o=i-"0".charCodeAt(0),a=0;a>8}if(o)throw new Error("number is out of range")}return n}function y(t,e){void 0===e&&(e=1);for(var n=Array(e).fill("0".charCodeAt(0)),r=t.length-1;r>=0;--r){for(var o=t[r],a=0;a>8}if(i)throw new Error("base-58 value is out of range")}return n.reverse(),n}function g(t,e){var n,r,a,u;void 0===e&&(e=1);var l=[];try{for(var f=o(t),h=f.next();!h.done;h=f.next()){for(var p=h.value,d=0;d>2,r=3*n;e>0&&"="===t[e-1]&&("="===t[e-2]?r-=2:r-=1);for(var i=new Uint8Array(r),o=0;o>4,3*o+1>2),3*o+20)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},o=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var s=n(0),u=function(t){void 0===t&&(t={}),this.skippedBinaryExtension=!1,this.options=t};e.SerializerState=u;var c=function(){function t(t){var e=void 0===t?{}:t,n=e.textEncoder,r=e.textDecoder,i=e.array;this.readPos=0,this.array=i||new Uint8Array(1024),this.length=i?i.length:0,this.textEncoder=n||new TextEncoder,this.textDecoder=r||new TextDecoder("utf-8",{fatal:!0})}return t.prototype.reserve=function(t){if(!(this.length+t<=this.array.length)){for(var e=this.array.length;this.length+t>e;)e=Math.ceil(1.5*e);var n=new Uint8Array(e);n.set(this.array),this.array=n}},t.prototype.haveReadData=function(){return this.readPosthis.length)throw new Error("Read past end of buffer");var e=new Uint8Array(this.array.buffer,this.array.byteOffset+this.readPos,t);return this.readPos+=t,e},t.prototype.pushUint16=function(t){this.push(t>>0&255,t>>8&255)},t.prototype.getUint16=function(){var t=0;return t|=this.get()<<0,t|=this.get()<<8},t.prototype.pushUint32=function(t){this.push(t>>0&255,t>>8&255,t>>16&255,t>>24&255)},t.prototype.getUint32=function(){var t=0;return t|=this.get()<<0,t|=this.get()<<8,t|=this.get()<<16,(t|=this.get()<<24)>>>0},t.prototype.pushNumberAsUint64=function(t){this.pushUint32(t>>>0),this.pushUint32(Math.floor(t/4294967296)>>>0)},t.prototype.getUint64AsNumber=function(){var t=this.getUint32();return 4294967296*(this.getUint32()>>>0)+(t>>>0)},t.prototype.pushVaruint32=function(t){for(;;){if(!(t>>>7)){this.push(t);break}this.push(128|127&t),t>>>=7}},t.prototype.getVaruint32=function(){for(var t=0,e=0;;){var n=this.get();if(t|=(127&n)<>>0},t.prototype.pushVarint32=function(t){this.pushVaruint32(t<<1^t>>31)},t.prototype.getVarint32=function(){var t=this.getVaruint32();return 1&t?~t>>1|2147483648:t>>>1},t.prototype.pushFloat32=function(t){this.pushArray(new Uint8Array(new Float32Array([t]).buffer))},t.prototype.getFloat32=function(){return new Float32Array(this.getUint8Array(4).slice().buffer)[0]},t.prototype.pushFloat64=function(t){this.pushArray(new Uint8Array(new Float64Array([t]).buffer))},t.prototype.getFloat64=function(){return new Float64Array(this.getUint8Array(8).slice().buffer)[0]},t.prototype.pushName=function(t){if("string"!=typeof t)throw new Error("Expected string containing name");function e(t){return t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)?t-"a".charCodeAt(0)+6:t>="1".charCodeAt(0)&&t<="5".charCodeAt(0)?t-"1".charCodeAt(0)+1:0}for(var n=new Uint8Array(8),r=63,i=0;i=0;--a)r>=0&&(n[Math.floor(r/8)]|=(o>>a&1)<=0;){for(var r=0,i=0;i<5;++i)n>=0&&(r=r<<1|t[Math.floor(n/8)]>>n%8&1,--n);e+=r>=6?String.fromCharCode(r+"a".charCodeAt(0)-6):r>=1?String.fromCharCode(r+"1".charCodeAt(0)-1):"."}for(;e.endsWith(".");)e=e.substr(0,e.length-1);return e},t.prototype.pushBytes=function(t){this.pushVaruint32(t.length),this.pushArray(t)},t.prototype.getBytes=function(){return this.getUint8Array(this.getVaruint32())},t.prototype.pushString=function(t){this.pushBytes(this.textEncoder.encode(t))},t.prototype.getString=function(){return this.textDecoder.decode(this.getBytes())},t.prototype.pushSymbolCode=function(t){if("string"!=typeof t)throw new Error("Expected string containing symbol_code");var e=[];for(e.push.apply(e,o(this.textEncoder.encode(t)));e.length<8;)e.push(0);this.pushArray(e.slice(0,8))},t.prototype.getSymbolCode=function(){var t,e=this.getUint8Array(8);for(t=0;t="0".charCodeAt(0)&&t.charCodeAt(e)<="9".charCodeAt(0);)i=!0,n+=t[e],++e;if(!i)throw new Error("Asset must begin with a number");if("."===t[e])for(++e;e="0".charCodeAt(0)&&t.charCodeAt(e)<="9".charCodeAt(0);)n+=t[e],++r,++e;var o=t.substr(e).trim();this.pushArray(s.signedDecimalToBinary(8,n)),this.pushSymbol({name:o,precision:r})},t.prototype.getAsset=function(){var t=this.getUint8Array(8),e=this.getSymbol(),n=e.name,r=e.precision,i=s.signedBinaryToDecimal(t,r+1);return r&&(i=i.substr(0,i.length-r)+"."+i.substr(i.length-r)),i+" "+n},t.prototype.pushPublicKey=function(t){var e=s.stringToPublicKey(t);this.push(e.type),this.pushArray(e.data)},t.prototype.getPublicKey=function(){var t=this.get(),e=this.getUint8Array(s.publicKeyDataSize);return s.publicKeyToString({type:t,data:e})},t.prototype.pushPrivateKey=function(t){var e=s.stringToPrivateKey(t);this.push(e.type),this.pushArray(e.data)},t.prototype.getPrivateKey=function(){var t=this.get(),e=this.getUint8Array(s.privateKeyDataSize);return s.privateKeyToString({type:t,data:e})},t.prototype.pushSignature=function(t){var e=s.stringToSignature(t);this.push(e.type),this.pushArray(e.data)},t.prototype.getSignature=function(){var t=this.get(),e=this.getUint8Array(s.signatureDataSize);return s.signatureToString({type:t,data:e})},t}();function l(t){var e=Date.parse(t);if(Number.isNaN(e))throw new Error("Invalid time format");return e}function f(t){return Math.round(1e3*l(t+"Z"))}function h(t){var e=new Date(t/1e3).toISOString();return e.substr(0,e.length-1)}function p(t){return Math.round(l(t+"Z")/1e3)}function d(t){var e=new Date(1e3*t).toISOString();return e.substr(0,e.length-1)}function y(t){return Math.round((l(t+"Z")-9466848e5)/500)}function v(t){var e=new Date(500*t+9466848e5).toISOString();return e.substr(0,e.length-1)}function g(t){if("string"!=typeof t)throw new Error("Expected string containing symbol");var e=t.match(/^([0-9]+),([A-Z]+)$/);if(!e)throw new Error("Invalid symbol");return{name:e[2],precision:+e[1]}}function b(t){var e=t.name;return t.precision+","+e}function m(t){var e,n,r="";try{for(var i=a(t),o=i.next();!o.done;o=i.next()){r+=("00"+o.value.toString(16)).slice(-2)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.toUpperCase()}function w(t){if("string"!=typeof t)throw new Error("Expected string containing hex digits");if(t.length%2)throw new Error("Odd number of hex digits");for(var e=t.length/2,n=new Uint8Array(e),r=0;r=this.fields.length)throw new Error("type index "+r+" is not valid for variant");var i=this.fields[r];return[i.name,i.type.deserialize(t,e,n)]}function k(t,e,n,r){var i,o;t.pushVaruint32(e.length);try{for(var s=a(e),u=s.next();!u.done;u=s.next()){var c=u.value;this.arrayOf.serialize(t,c,n,!1)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}}function T(t,e,n){for(var r=t.getVaruint32(),i=[],o=0;o",aliasOfName:"",arrayOf:null,optionalOf:null,extensionOf:null,baseName:"",base:null,fields:[],serialize:_,deserialize:x},t)}function K(t,e){if(Number.isNaN(+t)||Number.isNaN(+e)||"number"!=typeof t&&"string"!=typeof t)throw new Error("Expected number");if(+t!=+e)throw new Error("Number is out of range");return+t}function R(t,e){var n=t.get(e);if(n&&n.aliasOfName)return R(t,n.aliasOfName);if(n)return n;if(e.endsWith("[]"))return D({name:e,arrayOf:R(t,e.substr(0,e.length-2)),serialize:k,deserialize:T});if(e.endsWith("?"))return D({name:e,optionalOf:R(t,e.substr(0,e.length-1)),serialize:U,deserialize:P});if(e.endsWith("$"))return D({name:e,extensionOf:R(t,e.substr(0,e.length-1)),serialize:O,deserialize:C});throw new Error("Unknown type: "+e)}function N(t,e,n,r,i,o){var a=t.actions.get(n);if(!a)throw new Error("Unknown action "+n+" in contract "+e);var s=new c({textEncoder:i,textDecoder:o});return a.serialize(s,r),m(s.asUint8Array())}function j(t,e,n,r,i,o){var a=t.actions.get(n);if("string"==typeof r&&(r=w(r)),!a)throw new Error("Unknown action "+n+" in contract "+e);var s=new c({textDecoder:o,textEncoder:i});return s.pushArray(r),a.deserialize(s)}e.SerialBuffer=c,e.supportedAbiVersion=function(t){return t.startsWith("eosio::abi/1.")},e.dateToTimePoint=f,e.timePointToDate=h,e.dateToTimePointSec=p,e.timePointSecToDate=d,e.dateToBlockTimestamp=y,e.blockTimestampToDate=v,e.stringToSymbol=g,e.symbolToString=b,e.arrayToHex=m,e.hexToUint8Array=w,e.createInitialTypes=function(){var t=new Map(Object.entries({bool:D({name:"bool",serialize:function(t,e){if("boolean"!=typeof e)throw new Error("Expected true or false");t.push(e?1:0)},deserialize:function(t){return!!t.get()}}),uint8:D({name:"uint8",serialize:function(t,e){t.push(K(e,255&e))},deserialize:function(t){return t.get()}}),int8:D({name:"int8",serialize:function(t,e){t.push(K(e,e<<24>>24))},deserialize:function(t){return t.get()<<24>>24}}),uint16:D({name:"uint16",serialize:function(t,e){t.pushUint16(K(e,65535&e))},deserialize:function(t){return t.getUint16()}}),int16:D({name:"int16",serialize:function(t,e){t.pushUint16(K(e,e<<16>>16))},deserialize:function(t){return t.getUint16()<<16>>16}}),uint32:D({name:"uint32",serialize:function(t,e){t.pushUint32(K(e,e>>>0))},deserialize:function(t){return t.getUint32()}}),uint64:D({name:"uint64",serialize:function(t,e){t.pushArray(s.decimalToBinary(8,""+e))},deserialize:function(t){return s.binaryToDecimal(t.getUint8Array(8))}}),int64:D({name:"int64",serialize:function(t,e){t.pushArray(s.signedDecimalToBinary(8,""+e))},deserialize:function(t){return s.signedBinaryToDecimal(t.getUint8Array(8))}}),int32:D({name:"int32",serialize:function(t,e){t.pushUint32(K(e,0|e))},deserialize:function(t){return 0|t.getUint32()}}),varuint32:D({name:"varuint32",serialize:function(t,e){t.pushVaruint32(K(e,e>>>0))},deserialize:function(t){return t.getVaruint32()}}),varint32:D({name:"varint32",serialize:function(t,e){t.pushVarint32(K(e,0|e))},deserialize:function(t){return t.getVarint32()}}),uint128:D({name:"uint128",serialize:function(t,e){t.pushArray(s.decimalToBinary(16,""+e))},deserialize:function(t){return s.binaryToDecimal(t.getUint8Array(16))}}),int128:D({name:"int128",serialize:function(t,e){t.pushArray(s.signedDecimalToBinary(16,""+e))},deserialize:function(t){return s.signedBinaryToDecimal(t.getUint8Array(16))}}),float32:D({name:"float32",serialize:function(t,e){t.pushFloat32(e)},deserialize:function(t){return t.getFloat32()}}),float64:D({name:"float64",serialize:function(t,e){t.pushFloat64(e)},deserialize:function(t){return t.getFloat64()}}),float128:D({name:"float128",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),16)},deserialize:function(t){return m(t.getUint8Array(16))}}),bytes:D({name:"bytes",serialize:function(t,e){e instanceof Uint8Array||Array.isArray(e)?t.pushBytes(e):t.pushBytes(w(e))},deserialize:function(t,e){return e&&e.options.bytesAsUint8Array?t.getBytes():m(t.getBytes())}}),string:D({name:"string",serialize:function(t,e){t.pushString(e)},deserialize:function(t){return t.getString()}}),name:D({name:"name",serialize:function(t,e){t.pushName(e)},deserialize:function(t){return t.getName()}}),time_point:D({name:"time_point",serialize:function(t,e){t.pushNumberAsUint64(f(e))},deserialize:function(t){return h(t.getUint64AsNumber())}}),time_point_sec:D({name:"time_point_sec",serialize:function(t,e){t.pushUint32(p(e))},deserialize:function(t){return d(t.getUint32())}}),block_timestamp_type:D({name:"block_timestamp_type",serialize:function(t,e){t.pushUint32(y(e))},deserialize:function(t){return v(t.getUint32())}}),symbol_code:D({name:"symbol_code",serialize:function(t,e){t.pushSymbolCode(e)},deserialize:function(t){return t.getSymbolCode()}}),symbol:D({name:"symbol",serialize:function(t,e){t.pushSymbol(g(e))},deserialize:function(t){return b(t.getSymbol())}}),asset:D({name:"asset",serialize:function(t,e){t.pushAsset(e)},deserialize:function(t){return t.getAsset()}}),checksum160:D({name:"checksum160",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),20)},deserialize:function(t){return m(t.getUint8Array(20))}}),checksum256:D({name:"checksum256",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),32)},deserialize:function(t){return m(t.getUint8Array(32))}}),checksum512:D({name:"checksum512",serialize:function(t,e){t.pushUint8ArrayChecked(w(e),64)},deserialize:function(t){return m(t.getUint8Array(64))}}),public_key:D({name:"public_key",serialize:function(t,e){t.pushPublicKey(e)},deserialize:function(t){return t.getPublicKey()}}),private_key:D({name:"private_key",serialize:function(t,e){t.pushPrivateKey(e)},deserialize:function(t){return t.getPrivateKey()}}),signature:D({name:"signature",serialize:function(t,e){t.pushSignature(e)},deserialize:function(t){return t.getSignature()}})}));return t.set("extended_asset",D({name:"extended_asset",baseName:"",fields:[{name:"quantity",typeName:"asset",type:t.get("asset")},{name:"contract",typeName:"name",type:t.get("name")}],serialize:A,deserialize:z})),t},e.getType=R,e.getTypesFromAbi=function(t,e){var n,r,o,s,u,c,l,f,h,p,d=new Map(t);if(e.types)try{for(var y=a(e.types),v=y.next();!v.done;v=y.next()){var g=v.value,b=g.new_type_name,m=g.type;d.set(b,D({name:b,aliasOfName:m}))}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=y.return)&&r.call(y)}finally{if(n)throw n.error}}if(e.structs)try{for(var w=a(e.structs),_=w.next();!_.done;_=w.next()){var x=_.value,k=x.name,T=x.base,U=x.fields;d.set(k,D({name:k,baseName:T,fields:U.map((function(t){return{name:t.name,typeName:t.type,type:null}})),serialize:A,deserialize:z}))}}catch(t){o={error:t}}finally{try{_&&!_.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}if(e.variants)try{for(var P=a(e.variants),O=P.next();!O.done;O=P.next()){var C=O.value,K=C.name,N=C.types;d.set(K,D({name:K,fields:N.map((function(t){return{name:t,typeName:t,type:null}})),serialize:S,deserialize:E}))}}catch(t){u={error:t}}finally{try{O&&!O.done&&(c=P.return)&&c.call(P)}finally{if(u)throw u.error}}try{for(var j=a(d),B=j.next();!B.done;B=j.next()){var V=i(B.value,2);V[0];(m=V[1]).baseName&&(m.base=R(d,m.baseName));try{for(var M=a(m.fields),I=M.next();!I.done;I=M.next()){var L=I.value;L.type=R(d,L.typeName)}}catch(t){h={error:t}}finally{try{I&&!I.done&&(p=M.return)&&p.call(M)}finally{if(h)throw h.error}}}}catch(t){l={error:t}}finally{try{B&&!B.done&&(f=j.return)&&f.call(j)}finally{if(l)throw l.error}}return d},e.transactionHeader=function(t,e){return{expiration:d(p(t.timestamp)+e),ref_block_num:65535&t.block_num,ref_block_prefix:t.ref_block_prefix}},e.serializeActionData=N,e.serializeAction=function(t,e,n,r,i,o,a){return{account:e,name:n,authorization:r,data:N(t,e,n,i,o,a)}},e.deserializeActionData=j,e.deserializeAction=function(t,e,n,r,i,o,a){return{account:e,name:n,authorization:r,data:j(t,e,n,i,o,a)}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=function(t){function e(n){var r=this;return r=n.error&&n.error.details&&n.error.details.length&&n.error.details[0].message?t.call(this,n.error.details[0].message)||this:n.processed&&n.processed.except&&n.processed.except.message?t.call(this,n.processed.except.message)||this:t.call(this,n.message)||this,Object.setPrototypeOf(r,e.prototype),r.json=n,r}return i(e,t),e}(Error);e.RpcError=o},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},u=this&&this.__spread||function(){for(var t=[],e=0;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var l=n(1),f=n(7),h=n(8),p=function(){function t(t){this.contracts=new Map,this.cachedAbis=new Map,this.rpc=t.rpc,this.authorityProvider=t.authorityProvider||t.rpc,this.abiProvider=t.abiProvider||t.rpc,this.signatureProvider=t.signatureProvider,this.chainId=t.chainId,this.textEncoder=t.textEncoder,this.textDecoder=t.textDecoder,this.abiTypes=l.getTypesFromAbi(l.createInitialTypes(),f),this.transactionTypes=l.getTypesFromAbi(l.createInitialTypes(),h)}return t.prototype.rawAbiToJson=function(t){var e=new l.SerialBuffer({textEncoder:this.textEncoder,textDecoder:this.textDecoder,array:t});if(!l.supportedAbiVersion(e.getString()))throw new Error("Unsupported abi version");return e.restartRead(),this.abiTypes.get("abi_def").deserialize(e)},t.prototype.getCachedAbi=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var n,r,i,a;return o(this,(function(o){switch(o.label){case 0:if(!e&&this.cachedAbis.get(t))return[2,this.cachedAbis.get(t)];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.abiProvider.getRawAbi(t)];case 2:return r=o.sent().abi,i=this.rawAbiToJson(r),n={rawAbi:r,abi:i},[3,4];case 3:throw(a=o.sent()).message="fetching abi for "+t+": "+a.message,a;case 4:if(!n)throw new Error("Missing abi for "+t);return this.cachedAbis.set(t,n),[2,n]}}))}))},t.prototype.getAbi=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,this.getCachedAbi(t,e)];case 1:return[2,n.sent().abi]}}))}))},t.prototype.getTransactionAbis=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var n,r,a,s=this;return o(this,(function(c){return n=t.actions.map((function(t){return t.account})),r=new Set(n),a=u(r).map((function(t){return i(s,void 0,void 0,(function(){var n;return o(this,(function(r){switch(r.label){case 0:return n={accountName:t},[4,this.getCachedAbi(t,e)];case 1:return[2,(n.abi=r.sent().rawAbi,n)]}}))}))})),[2,Promise.all(a)]}))}))},t.prototype.getContract=function(t,e){return void 0===e&&(e=!1),i(this,void 0,void 0,(function(){var n,r,i,a,s,u,f,h,p,d,y;return o(this,(function(o){switch(o.label){case 0:return!e&&this.contracts.get(t)?[2,this.contracts.get(t)]:[4,this.getAbi(t,e)];case 1:i=o.sent(),a=l.getTypesFromAbi(l.createInitialTypes(),i),s=new Map;try{for(u=c(i.actions),f=u.next();!f.done;f=u.next())h=f.value,p=h.name,d=h.type,s.set(p,l.getType(a,d))}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return y={types:a,actions:s},this.contracts.set(t,y),[2,y]}}))}))},t.prototype.serialize=function(t,e,n){this.transactionTypes.get(e).serialize(t,n)},t.prototype.deserialize=function(t,e){return this.transactionTypes.get(e).deserialize(t)},t.prototype.serializeTransaction=function(t){var e=new l.SerialBuffer({textEncoder:this.textEncoder,textDecoder:this.textDecoder});return this.serialize(e,"transaction",r({max_net_usage_words:0,max_cpu_usage_ms:0,delay_sec:0,context_free_actions:[],actions:[],transaction_extensions:[]},t)),e.asUint8Array()},t.prototype.deserializeTransaction=function(t){var e=new l.SerialBuffer({textEncoder:this.textEncoder,textDecoder:this.textDecoder});return e.pushArray(t),this.deserialize(e,"transaction")},t.prototype.serializeActions=function(t){return i(this,void 0,void 0,(function(){var e=this;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){var n=t.account,r=t.name,a=t.authorization,s=t.data;return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.getContract(n)];case 1:return t=e.sent(),[2,l.serializeAction(t,n,r,a,s,this.textEncoder,this.textDecoder)]}}))}))})))];case 1:return[2,n.sent()]}}))}))},t.prototype.deserializeActions=function(t){return i(this,void 0,void 0,(function(){var e=this;return o(this,(function(n){switch(n.label){case 0:return[4,Promise.all(t.map((function(t){var n=t.account,r=t.name,a=t.authorization,s=t.data;return i(e,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return[4,this.getContract(n)];case 1:return t=e.sent(),[2,l.deserializeAction(t,n,r,a,s,this.textEncoder,this.textDecoder)]}}))}))})))];case 1:return[2,n.sent()]}}))}))},t.prototype.deserializeTransactionWithActions=function(t){return i(this,void 0,void 0,(function(){var e,n;return o(this,(function(i){switch(i.label){case 0:return"string"==typeof t&&(t=l.hexToUint8Array(t)),e=this.deserializeTransaction(t),[4,this.deserializeActions(e.actions)];case 1:return n=i.sent(),[2,r({},e,{actions:n})]}}))}))},t.prototype.transact=function(t,e){var n=void 0===e?{}:e,a=n.broadcast,s=void 0===a||a,u=n.sign,c=void 0===u||u,f=n.blocksBehind,h=n.expireSeconds;return i(this,void 0,void 0,(function(){var e,n,i,a,u,p,d,y,v;return o(this,(function(o){switch(o.label){case 0:return this.chainId?[3,2]:[4,this.rpc.get_info()];case 1:e=o.sent(),this.chainId=e.chain_id,o.label=2;case 2:return"number"==typeof f&&h?e?[3,4]:[4,this.rpc.get_info()]:[3,6];case 3:e=o.sent(),o.label=4;case 4:return[4,this.rpc.get_block(e.head_block_num-f)];case 5:n=o.sent(),t=r({},l.transactionHeader(n,h),t),o.label=6;case 6:if(!this.hasRequiredTaposFields(t))throw new Error("Required configuration or TAPOS fields are not present");return[4,this.getTransactionAbis(t)];case 7:return i=o.sent(),a=[{},t],u={},[4,this.serializeActions(t.actions)];case 8:return t=r.apply(void 0,a.concat([(u.actions=o.sent(),u)])),p=this.serializeTransaction(t),d={serializedTransaction:p,signatures:[]},c?[4,this.signatureProvider.getAvailableKeys()]:[3,12];case 9:return y=o.sent(),[4,this.authorityProvider.getRequiredKeys({transaction:t,availableKeys:y})];case 10:return v=o.sent(),[4,this.signatureProvider.sign({chainId:this.chainId,requiredKeys:v,serializedTransaction:p,abis:i})];case 11:d=o.sent(),o.label=12;case 12:return s?[2,this.pushSignedTransaction(d)]:[2,d]}}))}))},t.prototype.pushSignedTransaction=function(t){var e=t.signatures,n=t.serializedTransaction;return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.rpc.push_transaction({signatures:e,serializedTransaction:n})]}))}))},t.prototype.hasRequiredTaposFields=function(t){var e=t.expiration,n=t.ref_block_num,r=t.ref_block_prefix;a(t,["expiration","ref_block_num","ref_block_prefix"]);return!!(e&&n&&r)},t}();e.Api=p},function(t,e,n){"use strict";var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=function(){function t(t,e){for(var n=0;n>>32-e}},{key:"hash",value:function(e){for(var n=t.pad(e),r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],i=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],o=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],a=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],s=n.byteLength/64,u=new Array(s).fill(void 0).map((function(t,e){return function(t){return new DataView(n,64*e,64).getUint32(4*t,!0)}})),c=[1732584193,4023233417,2562383102,271733878,3285377520],l=0;l0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}};Object.defineProperty(e,"__esModule",{value:!0});var a=n(0),s=n(2);function u(t){var e,n,r="";try{for(var i=o(t),a=i.next();!a.done;a=i.next()){r+=("00"+a.value.toString(16)).slice(-2)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r}var c=function(){function e(e,n){void 0===n&&(n={}),this.endpoint=e,n.fetch?this.fetchBuiltin=n.fetch:this.fetchBuiltin=t.fetch}return e.prototype.fetch=function(t,e){return r(this,void 0,void 0,(function(){var n,r,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,(0,this.fetchBuiltin)(this.endpoint+t,{body:JSON.stringify(e),method:"POST"})];case 1:return[4,(n=i.sent()).json()];case 2:if((r=i.sent()).processed&&r.processed.except)throw new s.RpcError(r);return[3,4];case 3:throw(o=i.sent()).isFetchError=!0,o;case 4:if(!n.ok)throw new s.RpcError(r);return[2,r]}}))}))},e.prototype.get_abi=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_abi",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_account=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_account",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_block_header_state=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_block_header_state",{block_num_or_id:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_block=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_block",{block_num_or_id:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_code=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_code",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.get_currency_balance=function(t,e,n){return void 0===n&&(n=null),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.fetch("/v1/chain/get_currency_balance",{code:t,account:e,symbol:n})];case 1:return[2,r.sent()]}}))}))},e.prototype.get_currency_stats=function(t,e){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.fetch("/v1/chain/get_currency_stats",{code:t,symbol:e})];case 1:return[2,n.sent()]}}))}))},e.prototype.get_info=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_info",{})];case 1:return[2,t.sent()]}}))}))},e.prototype.get_producer_schedule=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_producer_schedule",{})];case 1:return[2,t.sent()]}}))}))},e.prototype.get_producers=function(t,e,n){return void 0===t&&(t=!0),void 0===e&&(e=""),void 0===n&&(n=50),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.fetch("/v1/chain/get_producers",{json:t,lower_bound:e,limit:n})];case 1:return[2,r.sent()]}}))}))},e.prototype.get_raw_code_and_abi=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/chain/get_raw_code_and_abi",{account_name:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.getRawAbi=function(t){return r(this,void 0,void 0,(function(){var e,n;return i(this,(function(r){switch(r.label){case 0:return[4,this.get_raw_code_and_abi(t)];case 1:return e=r.sent(),n=a.base64ToBinary(e.abi),[2,{accountName:e.account_name,abi:n}]}}))}))},e.prototype.get_table_rows=function(t){var e=t.json,n=void 0===e||e,o=t.code,a=t.scope,s=t.table,u=t.table_key,c=void 0===u?"":u,l=t.lower_bound,f=void 0===l?"":l,h=t.upper_bound,p=void 0===h?"":h,d=t.index_position,y=void 0===d?1:d,v=t.key_type,g=void 0===v?"":v,b=t.limit,m=void 0===b?10:b,w=t.reverse,_=void 0!==w&&w,x=t.show_payer,A=void 0!==x&&x;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_table_rows",{json:n,code:o,scope:a,table:s,table_key:c,lower_bound:f,upper_bound:p,index_position:y,key_type:g,limit:m,reverse:_,show_payer:A})];case 1:return[2,t.sent()]}}))}))},e.prototype.get_table_by_scope=function(t){var e=t.code,n=t.table,o=t.lower_bound,a=void 0===o?"":o,s=t.upper_bound,u=void 0===s?"":s,c=t.limit,l=void 0===c?10:c;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/get_table_by_scope",{code:e,table:n,lower_bound:a,upper_bound:u,limit:l})];case 1:return[2,t.sent()]}}))}))},e.prototype.getRequiredKeys=function(t){return r(this,void 0,void 0,(function(){var e;return i(this,(function(n){switch(n.label){case 0:return e=a.convertLegacyPublicKeys,[4,this.fetch("/v1/chain/get_required_keys",{transaction:t.transaction,available_keys:t.availableKeys})];case 1:return[2,e.apply(void 0,[n.sent().required_keys])]}}))}))},e.prototype.push_transaction=function(t){var e=t.signatures,n=t.serializedTransaction;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/chain/push_transaction",{signatures:e,compression:0,packed_context_free_data:"",packed_trx:u(n)})];case 1:return[2,t.sent()]}}))}))},e.prototype.db_size_get=function(){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.fetch("/v1/db_size/get",{})];case 1:return[2,t.sent()]}}))}))},e.prototype.history_get_actions=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return[4,this.fetch("/v1/history/get_actions",{account_name:t,pos:e,offset:n})];case 1:return[2,r.sent()]}}))}))},e.prototype.history_get_transaction=function(t,e){return void 0===e&&(e=null),r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return[4,this.fetch("/v1/history/get_transaction",{id:t,block_num_hint:e})];case 1:return[2,n.sent()]}}))}))},e.prototype.history_get_key_accounts=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/history/get_key_accounts",{public_key:t})];case 1:return[2,e.sent()]}}))}))},e.prototype.history_get_controlled_accounts=function(t){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.fetch("/v1/history/get_controlled_accounts",{controlling_account:t})];case 1:return[2,e.sent()]}}))}))},e}();e.JsonRpc=c}).call(this,n(11))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]