PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/casper-js-sdk/dist
Просмотр файла: lib.cjs.js
(()=>{"use strict";var e={3607:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1999),t),o(r(3915),t);var i=r(1417);Object.defineProperty(t,"base64to16",{enumerable:!0,get:function(){return i.base64to16}}),Object.defineProperty(t,"encodeBase16",{enumerable:!0,get:function(){return i.encodeBase16}}),Object.defineProperty(t,"decodeBase16",{enumerable:!0,get:function(){return i.decodeBase16}}),Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return i.encodeBase64}}),Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return i.decodeBase64}})},6138:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toBytesBytesArray=t.toBytesVectorNew=t.toBytesVector=t.toBytesArrayU8=t.fromBytesString=t.toBytesString=t.toBytesDeployHash=t.toBytesU512=t.toBytesU256=t.toBytesU128=t.toBytesI64=t.toBytesU64=t.toBytesU32=t.toBytesI32=t.toBytesU8=t.toBytesNumber=void 0;var n=r(1446),o=r(6148),i=r(4103),a=r(9486);t.toBytesNumber=function(e,t){return function(r){var a=n.BigNumber.from(r),s=o.MaxUint256.mask(e);if(t){var u=s.mask(e-1);if(a.gt(u)||a.lt(u.add(o.One).mul(o.NegativeOne)))throw new Error("value out-of-bounds, value: "+r)}else if(a.lt(o.Zero)||a.gt(s.mask(e)))throw new Error("value out-of-bounds, value: "+r);var c=a.toTwos(e).mask(e),p=i.arrayify(c);if(c.gte(0)){if(e>64)return c.eq(0)?p:i.concat([p,Uint8Array.from([p.length])]).slice().reverse();var y=e/8;return i.concat([p.slice().reverse(),new Uint8Array(y-p.length)])}return p.reverse()}},t.toBytesU8=t.toBytesNumber(8,!1),t.toBytesI32=t.toBytesNumber(32,!0),t.toBytesU32=t.toBytesNumber(32,!1),t.toBytesU64=t.toBytesNumber(64,!1),t.toBytesI64=t.toBytesNumber(64,!0),t.toBytesU128=t.toBytesNumber(128,!1),t.toBytesU256=t.toBytesNumber(256,!1),t.toBytesU512=t.toBytesNumber(512,!1),t.toBytesDeployHash=function(e){return e},t.toBytesString=function(e){var r=Uint8Array.from(Buffer.from(e));return i.concat([t.toBytesU32(r.byteLength),r])},t.fromBytesString=function(e){return Buffer.from(e).toString()},t.toBytesArrayU8=function(e){return i.concat([t.toBytesU32(e.length),e])},t.toBytesVector=function(e){var r=e.map((function(e){return e.toBytes()})).map((function(e){return e.unwrap()}));return r.splice(0,0,t.toBytesU32(e.length)),i.concat(r)},t.toBytesVectorNew=function(e){var r=e.map((function(e){return a.CLValueParsers.toBytes(e).unwrap()}));return r.splice(0,0,t.toBytesU32(e.length)),i.concat(r)},t.toBytesBytesArray=function(e){return e}},7066:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueBytesParsers=t.CLValueParsers=t.CLValue=t.ToBytes=t.CLType=t.resultHelper=void 0;var n=r(7107),o=r(4103),i=r(6138),a=r(7009),s=r(9591),u=r(9486),c=r(1417);t.resultHelper=function(e,t){return{result:e,remainder:t}};var p=function(){function e(){}return e.prototype.toBytes=function(){return Uint8Array.from([this.tag])},e}();t.CLType=p;t.ToBytes=function(){};t.CLValue=function(){};var y=function(){function e(){}return e.fromJSON=function(t){var r=s.matchTypeToCLType(t.cl_type),o=c.decodeBase16(t.bytes),i=e.fromBytes(o,r).unwrap();return n.Ok(i)},e.fromBytes=function(e,t){return s.matchByteParserByCLType(t).unwrap().fromBytes(e,t)},e.toJSON=function(t){var r=e.toBytes(t).unwrap(),o=c.encodeBase16(r),i=t.clType().toJSON();return n.Ok({bytes:o,cl_type:i})},e.toBytes=function(e){return s.matchByteParserByCLType(e.clType()).unwrap().toBytes(e)},e.toBytesWithType=function(e){var t=e.clType().toBytes(),r=s.matchByteParserByCLType(e.clType()).unwrap().toBytes(e).unwrap(),a=o.concat([i.toBytesArrayU8(r),t]);return n.Ok(a)},e.fromBytesWithType=function(e){var t=(new u.CLU32BytesParser).fromBytesWithRemainder(e),r=t.result,o=t.remainder,i=r.unwrap().value().toNumber();if(!o)return n.Err(a.CLErrorCodes.EarlyEndOfStream);var c=o.subarray(0,i),p=o.subarray(i),y=s.matchBytesToCLType(p).result,l=s.matchByteParserByCLType(y.unwrap()).unwrap().fromBytes(c,y.unwrap()).unwrap();return n.Ok(l)},e}();t.CLValueParsers=y;var l=function(){function e(){}return e.prototype.fromBytes=function(e,t){var r=this.fromBytesWithRemainder(e,t),o=r.result,i=r.remainder;return i&&i.length?n.Err(a.CLErrorCodes.LeftOverBytes):o},e}();t.CLValueBytesParsers=l},305:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLAccountHash=t.CLAccountHashBytesParser=t.CLAccountHashType=void 0;var i=r(7107),a=r(9486),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=c,t.tag=-1,t}return o(t,e),t.prototype.toString=function(){return"AccountHash (Not Supported as CLValue)"},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLAccountHashType=s;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return i.Ok(e.data)},t.prototype.fromBytesWithRemainder=function(e){if(e.length<a.ACCOUNT_HASH_LENGTH)return a.resultHelper(i.Err(a.CLErrorCodes.EarlyEndOfStream));var t=e.subarray(0,a.ACCOUNT_HASH_LENGTH),r=new c(t);return a.resultHelper(i.Ok(r))},t}(a.CLValueBytesParsers);t.CLAccountHashBytesParser=u;var c=function(e){function t(t){var r=e.call(this)||this;return r.data=t,r}return o(t,e),t.prototype.clType=function(){return new s},t.prototype.value=function(){return this.data},t}(a.CLValue);t.CLAccountHash=c},5110:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLBool=t.CLBoolBytesParser=t.CLBoolType=void 0;var i=r(7107),a=r(9486),s=r(7009),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=p,t.tag=s.CLTypeTag.Bool,t}return o(t,e),t.prototype.toString=function(){return s.BOOL_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLBoolType=u;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return i.Ok(new Uint8Array([e.value()?1:0]))},t.prototype.fromBytesWithRemainder=function(e){return 0===e.length?a.resultHelper(i.Err(a.CLErrorCodes.EarlyEndOfStream)):1===e[0]?a.resultHelper(i.Ok(new p(!0)),e.subarray(1)):0===e[0]?a.resultHelper(i.Ok(new p(!1)),e.subarray(1)):a.resultHelper(i.Err(a.CLErrorCodes.Formatting))},t}(a.CLValueBytesParsers);t.CLBoolBytesParser=c;var p=function(e){function t(t){var r=e.call(this)||this;return r.data=t,r}return o(t,e),t.prototype.clType=function(){return new u},t.prototype.value=function(){return this.data},t.fromBytesWithRemainder=function(e){return 0===e.length?a.resultHelper(i.Err(a.CLErrorCodes.EarlyEndOfStream)):1===e[0]?a.resultHelper(i.Ok(new t(!0)),e.subarray(1)):0===e[0]?a.resultHelper(i.Ok(new t(!1)),e.subarray(1)):a.resultHelper(i.Err(a.CLErrorCodes.Formatting))},t}(a.CLValue);t.CLBool=p},4259:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CLValueBuilder=t.CLTypeBuilder=void 0;var n=r(9486),o=function(){function e(){}return e.list=function(e){return new n.CLListType(e)},e.tuple1=function(e){var t=e[0];return new n.CLTuple1Type([t])},e.tuple2=function(e){var t=e[0],r=e[1];return new n.CLTuple2Type([t,r])},e.tuple3=function(e){var t=e[0],r=e[1],o=e[2];return new n.CLTuple3Type([t,r,o])},e.option=function(e){return new n.CLOptionType(e)},e.map=function(e){return new n.CLMapType(e)},e.publicKey=function(){return new n.CLPublicKeyType},e.byteArray=function(e){return new n.CLByteArrayType(e)},e.bool=function(){return new n.CLBoolType},e.u8=function(){return new n.CLU8Type},e.u32=function(){return new n.CLU32Type},e.i32=function(){return new n.CLI32Type},e.u64=function(){return new n.CLU64Type},e.i64=function(){return new n.CLI64Type},e.u128=function(){return new n.CLU128Type},e.u256=function(){return new n.CLU256Type},e.u512=function(){return new n.CLU512Type},e.unit=function(){return new n.CLUnitType},e.string=function(){return new n.CLStringType},e.key=function(){return new n.CLKeyType},e.uref=function(){return new n.CLURefType},e}();t.CLTypeBuilder=o;var i=function(){function e(){}return e.list=function(e){return new n.CLList(e)},e.tuple1=function(e){var t=e[0];return new n.CLTuple1([t])},e.tuple2=function(e){var t=e[0],r=e[1];return new n.CLTuple2([t,r])},e.tuple3=function(e){var t=e[0],r=e[1],o=e[2];return new n.CLTuple3([t,r,o])},e.option=function(e,t){return new n.CLOption(e,t)},e.map=function(e){return new n.CLMap(e)},e.publicKey=function(e,t){return new n.CLPublicKey(e,t)},e.byteArray=function(e){return new n.CLByteArray(e)},e.bool=function(e){return new n.CLBool(e)},e.u8=function(e){return new n.CLU8(e)},e.u32=function(e){return new n.CLU32(e)},e.i32=function(e){return new n.CLI32(e)},e.u64=function(e){return new n.CLU64(e)},e.i64=function(e){return new n.CLI64(e)},e.u128=function(e){return new n.CLU128(e)},e.u256=function(e){return new n.CLU256(e)},e.u512=function(e){return new n.CLU512(e)},e.unit=function(){return new n.CLUnit},e.string=function(e){return new n.CLString(e)},e.key=function(e){return new n.CLKey(e)},e.uref=function(e,t){return new n.CLURef(e,t)},e}();t.CLValueBuilder=i},401:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLByteArray=t.CLByteArrayBytesParser=t.CLByteArrayType=t.CL_BYTE_ARRAY_MAX_LENGTH=void 0;var i=r(7107),a=r(4103),s=r(9486),u=r(7009),c=r(6138);t.CL_BYTE_ARRAY_MAX_LENGTH=32;var p=function(e){function t(t){var r=e.call(this)||this;return r.linksTo=l,r.tag=u.CLTypeTag.ByteArray,r.size=t,r}return o(t,e),t.prototype.toString=function(){return u.BYTE_ARRAY_ID},t.prototype.toBytes=function(){return a.concat([Uint8Array.from([this.tag]),c.toBytesU32(this.size)])},t.prototype.toJSON=function(){var e;return(e={})[u.BYTE_ARRAY_ID]=this.size,e},t}(s.CLType);t.CLByteArrayType=p;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return i.Ok(e.data)},t.prototype.fromBytesWithRemainder=function(e,t){var r=new l(e.subarray(0,t.size));return s.resultHelper(i.Ok(r),e.subarray(t.size))},t}(s.CLValueBytesParsers);t.CLByteArrayBytesParser=y;var l=function(e){function t(t){var r=e.call(this)||this;return r.data=t,r}return o(t,e),t.prototype.clType=function(){return new p(this.data.length)},t.prototype.value=function(){return this.data},t}(s.CLValue);t.CLByteArray=l},4381:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLKey=t.CLKeyBytesParser=t.CLKeyType=void 0;var i=r(4103),a=r(7107),s=r(9486),u=r(7009),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=y,t.tag=u.CLTypeTag.Key,t}return o(t,e),t.prototype.toString=function(){return u.KEY_ID},t.prototype.toJSON=function(){return this.toString()},t}(s.CLType);t.CLKeyType=c;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){if(e.isAccount())return a.Ok(i.concat([Uint8Array.from([s.KeyVariant.Account]),(new s.CLAccountHashBytesParser).toBytes(e.data).unwrap()]));if(e.isHash())return a.Ok(i.concat([Uint8Array.from([s.KeyVariant.Hash]),(new s.CLByteArrayBytesParser).toBytes(e.data).unwrap()]));if(e.isURef())return a.Ok(i.concat([Uint8Array.from([s.KeyVariant.URef]),s.CLValueParsers.toBytes(e.data).unwrap()]));throw new Error("Unknown byte types")},t.prototype.fromBytesWithRemainder=function(e){if(e.length<1)return s.resultHelper(a.Err(s.CLErrorCodes.EarlyEndOfStream));var t=e[0];if(t===s.KeyVariant.Hash){var r=e.subarray(1),n=(new s.CLByteArrayBytesParser).fromBytesWithRemainder(r,new s.CLByteArrayType(32)),o=n.result,i=n.remainder,u=o.unwrap(),c=new y(u);return s.resultHelper(a.Ok(c),i)}if(t===s.KeyVariant.URef){var p=(new s.CLURefBytesParser).fromBytesWithRemainder(e.subarray(1)),l=p.result,f=p.remainder;return l.ok?(c=new y(l.val),s.resultHelper(a.Ok(c),f)):s.resultHelper(a.Err(l.val))}if(t===s.KeyVariant.Account){var d=(new s.CLAccountHashBytesParser).fromBytesWithRemainder(e.subarray(1)),h=d.result,g=d.remainder;return h.ok?(c=new y(h.val),s.resultHelper(a.Ok(c),g)):s.resultHelper(a.Err(h.val))}return s.resultHelper(a.Err(s.CLErrorCodes.Formatting))},t}(s.CLValueBytesParsers);t.CLKeyBytesParser=p;var y=function(e){function t(t){var r=e.call(this)||this;return r.data=t,r}return o(t,e),t.prototype.clType=function(){return new c},t.prototype.value=function(){return this.data},t.prototype.isHash=function(){return this.data instanceof s.CLByteArray},t.prototype.isURef=function(){return this.data instanceof s.CLURef},t.prototype.isAccount=function(){return this.data instanceof s.CLAccountHash},t}(s.CLValue);t.CLKey=y},9403:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLList=t.CLListBytesParser=t.CLListType=void 0;var i=r(7107),a=r(4103),s=r(9486),u=r(6138),c=r(7009),p=function(e){function t(t){var r=e.call(this)||this;return r.linksTo=l,r.tag=c.CLTypeTag.List,r.inner=t,r}return o(t,e),t.prototype.toString=function(){return c.LIST_ID+" ("+this.inner.toString()+")"},t.prototype.toBytes=function(){return a.concat([Uint8Array.from([this.tag]),this.inner.toBytes()])},t.prototype.toJSON=function(){var e,t=this.inner.toJSON();return(e={})[c.LIST_ID]=t,e},t}(s.CLType);t.CLListType=p;var y=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return i.Ok(u.toBytesVectorNew(e.data))},t.prototype.fromBytesWithRemainder=function(e,t){var r=(new s.CLU32BytesParser).fromBytesWithRemainder(e),n=r.result,o=r.remainder;if(!n.ok)return s.resultHelper(i.Err(n.val));for(var a=n.val.value().toNumber(),u=[],c=o,p=s.matchByteParserByCLType(t.inner).unwrap(),y=0;y<a;y++){if(!c)return s.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var f=p.fromBytesWithRemainder(c,t.inner),d=f.result,h=f.remainder;if(!d.ok)return s.resultHelper(i.Err(d.val));u.push(d.val),c=h}return 0===u.length?s.resultHelper(i.Ok(new l(t.inner)),c):s.resultHelper(i.Ok(new l(u)),c)},t}(s.CLValueBytesParsers);t.CLListBytesParser=y;var l=function(e){function t(t){var r=e.call(this)||this;if(Array.isArray(t)&&t[0].clType){var n=t[0].clType();if(!t.every((function(e){return e.clType().toString()===n.toString()})))throw Error("Invalid data provided.");r.data=t,r.vectorType=n}else{if(!(t instanceof s.CLType))throw Error("Invalid data type(s) provided.");r.vectorType=t,r.data=[]}return r}return o(t,e),t.prototype.value=function(){return this.data},t.prototype.clType=function(){return new p(this.vectorType)},t.prototype.get=function(e){if(e>=this.data.length)throw new Error("List index out of bounds.");return this.data[e]},t.prototype.set=function(e,t){if(e>=this.data.length)throw new Error("List index out of bounds.");this.data[e]=t},t.prototype.push=function(e){if(e.clType().toString()!==this.vectorType.toString())throw Error("Incosnsistent data type, use "+this.vectorType.toString()+".");this.data.push(e)},t.prototype.remove=function(e){this.data.splice(e,1)},t.prototype.pop=function(){return this.data.pop()},t.prototype.size=function(){return this.data.length},t}(s.CLValue);t.CLList=l},547:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n};Object.defineProperty(t,"__esModule",{value:!0}),t.CLMap=t.CLMapBytesParser=t.CLMapType=void 0;var a=r(4103),s=r(7107),u=r(9486),c=r(7009),p=r(6138),y=function(e){function t(t){var r=t[0],n=t[1],o=e.call(this)||this;return o.tag=c.CLTypeTag.Map,o.linksTo=f,o.innerKey=r,o.innerValue=n,o}return o(t,e),t.prototype.toString=function(){return c.MAP_ID+" ("+this.innerKey.toString()+": "+this.innerValue.toString()+")"},t.prototype.toBytes=function(){return a.concat([Uint8Array.from([this.tag]),this.innerKey.toBytes(),this.innerValue.toBytes()])},t.prototype.toJSON=function(){var e;return(e={})[c.MAP_ID]={key:this.innerKey.toJSON(),value:this.innerValue.toJSON()},e},t}(u.CLType);t.CLMapType=y;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){var t=Array.from(e.data).map((function(e){var t=e[0],r=e[1],n=u.CLValueParsers.toBytes(t).unwrap(),o=u.CLValueParsers.toBytes(r).unwrap();return a.concat([n,o])}));return s.Ok(a.concat(i([p.toBytesU32(e.data.length)],t)))},t.prototype.fromBytesWithRemainder=function(e,t){var r=(new u.CLU32BytesParser).fromBytesWithRemainder(e),n=r.result,o=r.remainder,i=n.unwrap().value().toNumber(),a=[],c=o;if(0===i)return u.resultHelper(s.Ok(new f([t.innerKey,t.innerValue])),c);for(var p=0;p<i;p++){if(!c)return u.resultHelper(s.Err(u.CLErrorCodes.EarlyEndOfStream));var y=u.matchByteParserByCLType(t.innerKey).unwrap().fromBytesWithRemainder(c,t.innerKey),l=y.result,d=y.remainder,h=l.unwrap();if(!(c=d))return u.resultHelper(s.Err(u.CLErrorCodes.EarlyEndOfStream));var g=u.matchByteParserByCLType(t.innerValue).unwrap().fromBytesWithRemainder(c,t.innerValue),m=g.result,v=g.remainder,b=m.unwrap();c=v,a.push([h,b])}return u.resultHelper(s.Ok(new f(a)),c)},t}(u.CLValueBytesParsers);t.CLMapBytesParser=l;var f=function(e){function t(t){var r=e.call(this)||this;if(function(e){return Array.isArray(e)&&Array.isArray(e[0])&&2===e[0].length&&!!e[0][0].clType&&!!e[0][1].clType}(t)){if(r.refType=[t[0][0].clType(),t[0][1].clType()],!t.every((function(e){var t=e[0],n=e[1];return t.clType().toString()===r.refType[0].toString()&&n.clType().toString()===r.refType[1].toString()})))throw Error("Invalid data provided.");r.data=t}else{if(!(t[0]instanceof u.CLType&&t[1]instanceof u.CLType))throw Error("Invalid data type(s) provided.");r.refType=t,r.data=[]}return r}return o(t,e),t.prototype.clType=function(){return new y(this.refType)},t.prototype.value=function(){return this.data},t.prototype.get=function(e){var t=this.data.find((function(t){return t[0].value()===e.value()}));return t?t[1]:void 0},t.prototype.set=function(e,t){this.get(e)?this.data=this.data.map((function(r){return r[0].value()===e.value()?[r[0],t]:r})):this.data=i(this.data,[[e,t]])},t.prototype.delete=function(e){this.data=this.data.filter((function(t){return t[0].value()!==e.value()}))},t.prototype.size=function(){return this.data.length},t}(u.CLValue);t.CLMap=f},9439:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLU512=t.CLU512BytesParser=t.CLU512Type=t.CLU256=t.CLU256BytesParser=t.CLU256Type=t.CLU128=t.CLU128BytesParser=t.CLU128Type=t.CLU64=t.CLU64BytesParser=t.CLU64Type=t.CLU32=t.CLU32BytesParser=t.CLU32Type=t.CLU8=t.CLU8BytesParser=t.CLU8Type=t.CLI64=t.CLI64BytesParser=t.CLI64Type=t.CLI32=t.CLI32BytesParser=t.CLI32Type=void 0;var i=r(7107),a=r(7066),s=r(7009),u=r(1446),c=r(6138),p=r(7009),y=r(4922),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return(128===e.bitSize||256===e.bitSize||512===e.bitSize)&&e.originalBytes&&y.arrayEquals(e.originalBytes,Uint8Array.from([1,0]))?i.Ok(e.originalBytes):i.Ok(c.toBytesNumber(e.bitSize,e.signed)(e.data))},t}(a.CLValueBytesParsers),f=function(e){function t(t,r,n,o){var i=e.call(this)||this;if(!1===r&&Math.sign(n)<0)throw new Error("Can't provide negative numbers with isSigned=false");return o&&(i.originalBytes=o),i.bitSize=t,i.signed=r,i.data=u.BigNumber.from(n),i}return o(t,e),t.prototype.value=function(){return this.data},t}(a.CLValue),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=g,t.tag=p.CLTypeTag.I32,t}return o(t,e),t.prototype.toString=function(){return p.I32_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLI32Type=d;var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){if(e.length<4)return a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var t=Uint8Array.from(e.subarray(0,4)),r=u.BigNumber.from(t.slice().reverse()).fromTwos(32),n=e.subarray(4);return a.resultHelper(i.Ok(new g(r)),n)},t}(l);t.CLI32BytesParser=h;var g=function(e){function t(t){return e.call(this,32,!0,t)||this}return o(t,e),t.prototype.clType=function(){return new d},t}(f);t.CLI32=g;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=b,t.tag=p.CLTypeTag.I64,t}return o(t,e),t.prototype.toString=function(){return p.I64_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLI64Type=m;var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){if(e.length<8)return a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var t=Uint8Array.from(e.subarray(0,8)),r=u.BigNumber.from(t.slice().reverse()).fromTwos(64),n=e.subarray(8);return a.resultHelper(i.Ok(new b(r)),n)},t}(l);t.CLI64BytesParser=v;var b=function(e){function t(t){return e.call(this,64,!0,t)||this}return o(t,e),t.prototype.clType=function(){return new m},t}(f);t.CLI64=b;var C=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=B,t.tag=p.CLTypeTag.U8,t}return o(t,e),t.prototype.toString=function(){return p.U8_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLU8Type=C;var T=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){return 0===e.length?a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream)):a.resultHelper(i.Ok(new B(e[0])),e.subarray(1))},t}(l);t.CLU8BytesParser=T;var B=function(e){function t(t){return e.call(this,8,!1,t)||this}return o(t,e),t.prototype.clType=function(){return new C},t}(f);t.CLU8=B;var w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=L,t.tag=p.CLTypeTag.U32,t}return o(t,e),t.prototype.toString=function(){return p.U32_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLU32Type=w;var _=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){if(e.length<4)return a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var t=Uint8Array.from(e.subarray(0,4)),r=u.BigNumber.from(t.slice().reverse());return a.resultHelper(i.Ok(new L(r)),e.subarray(4))},t}(l);t.CLU32BytesParser=_;var L=function(e){function t(t){return e.call(this,32,!1,t)||this}return o(t,e),t.prototype.clType=function(){return new w},t}(f);t.CLU32=L;var S=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=O,t.tag=p.CLTypeTag.U64,t}return o(t,e),t.prototype.toString=function(){return p.U64_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLU64Type=S;var P=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){if(e.length<8)return a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var t=Uint8Array.from(e.subarray(0,8)),r=u.BigNumber.from(t.slice().reverse());return a.resultHelper(i.Ok(new O(r)),e.subarray(8))},t}(l);t.CLU64BytesParser=P;var O=function(e){function t(t){return e.call(this,64,!1,t)||this}return o(t,e),t.prototype.clType=function(){return new S},t}(f);t.CLU64=O;var E=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=U,t.tag=p.CLTypeTag.U128,t}return o(t,e),t.prototype.toString=function(){return p.U128_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLU128Type=E;var A=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){return K(e,128)},t}(l);t.CLU128BytesParser=A;var U=function(e){function t(t,r){return e.call(this,128,!1,t,r)||this}return o(t,e),t.prototype.clType=function(){return new E},t}(f);t.CLU128=U;var j=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=H,t.tag=p.CLTypeTag.U256,t}return o(t,e),t.prototype.toString=function(){return p.U256_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLU256Type=j;var k=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){return K(e,256)},t}(l);t.CLU256BytesParser=k;var H=function(e){function t(t,r){return e.call(this,256,!1,t,r)||this}return o(t,e),t.prototype.clType=function(){return new j},t}(f);t.CLU256=H;var I=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=D,t.tag=p.CLTypeTag.U512,t}return o(t,e),t.prototype.toString=function(){return p.U512_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLU512Type=I;var M=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.fromBytesWithRemainder=function(e){return K(e,512)},t}(l);t.CLU512BytesParser=M;var D=function(e){function t(t,r){return e.call(this,512,!1,t,r)||this}return o(t,e),t.prototype.clType=function(){return new I},t}(f);t.CLU512=D;var K=function(e,t){if(e.length<1)return a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var r=t/8,n=e[0];if(n>r)return a.resultHelper(i.Err(s.CLErrorCodes.Formatting));if(n+1>e.length)return a.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var o=0===n?[0]:e.subarray(1,1+n),c=e.subarray(1+n),p=u.BigNumber.from(o.slice().reverse());return 128===t?a.resultHelper(i.Ok(new U(p,e)),c):256===t?a.resultHelper(i.Ok(new H(p,e)),c):512===t?a.resultHelper(i.Ok(new D(p,e)),c):a.resultHelper(i.Err(s.CLErrorCodes.Formatting))}},2285:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLOption=t.CLOptionBytesParser=t.CLOptionType=void 0;var i=r(7107),a=r(4103),s=r(9486),u=r(7009),c=function(e){function t(t){var r=e.call(this)||this;return r.tag=u.CLTypeTag.Option,r.linksTo=y,r.inner=t,r}return o(t,e),t.prototype.toString=function(){return null===this.inner?u.OPTION_ID+" (None)":u.OPTION_ID+" ("+this.inner.toString()+")"},t.prototype.toBytes=function(){return a.concat([Uint8Array.from([this.tag]),this.inner.toBytes()])},t.prototype.toJSON=function(){var e;return(e={})[u.OPTION_ID]=this.inner.toJSON(),e},t}(s.CLType);t.CLOptionType=c;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return e.data.none?i.Ok(Uint8Array.from([0])):e.data.some?i.Ok(a.concat([Uint8Array.from([1]),s.CLValueParsers.toBytes(e.data.unwrap()).unwrap()])):i.Err(s.CLErrorCodes.UnknownValue)},t.prototype.fromBytesWithRemainder=function(e,t){var r=(new s.CLU8BytesParser).fromBytesWithRemainder(e),n=r.result,o=r.remainder,a=n.unwrap().value().toNumber();if(0===a)return s.resultHelper(i.Ok(new y(i.None,t.inner)),o);if(1===a){if(!o)return s.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var u=s.matchByteParserByCLType(t.inner).unwrap().fromBytesWithRemainder(o,t.inner),c=u.result,p=u.remainder,l=c.unwrap();return s.resultHelper(i.Ok(new y(i.Some(l))),p)}return s.resultHelper(i.Err(s.CLErrorCodes.Formatting))},t}(s.CLValueBytesParsers);t.CLOptionBytesParser=p;var y=function(e){function t(t,r){var n=e.call(this)||this;if(n.data=t,t.none){if(!r)throw new Error("You had to assign innerType for None");n.innerType=r}else n.innerType=t.val.clType();return e.call(this)||this}return o(t,e),t.prototype.isNone=function(){return this.data.none},t.prototype.isSome=function(){return this.data.some},t.prototype.value=function(){return this.data},t.prototype.clType=function(){return new c(this.innerType)},t}(s.CLValue);t.CLOption=y},1533:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLPublicKey=t.CLPublicKeyBytesParser=t.CLPublicKeyType=t.CLPublicKeyTag=void 0;var i,a=r(4103),s=r(7107),u=r(9486),c=r(7009),p=r(1417),y=r(3492),l=r(2964);!function(e){e[e.ED25519=1]="ED25519",e[e.SECP256K1=2]="SECP256K1"}(i=t.CLPublicKeyTag||(t.CLPublicKeyTag={}));var f=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=h,t.tag=c.CLTypeTag.PublicKey,t}return o(t,e),t.prototype.toString=function(){return c.PUBLIC_KEY_ID},t.prototype.toJSON=function(){return this.toString()},t}(u.CLType);t.CLPublicKeyType=f;var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return s.Ok(a.concat([Uint8Array.from([e.tag]),e.data]))},t.prototype.fromBytesWithRemainder=function(e){if(e.length<1)return u.resultHelper(s.Err(u.CLErrorCodes.EarlyEndOfStream));var t,r=e[0];if(r===i.ED25519)t=32;else{if(r!==i.SECP256K1)return u.resultHelper(s.Err(u.CLErrorCodes.Formatting));t=33}var n=e.subarray(1,t+1),o=new h(n,r);return u.resultHelper(s.Ok(o),e.subarray(t+1))},t}(u.CLValueBytesParsers);t.CLPublicKeyBytesParser=d;var h=function(e){function t(t,r){var n=e.call(this)||this;if(r===i.ED25519||r===l.SignatureAlgorithm.Ed25519){if(32!==t.length)throw new Error("Wrong length of ED25519 key. Expected 32, but got "+t.length+".");return n.data=t,n.tag=i.ED25519,n}if(r===i.SECP256K1||r===l.SignatureAlgorithm.Secp256K1){if(33!==t.length)throw new Error("Wrong length of SECP256K1 key. Expected 33, but got "+t.length+".");return n.data=t,n.tag=i.SECP256K1,n}throw new Error("Unsupported type of public key")}return o(t,e),t.prototype.clType=function(){return new f},t.prototype.isEd25519=function(){return this.tag===i.ED25519},t.prototype.isSecp256K1=function(){return this.tag===i.SECP256K1},t.prototype.toHex=function(){return"0"+this.tag+p.encodeBase16(this.data)},t.prototype.toAccountHash=function(){var e=i[this.tag],t=Uint8Array.from([0]),r=Buffer.concat([Buffer.from(e.toLowerCase()),t]);return 0===this.data.length?Uint8Array.from([]):y.byteHash(a.concat([r,this.data]))},t.prototype.toAccountHashStr=function(){var e=this.toAccountHash();return"account-hash-"+Buffer.from(e).toString("hex")},t.prototype.value=function(){return this.data},t.fromEd25519=function(e){return new t(e,i.ED25519)},t.fromSecp256K1=function(e){return new t(e,i.SECP256K1)},t.fromHex=function(e){if(e.length<2)throw new Error("Asymmetric key error: too short");if(!/^0(1[0-9a-fA-F]{64}|2[0-9a-fA-F]{66})$/.test(e))throw new Error("Invalid public key");var r=p.decodeBase16(e);return new t(r.subarray(1),r[0])},t}(u.CLValue);t.CLPublicKey=h},5159:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLResult=t.CLResultBytesParser=t.CLResultType=void 0;var i=r(7107),a=r(4103),s=r(9486),u=r(7009),c=function(e){function t(t){var r=t.ok,n=t.err,o=e.call(this)||this;return o.linksTo=y,o.tag=u.CLTypeTag.Result,o.innerOk=r,o.innerErr=n,o}return o(t,e),t.prototype.toString=function(){return u.RESULT_ID+" (OK: "+this.innerOk.toString()+", ERR: "+this.innerOk.toString()+")"},t.prototype.toBytes=function(){return a.concat([Uint8Array.from([this.tag]),this.innerOk.toBytes(),this.innerErr.toBytes()])},t.prototype.toJSON=function(){var e;return(e={})[u.RESULT_ID]={ok:this.innerOk.toJSON(),err:this.innerErr.toJSON()},e},t}(s.CLType);t.CLResultType=c;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){if(e.data instanceof i.Ok&&e.data.val instanceof s.CLValue)return i.Ok(a.concat([Uint8Array.from([1]),s.CLValueParsers.toBytes(e.data.val).unwrap()]));if(e.data instanceof i.Err)return i.Ok(a.concat([Uint8Array.from([0]),s.CLValueParsers.toBytes(e.data.val).unwrap()]));throw new Error("Unproper data stored in CLResult")},t.prototype.fromBytesWithRemainder=function(e,t){var r=(new s.CLU8BytesParser).fromBytesWithRemainder(e),n=r.result,o=r.remainder;if(!o)return s.resultHelper(i.Err(s.CLErrorCodes.EarlyEndOfStream));var a=n.unwrap().value().toNumber(),u=t.innerErr,c=t.innerOk;if(0===a){var p=s.matchByteParserByCLType(u).unwrap().fromBytesWithRemainder(o,t.innerErr),l=p.result,f=p.remainder,d=new y(i.Err(l.unwrap()),{ok:c,err:u});return s.resultHelper(i.Ok(d),f)}if(1===a){var h=s.matchByteParserByCLType(c).unwrap().fromBytesWithRemainder(o,t.innerOk);return l=h.result,f=h.remainder,d=new y(i.Ok(l.unwrap()),{ok:c,err:u}),s.resultHelper(i.Ok(d),f)}return s.resultHelper(i.Err(s.CLErrorCodes.Formatting))},t}(s.CLValueBytesParsers);t.CLResultBytesParser=p;var y=function(e){function t(t,r){var n=r.ok,o=r.err,i=e.call(this)||this;return i.data=t,i.innerOk=n,i.innerErr=o,i}return o(t,e),t.prototype.value=function(){return this.data},t.prototype.isError=function(){return this.data instanceof i.Err},t.prototype.isOk=function(){return this.data.ok},t.prototype.clType=function(){return new c({ok:this.innerOk,err:this.innerErr})},t}(s.CLValue);t.CLResult=y},8641:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLString=t.CLStringBytesParser=t.CLStringType=void 0;var i=r(7107),a=r(9486),s=r(7009),u=r(6138),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=y,t.tag=s.CLTypeTag.String,t}return o(t,e),t.prototype.toString=function(){return s.STRING_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLStringType=c;var p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return i.Ok(u.toBytesString(e.data))},t.prototype.fromBytesWithRemainder=function(e){var t=(new a.CLU32BytesParser).fromBytesWithRemainder(e),r=t.result,n=t.remainder,o=r.unwrap().value().toNumber();if(n){var s=u.fromBytesString(n.subarray(0,o));return a.resultHelper(i.Ok(new y(s)),n.subarray(o))}return a.resultHelper(i.Err(a.CLErrorCodes.EarlyEndOfStream))},t}(a.CLValueBytesParsers);t.CLStringBytesParser=p;var y=function(e){function t(t){var r=e.call(this)||this;if("string"!=typeof t)throw new Error("Wrong data type, you should provide string, but you provided "+typeof t);return r.data=t,r}return o(t,e),t.prototype.clType=function(){return new c},t.prototype.value=function(){return this.data},t.prototype.size=function(){return this.data.length},t}(a.CLValue);t.CLString=y},932:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n};Object.defineProperty(t,"__esModule",{value:!0}),t.CLTuple3=t.CLTuple3Type=t.CLTuple2=t.CLTuple2Type=t.CLTuple1=t.CLTuple1Type=t.CLTupleBytesParser=t.CLTupleType=void 0;var a=r(7107),s=r(4103),u=r(9486),c=r(9591),p=r(7009),y=function(e){function t(t,r,n){var o=e.call(this)||this;return o.inner=t,o.linksTo=r,o.tag=n,o}return o(t,e),t.prototype.toString=function(){var e=this.inner.map((function(e){return e.toString()})).join(", ");return"Tuple"+this.inner.length+" ("+e+")"},t.prototype.toJSON=function(){var e;return(e={})[c.TUPLE_MATCH_LEN_TO_ID[this.inner.length-1]]=this.inner.map((function(e){return e.toJSON()})),e},t.prototype.toBytes=function(){var e=this.inner.map((function(e){return e.toBytes()}));return s.concat(i([Uint8Array.from([this.tag])],e))},t}(u.CLType);t.CLTupleType=y;var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return a.Ok(s.concat(e.data.map((function(e){return u.CLValueParsers.toBytes(e).unwrap()}))))},t.prototype.fromBytesWithRemainder=function(e,t){var r=e,n=t.inner.map((function(e){var t=u.matchByteParserByCLType(e).unwrap().fromBytesWithRemainder(r),n=t.result,o=t.remainder;return r=o,n.unwrap()}));return 1===n.length?u.resultHelper(a.Ok(new h(n)),r):2===n.length?u.resultHelper(a.Ok(new m(n)),r):3===n.length?u.resultHelper(a.Ok(new b(n)),r):u.resultHelper(a.Err(u.CLErrorCodes.Formatting))},t}(u.CLValueBytesParsers);t.CLTupleBytesParser=l;var f=function(e){function t(t,r){var n=e.call(this)||this;if(r.length>t)throw new Error("Too many elements!");if(!r.every((function(e){return e instanceof u.CLValue})))throw Error("Invalid data type(s) provided.");return n.tupleSize=t,n.data=r,n}return o(t,e),t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,t){if(e>=this.tupleSize)throw new Error("Tuple index out of bounds.");this.data[e]=t},t.prototype.push=function(e){if(!(this.data.length<this.tupleSize))throw new Error("No more space in this tuple!");this.data.push(e)},t.prototype.value=function(){return this.data},t}(u.CLValue),d=function(e){function t(t){return e.call(this,t,h,p.CLTypeTag.Tuple1)||this}return o(t,e),t}(y);t.CLTuple1Type=d;var h=function(e){function t(t){return e.call(this,1,t)||this}return o(t,e),t.prototype.clType=function(){return new d(this.data.map((function(e){return e.clType()})))},t}(f);t.CLTuple1=h;var g=function(e){function t(t){return e.call(this,t,m,p.CLTypeTag.Tuple2)||this}return o(t,e),t}(y);t.CLTuple2Type=g;var m=function(e){function t(t){return e.call(this,2,t)||this}return o(t,e),t.prototype.clType=function(){return new g(this.data.map((function(e){return e.clType()})))},t}(f);t.CLTuple2=m;var v=function(e){function t(t){return e.call(this,t,b,p.CLTypeTag.Tuple3)||this}return o(t,e),t}(y);t.CLTuple3Type=v;var b=function(e){function t(t){return e.call(this,3,t)||this}return o(t,e),t.prototype.clType=function(){return new v(this.data.map((function(e){return e.clType()})))},t}(f);t.CLTuple3=b},3300:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLURef=t.CLURefBytesParser=t.CLURefType=t.AccessRights=void 0;var i,a=r(4103),s=r(7107),u=r(9486),c=r(7009),p=r(1417);!function(e){e[e.None=0]="None",e[e.READ=1]="READ",e[e.WRITE=2]="WRITE",e[e.ADD=4]="ADD",e[e.READ_WRITE=3]="READ_WRITE",e[e.READ_ADD=5]="READ_ADD",e[e.ADD_WRITE=6]="ADD_WRITE",e[e.READ_ADD_WRITE=7]="READ_ADD_WRITE"}(i=t.AccessRights||(t.AccessRights={}));var y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.linksTo=d,t.tag=c.CLTypeTag.URef,t}return o(t,e),t.prototype.toString=function(){return c.UREF_ID},t.prototype.toJSON=function(){return this.toString()},t}(u.CLType);t.CLURefType=y;var l="uref",f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(e){return s.Ok(a.concat([e.data,Uint8Array.from([e.accessRights])]))},t.prototype.fromBytesWithRemainder=function(e){if(e.length<33)return u.resultHelper(s.Err(u.CLErrorCodes.EarlyEndOfStream));var t=e.subarray(0,32),r=e[32],n=new d(t,r);return u.resultHelper(s.Ok(n),e.subarray(33))},t}(u.CLValueBytesParsers);t.CLURefBytesParser=f;var d=function(e){function t(t,r){var n=e.call(this)||this;if(32!==t.byteLength)throw new Error("The length of URefAddr should be 32");if(!Object.values(i).includes(r))throw new Error("Unsuported AccessRights");return n.data=t,n.accessRights=r,n}return o(t,e),t.fromFormattedStr=function(e){if(!e.startsWith(l+"-"))throw new Error("Prefix is not 'uref-'");var r=e.substring((l+"-").length).split("-",2);if(2!==r.length)throw new Error("No access rights as suffix");return new t(p.decodeBase16(r[0]),parseInt(r[1],8))},t.prototype.toFormattedStr=function(){return[l,p.encodeBase16(this.data),u.padNum(this.accessRights.toString(8),3)].join("-")},t.prototype.clType=function(){return new y},t.prototype.value=function(){return{data:this.data,accessRights:this.accessRights}},t}(u.CLValue);t.CLURef=d},8830:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.CLUnit=t.CLUnitBytesParser=t.CLUnitType=void 0;var i=r(7107),a=r(9486),s=r(7009),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tag=s.CLTypeTag.Unit,t.linksTo=p,t}return o(t,e),t.prototype.toString=function(){return s.UNIT_ID},t.prototype.toJSON=function(){return this.toString()},t}(a.CLType);t.CLUnitType=u;var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.toBytes=function(){return i.Ok(Uint8Array.from([]))},t.prototype.fromBytesWithRemainder=function(e){return a.resultHelper(i.Ok(new p),e)},t}(a.CLValueBytesParsers);t.CLUnitBytesParser=c;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.data=void 0,t}return o(t,e),t.prototype.clType=function(){return new u},t.prototype.value=function(){return this.data},t}(a.CLValue);t.CLUnit=p},7009:(e,t)=>{var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.TUPLE3_ID=t.TUPLE2_ID=t.TUPLE1_ID=t.RESULT_ID=t.OPTION_ID=t.MAP_ID=t.LIST_ID=t.BYTE_ARRAY_ID=t.U512_ID=t.U256_ID=t.U128_ID=t.U64_ID=t.U32_ID=t.U8_ID=t.I64_ID=t.I32_ID=t.UNIT_ID=t.UREF_ID=t.STRING_ID=t.PUBLIC_KEY_ID=t.KEY_ID=t.BOOL_ID=t.CLTypeTag=t.KeyVariant=t.CLErrorCodes=t.ACCOUNT_HASH_LENGTH=void 0,t.ACCOUNT_HASH_LENGTH=32,(o=t.CLErrorCodes||(t.CLErrorCodes={}))[o.EarlyEndOfStream=0]="EarlyEndOfStream",o[o.Formatting=1]="Formatting",o.LeftOverBytes="Left over bytes",o.OutOfMemory="Out of memory exception",o.UnknownValue="Unknown value",(n=t.KeyVariant||(t.KeyVariant={}))[n.Account=0]="Account",n[n.Hash=1]="Hash",n[n.URef=2]="URef",(r=t.CLTypeTag||(t.CLTypeTag={}))[r.Bool=0]="Bool",r[r.I32=1]="I32",r[r.I64=2]="I64",r[r.U8=3]="U8",r[r.U32=4]="U32",r[r.U64=5]="U64",r[r.U128=6]="U128",r[r.U256=7]="U256",r[r.U512=8]="U512",r[r.Unit=9]="Unit",r[r.String=10]="String",r[r.Key=11]="Key",r[r.URef=12]="URef",r[r.Option=13]="Option",r[r.List=14]="List",r[r.ByteArray=15]="ByteArray",r[r.Result=16]="Result",r[r.Map=17]="Map",r[r.Tuple1=18]="Tuple1",r[r.Tuple2=19]="Tuple2",r[r.Tuple3=20]="Tuple3",r[r.Any=21]="Any",r[r.PublicKey=22]="PublicKey",t.BOOL_ID="Bool",t.KEY_ID="Key",t.PUBLIC_KEY_ID="PublicKey",t.STRING_ID="String",t.UREF_ID="URef",t.UNIT_ID="Unit",t.I32_ID="I32",t.I64_ID="I64",t.U8_ID="U8",t.U32_ID="U32",t.U64_ID="U64",t.U128_ID="U128",t.U256_ID="U256",t.U512_ID="U512",t.BYTE_ARRAY_ID="ByteArray",t.LIST_ID="List",t.MAP_ID="Map",t.OPTION_ID="Option",t.RESULT_ID="Result",t.TUPLE1_ID="Tuple1",t.TUPLE2_ID="Tuple2",t.TUPLE3_ID="Tuple3"},9486:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(7066),t),o(r(4259),t),o(r(401),t),o(r(4381),t),o(r(9403),t),o(r(547),t),o(r(9439),t),o(r(1533),t),o(r(8641),t),o(r(932),t),o(r(3300),t),o(r(8830),t),o(r(305),t),o(r(5110),t),o(r(3300),t),o(r(5159),t),o(r(2285),t),o(r(7009),t),o(r(9591),t)},9591:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.padNum=t.matchBytesToCLType=t.matchByteParserByCLType=t.matchTypeToCLType=t.TUPLE_MATCH_LEN_TO_ID=void 0;var n=r(7107),o=r(7009),i=r(9486);t.TUPLE_MATCH_LEN_TO_ID=[o.TUPLE1_ID,o.TUPLE2_ID,o.TUPLE3_ID],t.matchTypeToCLType=function(e){if("string"==typeof e)switch(e){case o.BOOL_ID:return new i.CLBoolType;case o.KEY_ID:return new i.CLKeyType;case o.PUBLIC_KEY_ID:return new i.CLPublicKeyType;case o.STRING_ID:return new i.CLStringType;case o.UREF_ID:return new i.CLURefType;case o.UNIT_ID:return new i.CLUnitType;case o.I32_ID:return new i.CLI32Type;case o.I64_ID:return new i.CLI64Type;case o.U8_ID:return new i.CLU8Type;case o.U32_ID:return new i.CLU32Type;case o.U64_ID:return new i.CLU64Type;case o.U128_ID:return new i.CLU128Type;case o.U256_ID:return new i.CLU256Type;case o.U512_ID:return new i.CLU512Type;default:throw new Error("The simple type "+e+" is not supported")}if(typeof e==typeof{}){if(o.LIST_ID in e){var r=t.matchTypeToCLType(e[o.LIST_ID]);return new i.CLListType(r)}if(o.BYTE_ARRAY_ID in e){var n=e[o.BYTE_ARRAY_ID];return new i.CLByteArrayType(n)}if(o.MAP_ID in e){var a=t.matchTypeToCLType(e[o.MAP_ID].key),s=t.matchTypeToCLType(e[o.MAP_ID].value);return new i.CLMapType([a,s])}if(o.TUPLE1_ID in e){var u=e[o.TUPLE1_ID].map((function(e){return t.matchTypeToCLType(e)}));return new i.CLTuple1Type(u)}if(o.TUPLE2_ID in e)return u=e[o.TUPLE2_ID].map((function(e){return t.matchTypeToCLType(e)})),new i.CLTuple2Type(u);if(o.TUPLE3_ID in e)return u=e[o.TUPLE3_ID].map((function(e){return t.matchTypeToCLType(e)})),new i.CLTuple3Type(u);if(o.OPTION_ID in e)return r=t.matchTypeToCLType(e[o.OPTION_ID]),new i.CLOptionType(r);if(o.RESULT_ID in e){var c=t.matchTypeToCLType(e[o.RESULT_ID].ok),p=t.matchTypeToCLType(e[o.RESULT_ID].err);return new i.CLResultType({ok:c,err:p})}throw new Error("The complex type "+e+" is not supported")}throw new Error("Unknown data provided.")},t.matchByteParserByCLType=function(e){return e.tag===o.CLTypeTag.Bool?n.Ok(new i.CLBoolBytesParser):e.tag===o.CLTypeTag.I32?n.Ok(new i.CLI32BytesParser):e.tag===o.CLTypeTag.I64?n.Ok(new i.CLI64BytesParser):e.tag===o.CLTypeTag.U8?n.Ok(new i.CLU8BytesParser):e.tag===o.CLTypeTag.U32?n.Ok(new i.CLU32BytesParser):e.tag===o.CLTypeTag.U64?n.Ok(new i.CLU64BytesParser):e.tag===o.CLTypeTag.U128?n.Ok(new i.CLU128BytesParser):e.tag===o.CLTypeTag.U256?n.Ok(new i.CLU256BytesParser):e.tag===o.CLTypeTag.U512?n.Ok(new i.CLU512BytesParser):e.tag===o.CLTypeTag.ByteArray?n.Ok(new i.CLByteArrayBytesParser):e.tag===o.CLTypeTag.URef?n.Ok(new i.CLURefBytesParser):e.tag===o.CLTypeTag.Key?n.Ok(new i.CLKeyBytesParser):e.tag===o.CLTypeTag.PublicKey?n.Ok(new i.CLPublicKeyBytesParser):e.tag===o.CLTypeTag.List?n.Ok(new i.CLListBytesParser):e.tag===o.CLTypeTag.Map?n.Ok(new i.CLMapBytesParser):e.tag===o.CLTypeTag.Tuple1||e.tag===o.CLTypeTag.Tuple2||e.tag===o.CLTypeTag.Tuple3?n.Ok(new i.CLTupleBytesParser):e.tag===o.CLTypeTag.Option?n.Ok(new i.CLOptionBytesParser):e.tag===o.CLTypeTag.Result?n.Ok(new i.CLResultBytesParser):e.tag===o.CLTypeTag.String?n.Ok(new i.CLStringBytesParser):e.tag===o.CLTypeTag.Unit?n.Ok(new i.CLUnitBytesParser):n.Err("Unknown type")},t.matchBytesToCLType=function(e){var r=e[0],a=e.subarray(1);switch(r){case o.CLTypeTag.Bool:return i.resultHelper(n.Ok(new i.CLBoolType),a);case o.CLTypeTag.I32:return i.resultHelper(n.Ok(new i.CLI32Type),a);case o.CLTypeTag.I64:return i.resultHelper(n.Ok(new i.CLI64Type),a);case o.CLTypeTag.U8:return i.resultHelper(n.Ok(new i.CLU8Type),a);case o.CLTypeTag.U32:return i.resultHelper(n.Ok(new i.CLU32Type),a);case o.CLTypeTag.U64:case o.CLTypeTag.U64:return i.resultHelper(n.Ok(new i.CLU64Type),a);case o.CLTypeTag.U128:return i.resultHelper(n.Ok(new i.CLU128Type),a);case o.CLTypeTag.U256:return i.resultHelper(n.Ok(new i.CLU256Type),a);case o.CLTypeTag.U512:return i.resultHelper(n.Ok(new i.CLU512Type),a);case o.CLTypeTag.Unit:return i.resultHelper(n.Ok(new i.CLUnitType),a);case o.CLTypeTag.String:return i.resultHelper(n.Ok(new i.CLStringType),a);case o.CLTypeTag.Key:return i.resultHelper(n.Ok(new i.CLKeyType),a);case o.CLTypeTag.URef:return i.resultHelper(n.Ok(new i.CLURefType),a);case o.CLTypeTag.Option:var s=t.matchBytesToCLType(a),u=s.result,c=s.remainder,p=u.unwrap();return i.resultHelper(n.Ok(new i.CLOptionType(p)),c);case o.CLTypeTag.List:var y=t.matchBytesToCLType(a);return u=y.result,c=y.remainder,p=u.unwrap(),i.resultHelper(n.Ok(new i.CLListType(p)),c);case o.CLTypeTag.ByteArray:var l=t.matchBytesToCLType(a);return u=l.result,c=l.remainder,p=u.unwrap(),i.resultHelper(n.Ok(new i.CLListType(p)),c);case o.CLTypeTag.Result:var f=t.matchBytesToCLType(a),d=f.result,h=f.remainder,g=d.unwrap();if(!h)return i.resultHelper(n.Err("Missing Error type bytes in Result"));var m=t.matchBytesToCLType(h),v=m.result,b=m.remainder,C=v.unwrap();return i.resultHelper(n.Ok(new i.CLResultType({ok:g,err:C})),b);case o.CLTypeTag.Map:var T=t.matchBytesToCLType(a),B=T.result,w=T.remainder,_=B.unwrap();if(!w)return i.resultHelper(n.Err("Missing Key type bytes in Map"));var L=t.matchBytesToCLType(w),S=L.result,P=(b=L.remainder,S.unwrap());return i.resultHelper(n.Ok(new i.CLMapType([_,P])),b);case o.CLTypeTag.Tuple1:var O=t.matchBytesToCLType(a),E=O.result;return b=O.remainder,p=E.unwrap(),i.resultHelper(n.Ok(new i.CLTuple1Type([p])),b);case o.CLTypeTag.Tuple2:var A=t.matchBytesToCLType(a),U=A.result,j=A.remainder,k=U.unwrap();if(!j)return i.resultHelper(n.Err("Missing second tuple type bytes in CLTuple2Type"));var H=t.matchBytesToCLType(j),I=H.result,M=H.remainder,D=I.unwrap();return i.resultHelper(n.Ok(new i.CLTuple1Type([k,D])),M);case o.CLTypeTag.Tuple3:var K=t.matchBytesToCLType(a);if(U=K.result,j=K.remainder,k=U.unwrap(),!j)return i.resultHelper(n.Err("Missing second tuple type bytes in CLTuple2Type"));var N=t.matchBytesToCLType(j);if(I=N.result,M=N.remainder,D=I.unwrap(),!M)return i.resultHelper(n.Err("Missing third tuple type bytes in CLTuple2Type"));var R=t.matchBytesToCLType(M),V=R.result,x=R.remainder,W=V.unwrap();return i.resultHelper(n.Ok(new i.CLTuple1Type([k,D,W])),x);case o.CLTypeTag.Any:return i.resultHelper(n.Err("Any unsupported"));case o.CLTypeTag.PublicKey:return i.resultHelper(n.Ok(new i.CLPublicKeyType))}return i.resultHelper(n.Err("Unsuported type"))},t.padNum=function(e,t){return void 0===t&&(t=1),new Array(t).join("0").slice(-1*(t||2))+e}},3368:function(e,t,r){var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CasperClient=void 0;var i=r(1999),a=r(3915),s=r(1417),u=r(2964),c=r(3655),p=r(1446),y=function(){function e(e){this.nodeClient=new i.CasperServiceByJsonRPC(e)}return e.prototype.newKeyPair=function(e){switch(e){case u.SignatureAlgorithm.Ed25519:return a.Keys.Ed25519.new();case u.SignatureAlgorithm.Secp256K1:return a.Keys.Secp256K1.new();default:throw new Error("Invalid signature algorithm")}},e.prototype.loadPublicKeyFromFile=function(e,t){switch(t){case u.SignatureAlgorithm.Ed25519:return a.Keys.Ed25519.parsePublicKeyFile(e);case u.SignatureAlgorithm.Secp256K1:return a.Keys.Secp256K1.parsePublicKeyFile(e);default:throw new Error("Invalid signature algorithm")}},e.prototype.loadPrivateKeyFromFile=function(e,t){switch(t){case u.SignatureAlgorithm.Ed25519:return a.Keys.Ed25519.parsePrivateKeyFile(e);case u.SignatureAlgorithm.Secp256K1:return a.Keys.Secp256K1.parsePrivateKeyFile(e);default:throw new Error("Invalid signature algorithm")}},e.prototype.loadKeyPairFromPrivateFile=function(e,t){switch(t){case u.SignatureAlgorithm.Ed25519:return a.Keys.Ed25519.loadKeyPairFromPrivateFile(e);case u.SignatureAlgorithm.Secp256K1:return a.Keys.Secp256K1.loadKeyPairFromPrivateFile(e);default:throw new Error("Invalid signature algorithm")}},e.prototype.newHdWallet=function(e){return c.CasperHDKey.fromMasterSeed(e)},e.prototype.privateToPublicKey=function(e,t){switch(t){case u.SignatureAlgorithm.Ed25519:return a.Keys.Ed25519.privateToPublicKey(e);case u.SignatureAlgorithm.Secp256K1:return a.Keys.Secp256K1.privateToPublicKey(e);default:throw new Error("Invalid signature algorithm")}},e.prototype.makeDeploy=function(e,t,r){return a.DeployUtil.makeDeploy(e,t,r)},e.prototype.signDeploy=function(e,t){return a.DeployUtil.signDeploy(e,t)},e.prototype.putDeploy=function(e){return this.nodeClient.deploy(e).then((function(e){return e.deploy_hash}))},e.prototype.deployToJson=function(e){return a.DeployUtil.deployToJson(e)},e.prototype.deployFromJson=function(e){return a.DeployUtil.deployFromJson(e)},e.prototype.makeTransferDeploy=function(e,t,r){if(!t.isTransfer())throw new Error("The session is not a Transfer ExecutableDeployItem");return this.makeDeploy(e,t,r)},e.prototype.balanceOfByPublicKey=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.balanceOfByAccountHash(s.encodeBase16(e.toAccountHash()))]}))}))},e.prototype.balanceOfByAccountHash=function(e){return n(this,void 0,void 0,(function(){var t,r;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,4,,5]),[4,this.nodeClient.getLatestBlockInfo().then((function(e){var t;return null===(t=e.block)||void 0===t?void 0:t.header.state_root_hash}))];case 1:return(t=n.sent())?[4,this.nodeClient.getAccountBalanceUrefByPublicKeyHash(t,e)]:[2,p.BigNumber.from(0)];case 2:return(r=n.sent())?[4,this.nodeClient.getAccountBalance(t,r)]:[2,p.BigNumber.from(0)];case 3:return[2,n.sent()];case 4:return n.sent(),[2,p.BigNumber.from(0)];case 5:return[2]}}))}))},e.prototype.getDeploy=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.nodeClient.getDeployInfo(e).then((function(e){return[a.DeployUtil.deployFromJson(e).unwrap(),e]}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getAccountMainPurseUref=function(e){return n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.nodeClient.getLatestBlockInfo().then((function(e){var t;return null===(t=e.block)||void 0===t?void 0:t.header.state_root_hash}))];case 1:return(t=r.sent())?[4,this.nodeClient.getAccountBalanceUrefByPublicKeyHash(t,s.encodeBase16(e.toAccountHash()))]:[2,null];case 2:return[2,r.sent()]}}))}))},e}();t.CasperClient=y},3655:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CasperHDKey=void 0;var n=r(8),o=r(604),i=r(2964),a=function(){function e(e){this.hdKey=e,this.bip44Index=506}return e.prototype.bip44Path=function(e){return["m","44'",this.bip44Index+"'","0'","0",""+e].join("/")},e.fromMasterSeed=function(t){return new e(n.HDKey.fromMasterSeed(Buffer.from(t)))},e.prototype.publicKey=function(){return this.hdKey.publicKey},e.prototype.privateKey=function(){return this.hdKey.privateKey},e.prototype.privateExtendedKey=function(){return this.hdKey.privateExtendedKey},e.prototype.publicExtendedKey=function(){return this.hdKey.publicExtendedKey},e.prototype.derive=function(e){var t=this.hdKey.derive(e);return new i.Secp256K1(new Uint8Array(t.publicKey),new Uint8Array(t.privateKey))},e.prototype.deriveIndex=function(e){return this.derive(this.bip44Path(e))},e.prototype.sign=function(e){return this.hdKey.sign(o.sha256(Buffer.from(e)))},e.prototype.verify=function(e,t){return this.hdKey.verify(o.sha256(Buffer.from(t)),Buffer.from(e))},e.prototype.toJSON=function(){return this.hdKey.toJSON()},e}();t.CasperHDKey=a},3492:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Transfer=t.Faucet=t.BoundContract=t.Contract=t.byteHash=void 0;var s=a(r(3779)),u=i(r(5747)),c=i(r(4922)),p=r(4922),y=r(6349),l=r(9486);t.byteHash=function(e){return s.default.blake2b(e,null,32)};var f=function(){function e(e,t){this.sessionWasm=u.readFileSync(e),this.paymentWasm=t?u.readFileSync(t):Buffer.from("")}return e.prototype.deploy=function(e,t,r,n,o){var i=p.ExecutableDeployItem.newModuleBytes(this.sessionWasm,e),a=y.RuntimeArgs.fromMap({amount:l.CLValueBuilder.u512(t.toString())}),s=p.ExecutableDeployItem.newModuleBytes(this.paymentWasm,a),u=c.makeDeploy(new p.DeployParams(r,o),i,s);return c.signDeploy(u,n)},e}();t.Contract=f;var d=function(){function e(e,t){this.contract=e,this.contractKeyPair=t}return e.prototype.deploy=function(e,t,r){return this.contract.deploy(e,t,this.contractKeyPair.publicKey,this.contractKeyPair,r)},e}();t.BoundContract=d;var h=function(){function e(){}return e.args=function(e){var t=new l.CLKey(new l.CLAccountHash(e));return y.RuntimeArgs.fromMap({account:t})},e}();t.Faucet=h;var g=function(){function e(){}return e.args=function(e,t){var r=l.CLValueBuilder.key(new l.CLAccountHash(e));return y.RuntimeArgs.fromMap({account:r,amount:l.CLValueBuilder.u512(t.toString())})},e}();t.Transfer=g},1417:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.decodeBase16=t.encodeBase16=t.base64to16=void 0;var n=r(1718),o=r(1718);function i(e){return Buffer.from(e).toString("hex")}Object.defineProperty(t,"encodeBase64",{enumerable:!0,get:function(){return o.encodeBase64}}),Object.defineProperty(t,"decodeBase64",{enumerable:!0,get:function(){return o.decodeBase64}}),t.base64to16=function(e){return i(n.decodeBase64(e))},t.encodeBase16=i,t.decodeBase16=function(e){return new Uint8Array(Buffer.from(e,"hex"))}},4922:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},a=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.deployToBytes=t.arrayEquals=t.validateDeploy=t.deploySizeInBytes=t.addArgToDeploy=t.deployFromJson=t.deployToJson=t.standardPayment=t.setSignature=t.signDeploy=t.makeDeploy=t.DeployParams=t.ContractType=t.serializeApprovals=t.serializeBody=t.serializeHeader=t.Deploy=t.ExecutableDeployItem=t.Transfer=t.StoredVersionedContractByHash=t.StoredVersionedContractByName=t.StoredContractByName=t.StoredContractByHash=t.ModuleBytes=t.Approval=t.DeployHeader=t.UniqAddress=t.dehumanizerTTL=t.humanizerTTL=void 0;var u=r(7107),c=r(4103),p=s(r(3779)),y=r(1417),l=s(r(1953)),f=r(9486),d=r(6138),h=r(6349),g=r(3915),m=r(2964),v=r(1446),b=r(8791),C=r(3786),T=l.default.humanizer({spacer:"",serialComma:!1,conjunction:" ",delimiter:" ",language:"shortEn",languages:{shortEn:{d:function(){return"day"},h:function(){return"h"},m:function(){return"m"},s:function(){return"s"},ms:function(){return"ms"}}}}),B=function(e){return y.encodeBase16(e)},w=function(e){return y.decodeBase16(e)};t.humanizerTTL=function(e){return T(e)},t.dehumanizerTTL=function(e){return e.split(" ").map((function(e){if(e.includes("ms"))return Number(e.replace("ms",""));if(e.includes("s")&&!e.includes("m"))return 1e3*Number(e.replace("s",""));if(e.includes("m")&&!e.includes("s"))return 60*Number(e.replace("m",""))*1e3;if(e.includes("h"))return 60*Number(e.replace("h",""))*60*1e3;if(e.includes("day"))return 24*Number(e.replace("day",""))*60*60*1e3;throw Error("Unsuported TTL unit")})).reduce((function(e,t){return e+t}))};var _=function(){function e(e,t){if(!(e instanceof f.CLPublicKey))throw new Error("publicKey is not an instance of CLPublicKey");var r=v.BigNumber.from(t);if(r.gt("18446744073709551615"))throw new Error("transferId max value is U64");this.transferId=r,this.publicKey=e}return e.prototype.toString=function(){return this.publicKey.toHex()+"-"+this.transferId.toHexString()},e.fromString=function(t){var r=t.split("-"),n=r[0],o=r[1];return new e(f.CLPublicKey.fromHex(n),o)},e}();t.UniqAddress=_;var L=function(){function e(e,t,r,n,o,i,a){this.account=e,this.timestamp=t,this.ttl=r,this.gasPrice=n,this.bodyHash=o,this.dependencies=i,this.chainName=a}return e.prototype.toBytes=function(){return u.Ok(c.concat([f.CLValueParsers.toBytes(this.account).unwrap(),d.toBytesU64(this.timestamp),d.toBytesU64(this.ttl),d.toBytesU64(this.gasPrice),d.toBytesDeployHash(this.bodyHash),d.toBytesVector(this.dependencies.map((function(e){return new S(e)}))),d.toBytesString(this.chainName)]))},i([b.jsonMember({serializer:function(e){return e.toHex()},deserializer:function(e){return f.CLPublicKey.fromHex(e)}}),a("design:type",f.CLPublicKey)],e.prototype,"account",void 0),i([b.jsonMember({serializer:function(e){return new Date(e).toISOString()},deserializer:function(e){return Date.parse(e)}}),a("design:type",Number)],e.prototype,"timestamp",void 0),i([b.jsonMember({serializer:t.humanizerTTL,deserializer:t.dehumanizerTTL}),a("design:type",Number)],e.prototype,"ttl",void 0),i([b.jsonMember({constructor:Number,name:"gas_price"}),a("design:type",Number)],e.prototype,"gasPrice",void 0),i([b.jsonMember({name:"body_hash",serializer:B,deserializer:w}),a("design:type",Uint8Array)],e.prototype,"bodyHash",void 0),i([b.jsonArrayMember(C.ByteArray,{serializer:function(e){return e.map((function(e){return B(e)}))},deserializer:function(e){return e.map((function(e){return w(e)}))}}),a("design:type",Array)],e.prototype,"dependencies",void 0),i([b.jsonMember({name:"chain_name",constructor:String}),a("design:type",String)],e.prototype,"chainName",void 0),i([b.jsonObject,a("design:paramtypes",[f.CLPublicKey,Number,Number,Number,Uint8Array,Array,String])],e)}();t.DeployHeader=L;var S=function(){function e(e){this.hash=e}return e.prototype.toBytes=function(){return u.Ok(d.toBytesDeployHash(this.hash))},e}(),P=function(){function e(){}return i([b.jsonMember({constructor:String}),a("design:type",String)],e.prototype,"signer",void 0),i([b.jsonMember({constructor:String}),a("design:type",String)],e.prototype,"signature",void 0),i([b.jsonObject],e)}();t.Approval=P;var O=function(){function e(){}return e.prototype.getArgByName=function(e){return this.args.args.get(e)},e.prototype.setArg=function(e,t){this.args.args.set(e,t)},e}(),E=function(e){var t={args:e};return new b.TypedJSON(h.RuntimeArgs).parse(t)},A=function(e){var t=new b.TypedJSON(h.RuntimeArgs).toPlainJson(e);return Object.values(t)[0]},U=function(e){function t(t,r){var n=e.call(this)||this;return n.tag=0,n.moduleBytes=t,n.args=r,n}return o(t,e),t.prototype.toBytes=function(){return u.Ok(c.concat([Uint8Array.from([this.tag]),d.toBytesArrayU8(this.moduleBytes),d.toBytesBytesArray(this.args.toBytes().unwrap())]))},i([b.jsonMember({name:"module_bytes",serializer:B,deserializer:w}),a("design:type",Uint8Array)],t.prototype,"moduleBytes",void 0),i([b.jsonMember({deserializer:E,serializer:A}),a("design:type",h.RuntimeArgs)],t.prototype,"args",void 0),i([b.jsonObject,a("design:paramtypes",[Uint8Array,h.RuntimeArgs])],t)}(O);t.ModuleBytes=U;var j=function(e){function t(t,r,n){var o=e.call(this)||this;return o.tag=1,o.entryPoint=r,o.args=n,o.hash=t,o}return o(t,e),t.prototype.toBytes=function(){return u.Ok(c.concat([Uint8Array.from([this.tag]),d.toBytesBytesArray(this.hash),d.toBytesString(this.entryPoint),d.toBytesBytesArray(this.args.toBytes().unwrap())]))},i([b.jsonMember({serializer:B,deserializer:w}),a("design:type",Uint8Array)],t.prototype,"hash",void 0),i([b.jsonMember({name:"entry_point",constructor:String}),a("design:type",String)],t.prototype,"entryPoint",void 0),i([b.jsonMember({deserializer:E,serializer:A}),a("design:type",h.RuntimeArgs)],t.prototype,"args",void 0),i([b.jsonObject,a("design:paramtypes",[Uint8Array,String,h.RuntimeArgs])],t)}(O);t.StoredContractByHash=j;var k=function(e){function t(t,r,n){var o=e.call(this)||this;return o.tag=2,o.name=t,o.entryPoint=r,o.args=n,o}return o(t,e),t.prototype.toBytes=function(){return u.Ok(c.concat([Uint8Array.from([this.tag]),d.toBytesString(this.name),d.toBytesString(this.entryPoint),d.toBytesBytesArray(this.args.toBytes().unwrap())]))},i([b.jsonMember({constructor:String}),a("design:type",String)],t.prototype,"name",void 0),i([b.jsonMember({name:"entry_point",constructor:String}),a("design:type",String)],t.prototype,"entryPoint",void 0),i([b.jsonMember({deserializer:E,serializer:A}),a("design:type",h.RuntimeArgs)],t.prototype,"args",void 0),i([b.jsonObject,a("design:paramtypes",[String,String,h.RuntimeArgs])],t)}(O);t.StoredContractByName=k;var H=function(e){function t(t,r,n,o){var i=e.call(this)||this;return i.tag=4,i.name=t,i.version=r,i.entryPoint=n,i.args=o,i}return o(t,e),t.prototype.toBytes=function(){var e;return e=null===this.version?new f.CLOption(u.None,new f.CLU32Type):new f.CLOption(u.Some(new f.CLU32(this.version))),u.Ok(c.concat([Uint8Array.from([this.tag]),d.toBytesString(this.name),f.CLValueParsers.toBytes(e).unwrap(),d.toBytesString(this.entryPoint),d.toBytesBytesArray(this.args.toBytes().unwrap())]))},i([b.jsonMember({constructor:String}),a("design:type",String)],t.prototype,"name",void 0),i([b.jsonMember({constructor:Number,preserveNull:!0}),a("design:type",Object)],t.prototype,"version",void 0),i([b.jsonMember({name:"entry_point",constructor:String}),a("design:type",String)],t.prototype,"entryPoint",void 0),i([b.jsonMember({deserializer:E,serializer:A}),a("design:type",h.RuntimeArgs)],t.prototype,"args",void 0),i([b.jsonObject,a("design:paramtypes",[String,Object,String,h.RuntimeArgs])],t)}(O);t.StoredVersionedContractByName=H;var I=function(e){function t(t,r,n,o){var i=e.call(this)||this;return i.tag=3,i.hash=t,i.version=r,i.entryPoint=n,i.args=o,i}return o(t,e),t.prototype.toBytes=function(){var e;return e=null===this.version?new f.CLOption(u.None,new f.CLU32Type):new f.CLOption(u.Some(new f.CLU32(this.version))),u.Ok(c.concat([Uint8Array.from([this.tag]),d.toBytesBytesArray(this.hash),f.CLValueParsers.toBytes(e).unwrap(),d.toBytesString(this.entryPoint),d.toBytesBytesArray(this.args.toBytes().unwrap())]))},i([b.jsonMember({serializer:B,deserializer:w}),a("design:type",Uint8Array)],t.prototype,"hash",void 0),i([b.jsonMember({constructor:Number,preserveNull:!0}),a("design:type",Object)],t.prototype,"version",void 0),i([b.jsonMember({name:"entry_point",constructor:String}),a("design:type",String)],t.prototype,"entryPoint",void 0),i([b.jsonMember({deserializer:E,serializer:A}),a("design:type",h.RuntimeArgs)],t.prototype,"args",void 0),i([b.jsonObject,a("design:paramtypes",[Uint8Array,Object,String,h.RuntimeArgs])],t)}(O);t.StoredVersionedContractByHash=I;var M=function(e){function t(t){var r=e.call(this)||this;return r.tag=5,r.args=t,r}return o(t,e),t.prototype.toBytes=function(){return u.Ok(c.concat([Uint8Array.from([this.tag]),d.toBytesBytesArray(this.args.toBytes().unwrap())]))},i([b.jsonMember({deserializer:E,serializer:A}),a("design:type",h.RuntimeArgs)],t.prototype,"args",void 0),i([b.jsonObject,a("design:paramtypes",[h.RuntimeArgs])],t)}(O);t.Transfer=M;var D=function(){function e(){}var t;return t=e,e.prototype.toBytes=function(){if(this.isModuleBytes())return this.moduleBytes.toBytes();if(this.isStoredContractByHash())return this.storedContractByHash.toBytes();if(this.isStoredContractByName())return this.storedContractByName.toBytes();if(this.isStoredVersionContractByHash())return this.storedVersionedContractByHash.toBytes();if(this.isStoredVersionContractByName())return this.storedVersionedContractByName.toBytes();if(this.isTransfer())return this.transfer.toBytes();throw new Error("failed to serialize ExecutableDeployItemJsonWrapper")},e.prototype.getArgByName=function(e){if(this.isModuleBytes())return this.moduleBytes.getArgByName(e);if(this.isStoredContractByHash())return this.storedContractByHash.getArgByName(e);if(this.isStoredContractByName())return this.storedContractByName.getArgByName(e);if(this.isStoredVersionContractByHash())return this.storedVersionedContractByHash.getArgByName(e);if(this.isStoredVersionContractByName())return this.storedVersionedContractByName.getArgByName(e);if(this.isTransfer())return this.transfer.getArgByName(e);throw new Error("failed to serialize ExecutableDeployItemJsonWrapper")},e.prototype.setArg=function(e,t){if(this.isModuleBytes())return this.moduleBytes.setArg(e,t);if(this.isStoredContractByHash())return this.storedContractByHash.setArg(e,t);if(this.isStoredContractByName())return this.storedContractByName.setArg(e,t);if(this.isStoredVersionContractByHash())return this.storedVersionedContractByHash.setArg(e,t);if(this.isStoredVersionContractByName())return this.storedVersionedContractByName.setArg(e,t);if(this.isTransfer())return this.transfer.setArg(e,t);throw new Error("failed to serialize ExecutableDeployItemJsonWrapper")},e.fromExecutableDeployItemInternal=function(e){var r=new t;switch(e.tag){case 0:r.moduleBytes=e;break;case 1:r.storedContractByHash=e;break;case 2:r.storedContractByName=e;break;case 3:r.storedVersionedContractByHash=e;break;case 4:r.storedVersionedContractByName=e;break;case 5:r.transfer=e}return r},e.newModuleBytes=function(e,r){return t.fromExecutableDeployItemInternal(new U(e,r))},e.newStoredContractByHash=function(e,r,n){return t.fromExecutableDeployItemInternal(new j(e,r,n))},e.newStoredContractByName=function(e,r,n){return t.fromExecutableDeployItemInternal(new k(e,r,n))},e.newStoredVersionContractByHash=function(e,r,n,o){return t.fromExecutableDeployItemInternal(new I(e,r,n,o))},e.newStoredVersionContractByName=function(e,r,n,o){return t.fromExecutableDeployItemInternal(new H(e,r,n,o))},e.newTransfer=function(e,r,n,o){void 0===n&&(n=null);var i=h.RuntimeArgs.fromMap({});if(i.insert("amount",f.CLValueBuilder.u512(e)),n&&i.insert("source",n),r instanceof f.CLURef)i.insert("target",r);else{if(!(r instanceof f.CLPublicKey))throw new Error("Please specify target");i.insert("target",r)}if(void 0===o)throw new Error("transfer-id missing in new transfer.");return i.insert("id",f.CLValueBuilder.option(u.Some(new f.CLU64(o)),new f.CLU64Type)),t.fromExecutableDeployItemInternal(new M(i))},e.newTransferWithOptionalTransferId=function(e,r,n,o){var i=h.RuntimeArgs.fromMap({});if(i.insert("amount",f.CLValueBuilder.u512(e)),n&&i.insert("source",n),r instanceof f.CLURef)i.insert("target",r);else{if(!(r instanceof f.CLPublicKey))throw new Error("Please specify target");i.insert("target",f.CLValueBuilder.byteArray(r.toAccountHash()))}return null!=o?i.insert("id",f.CLValueBuilder.option(u.Some(f.CLValueBuilder.u64(o)),f.CLTypeBuilder.u64())):i.insert("id",f.CLValueBuilder.option(u.None,f.CLTypeBuilder.u64())),t.fromExecutableDeployItemInternal(new M(i))},e.newTransferToUniqAddress=function(e,t,r,n,o,i,a,s){void 0===i&&(i=1),void 0===a&&(a=18e5);var u=new g.DeployUtil.DeployParams(e,o,i,a),c=g.DeployUtil.standardPayment(n),p=g.DeployUtil.ExecutableDeployItem.newTransfer(r,t.publicKey,s,t.transferId);return g.DeployUtil.makeDeploy(u,p,c)},e.prototype.isModuleBytes=function(){return!!this.moduleBytes},e.prototype.asModuleBytes=function(){return this.moduleBytes},e.prototype.isStoredContractByHash=function(){return!!this.storedContractByHash},e.prototype.asStoredContractByHash=function(){return this.storedContractByHash},e.prototype.isStoredContractByName=function(){return!!this.storedContractByName},e.prototype.asStoredContractByName=function(){return this.storedContractByName},e.prototype.isStoredVersionContractByName=function(){return!!this.storedVersionedContractByName},e.prototype.asStoredVersionContractByName=function(){return this.storedVersionedContractByName},e.prototype.isStoredVersionContractByHash=function(){return!!this.storedVersionedContractByHash},e.prototype.asStoredVersionContractByHash=function(){return this.storedVersionedContractByHash},e.prototype.isTransfer=function(){return!!this.transfer},e.prototype.asTransfer=function(){return this.transfer},i([b.jsonMember({name:"ModuleBytes",constructor:U}),a("design:type",U)],e.prototype,"moduleBytes",void 0),i([b.jsonMember({name:"StoredContractByHash",constructor:j}),a("design:type",j)],e.prototype,"storedContractByHash",void 0),i([b.jsonMember({name:"StoredContractByName",constructor:k}),a("design:type",k)],e.prototype,"storedContractByName",void 0),i([b.jsonMember({name:"StoredVersionedContractByHash",constructor:I}),a("design:type",I)],e.prototype,"storedVersionedContractByHash",void 0),i([b.jsonMember({name:"StoredVersionedContractByName",constructor:H}),a("design:type",H)],e.prototype,"storedVersionedContractByName",void 0),i([b.jsonMember({name:"Transfer",constructor:M}),a("design:type",M)],e.prototype,"transfer",void 0),t=i([b.jsonObject],e)}();t.ExecutableDeployItem=D;var K,N=function(){function e(e,t,r,n,o){this.approvals=o,this.session=n,this.payment=r,this.header=t,this.hash=e}return e.prototype.isTransfer=function(){return this.session.isTransfer()},e.prototype.isStandardPayment=function(){var e;return!!this.payment.isModuleBytes()&&0===(null===(e=this.payment.asModuleBytes())||void 0===e?void 0:e.moduleBytes.length)},i([b.jsonMember({serializer:B,deserializer:w}),a("design:type",Uint8Array)],e.prototype,"hash",void 0),i([b.jsonMember({constructor:L}),a("design:type",L)],e.prototype,"header",void 0),i([b.jsonMember({constructor:D}),a("design:type",D)],e.prototype,"payment",void 0),i([b.jsonMember({constructor:D}),a("design:type",D)],e.prototype,"session",void 0),i([b.jsonArrayMember(P),a("design:type",Array)],e.prototype,"approvals",void 0),i([b.jsonObject,a("design:paramtypes",[Uint8Array,L,D,D,Array])],e)}();t.Deploy=N,t.serializeHeader=function(e){return e.toBytes()},t.serializeBody=function(e,t){return c.concat([e.toBytes().unwrap(),t.toBytes().unwrap()])},t.serializeApprovals=function(e){var t=d.toBytesU32(e.length),r=c.concat(e.map((function(e){return c.concat([Uint8Array.from(Buffer.from(e.signer,"hex")),Uint8Array.from(Buffer.from(e.signature,"hex"))])})));return c.concat([t,r])},(K=t.ContractType||(t.ContractType={})).WASM="WASM",K.Hash="Hash",K.Name="Name";function R(e,r,n){var o=t.serializeBody(n,r),i=p.default.blake2b(o,null,32),a=new L(e.accountPublicKey,e.timestamp,e.ttl,e.gasPrice,i,e.dependencies,e.chainName),s=t.serializeHeader(a),u=p.default.blake2b(s.unwrap(),null,32);return new N(u,a,n,r,[])}t.DeployParams=function(e,t,r,n,o,i){void 0===r&&(r=1),void 0===n&&(n=18e5),void 0===o&&(o=[]),this.accountPublicKey=e,this.chainName=t,this.gasPrice=r,this.ttl=n,this.dependencies=o,this.timestamp=i,this.dependencies=o.filter((function(e){return o.filter((function(t){return y.encodeBase16(e)===y.encodeBase16(t)})).length<2})),i||(this.timestamp=Date.now())},t.makeDeploy=R,t.signDeploy=function(e,t){var r=new P,n=t.sign(e.hash);switch(r.signer=t.accountHex(),t.signatureAlgorithm){case m.SignatureAlgorithm.Ed25519:r.signature=g.Keys.Ed25519.accountHex(n);break;case m.SignatureAlgorithm.Secp256K1:r.signature=g.Keys.Secp256K1.accountHex(n)}return e.approvals.push(r),e},t.setSignature=function(e,t,r){var n=new P;return n.signer=r.toHex(),r.isEd25519()&&(n.signature=g.Keys.Ed25519.accountHex(t)),r.isSecp256K1()&&(n.signature=g.Keys.Secp256K1.accountHex(t)),e.approvals.push(n),e},t.standardPayment=function(e){var t=h.RuntimeArgs.fromMap({amount:f.CLValueBuilder.u512(e.toString())});return D.newModuleBytes(Uint8Array.from([]),t)},t.deployToJson=function(e){return{deploy:new b.TypedJSON(N).toPlainJson(e)}},t.deployFromJson=function(e){if(void 0===e.deploy)return new u.Err(new Error("The Deploy JSON doesn't have 'deploy' field."));var r=null;try{r=new b.TypedJSON(N).parse(e.deploy)}catch(e){return new u.Err(e)}if(null==r)return u.Err(new Error("The JSON can't be parsed as a Deploy."));var n=t.validateDeploy(r);return n.err?new u.Err(new Error(n.val)):new u.Ok(r)},t.addArgToDeploy=function(e,t,r){if(0!==e.approvals.length)throw Error("Can not add argument to already signed deploy.");var n=new g.DeployUtil.DeployParams(e.header.account,e.header.chainName,e.header.gasPrice,e.header.ttl,e.header.dependencies,e.header.timestamp),o=e.session;return o.setArg(t,r),R(n,o,e.payment)},t.deploySizeInBytes=function(e){var r=e.hash.length,n=t.serializeBody(e.payment,e.session).length;return r+t.serializeHeader(e.header).unwrap().length+n+e.approvals.map((function(e){return(e.signature.length+e.signer.length)/2})).reduce((function(e,t){return e+t}),0)},t.validateDeploy=function(e){if(!(e instanceof N))return new u.Err("'deploy' is not an instance of Deploy class.");var r=t.serializeBody(e.payment,e.session),n=p.default.blake2b(r,null,32);if(!t.arrayEquals(e.header.bodyHash,n))return u.Err("Invalid deploy: bodyHash missmatch. Expected: "+n+", \n got: "+e.header.bodyHash+".");var o=t.serializeHeader(e.header).unwrap(),i=p.default.blake2b(o,null,32);return t.arrayEquals(e.hash,i)?u.Ok(e):u.Err("Invalid deploy: hash missmatch. Expected: "+i+", \n got: "+e.hash+".")},t.arrayEquals=function(e,t){return e.length===t.length&&e.every((function(e,r){return e===t[r]}))},t.deployToBytes=function(e){return c.concat([t.serializeHeader(e.header).unwrap(),e.hash,t.serializeBody(e.payment,e.session),t.serializeApprovals(e.approvals)])}},2964:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&i(t,e,r);return a(t,e),t},u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Secp256K1=t.Ed25519=t.AsymmetricKey=t.readBase64WithPEM=t.SignatureAlgorithm=void 0;var c,p=s(r(5747)),y=s(r(3786)),l=r(1718),f=r(3607),d=r(9486),h=r(3492),g=u(r(5986)),m=s(r(4410)),v=u(r(282)),b=r(604),C=new v.default("secp256k1");function T(e,t){var r=Buffer.from([0]),n=Buffer.concat([Buffer.from(e),r]);return 0===t.length?Buffer.from([]):h.byteHash(Buffer.concat([n,Buffer.from(t)]))}function B(e){var t=e.split(/\r?\n/).filter((function(e){return!e.startsWith("---")})).join("").trim();return l.decodeBase64(t)}!function(e){e.Ed25519="ed25519",e.Secp256K1="secp256k1"}(c=t.SignatureAlgorithm||(t.SignatureAlgorithm={})),t.readBase64WithPEM=B;var w=function(){function e(e,t,r){this.publicKey=new d.CLPublicKey(e,r),this.privateKey=t,this.signatureAlgorithm=r}return e.prototype.accountHash=function(){return this.publicKey.toAccountHash()},e.prototype.accountHex=function(){return this.publicKey.toHex()},e.prototype.toPem=function(e,t){return"-----BEGIN "+e+"-----\n"+t+"\n-----END "+e+"-----\n"},e}();t.AsymmetricKey=w;var _=function(e){function t(t){return e.call(this,t.publicKey,t.secretKey,c.Ed25519)||this}return o(t,e),t.new=function(){return new t(y.sign_keyPair())},t.accountHex=function(e){return"01"+f.encodeBase16(e)},t.parseKeyFiles=function(e,r){var n=t.parsePublicKeyFile(e),o=t.parsePrivateKeyFile(r);return new t({publicKey:n,secretKey:Buffer.concat([o,n])})},t.accountHash=function(e){return T(c.Ed25519,e)},t.parseKeyPair=function(e,r){var n=t.parsePublicKey(e),o=t.parsePrivateKey(r),i=new Uint8Array(n.length+o.length);return i.set(o),i.set(n,o.length),new t({publicKey:n,secretKey:i})},t.parsePrivateKeyFile=function(e){return t.parsePrivateKey(t.readBase64File(e))},t.parsePublicKeyFile=function(e){return t.parsePublicKey(t.readBase64File(e))},t.parsePrivateKey=function(e){return t.parseKey(e,0,32)},t.parsePublicKey=function(e){return t.parseKey(e,32,64)},t.readBase64WithPEM=function(e){return B(e)},t.readBase64File=function(e){var r=p.readFileSync(e).toString();return t.readBase64WithPEM(r)},t.parseKey=function(e,t,r){var n=e.length,o=32===n?e:64===n?Buffer.from(e).slice(t,r):n>32&&n<64?Buffer.from(e).slice(n%32):null;if(null==o||32!==o.length)throw Error("Unexpected key length: "+n);return o},t.prototype.exportPrivateKeyInPem=function(){var e=Buffer.from([48,46,2,1,0,48,5,6,3,43,101,112,4,34,4,32]),r=f.encodeBase64(Buffer.concat([e,Buffer.from(t.parsePrivateKey(this.privateKey))]));return this.toPem("PRIVATE KEY",r)},t.prototype.exportPublicKeyInPem=function(){var e=Buffer.from([48,42,48,5,6,3,43,101,112,3,33,0]),t=f.encodeBase64(Buffer.concat([e,Buffer.from(this.publicKey.value())]));return this.toPem("PUBLIC KEY",t)},t.prototype.sign=function(e){return y.sign_detached(e,this.privateKey)},t.prototype.verify=function(e,t){return y.sign_detached_verify(t,e,this.publicKey.value())},t.privateToPublicKey=function(e){return 64===e.length?y.sign_keyPair_fromSecretKey(e).publicKey:y.sign_keyPair_fromSeed(e).publicKey},t.loadKeyPairFromPrivateFile=function(e){var r=t.parsePrivateKeyFile(e),n=t.privateToPublicKey(r);return t.parseKeyPair(n,r)},t}(w);t.Ed25519=_;var L=function(e){function t(t,r){return e.call(this,t,r,c.Secp256K1)||this}return o(t,e),t.new=function(){var e=g.default.generatePrivate();return new t(Uint8Array.from(g.default.getPublicCompressed(e)),e)},t.parseKeyFiles=function(e,r){var n=t.parsePublicKeyFile(e),o=t.parsePrivateKeyFile(r);return new t(n,o)},t.accountHash=function(e){return T(c.Secp256K1,e)},t.accountHex=function(e){return"02"+f.encodeBase16(e)},t.parseKeyPair=function(e,r,n){var o=t.parsePublicKey(e,n),i=t.parsePrivateKey(r,n);return new t(o,i)},t.parsePrivateKeyFile=function(e){return t.parsePrivateKey(t.readBase64File(e))},t.parsePublicKeyFile=function(e){return t.parsePublicKey(t.readBase64File(e))},t.parsePrivateKey=function(e,t){var r;return void 0===t&&(t="der"),r="der"===t?C.encodePrivate(Buffer.from(e),"der","raw"):f.encodeBase16(e),Buffer.from(r,"hex")},t.parsePublicKey=function(e,t){var r;return void 0===t&&(t="der"),r="der"===t?C.encodePublic(Buffer.from(e),"der","raw"):f.encodeBase16(e),Uint8Array.from(Buffer.from(r,"hex"))},t.readBase64WithPEM=function(e){return B(e)},t.readBase64File=function(e){var r=p.readFileSync(e).toString();return t.readBase64WithPEM(r)},t.prototype.exportPrivateKeyInPem=function(){return C.encodePrivate(f.encodeBase16(this.privateKey),"raw","pem")},t.prototype.exportPublicKeyInPem=function(){return C.encodePublic(f.encodeBase16(this.publicKey.value()),"raw","pem")},t.prototype.sign=function(e){return m.ecdsaSign(b.sha256(Buffer.from(e)),this.privateKey).signature},t.prototype.verify=function(e,t){return m.ecdsaVerify(e,b.sha256(Buffer.from(t)),this.publicKey.value())},t.privateToPublicKey=function(e){return m.publicKeyCreate(e,!0)},t.loadKeyPairFromPrivateFile=function(e){var r=t.parsePrivateKeyFile(e),n=t.privateToPublicKey(r);return t.parseKeyPair(n,r,"raw")},t.deriveIndex=function(e,t){return e.deriveIndex(t)},t}(w);t.Secp256K1=L},6349:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RuntimeArgs=t.NamedArg=void 0;var i=r(7107),a=r(6138),s=r(9486),u=r(4103),c=r(8791),p=function(){function e(e,t){this.name=e,this.value=t}return e.prototype.toBytes=function(){var e=a.toBytesString(this.name),t=s.CLValueParsers.toBytesWithType(this.value);return i.Ok(u.concat([e,t.unwrap()]))},e.fromBytes=function(t){var r=(new s.CLStringBytesParser).fromBytesWithRemainder(t),n=r.result,o=r.remainder,a=n.unwrap();if(!o)return s.resultHelper(i.Err("Missing data for value of named arg"));var u=s.CLValueParsers.fromBytesWithType(o).unwrap();return s.resultHelper(i.Ok(new e(a.value(),u)))},e}();t.NamedArg=p;var y=function(e){return new Map(Array.from(e,(function(e){var t=e[0],r=e[1];return[t,s.CLValueParsers.fromJSON(r).unwrap()]})))},l=function(e){return Array.from(e,(function(e){var t=e[0],r=e[1];return[t,s.CLValueParsers.toJSON(r).unwrap()]}))},f=function(){function e(e){this.args=e}var t;return t=e,e.fromMap=function(e){var r=new Map(Object.keys(e).map((function(t){return[t,e[t]]})));return new t(r)},e.fromNamedArgs=function(e){var r=e.reduce((function(e,t){return e[t.name]=t.value,e}),{});return t.fromMap(r)},e.prototype.insert=function(e,t){this.args.set(e,t)},e.prototype.toBytes=function(){var e=Array.from(this.args.entries()).map((function(e){return new p(e[0],e[1])}));return i.Ok(a.toBytesVector(e))},e.fromBytes=function(e){for(var r=(new s.CLU32BytesParser).fromBytesWithRemainder(e),n=r.result,o=r.remainder,a=n.unwrap().value().toNumber(),u=o,c=[],y=0;y<a;y++){if(!u)return s.resultHelper(i.Err("Error while parsing bytes"));var l=p.fromBytes(u),f=l.result,d=l.remainder;c.push(f.unwrap()),u=d}return s.resultHelper(i.Ok(t.fromNamedArgs(c)),u)},n([c.jsonMapMember(String,s.CLValue,{serializer:l,deserializer:y}),o("design:type",Map)],e.prototype,"args",void 0),t=n([c.jsonObject(),o("design:paramtypes",[Map])],e)}();t.RuntimeArgs=f},165:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Args=t.UInt64Arg=t.PublicKeyArg=t.ByteSequenceArg=t.ByteArrayArg=void 0;var r=function(e){var t=Buffer.alloc(4);return t.writeInt32LE(e,0),t};t.ByteArrayArg=function(e){return Buffer.from(e)},t.ByteSequenceArg=function(e){return Buffer.concat([r(e.length),e].map(Buffer.from))},t.PublicKeyArg=t.ByteArrayArg,t.UInt64Arg=function(e){var t=Buffer.alloc(8);return t.writeBigUInt64LE(e,0),t},t.Args=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var o=[r(e.length)].concat(e.map(t.ByteSequenceArg));return Buffer.concat(o.map(Buffer.from))}},7801:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.verifyMessageSignature=t.signFormattedMessage=t.signRawMessage=t.formatMessageWithHeaders=void 0;var a=i(r(3786)),s=i(r(4410)),u=r(604);t.formatMessageWithHeaders=function(e){return Uint8Array.from(Buffer.from("Casper Message:\n"+e))},t.signRawMessage=function(e,r){return e.sign(t.formatMessageWithHeaders(r))},t.signFormattedMessage=function(e,t){return e.sign(t)},t.verifyMessageSignature=function(e,r,n){var o=t.formatMessageWithHeaders(r);if(e.isEd25519())return a.sign_detached_verify(o,n,e.value());if(e.isSecp256K1())return s.ecdsaVerify(n,u.sha256(Buffer.from(o)),e.value());throw new Error("Unsupported algorithm.")}},2896:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.signTestDeploy=t.getToSignMessageID=t.createTestAccount=t.createNewVault=t.resetExistingVault=t.hasCreatedVault=t.forceDisconnect=t.forceConnection=t.disconnectFromSite=t.signMessage=t.sign=t.getActivePublicKey=t.getSelectedPublicKeyBase64=t.sendConnectionRequest=t.isConnected=t.getVersion=void 0;var o=function(){return!(void 0===window.casperlabsHelper)};t.getVersion=function(){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:if(!o())return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,window.casperlabsHelper.getVersion()];case 2:return[2,e.sent()];case 3:return e.sent(),[2,"<1.0.0"];case 4:return[2,Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))]}}))}))},t.isConnected=function(){return r(void 0,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return o()?[4,window.casperlabsHelper.isConnected()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))]}}))}))},t.sendConnectionRequest=function(){if(o())return window.casperlabsHelper.requestConnection();throw new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again.")},t.getSelectedPublicKeyBase64=function(){if(o())return window.casperlabsHelper.getSelectedPublicKeyBase64();throw new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again.")},t.getActivePublicKey=function(){return o()?window.casperlabsHelper.getActivePublicKey():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.sign=function(e,t,r){return o()?window.casperlabsHelper.sign(e,t,r):Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.signMessage=function(e,t){return o()?window.casperlabsHelper.signMessage(e,t):Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.disconnectFromSite=function(){return o()?window.casperlabsHelper.disconnectFromSite():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.forceConnection=function(){return o()?window.signerTestingHelper.forceConnection():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.forceDisconnect=function(){return o()?window.signerTestingHelper.forceDisconnect():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.hasCreatedVault=function(){return o()?window.signerTestingHelper.hasCreatedVault():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.resetExistingVault=function(){return o()?window.signerTestingHelper.resetExistingVault():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.createNewVault=function(e){return o()?window.signerTestingHelper.createNewVault(e):Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.createTestAccount=function(e,t){return o()?window.signerTestingHelper.createTestAccount(e,t):Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.getToSignMessageID=function(){return o()?window.signerTestingHelper.getToSignMessageID():Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))},t.signTestDeploy=function(e){return o()?window.signerTestingHelper.signTestDeploy(e):Promise.reject(new Error("Content script not found - make sure you have the Signer installed and refresh the page before trying again."))}},5778:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StoredValue=t.ContractPackageJson=t.GroupsJson=t.DisabledVersionJson=t.ContractVersionJson=t.ContractMetadataJson=t.EntryPoint=t.NamedCLTypeArg=t.EraInfoJson=t.SeigniorageAllocation=t.DeployInfoJson=t.Transfers=t.TransferJson=void 0;var i=r(8791),a=r(9486),s=function(){function e(){}return n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([i.jsonObject],e)}(),u=function(){function e(){}return n([i.jsonMember({name:"account_hash",constructor:String}),o("design:type",String)],e.prototype,"accountHash",void 0),n([i.jsonMember({constructor:Number}),o("design:type",Number)],e.prototype,"weight",void 0),n([i.jsonObject],e)}(),c=function(){function e(){}return n([i.jsonMember({constructor:Number}),o("design:type",Number)],e.prototype,"deployment",void 0),n([i.jsonMember({name:"key_management",constructor:Number}),o("design:type",Number)],e.prototype,"keyManagement",void 0),n([i.jsonObject],e)}(),p=function(){function e(){}return e.prototype.accountHash=function(){return this._accountHash},n([i.jsonMember({name:"account_hash",constructor:String}),o("design:type",String)],e.prototype,"_accountHash",void 0),n([i.jsonArrayMember(s,{name:"named_keys"}),o("design:type",Array)],e.prototype,"namedKeys",void 0),n([i.jsonMember({name:"main_purse",constructor:String}),o("design:type",String)],e.prototype,"mainPurse",void 0),n([i.jsonArrayMember(u,{name:"associated_keys"}),o("design:type",Array)],e.prototype,"associatedKeys",void 0),n([i.jsonMember({name:"action_thresholds",constructor:c}),o("design:type",c)],e.prototype,"actionThresholds",void 0),n([i.jsonObject],e)}(),y=function(){function e(){}return n([i.jsonMember({name:"deploy_hash",constructor:String}),o("design:type",String)],e.prototype,"deployHash",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"from",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"source",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"target",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"amount",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"gas",void 0),n([i.jsonMember({constructor:Number,preserveNull:!0}),o("design:type",Object)],e.prototype,"id",void 0),n([i.jsonObject],e)}();t.TransferJson=y;var l=function(){function e(){}return n([i.jsonArrayMember(y),o("design:type",Array)],e.prototype,"transfers",void 0),n([i.jsonObject],e)}();t.Transfers=l;var f=function(){function e(){}return n([i.jsonMember({name:"deploy_hash",constructor:String}),o("design:type",String)],e.prototype,"deployHash",void 0),n([i.jsonArrayMember(String),o("design:type",Array)],e.prototype,"transfers",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"from",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"source",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"gas",void 0),n([i.jsonObject],e)}();t.DeployInfoJson=f;var d=function(){function e(){}return n([i.jsonMember({name:"validator_public_key",constructor:String}),o("design:type",String)],e.prototype,"validatorPublicKey",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"amount",void 0),n([i.jsonObject],e)}(),h=function(){function e(){}return n([i.jsonMember({name:"delegator_public_key",constructor:String}),o("design:type",String)],e.prototype,"delegatorPublicKey",void 0),n([i.jsonMember({name:"validator_public_key",constructor:String}),o("design:type",String)],e.prototype,"validatorPublicKey",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"amount",void 0),n([i.jsonObject],e)}(),g=function(){function e(){}return n([i.jsonMember({constructor:d}),o("design:type",d)],e.prototype,"Validator",void 0),n([i.jsonMember({constructor:h}),o("design:type",h)],e.prototype,"Delegator",void 0),n([i.jsonObject],e)}();t.SeigniorageAllocation=g;var m=function(){function e(){}return n([i.jsonArrayMember(g,{name:"seigniorage_allocations"}),o("design:type",Array)],e.prototype,"seigniorageAllocations",void 0),n([i.jsonObject],e)}();t.EraInfoJson=m;var v=function(){function e(){}return n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([i.jsonMember({name:"cl_type",deserializer:function(e){return a.matchTypeToCLType(e)}}),o("design:type",a.CLType)],e.prototype,"clType",void 0),n([i.jsonObject],e)}();t.NamedCLTypeArg=v;var b=function(){function e(){}return n([i.jsonMember({name:"access",deserializer:function(e){return"string"==typeof e?e:null}}),o("design:type",String)],e.prototype,"access",void 0),n([i.jsonMember({name:"entry_point_type",constructor:String}),o("design:type",String)],e.prototype,"entryPointType",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"name",void 0),n([i.jsonMember({name:"ret",deserializer:function(e){return a.matchTypeToCLType(e)}}),o("design:type",String)],e.prototype,"ret",void 0),n([i.jsonArrayMember(v),o("design:type",Array)],e.prototype,"args",void 0),n([i.jsonObject],e)}();t.EntryPoint=b;var C=function(){function e(){}return n([i.jsonMember({name:"contract_package_hash",constructor:String}),o("design:type",String)],e.prototype,"contractPackageHash",void 0),n([i.jsonMember({name:"contract_wasm_hash",constructor:String}),o("design:type",String)],e.prototype,"contractWasmHash",void 0),n([i.jsonArrayMember(b,{name:"entry_points"}),o("design:type",Array)],e.prototype,"entrypoints",void 0),n([i.jsonMember({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([i.jsonArrayMember(s,{name:"named_keys"}),o("design:type",Array)],e.prototype,"namedKeys",void 0),n([i.jsonObject],e)}();t.ContractMetadataJson=C;var T=function(){function e(){}return n([i.jsonMember({name:"protocol_version_major",constructor:Number}),o("design:type",Number)],e.prototype,"protocolVersionMajor",void 0),n([i.jsonMember({name:"contract_version",constructor:Number}),o("design:type",Number)],e.prototype,"contractVersion",void 0),n([i.jsonMember({name:"contract_hash",constructor:String}),o("design:type",String)],e.prototype,"contractHash",void 0),n([i.jsonObject],e)}();t.ContractVersionJson=T;var B=function(){function e(){}return n([i.jsonMember({name:"protocol_version_major",constructor:Number}),o("design:type",Number)],e.prototype,"accessKey",void 0),n([i.jsonMember({name:"contract_version",constructor:Number}),o("design:type",Number)],e.prototype,"contractVersion",void 0),n([i.jsonObject],e)}();t.DisabledVersionJson=B;var w=function(){function e(){}return n([i.jsonMember({name:"group",constructor:String}),o("design:type",String)],e.prototype,"group",void 0),n([i.jsonMember({name:"keys",constructor:String}),o("design:type",String)],e.prototype,"keys",void 0),n([i.jsonObject],e)}();t.GroupsJson=w;var _=function(){function e(){}return n([i.jsonMember({name:"access_key",constructor:String}),o("design:type",String)],e.prototype,"accessKey",void 0),n([i.jsonArrayMember(T,{name:"versions"}),o("design:type",Array)],e.prototype,"versions",void 0),n([i.jsonArrayMember(B,{name:"disabled_versions"}),o("design:type",Array)],e.prototype,"disabledVersions",void 0),n([i.jsonArrayMember(w,{name:"groups"}),o("design:type",Array)],e.prototype,"groups",void 0),n([i.jsonObject],e)}();t.ContractPackageJson=_;var L=function(){function e(){}return n([i.jsonMember({name:"CLValue",deserializer:function(e){if(e)return a.CLValueParsers.fromJSON(e).unwrap()}}),o("design:type",a.CLValue)],e.prototype,"CLValue",void 0),n([i.jsonMember({constructor:p}),o("design:type",p)],e.prototype,"Account",void 0),n([i.jsonMember({constructor:String}),o("design:type",String)],e.prototype,"ContractWASM",void 0),n([i.jsonMember({constructor:C}),o("design:type",C)],e.prototype,"Contract",void 0),n([i.jsonMember({constructor:_}),o("design:type",_)],e.prototype,"ContractPackage",void 0),n([i.jsonMember({constructor:y}),o("design:type",y)],e.prototype,"Transfer",void 0),n([i.jsonMember({constructor:f}),o("design:type",f)],e.prototype,"DeployInfo",void 0),n([i.jsonMember({constructor:m}),o("design:type",m)],e.prototype,"EraInfo",void 0),n([i.jsonObject],e)}();t.StoredValue=L},3915:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return o(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.DeployUtil=t.Serialization=t.Keys=t.Contracts=void 0;var s=i(r(3492));t.Contracts=s;var u=i(r(4922));t.DeployUtil=u;var c=i(r(2964));t.Keys=c;var p=i(r(165));t.Serialization=p;var y=i(r(2896));t.Signer=y,a(r(9486),t),a(r(6349),t),a(r(3368),t),a(r(7801),t)},8132:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.BalanceServiceByJsonRPC=void 0;var o=function(){function e(e){this.casperService=e,this.balanceUrefs=new Map}return e.prototype.getAccountBalance=function(e,t){return r(this,void 0,void 0,(function(){var r,o;return n(this,(function(n){switch(n.label){case 0:return n.trys.push([0,5,,6]),[4,this.casperService.getStateRootHash(e)];case 1:return r=n.sent(),(o=this.balanceUrefs.get(t.toHex()))?[3,3]:[4,this.casperService.getAccountBalanceUrefByPublicKey(r,t)];case 2:(o=n.sent())&&this.balanceUrefs.set(t.toHex(),o),n.label=3;case 3:return o?[4,this.casperService.getAccountBalance(r,o)]:[2,void 0];case 4:return[2,n.sent()];case 5:return n.sent(),[2,void 0];case 6:return[2]}}))}))},e}();t.BalanceServiceByJsonRPC=o},9693:function(e,t,r){var n=this&&this.__decorate||function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CasperServiceByJsonRPC=t.EraSummary=void 0;var u=r(7476),c=r(8791),p=r(3607),y=r(4922),l=r(5778),f=r(1446),d=s(r(1302)),h=function(){function e(){}return n([c.jsonMember({constructor:String,name:"block_hash"}),o("design:type",String)],e.prototype,"blockHash",void 0),n([c.jsonMember({constructor:Number,name:"era_id"}),o("design:type",Number)],e.prototype,"eraId",void 0),n([c.jsonMember({constructor:l.StoredValue,name:"stored_value"}),o("design:type",l.StoredValue)],e.prototype,"StoredValue",void 0),n([c.jsonMember({constructor:String,name:"state_root_hash"}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([c.jsonObject],e)}();t.EraSummary=h;var g=function(){function e(e){var t;t="string"==typeof e?new u.HTTPTransport(e):new d.default(e);var r=new u.RequestManager([t]);this.client=new u.Client(r)}return e.prototype.getDeployInfo=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.client.request({method:"info_get_deploy",params:{deploy_hash:e}})];case 1:return[2,t.sent()]}}))}))},e.prototype.getBlockInfo=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.client.request({method:"chain_get_block",params:{block_identifier:{Hash:e}}}).then((function(t){if(null!==t.block&&t.block.hash.toLowerCase()!==e.toLowerCase())throw new Error("Returned block does not have a matching hash.");return t}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBlockInfoByHeight=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.client.request({method:"chain_get_block",params:{block_identifier:{Height:e}}}).then((function(t){if(null!==t.block&&t.block.header.height!==e)throw new Error("Returned block does not have a matching height.");return t}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getLatestBlockInfo=function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.client.request({method:"chain_get_block"})];case 1:return[2,e.sent()]}}))}))},e.prototype.getPeers=function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.client.request({method:"info_get_peers"})];case 1:return[2,e.sent()]}}))}))},e.prototype.getStatus=function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.client.request({method:"info_get_status"})];case 1:return[2,e.sent()]}}))}))},e.prototype.getValidatorsInfo=function(){return i(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,this.client.request({method:"state_get_auction_info"})];case 1:return[2,e.sent()]}}))}))},e.prototype.getAccountBalanceUrefByPublicKeyHash=function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this.getBlockState(e,"account-hash-"+t,[]).then((function(e){return e.Account}))];case 1:return[2,r.sent().mainPurse]}}))}))},e.prototype.getAccountBalanceUrefByPublicKey=function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){return[2,this.getAccountBalanceUrefByPublicKeyHash(e,p.encodeBase16(t.toAccountHash()))]}))}))},e.prototype.getAccountBalance=function(e,t){return i(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return[4,this.client.request({method:"state_get_balance",params:{state_root_hash:e,purse_uref:t}}).then((function(e){return f.BigNumber.from(e.balance_value)}))];case 1:return[2,r.sent()]}}))}))},e.prototype.getStateRootHash=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.client.request({method:"chain_get_state_root_hash",params:{block_hash:e}}).then((function(e){return e.state_root_hash}))];case 1:return[2,t.sent()]}}))}))},e.prototype.getBlockState=function(e,t,r){return i(this,void 0,void 0,(function(){var n,o;return a(this,(function(i){switch(i.label){case 0:return[4,this.client.request({method:"state_get_item",params:{state_root_hash:e,key:t,path:r}})];case 1:return(n=i.sent()).error?[2,n]:(o=n.stored_value,[2,new c.TypedJSON(l.StoredValue).parse(o)])}}))}))},e.prototype.deploy=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:if((t=p.DeployUtil.deploySizeInBytes(e))>1048576)throw Error("Deploy can not be send, because it's too large: "+t+" bytes. Max size is 1 megabyte.");return[4,this.client.request({method:"account_put_deploy",params:y.deployToJson(e)})];case 1:return[2,r.sent()]}}))}))},e.prototype.getBlockTransfers=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,this.client.request({method:"chain_get_block_transfers",params:{block_identifier:e?{Hash:e}:null}})];case 1:return(t=r.sent()).error?[2,t]:[2,new c.TypedJSON(l.Transfers).parse(t)]}}))}))},e.prototype.getEraInfoBySwitchBlock=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,this.client.request({method:"chain_get_era_info_by_switch_block",params:{block_identifier:e?{Hash:e}:null}})];case 1:return(t=r.sent()).error?[2,t]:[2,new c.TypedJSON(h).parse(t.era_summary)]}}))}))},e.prototype.getEraInfoBySwitchBlockHeight=function(e){return i(this,void 0,void 0,(function(){var t;return a(this,(function(r){switch(r.label){case 0:return[4,this.client.request({method:"chain_get_era_info_by_switch_block",params:{block_identifier:{Height:e}}})];case 1:return(t=r.sent()).error?[2,t]:[2,new c.TypedJSON(h).parse(t.era_summary)]}}))}))},e.prototype.getDictionaryItemByURef=function(e,t,r){return i(this,void 0,void 0,(function(){var n,o;return a(this,(function(i){switch(i.label){case 0:return[4,this.client.request({method:"state_get_dictionary_item",params:{state_root_hash:e,dictionary_identifier:{URef:{seed_uref:r,dictionary_item_key:t}}}})];case 1:return(n=i.sent()).error?[2,n]:(o=n.stored_value,[2,new c.TypedJSON(l.StoredValue).parse(o)])}}))}))},e}();t.CasperServiceByJsonRPC=g},4453:function(e,t,r){var n=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.parseEvent=t.EventStream=t.EventName=t.DeployWatcher=void 0;var i,a=r(7107),s=o(r(8605));!function(e){e[e.NotAnEvent=0]="NotAnEvent",e[e.EarlyEndOfStream=1]="EarlyEndOfStream",e[e.MissingDataHeader=2]="MissingDataHeader",e[e.MissingDataHeaderAndId=3]="MissingDataHeaderAndId",e[e.MissingId=4]="MissingId"}(i||(i={}));var u,c=function(){function e(e){this.eventStreamUrl=e,this.watchList=[],this.es=new p(e)}return e.prototype.subscribe=function(e){this.watchList=n(this.watchList,e)},e.prototype.unsubscribe=function(e){this.watchList=this.watchList.filter((function(t){return t.deployHash!==e}))},e.prototype.start=function(){var e=this;this.es.subscribe(u.DeployProcessed,(function(t){var r=t.body.DeployProcessed.deploy_hash,n=e.watchList.find((function(e){return e.deployHash===r}));n&&(n.eventHandlerFn(t),e.unsubscribe(r))})),this.es.start()},e.prototype.stop=function(){this.es.stop()},e}();t.DeployWatcher=c,function(e){e.BlockAdded="BlockAdded",e.BlockFinalized="BlockFinalized",e.FinalitySignature="FinalitySignature",e.Fault="Fault",e.DeployProcessed="DeployProcessed"}(u=t.EventName||(t.EventName={}));var p=function(){function e(e){this.eventStreamUrl=e,this.subscribedTo=[],this.pendingDeploysParts=[],this.pendingDeployString=""}return e.prototype.subscribe=function(e,t){return this.subscribedTo.some((function(t){return t.eventName===e}))?a.Err("Already subscribed to this event"):(this.subscribedTo.push({eventName:e,eventHandlerFn:t}),a.Ok(!0))},e.prototype.unsubscribe=function(e){return this.subscribedTo.some((function(t){return t.eventName===e}))?(this.subscribedTo=this.subscribedTo.filter((function(t){return t.eventName!==e})),a.Ok(!0)):a.Err("Cannot find provided subscription")},e.prototype.runEventsLoop=function(e){this.subscribedTo.forEach((function(t){e.body&&e.body.hasOwnProperty(t.eventName)&&t.eventHandlerFn(e)}))},e.prototype.start=function(e){var r=this;void 0===e&&(e=0),s.default.get(this.eventStreamUrl+"?start_from="+e,(function(e){r.stream=e,r.stream.on("data",(function(e){var n=t.parseEvent(Buffer.from(e).toString());if(n&&!n.err&&r.runEventsLoop(n),n.err===i.EarlyEndOfStream&&(r.pendingDeployString=n.body),n.err===i.MissingDataHeaderAndId&&(r.pendingDeployString+=n.body),n.err===i.MissingDataHeader){r.pendingDeployString+=n.body,r.pendingDeployString+="\nid:"+n.id;var o=t.parseEvent(r.pendingDeployString);null===o.err&&(r.pendingDeployString=""),r.runEventsLoop(o)}}))}))},e.prototype.stop=function(){this.stream.destroy()},e}();t.EventStream=p,t.parseEvent=function(e){if(!e.startsWith("data"))return n=(t=e.split("\n"))[0],r=t[1]&&t[1].startsWith("id:")?t[1].substr(3):null,":"===t[0]&&""===t[1]&&""===t[2]?{id:null,body:null,err:i.NotAnEvent}:r?{id:r,body:n,err:i.MissingDataHeader}:{id:null,body:n,err:i.MissingDataHeaderAndId};var t,r=(t=e.split("\n"))[1]&&t[1].startsWith("id:")?t[1].substr(3):null;try{var n=JSON.parse(t[0].substr(5));return r?{id:r,body:n,err:null}:{id:r,body:n,err:i.MissingId}}catch(e){return{id:r,body:n=t[0],err:i.EarlyEndOfStream}}}},1302:function(e,t,r){var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var s=r(5780),u=r(7368),c=r(9758),p=function(e){function t(t){var r=e.call(this)||this;return r.onlyNotifications=function(e){return e instanceof Array?e.every((function(e){return null===e.request.request.id||void 0===e.request.request.id})):null===e.request.id||void 0===e.request.id},r.provider=t,r}return o(t,e),t.prototype.connect=function(){return Promise.resolve()},t.prototype.sendData=function(e,t){return void 0===t&&(t=null),i(this,void 0,void 0,(function(){var r,n,o,i,s,p,y;return a(this,(function(a){switch(a.label){case 0:r=this.transportRequestManager.addRequest(e,t),n=u.getNotifications(e),o=u.getBatchRequests(e),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.provider.sendAsync(e.request)];case 2:return i=a.sent(),s={id:e.request.id,jsonrpc:e.request.jsonrpc,result:i,error:null},this.transportRequestManager.settlePendingRequest(n),this.onlyNotifications(e)?[2,Promise.resolve()]:(y=this.transportRequestManager.resolveResponse(JSON.stringify(s)))?(this.transportRequestManager.settlePendingRequest(o,y),[2,Promise.reject(y)]):[3,4];case 3:return p=a.sent(),y=new c.JSONRPCError(p.message,c.ERR_UNKNOWN,p),this.transportRequestManager.settlePendingRequest(n,y),this.transportRequestManager.settlePendingRequest(u.getBatchRequests(e),y),[2,Promise.reject(y)];case 4:return[2,r]}}))}))},t.prototype.close=function(){},t}(s.Transport);t.default=p},1999:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(9693),t),o(r(8132),t),o(r(4453),t)},1446:e=>{e.exports=require("@ethersproject/bignumber")},4103:e=>{e.exports=require("@ethersproject/bytes")},6148:e=>{e.exports=require("@ethersproject/constants")},7476:e=>{e.exports=require("@open-rpc/client-js")},9758:e=>{e.exports=require("@open-rpc/client-js/build/Error")},7368:e=>{e.exports=require("@open-rpc/client-js/build/Request")},5780:e=>{e.exports=require("@open-rpc/client-js/build/transports/Transport")},3779:e=>{e.exports=require("blakejs")},5986:e=>{e.exports=require("eccrypto")},8:e=>{e.exports=require("ethereum-cryptography/hdkey")},4410:e=>{e.exports=require("ethereum-cryptography/secp256k1")},604:e=>{e.exports=require("ethereum-cryptography/sha256")},5747:e=>{e.exports=require("fs")},8605:e=>{e.exports=require("http")},1953:e=>{e.exports=require("humanize-duration")},282:e=>{e.exports=require("key-encoder")},7107:e=>{e.exports=require("ts-results")},3786:e=>{e.exports=require("tweetnacl-ts")},1718:e=>{e.exports=require("tweetnacl-util")},8791:e=>{e.exports=require("typedjson")}},t={},r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(3607);module.exports=r})();Выполнить команду
Для локальной разработки. Не используйте в интернете!