UNPKG

casper-js-sdk

Version:
1 lines 487 kB
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(global,(()=>(()=>{"use strict";var e={872:(e,t)=>{var r,n,o;Object.defineProperty(t,"__esModule",{value:!0}),t.NFTTokenStandard=t.AuctionManagerEntryPoint=t.CasperNetworkName=void 0,(o=t.CasperNetworkName||(t.CasperNetworkName={})).Mainnet="casper",o.Testnet="casper-test",o.Integration="integration-test",o.DevNet="dev-net",(n=t.AuctionManagerEntryPoint||(t.AuctionManagerEntryPoint={})).delegate="delegate",n.undelegate="undelegate",n.redelegate="redelegate",n.addBid="add_bid",n.withdrawBid="withdraw_bid",n.activateBid="activate_bid",(r=t.NFTTokenStandard||(t.NFTTokenStandard={})).CEP47="CEP47",r.CEP78="CEP78",r.CEP95="CEP95"},471:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorCode=void 0,(r=t.ErrorCode||(t.ErrorCode={}))[r.NoSuchDeploy=-32e3]="NoSuchDeploy",r[r.NoSuchBlock=-32001]="NoSuchBlock",r[r.FailedToParseQueryKey=-32002]="FailedToParseQueryKey",r[r.QueryFailed=-32003]="QueryFailed",r[r.QueryFailedToExecute=-32004]="QueryFailedToExecute",r[r.FailedToParseGetBalanceURef=-32005]="FailedToParseGetBalanceURef",r[r.FailedToGetBalance=-32006]="FailedToGetBalance",r[r.GetBalanceFailedToExecute=-32007]="GetBalanceFailedToExecute",r[r.InvalidDeploy=-32008]="InvalidDeploy",r[r.NoSuchAccount=-32009]="NoSuchAccount",r[r.FailedToGetDictionaryURef=-32010]="FailedToGetDictionaryURef",r[r.FailedToGetTrie=-32011]="FailedToGetTrie",r[r.NoSuchStateRoot=-32012]="NoSuchStateRoot",r[r.NoMainPurse=-32013]="NoMainPurse",r[r.NoSuchTransaction=-32014]="NoSuchTransaction",r[r.VariantMismatch=-32015]="VariantMismatch",r[r.InvalidTransaction=-32016]="InvalidTransaction",r[r.InvalidBlock=-32017]="InvalidBlock",r[r.NodeRequestFailed=-32018]="NodeRequestFailed",r[r.FunctionIsDisabled=-32019]="FunctionIsDisabled",r[r.NoSuchAddressableEntity=-32020]="NoSuchAddressableEntity",r[r.AccountMigratedToEntity=-32021]="AccountMigratedToEntity",r[r.NoRewardsFound=-32022]="NoRewardsFound",r[r.SwitchBlockNotFound=-32023]="SwitchBlockNotFound",r[r.SwitchBlockParentNotFound=-32024]="SwitchBlockParentNotFound",r[r.UnsupportedRewardsV1Request=-32025]="UnsupportedRewardsV1Request",r[r.PurseNotFound=-32026]="PurseNotFound"},7909:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(872),t),o(r(471),t)},887:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(7545),t),o(r(8855),t),o(r(7941),t),o(r(8389),t),o(r(7909),t)},848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},7021: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)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");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)};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpError=t.RpcError=void 0;var s=r(2294),c=function(e){function t(t,r,n){void 0===t&&(t=0),void 0===r&&(r="");var o=e.call(this,r)||this;return o.code=t,o.data=n,o}return o(t,e),t.prototype.toString=function(){return"key: ".concat(this.message,", data: ").concat(JSON.stringify(this.data))},i([(0,s.jsonMember)({constructor:Number}),a("design:type",Number)],t.prototype,"code",void 0),i([(0,s.jsonMember)({isRequired:!1,constructor:s.AnyT}),a("design:type",Object)],t.prototype,"data",void 0),i([s.jsonObject,a("design:paramtypes",[Object,Object,Object])],t)}(Error);t.RpcError=c;var u=function(e){function t(t,r){void 0===t&&(t=0);var n=e.call(this,"Code: ".concat(t,", err: ").concat(r.message))||this;return n.sourceErr=r,n.statusCode=t,n}return o(t,e),t.prototype.unwrap=function(){return this.sourceErr},t.prototype.isNotFound=function(){return 404===this.statusCode},t.isHttpError=function(e){return Boolean((null==e?void 0:e.statusCode)&&(null==e?void 0:e.sourceErr))},i([(0,s.jsonMember)({constructor:Error}),a("design:type",Object)],t.prototype,"sourceErr",void 0),i([(0,s.jsonMember)({constructor:Number}),a("design:type",Number)],t.prototype,"statusCode",void 0),i([s.jsonObject,a("design:paramtypes",[Object,Object])],t)}(Error);t.HttpError=u},440:function(e,t,r){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},i=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(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HttpHandler=t.ErrRpcResponseUnmarshal=t.ErrReadHttpResponseBody=t.ErrProcessHttpRequest=t.ErrParamsJsonStringifyHandler=void 0;var s=r(2294),c=a(r(8938)),u=r(7021),d=r(7790);t.ErrParamsJsonStringifyHandler=new Error("failed to stringify json rpc request's params"),t.ErrProcessHttpRequest=new Error("failed to send http request"),t.ErrReadHttpResponseBody=new Error("failed to read http response body"),t.ErrRpcResponseUnmarshal=new Error("failed to unmarshal rpc response");var l=function(){function e(e,t){void 0===t&&(t="axios"),this.customHeaders={},this.endpoint=e,this.client=t,"axios"===t&&(this.httpClient=c.default.create())}return e.prototype.setCustomHeaders=function(e){this.customHeaders=e},e.prototype.setReferrer=function(e){this.referrer=e},e.prototype.processCall=function(e){return o(this,void 0,void 0,(function(){var r,n;return i(this,(function(o){r=new s.TypedJSON(d.RpcRequest);try{n=r.stringify(e)}catch(e){throw new Error("".concat(t.ErrParamsJsonStringifyHandler.message,", details: ").concat(e.message))}return"axios"===this.client?[2,this.processAxiosRequest(n)]:[2,this.processFetchRequest(n)]}))}))},e.prototype.processAxiosRequest=function(e){return o(this,void 0,void 0,(function(){var r,o,a;return i(this,(function(i){switch(i.label){case 0:r={method:"POST",url:this.endpoint,headers:n({"Content-Type":"application/json"},this.customHeaders),data:e},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.httpClient.request(r)];case 2:if((o=i.sent()).status<200||o.status>=300)throw new u.HttpError(o.status,new Error(o.statusText));return[2,o.data];case 3:if(a=i.sent(),c.default.isAxiosError(a)&&a.response)throw new u.HttpError(a.response.status,new Error(a.response.statusText));throw new Error("".concat(t.ErrProcessHttpRequest.message,", details: ").concat(a.message));case 4:return[2]}}))}))},e.prototype.processFetchRequest=function(e){return o(this,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(this.endpoint,n(n({method:"POST"},this.referrer?{referrer:this.referrer}:{}),{headers:n({"Content-Type":"application/json"},this.customHeaders),body:e}))];case 1:if((r=i.sent()).status<200||r.status>=300)throw new u.HttpError(r.status,new Error(r.statusText));return[2,r.json()];case 2:throw o=i.sent(),new Error("".concat(t.ErrProcessHttpRequest.message,", details: ").concat(o.message));case 3:return[2]}}))}))},e}();t.HttpHandler=l},8608: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.IDValue=void 0;var i=r(2294),a=function(){function e(e){this.intValue=null,this.strValue=null,"number"==typeof e?(this.intValue=e,this.isIntValue=!0):(this.strValue=e,this.isIntValue=!1)}var t;return t=e,e.fromString=function(e){return new t(e)},e.fromInt=function(e){return new t(e)},e.prototype.toString=function(){return this.isIntValue&&null!==this.intValue?this.intValue.toString():this.strValue||""},e.prototype.toInt=function(){if(this.isIntValue&&null!==this.intValue)return this.intValue;var e=parseInt(this.strValue||"0",10);return isNaN(e)?0:e},e.prototype.toJSON=function(){return this.toString()},e.fromJSON=function(e){if("number"==typeof e)return t.fromInt(e);if("string"==typeof e)return t.fromString(e);throw new Error("IDValue should be an int or string")},n([(0,i.jsonMember)({constructor:Number,isRequired:!1,preserveNull:!0}),o("design:type",Object)],e.prototype,"intValue",void 0),n([(0,i.jsonMember)({constructor:String,isRequired:!1,preserveNull:!0}),o("design:type",Object)],e.prototype,"strValue",void 0),n([(0,i.jsonMember)({constructor:Boolean}),o("design:type",Boolean)],e.prototype,"isIntValue",void 0),t=n([i.jsonObject,o("design:paramtypes",[Object])],e)}();t.IDValue=a},8855:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(848),t),o(r(7021),t),o(r(440),t),o(r(8608),t),o(r(7790),t),o(r(1412),t),o(r(4176),t),o(r(5060),t)},7790: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.StateGetDictionaryRequest=t.StateGetBalanceRequest=t.InfoGetRewardRequest=t.QueryBalanceDetailsRequest=t.QueryBalanceRequest=t.PurseIdentifier=t.SpeculativeExecParams=t.ParamDictionaryIdentifier=t.ParamDictionaryIdentifierContractNamedKey=t.AccountNamedKey=t.ParamDictionaryIdentifierURef=t.EraIdentifier=t.GlobalStateIdentifier=t.PutTransactionRequest=t.PutDeployRequest=t.AccountIdentifier=t.ParamGetStateEntity=t.EntityIdentifier=t.ParamGetAccountInfoBalance=t.ParamBlockIdentifier=t.ParamDeployHash=t.ParamTransactionHash=t.ParamQueryGlobalState=t.ParamQueryGlobalStateID=t.BlockIdentifier=t.ParamStateRootHash=t.RpcRequest=t.Method=t.ApiVersion=void 0;var i,a=r(2294),s=r(8608),c=r(7545);t.ApiVersion="2.0",(i=t.Method||(t.Method={})).GetDeploy="info_get_deploy",i.GetTransaction="info_get_transaction",i.GetStateItem="state_get_item",i.QueryGlobalState="query_global_state",i.GetDictionaryItem="state_get_dictionary_item",i.GetStateBalance="state_get_balance",i.GetStateAccount="state_get_account_info",i.GetStateEntity="state_get_entity",i.GetEraInfo="chain_get_era_info_by_switch_block",i.GetBlock="chain_get_block",i.GetBlockTransfers="chain_get_block_transfers",i.GetEraSummary="chain_get_era_summary",i.GetAuctionInfo="state_get_auction_info",i.GetAuctionInfoV2="state_get_auction_info_v2",i.GetValidatorChanges="info_get_validator_changes",i.GetStateRootHash="chain_get_state_root_hash",i.GetStatus="info_get_status",i.GetReward="info_get_reward",i.GetPeers="info_get_peers",i.PutDeploy="account_put_deploy",i.PutTransaction="account_put_transaction",i.SpeculativeExec="speculative_exec",i.QueryBalance="query_balance",i.QueryBalanceDetails="query_balance_details",i.InfoGetChainspec="info_get_chainspec";var u=function(){function e(e,t,r,n){this.version=e,this.method=t,this.params=r,this.id=n}var r;return r=e,e.defaultRpcRequest=function(e,n){return new r(t.ApiVersion,e,n,s.IDValue.fromString("1"))},n([(0,a.jsonMember)({constructor:String,name:"jsonrpc"}),o("design:type",String)],e.prototype,"version",void 0),n([(0,a.jsonMember)({constructor:s.IDValue,isRequired:!1,deserializer:function(e){return s.IDValue.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",s.IDValue)],e.prototype,"id",void 0),n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"method",void 0),n([(0,a.jsonMember)({constructor:a.AnyT}),o("design:type",Object)],e.prototype,"params",void 0),r=n([a.jsonObject,o("design:paramtypes",[String,String,Object,s.IDValue])],e)}();t.RpcRequest=u;var d=function(){function e(e,t,r){this.stateRootHash=e,this.key=t,this.path=r}return n([(0,a.jsonMember)({constructor:String,name:"state_root_hash"}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonArrayMember)(String),o("design:type",Array)],e.prototype,"path",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,Array])],e)}();t.ParamStateRootHash=d;var l=function(){function e(e,t){this.hash=e,this.height=t}return n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"Hash"}),o("design:type",String)],e.prototype,"hash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"Height"}),o("design:type",Number)],e.prototype,"height",void 0),n([a.jsonObject,o("design:paramtypes",[String,Number])],e)}();t.BlockIdentifier=l;var p=function(){function e(e,t,r){this.stateRootHash=e,this.blockHash=t,this.blockHeight=r}return n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"StateRootHash"}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"BlockHash"}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"BlockHeight"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,Number])],e)}();t.ParamQueryGlobalStateID=p;var y=function(){function e(e,t,r){this.stateIdentifier=e,this.key=t,this.path=r}var t;return t=e,e.newQueryGlobalStateParam=function(e,r,n){return new t(n,e,r)},n([(0,a.jsonMember)({isRequired:!1,constructor:p,name:"state_identifier"}),o("design:type",p)],e.prototype,"stateIdentifier",void 0),n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonArrayMember)(String),o("design:type",Array)],e.prototype,"path",void 0),t=n([a.jsonObject,o("design:paramtypes",[Object,String,Array])],e)}();t.ParamQueryGlobalState=y;var f=function(){function e(e,t){this.transactionHash=e,this.finalizedApprovals=t}return n([(0,a.jsonMember)({constructor:c.TransactionHash,isRequired:!1,name:"transaction_hash"}),o("design:type",c.TransactionHash)],e.prototype,"transactionHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Boolean,name:"finalized_approvals"}),o("design:type",Boolean)],e.prototype,"finalizedApprovals",void 0),n([a.jsonObject,o("design:paramtypes",[c.TransactionHash,Boolean])],e)}();t.ParamTransactionHash=f;var m=function(){function e(e,t){this.deployHash=e,this.finalizedApprovals=t}return n([(0,a.jsonMember)({name:"deploy_hash",constructor:String}),o("design:type",String)],e.prototype,"deployHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Boolean,name:"finalized_approvals"}),o("design:type",Boolean)],e.prototype,"finalizedApprovals",void 0),n([a.jsonObject,o("design:paramtypes",[String,Boolean])],e)}();t.ParamDeployHash=m;var h=function(){function e(e){this.blockIdentifier=e}var t;return t=e,e.byHeight=function(e){return new t(new l(void 0,e))},e.byHash=function(e){return new t(new l(e))},n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"block_identifier"}),o("design:type",l)],e.prototype,"blockIdentifier",void 0),t=n([a.jsonObject,o("design:paramtypes",[l])],e)}();t.ParamBlockIdentifier=h;var v=function(){function e(e,t){this.accountIdentifier=e,this.paramBlockIdentifier=t}return e.prototype.toJSON=function(){return Object.assign({account_identifier:this.accountIdentifier},this.paramBlockIdentifier?new a.TypedJSON(h).toPlainJson(this.paramBlockIdentifier):{})},n([(0,a.jsonMember)({constructor:String,name:"account_identifier"}),o("design:type",String)],e.prototype,"accountIdentifier",void 0),n([(0,a.jsonMember)({constructor:h}),o("design:type",h)],e.prototype,"paramBlockIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[String,h])],e)}();t.ParamGetAccountInfoBalance=v;var g=function(){function e(e,t,r){this.accountHash=e,this.publicKey=t,this.entityAddr=r}var t;return t=e,e.fromAccountHash=function(e){return new t(e)},e.fromPublicKey=function(e){return new t(void 0,e)},e.fromEntityAddr=function(e){return new t(void 0,void 0,e)},n([(0,a.jsonMember)({constructor:c.AccountHash,name:"AccountHash",isRequired:!1,deserializer:function(e){if(e)return c.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.AccountHash)],e.prototype,"accountHash",void 0),n([(0,a.jsonMember)({constructor:c.PublicKey,name:"PublicKey",isRequired:!1,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"publicKey",void 0),n([(0,a.jsonMember)({constructor:c.EntityAddr,name:"EntityAddr",isRequired:!1,deserializer:function(e){if(e)return c.EntityAddr.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.EntityAddr)],e.prototype,"entityAddr",void 0),t=n([a.jsonObject,o("design:paramtypes",[c.AccountHash,c.PublicKey,c.EntityAddr])],e)}();t.EntityIdentifier=g;var b=function(){function e(e,t){this.entityIdentifier=e,this.blockIdentifier=t}return n([(0,a.jsonMember)({constructor:g,name:"entity_identifier"}),o("design:type",g)],e.prototype,"entityIdentifier",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"block_identifier"}),o("design:type",l)],e.prototype,"blockIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[g,l])],e)}();t.ParamGetStateEntity=b;var w=function(){function e(e,t){this.accountHash=e,this.publicKey=t}return n([(0,a.jsonMember)({constructor:c.AccountHash,isRequired:!1,deserializer:function(e){if(e)return c.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.AccountHash)],e.prototype,"accountHash",void 0),n([(0,a.jsonMember)({constructor:c.PublicKey,isRequired:!1,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"publicKey",void 0),n([a.jsonObject,o("design:paramtypes",[c.AccountHash,c.PublicKey])],e)}();t.AccountIdentifier=w;var S=function(){function e(e){this.deploy=e}return n([(0,a.jsonMember)({constructor:c.Deploy}),o("design:type",c.Deploy)],e.prototype,"deploy",void 0),n([a.jsonObject,o("design:paramtypes",[c.Deploy])],e)}();t.PutDeployRequest=S;var j=function(){function e(e){this.transaction=e}return n([(0,a.jsonMember)({constructor:c.TransactionWrapper,serializer:function(e){return c.TransactionWrapper.toJSON(e)}}),o("design:type",c.TransactionWrapper)],e.prototype,"transaction",void 0),n([a.jsonObject,o("design:paramtypes",[c.TransactionWrapper])],e)}();t.PutTransactionRequest=j;var O=function(){function e(e,t,r){this.blockHash=e,this.blockHeight=t,this.stateRoot=r}return n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"BlockHash"}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"BlockHeight"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"StateRootHash"}),o("design:type",String)],e.prototype,"stateRoot",void 0),n([a.jsonObject,o("design:paramtypes",[String,Number,String])],e)}();t.GlobalStateIdentifier=O;var P=function(){function e(e,t){this.block=e,this.era=t}return n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"Block"}),o("design:type",l)],e.prototype,"block",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:Number,name:"Era"}),o("design:type",Number)],e.prototype,"era",void 0),n([a.jsonObject,o("design:paramtypes",[l,Number])],e)}();t.EraIdentifier=P;var N=function(){function e(e,t){this.dictionaryItemKey=e,this.seedUref=t}return n([(0,a.jsonMember)({constructor:String,name:"dictionary_item_key"}),o("design:type",String)],e.prototype,"dictionaryItemKey",void 0),n([(0,a.jsonMember)({constructor:String,name:"seed_uref"}),o("design:type",String)],e.prototype,"seedUref",void 0),n([a.jsonObject,o("design:paramtypes",[String,String])],e)}();t.ParamDictionaryIdentifierURef=N;var _=function(){function e(e,t,r){this.key=e,this.dictionaryName=t,this.dictionaryItemKey=r}return n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_name"}),o("design:type",String)],e.prototype,"dictionaryName",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_item_key"}),o("design:type",String)],e.prototype,"dictionaryItemKey",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,String])],e)}();t.AccountNamedKey=_;var B=function(){function e(e,t,r){this.key=e,this.dictionaryName=t,this.dictionaryItemKey=r}return n([(0,a.jsonMember)({constructor:String}),o("design:type",String)],e.prototype,"key",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_name"}),o("design:type",String)],e.prototype,"dictionaryName",void 0),n([(0,a.jsonMember)({constructor:String,name:"dictionary_item_key"}),o("design:type",String)],e.prototype,"dictionaryItemKey",void 0),n([a.jsonObject,o("design:paramtypes",[String,String,String])],e)}();t.ParamDictionaryIdentifierContractNamedKey=B;var T=function(){function e(e,t,r,n){this.accountNamedKey=e,this.contractNamedKey=t,this.uRef=r,this.dictionary=n}return n([(0,a.jsonMember)({isRequired:!1,constructor:_,name:"AccountNamedKey"}),o("design:type",_)],e.prototype,"accountNamedKey",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:B,name:"ContractNamedKey"}),o("design:type",B)],e.prototype,"contractNamedKey",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:N,name:"URef"}),o("design:type",N)],e.prototype,"uRef",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:String,name:"Dictionary"}),o("design:type",String)],e.prototype,"dictionary",void 0),n([a.jsonObject,o("design:paramtypes",[_,B,N,String])],e)}();t.ParamDictionaryIdentifier=T;var A=function(){function e(e,t){this.deploy=e,this.blockIdentifier=t}return n([(0,a.jsonMember)({constructor:c.Deploy}),o("design:type",c.Deploy)],e.prototype,"deploy",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:l,name:"block_identifier"}),o("design:type",l)],e.prototype,"blockIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[c.Deploy,l])],e)}();t.SpeculativeExecParams=A;var C=function(){function e(e,t,r,n){this.mainPurseUnderPublicKey=e,this.mainPurseUnderAccountHash=t,this.mainPurseUnderEntityAddr=r,this.purseUref=n}var t;return t=e,e.fromPublicKey=function(e){return new t(e)},e.fromAccountHash=function(e){return new t(void 0,e)},e.fromEntityAddr=function(e){return new t(void 0,void 0,e)},e.fromUref=function(e){return new t(void 0,void 0,void 0,e)},n([(0,a.jsonMember)({constructor:c.PublicKey,name:"main_purse_under_public_key",isRequired:!1,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"mainPurseUnderPublicKey",void 0),n([(0,a.jsonMember)({constructor:c.AccountHash,name:"main_purse_under_account_hash",isRequired:!1,deserializer:function(e){if(e)return c.AccountHash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.AccountHash)],e.prototype,"mainPurseUnderAccountHash",void 0),n([(0,a.jsonMember)({constructor:c.EntityAddr,name:"main_purse_under_entity_addr",isRequired:!1,deserializer:function(e){if(e)return c.EntityAddr.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.EntityAddr)],e.prototype,"mainPurseUnderEntityAddr",void 0),n([(0,a.jsonMember)({constructor:c.URef,isRequired:!1,name:"purse_uref",deserializer:function(e){if(e)return c.URef.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.URef)],e.prototype,"purseUref",void 0),t=n([a.jsonObject,o("design:paramtypes",[c.PublicKey,c.AccountHash,c.EntityAddr,c.URef])],e)}();t.PurseIdentifier=C;var M=function(){function e(e,t){this.purseIdentifier=e,this.stateIdentifier=t}return n([(0,a.jsonMember)({constructor:C,name:"purse_identifier"}),o("design:type",C)],e.prototype,"purseIdentifier",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:O,name:"state_identifier"}),o("design:type",O)],e.prototype,"stateIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[C,O])],e)}();t.QueryBalanceRequest=M;var R=function(){function e(e,t){this.purseIdentifier=e,this.stateIdentifier=t}return n([(0,a.jsonMember)({constructor:C,name:"purse_identifier"}),o("design:type",C)],e.prototype,"purseIdentifier",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:O,name:"state_identifier"}),o("design:type",O)],e.prototype,"stateIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[C,O])],e)}();t.QueryBalanceDetailsRequest=R;var H=function(){function e(e,t,r){this.validator=e,this.delegator=t,this.eraIdentifier=r}return n([(0,a.jsonMember)({constructor:c.PublicKey,isRequired:!1,deserializer:function(e){return c.PublicKey.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"validator",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:c.PublicKey,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"delegator",void 0),n([(0,a.jsonMember)({isRequired:!1,constructor:P,name:"era_identifier"}),o("design:type",P)],e.prototype,"eraIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[c.PublicKey,c.PublicKey,P])],e)}();t.InfoGetRewardRequest=H;var E=function(){function e(e,t){this.stateRootHash=e,this.purseURef=t}return n([(0,a.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({name:"purse_uref",constructor:String}),o("design:type",String)],e.prototype,"purseURef",void 0),n([a.jsonObject,o("design:paramtypes",[String,String])],e)}();t.StateGetBalanceRequest=E;var I=function(){function e(e,t){this.stateRootHash=e,this.dictionaryIdentifier=t}return n([(0,a.jsonMember)({name:"state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"stateRootHash",void 0),n([(0,a.jsonMember)({name:"dictionary_identifier",constructor:T}),o("design:type",T)],e.prototype,"dictionaryIdentifier",void 0),n([a.jsonObject,o("design:paramtypes",[String,T])],e)}();t.StateGetDictionaryRequest=I},1412: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.QueryGlobalStateResultV1Compatible=t.InfoGetChainspecResult=t.BalanceHoldWithProof=t.InfoGetRewardResult=t.QueryBalanceDetailsResult=t.QueryBalanceResult=t.SpeculativeExecResult=t.PutTransactionResult=t.PutDeployResult=t.InfoGetStatusResult=t.BlockSynchronizerStatus=t.BlockSyncStatus=t.NodeNextUpgrade=t.InfoGetValidatorChangesResult=t.ValidatorChanges=t.StatusChanges=t.ValidatorState=t.ChainGetStateRootHashResult=t.NodePeer=t.InfoGetPeerResult=t.QueryGlobalStateResult=t.StateGetDictionaryResult=t.StateGetItemResult=t.ChainGetEraInfoResult=t.InfoGetTransactionResultV1Compatible=t.InfoGetDeployResultV1Compatible=t.InfoGetTransactionResult=t.InfoGetDeployResult=t.ChainGetEraSummaryResult=t.ChainGetBlockTransfersResult=t.ChainGetBlockResult=t.ChainGetBlockResultV1Compatible=t.StateGetEntityResult=t.EntityOrAccount=t.RpcAddressableEntity=t.StateGetAccountInfo=t.StateGetBalanceResult=t.StateGetAuctionInfoV2Result=t.StateGetAuctionInfoV1Result=t.StateGetAuctionInfoResult=t.RpcResponse=void 0;var i=r(2294),a=r(8608),s=r(7021),c=r(7545),u=function(){function e(){}return n([(0,i.jsonMember)({name:"jsonrpc",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({constructor:a.IDValue,name:"id",deserializer:function(e){if(e)return a.IDValue.fromJSON(e)}}),o("design:type",a.IDValue)],e.prototype,"id",void 0),n([(0,i.jsonMember)({name:"result",constructor:i.AnyT}),o("design:type",Object)],e.prototype,"result",void 0),n([(0,i.jsonMember)({name:"error",constructor:s.RpcError,preserveNull:!0}),o("design:type",s.RpcError)],e.prototype,"error",void 0),n([i.jsonObject],e)}();t.RpcResponse=u;var d=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"auction_state",constructor:c.AuctionState}),o("design:type",c.AuctionState)],e.prototype,"auctionState",void 0),n([i.jsonObject],e)}();t.StateGetAuctionInfoResult=d;var l=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"auction_state",constructor:c.AuctionStateV1}),o("design:type",c.AuctionStateV1)],e.prototype,"auctionState",void 0),n([i.jsonObject],e)}();t.StateGetAuctionInfoV1Result=l;var p=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"auction_state",constructor:c.AuctionStateV2}),o("design:type",c.AuctionStateV2)],e.prototype,"auctionState",void 0),n([i.jsonObject],e)}();t.StateGetAuctionInfoV2Result=p;var y=function(){function e(){}return e.prototype.toQueryBalanceResult=function(){var e=new z;return e.apiVersion=this.apiVersion,e.balance=this.balanceValue,e},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"balance_value",constructor:c.CLValueUInt512,deserializer:function(e){return c.CLValueUInt512.fromJSON(e)},serializer:function(e){return e.toJSON()}}),o("design:type",c.CLValueUInt512)],e.prototype,"balanceValue",void 0),n([i.jsonObject],e)}();t.StateGetBalanceResult=y;var f=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"account",constructor:c.Account}),o("design:type",c.Account)],e.prototype,"account",void 0),n([i.jsonObject],e)}();t.StateGetAccountInfo=f;var m=function(){function e(){}return n([(0,i.jsonMember)({name:"entity",constructor:c.AddressableEntity}),o("design:type",c.AddressableEntity)],e.prototype,"entity",void 0),n([(0,i.jsonArrayMember)(c.NamedKey,{name:"named_keys"}),o("design:type",Array)],e.prototype,"namedKeys",void 0),n([(0,i.jsonArrayMember)(c.EntryPointValue,{name:"entry_points"}),o("design:type",Array)],e.prototype,"entryPoints",void 0),n([i.jsonObject],e)}();t.RpcAddressableEntity=m;var h=function(){function e(){}return n([(0,i.jsonMember)({name:"AddressableEntity",constructor:m}),o("design:type",m)],e.prototype,"addressableEntity",void 0),n([(0,i.jsonMember)({name:"LegacyAccount",constructor:c.Account}),o("design:type",c.Account)],e.prototype,"legacyAccount",void 0),n([i.jsonObject],e)}();t.EntityOrAccount=h;var v=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"entity",constructor:h}),o("design:type",h)],e.prototype,"entity",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:i.AnyT}),o("design:type",Object)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.StateGetEntityResult=v;var g=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"block_with_signatures",constructor:c.BlockWithSignatures}),o("design:type",c.BlockWithSignatures)],e.prototype,"blockWithSignatures",void 0),n([(0,i.jsonMember)({name:"block",constructor:c.BlockV1}),o("design:type",c.BlockV1)],e.prototype,"blockV1",void 0),n([i.jsonObject],e)}();t.ChainGetBlockResultV1Compatible=g;var b=function(){function e(){}var t;return t=e,e.fromJSON=function(e){var r=new i.TypedJSON(t).parse(e);if(!r)throw new Error("Failed to parse ChainGetBlockResult");return r.rawJSON=e,r},e.newChainGetBlockResultFromV1Compatible=function(e,r){var n=new t;if(n.apiVersion=e.apiVersion,n.rawJSON=r,e.blockV1)n.block=c.Block.newBlockFromBlockV1(e.blockV1);else{if(!e.blockWithSignatures)throw new Error("Incorrect RPC response structure");n.block=c.Block.newBlockFromBlockWrapper(e.blockWithSignatures.block,e.blockWithSignatures.proofs)}return n},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:c.Block}),o("design:type",c.Block)],e.prototype,"block",void 0),t=n([i.jsonObject],e)}();t.ChainGetBlockResult=b;var w=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"block_hash",constructor:String}),o("design:type",String)],e.prototype,"blockHash",void 0),n([(0,i.jsonArrayMember)(c.Transfer,{name:"transfers",deserializer:function(e){return e.map((function(e){return c.Transfer.fromJSON(e)}))}}),o("design:type",Array)],e.prototype,"transfers",void 0),n([i.jsonObject],e)}();t.ChainGetBlockTransfersResult=w;var S=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"era_summary",constructor:c.EraSummary}),o("design:type",c.EraSummary)],e.prototype,"eraSummary",void 0),n([i.jsonObject],e)}();t.ChainGetEraSummaryResult=S;var j=function(){function e(){}return e.prototype.toInfoGetTransactionResult=function(){var e,t=void 0;return this.executionInfo?t=new c.ExecutionInfo(this.executionInfo.blockHash,this.executionInfo.blockHeight,this.executionInfo.executionResult):(null===(e=null==this?void 0:this.executionResultsV1)||void 0===e?void 0:e.length)&&(t=c.ExecutionInfo.fromV1(this.executionResultsV1)),new O(this.apiVersion,c.Deploy.newTransactionFromDeploy(this.deploy),t,this.rawJSON)},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"deploy",constructor:c.Deploy}),o("design:type",c.Deploy)],e.prototype,"deploy",void 0),n([(0,i.jsonMember)({name:"execution_info",constructor:c.DeployExecutionInfo}),o("design:type",c.DeployExecutionInfo)],e.prototype,"executionInfo",void 0),n([(0,i.jsonArrayMember)(c.DeployExecutionResult,{name:"execution_results",preserveNull:!0}),o("design:type",Array)],e.prototype,"executionResultsV1",void 0),n([i.jsonObject],e)}();t.InfoGetDeployResult=j;var O=function(){function e(e,t,r,n){void 0===n&&(n=""),this.apiVersion=e,this.transaction=t,this.executionInfo=r,this.rawJSON=n}var t;return t=e,e.fromJSON=function(e){var r,n=new i.TypedJSON(N).parse(e);return n?N.newInfoGetTransactionResultFromV1Compatible(n,e):null!==(r=new i.TypedJSON(t).parse(e))&&void 0!==r?r:null},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:c.Transaction,deserializer:function(e){if(e)return c.Transaction.fromJSON(e)}}),o("design:type",c.Transaction)],e.prototype,"transaction",void 0),n([(0,i.jsonMember)({name:"execution_info",constructor:c.ExecutionInfo,preserveNull:!0}),o("design:type",c.ExecutionInfo)],e.prototype,"executionInfo",void 0),t=n([i.jsonObject,o("design:paramtypes",[String,c.Transaction,c.ExecutionInfo,Object])],e)}();t.InfoGetTransactionResult=O;var P=function(){function e(){}var t;return t=e,e.fromJSON=function(e){return new i.TypedJSON(t).parse(e)},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:c.Deploy}),o("design:type",c.Deploy)],e.prototype,"deploy",void 0),n([(0,i.jsonArrayMember)(c.DeployExecutionResult,{name:"execution_results"}),o("design:type",Array)],e.prototype,"executionResults",void 0),n([(0,i.jsonMember)({name:"block_hash",constructor:c.Hash,deserializer:function(e){if(e)return c.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number}),o("design:type",Number)],e.prototype,"blockHeight",void 0),t=n([i.jsonObject],e)}();t.InfoGetDeployResultV1Compatible=P;var N=function(){function e(){this.executionResults=[]}var t;return t=e,e.newInfoGetTransactionResultFromV1Compatible=function(e,t){if(e.transaction){if(e.transaction.transactionV1)return new O(e.apiVersion,c.Transaction.fromTransactionV1(e.transaction.transactionV1),e.executionInfo,t);if(e.transaction.deploy){var r=c.Deploy.newTransactionFromDeploy(e.transaction.deploy),n=new O(e.apiVersion,r,e.executionInfo,t);return e.executionResults.length>0&&((o=c.ExecutionInfo.fromV1(e.executionResults,e.blockHeight)).executionResult.initiator=new c.InitiatorAddr(e.deploy.header.account),n.executionInfo=o),n}}var o;if(e.deploy)return r=c.Deploy.newTransactionFromDeploy(e.deploy),n=new O(e.apiVersion,r,e.executionInfo,t),e.executionResults.length>0&&((o=c.ExecutionInfo.fromV1(e.executionResults,e.blockHeight)).executionResult.initiator=new c.InitiatorAddr(e.deploy.header.account),n.executionInfo=o),n;throw new Error("Incorrect RPC response structure")},e.fromJSON=function(e){return new i.TypedJSON(t).parse(e)},n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({constructor:c.TransactionWrapper}),o("design:type",c.TransactionWrapper)],e.prototype,"transaction",void 0),n([(0,i.jsonMember)({constructor:c.Deploy}),o("design:type",c.Deploy)],e.prototype,"deploy",void 0),n([(0,i.jsonMember)({constructor:c.ExecutionInfo,name:"execution_info"}),o("design:type",c.ExecutionInfo)],e.prototype,"executionInfo",void 0),n([(0,i.jsonArrayMember)(c.DeployExecutionResult,{name:"execution_results"}),o("design:type",Array)],e.prototype,"executionResults",void 0),n([(0,i.jsonMember)({constructor:c.Hash,name:"block_hash",deserializer:function(e){if(e)return c.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({constructor:Number,name:"block_height"}),o("design:type",Number)],e.prototype,"blockHeight",void 0),t=n([i.jsonObject],e)}();t.InfoGetTransactionResultV1Compatible=N;var _=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"era_summary",constructor:c.EraSummary}),o("design:type",c.EraSummary)],e.prototype,"eraSummary",void 0),n([i.jsonObject],e)}();t.ChainGetEraInfoResult=_;var B=function(){function e(){}return n([(0,i.jsonMember)({name:"stored_value",constructor:c.StoredValue}),o("design:type",c.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.StateGetItemResult=B;var T=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"dictionary_key",constructor:String}),o("design:type",String)],e.prototype,"dictionaryKey",void 0),n([(0,i.jsonMember)({name:"stored_value",constructor:c.StoredValue}),o("design:type",c.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.StateGetDictionaryResult=T;var A=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"block_header",constructor:c.BlockHeader}),o("design:type",c.BlockHeader)],e.prototype,"blockHeader",void 0),n([(0,i.jsonMember)({name:"stored_value",constructor:c.StoredValue}),o("design:type",c.StoredValue)],e.prototype,"storedValue",void 0),n([(0,i.jsonMember)({name:"merkle_proof",constructor:String}),o("design:type",String)],e.prototype,"merkleProof",void 0),n([i.jsonObject],e)}();t.QueryGlobalStateResult=A;var C=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonArrayMember)((function(){return M}),{name:"peers"}),o("design:type",Array)],e.prototype,"peers",void 0),n([i.jsonObject],e)}();t.InfoGetPeerResult=C;var M=function(){function e(){}return n([(0,i.jsonMember)({name:"node_id",constructor:String}),o("design:type",String)],e.prototype,"nodeId",void 0),n([(0,i.jsonMember)({name:"address",constructor:String}),o("design:type",String)],e.prototype,"address",void 0),n([i.jsonObject],e)}();t.NodePeer=M;var R,H=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"version",void 0),n([(0,i.jsonMember)({name:"state_root_hash",constructor:c.Hash,deserializer:function(e){if(e)return c.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.Hash)],e.prototype,"stateRootHash",void 0),n([i.jsonObject],e)}();t.ChainGetStateRootHashResult=H,(R=t.ValidatorState||(t.ValidatorState={})).Added="Added",R.Removed="Removed",R.Banned="Banned",R.CannotPropose="CannotPropose",R.SeenAsFaulty="SeenAsFaulty";var E=function(){function e(){}return n([(0,i.jsonMember)({name:"era_id",constructor:Number}),o("design:type",Number)],e.prototype,"eraID",void 0),n([(0,i.jsonMember)({name:"validator_change",constructor:String}),o("design:type",String)],e.prototype,"validatorState",void 0),n([i.jsonObject],e)}();t.StatusChanges=E;var I=function(){function e(){}return n([(0,i.jsonMember)({name:"public_key",constructor:c.PublicKey,deserializer:function(e){if(e)return c.PublicKey.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.PublicKey)],e.prototype,"publicKey",void 0),n([(0,i.jsonArrayMember)(E,{name:"status_changes"}),o("design:type",Array)],e.prototype,"statusChanges",void 0),n([i.jsonObject],e)}();t.ValidatorChanges=I;var V=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonArrayMember)(I,{name:"changes"}),o("design:type",Array)],e.prototype,"changes",void 0),n([i.jsonObject],e)}();t.InfoGetValidatorChangesResult=V;var k=function(){function e(){}return n([(0,i.jsonMember)({name:"activation_point",constructor:Number}),o("design:type",Number)],e.prototype,"activationPoint",void 0),n([(0,i.jsonMember)({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([i.jsonObject],e)}();t.NodeNextUpgrade=k;var J=function(){function e(){}return n([(0,i.jsonMember)({name:"block_hash",constructor:c.Hash,deserializer:function(e){if(e)return c.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()},preserveNull:!0}),o("design:type",c.Hash)],e.prototype,"blockHash",void 0),n([(0,i.jsonMember)({name:"block_height",constructor:Number,preserveNull:!0}),o("design:type",Number)],e.prototype,"blockHeight",void 0),n([(0,i.jsonMember)({name:"acquisition_state",constructor:String}),o("design:type",String)],e.prototype,"acquisitionState",void 0),n([i.jsonObject],e)}();t.BlockSyncStatus=J;var D=function(){function e(){}return n([(0,i.jsonMember)({name:"historical",constructor:J}),o("design:type",J)],e.prototype,"historical",void 0),n([(0,i.jsonMember)({name:"forward",constructor:J}),o("design:type",J)],e.prototype,"forward",void 0),n([i.jsonObject],e)}();t.BlockSynchronizerStatus=D;var L=function(){function e(){}return n([(0,i.jsonMember)({name:"api_version",constructor:String}),o("design:type",String)],e.prototype,"apiVersion",void 0),n([(0,i.jsonMember)({name:"protocol_version",constructor:String}),o("design:type",String)],e.prototype,"protocolVersion",void 0),n([(0,i.jsonMember)({name:"build_version",constructor:String}),o("design:type",String)],e.prototype,"buildVersion",void 0),n([(0,i.jsonMember)({name:"chainspec_name",constructor:String}),o("design:type",String)],e.prototype,"chainSpecName",void 0),n([(0,i.jsonMember)({name:"last_added_block_info",constructor:c.MinimalBlockInfo}),o("design:type",c.MinimalBlockInfo)],e.prototype,"lastAddedBlockInfo",void 0),n([(0,i.jsonMember)({name:"next_upgrade",constructor:k}),o("design:type",k)],e.prototype,"nextUpgrade",void 0),n([(0,i.jsonMember)({name:"our_public_signing_key",constructor:String}),o("design:type",String)],e.prototype,"ourPublicSigningKey",void 0),n([(0,i.jsonArrayMember)(M,{name:"peers"}),o("design:type",Array)],e.prototype,"peers",void 0),n([(0,i.jsonMember)({name:"round_length",constructor:String}),o("design:type",String)],e.prototype,"roundLength",void 0),n([(0,i.jsonMember)({name:"starting_state_root_hash",constructor:String}),o("design:type",String)],e.prototype,"startingStateRootHash",void 0),n([(0,i.jsonMember)({name:"uptime",constructor:String}),o("design:type",String)],e.prototype,"uptime",void 0),n([(0,i.jsonMember)({name:"reactor_state",constructor:String}),o("design:type",String)],e.prototype,"reactorState",void 0),n([(0,i.jsonMember)({name:"last_progress",constructor:c.Timestamp,deserializer:function(e){if(e)return c.Timestamp.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.Timestamp)],e.prototype,"lastProgress",void 0),n([(0,i.jsonMember)({name:"latest_switch_block_hash",constructor:c.Hash,deserializer:function(e){if(e)return c.Hash.fromJSON(e)},serializer:function(e){if(e)return e.toJSON()}}),o("design:type",c.Hash)],e.prototype,"latestSwitchBlockHash",void 0),n([(0,i.jsonMember)({name:"available_block_range",constructor:function(){return{low:(0,i.jsonMember)({name:"low",constructor:Number}),high:(0,i.jsonMember)({name:"high",constructor:Number})}}}),o("design:type",Object)],e.prototype,"availableBlockRange",void 0),n([(0,i.