wax-ws-rpc-js 1.0.0
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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/websocket-rpc.d.ts +56 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 meta
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './websocket-rpc';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.WaxWsRpc=e():t.WaxWsRpc=e()}(this,()=>{return t={17(t,e,r){try{var n=r(23);if("function"!=typeof n.inherits)throw"";t.exports=n.inherits}catch(e){t.exports=r(698)}},23(t){"use strict";t.exports=require("util")},86(t){"use strict";t.exports=require("ws")},156(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),i=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),i(r(801),e)},166(t,e,r){"use strict";var n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spreadArray||function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.signatureToString=e.stringToSignature=e.privateKeyToString=e.privateKeyToLegacyString=e.stringToPrivateKey=e.convertLegacyPublicKeys=e.convertLegacyPublicKey=e.publicKeyToString=e.publicKeyToLegacyString=e.stringToPublicKey=e.signatureDataSize=e.privateKeyDataSize=e.publicKeyDataSize=e.KeyType=e.base64ToBinary=e.binaryToBase58=e.base58ToBinary=e.signedBinaryToDecimal=e.binaryToDecimal=e.signedDecimalToBinary=e.decimalToBinary=e.negate=e.isNegative=void 0;var o,s=r(952),h=r(851).RIPEMD160.hash,u="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",c=function(){for(var t=Array(256).fill(-1),e=0;e<58;++e)t[u.charCodeAt(e)]=e;return t}(),l=function(){for(var t=Array(256).fill(-1),e=0;e<64;++e)t["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(e)]=e;return t["=".charCodeAt(0)]=0,t}();e.isNegative=function(t){return!!(128&t[t.length-1])},e.negate=function(t){for(var e=1,r=0;r<t.length;++r){var n=(255&~t[r])+e;t[r]=n,e=n>>8}},e.decimalToBinary=function(t,e){for(var r=new Uint8Array(t),n=0;n<e.length;++n){var i=e.charCodeAt(n);if(i<"0".charCodeAt(0)||i>"9".charCodeAt(0))throw new Error("invalid number");for(var a=i-"0".charCodeAt(0),o=0;o<t;++o){var s=10*r[o]+a;r[o]=s,a=s>>8}if(a)throw new Error("number is out of range")}return r},e.signedDecimalToBinary=function(t,r){var n="-"===r[0];n&&(r=r.substr(1));var i=e.decimalToBinary(t,r);if(n){if(e.negate(i),!e.isNegative(i))throw new Error("number is out of range")}else if(e.isNegative(i))throw new Error("number is out of range");return i},e.binaryToDecimal=function(t,e){void 0===e&&(e=1);for(var r=Array(e).fill("0".charCodeAt(0)),a=t.length-1;a>=0;--a){for(var o=t[a],s=0;s<r.length;++s){var h=(r[s]-"0".charCodeAt(0)<<8)+o;r[s]="0".charCodeAt(0)+h%10,o=h/10|0}for(;o;)r.push("0".charCodeAt(0)+o%10),o=o/10|0}return r.reverse(),String.fromCharCode.apply(String,i([],n(r)))},e.signedBinaryToDecimal=function(t,r){if(void 0===r&&(r=1),e.isNegative(t)){var n=t.slice();return e.negate(n),"-"+e.binaryToDecimal(n,r)}return e.binaryToDecimal(t,r)},e.base58ToBinary=function(t,e){if(!t)return function(t){for(var e,r,n=[],i=0;i<t.length;++i){var o=c[t.charCodeAt(i)];if(o<0)throw new Error("invalid base-58 value");for(var s=0;s<n.length;++s){var h=58*n[s]+o;n[s]=255&h,o=h>>8}o&&n.push(o)}try{for(var u=a(t),l=u.next();!l.done&&"1"===l.value;l=u.next())n.push(0)}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}return n.reverse(),new Uint8Array(n)}(e);for(var r=new Uint8Array(t),n=0;n<e.length;++n){var i=c[e.charCodeAt(n)];if(i<0)throw new Error("invalid base-58 value");for(var o=0;o<t;++o){var s=58*r[o]+i;r[o]=s,i=s>>8}if(i)throw new Error("base-58 value is out of range")}return r.reverse(),r},e.binaryToBase58=function(t,e){var r,o,s,h;void 0===e&&(e=1);var l=[];try{for(var f=a(t),p=f.next();!p.done;p=f.next()){for(var d=p.value,g=0;g<l.length;++g){var y=(c[l[g]]<<8)+d;l[g]=u.charCodeAt(y%58),d=y/58|0}for(;d;)l.push(u.charCodeAt(d%58)),d=d/58|0}}catch(t){r={error:t}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}try{for(var _=a(t),v=_.next();!v.done&&!v.value;v=_.next())l.push("1".charCodeAt(0))}catch(t){s={error:t}}finally{try{v&&!v.done&&(h=_.return)&&h.call(_)}finally{if(s)throw s.error}}return l.reverse(),String.fromCharCode.apply(String,i([],n(l)))},e.base64ToBinary=function(t){var e=t.length;if(1==(3&e)&&"="===t[e-1]&&(e-=1),3&e)throw new Error("base-64 value is not padded correctly");var r=e>>2,n=3*r;e>0&&"="===t[e-1]&&("="===t[e-2]?n-=2:n-=1);for(var i=new Uint8Array(n),a=0;a<r;++a){var o=l[t.charCodeAt(4*a+0)],s=l[t.charCodeAt(4*a+1)],h=l[t.charCodeAt(4*a+2)],u=l[t.charCodeAt(4*a+3)];i[3*a+0]=o<<2|s>>4,3*a+1<n&&(i[3*a+1]=(15&s)<<4|h>>2),3*a+2<n&&(i[3*a+2]=(3&h)<<6|u)}return i},function(t){t[t.k1=0]="k1",t[t.r1=1]="r1",t[t.wa=2]="wa"}(o=e.KeyType||(e.KeyType={})),e.publicKeyDataSize=33,e.privateKeyDataSize=32,e.signatureDataSize=65;var f=function(t,e){for(var r=new Uint8Array(t.length+e.length),n=0;n<t.length;++n)r[n]=t[n];for(n=0;n<e.length;++n)r[t.length+n]=e.charCodeAt(n);return h(r)},p=function(t,r,n,i){var a=e.base58ToBinary(n?n+4:0,t),o={type:r,data:new Uint8Array(a.buffer,0,a.length-4)},s=new Uint8Array(f(o.data,i));if(s[0]!==a[a.length-4]||s[1]!==a[a.length-3]||s[2]!==a[a.length-2]||s[3]!==a[a.length-1])throw new Error("checksum doesn't match");return o},d=function(t,r,n){for(var i=new Uint8Array(f(t.data,r)),a=new Uint8Array(t.data.length+4),o=0;o<t.data.length;++o)a[o]=t.data[o];for(o=0;o<4;++o)a[o+t.data.length]=i[o];return n+e.binaryToBase58(a)};e.stringToPublicKey=function(t){if("string"!=typeof t)throw new Error("expected string containing public key");if("EOS"===t.substr(0,3)){for(var r=e.base58ToBinary(e.publicKeyDataSize+4,t.substr(3)),n={type:o.k1,data:new Uint8Array(e.publicKeyDataSize)},i=0;i<e.publicKeyDataSize;++i)n.data[i]=r[i];var a=new Uint8Array(h(n.data));if(a[0]!==r[e.publicKeyDataSize]||a[1]!==r[34]||a[2]!==r[35]||a[3]!==r[36])throw new Error("checksum doesn't match");return n}if("PUB_K1_"===t.substr(0,7))return p(t.substr(7),o.k1,e.publicKeyDataSize,"K1");if("PUB_R1_"===t.substr(0,7))return p(t.substr(7),o.r1,e.publicKeyDataSize,"R1");if("PUB_WA_"===t.substr(0,7))return p(t.substr(7),o.wa,0,"WA");throw new Error("unrecognized public key format")},e.publicKeyToLegacyString=function(t){if(t.type===o.k1&&t.data.length===e.publicKeyDataSize)return d(t,"","EOS");throw t.type===o.r1||t.type===o.wa?new Error("Key format not supported in legacy conversion"):new Error("unrecognized public key format")},e.publicKeyToString=function(t){if(t.type===o.k1&&t.data.length===e.publicKeyDataSize)return d(t,"K1","PUB_K1_");if(t.type===o.r1&&t.data.length===e.publicKeyDataSize)return d(t,"R1","PUB_R1_");if(t.type===o.wa)return d(t,"WA","PUB_WA_");throw new Error("unrecognized public key format")},e.convertLegacyPublicKey=function(t){return"EOS"===t.substr(0,3)?e.publicKeyToString(e.stringToPublicKey(t)):t},e.convertLegacyPublicKeys=function(t){return t.map(e.convertLegacyPublicKey)},e.stringToPrivateKey=function(t){if("string"!=typeof t)throw new Error("expected string containing private key");if("PVT_R1_"===t.substr(0,7))return p(t.substr(7),o.r1,e.privateKeyDataSize,"R1");if("PVT_K1_"===t.substr(0,7))return p(t.substr(7),o.k1,e.privateKeyDataSize,"K1");var r=e.base58ToBinary(e.privateKeyDataSize+5,t),n={type:o.k1,data:new Uint8Array(e.privateKeyDataSize)};if(128!==r[0])throw new Error("unrecognized private key type");for(var i=0;i<e.privateKeyDataSize;++i)n.data[i]=r[i+1];return n},e.privateKeyToLegacyString=function(t){if(t.type===o.k1&&t.data.length===e.privateKeyDataSize){var r=[];r.push(128),t.data.forEach(function(t){return r.push(t)});for(var n=new Uint8Array(s.sha256().update(s.sha256().update(r).digest()).digest()),i=new Uint8Array(e.privateKeyDataSize+5),a=0;a<r.length;a++)i[a]=r[a];for(a=0;a<4;a++)i[a+r.length]=n[a];return e.binaryToBase58(i)}throw t.type===o.r1||t.type===o.wa?new Error("Key format not supported in legacy conversion"):new Error("unrecognized public key format")},e.privateKeyToString=function(t){if(t.type===o.r1)return d(t,"R1","PVT_R1_");if(t.type===o.k1)return d(t,"K1","PVT_K1_");throw new Error("unrecognized private key format")},e.stringToSignature=function(t){if("string"!=typeof t)throw new Error("expected string containing signature");if("SIG_K1_"===t.substr(0,7))return p(t.substr(7),o.k1,e.signatureDataSize,"K1");if("SIG_R1_"===t.substr(0,7))return p(t.substr(7),o.r1,e.signatureDataSize,"R1");if("SIG_WA_"===t.substr(0,7))return p(t.substr(7),o.wa,0,"WA");throw new Error("unrecognized signature format")},e.signatureToString=function(t){if(t.type===o.k1)return d(t,"K1","SIG_K1_");if(t.type===o.r1)return d(t,"R1","SIG_R1_");if(t.type===o.wa)return d(t,"WA","SIG_WA_");throw new Error("unrecognized signature format")}},225(t,e,r){"use strict";var n=r(426).rotr32;function i(t,e,r){return t&e^~t&r}function a(t,e,r){return t&e^t&r^e&r}function o(t,e,r){return t^e^r}e.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?o(e,r,n):2===t?a(e,r,n):void 0},e.ch32=i,e.maj32=a,e.p32=o,e.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},e.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},e.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},e.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},229(t,e,r){"use strict";e.sha1=r(917),e.sha224=r(714),e.sha256=r(287),e.sha384=r(911),e.sha512=r(766)},287(t,e,r){"use strict";var n=r(426),i=r(785),a=r(225),o=r(349),s=n.sum32,h=n.sum32_4,u=n.sum32_5,c=a.ch32,l=a.maj32,f=a.s0_256,p=a.s1_256,d=a.g0_256,g=a.g1_256,y=i.BlockHash,_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=_,this.W=new Array(64)}n.inherits(v,y),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=h(g(r[n-2]),r[n-7],d(r[n-15]),r[n-16]);var i=this.h[0],a=this.h[1],y=this.h[2],_=this.h[3],v=this.h[4],b=this.h[5],w=this.h[6],m=this.h[7];for(o(this.k.length===r.length),n=0;n<r.length;n++){var S=u(m,p(v),c(v,b,w),this.k[n],r[n]),k=s(f(i),l(i,a,y));m=w,w=b,b=v,v=s(_,S),_=y,y=a,a=i,i=s(S,k)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],y),this.h[3]=s(this.h[3],_),this.h[4]=s(this.h[4],v),this.h[5]=s(this.h[5],b),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],m)},v.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},349(t){function e(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=e,e.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},426(t,e,r){"use strict";var n=r(349),i=r(17);function a(t,e){return 55296==(64512&t.charCodeAt(e))&&!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1))}function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function h(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var o=t.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):a(t,i)?(o=65536+((1023&o)<<10)+(1023&t.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},e.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=s(t[r].toString(16));return e},e.htonl=o,e.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=o(i)),r+=h(i.toString(16))}return r},e.zero2=s,e.zero8=h,e.join32=function(t,e,r,i){var a=r-e;n(a%4==0);for(var o=new Array(a/4),s=0,h=e;s<o.length;s++,h+=4){var u;u="big"===i?t[h]<<24|t[h+1]<<16|t[h+2]<<8|t[h+3]:t[h+3]<<24|t[h+2]<<16|t[h+1]<<8|t[h],o[s]=u>>>0}return o},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var a=t[n];"big"===e?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<<e|t>>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],a=n+t[e+1]>>>0,o=(a<n?1:0)+r+i;t[e]=o>>>0,t[e+1]=a},e.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,a,o,s){var h=0,u=e;return h+=(u=u+n>>>0)<e?1:0,h+=(u=u+a>>>0)<a?1:0,t+r+i+o+(h+=(u=u+s>>>0)<s?1:0)>>>0},e.sum64_4_lo=function(t,e,r,n,i,a,o,s){return e+n+a+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,a,o,s,h,u){var c=0,l=e;return c+=(l=l+n>>>0)<e?1:0,c+=(l=l+a>>>0)<a?1:0,c+=(l=l+s>>>0)<s?1:0,t+r+i+o+h+(c+=(l=l+u>>>0)<u?1:0)>>>0},e.sum64_5_lo=function(t,e,r,n,i,a,o,s,h,u){return e+n+a+s+u>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},698(t){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},714(t,e,r){"use strict";var n=r(426),i=r(287);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),t.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},766(t,e,r){"use strict";var n=r(426),i=r(785),a=r(349),o=n.rotr64_hi,s=n.rotr64_lo,h=n.shr64_hi,u=n.shr64_lo,c=n.sum64,l=n.sum64_hi,f=n.sum64_lo,p=n.sum64_4_hi,d=n.sum64_4_lo,g=n.sum64_5_hi,y=n.sum64_5_lo,_=i.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;_.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function w(t,e,r,n,i){var a=t&r^~t&i;return a<0&&(a+=4294967296),a}function m(t,e,r,n,i,a){var o=e&n^~e&a;return o<0&&(o+=4294967296),o}function S(t,e,r,n,i){var a=t&r^t&i^r&i;return a<0&&(a+=4294967296),a}function k(t,e,r,n,i,a){var o=e&n^e&a^n&a;return o<0&&(o+=4294967296),o}function A(t,e){var r=o(t,e,28)^o(e,t,2)^o(e,t,7);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=o(t,e,14)^o(t,e,18)^o(e,t,9);return r<0&&(r+=4294967296),r}function z(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function K(t,e){var r=o(t,e,1)^o(t,e,8)^h(t,e,7);return r<0&&(r+=4294967296),r}function C(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function E(t,e){var r=o(t,e,19)^o(e,t,29)^h(t,e,6);return r<0&&(r+=4294967296),r}function D(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(b,_),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=E(r[n-4],r[n-3]),a=D(r[n-4],r[n-3]),o=r[n-14],s=r[n-13],h=K(r[n-30],r[n-29]),u=C(r[n-30],r[n-29]),c=r[n-32],l=r[n-31];r[n]=p(i,a,o,s,h,u,c,l),r[n+1]=d(i,a,o,s,h,u,c,l)}},b.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],h=this.h[4],u=this.h[5],p=this.h[6],d=this.h[7],_=this.h[8],v=this.h[9],b=this.h[10],K=this.h[11],C=this.h[12],E=this.h[13],D=this.h[14],B=this.h[15];a(this.k.length===r.length);for(var P=0;P<r.length;P+=2){var R=D,U=B,j=x(_,v),W=z(_,v),L=w(_,0,b,0,C),H=m(0,v,0,K,0,E),O=this.k[P],I=this.k[P+1],q=r[P],N=r[P+1],M=g(R,U,j,W,L,H,O,I,q,N),V=y(R,U,j,W,L,H,O,I,q,N);R=A(n,i),U=T(n,i),j=S(n,0,o,0,h),W=k(0,i,0,s,0,u);var G=l(R,U,j,W),J=f(R,U,j,W);D=C,B=E,C=b,E=K,b=_,K=v,_=l(p,d,M,V),v=f(d,d,M,V),p=h,d=u,h=o,u=s,o=n,s=i,n=l(M,V,G,J),i=f(M,V,G,J)}c(this.h,0,n,i),c(this.h,2,o,s),c(this.h,4,h,u),c(this.h,6,p,d),c(this.h,8,_,v),c(this.h,10,b,K),c(this.h,12,C,E),c(this.h,14,D,B)},b.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},784(t,e,r){"use strict";var n=r(426),i=r(785),a=n.rotl32,o=n.sum32,s=n.sum32_3,h=n.sum32_4,u=i.BlockHash;function c(){if(!(this instanceof c))return new c;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function f(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function p(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(c,u),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],c=this.h[4],v=r,b=n,w=i,m=u,S=c,k=0;k<80;k++){var A=o(a(h(r,l(k,n,i,u),t[d[k]+e],f(k)),y[k]),c);r=c,c=u,u=a(i,10),i=n,n=A,A=o(a(h(v,l(79-k,b,w,m),t[g[k]+e],p(k)),_[k]),S),v=S,S=m,m=a(w,10),w=b,b=A}A=s(this.h[1],i,m),this.h[1]=s(this.h[2],u,S),this.h[2]=s(this.h[3],c,v),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,w),this.h[0]=A},c.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var d=[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],g=[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],y=[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],_=[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]},785(t,e,r){"use strict";var n=r(426),i=r(349);function a(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}e.BlockHash=a,a.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},a.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},a.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n}},801(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebsocketJsonRpc=void 0;const n=r(166),i=t=>{let e="";for(const r of t)e+=("00"+r.toString(16)).slice(-2);return e};let a;if("undefined"!=typeof window&&window.WebSocket)a=window.WebSocket;else try{a=r(86)}catch(t){throw new Error('WebSocket is not available. Please install "ws" package for Node.js environment.')}e.WebsocketJsonRpc=class{constructor(t,e={}){this.isConnected=!1,this.isConnecting=!1,this.pending=new Map,this.queue=[],this.retryCount=0,this.reqId=0,this.HEARTBEAT_INTERVAL=3e4,this.endpoint=t.replace(/\/$/,""),this.options={autoConnect:e.autoConnect??!0,autoReconnect:e.autoReconnect??!0,reconnectInterval:e.reconnectInterval??3e3,maxRetries:e.maxRetries??10},this.options.autoConnect&&this.connect()}async connect(){if(!this.isConnected&&!this.isConnecting)return this.isConnecting=!0,new Promise((t,e)=>{try{this.ws=new a(this.endpoint),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.isConnected=!0,this.isConnecting=!1,this.retryCount=0,this.processQueue(),this.startHeartbeat(),t()},this.ws.onmessage=t=>this.handleMessage(t),this.ws.onclose=()=>{this.isConnected=!1,this.isConnecting=!1,this.stopHeartbeat(),this.options.autoReconnect&&this.attemptReconnect()},this.ws.onerror=t=>{this.isConnecting=!1,this.isConnected||e(t)}}catch(t){this.isConnecting=!1,e(t)}})}attemptReconnect(){this.retryCount<this.options.maxRetries&&(this.retryCount++,console.log(`Reconnecting (${this.retryCount}/${this.options.maxRetries}) in ${this.options.reconnectInterval}ms...`),setTimeout(()=>this.connect(),this.options.reconnectInterval))}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.isConnected&&this.ws&&this.ws.send(JSON.stringify({type:"ping"}))},this.HEARTBEAT_INTERVAL)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}processQueue(){for(;this.queue.length>0&&this.isConnected;){const t=this.queue.shift();t&&this.sendToWs(t.payload,t.resolve,t.reject)}}sendToWs(t,e,r){const n=Number(t.request_id),i=setTimeout(()=>{this.pending.has(n)&&(this.pending.delete(n),r(new Error("Request Timeout")))},15e3);this.pending.set(n,{resolve:e,reject:r,timeout:i}),this.ws.send(JSON.stringify(t))}handleMessage(t){try{const e=t.data.toString(),r=JSON.parse(e),n=Number(r.request_id),i=this.pending.get(n);i&&(clearTimeout(i.timeout),this.pending.delete(n),r.error?i.reject(new Error(r.error)):i.resolve(r.result))}catch(t){console.error("Parse Error:",t)}}async call(t,e={}){const r={request_id:""+ ++this.reqId,type:t};return e&&Object.keys(e).length>0&&(r.params=e),new Promise((t,e)=>{this.isConnected?this.sendToWs(r,t,e):(this.queue.push({payload:r,resolve:t,reject:e}),this.isConnecting||this.connect())})}async get_abi(t){return await this.call("get_abi",{account_name:t})}async get_account(t){return await this.call("get_account",{account_name:t})}async get_accounts_by_authorizers(t,e){return await this.call("get_accounts_by_authorizers",{accounts:t,keys:e})}async get_activated_protocol_features({limit:t=10,search_by_block_num:e=!1,reverse:r=!1,lower_bound:n,upper_bound:i}){return await this.call("get_activated_protocol_features",{lower_bound:n,upper_bound:i,limit:t,search_by_block_num:e,reverse:r})}async get_block_header_state(t){return await this.call("get_block_header_state",{block_num_or_id:t})}async get_block_info(t){return await this.call("get_block_info",{block_num:t})}async get_block(t){return await this.call("get_block",{block_num_or_id:t})}async get_code(t){return await this.call("get_code",{account_name:t,code_as_wasm:!0})}async get_code_hash(t){return await this.call("get_code_hash",{account_name:t})}async get_currency_balance(t,e,r=null){return await this.call("get_currency_balance",{code:t,account:e,symbol:r})}async get_currency_stats(t,e){return await this.call("get_currency_stats",{code:t,symbol:e})}async get_info(){return await this.call("get_info",{})}async get_producer_schedule(){return await this.call("get_producer_schedule",{})}async get_producers(t=!0,e="",r=50){return await this.call("get_producers",{json:t,lower_bound:e,limit:r})}async get_raw_code_and_abi(t){return await this.call("get_raw_code_and_abi",{account_name:t})}async getRawAbi(t){const e=await this.get_raw_abi(t),r=(0,n.base64ToBinary)(e.abi);return{accountName:e.account_name,abi:r}}async get_raw_abi(t){return await this.call("get_raw_abi",{account_name:t})}async get_scheduled_transactions(t=!0,e="",r=50){return await this.call("get_scheduled_transactions",{json:t,lower_bound:e,limit:r})}async get_table_rows({json:t=!0,code:e,scope:r,table:n,lower_bound:i="",upper_bound:a="",index_position:o=1,key_type:s="",limit:h=10,reverse:u=!1,show_payer:c=!1}){return await this.call("get_table_rows",{json:t,code:e,scope:r,table:n,lower_bound:i,upper_bound:a,index_position:o,key_type:s,limit:h,reverse:u,show_payer:c})}async get_table_by_scope({code:t,table:e,lower_bound:r="",upper_bound:n="",limit:i=10}){return await this.call("get_table_by_scope",{code:t,table:e,lower_bound:r,upper_bound:n,limit:i})}async getRequiredKeys(t){const e=await this.call("get_required_keys",{transaction:t.transaction,available_keys:t.availableKeys});return(0,n.convertLegacyPublicKeys)(e.required_keys)}async push_transaction({signatures:t,compression:e=0,serializedTransaction:r,serializedContextFreeData:n}){return await this.call("push_transaction",{signatures:t,compression:e,packed_context_free_data:i(n||new Uint8Array(0)),packed_trx:i(r)})}async push_ro_transaction({signatures:t,compression:e=0,serializedTransaction:r},n=!1){return await this.call("push_ro_transaction",{transaction:{signatures:t,compression:e,packed_context_free_data:i(new Uint8Array(0)),packed_trx:i(r)},return_failure_traces:n})}async push_transactions(t){const e=t.map(({signatures:t,compression:e=0,serializedTransaction:r,serializedContextFreeData:n})=>({signatures:t,compression:e,packed_context_free_data:i(n||new Uint8Array(0)),packed_trx:i(r)}));return await this.call("push_transactions",e)}async send_transaction({signatures:t,compression:e=0,serializedTransaction:r,serializedContextFreeData:n}){return await this.call("send_transaction",{signatures:t,compression:e,packed_context_free_data:i(n||new Uint8Array(0)),packed_trx:i(r)})}}},851(t){"use strict";var e=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),r=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return e(t,null,[{key:"get_n_pad_bytes",value:function(t){return 64-(t+8&63)}},{key:"pad",value:function(e){var r,n,i=e.byteLength,a=t.get_n_pad_bytes(i),o=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!e||r.length!==e);n=!0);}catch(t){i=!0,a=t}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}((r=i,n=536870912,[Math.floor(r/n),r%n]).map(function(t,e){return e?8*t:t}),2),s=o[0],h=o[1],u=new Uint8Array(i+a+8);u.set(new Uint8Array(e),0);var c=new DataView(u.buffer);return c.setUint8(i,128),c.setUint32(i+a,h,!0),c.setUint32(i+a+4,s,!0),u.buffer}},{key:"f",value:function(t,e,r,n){return 0<=t&&t<=15?e^r^n:16<=t&&t<=31?e&r|~e&n:32<=t&&t<=47?(e|~r)^n:48<=t&&t<=63?e&n|r&~n:64<=t&&t<=79?e^(r|~n):void 0}},{key:"K",value:function(t){return 0<=t&&t<=15?0:16<=t&&t<=31?1518500249:32<=t&&t<=47?1859775393:48<=t&&t<=63?2400959708:64<=t&&t<=79?2840853838:void 0}},{key:"KP",value:function(t){return 0<=t&&t<=15?1352829926:16<=t&&t<=31?1548603684:32<=t&&t<=47?1836072691:48<=t&&t<=63?2053994217:64<=t&&t<=79?0:void 0}},{key:"add_modulo32",value:function(){return 0|Array.from(arguments).reduce(function(t,e){return t+e},0)}},{key:"rol32",value:function(t,e){return t<<e|t>>>32-e}},{key:"hash",value:function(e){for(var r=t.pad(e),n=[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],a=[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],o=[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=r.byteLength/64,h=new Array(s).fill(void 0).map(function(t,e){return function(t){return new DataView(r,64*e,64).getUint32(4*t,!0)}}),u=[1732584193,4023233417,2562383102,271733878,3285377520],c=0;c<s;++c){for(var l=u[0],f=u[1],p=u[2],d=u[3],g=u[4],y=l,_=f,v=p,b=d,w=g,m=0;m<80;++m){var S=t.add_modulo32(t.rol32(t.add_modulo32(l,t.f(m,f,p,d),h[c](n[m]),t.K(m)),a[m]),g);l=g,g=d,d=t.rol32(p,10),p=f,f=S,S=t.add_modulo32(t.rol32(t.add_modulo32(y,t.f(79-m,_,v,b),h[c](i[m]),t.KP(m)),o[m]),w),y=w,w=b,b=t.rol32(v,10),v=_,_=S}var k=t.add_modulo32(u[1],p,b);u[1]=t.add_modulo32(u[2],d,w),u[2]=t.add_modulo32(u[3],g,y),u[3]=t.add_modulo32(u[4],l,_),u[4]=t.add_modulo32(u[0],f,v),u[0]=k}var A=new ArrayBuffer(20),T=new DataView(A);return u.forEach(function(t,e){return T.setUint32(4*e,t,!0)}),A}}]),t}();t.exports={RIPEMD160:r}},911(t,e,r){"use strict";var n=r(426),i=r(766);function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),t.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},917(t,e,r){"use strict";var n=r(426),i=r(785),a=r(225),o=n.rotl32,s=n.sum32,h=n.sum32_5,u=a.ft_1,c=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,c),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],c=this.h[2],f=this.h[3],p=this.h[4];for(n=0;n<r.length;n++){var d=~~(n/20),g=h(o(i,5),u(d,a,c,f),p,r[n],l[d]);p=f,f=c,c=o(a,30),a=i,i=g}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],c),this.h[3]=s(this.h[3],f),this.h[4]=s(this.h[4],p)},f.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},948(t,e,r){"use strict";var n=r(426),i=r(349);function a(t,e,r){if(!(this instanceof a))return new a(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}t.exports=a,a.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},a.prototype.update=function(t,e){return this.inner.update(t,e),this},a.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},952(t,e,r){var n=e;n.utils=r(426),n.common=r(785),n.sha=r(229),n.ripemd=r(784),n.hmac=r(948),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160}},e={},function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n].call(a.exports,a,a.exports,r),a.exports}(156);var t,e});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { AbiProvider, AuthorityProvider, AuthorityProviderArgs, BinaryAbi, TransactResult } from 'eosjs/dist/eosjs-api-interfaces';
|
|
2
|
+
import { GetAbiResult, GetAccountResult, GetAccountsByAuthorizersResult, GetActivatedProtocolFeaturesParams, GetActivatedProtocolFeaturesResult, GetBlockInfoResult, GetBlockResult, GetCodeResult, GetCodeHashResult, GetCurrencyStatsResult, GetInfoResult, GetProducerScheduleResult, GetProducersResult, GetRawCodeAndAbiResult, GetRawAbiResult, GetScheduledTransactionsResult, GetTableRowsResult, PushTransactionArgs, ReadOnlyTransactResult, GetBlockHeaderStateResult, GetTableByScopeResult } from 'eosjs/dist/eosjs-rpc-interfaces';
|
|
3
|
+
import { Authorization } from 'eosjs/dist/eosjs-serialize';
|
|
4
|
+
export interface WaxRpcOptions {
|
|
5
|
+
autoConnect?: boolean;
|
|
6
|
+
autoReconnect?: boolean;
|
|
7
|
+
reconnectInterval?: number;
|
|
8
|
+
maxRetries?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class WebsocketJsonRpc implements AuthorityProvider, AbiProvider {
|
|
11
|
+
endpoint: string;
|
|
12
|
+
private ws;
|
|
13
|
+
private isConnected;
|
|
14
|
+
private isConnecting;
|
|
15
|
+
private pending;
|
|
16
|
+
private queue;
|
|
17
|
+
private options;
|
|
18
|
+
private retryCount;
|
|
19
|
+
private reqId;
|
|
20
|
+
private heartbeatTimer;
|
|
21
|
+
private readonly HEARTBEAT_INTERVAL;
|
|
22
|
+
constructor(endpoint: string, options?: WaxRpcOptions);
|
|
23
|
+
connect(): Promise<void>;
|
|
24
|
+
private attemptReconnect;
|
|
25
|
+
private startHeartbeat;
|
|
26
|
+
private stopHeartbeat;
|
|
27
|
+
private processQueue;
|
|
28
|
+
private sendToWs;
|
|
29
|
+
private handleMessage;
|
|
30
|
+
private call;
|
|
31
|
+
get_abi(accountName: string): Promise<GetAbiResult>;
|
|
32
|
+
get_account(accountName: string): Promise<GetAccountResult>;
|
|
33
|
+
get_accounts_by_authorizers(accounts: Authorization[], keys: string[]): Promise<GetAccountsByAuthorizersResult>;
|
|
34
|
+
get_activated_protocol_features({ limit, search_by_block_num, reverse, lower_bound, upper_bound, }: GetActivatedProtocolFeaturesParams): Promise<GetActivatedProtocolFeaturesResult>;
|
|
35
|
+
get_block_header_state(blockNumOrId: number | string): Promise<GetBlockHeaderStateResult>;
|
|
36
|
+
get_block_info(blockNum: number): Promise<GetBlockInfoResult>;
|
|
37
|
+
get_block(blockNumOrId: number | string): Promise<GetBlockResult>;
|
|
38
|
+
get_code(accountName: string): Promise<GetCodeResult>;
|
|
39
|
+
get_code_hash(accountName: string): Promise<GetCodeHashResult>;
|
|
40
|
+
get_currency_balance(code: string, account: string, symbol?: string | null): Promise<string[]>;
|
|
41
|
+
get_currency_stats(code: string, symbol: string): Promise<GetCurrencyStatsResult>;
|
|
42
|
+
get_info(): Promise<GetInfoResult>;
|
|
43
|
+
get_producer_schedule(): Promise<GetProducerScheduleResult>;
|
|
44
|
+
get_producers(json?: boolean, lowerBound?: string, limit?: number): Promise<GetProducersResult>;
|
|
45
|
+
get_raw_code_and_abi(accountName: string): Promise<GetRawCodeAndAbiResult>;
|
|
46
|
+
getRawAbi(accountName: string): Promise<BinaryAbi>;
|
|
47
|
+
get_raw_abi(accountName: string): Promise<GetRawAbiResult>;
|
|
48
|
+
get_scheduled_transactions(json?: boolean, lowerBound?: string, limit?: number): Promise<GetScheduledTransactionsResult>;
|
|
49
|
+
get_table_rows({ json, code, scope, table, lower_bound, upper_bound, index_position, key_type, limit, reverse, show_payer, }: any): Promise<GetTableRowsResult>;
|
|
50
|
+
get_table_by_scope({ code, table, lower_bound, upper_bound, limit, }: any): Promise<GetTableByScopeResult>;
|
|
51
|
+
getRequiredKeys(args: AuthorityProviderArgs): Promise<string[]>;
|
|
52
|
+
push_transaction({ signatures, compression, serializedTransaction, serializedContextFreeData }: PushTransactionArgs): Promise<TransactResult>;
|
|
53
|
+
push_ro_transaction({ signatures, compression, serializedTransaction }: PushTransactionArgs, returnFailureTraces?: boolean): Promise<ReadOnlyTransactResult>;
|
|
54
|
+
push_transactions(transactions: PushTransactionArgs[]): Promise<TransactResult[]>;
|
|
55
|
+
send_transaction({ signatures, compression, serializedTransaction, serializedContextFreeData }: PushTransactionArgs): Promise<TransactResult>;
|
|
56
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wax-ws-rpc-js",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "JavaScript client SDK for WAX WebSocket RPC.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "webpack",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/peeraphat-lakboon/wax-ws-rpc-js.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [],
|
|
19
|
+
"author": "meta",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/peeraphat-lakboon/wax-ws-rpc-js/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/peeraphat-lakboon/wax-ws-rpc-js#readme",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"ws": "^8.18.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/ws": "^8.18.1",
|
|
30
|
+
"eosjs": "^22.1.0",
|
|
31
|
+
"ts-loader": "^9.5.4",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"webpack": "^5.104.1",
|
|
34
|
+
"webpack-cli": "^6.0.1"
|
|
35
|
+
}
|
|
36
|
+
}
|