@psalomo/jsonrpc-client 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-standalone.js +454 -249
- package/dist/browser-standalone.min.js +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.js +18 -9
- package/dist/index.mjs +18 -9
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
function e(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}function t(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function n(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(n);const o={};for(const[s,a]of Object.entries(t)){o[e(s)]=n(a)}return o}function o(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(o);const n={};for(const[s,a]of Object.entries(e)){n[t(s)]=o(a)}return n}class s extends Error{code;data;constructor(e,t,n){super(e),this.code=t,this.data=n,this.name="JsonRpcClientError"}}class a extends Error{originalError;constructor(e,t){super(e),this.originalError=t,this.name="JsonRpcNetworkError"}}class r{endpoint;headers;timeout;retries;validation;constructor(e){"string"==typeof e?(this.endpoint=e,this.headers={},this.timeout=3e4,this.retries=3):(this.endpoint=e.endpoint,this.headers=e.headers||{},this.timeout=e.timeout||3e4,this.retries=e.retries||3,e.validation&&(this.validation=e.validation))}async makeRequest(e,t){const r={jsonrpc:"2.0",id:"dontcare",method:e,params:t?n(t):t};this.validation&&("validateMethodRequest"in this.validation?this.validation.validateMethodRequest(e,r):this.validation.validateRequest(r));let i=null;for(let t=0;t<=this.retries;t++)try{const t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout),i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify(r),signal:t.signal});if(clearTimeout(n),!i.ok)throw new a(`HTTP error! status: ${i.status}`);let c;try{c=await i.json()}catch(e){throw new a("Failed to parse JSON response",e)}if(this.validation&&this.validation.validateResponse(c),c.error)throw new s(c.error.message,c.error.code,c.error.data);const u=c.result?o(c.result):c.result;if(this.validation&&"validateMethodResponse"in this.validation){const t={...c,result:u};this.validation.validateMethodResponse(e,t)}return u}catch(e){if(i=e,e instanceof s)throw e;if(t===this.retries)break;await new Promise(e=>setTimeout(e,1e3*Math.pow(2,t)))}throw new a(i?.message||"Request failed after all retries",i||void 0)}withConfig(e){return new r({endpoint:e.endpoint??this.endpoint,headers:e.headers??this.headers,timeout:e.timeout??this.timeout,retries:e.retries??this.retries,...void 0!==e.validation?{validation:e.validation}:void 0!==this.validation?{validation:this.validation}:{}})}}const i=new r({endpoint:"https://rpc.mainnet.near.org"});class c extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n,this.name="NearRpcError"}}function u(e,t,n){function o(n,o){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(s=n._zod).traits??(s.traits=new Set),n._zod.traits.add(e),t(n,o);for(const e in r.prototype)e in n||Object.defineProperty(n,e,{value:r.prototype[e].bind(n)});n._zod.constr=r,n._zod.def=o}const s=n?.Parent??Object;class a extends s{}function r(e){var t;const s=n?.Parent?new a:this;o(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(r,"init",{value:o}),Object.defineProperty(r,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class d extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const l={};function p(e){return l}function h(e,t){return"bigint"==typeof t?t.toString():t}function m(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function g(e,t,n){Object.defineProperty(e,t,{get(){{const o=n();return e[t]=o,o}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _(e){return JSON.stringify(e)}const f=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function I(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const v=m(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function k(e){if(!1===I(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==I(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const E=new Set(["string","number","symbol"]);function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function P(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function T(e){return"string"==typeof e?e:e?.message}function R(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const s=T(e.inst?._zod.def?.error?.(e))??T(t?.error?.(e))??T(n.customError?.(e))??T(n.localeError?.(e))??"Invalid input";o.message=s}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}const x=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,h,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},w=u("$ZodError",x),A=u("$ZodError",x,{Parent:Error}),B=(e=>(t,n,o,s)=>{const a=o?Object.assign(o,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},a);if(r instanceof Promise)throw new d;if(r.issues.length){const t=new(s?.Err??e)(r.issues.map(e=>R(e,a,p())));throw f(t,s?.callee),t}return r.value})(A),C=(e=>async(t,n,o,s)=>{const a=o?Object.assign(o,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},a);if(r instanceof Promise&&(r=await r),r.issues.length){const t=new(s?.Err??e)(r.issues.map(e=>R(e,a,p())));throw f(t,s?.callee),t}return r.value})(A),N=(e=>(t,n,o)=>{const s=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new d;return a.issues.length?{success:!1,error:new(e??w)(a.issues.map(e=>R(e,s,p())))}:{success:!0,data:a.value}})(A),M=(e=>async(t,n,o)=>{const s=o?Object.assign(o,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>R(e,s,p())))}:{success:!0,data:a.value}})(A),z=/^-?\d+(?:\.\d+)?/i,L=/true|false/i,q=/null/i;class O{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),o=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of o)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const D={major:4,minor:0,patch:5},j=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=D;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const t of o)for(const n of t._zod.onattach)n(e);if(0===o.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let o,s=S(e);for(const a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,r=a._zod.check(e);if(r instanceof Promise&&!1===n?.async)throw new d;if(o||r instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await r;e.issues.length!==t&&(s||(s=S(e,t)))});else{if(e.issues.length===t)continue;s||(s=S(e,t))}}return o?o.then(()=>e):e};e._zod.run=(n,s)=>{const a=e._zod.parse(n,s);if(a instanceof Promise){if(!1===s.async)throw new d;return a.then(e=>t(e,o,s))}return t(a,o,s)}}e["~standard"]={validate:t=>{try{const n=N(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return M(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),K=u("$ZodString",(e,t)=>{var n;j.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),H=u("$ZodNumber",(e,t)=>{j.init(e,t),e._zod.pattern=e._zod.bag.pattern??z,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const a="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),n}}),$=u("$ZodBoolean",(e,t)=>{j.init(e,t),e._zod.pattern=L,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),X=u("$ZodNull",(e,t)=>{j.init(e,t),e._zod.pattern=q,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),V=u("$ZodUnknown",(e,t)=>{j.init(e,t),e._zod.parse=e=>e});function F(e,t,n){e.issues.length&&t.issues.push(...P(n,e.issues)),t.value[n]=e.value}const G=u("$ZodArray",(e,t)=>{j.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const a=[];for(let e=0;e<s.length;e++){const r=s[e],i=t.element._zod.run({value:r,issues:[]},o);i instanceof Promise?a.push(i.then(t=>F(t,n,e))):F(i,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function U(e,t,n){e.issues.length&&t.issues.push(...P(n,e.issues)),t.value[n]=e.value}function Z(e,t,n,o){e.issues.length?void 0===o[n]?t.value[n]=n in o?void 0:e.value:t.issues.push(...P(n,e.issues)):void 0===e.value?n in o&&(t.value[n]=void 0):t.value[n]=e.value}const W=u("$ZodObject",(e,t)=>{j.init(e,t);const n=m(()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof j))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(o=t.shape,Object.keys(o).filter(e=>"optional"===o[e]._zod.optin&&"optional"===o[e]._zod.optout));var o;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});g(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const o=e[t]._zod;if(o.values){n[t]??(n[t]=new Set);for(const e of o.values)n[t].add(e)}}return n});let o;const s=I,a=!l.jitless,r=a&&v.value,i=t.catchall;let c;e._zod.parse=(u,d)=>{c??(c=n.value);const l=u.value;if(!s(l))return u.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),u;const p=[];if(a&&r&&!1===d?.async&&!0!==d.jitless)o||(o=(e=>{const t=new O(["shape","payload","ctx"]),o=n.value,s=e=>{const t=_(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const a=Object.create(null);let r=0;for(const e of o.keys)a[e]="key_"+r++;t.write("const newResult = {}");for(const e of o.keys)if(o.optionalKeys.has(e)){const n=a[e];t.write(`const ${n} = ${s(e)};`);const o=_(e);t.write(`\n if (${n}.issues.length) {\n if (input[${o}] === undefined) {\n if (${o} in input) {\n newResult[${o}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${o}, ...iss.path] : [${o}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${o} in input) newResult[${o}] = undefined;\n } else {\n newResult[${o}] = ${n}.value;\n }\n `)}else{const n=a[e];t.write(`const ${n} = ${s(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${_(e)}, ...iss.path] : [${_(e)}]\n })));`),t.write(`newResult[${_(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const i=t.compile();return(t,n)=>i(e,t,n)})(t.shape)),u=o(u,d);else{u.value={};const e=c.shape;for(const t of c.keys){const n=e[t],o=n._zod.run({value:l[t],issues:[]},d),s="optional"===n._zod.optin&&"optional"===n._zod.optout;o instanceof Promise?p.push(o.then(e=>s?Z(e,u,t,l):U(e,u,t))):s?Z(o,u,t,l):U(o,u,t)}}if(!i)return p.length?Promise.all(p).then(()=>u):u;const h=[],m=c.keySet,y=i._zod,g=y.def.type;for(const e of Object.keys(l)){if(m.has(e))continue;if("never"===g){h.push(e);continue}const t=y.run({value:l[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>U(t,u,e))):U(t,u,e)}return h.length&&u.issues.push({code:"unrecognized_keys",keys:h,input:l,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function J(e,t,n,o){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>R(e,o,p())))}),t}const Y=u("$ZodUnion",(e,t)=>{j.init(e,t),g(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),g(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),g(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),g(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>y(e.source)).join("|")})$`)}}),e._zod.parse=(n,o)=>{let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},o);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>J(t,n,e,o)):J(a,n,e,o)}}),Q=u("$ZodIntersection",(e,t)=>{j.init(e,t),e._zod.parse=(e,n)=>{const o=e.value,s=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([t,n])=>te(e,t,n)):te(e,s,a)}});function ee(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(k(e)&&k(t)){const n=Object.keys(t),o=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of o){const o=ee(e[n],t[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};s[n]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const s=ee(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function te(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),S(e))return e;const o=ee(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const ne=u("$ZodRecord",(e,t)=>{j.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!k(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const a=[];if(t.keyType._zod.values){const r=t.keyType._zod.values;n.value={};for(const e of r)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const r=t.valueType._zod.run({value:s[e],issues:[]},o);r instanceof Promise?a.push(r.then(t=>{t.issues.length&&n.issues.push(...P(e,t.issues)),n.value[e]=t.value})):(r.issues.length&&n.issues.push(...P(e,r.issues)),n.value[e]=r.value)}let i;for(const e in s)r.has(e)||(i=i??[],i.push(e));i&&i.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:i})}else{n.value={};for(const r of Reflect.ownKeys(s)){if("__proto__"===r)continue;const i=t.keyType._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(i.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:i.issues.map(e=>R(e,o,p())),input:r,path:[r],inst:e}),n.value[i.value]=i.value;continue}const c=t.valueType._zod.run({value:s[r],issues:[]},o);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...P(r,e.issues)),n.value[i.value]=e.value})):(c.issues.length&&n.issues.push(...P(r,c.issues)),n.value[i.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),oe=u("$ZodEnum",(e,t)=>{j.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(e=>E.has(typeof e)).map(e=>"string"==typeof e?b(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const s=t.value;return e._zod.values.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),se=u("$ZodLiteral",(e,t)=>{j.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?b(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(n,o)=>{const s=n.value;return e._zod.values.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}}),ae=u("$ZodOptional",(e,t)=>{j.init(e,t),e._zod.optin="optional",e._zod.optout="optional",g(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),g(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${y(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)}),re=u("$ZodLazy",(e,t)=>{j.init(e,t),g(e._zod,"innerType",()=>t.getter()),g(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),g(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),g(e._zod,"optin",()=>e._zod.innerType._zod.optin),g(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)});const ie=u("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");j.init(e,t),e.def=t,e.parse=(t,n)=>B(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>N(e,t,n),e.parseAsync=async(t,n)=>C(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>M(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>function(e,t,n){const o=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(o._zod.parent=e),o}(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e)}),ce=u("ZodMiniString",(e,t)=>{K.init(e,t),ie.init(e,t)});function ue(e){return new ce({type:"string"})}const de=u("ZodMiniNumber",(e,t)=>{H.init(e,t),ie.init(e,t)});function le(e){return new de({type:"number",checks:[]})}const pe=u("ZodMiniBoolean",(e,t)=>{$.init(e,t),ie.init(e,t)});function he(e){return new pe({type:"boolean"})}const me=u("ZodMiniNull",(e,t)=>{X.init(e,t),ie.init(e,t)});function ye(e){return new me({type:"null"})}const ge=u("ZodMiniUnknown",(e,t)=>{V.init(e,t),ie.init(e,t)});function _e(){return new ge({type:"unknown"})}const fe=u("ZodMiniArray",(e,t)=>{G.init(e,t),ie.init(e,t)});function Ie(e,t){return new fe({type:"array",element:e})}const ve=u("ZodMiniObject",(e,t)=>{W.init(e,t),ie.init(e,t),g(e,"shape",()=>t.shape)});function ke(e,t){return new ve({type:"object",get shape(){var t,n,o;return t=this,n="shape",o={...e},Object.defineProperty(t,n,{value:o,writable:!0,enumerable:!0,configurable:!0}),this.shape}})}const Ee=u("ZodMiniUnion",(e,t)=>{Y.init(e,t),ie.init(e,t)});function be(e,t){return new Ee({type:"union",options:e})}const Se=u("ZodMiniIntersection",(e,t)=>{Q.init(e,t),ie.init(e,t)});function Pe(e,t){return new Se({type:"intersection",left:e,right:t})}const Te=u("ZodMiniRecord",(e,t)=>{ne.init(e,t),ie.init(e,t)});function Re(e,t,n){return new Te({type:"record",keyType:e,valueType:t})}const xe=u("ZodMiniEnum",(e,t)=>{oe.init(e,t),ie.init(e,t)});function we(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new xe({type:"enum",entries:n})}const Ae=u("ZodMiniLiteral",(e,t)=>{se.init(e,t),ie.init(e,t)});function Be(e,t){return new Ae({type:"literal",values:Array.isArray(e)?e:[e]})}const Ce=u("ZodMiniOptional",(e,t)=>{ae.init(e,t),ie.init(e,t)});function Ne(e){return new Ce({type:"optional",innerType:e})}const Me=u("ZodMiniLazy",(e,t)=>{re.init(e,t),ie.init(e,t)});function ze(e){return new Me({type:"lazy",getter:e})}var Le=()=>ke({keys:Ie(ze(()=>ke({accessKey:ze(()=>De()),publicKey:ze(()=>Ht())})))}),qe=()=>be([ke({FunctionCall:ze(()=>kt())}),we(["FullAccess"])]),Oe=()=>be([we(["FullAccess"]),ke({FunctionCall:ke({allowance:Ne(ue()),methodNames:Ie(ue()),receiverId:ue()})})]),De=()=>ke({nonce:le(),permission:ze(()=>Oe())}),je=()=>ue(),Ke=()=>ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht())}),He=()=>ke({addKeyCost:ze(()=>ke({fullAccessCost:ze(()=>yt()),functionCallCost:ze(()=>yt()),functionCallCostPerByte:ze(()=>yt())})),createAccountCost:ze(()=>yt()),delegateCost:ze(()=>yt()),deleteAccountCost:ze(()=>yt()),deleteKeyCost:ze(()=>yt()),deployContractCost:ze(()=>yt()),deployContractCostPerByte:ze(()=>yt()),functionCallCost:ze(()=>yt()),functionCallCostPerByte:ze(()=>yt()),stakeCost:ze(()=>yt()),transferCost:ze(()=>yt())}),$e=()=>be([ke({AccountAlreadyExists:ke({accountId:ze(()=>je())})}),ke({AccountDoesNotExist:ke({accountId:ze(()=>je())})}),ke({CreateAccountOnlyByRegistrar:ke({accountId:ze(()=>je()),predecessorId:ze(()=>je()),registrarAccountId:ze(()=>je())})}),ke({CreateAccountNotAllowed:ke({accountId:ze(()=>je()),predecessorId:ze(()=>je())})}),ke({ActorNoPermission:ke({accountId:ze(()=>je()),actorId:ze(()=>je())})}),ke({DeleteKeyDoesNotExist:ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht())})}),ke({AddKeyAlreadyExists:ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht())})}),ke({DeleteAccountStaking:ke({accountId:ze(()=>je())})}),ke({LackBalanceForState:ke({accountId:ze(()=>je()),amount:ue()})}),ke({TriesToUnstake:ke({accountId:ze(()=>je())})}),ke({TriesToStake:ke({accountId:ze(()=>je()),balance:ue(),locked:ue(),stake:ue()})}),ke({InsufficientStake:ke({accountId:ze(()=>je()),minimumStake:ue(),stake:ue()})}),ke({FunctionCallError:ze(()=>vt())}),ke({NewReceiptValidationError:ze(()=>Vt())}),ke({OnlyImplicitAccountCreationAllowed:ke({accountId:ze(()=>je())})}),ke({DeleteAccountWithLargeState:ke({accountId:ze(()=>je())})}),we(["DelegateActionInvalidSignature"]),ke({DelegateActionSenderDoesNotMatchTxReceiver:ke({receiverId:ze(()=>je()),senderId:ze(()=>je())})}),we(["DelegateActionExpired"]),ke({DelegateActionAccessKeyError:ze(()=>Tt())}),ke({DelegateActionInvalidNonce:ke({akNonce:le(),delegateNonce:le()})}),ke({DelegateActionNonceTooLarge:ke({delegateNonce:le(),upperBound:le()})}),ke({GlobalContractDoesNotExist:ke({identifier:ze(()=>St())})})]),Xe=()=>be([we(["CreateAccount"]),ke({DeployContract:ke({code:ue()})}),ke({FunctionCall:ke({args:ze(()=>ft()),deposit:ue(),gas:le(),methodName:ue()})}),ke({Transfer:ke({deposit:ue()})}),ke({Stake:ke({publicKey:ze(()=>Ht()),stake:ue()})}),ke({AddKey:ke({accessKey:ze(()=>De()),publicKey:ze(()=>Ht())})}),ke({DeleteKey:ke({publicKey:ze(()=>Ht())})}),ke({DeleteAccount:ke({beneficiaryId:ze(()=>je())})}),ke({Delegate:ke({delegateAction:ze(()=>ot()),signature:ze(()=>Vn())})}),ke({DeployGlobalContract:ke({code:ue()})}),ke({DeployGlobalContractByAccountId:ke({code:ue()})}),ke({UseGlobalContract:ke({codeHash:ze(()=>nt())})}),ke({UseGlobalContractByAccountId:ke({accountId:ze(()=>je())})})]),Ve=()=>be([we(["DeleteActionMustBeFinal"]),ke({TotalPrepaidGasExceeded:ke({limit:le(),totalPrepaidGas:le()})}),ke({TotalNumberOfActionsExceeded:ke({limit:le(),totalNumberOfActions:le()})}),ke({AddKeyMethodNamesNumberOfBytesExceeded:ke({limit:le(),totalNumberOfBytes:le()})}),ke({AddKeyMethodNameLengthExceeded:ke({length:le(),limit:le()})}),we(["IntegerOverflow"]),ke({InvalidAccountId:ke({accountId:ue()})}),ke({ContractSizeExceeded:ke({limit:le(),size:le()})}),ke({FunctionCallMethodNameLengthExceeded:ke({length:le(),limit:le()})}),ke({FunctionCallArgumentsLengthExceeded:ke({length:le(),limit:le()})}),ke({UnsuitableStakingKey:ke({publicKey:ze(()=>Ht())})}),we(["FunctionCallZeroAttachedGas"]),we(["DelegateActionMustBeOnlyOne"]),ke({UnsupportedProtocolFeature:ke({protocolFeature:ue(),version:le()})})]),Fe=()=>ke({accessKey:ze(()=>ke({nonce:le(),permission:ze(()=>qe())})),publicKey:ze(()=>Ht())}),Ge=()=>ke({data:Ie(le())}),Ue=()=>ke({requests:Ie(ze(()=>ke({requestedValuesBitmap:ze(()=>Ge()),toShard:le()})))}),Ze=()=>ke({blockMerkleRoot:ze(()=>nt()),epochId:ze(()=>nt()),height:le(),nextBpHash:ze(()=>nt()),nextEpochId:ze(()=>nt()),outcomeRoot:ze(()=>nt()),prevStateRoot:ze(()=>nt()),timestamp:le(),timestampNanosec:ue()}),We=()=>be([le(),ze(()=>nt())]),Je=()=>ke({hash:ze(()=>nt()),height:le()}),Ye=()=>ke({get:ue(),set:ue()}),Qe=()=>ke({balanceBurnt:ue(),bandwidthRequests:Ne(be([ze(()=>ke({V1:ze(()=>Ue())})),ye()])),chunkHash:ze(()=>nt()),congestionInfo:Ne(be([ze(()=>et()),ye()])),encodedLength:le(),encodedMerkleRoot:ze(()=>nt()),gasLimit:le(),gasUsed:le(),heightCreated:le(),heightIncluded:le(),outcomeRoot:ze(()=>nt()),outgoingReceiptsRoot:ze(()=>nt()),prevBlockHash:ze(()=>nt()),prevStateRoot:ze(()=>nt()),rentPaid:ue(),shardId:ze(()=>jn()),signature:ze(()=>Vn()),txRoot:ze(()=>nt()),validatorProposals:Ie(ze(()=>Io())),validatorReward:ue()}),et=()=>ke({allowedShard:le(),bufferedReceiptsGas:ue(),delayedReceiptsGas:ue(),receiptBytes:le()}),tt=()=>Re(ue(),_e()),nt=()=>ue(),ot=()=>ke({actions:Ie(ze(()=>Ot())),maxBlockHeight:le(),nonce:le(),publicKey:ze(()=>Ht()),receiverId:ze(()=>je()),senderId:ze(()=>je())}),st=()=>ke({beneficiaryId:ze(()=>je())}),at=()=>ke({publicKey:ze(()=>Ht())}),rt=()=>ke({code:ue()}),it=()=>ke({code:ue(),deployMode:ze(()=>bt())}),ct=()=>ke({blockProductionDelayMillis:le(),catchupStatus:Ie(ze(()=>ke({blocksToCatchup:Ie(ze(()=>Je())),shardSyncStatus:Re(ue(),_e()),syncBlockHash:ze(()=>nt()),syncBlockHeight:le()}))),currentHeadStatus:ze(()=>Je()),currentHeaderHeadStatus:ze(()=>Je()),networkInfo:ze(()=>qt()),syncStatus:ue()}),ut=()=>ke({nanos:le(),secs:le()}),dt=()=>ze(()=>nt()),lt=()=>ke({gasProfile:Ne(Ie(ze(()=>ke({cost:ue(),costCategory:ue(),gasUsed:ue()})))),version:le()}),pt=()=>ke({blockHash:ze(()=>nt()),id:ze(()=>nt()),outcome:ze(()=>ke({executorId:ze(()=>je()),gasBurnt:le(),logs:Ie(ue()),metadata:Ne(ze(()=>lt())),receiptIds:Ie(ze(()=>nt())),status:ze(()=>ht()),tokensBurnt:ue()})),proof:Ie(ze(()=>Nt()))}),ht=()=>be([we(["Unknown"]),ke({Failure:ze(()=>po())}),ke({SuccessValue:ue()}),ke({SuccessReceiptId:ze(()=>nt())})]),mt=()=>be([ke({S3:ke({bucket:ue(),region:ue()})}),ke({Filesystem:ke({rootDir:ue()})}),ke({GCS:ke({bucket:ue()})})]),yt=()=>ke({execution:le(),sendNotSir:le(),sendSir:le()}),gt=()=>be([we(["NotStarted"]),we(["Started"]),ke({Failure:ze(()=>po())}),ke({SuccessValue:ue()})]),_t=()=>we(["optimistic","near-final","final"]),ft=()=>ue(),It=()=>ke({args:ue(),deposit:ue(),gas:le(),methodName:ue()}),vt=()=>be([we(["WasmUnknownError","_EVMError"]),ke({CompilationError:ze(()=>be([ke({CodeDoesNotExist:ke({accountId:ze(()=>je())})}),ke({PrepareError:ze(()=>Kt())}),ke({WasmerCompileError:ke({msg:ue()})})]))}),ke({LinkError:ke({msg:ue()})}),ke({MethodResolveError:ze(()=>Mt())}),ke({WasmTrap:ze(()=>bo())}),ke({HostError:ze(()=>Pt())}),ke({ExecutionError:ue()})]),kt=()=>ke({allowance:Ne(ue()),methodNames:Ie(ue()),receiverId:ue()}),Et=()=>ke({avgHiddenValidatorSeatsPerShard:Ie(le()),blockProducerKickoutThreshold:le(),chainId:ue(),chunkProducerAssignmentChangesLimit:Ne(le()),chunkProducerKickoutThreshold:le(),chunkValidatorOnlyKickoutThreshold:Ne(le()),dynamicResharding:he(),epochLength:le(),fishermenThreshold:ue(),gasLimit:le(),gasPriceAdjustmentRate:Ie(le()),genesisHeight:le(),genesisTime:ue(),maxGasPrice:ue(),maxInflationRate:Ie(le()),maxKickoutStakePerc:Ne(le()),minGasPrice:ue(),minimumStakeDivisor:Ne(le()),minimumStakeRatio:Ne(Ie(le())),minimumValidatorsPerShard:Ne(le()),numBlockProducerSeats:le(),numBlockProducerSeatsPerShard:Ie(le()),numBlocksPerYear:le(),numChunkOnlyProducerSeats:Ne(le()),numChunkProducerSeats:Ne(le()),numChunkValidatorSeats:Ne(le()),onlineMaxThreshold:Ne(Ie(le())),onlineMinThreshold:Ne(Ie(le())),protocolRewardRate:Ie(le()),protocolTreasuryAccount:ze(()=>je()),protocolUpgradeStakeThreshold:Ne(Ie(le())),protocolVersion:le(),shardLayout:Ne(ze(()=>Kn())),shuffleShardAssignmentForChunkProducers:Ne(he()),targetValidatorMandatesPerShard:Ne(le()),totalSupply:ue(),transactionValidityPeriod:le(),useProductionConfig:Ne(he()),validators:Ie(ze(()=>ke({accountId:ze(()=>je()),amount:ue(),publicKey:ze(()=>Ht())})))}),bt=()=>be([we(["CodeHash"]),we(["AccountId"])]),St=()=>be([ke({CodeHash:ze(()=>nt())}),ke({AccountId:ze(()=>je())})]),Pt=()=>be([we(["BadUTF16"]),we(["BadUTF8"]),we(["GasExceeded"]),we(["GasLimitExceeded"]),we(["BalanceExceeded"]),we(["EmptyMethodName"]),ke({GuestPanic:ke({panicMsg:ue()})}),we(["IntegerOverflow"]),ke({InvalidPromiseIndex:ke({promiseIdx:le()})}),we(["CannotAppendActionToJointPromise"]),we(["CannotReturnJointPromise"]),ke({InvalidPromiseResultIndex:ke({resultIdx:le()})}),ke({InvalidRegisterId:ke({registerId:le()})}),ke({IteratorWasInvalidated:ke({iteratorIndex:le()})}),we(["MemoryAccessViolation"]),ke({InvalidReceiptIndex:ke({receiptIndex:le()})}),ke({InvalidIteratorIndex:ke({iteratorIndex:le()})}),we(["InvalidAccountId"]),we(["InvalidMethodName"]),we(["InvalidPublicKey"]),ke({ProhibitedInView:ke({methodName:ue()})}),ke({NumberOfLogsExceeded:ke({limit:le()})}),ke({KeyLengthExceeded:ke({length:le(),limit:le()})}),ke({ValueLengthExceeded:ke({length:le(),limit:le()})}),ke({TotalLogLengthExceeded:ke({length:le(),limit:le()})}),ke({NumberPromisesExceeded:ke({limit:le(),numberOfPromises:le()})}),ke({NumberInputDataDependenciesExceeded:ke({limit:le(),numberOfInputDataDependencies:le()})}),ke({ReturnedValueLengthExceeded:ke({length:le(),limit:le()})}),ke({ContractSizeExceeded:ke({limit:le(),size:le()})}),ke({Deprecated:ke({methodName:ue()})}),ke({ECRecoverError:ke({msg:ue()})}),ke({AltBn128InvalidInput:ke({msg:ue()})}),ke({Ed25519VerifyInvalidInput:ke({msg:ue()})})]),Tt=()=>be([ke({AccessKeyNotFound:ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht())})}),ke({ReceiverMismatch:ke({akReceiver:ue(),txReceiver:ze(()=>je())})}),ke({MethodNameMismatch:ke({methodName:ue()})}),we(["RequiresFullAccess"]),ke({NotEnoughAllowance:ke({accountId:ze(()=>je()),allowance:ue(),cost:ue(),publicKey:ze(()=>Ht())})}),we(["DepositWithFunctionCall"])]),Rt=()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_genesis_config"]),params:ze(()=>ye())}),xt=()=>be([ke({result:ze(()=>dn())}),ke({error:ze(()=>tn())})]),wt=()=>be([ke({result:ze(()=>An())}),ke({error:ze(()=>tn())})]),At=()=>be([ke({result:ze(()=>Nn())}),ke({error:ze(()=>tn())})]),Bt=()=>ke({innerLite:ze(()=>Ze()),innerRestHash:ze(()=>nt()),prevBlockHash:ze(()=>nt())}),Ct=()=>ke({accountIdValidityRulesVersion:Ne(ze(()=>le())),initialMemoryPages:le(),maxActionsPerReceipt:le(),maxArgumentsLength:le(),maxContractSize:le(),maxFunctionsNumberPerContract:Ne(le()),maxGasBurnt:le(),maxLengthMethodName:le(),maxLengthReturnedData:le(),maxLengthStorageKey:le(),maxLengthStorageValue:le(),maxLocalsPerContract:Ne(le()),maxMemoryPages:le(),maxNumberBytesMethodNames:le(),maxNumberInputDataDependencies:le(),maxNumberLogs:le(),maxNumberRegisters:le(),maxPromisesPerFunctionCallAction:le(),maxReceiptSize:le(),maxRegisterSize:le(),maxStackHeight:le(),maxTotalLogLength:le(),maxTotalPrepaidGas:le(),maxTransactionSize:le(),maxYieldPayloadSize:le(),perReceiptStorageProofSizeLimit:le(),registersMemoryLimit:le(),yieldTimeoutLengthInBlocks:le()}),Nt=()=>ke({direction:ze(()=>we(["Left","Right"])),hash:ze(()=>nt())}),Mt=()=>we(["MethodEmptyName","MethodNotFound","MethodInvalidSignature"]),zt=()=>be([we(["TrieIterator"]),we(["TriePrefetchingStorage"]),we(["TrieMemoryPartialStorage"]),we(["TrieStorage"])]),Lt=()=>ue(),qt=()=>ke({connectedPeers:Ie(ze(()=>jt())),knownProducers:Ie(ze(()=>ke({accountId:ze(()=>je()),nextHops:Ne(Ie(ze(()=>Ht()))),peerId:ze(()=>Ht())}))),numConnectedPeers:le(),peerMaxCount:le(),tier1AccountsData:Ie(ze(()=>ke({accountKey:ze(()=>Ht()),peerId:ze(()=>Ht()),proxies:Ie(ze(()=>co())),timestamp:ue()}))),tier1AccountsKeys:Ie(ze(()=>Ht())),tier1Connections:Ie(ze(()=>jt()))}),Ot=()=>ze(()=>be([ke({CreateAccount:ze(()=>tt())}),ke({DeployContract:ze(()=>rt())}),ke({FunctionCall:ze(()=>It())}),ke({Transfer:ze(()=>lo())}),ke({Stake:ze(()=>Wn())}),ke({AddKey:ze(()=>Fe())}),ke({DeleteKey:ze(()=>at())}),ke({DeleteAccount:ze(()=>st())}),ke({Delegate:ze(()=>Fn())}),ke({DeployGlobalContract:ze(()=>it())}),ke({UseGlobalContract:ze(()=>mo())})])),Dt=()=>ze(()=>Ht()),jt=()=>ke({accountId:Ne(be([ze(()=>je()),ye()])),addr:ue(),archival:he(),blockHash:Ne(be([ze(()=>nt()),ye()])),connectionEstablishedTimeMillis:le(),height:Ne(le()),isHighestBlockInvalid:he(),isOutboundPeer:he(),lastTimePeerRequestedMillis:le(),lastTimeReceivedMessageMillis:le(),nonce:le(),peerId:ze(()=>Ht()),receivedBytesPerSec:le(),sentBytesPerSec:le(),trackedShards:Ie(ze(()=>jn()))}),Kt=()=>be([we(["Serialization"]),we(["Deserialization"]),we(["InternalMemoryDeclared"]),we(["GasInstrumentation"]),we(["StackHeightInstrumentation"]),we(["Instantiate"]),we(["Memory"]),we(["TooManyFunctions"]),we(["TooManyLocals"])]),Ht=()=>ue(),$t=()=>ke({end:le(),start:le()}),Xt=()=>be([ke({Action:ke({actions:Ie(ze(()=>Xe())),gasPrice:ue(),inputDataIds:Ie(ze(()=>nt())),isPromiseYield:Ne(he()),outputDataReceivers:Ie(ze(()=>ke({dataId:ze(()=>nt()),receiverId:ze(()=>je())}))),signerId:ze(()=>je()),signerPublicKey:ze(()=>Ht())})}),ke({Data:ke({data:Ne(ue()),dataId:ze(()=>nt()),isPromiseResume:Ne(he())})}),ke({GlobalContractDistribution:ke({alreadyDeliveredShards:Ie(ze(()=>jn())),code:ue(),id:ze(()=>St()),targetShard:ze(()=>jn())})})]),Vt=()=>be([ke({InvalidPredecessorId:ke({accountId:ue()})}),ke({InvalidReceiverId:ke({accountId:ue()})}),ke({InvalidSignerId:ke({accountId:ue()})}),ke({InvalidDataReceiverId:ke({accountId:ue()})}),ke({ReturnedValueLengthExceeded:ke({length:le(),limit:le()})}),ke({NumberInputDataDependenciesExceeded:ke({limit:le(),numberOfInputDataDependencies:le()})}),ke({ActionsValidation:ze(()=>Ve())}),ke({ReceiptSizeExceeded:ke({limit:le(),size:le()})})]),Ft=()=>ke({predecessorId:ze(()=>je()),priority:Ne(le()),receipt:ze(()=>Xt()),receiptId:ze(()=>nt()),receiverId:ze(()=>je())}),Gt=()=>be([ke({blockId:ze(()=>We())}),ke({finality:ze(()=>_t())}),ke({syncCheckpoint:ze(()=>ao())})]),Ut=()=>ke({author:ze(()=>je()),chunks:Ie(ze(()=>Qe())),header:ze(()=>ke({approvals:Ie(be([ze(()=>Vn()),ye()])),blockBodyHash:Ne(be([ze(()=>nt()),ye()])),blockMerkleRoot:ze(()=>nt()),blockOrdinal:Ne(le()),challengesResult:Ie(ze(()=>Zn())),challengesRoot:ze(()=>nt()),chunkEndorsements:Ne(Ie(Ie(le()))),chunkHeadersRoot:ze(()=>nt()),chunkMask:Ie(he()),chunkReceiptsRoot:ze(()=>nt()),chunkTxRoot:ze(()=>nt()),chunksIncluded:le(),epochId:ze(()=>nt()),epochSyncDataHash:Ne(be([ze(()=>nt()),ye()])),gasPrice:ue(),hash:ze(()=>nt()),height:le(),lastDsFinalBlock:ze(()=>nt()),lastFinalBlock:ze(()=>nt()),latestProtocolVersion:le(),nextBpHash:ze(()=>nt()),nextEpochId:ze(()=>nt()),outcomeRoot:ze(()=>nt()),prevHash:ze(()=>nt()),prevHeight:Ne(le()),prevStateRoot:ze(()=>nt()),randomValue:ze(()=>nt()),rentPaid:ue(),signature:ze(()=>Vn()),timestamp:le(),timestampNanosec:ue(),totalSupply:ue(),validatorProposals:Ie(ze(()=>Io())),validatorReward:ue()}))}),Zt=()=>be([ke({blockId:ze(()=>We()),shardId:ze(()=>jn())}),ke({chunkId:ze(()=>nt())})]),Wt=()=>ke({author:ze(()=>je()),header:ze(()=>Qe()),receipts:Ie(ze(()=>Ft())),transactions:Ie(ze(()=>Un()))}),Jt=()=>ye(),Yt=()=>ke({archive:he(),blockFetchHorizon:le(),blockHeaderFetchHorizon:le(),blockProductionTrackingDelay:Ie(le()),catchupStepPeriod:Ie(le()),chainId:ue(),chunkDistributionNetwork:Ne(be([ze(()=>ke({enabled:he(),uris:ze(()=>Ye())})),ye()])),chunkRequestRetryPeriod:Ie(le()),chunkWaitMult:Ie(le()),clientBackgroundMigrationThreads:le(),doomslugStepPeriod:Ie(le()),enableMultilineLogging:he(),enableStatisticsExport:he(),epochLength:le(),epochSync:ze(()=>ke({disableEpochSyncForBootstrapping:Ne(he()),epochSyncHorizon:le(),ignoreEpochSyncNetworkRequests:Ne(he()),timeoutForEpochSync:ze(()=>ut())})),expectedShutdown:ze(()=>Lt()),gc:ze(()=>ke({gcBlocksLimit:Ne(le()),gcForkCleanStep:Ne(le()),gcNumEpochsToKeep:Ne(le()),gcStepPeriod:Ne(ze(()=>ut()))})),headerSyncExpectedHeightPerSecond:le(),headerSyncInitialTimeout:Ie(le()),headerSyncProgressTimeout:Ie(le()),headerSyncStallBanTimeout:Ie(le()),logSummaryPeriod:Ie(le()),logSummaryStyle:ze(()=>we(["plain","colored"])),maxBlockProductionDelay:Ie(le()),maxBlockWaitDelay:Ie(le()),maxGasBurntView:Ne(le()),minBlockProductionDelay:Ie(le()),minNumPeers:le(),numBlockProducerSeats:le(),orphanStateWitnessMaxSize:le(),orphanStateWitnessPoolSize:le(),produceChunkAddTransactionsTimeLimit:ue(),produceEmptyBlocks:he(),reshardingConfig:ze(()=>Lt()),rpcAddr:Ne(ue()),saveInvalidWitnesses:he(),saveLatestWitnesses:he(),saveTrieChanges:he(),saveTxOutcomes:he(),skipSyncWait:he(),stateSync:ze(()=>Qn()),stateSyncEnabled:he(),stateSyncExternalBackoff:Ie(le()),stateSyncExternalTimeout:Ie(le()),stateSyncP2pTimeout:Ie(le()),stateSyncRetryBackoff:Ie(le()),syncCheckPeriod:Ie(le()),syncHeightThreshold:le(),syncMaxBlockRequests:le(),syncStepPeriod:Ie(le()),trackedShardsConfig:ze(()=>uo()),transactionPoolSizeLimit:Ne(le()),transactionRequestHandlerThreads:le(),trieViewerStateSizeLimit:Ne(le()),ttlAccountIdRouter:Ie(le()),txRoutingHeightHorizon:le(),version:ze(()=>ko()),viewClientNumStateRequestsPerThrottlePeriod:le(),viewClientThreads:le(),viewClientThrottlePeriod:Ie(le())}),Qt=()=>be([ke({blockId:ze(()=>We()),shardId:ze(()=>jn())}),ke({chunkId:ze(()=>nt())})]),en=()=>ke({congestionLevel:le()}),tn=()=>be([ke({cause:ze(()=>bn()),name:we(["REQUEST_VALIDATION_ERROR"])}),ke({cause:_e(),name:we(["HANDLER_ERROR"])}),ke({cause:_e(),name:we(["INTERNAL_ERROR"])})]),nn=()=>ke({blockId:Ne(be([ze(()=>We()),ye()]))}),on=()=>ke({gasPrice:ue()}),sn=()=>ye(),an=()=>ye(),rn=()=>ke({blockHash:ze(()=>nt()),lightClientHead:ze(()=>nt())}),cn=()=>ke({blockHeaderLite:ze(()=>Bt()),blockProof:Ie(ze(()=>Nt()))}),un=()=>be([ke({senderId:ze(()=>je()),transactionHash:ze(()=>nt()),type:we(["transaction"])}),ke({receiptId:ze(()=>nt()),receiverId:ze(()=>je()),type:we(["receipt"])})]),dn=()=>ke({blockHeaderLite:ze(()=>Bt()),blockProof:Ie(ze(()=>Nt())),outcomeProof:ze(()=>pt()),outcomeRootProof:Ie(ze(()=>Nt()))}),ln=()=>ke({lastBlockHash:ze(()=>nt())}),pn=()=>ke({approvalsAfterNext:Ne(Ie(be([ze(()=>Vn()),ye()]))),innerLite:Ne(ze(()=>Ze())),innerRestHash:Ne(ze(()=>nt())),nextBlockInnerHash:Ne(ze(()=>nt())),nextBps:Ne(Ie(ze(()=>Io()))),prevBlockHash:Ne(ze(()=>nt()))}),hn=()=>ke({accountId:ze(()=>je())}),mn=()=>ye(),yn=()=>ke({activePeers:Ie(ze(()=>gn())),knownProducers:Ie(ze(()=>ke({accountId:ze(()=>je()),addr:Ne(ue()),peerId:ze(()=>Dt())}))),numActivePeers:le(),peerMaxCount:le(),receivedBytesPerSec:le(),sentBytesPerSec:le()}),gn=()=>ke({accountId:Ne(be([ze(()=>je()),ye()])),addr:Ne(ue()),id:ze(()=>Dt())}),_n=()=>be([ke({blockId:ze(()=>We())}),ke({finality:ze(()=>_t())}),ke({syncCheckpoint:ze(()=>ao())})]),fn=()=>ke({avgHiddenValidatorSeatsPerShard:Ie(le()),blockProducerKickoutThreshold:le(),chainId:ue(),chunkProducerKickoutThreshold:le(),chunkValidatorOnlyKickoutThreshold:le(),dynamicResharding:he(),epochLength:le(),fishermenThreshold:ue(),gasLimit:le(),gasPriceAdjustmentRate:Ie(le()),genesisHeight:le(),genesisTime:ue(),maxGasPrice:ue(),maxInflationRate:Ie(le()),maxKickoutStakePerc:le(),minGasPrice:ue(),minimumStakeDivisor:le(),minimumStakeRatio:Ie(le()),minimumValidatorsPerShard:le(),numBlockProducerSeats:le(),numBlockProducerSeatsPerShard:Ie(le()),numBlocksPerYear:le(),onlineMaxThreshold:Ie(le()),onlineMinThreshold:Ie(le()),protocolRewardRate:Ie(le()),protocolTreasuryAccount:ze(()=>je()),protocolUpgradeStakeThreshold:Ie(le()),protocolVersion:le(),runtimeConfig:ze(()=>On()),shardLayout:ze(()=>Kn()),shuffleShardAssignmentForChunkProducers:he(),targetValidatorMandatesPerShard:le(),transactionValidityPeriod:le()}),In=()=>be([Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),requestType:we(["view_account"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),requestType:we(["view_code"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),includeProof:Ne(he()),prefixBase64:ze(()=>oo()),requestType:we(["view_state"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht()),requestType:we(["view_access_key"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),requestType:we(["view_access_key_list"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),argsBase64:ze(()=>ft()),methodName:ue(),requestType:we(["call_function"])})),Pe(ke({blockId:ze(()=>We())}),ke({codeHash:ze(()=>nt()),requestType:we(["view_global_contract_code"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>je()),requestType:we(["view_global_contract_code_by_account_id"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),requestType:we(["view_account"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),requestType:we(["view_code"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),includeProof:Ne(he()),prefixBase64:ze(()=>oo()),requestType:we(["view_state"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht()),requestType:we(["view_access_key"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),requestType:we(["view_access_key_list"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),argsBase64:ze(()=>ft()),methodName:ue(),requestType:we(["call_function"])})),Pe(ke({finality:ze(()=>_t())}),ke({codeHash:ze(()=>nt()),requestType:we(["view_global_contract_code"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>je()),requestType:we(["view_global_contract_code_by_account_id"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),requestType:we(["view_account"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),requestType:we(["view_code"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),includeProof:Ne(he()),prefixBase64:ze(()=>oo()),requestType:we(["view_state"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht()),requestType:we(["view_access_key"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),requestType:we(["view_access_key_list"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),argsBase64:ze(()=>ft()),methodName:ue(),requestType:we(["call_function"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({codeHash:ze(()=>nt()),requestType:we(["view_global_contract_code"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>je()),requestType:we(["view_global_contract_code_by_account_id"])}))]),vn=()=>be([ze(()=>ke({amount:ue(),codeHash:ze(()=>nt()),globalContractAccountId:Ne(be([ze(()=>je()),ye()])),globalContractHash:Ne(be([ze(()=>nt()),ye()])),locked:ue(),storagePaidAt:Ne(le()),storageUsage:le()})),ze(()=>ke({codeBase64:ue(),hash:ze(()=>nt())})),ze(()=>Eo()),ze(()=>ke({logs:Ie(ue()),result:Ie(le())})),ze(()=>De()),ze(()=>Le())]),kn=()=>ke({receiptId:ze(()=>nt())}),En=()=>ke({predecessorId:ze(()=>je()),priority:Ne(le()),receipt:ze(()=>Xt()),receiptId:ze(()=>nt()),receiverId:ze(()=>je())}),bn=()=>be([ke({info:ke({methodName:ue()}),name:we(["METHOD_NOT_FOUND"])}),ke({info:ke({errorMessage:ue()}),name:we(["PARSE_ERROR"])})]),Sn=()=>ke({signedTxBase64:ze(()=>Gn()),waitUntil:Ne(ze(()=>ho()))}),Pn=()=>Re(ue(),_e()),Tn=()=>ke({coldHeadHeight:Ne(le()),finalHeadHeight:Ne(le()),headHeight:Ne(le()),hotDbKind:Ne(ue())}),Rn=()=>be([Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["account_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({changesType:we(["single_access_key_changes"]),keys:Ie(ze(()=>Ke()))})),Pe(ke({blockId:ze(()=>We())}),ke({changesType:we(["single_gas_key_changes"]),keys:Ie(ze(()=>Ke()))})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["all_access_key_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["all_gas_key_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["contract_code_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["data_changes"]),keyPrefixBase64:ze(()=>oo())})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["account_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({changesType:we(["single_access_key_changes"]),keys:Ie(ze(()=>Ke()))})),Pe(ke({finality:ze(()=>_t())}),ke({changesType:we(["single_gas_key_changes"]),keys:Ie(ze(()=>Ke()))})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["all_access_key_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["all_gas_key_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["contract_code_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["data_changes"]),keyPrefixBase64:ze(()=>oo())})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["account_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({changesType:we(["single_access_key_changes"]),keys:Ie(ze(()=>Ke()))})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({changesType:we(["single_gas_key_changes"]),keys:Ie(ze(()=>Ke()))})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["all_access_key_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["all_gas_key_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["contract_code_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>je())),changesType:we(["data_changes"]),keyPrefixBase64:ze(()=>oo())}))]),xn=()=>ke({blockHash:ze(()=>nt()),changes:Ie(ze(()=>Jn()))}),wn=()=>be([ke({blockId:ze(()=>We())}),ke({finality:ze(()=>_t())}),ke({syncCheckpoint:ze(()=>ao())})]),An=()=>ke({blockHash:ze(()=>nt()),changes:Ie(ze(()=>Yn()))}),Bn=()=>ye(),Cn=()=>ke({chainId:ue(),detailedDebugStatus:Ne(be([ze(()=>ct()),ye()])),genesisHash:ze(()=>nt()),latestProtocolVersion:le(),nodeKey:Ne(be([ze(()=>Ht()),ye()])),nodePublicKey:ze(()=>Ht()),protocolVersion:le(),rpcAddr:Ne(ue()),syncInfo:ze(()=>eo()),uptimeSec:le(),validatorAccountId:Ne(be([ze(()=>je()),ye()])),validatorPublicKey:Ne(be([ze(()=>Ht()),ye()])),validators:Ie(ze(()=>_o())),version:ze(()=>ko())}),Nn=()=>be([ze(()=>ke({receipts:Ie(ze(()=>Ft())),receiptsOutcome:Ie(ze(()=>pt())),status:ze(()=>gt()),transaction:ze(()=>Un()),transactionOutcome:ze(()=>pt())})),ze(()=>ke({receiptsOutcome:Ie(ze(()=>pt())),status:ze(()=>gt()),transaction:ze(()=>Un()),transactionOutcome:ze(()=>pt())}))]),Mn=()=>be([ke({signedTxBase64:ze(()=>Gn())}),ke({senderAccountId:ze(()=>je()),txHash:ze(()=>nt())})]),zn=()=>be([we(["latest"]),ke({epochId:ze(()=>dt())}),ke({blockId:ze(()=>We())})]),Ln=()=>ke({currentFishermen:Ie(ze(()=>Io())),currentProposals:Ie(ze(()=>Io())),currentValidators:Ie(ze(()=>ke({accountId:ze(()=>je()),isSlashed:he(),numExpectedBlocks:le(),numExpectedChunks:Ne(le()),numExpectedChunksPerShard:Ne(Ie(le())),numExpectedEndorsements:Ne(le()),numExpectedEndorsementsPerShard:Ne(Ie(le())),numProducedBlocks:le(),numProducedChunks:Ne(le()),numProducedChunksPerShard:Ne(Ie(le())),numProducedEndorsements:Ne(le()),numProducedEndorsementsPerShard:Ne(Ie(le())),publicKey:ze(()=>Ht()),shards:Ie(ze(()=>jn())),shardsEndorsed:Ne(Ie(ze(()=>jn()))),stake:ue()}))),epochHeight:le(),epochStartHeight:le(),nextFishermen:Ie(ze(()=>Io())),nextValidators:Ie(ze(()=>ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht()),shards:Ie(ze(()=>jn())),stake:ue()}))),prevEpochKickout:Ie(ze(()=>fo()))}),qn=()=>ke({blockId:Ne(be([ze(()=>We()),ye()]))}),On=()=>ke({accountCreationConfig:ze(()=>ke({minAllowedTopLevelAccountLength:le(),registrarAccountId:ze(()=>je())})),congestionControlConfig:ze(()=>ke({allowedShardOutgoingGas:le(),maxCongestionIncomingGas:le(),maxCongestionMemoryConsumption:le(),maxCongestionMissedChunks:le(),maxCongestionOutgoingGas:le(),maxOutgoingGas:le(),maxTxGas:le(),minOutgoingGas:le(),minTxGas:le(),outgoingReceiptsBigSizeLimit:le(),outgoingReceiptsUsualSizeLimit:le(),rejectTxCongestionThreshold:le()})),storageAmountPerByte:ue(),transactionCosts:ze(()=>Dn()),wasmConfig:ze(()=>yo()),witnessConfig:ze(()=>So())}),Dn=()=>ke({actionCreationConfig:ze(()=>He()),actionReceiptCreationConfig:ze(()=>yt()),burntGasReward:Ie(le()),dataReceiptCreationConfig:ze(()=>ke({baseCost:ze(()=>yt()),costPerByte:ze(()=>yt())})),pessimisticGasPriceInflationRatio:Ie(le()),storageUsageConfig:ze(()=>no())}),jn=()=>le(),Kn=()=>be([ke({V0:ze(()=>Hn())}),ke({V1:ze(()=>$n())}),ke({V2:ze(()=>Xn())})]),Hn=()=>ke({numShards:le(),version:le()}),$n=()=>ke({boundaryAccounts:Ie(ze(()=>je())),shardsSplitMap:Ne(Ie(Ie(ze(()=>jn())))),toParentShardMap:Ne(Ie(ze(()=>jn()))),version:le()}),Xn=()=>ke({boundaryAccounts:Ie(ze(()=>je())),idToIndexMap:Re(ue(),le()),indexToIdMap:Re(ue(),ze(()=>jn())),shardIds:Ie(ze(()=>jn())),shardsParentMap:Ne(Re(ue(),ze(()=>jn()))),shardsSplitMap:Ne(Re(ue(),Ie(ze(()=>jn())))),version:le()}),Vn=()=>ue(),Fn=()=>ke({delegateAction:ze(()=>ot()),signature:ze(()=>Vn())}),Gn=()=>ue(),Un=()=>ke({actions:Ie(ze(()=>Xe())),hash:ze(()=>nt()),nonce:le(),priorityFee:Ne(le()),publicKey:ze(()=>Ht()),receiverId:ze(()=>je()),signature:ze(()=>Vn()),signerId:ze(()=>je())}),Zn=()=>ke({accountId:ze(()=>je()),isDoubleSign:he()}),Wn=()=>ke({publicKey:ze(()=>Ht()),stake:ue()}),Jn=()=>be([ke({accountId:ze(()=>je()),type:we(["account_touched"])}),ke({accountId:ze(()=>je()),type:we(["access_key_touched"])}),ke({accountId:ze(()=>je()),type:we(["data_touched"])}),ke({accountId:ze(()=>je()),type:we(["contract_code_touched"])})]),Yn=()=>be([ke({change:ke({accountId:ze(()=>je()),amount:ue(),codeHash:ze(()=>nt()),globalContractAccountId:Ne(be([ze(()=>je()),ye()])),globalContractHash:Ne(be([ze(()=>nt()),ye()])),locked:ue(),storagePaidAt:Ne(le()),storageUsage:le()}),type:we(["account_update"])}),ke({change:ke({accountId:ze(()=>je())}),type:we(["account_deletion"])}),ke({change:ke({accessKey:ze(()=>De()),accountId:ze(()=>je()),publicKey:ze(()=>Ht())}),type:we(["access_key_update"])}),ke({change:ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht())}),type:we(["access_key_deletion"])}),ke({change:ke({accountId:ze(()=>je()),gasKey:ze(()=>ke({balance:le(),numNonces:le(),permission:ze(()=>Oe())})),publicKey:ze(()=>Ht())}),type:we(["gas_key_update"])}),ke({change:ke({accountId:ze(()=>je()),index:le(),nonce:le(),publicKey:ze(()=>Ht())}),type:we(["gas_key_nonce_update"])}),ke({change:ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht())}),type:we(["gas_key_deletion"])}),ke({change:ke({accountId:ze(()=>je()),keyBase64:ze(()=>oo()),valueBase64:ze(()=>so())}),type:we(["data_update"])}),ke({change:ke({accountId:ze(()=>je()),keyBase64:ze(()=>oo())}),type:we(["data_deletion"])}),ke({change:ke({accountId:ze(()=>je()),codeBase64:ue()}),type:we(["contract_code_update"])}),ke({change:ke({accountId:ze(()=>je())}),type:we(["contract_code_deletion"])})]),Qn=()=>ke({concurrency:Ne(ze(()=>ro())),dump:Ne(be([ze(()=>ke({credentialsFile:Ne(ue()),iterationDelay:Ne(be([ze(()=>ut()),ye()])),location:ze(()=>mt()),restartDumpForShards:Ne(Ie(ze(()=>jn())))})),ye()])),sync:Ne(ze(()=>io()))}),eo=()=>ke({earliestBlockHash:Ne(be([ze(()=>nt()),ye()])),earliestBlockHeight:Ne(le()),earliestBlockTime:Ne(ue()),epochId:Ne(be([ze(()=>dt()),ye()])),epochStartHeight:Ne(le()),latestBlockHash:ze(()=>nt()),latestBlockHeight:le(),latestBlockTime:ue(),latestStateRoot:ze(()=>nt()),syncing:he()}),to=()=>be([we(["StorageInternalError"]),ke({MissingTrieValue:ze(()=>ke({context:ze(()=>zt()),hash:ze(()=>nt())}))}),we(["UnexpectedTrieValue"]),ke({StorageInconsistentState:ue()}),ke({FlatStorageBlockNotSupported:ue()}),ke({MemTrieLoadingError:ue()})]),no=()=>ke({numBytesAccount:le(),numExtraBytesRecord:le()}),oo=()=>ue(),so=()=>ue(),ao=()=>we(["genesis","earliest_available"]),ro=()=>ke({apply:le(),applyDuringCatchup:le(),peerDownloads:le(),perShard:le()}),io=()=>be([we(["Peers"]),ke({ExternalStorage:ze(()=>ke({externalStorageFallbackThreshold:Ne(le()),location:ze(()=>mt()),numConcurrentRequests:Ne(le()),numConcurrentRequestsDuringCatchup:Ne(le())}))})]),co=()=>ke({addr:ue(),peerId:ze(()=>Ht())}),uo=()=>be([we(["NoShards"]),ke({Shards:Ie(ze(()=>ke({shardId:le(),version:le()})))}),we(["AllShards"]),ke({ShadowValidator:ze(()=>je())}),ke({Schedule:Ie(Ie(ze(()=>jn())))}),ke({Accounts:Ie(ze(()=>je()))})]),lo=()=>ke({deposit:ue()}),po=()=>be([ke({ActionError:ze(()=>ke({index:Ne(le()),kind:ze(()=>$e())}))}),ke({InvalidTxError:ze(()=>be([ke({InvalidAccessKeyError:ze(()=>Tt())}),ke({InvalidSignerId:ke({signerId:ue()})}),ke({SignerDoesNotExist:ke({signerId:ze(()=>je())})}),ke({InvalidNonce:ke({akNonce:le(),txNonce:le()})}),ke({NonceTooLarge:ke({txNonce:le(),upperBound:le()})}),ke({InvalidReceiverId:ke({receiverId:ue()})}),we(["InvalidSignature"]),ke({NotEnoughBalance:ke({balance:ue(),cost:ue(),signerId:ze(()=>je())})}),ke({LackBalanceForState:ke({amount:ue(),signerId:ze(()=>je())})}),we(["CostOverflow"]),we(["InvalidChain"]),we(["Expired"]),ke({ActionsValidation:ze(()=>Ve())}),ke({TransactionSizeExceeded:ke({limit:le(),size:le()})}),we(["InvalidTransactionVersion"]),ke({StorageError:ze(()=>to())}),ke({ShardCongested:ke({congestionLevel:le(),shardId:le()})}),ke({ShardStuck:ke({missedChunks:le(),shardId:le()})})]))})]),ho=()=>be([we(["NONE"]),we(["INCLUDED"]),we(["EXECUTED_OPTIMISTIC"]),we(["INCLUDED_FINAL"]),we(["EXECUTED"]),we(["FINAL"])]),mo=()=>ke({contractIdentifier:ze(()=>St())}),yo=()=>ke({discardCustomSections:he(),ethImplicitAccounts:he(),extCosts:ze(()=>ke({altBn128G1MultiexpBase:le(),altBn128G1MultiexpElement:le(),altBn128G1SumBase:le(),altBn128G1SumElement:le(),altBn128PairingCheckBase:le(),altBn128PairingCheckElement:le(),base:le(),bls12381G1MultiexpBase:le(),bls12381G1MultiexpElement:le(),bls12381G2MultiexpBase:le(),bls12381G2MultiexpElement:le(),bls12381MapFp2ToG2Base:le(),bls12381MapFp2ToG2Element:le(),bls12381MapFpToG1Base:le(),bls12381MapFpToG1Element:le(),bls12381P1DecompressBase:le(),bls12381P1DecompressElement:le(),bls12381P1SumBase:le(),bls12381P1SumElement:le(),bls12381P2DecompressBase:le(),bls12381P2DecompressElement:le(),bls12381P2SumBase:le(),bls12381P2SumElement:le(),bls12381PairingBase:le(),bls12381PairingElement:le(),contractCompileBase:le(),contractCompileBytes:le(),contractLoadingBase:le(),contractLoadingBytes:le(),ecrecoverBase:le(),ed25519VerifyBase:le(),ed25519VerifyByte:le(),keccak256Base:le(),keccak256Byte:le(),keccak512Base:le(),keccak512Byte:le(),logBase:le(),logByte:le(),promiseAndBase:le(),promiseAndPerPromise:le(),promiseReturn:le(),readCachedTrieNode:le(),readMemoryBase:le(),readMemoryByte:le(),readRegisterBase:le(),readRegisterByte:le(),ripemd160Base:le(),ripemd160Block:le(),sha256Base:le(),sha256Byte:le(),storageHasKeyBase:le(),storageHasKeyByte:le(),storageIterCreateFromByte:le(),storageIterCreatePrefixBase:le(),storageIterCreatePrefixByte:le(),storageIterCreateRangeBase:le(),storageIterCreateToByte:le(),storageIterNextBase:le(),storageIterNextKeyByte:le(),storageIterNextValueByte:le(),storageLargeReadOverheadBase:le(),storageLargeReadOverheadByte:le(),storageReadBase:le(),storageReadKeyByte:le(),storageReadValueByte:le(),storageRemoveBase:le(),storageRemoveKeyByte:le(),storageRemoveRetValueByte:le(),storageWriteBase:le(),storageWriteEvictedByte:le(),storageWriteKeyByte:le(),storageWriteValueByte:le(),touchingTrieNode:le(),utf16DecodingBase:le(),utf16DecodingByte:le(),utf8DecodingBase:le(),utf8DecodingByte:le(),validatorStakeBase:le(),validatorTotalStakeBase:le(),writeMemoryBase:le(),writeMemoryByte:le(),writeRegisterBase:le(),writeRegisterByte:le(),yieldCreateBase:le(),yieldCreateByte:le(),yieldResumeBase:le(),yieldResumeByte:le()})),fixContractLoadingCost:he(),globalContractHostFns:he(),growMemCost:le(),implicitAccountCreation:he(),limitConfig:ze(()=>Ct()),reftypesBulkMemory:he(),regularOpCost:le(),saturatingFloatToInt:he(),storageGetMode:ze(()=>we(["FlatStorage","Trie"])),vmKind:ze(()=>go())}),go=()=>be([we(["Wasmer0"]),we(["Wasmtime"]),we(["Wasmer2"]),we(["NearVm"]),we(["NearVm2"])]),_o=()=>ke({accountId:ze(()=>je())}),fo=()=>ke({accountId:ze(()=>je()),reason:ze(()=>be([we(["_UnusedSlashed"]),ke({NotEnoughBlocks:ke({expected:le(),produced:le()})}),ke({NotEnoughChunks:ke({expected:le(),produced:le()})}),we(["Unstaked"]),ke({NotEnoughStake:ke({stakeU128:ue(),thresholdU128:ue()})}),we(["DidNotGetASeat"]),ke({NotEnoughChunkEndorsements:ke({expected:le(),produced:le()})}),ke({ProtocolVersionTooOld:ke({networkVersion:le(),version:le()})})]))}),Io=()=>ze(()=>vo()),vo=()=>ke({accountId:ze(()=>je()),publicKey:ze(()=>Ht()),stake:ue()}),ko=()=>ke({build:ue(),commit:ue(),rustcVersion:Ne(ue()),version:ue()}),Eo=()=>ke({proof:Ne(Ie(ue())),values:Ie(ze(()=>ke({key:ze(()=>oo()),value:ze(()=>so())})))}),bo=()=>be([we(["Unreachable"]),we(["IncorrectCallIndirectSignature"]),we(["MemoryOutOfBounds"]),we(["CallIndirectOOB"]),we(["IllegalArithmetic"]),we(["MisalignedAtomicAccess"]),we(["IndirectCallToNull"]),we(["StackOverflow"]),we(["GenericTrap"])]),So=()=>ke({combinedTransactionsSizeLimit:le(),mainStorageProofSizeSoftLimit:le(),newTransactionsValidationStateSizeSoftLimit:le()}),Po={EXPERIMENTAL_changes:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_changes"]),params:ze(()=>Rn())})),responseSchema:()=>ze(()=>wt())},EXPERIMENTAL_changes_in_block:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_changes_in_block"]),params:ze(()=>wn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>xn())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_congestion_level:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_congestion_level"]),params:ze(()=>Qt())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>en())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_genesis_config:{requestSchema:()=>ze(()=>Rt()),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Et())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_light_client_block_proof:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_light_client_block_proof"]),params:ze(()=>rn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>cn())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_light_client_proof:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_light_client_proof"]),params:ze(()=>un())})),responseSchema:()=>ze(()=>xt())},EXPERIMENTAL_maintenance_windows:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_maintenance_windows"]),params:ze(()=>hn())})),responseSchema:()=>ze(()=>be([ke({result:Ie(ze(()=>$t()))}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_protocol_config:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_protocol_config"]),params:ze(()=>_n())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>fn())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_receipt:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_receipt"]),params:ze(()=>kn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>En())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_split_storage_info:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_split_storage_info"]),params:ze(()=>Pn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Tn())}),ke({error:ze(()=>tn())})]))},EXPERIMENTAL_tx_status:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_tx_status"]),params:ze(()=>Mn())})),responseSchema:()=>ze(()=>At())},EXPERIMENTAL_validators_ordered:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["EXPERIMENTAL_validators_ordered"]),params:ze(()=>qn())})),responseSchema:()=>ze(()=>be([ke({result:Ie(ze(()=>Io()))}),ke({error:ze(()=>tn())})]))},block:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["block"]),params:ze(()=>Gt())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Ut())}),ke({error:ze(()=>tn())})]))},broadcast_tx_async:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["broadcast_tx_async"]),params:ze(()=>Sn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>nt())}),ke({error:ze(()=>tn())})]))},broadcast_tx_commit:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["broadcast_tx_commit"]),params:ze(()=>Sn())})),responseSchema:()=>ze(()=>At())},changes:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["changes"]),params:ze(()=>Rn())})),responseSchema:()=>ze(()=>wt())},chunk:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["chunk"]),params:ze(()=>Zt())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Wt())}),ke({error:ze(()=>tn())})]))},client_config:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["client_config"]),params:ze(()=>Jt())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Yt())}),ke({error:ze(()=>tn())})]))},gas_price:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["gas_price"]),params:ze(()=>nn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>on())}),ke({error:ze(()=>tn())})]))},health:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["health"]),params:ze(()=>sn())})),responseSchema:()=>ze(()=>be([ke({result:be([ze(()=>an()),ye()])}),ke({error:ze(()=>tn())})]))},light_client_proof:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["light_client_proof"]),params:ze(()=>un())})),responseSchema:()=>ze(()=>xt())},network_info:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["network_info"]),params:ze(()=>mn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>yn())}),ke({error:ze(()=>tn())})]))},next_light_client_block:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["next_light_client_block"]),params:ze(()=>ln())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>pn())}),ke({error:ze(()=>tn())})]))},query:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["query"]),params:ze(()=>In())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>vn())}),ke({error:ze(()=>tn())})]))},send_tx:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["send_tx"]),params:ze(()=>Sn())})),responseSchema:()=>ze(()=>At())},status:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["status"]),params:ze(()=>Bn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Cn())}),ke({error:ze(()=>tn())})]))},tx:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["tx"]),params:ze(()=>Mn())})),responseSchema:()=>ze(()=>At())},validators:{requestSchema:()=>ze(()=>ke({id:ue(),jsonrpc:ue(),method:we(["validators"]),params:ze(()=>zn())})),responseSchema:()=>ze(()=>be([ke({result:ze(()=>Ln())}),ke({error:ze(()=>tn())})]))}},To=()=>ke({jsonrpc:Be("2.0"),id:ue(),method:ue(),params:Ne(_e())}),Ro=()=>ke({jsonrpc:Be("2.0"),id:ue(),result:Ne(_e()),error:Ne(ke({code:le(),message:ue(),data:Ne(_e())}))}),xo={"/EXPERIMENTAL_changes":"EXPERIMENTAL_changes","/EXPERIMENTAL_changes_in_block":"EXPERIMENTAL_changes_in_block","/EXPERIMENTAL_congestion_level":"EXPERIMENTAL_congestion_level","/EXPERIMENTAL_genesis_config":"EXPERIMENTAL_genesis_config","/EXPERIMENTAL_light_client_block_proof":"EXPERIMENTAL_light_client_block_proof","/EXPERIMENTAL_light_client_proof":"EXPERIMENTAL_light_client_proof","/EXPERIMENTAL_maintenance_windows":"EXPERIMENTAL_maintenance_windows","/EXPERIMENTAL_protocol_config":"EXPERIMENTAL_protocol_config","/EXPERIMENTAL_receipt":"EXPERIMENTAL_receipt","/EXPERIMENTAL_split_storage_info":"EXPERIMENTAL_split_storage_info","/EXPERIMENTAL_tx_status":"EXPERIMENTAL_tx_status","/EXPERIMENTAL_validators_ordered":"EXPERIMENTAL_validators_ordered","/block":"block","/broadcast_tx_async":"broadcast_tx_async","/broadcast_tx_commit":"broadcast_tx_commit","/changes":"changes","/chunk":"chunk","/client_config":"client_config","/gas_price":"gas_price","/health":"health","/light_client_proof":"light_client_proof","/network_info":"network_info","/next_light_client_block":"next_light_client_block","/query":"query","/send_tx":"send_tx","/status":"status","/tx":"tx","/validators":"validators"};Object.entries(xo).forEach(([e,t])=>{});var wo=Object.values(xo);async function Ao(e,t){return e.makeRequest("EXPERIMENTAL_changes",t)}async function Bo(e,t){return e.makeRequest("EXPERIMENTAL_changes_in_block",t)}async function Co(e,t){return e.makeRequest("EXPERIMENTAL_congestion_level",t)}async function No(e,t){return e.makeRequest("EXPERIMENTAL_genesis_config",t)}async function Mo(e,t){return e.makeRequest("EXPERIMENTAL_light_client_block_proof",t)}async function zo(e,t){return e.makeRequest("EXPERIMENTAL_light_client_proof",t)}async function Lo(e,t){return e.makeRequest("EXPERIMENTAL_maintenance_windows",t)}async function qo(e,t){return e.makeRequest("EXPERIMENTAL_protocol_config",t)}async function Oo(e,t){return e.makeRequest("EXPERIMENTAL_receipt",t)}async function Do(e,t){return e.makeRequest("EXPERIMENTAL_split_storage_info",t)}async function jo(e,t){return e.makeRequest("EXPERIMENTAL_tx_status",t)}async function Ko(e,t){return e.makeRequest("EXPERIMENTAL_validators_ordered",t)}async function Ho(e,t){return e.makeRequest("block",t)}async function $o(e,t){return e.makeRequest("broadcast_tx_async",t)}async function Xo(e,t){return e.makeRequest("broadcast_tx_commit",t)}async function Vo(e,t){return e.makeRequest("changes",t)}async function Fo(e,t){return e.makeRequest("chunk",t)}async function Go(e,t){return e.makeRequest("client_config",t)}async function Uo(e,t){return e.makeRequest("gas_price",t)}async function Zo(e,t){return e.makeRequest("health",t)}async function Wo(e,t){return e.makeRequest("light_client_proof",t)}async function Jo(e,t){return e.makeRequest("network_info",t)}async function Yo(e,t){return e.makeRequest("next_light_client_block",t)}async function Qo(e,t){return e.makeRequest("query",t)}async function es(e,t){return e.makeRequest("send_tx",t)}async function ts(e,t){return e.makeRequest("status",t)}async function ns(e,t){return e.makeRequest("tx",t)}async function os(e,t){return e.makeRequest("validators",t)}async function ss(e,t){return Qo(e,t.blockId?{requestType:"view_account",accountId:t.accountId,blockId:t.blockId}:{requestType:"view_account",accountId:t.accountId,finality:t.finality||"final"})}async function as(e,t){const n={requestType:"call_function",accountId:t.accountId,methodName:t.methodName,argsBase64:t.argsBase64??""};return Qo(e,t.blockId?{...n,blockId:t.blockId}:{...n,finality:t.finality||"final"})}async function rs(e,t){return Qo(e,t.blockId?{requestType:"view_access_key",accountId:t.accountId,publicKey:t.publicKey,blockId:t.blockId}:{requestType:"view_access_key",accountId:t.accountId,publicKey:t.publicKey,finality:t.finality||"final"})}function is(){const e=To(),t=Ro();return{validateRequest:t=>{try{e.parse(t)}catch(e){throw new a(`Invalid request format: ${e instanceof Error?e.message:"Unknown error"}`,e)}},validateResponse:e=>{try{t.parse(e)}catch(e){throw new s(`Invalid response format: ${e instanceof Error?e.message:"Unknown error"}`)}},validateMethodRequest:(t,n)=>{try{e.parse(n);const o=Po[t];if(o?.requestSchema){o.requestSchema().parse(n)}}catch(e){throw new a(`Invalid ${t} request: ${e instanceof Error?e.message:"Unknown error"}`,e)}},validateMethodResponse:(e,n)=>{try{t.parse(n);const o=Po[e];if(o?.responseSchema){o.responseSchema().parse(n)}}catch(t){throw new s(`Invalid ${e} response: ${t instanceof Error?t.message:"Unknown error"}`)}}}}export{s as JsonRpcClientError,a as JsonRpcNetworkError,To as JsonRpcRequestSchema,Ro as JsonRpcResponseSchema,r as NearRpcClient,c as NearRpcError,wo as RPC_METHODS,Ho as block,$o as broadcastTxAsync,Xo as broadcastTxCommit,Vo as changes,Fo as chunk,Go as clientConfig,r as default,i as defaultClient,is as enableValidation,Ao as experimentalChanges,Bo as experimentalChangesInBlock,Co as experimentalCongestionLevel,No as experimentalGenesisConfig,Mo as experimentalLightClientBlockProof,zo as experimentalLightClientProof,Lo as experimentalMaintenanceWindows,qo as experimentalProtocolConfig,Oo as experimentalReceipt,Do as experimentalSplitStorageInfo,jo as experimentalTxStatus,Ko as experimentalValidatorsOrdered,Uo as gasPrice,Zo as health,Wo as lightClientProof,Jo as networkInfo,Yo as nextLightClientBlock,Qo as query,es as sendTx,ts as status,ns as tx,os as validators,rs as viewAccessKey,ss as viewAccount,as as viewFunction};
|
1
|
+
function e(e){return e.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}function t(e){return e.replace(/_([a-z])/g,(e,t)=>t.toUpperCase())}function n(t){if(null===t||"object"!=typeof t)return t;if(Array.isArray(t))return t.map(n);const o={};for(const[s,a]of Object.entries(t)){o[e(s)]=n(a)}return o}function o(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(o);const n={};for(const[s,a]of Object.entries(e)){n[t(s)]=o(a)}return n}class s extends Error{code;data;constructor(e,t,n){super(e),this.code=t,this.data=n,this.name="JsonRpcClientError"}}class a extends Error{originalError;responseBody;constructor(e,t,n){super(e),this.originalError=t,this.responseBody=n,this.name="JsonRpcNetworkError"}}class r{endpoint;headers;timeout;retries;validation;constructor(e){"string"==typeof e?(this.endpoint=e,this.headers={},this.timeout=3e4,this.retries=3):(this.endpoint=e.endpoint,this.headers=e.headers||{},this.timeout=e.timeout||3e4,this.retries=e.retries||3,e.validation&&(this.validation=e.validation))}async makeRequest(e,t){const r={jsonrpc:"2.0",id:"dontcare",method:e,params:t?n(t):t};this.validation&&("validateMethodRequest"in this.validation?this.validation.validateMethodRequest(e,r):this.validation.validateRequest(r));let i=null;for(let t=0;t<=this.retries;t++)try{const t=new AbortController,n=setTimeout(()=>t.abort(),this.timeout),i=await fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json",...this.headers},body:JSON.stringify(r),signal:t.signal});let c;clearTimeout(n);try{c=await i.json()}catch(e){if(!i.ok)throw new a(`HTTP error! status: ${i.status} - Failed to parse JSON response`,e);throw new a("Failed to parse JSON response",e)}if(c.error)throw new s(c.error.message,c.error.code,c.error.data);if(!i.ok)throw new a(`HTTP error! status: ${i.status}`,void 0,c);this.validation&&this.validation.validateResponse(c);const d=c.result?o(c.result):c.result;if(this.validation&&"validateMethodResponse"in this.validation){const t={...c,result:d};this.validation.validateMethodResponse(e,t)}return d}catch(e){if(i=e,e instanceof s)throw e;if(t===this.retries)break;await new Promise(e=>setTimeout(e,1e3*Math.pow(2,t)))}throw new a(i?.message||"Request failed after all retries",i||void 0)}withConfig(e){return new r({endpoint:e.endpoint??this.endpoint,headers:e.headers??this.headers,timeout:e.timeout??this.timeout,retries:e.retries??this.retries,...void 0!==e.validation?{validation:e.validation}:void 0!==this.validation?{validation:this.validation}:{}})}}const i=new r({endpoint:"https://rpc.mainnet.near.org"});class c extends Error{code;data;constructor(e,t,n){super(t),this.code=e,this.data=n,this.name="NearRpcError"}}function d(e,t,n){function o(n,o){var s;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(s=n._zod).traits??(s.traits=new Set),n._zod.traits.add(e),t(n,o);for(const e in r.prototype)e in n||Object.defineProperty(n,e,{value:r.prototype[e].bind(n)});n._zod.constr=r,n._zod.def=o}const s=n?.Parent??Object;class a extends s{}function r(e){var t;const s=n?.Parent?new a:this;o(s,e),(t=s._zod).deferred??(t.deferred=[]);for(const e of s._zod.deferred)e();return s}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(r,"init",{value:o}),Object.defineProperty(r,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class u extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const l={};function p(e){return l}function h(e,t){return"bigint"==typeof t?t.toString():t}function m(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function g(e,t,n){Object.defineProperty(e,t,{get(){{const o=n();return e[t]=o,o}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function _(e){return JSON.stringify(e)}const f=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function I(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const v=m(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function k(e){if(!1===I(e))return!1;const t=e.constructor;if(void 0===t)return!0;const n=t.prototype;return!1!==I(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}const E=new Set(["string","number","symbol"]);function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S(e,t=0){for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function P(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function T(e){return"string"==typeof e?e:e?.message}function R(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const s=T(e.inst?._zod.def?.error?.(e))??T(t?.error?.(e))??T(n.customError?.(e))??T(n.localeError?.(e))??"Invalid input";o.message=s}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}const x=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,h,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},w=d("$ZodError",x),A=d("$ZodError",x,{Parent:Error}),B=(e=>(t,n,o,s)=>{const a=o?Object.assign(o,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},a);if(r instanceof Promise)throw new u;if(r.issues.length){const t=new(s?.Err??e)(r.issues.map(e=>R(e,a,p())));throw f(t,s?.callee),t}return r.value})(A),C=(e=>async(t,n,o,s)=>{const a=o?Object.assign(o,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},a);if(r instanceof Promise&&(r=await r),r.issues.length){const t=new(s?.Err??e)(r.issues.map(e=>R(e,a,p())));throw f(t,s?.callee),t}return r.value})(A),N=(e=>(t,n,o)=>{const s=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new u;return a.issues.length?{success:!1,error:new(e??w)(a.issues.map(e=>R(e,s,p())))}:{success:!0,data:a.value}})(A),M=(e=>async(t,n,o)=>{const s=o?Object.assign(o,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},s);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>R(e,s,p())))}:{success:!0,data:a.value}})(A),z=/^-?\d+(?:\.\d+)?/i,L=/true|false/i,q=/null/i;class j{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),o=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of o)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const O={major:4,minor:0,patch:5},D=d("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=O;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const t of o)for(const n of t._zod.onattach)n(e);if(0===o.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let o,s=S(e);for(const a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(s)continue;const t=e.issues.length,r=a._zod.check(e);if(r instanceof Promise&&!1===n?.async)throw new u;if(o||r instanceof Promise)o=(o??Promise.resolve()).then(async()=>{await r;e.issues.length!==t&&(s||(s=S(e,t)))});else{if(e.issues.length===t)continue;s||(s=S(e,t))}}return o?o.then(()=>e):e};e._zod.run=(n,s)=>{const a=e._zod.parse(n,s);if(a instanceof Promise){if(!1===s.async)throw new u;return a.then(e=>t(e,o,s))}return t(a,o,s)}}e["~standard"]={validate:t=>{try{const n=N(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return M(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),H=d("$ZodString",(e,t)=>{var n;D.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),K=d("$ZodNumber",(e,t)=>{D.init(e,t),e._zod.pattern=e._zod.bag.pattern??z,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const s=n.value;if("number"==typeof s&&!Number.isNaN(s)&&Number.isFinite(s))return n;const a="number"==typeof s?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...a?{received:a}:{}}),n}}),$=d("$ZodBoolean",(e,t)=>{D.init(e,t),e._zod.pattern=L,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const s=n.value;return"boolean"==typeof s||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),X=d("$ZodNull",(e,t)=>{D.init(e,t),e._zod.pattern=q,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{const o=t.value;return null===o||t.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),t}}),V=d("$ZodUnknown",(e,t)=>{D.init(e,t),e._zod.parse=e=>e});function F(e,t,n){e.issues.length&&t.issues.push(...P(n,e.issues)),t.value[n]=e.value}const G=d("$ZodArray",(e,t)=>{D.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const a=[];for(let e=0;e<s.length;e++){const r=s[e],i=t.element._zod.run({value:r,issues:[]},o);i instanceof Promise?a.push(i.then(t=>F(t,n,e))):F(i,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function U(e,t,n){e.issues.length&&t.issues.push(...P(n,e.issues)),t.value[n]=e.value}function Z(e,t,n,o){e.issues.length?void 0===o[n]?t.value[n]=n in o?void 0:e.value:t.issues.push(...P(n,e.issues)):void 0===e.value?n in o&&(t.value[n]=void 0):t.value[n]=e.value}const W=d("$ZodObject",(e,t)=>{D.init(e,t);const n=m(()=>{const e=Object.keys(t.shape);for(const n of e)if(!(t.shape[n]instanceof D))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(o=t.shape,Object.keys(o).filter(e=>"optional"===o[e]._zod.optin&&"optional"===o[e]._zod.optout));var o;return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});g(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const o=e[t]._zod;if(o.values){n[t]??(n[t]=new Set);for(const e of o.values)n[t].add(e)}}return n});let o;const s=I,a=!l.jitless,r=a&&v.value,i=t.catchall;let c;e._zod.parse=(d,u)=>{c??(c=n.value);const l=d.value;if(!s(l))return d.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),d;const p=[];if(a&&r&&!1===u?.async&&!0!==u.jitless)o||(o=(e=>{const t=new j(["shape","payload","ctx"]),o=n.value,s=e=>{const t=_(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const a=Object.create(null);let r=0;for(const e of o.keys)a[e]="key_"+r++;t.write("const newResult = {}");for(const e of o.keys)if(o.optionalKeys.has(e)){const n=a[e];t.write(`const ${n} = ${s(e)};`);const o=_(e);t.write(`\n if (${n}.issues.length) {\n if (input[${o}] === undefined) {\n if (${o} in input) {\n newResult[${o}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${n}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${o}, ...iss.path] : [${o}],\n }))\n );\n }\n } else if (${n}.value === undefined) {\n if (${o} in input) newResult[${o}] = undefined;\n } else {\n newResult[${o}] = ${n}.value;\n }\n `)}else{const n=a[e];t.write(`const ${n} = ${s(e)};`),t.write(`\n if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${_(e)}, ...iss.path] : [${_(e)}]\n })));`),t.write(`newResult[${_(e)}] = ${n}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");const i=t.compile();return(t,n)=>i(e,t,n)})(t.shape)),d=o(d,u);else{d.value={};const e=c.shape;for(const t of c.keys){const n=e[t],o=n._zod.run({value:l[t],issues:[]},u),s="optional"===n._zod.optin&&"optional"===n._zod.optout;o instanceof Promise?p.push(o.then(e=>s?Z(e,d,t,l):U(e,d,t))):s?Z(o,d,t,l):U(o,d,t)}}if(!i)return p.length?Promise.all(p).then(()=>d):d;const h=[],m=c.keySet,y=i._zod,g=y.def.type;for(const e of Object.keys(l)){if(m.has(e))continue;if("never"===g){h.push(e);continue}const t=y.run({value:l[e],issues:[]},u);t instanceof Promise?p.push(t.then(t=>U(t,d,e))):U(t,d,e)}return h.length&&d.issues.push({code:"unrecognized_keys",keys:h,input:l,inst:e}),p.length?Promise.all(p).then(()=>d):d}});function J(e,t,n,o){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>R(e,o,p())))}),t}const Y=d("$ZodUnion",(e,t)=>{D.init(e,t),g(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),g(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),g(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),g(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>y(e.source)).join("|")})$`)}}),e._zod.parse=(n,o)=>{let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:n.value,issues:[]},o);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>J(t,n,e,o)):J(a,n,e,o)}}),Q=d("$ZodIntersection",(e,t)=>{D.init(e,t),e._zod.parse=(e,n)=>{const o=e.value,s=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([t,n])=>te(e,t,n)):te(e,s,a)}});function ee(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(k(e)&&k(t)){const n=Object.keys(t),o=Object.keys(e).filter(e=>-1!==n.indexOf(e)),s={...e,...t};for(const n of o){const o=ee(e[n],t[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};s[n]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const s=ee(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function te(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),S(e))return e;const o=ee(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const ne=d("$ZodRecord",(e,t)=>{D.init(e,t),e._zod.parse=(n,o)=>{const s=n.value;if(!k(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const a=[];if(t.keyType._zod.values){const r=t.keyType._zod.values;n.value={};for(const e of r)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){const r=t.valueType._zod.run({value:s[e],issues:[]},o);r instanceof Promise?a.push(r.then(t=>{t.issues.length&&n.issues.push(...P(e,t.issues)),n.value[e]=t.value})):(r.issues.length&&n.issues.push(...P(e,r.issues)),n.value[e]=r.value)}let i;for(const e in s)r.has(e)||(i=i??[],i.push(e));i&&i.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:i})}else{n.value={};for(const r of Reflect.ownKeys(s)){if("__proto__"===r)continue;const i=t.keyType._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(i.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:i.issues.map(e=>R(e,o,p())),input:r,path:[r],inst:e}),n.value[i.value]=i.value;continue}const c=t.valueType._zod.run({value:s[r],issues:[]},o);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...P(r,e.issues)),n.value[i.value]=e.value})):(c.issues.length&&n.issues.push(...P(r,c.issues)),n.value[i.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),oe=d("$ZodEnum",(e,t)=>{D.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(e=>E.has(typeof e)).map(e=>"string"==typeof e?b(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const s=t.value;return e._zod.values.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),se=d("$ZodLiteral",(e,t)=>{D.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?b(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(n,o)=>{const s=n.value;return e._zod.values.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}}),ae=d("$ZodOptional",(e,t)=>{D.init(e,t),e._zod.optin="optional",e._zod.optout="optional",g(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),g(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${y(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,n):void 0===e.value?e:t.innerType._zod.run(e,n)}),re=d("$ZodLazy",(e,t)=>{D.init(e,t),g(e._zod,"innerType",()=>t.getter()),g(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),g(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),g(e._zod,"optin",()=>e._zod.innerType._zod.optin),g(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)});const ie=d("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");D.init(e,t),e.def=t,e.parse=(t,n)=>B(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>N(e,t,n),e.parseAsync=async(t,n)=>C(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>M(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>function(e,t,n){const o=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(o._zod.parent=e),o}(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e)}),ce=d("ZodMiniString",(e,t)=>{H.init(e,t),ie.init(e,t)});function de(e){return new ce({type:"string"})}const ue=d("ZodMiniNumber",(e,t)=>{K.init(e,t),ie.init(e,t)});function le(e){return new ue({type:"number",checks:[]})}const pe=d("ZodMiniBoolean",(e,t)=>{$.init(e,t),ie.init(e,t)});function he(e){return new pe({type:"boolean"})}const me=d("ZodMiniNull",(e,t)=>{X.init(e,t),ie.init(e,t)});function ye(e){return new me({type:"null"})}const ge=d("ZodMiniUnknown",(e,t)=>{V.init(e,t),ie.init(e,t)});function _e(){return new ge({type:"unknown"})}const fe=d("ZodMiniArray",(e,t)=>{G.init(e,t),ie.init(e,t)});function Ie(e,t){return new fe({type:"array",element:e})}const ve=d("ZodMiniObject",(e,t)=>{W.init(e,t),ie.init(e,t),g(e,"shape",()=>t.shape)});function ke(e,t){return new ve({type:"object",get shape(){var t,n,o;return t=this,n="shape",o={...e},Object.defineProperty(t,n,{value:o,writable:!0,enumerable:!0,configurable:!0}),this.shape}})}const Ee=d("ZodMiniUnion",(e,t)=>{Y.init(e,t),ie.init(e,t)});function be(e,t){return new Ee({type:"union",options:e})}const Se=d("ZodMiniIntersection",(e,t)=>{Q.init(e,t),ie.init(e,t)});function Pe(e,t){return new Se({type:"intersection",left:e,right:t})}const Te=d("ZodMiniRecord",(e,t)=>{ne.init(e,t),ie.init(e,t)});function Re(e,t,n){return new Te({type:"record",keyType:e,valueType:t})}const xe=d("ZodMiniEnum",(e,t)=>{oe.init(e,t),ie.init(e,t)});function we(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new xe({type:"enum",entries:n})}const Ae=d("ZodMiniLiteral",(e,t)=>{se.init(e,t),ie.init(e,t)});function Be(e,t){return new Ae({type:"literal",values:Array.isArray(e)?e:[e]})}const Ce=d("ZodMiniOptional",(e,t)=>{ae.init(e,t),ie.init(e,t)});function Ne(e){return new Ce({type:"optional",innerType:e})}const Me=d("ZodMiniLazy",(e,t)=>{re.init(e,t),ie.init(e,t)});function ze(e){return new Me({type:"lazy",getter:e})}var Le=()=>ke({keys:Ie(ze(()=>ke({accessKey:ze(()=>Oe()),publicKey:ze(()=>Kt())})))}),qe=()=>be([ke({FunctionCall:ze(()=>kt())}),we(["FullAccess"])]),je=()=>be([we(["FullAccess"]),ke({FunctionCall:ke({allowance:Ne(de()),methodNames:Ie(de()),receiverId:de()})})]),Oe=()=>ke({nonce:le(),permission:ze(()=>je())}),De=()=>de(),He=()=>ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt())}),Ke=()=>ke({addKeyCost:ze(()=>ke({fullAccessCost:ze(()=>yt()),functionCallCost:ze(()=>yt()),functionCallCostPerByte:ze(()=>yt())})),createAccountCost:ze(()=>yt()),delegateCost:ze(()=>yt()),deleteAccountCost:ze(()=>yt()),deleteKeyCost:ze(()=>yt()),deployContractCost:ze(()=>yt()),deployContractCostPerByte:ze(()=>yt()),functionCallCost:ze(()=>yt()),functionCallCostPerByte:ze(()=>yt()),stakeCost:ze(()=>yt()),transferCost:ze(()=>yt())}),$e=()=>be([ke({AccountAlreadyExists:ke({accountId:ze(()=>De())})}),ke({AccountDoesNotExist:ke({accountId:ze(()=>De())})}),ke({CreateAccountOnlyByRegistrar:ke({accountId:ze(()=>De()),predecessorId:ze(()=>De()),registrarAccountId:ze(()=>De())})}),ke({CreateAccountNotAllowed:ke({accountId:ze(()=>De()),predecessorId:ze(()=>De())})}),ke({ActorNoPermission:ke({accountId:ze(()=>De()),actorId:ze(()=>De())})}),ke({DeleteKeyDoesNotExist:ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt())})}),ke({AddKeyAlreadyExists:ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt())})}),ke({DeleteAccountStaking:ke({accountId:ze(()=>De())})}),ke({LackBalanceForState:ke({accountId:ze(()=>De()),amount:de()})}),ke({TriesToUnstake:ke({accountId:ze(()=>De())})}),ke({TriesToStake:ke({accountId:ze(()=>De()),balance:de(),locked:de(),stake:de()})}),ke({InsufficientStake:ke({accountId:ze(()=>De()),minimumStake:de(),stake:de()})}),ke({FunctionCallError:ze(()=>vt())}),ke({NewReceiptValidationError:ze(()=>Vt())}),ke({OnlyImplicitAccountCreationAllowed:ke({accountId:ze(()=>De())})}),ke({DeleteAccountWithLargeState:ke({accountId:ze(()=>De())})}),we(["DelegateActionInvalidSignature"]),ke({DelegateActionSenderDoesNotMatchTxReceiver:ke({receiverId:ze(()=>De()),senderId:ze(()=>De())})}),we(["DelegateActionExpired"]),ke({DelegateActionAccessKeyError:ze(()=>Tt())}),ke({DelegateActionInvalidNonce:ke({akNonce:le(),delegateNonce:le()})}),ke({DelegateActionNonceTooLarge:ke({delegateNonce:le(),upperBound:le()})}),ke({GlobalContractDoesNotExist:ke({identifier:ze(()=>St())})})]),Xe=()=>be([we(["CreateAccount"]),ke({DeployContract:ke({code:de()})}),ke({FunctionCall:ke({args:ze(()=>ft()),deposit:de(),gas:le(),methodName:de()})}),ke({Transfer:ke({deposit:de()})}),ke({Stake:ke({publicKey:ze(()=>Kt()),stake:de()})}),ke({AddKey:ke({accessKey:ze(()=>Oe()),publicKey:ze(()=>Kt())})}),ke({DeleteKey:ke({publicKey:ze(()=>Kt())})}),ke({DeleteAccount:ke({beneficiaryId:ze(()=>De())})}),ke({Delegate:ke({delegateAction:ze(()=>ot()),signature:ze(()=>Vn())})}),ke({DeployGlobalContract:ke({code:de()})}),ke({DeployGlobalContractByAccountId:ke({code:de()})}),ke({UseGlobalContract:ke({codeHash:ze(()=>nt())})}),ke({UseGlobalContractByAccountId:ke({accountId:ze(()=>De())})})]),Ve=()=>be([we(["DeleteActionMustBeFinal"]),ke({TotalPrepaidGasExceeded:ke({limit:le(),totalPrepaidGas:le()})}),ke({TotalNumberOfActionsExceeded:ke({limit:le(),totalNumberOfActions:le()})}),ke({AddKeyMethodNamesNumberOfBytesExceeded:ke({limit:le(),totalNumberOfBytes:le()})}),ke({AddKeyMethodNameLengthExceeded:ke({length:le(),limit:le()})}),we(["IntegerOverflow"]),ke({InvalidAccountId:ke({accountId:de()})}),ke({ContractSizeExceeded:ke({limit:le(),size:le()})}),ke({FunctionCallMethodNameLengthExceeded:ke({length:le(),limit:le()})}),ke({FunctionCallArgumentsLengthExceeded:ke({length:le(),limit:le()})}),ke({UnsuitableStakingKey:ke({publicKey:ze(()=>Kt())})}),we(["FunctionCallZeroAttachedGas"]),we(["DelegateActionMustBeOnlyOne"]),ke({UnsupportedProtocolFeature:ke({protocolFeature:de(),version:le()})})]),Fe=()=>ke({accessKey:ze(()=>ke({nonce:le(),permission:ze(()=>qe())})),publicKey:ze(()=>Kt())}),Ge=()=>ke({data:Ie(le())}),Ue=()=>ke({requests:Ie(ze(()=>ke({requestedValuesBitmap:ze(()=>Ge()),toShard:le()})))}),Ze=()=>ke({blockMerkleRoot:ze(()=>nt()),epochId:ze(()=>nt()),height:le(),nextBpHash:ze(()=>nt()),nextEpochId:ze(()=>nt()),outcomeRoot:ze(()=>nt()),prevStateRoot:ze(()=>nt()),timestamp:le(),timestampNanosec:de()}),We=()=>be([le(),ze(()=>nt())]),Je=()=>ke({hash:ze(()=>nt()),height:le()}),Ye=()=>ke({get:de(),set:de()}),Qe=()=>ke({balanceBurnt:de(),bandwidthRequests:Ne(be([ze(()=>ke({V1:ze(()=>Ue())})),ye()])),chunkHash:ze(()=>nt()),congestionInfo:Ne(be([ze(()=>et()),ye()])),encodedLength:le(),encodedMerkleRoot:ze(()=>nt()),gasLimit:le(),gasUsed:le(),heightCreated:le(),heightIncluded:le(),outcomeRoot:ze(()=>nt()),outgoingReceiptsRoot:ze(()=>nt()),prevBlockHash:ze(()=>nt()),prevStateRoot:ze(()=>nt()),rentPaid:de(),shardId:ze(()=>Dn()),signature:ze(()=>Vn()),txRoot:ze(()=>nt()),validatorProposals:Ie(ze(()=>Io())),validatorReward:de()}),et=()=>ke({allowedShard:le(),bufferedReceiptsGas:de(),delayedReceiptsGas:de(),receiptBytes:le()}),tt=()=>Re(de(),_e()),nt=()=>de(),ot=()=>ke({actions:Ie(ze(()=>jt())),maxBlockHeight:le(),nonce:le(),publicKey:ze(()=>Kt()),receiverId:ze(()=>De()),senderId:ze(()=>De())}),st=()=>ke({beneficiaryId:ze(()=>De())}),at=()=>ke({publicKey:ze(()=>Kt())}),rt=()=>ke({code:de()}),it=()=>ke({code:de(),deployMode:ze(()=>bt())}),ct=()=>ke({blockProductionDelayMillis:le(),catchupStatus:Ie(ze(()=>ke({blocksToCatchup:Ie(ze(()=>Je())),shardSyncStatus:Re(de(),_e()),syncBlockHash:ze(()=>nt()),syncBlockHeight:le()}))),currentHeadStatus:ze(()=>Je()),currentHeaderHeadStatus:ze(()=>Je()),networkInfo:ze(()=>qt()),syncStatus:de()}),dt=()=>ke({nanos:le(),secs:le()}),ut=()=>ze(()=>nt()),lt=()=>ke({gasProfile:Ne(Ie(ze(()=>ke({cost:de(),costCategory:de(),gasUsed:de()})))),version:le()}),pt=()=>ke({blockHash:ze(()=>nt()),id:ze(()=>nt()),outcome:ze(()=>ke({executorId:ze(()=>De()),gasBurnt:le(),logs:Ie(de()),metadata:Ne(ze(()=>lt())),receiptIds:Ie(ze(()=>nt())),status:ze(()=>ht()),tokensBurnt:de()})),proof:Ie(ze(()=>Nt()))}),ht=()=>be([we(["Unknown"]),ke({Failure:ze(()=>po())}),ke({SuccessValue:de()}),ke({SuccessReceiptId:ze(()=>nt())})]),mt=()=>be([ke({S3:ke({bucket:de(),region:de()})}),ke({Filesystem:ke({rootDir:de()})}),ke({GCS:ke({bucket:de()})})]),yt=()=>ke({execution:le(),sendNotSir:le(),sendSir:le()}),gt=()=>be([we(["NotStarted"]),we(["Started"]),ke({Failure:ze(()=>po())}),ke({SuccessValue:de()})]),_t=()=>we(["optimistic","near-final","final"]),ft=()=>de(),It=()=>ke({args:de(),deposit:de(),gas:le(),methodName:de()}),vt=()=>be([we(["WasmUnknownError","_EVMError"]),ke({CompilationError:ze(()=>be([ke({CodeDoesNotExist:ke({accountId:ze(()=>De())})}),ke({PrepareError:ze(()=>Ht())}),ke({WasmerCompileError:ke({msg:de()})})]))}),ke({LinkError:ke({msg:de()})}),ke({MethodResolveError:ze(()=>Mt())}),ke({WasmTrap:ze(()=>bo())}),ke({HostError:ze(()=>Pt())}),ke({ExecutionError:de()})]),kt=()=>ke({allowance:Ne(de()),methodNames:Ie(de()),receiverId:de()}),Et=()=>ke({avgHiddenValidatorSeatsPerShard:Ie(le()),blockProducerKickoutThreshold:le(),chainId:de(),chunkProducerAssignmentChangesLimit:Ne(le()),chunkProducerKickoutThreshold:le(),chunkValidatorOnlyKickoutThreshold:Ne(le()),dynamicResharding:he(),epochLength:le(),fishermenThreshold:de(),gasLimit:le(),gasPriceAdjustmentRate:Ie(le()),genesisHeight:le(),genesisTime:de(),maxGasPrice:de(),maxInflationRate:Ie(le()),maxKickoutStakePerc:Ne(le()),minGasPrice:de(),minimumStakeDivisor:Ne(le()),minimumStakeRatio:Ne(Ie(le())),minimumValidatorsPerShard:Ne(le()),numBlockProducerSeats:le(),numBlockProducerSeatsPerShard:Ie(le()),numBlocksPerYear:le(),numChunkOnlyProducerSeats:Ne(le()),numChunkProducerSeats:Ne(le()),numChunkValidatorSeats:Ne(le()),onlineMaxThreshold:Ne(Ie(le())),onlineMinThreshold:Ne(Ie(le())),protocolRewardRate:Ie(le()),protocolTreasuryAccount:ze(()=>De()),protocolUpgradeStakeThreshold:Ne(Ie(le())),protocolVersion:le(),shardLayout:Ne(ze(()=>Hn())),shuffleShardAssignmentForChunkProducers:Ne(he()),targetValidatorMandatesPerShard:Ne(le()),totalSupply:de(),transactionValidityPeriod:le(),useProductionConfig:Ne(he()),validators:Ie(ze(()=>ke({accountId:ze(()=>De()),amount:de(),publicKey:ze(()=>Kt())})))}),bt=()=>be([we(["CodeHash"]),we(["AccountId"])]),St=()=>be([ke({CodeHash:ze(()=>nt())}),ke({AccountId:ze(()=>De())})]),Pt=()=>be([we(["BadUTF16"]),we(["BadUTF8"]),we(["GasExceeded"]),we(["GasLimitExceeded"]),we(["BalanceExceeded"]),we(["EmptyMethodName"]),ke({GuestPanic:ke({panicMsg:de()})}),we(["IntegerOverflow"]),ke({InvalidPromiseIndex:ke({promiseIdx:le()})}),we(["CannotAppendActionToJointPromise"]),we(["CannotReturnJointPromise"]),ke({InvalidPromiseResultIndex:ke({resultIdx:le()})}),ke({InvalidRegisterId:ke({registerId:le()})}),ke({IteratorWasInvalidated:ke({iteratorIndex:le()})}),we(["MemoryAccessViolation"]),ke({InvalidReceiptIndex:ke({receiptIndex:le()})}),ke({InvalidIteratorIndex:ke({iteratorIndex:le()})}),we(["InvalidAccountId"]),we(["InvalidMethodName"]),we(["InvalidPublicKey"]),ke({ProhibitedInView:ke({methodName:de()})}),ke({NumberOfLogsExceeded:ke({limit:le()})}),ke({KeyLengthExceeded:ke({length:le(),limit:le()})}),ke({ValueLengthExceeded:ke({length:le(),limit:le()})}),ke({TotalLogLengthExceeded:ke({length:le(),limit:le()})}),ke({NumberPromisesExceeded:ke({limit:le(),numberOfPromises:le()})}),ke({NumberInputDataDependenciesExceeded:ke({limit:le(),numberOfInputDataDependencies:le()})}),ke({ReturnedValueLengthExceeded:ke({length:le(),limit:le()})}),ke({ContractSizeExceeded:ke({limit:le(),size:le()})}),ke({Deprecated:ke({methodName:de()})}),ke({ECRecoverError:ke({msg:de()})}),ke({AltBn128InvalidInput:ke({msg:de()})}),ke({Ed25519VerifyInvalidInput:ke({msg:de()})})]),Tt=()=>be([ke({AccessKeyNotFound:ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt())})}),ke({ReceiverMismatch:ke({akReceiver:de(),txReceiver:ze(()=>De())})}),ke({MethodNameMismatch:ke({methodName:de()})}),we(["RequiresFullAccess"]),ke({NotEnoughAllowance:ke({accountId:ze(()=>De()),allowance:de(),cost:de(),publicKey:ze(()=>Kt())})}),we(["DepositWithFunctionCall"])]),Rt=()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_genesis_config"]),params:ze(()=>ye())}),xt=()=>Pe(be([ke({result:ze(()=>un())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})),wt=()=>Pe(be([ke({result:ze(()=>An())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})),At=()=>Pe(be([ke({result:ze(()=>Nn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})),Bt=()=>ke({innerLite:ze(()=>Ze()),innerRestHash:ze(()=>nt()),prevBlockHash:ze(()=>nt())}),Ct=()=>ke({accountIdValidityRulesVersion:Ne(ze(()=>le())),initialMemoryPages:le(),maxActionsPerReceipt:le(),maxArgumentsLength:le(),maxContractSize:le(),maxFunctionsNumberPerContract:Ne(le()),maxGasBurnt:le(),maxLengthMethodName:le(),maxLengthReturnedData:le(),maxLengthStorageKey:le(),maxLengthStorageValue:le(),maxLocalsPerContract:Ne(le()),maxMemoryPages:le(),maxNumberBytesMethodNames:le(),maxNumberInputDataDependencies:le(),maxNumberLogs:le(),maxNumberRegisters:le(),maxPromisesPerFunctionCallAction:le(),maxReceiptSize:le(),maxRegisterSize:le(),maxStackHeight:le(),maxTotalLogLength:le(),maxTotalPrepaidGas:le(),maxTransactionSize:le(),maxYieldPayloadSize:le(),perReceiptStorageProofSizeLimit:le(),registersMemoryLimit:le(),yieldTimeoutLengthInBlocks:le()}),Nt=()=>ke({direction:ze(()=>we(["Left","Right"])),hash:ze(()=>nt())}),Mt=()=>we(["MethodEmptyName","MethodNotFound","MethodInvalidSignature"]),zt=()=>be([we(["TrieIterator"]),we(["TriePrefetchingStorage"]),we(["TrieMemoryPartialStorage"]),we(["TrieStorage"])]),Lt=()=>de(),qt=()=>ke({connectedPeers:Ie(ze(()=>Dt())),knownProducers:Ie(ze(()=>ke({accountId:ze(()=>De()),nextHops:Ne(Ie(ze(()=>Kt()))),peerId:ze(()=>Kt())}))),numConnectedPeers:le(),peerMaxCount:le(),tier1AccountsData:Ie(ze(()=>ke({accountKey:ze(()=>Kt()),peerId:ze(()=>Kt()),proxies:Ie(ze(()=>co())),timestamp:de()}))),tier1AccountsKeys:Ie(ze(()=>Kt())),tier1Connections:Ie(ze(()=>Dt()))}),jt=()=>ze(()=>be([ke({CreateAccount:ze(()=>tt())}),ke({DeployContract:ze(()=>rt())}),ke({FunctionCall:ze(()=>It())}),ke({Transfer:ze(()=>lo())}),ke({Stake:ze(()=>Wn())}),ke({AddKey:ze(()=>Fe())}),ke({DeleteKey:ze(()=>at())}),ke({DeleteAccount:ze(()=>st())}),ke({Delegate:ze(()=>Fn())}),ke({DeployGlobalContract:ze(()=>it())}),ke({UseGlobalContract:ze(()=>mo())})])),Ot=()=>ze(()=>Kt()),Dt=()=>ke({accountId:Ne(be([ze(()=>De()),ye()])),addr:de(),archival:he(),blockHash:Ne(be([ze(()=>nt()),ye()])),connectionEstablishedTimeMillis:le(),height:Ne(le()),isHighestBlockInvalid:he(),isOutboundPeer:he(),lastTimePeerRequestedMillis:le(),lastTimeReceivedMessageMillis:le(),nonce:le(),peerId:ze(()=>Kt()),receivedBytesPerSec:le(),sentBytesPerSec:le(),trackedShards:Ie(ze(()=>Dn()))}),Ht=()=>be([we(["Serialization"]),we(["Deserialization"]),we(["InternalMemoryDeclared"]),we(["GasInstrumentation"]),we(["StackHeightInstrumentation"]),we(["Instantiate"]),we(["Memory"]),we(["TooManyFunctions"]),we(["TooManyLocals"])]),Kt=()=>de(),$t=()=>ke({end:le(),start:le()}),Xt=()=>be([ke({Action:ke({actions:Ie(ze(()=>Xe())),gasPrice:de(),inputDataIds:Ie(ze(()=>nt())),isPromiseYield:Ne(he()),outputDataReceivers:Ie(ze(()=>ke({dataId:ze(()=>nt()),receiverId:ze(()=>De())}))),signerId:ze(()=>De()),signerPublicKey:ze(()=>Kt())})}),ke({Data:ke({data:Ne(de()),dataId:ze(()=>nt()),isPromiseResume:Ne(he())})}),ke({GlobalContractDistribution:ke({alreadyDeliveredShards:Ie(ze(()=>Dn())),code:de(),id:ze(()=>St()),targetShard:ze(()=>Dn())})})]),Vt=()=>be([ke({InvalidPredecessorId:ke({accountId:de()})}),ke({InvalidReceiverId:ke({accountId:de()})}),ke({InvalidSignerId:ke({accountId:de()})}),ke({InvalidDataReceiverId:ke({accountId:de()})}),ke({ReturnedValueLengthExceeded:ke({length:le(),limit:le()})}),ke({NumberInputDataDependenciesExceeded:ke({limit:le(),numberOfInputDataDependencies:le()})}),ke({ActionsValidation:ze(()=>Ve())}),ke({ReceiptSizeExceeded:ke({limit:le(),size:le()})})]),Ft=()=>ke({predecessorId:ze(()=>De()),priority:Ne(le()),receipt:ze(()=>Xt()),receiptId:ze(()=>nt()),receiverId:ze(()=>De())}),Gt=()=>be([ke({blockId:ze(()=>We())}),ke({finality:ze(()=>_t())}),ke({syncCheckpoint:ze(()=>ao())})]),Ut=()=>ke({author:ze(()=>De()),chunks:Ie(ze(()=>Qe())),header:ze(()=>ke({approvals:Ie(be([ze(()=>Vn()),ye()])),blockBodyHash:Ne(be([ze(()=>nt()),ye()])),blockMerkleRoot:ze(()=>nt()),blockOrdinal:Ne(le()),challengesResult:Ie(ze(()=>Zn())),challengesRoot:ze(()=>nt()),chunkEndorsements:Ne(Ie(Ie(le()))),chunkHeadersRoot:ze(()=>nt()),chunkMask:Ie(he()),chunkReceiptsRoot:ze(()=>nt()),chunkTxRoot:ze(()=>nt()),chunksIncluded:le(),epochId:ze(()=>nt()),epochSyncDataHash:Ne(be([ze(()=>nt()),ye()])),gasPrice:de(),hash:ze(()=>nt()),height:le(),lastDsFinalBlock:ze(()=>nt()),lastFinalBlock:ze(()=>nt()),latestProtocolVersion:le(),nextBpHash:ze(()=>nt()),nextEpochId:ze(()=>nt()),outcomeRoot:ze(()=>nt()),prevHash:ze(()=>nt()),prevHeight:Ne(le()),prevStateRoot:ze(()=>nt()),randomValue:ze(()=>nt()),rentPaid:de(),signature:ze(()=>Vn()),timestamp:le(),timestampNanosec:de(),totalSupply:de(),validatorProposals:Ie(ze(()=>Io())),validatorReward:de()}))}),Zt=()=>be([ke({blockId:ze(()=>We()),shardId:ze(()=>Dn())}),ke({chunkId:ze(()=>nt())})]),Wt=()=>ke({author:ze(()=>De()),header:ze(()=>Qe()),receipts:Ie(ze(()=>Ft())),transactions:Ie(ze(()=>Un()))}),Jt=()=>ye(),Yt=()=>ke({archive:he(),blockFetchHorizon:le(),blockHeaderFetchHorizon:le(),blockProductionTrackingDelay:Ie(le()),catchupStepPeriod:Ie(le()),chainId:de(),chunkDistributionNetwork:Ne(be([ze(()=>ke({enabled:he(),uris:ze(()=>Ye())})),ye()])),chunkRequestRetryPeriod:Ie(le()),chunkWaitMult:Ie(le()),clientBackgroundMigrationThreads:le(),doomslugStepPeriod:Ie(le()),enableMultilineLogging:he(),enableStatisticsExport:he(),epochLength:le(),epochSync:ze(()=>ke({disableEpochSyncForBootstrapping:Ne(he()),epochSyncHorizon:le(),ignoreEpochSyncNetworkRequests:Ne(he()),timeoutForEpochSync:ze(()=>dt())})),expectedShutdown:ze(()=>Lt()),gc:ze(()=>ke({gcBlocksLimit:Ne(le()),gcForkCleanStep:Ne(le()),gcNumEpochsToKeep:Ne(le()),gcStepPeriod:Ne(ze(()=>dt()))})),headerSyncExpectedHeightPerSecond:le(),headerSyncInitialTimeout:Ie(le()),headerSyncProgressTimeout:Ie(le()),headerSyncStallBanTimeout:Ie(le()),logSummaryPeriod:Ie(le()),logSummaryStyle:ze(()=>we(["plain","colored"])),maxBlockProductionDelay:Ie(le()),maxBlockWaitDelay:Ie(le()),maxGasBurntView:Ne(le()),minBlockProductionDelay:Ie(le()),minNumPeers:le(),numBlockProducerSeats:le(),orphanStateWitnessMaxSize:le(),orphanStateWitnessPoolSize:le(),produceChunkAddTransactionsTimeLimit:de(),produceEmptyBlocks:he(),reshardingConfig:ze(()=>Lt()),rpcAddr:Ne(de()),saveInvalidWitnesses:he(),saveLatestWitnesses:he(),saveTrieChanges:he(),saveTxOutcomes:he(),skipSyncWait:he(),stateSync:ze(()=>Qn()),stateSyncEnabled:he(),stateSyncExternalBackoff:Ie(le()),stateSyncExternalTimeout:Ie(le()),stateSyncP2pTimeout:Ie(le()),stateSyncRetryBackoff:Ie(le()),syncCheckPeriod:Ie(le()),syncHeightThreshold:le(),syncMaxBlockRequests:le(),syncStepPeriod:Ie(le()),trackedShardsConfig:ze(()=>uo()),transactionPoolSizeLimit:Ne(le()),transactionRequestHandlerThreads:le(),trieViewerStateSizeLimit:Ne(le()),ttlAccountIdRouter:Ie(le()),txRoutingHeightHorizon:le(),version:ze(()=>ko()),viewClientNumStateRequestsPerThrottlePeriod:le(),viewClientThreads:le(),viewClientThrottlePeriod:Ie(le())}),Qt=()=>be([ke({blockId:ze(()=>We()),shardId:ze(()=>Dn())}),ke({chunkId:ze(()=>nt())})]),en=()=>ke({congestionLevel:le()}),tn=()=>Pe(be([ke({cause:ze(()=>bn()),name:we(["REQUEST_VALIDATION_ERROR"])}),ke({cause:_e(),name:we(["HANDLER_ERROR"])}),ke({cause:_e(),name:we(["INTERNAL_ERROR"])})]),ke({cause:Ne(_e()),code:le(),data:Ne(_e()),message:de(),name:Ne(_e())})),nn=()=>ke({blockId:Ne(be([ze(()=>We()),ye()]))}),on=()=>ke({gasPrice:de()}),sn=()=>ye(),an=()=>ye(),rn=()=>ke({blockHash:ze(()=>nt()),lightClientHead:ze(()=>nt())}),cn=()=>ke({blockHeaderLite:ze(()=>Bt()),blockProof:Ie(ze(()=>Nt()))}),dn=()=>Pe(be([ke({senderId:ze(()=>De()),transactionHash:ze(()=>nt()),type:we(["transaction"])}),ke({receiptId:ze(()=>nt()),receiverId:ze(()=>De()),type:we(["receipt"])})]),ke({lightClientHead:ze(()=>nt())})),un=()=>ke({blockHeaderLite:ze(()=>Bt()),blockProof:Ie(ze(()=>Nt())),outcomeProof:ze(()=>pt()),outcomeRootProof:Ie(ze(()=>Nt()))}),ln=()=>ke({lastBlockHash:ze(()=>nt())}),pn=()=>ke({approvalsAfterNext:Ne(Ie(be([ze(()=>Vn()),ye()]))),innerLite:Ne(ze(()=>Ze())),innerRestHash:Ne(ze(()=>nt())),nextBlockInnerHash:Ne(ze(()=>nt())),nextBps:Ne(Ie(ze(()=>Io()))),prevBlockHash:Ne(ze(()=>nt()))}),hn=()=>ke({accountId:ze(()=>De())}),mn=()=>ye(),yn=()=>ke({activePeers:Ie(ze(()=>gn())),knownProducers:Ie(ze(()=>ke({accountId:ze(()=>De()),addr:Ne(de()),peerId:ze(()=>Ot())}))),numActivePeers:le(),peerMaxCount:le(),receivedBytesPerSec:le(),sentBytesPerSec:le()}),gn=()=>ke({accountId:Ne(be([ze(()=>De()),ye()])),addr:Ne(de()),id:ze(()=>Ot())}),_n=()=>be([ke({blockId:ze(()=>We())}),ke({finality:ze(()=>_t())}),ke({syncCheckpoint:ze(()=>ao())})]),fn=()=>ke({avgHiddenValidatorSeatsPerShard:Ie(le()),blockProducerKickoutThreshold:le(),chainId:de(),chunkProducerKickoutThreshold:le(),chunkValidatorOnlyKickoutThreshold:le(),dynamicResharding:he(),epochLength:le(),fishermenThreshold:de(),gasLimit:le(),gasPriceAdjustmentRate:Ie(le()),genesisHeight:le(),genesisTime:de(),maxGasPrice:de(),maxInflationRate:Ie(le()),maxKickoutStakePerc:le(),minGasPrice:de(),minimumStakeDivisor:le(),minimumStakeRatio:Ie(le()),minimumValidatorsPerShard:le(),numBlockProducerSeats:le(),numBlockProducerSeatsPerShard:Ie(le()),numBlocksPerYear:le(),onlineMaxThreshold:Ie(le()),onlineMinThreshold:Ie(le()),protocolRewardRate:Ie(le()),protocolTreasuryAccount:ze(()=>De()),protocolUpgradeStakeThreshold:Ie(le()),protocolVersion:le(),runtimeConfig:ze(()=>jn()),shardLayout:ze(()=>Hn()),shuffleShardAssignmentForChunkProducers:he(),targetValidatorMandatesPerShard:le(),transactionValidityPeriod:le()}),In=()=>be([Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),requestType:we(["view_account"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),requestType:we(["view_code"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),includeProof:Ne(he()),prefixBase64:ze(()=>oo()),requestType:we(["view_state"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt()),requestType:we(["view_access_key"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),requestType:we(["view_access_key_list"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),argsBase64:ze(()=>ft()),methodName:de(),requestType:we(["call_function"])})),Pe(ke({blockId:ze(()=>We())}),ke({codeHash:ze(()=>nt()),requestType:we(["view_global_contract_code"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountId:ze(()=>De()),requestType:we(["view_global_contract_code_by_account_id"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),requestType:we(["view_account"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),requestType:we(["view_code"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),includeProof:Ne(he()),prefixBase64:ze(()=>oo()),requestType:we(["view_state"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt()),requestType:we(["view_access_key"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),requestType:we(["view_access_key_list"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),argsBase64:ze(()=>ft()),methodName:de(),requestType:we(["call_function"])})),Pe(ke({finality:ze(()=>_t())}),ke({codeHash:ze(()=>nt()),requestType:we(["view_global_contract_code"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountId:ze(()=>De()),requestType:we(["view_global_contract_code_by_account_id"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),requestType:we(["view_account"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),requestType:we(["view_code"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),includeProof:Ne(he()),prefixBase64:ze(()=>oo()),requestType:we(["view_state"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt()),requestType:we(["view_access_key"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),requestType:we(["view_access_key_list"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),argsBase64:ze(()=>ft()),methodName:de(),requestType:we(["call_function"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({codeHash:ze(()=>nt()),requestType:we(["view_global_contract_code"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountId:ze(()=>De()),requestType:we(["view_global_contract_code_by_account_id"])}))]),vn=()=>be([ze(()=>ke({amount:de(),codeHash:ze(()=>nt()),globalContractAccountId:Ne(be([ze(()=>De()),ye()])),globalContractHash:Ne(be([ze(()=>nt()),ye()])),locked:de(),storagePaidAt:Ne(le()),storageUsage:le()})),ze(()=>ke({codeBase64:de(),hash:ze(()=>nt())})),ze(()=>Eo()),ze(()=>ke({logs:Ie(de()),result:Ie(le())})),ze(()=>Oe()),ze(()=>Le())]),kn=()=>ke({receiptId:ze(()=>nt())}),En=()=>ke({predecessorId:ze(()=>De()),priority:Ne(le()),receipt:ze(()=>Xt()),receiptId:ze(()=>nt()),receiverId:ze(()=>De())}),bn=()=>be([ke({info:ke({methodName:de()}),name:we(["METHOD_NOT_FOUND"])}),ke({info:ke({errorMessage:de()}),name:we(["PARSE_ERROR"])})]),Sn=()=>ke({signedTxBase64:ze(()=>Gn()),waitUntil:Ne(ze(()=>ho()))}),Pn=()=>Re(de(),_e()),Tn=()=>ke({coldHeadHeight:Ne(le()),finalHeadHeight:Ne(le()),headHeight:Ne(le()),hotDbKind:Ne(de())}),Rn=()=>be([Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["account_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({changesType:we(["single_access_key_changes"]),keys:Ie(ze(()=>He()))})),Pe(ke({blockId:ze(()=>We())}),ke({changesType:we(["single_gas_key_changes"]),keys:Ie(ze(()=>He()))})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["all_access_key_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["all_gas_key_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["contract_code_changes"])})),Pe(ke({blockId:ze(()=>We())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["data_changes"]),keyPrefixBase64:ze(()=>oo())})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["account_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({changesType:we(["single_access_key_changes"]),keys:Ie(ze(()=>He()))})),Pe(ke({finality:ze(()=>_t())}),ke({changesType:we(["single_gas_key_changes"]),keys:Ie(ze(()=>He()))})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["all_access_key_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["all_gas_key_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["contract_code_changes"])})),Pe(ke({finality:ze(()=>_t())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["data_changes"]),keyPrefixBase64:ze(()=>oo())})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["account_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({changesType:we(["single_access_key_changes"]),keys:Ie(ze(()=>He()))})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({changesType:we(["single_gas_key_changes"]),keys:Ie(ze(()=>He()))})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["all_access_key_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["all_gas_key_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["contract_code_changes"])})),Pe(ke({syncCheckpoint:ze(()=>ao())}),ke({accountIds:Ie(ze(()=>De())),changesType:we(["data_changes"]),keyPrefixBase64:ze(()=>oo())}))]),xn=()=>ke({blockHash:ze(()=>nt()),changes:Ie(ze(()=>Jn()))}),wn=()=>be([ke({blockId:ze(()=>We())}),ke({finality:ze(()=>_t())}),ke({syncCheckpoint:ze(()=>ao())})]),An=()=>ke({blockHash:ze(()=>nt()),changes:Ie(ze(()=>Yn()))}),Bn=()=>ye(),Cn=()=>ke({chainId:de(),detailedDebugStatus:Ne(be([ze(()=>ct()),ye()])),genesisHash:ze(()=>nt()),latestProtocolVersion:le(),nodeKey:Ne(be([ze(()=>Kt()),ye()])),nodePublicKey:ze(()=>Kt()),protocolVersion:le(),rpcAddr:Ne(de()),syncInfo:ze(()=>eo()),uptimeSec:le(),validatorAccountId:Ne(be([ze(()=>De()),ye()])),validatorPublicKey:Ne(be([ze(()=>Kt()),ye()])),validators:Ie(ze(()=>_o())),version:ze(()=>ko())}),Nn=()=>be([ze(()=>ke({receipts:Ie(ze(()=>Ft())),receiptsOutcome:Ie(ze(()=>pt())),status:ze(()=>gt()),transaction:ze(()=>Un()),transactionOutcome:ze(()=>pt())})),ze(()=>ke({receiptsOutcome:Ie(ze(()=>pt())),status:ze(()=>gt()),transaction:ze(()=>Un()),transactionOutcome:ze(()=>pt())}))]),Mn=()=>be([ke({signedTxBase64:ze(()=>Gn())}),ke({senderAccountId:ze(()=>De()),txHash:ze(()=>nt())})]),zn=()=>be([we(["latest"]),ke({epochId:ze(()=>ut())}),ke({blockId:ze(()=>We())})]),Ln=()=>ke({currentFishermen:Ie(ze(()=>Io())),currentProposals:Ie(ze(()=>Io())),currentValidators:Ie(ze(()=>ke({accountId:ze(()=>De()),isSlashed:he(),numExpectedBlocks:le(),numExpectedChunks:Ne(le()),numExpectedChunksPerShard:Ne(Ie(le())),numExpectedEndorsements:Ne(le()),numExpectedEndorsementsPerShard:Ne(Ie(le())),numProducedBlocks:le(),numProducedChunks:Ne(le()),numProducedChunksPerShard:Ne(Ie(le())),numProducedEndorsements:Ne(le()),numProducedEndorsementsPerShard:Ne(Ie(le())),publicKey:ze(()=>Kt()),shards:Ie(ze(()=>Dn())),shardsEndorsed:Ne(Ie(ze(()=>Dn()))),stake:de()}))),epochHeight:le(),epochStartHeight:le(),nextFishermen:Ie(ze(()=>Io())),nextValidators:Ie(ze(()=>ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt()),shards:Ie(ze(()=>Dn())),stake:de()}))),prevEpochKickout:Ie(ze(()=>fo()))}),qn=()=>ke({blockId:Ne(be([ze(()=>We()),ye()]))}),jn=()=>ke({accountCreationConfig:ze(()=>ke({minAllowedTopLevelAccountLength:le(),registrarAccountId:ze(()=>De())})),congestionControlConfig:ze(()=>ke({allowedShardOutgoingGas:le(),maxCongestionIncomingGas:le(),maxCongestionMemoryConsumption:le(),maxCongestionMissedChunks:le(),maxCongestionOutgoingGas:le(),maxOutgoingGas:le(),maxTxGas:le(),minOutgoingGas:le(),minTxGas:le(),outgoingReceiptsBigSizeLimit:le(),outgoingReceiptsUsualSizeLimit:le(),rejectTxCongestionThreshold:le()})),storageAmountPerByte:de(),transactionCosts:ze(()=>On()),wasmConfig:ze(()=>yo()),witnessConfig:ze(()=>So())}),On=()=>ke({actionCreationConfig:ze(()=>Ke()),actionReceiptCreationConfig:ze(()=>yt()),burntGasReward:Ie(le()),dataReceiptCreationConfig:ze(()=>ke({baseCost:ze(()=>yt()),costPerByte:ze(()=>yt())})),pessimisticGasPriceInflationRatio:Ie(le()),storageUsageConfig:ze(()=>no())}),Dn=()=>le(),Hn=()=>be([ke({V0:ze(()=>Kn())}),ke({V1:ze(()=>$n())}),ke({V2:ze(()=>Xn())})]),Kn=()=>ke({numShards:le(),version:le()}),$n=()=>ke({boundaryAccounts:Ie(ze(()=>De())),shardsSplitMap:Ne(Ie(Ie(ze(()=>Dn())))),toParentShardMap:Ne(Ie(ze(()=>Dn()))),version:le()}),Xn=()=>ke({boundaryAccounts:Ie(ze(()=>De())),idToIndexMap:Re(de(),le()),indexToIdMap:Re(de(),ze(()=>Dn())),shardIds:Ie(ze(()=>Dn())),shardsParentMap:Ne(Re(de(),ze(()=>Dn()))),shardsSplitMap:Ne(Re(de(),Ie(ze(()=>Dn())))),version:le()}),Vn=()=>de(),Fn=()=>ke({delegateAction:ze(()=>ot()),signature:ze(()=>Vn())}),Gn=()=>de(),Un=()=>ke({actions:Ie(ze(()=>Xe())),hash:ze(()=>nt()),nonce:le(),priorityFee:Ne(le()),publicKey:ze(()=>Kt()),receiverId:ze(()=>De()),signature:ze(()=>Vn()),signerId:ze(()=>De())}),Zn=()=>ke({accountId:ze(()=>De()),isDoubleSign:he()}),Wn=()=>ke({publicKey:ze(()=>Kt()),stake:de()}),Jn=()=>be([ke({accountId:ze(()=>De()),type:we(["account_touched"])}),ke({accountId:ze(()=>De()),type:we(["access_key_touched"])}),ke({accountId:ze(()=>De()),type:we(["data_touched"])}),ke({accountId:ze(()=>De()),type:we(["contract_code_touched"])})]),Yn=()=>Pe(be([ke({change:ke({accountId:ze(()=>De()),amount:de(),codeHash:ze(()=>nt()),globalContractAccountId:Ne(be([ze(()=>De()),ye()])),globalContractHash:Ne(be([ze(()=>nt()),ye()])),locked:de(),storagePaidAt:Ne(le()),storageUsage:le()}),type:we(["account_update"])}),ke({change:ke({accountId:ze(()=>De())}),type:we(["account_deletion"])}),ke({change:ke({accessKey:ze(()=>Oe()),accountId:ze(()=>De()),publicKey:ze(()=>Kt())}),type:we(["access_key_update"])}),ke({change:ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt())}),type:we(["access_key_deletion"])}),ke({change:ke({accountId:ze(()=>De()),gasKey:ze(()=>ke({balance:le(),numNonces:le(),permission:ze(()=>je())})),publicKey:ze(()=>Kt())}),type:we(["gas_key_update"])}),ke({change:ke({accountId:ze(()=>De()),index:le(),nonce:le(),publicKey:ze(()=>Kt())}),type:we(["gas_key_nonce_update"])}),ke({change:ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt())}),type:we(["gas_key_deletion"])}),ke({change:ke({accountId:ze(()=>De()),keyBase64:ze(()=>oo()),valueBase64:ze(()=>so())}),type:we(["data_update"])}),ke({change:ke({accountId:ze(()=>De()),keyBase64:ze(()=>oo())}),type:we(["data_deletion"])}),ke({change:ke({accountId:ze(()=>De()),codeBase64:de()}),type:we(["contract_code_update"])}),ke({change:ke({accountId:ze(()=>De())}),type:we(["contract_code_deletion"])})]),ke({cause:ze(()=>be([ke({type:we(["not_writable_to_disk"])}),ke({type:we(["initial_state"])}),ke({txHash:ze(()=>nt()),type:we(["transaction_processing"])}),ke({receiptHash:ze(()=>nt()),type:we(["action_receipt_processing_started"])}),ke({receiptHash:ze(()=>nt()),type:we(["action_receipt_gas_reward"])}),ke({receiptHash:ze(()=>nt()),type:we(["receipt_processing"])}),ke({receiptHash:ze(()=>nt()),type:we(["postponed_receipt"])}),ke({type:we(["updated_delayed_receipts"])}),ke({type:we(["validator_accounts_update"])}),ke({type:we(["migration"])}),ke({type:we(["bandwidth_scheduler_state_update"])})]))})),Qn=()=>ke({concurrency:Ne(ze(()=>ro())),dump:Ne(be([ze(()=>ke({credentialsFile:Ne(de()),iterationDelay:Ne(be([ze(()=>dt()),ye()])),location:ze(()=>mt()),restartDumpForShards:Ne(Ie(ze(()=>Dn())))})),ye()])),sync:Ne(ze(()=>io()))}),eo=()=>ke({earliestBlockHash:Ne(be([ze(()=>nt()),ye()])),earliestBlockHeight:Ne(le()),earliestBlockTime:Ne(de()),epochId:Ne(be([ze(()=>ut()),ye()])),epochStartHeight:Ne(le()),latestBlockHash:ze(()=>nt()),latestBlockHeight:le(),latestBlockTime:de(),latestStateRoot:ze(()=>nt()),syncing:he()}),to=()=>be([we(["StorageInternalError"]),ke({MissingTrieValue:ze(()=>ke({context:ze(()=>zt()),hash:ze(()=>nt())}))}),we(["UnexpectedTrieValue"]),ke({StorageInconsistentState:de()}),ke({FlatStorageBlockNotSupported:de()}),ke({MemTrieLoadingError:de()})]),no=()=>ke({numBytesAccount:le(),numExtraBytesRecord:le()}),oo=()=>de(),so=()=>de(),ao=()=>we(["genesis","earliest_available"]),ro=()=>ke({apply:le(),applyDuringCatchup:le(),peerDownloads:le(),perShard:le()}),io=()=>be([we(["Peers"]),ke({ExternalStorage:ze(()=>ke({externalStorageFallbackThreshold:Ne(le()),location:ze(()=>mt()),numConcurrentRequests:Ne(le()),numConcurrentRequestsDuringCatchup:Ne(le())}))})]),co=()=>ke({addr:de(),peerId:ze(()=>Kt())}),uo=()=>be([we(["NoShards"]),ke({Shards:Ie(ze(()=>ke({shardId:le(),version:le()})))}),we(["AllShards"]),ke({ShadowValidator:ze(()=>De())}),ke({Schedule:Ie(Ie(ze(()=>Dn())))}),ke({Accounts:Ie(ze(()=>De()))})]),lo=()=>ke({deposit:de()}),po=()=>be([ke({ActionError:ze(()=>ke({index:Ne(le()),kind:ze(()=>$e())}))}),ke({InvalidTxError:ze(()=>be([ke({InvalidAccessKeyError:ze(()=>Tt())}),ke({InvalidSignerId:ke({signerId:de()})}),ke({SignerDoesNotExist:ke({signerId:ze(()=>De())})}),ke({InvalidNonce:ke({akNonce:le(),txNonce:le()})}),ke({NonceTooLarge:ke({txNonce:le(),upperBound:le()})}),ke({InvalidReceiverId:ke({receiverId:de()})}),we(["InvalidSignature"]),ke({NotEnoughBalance:ke({balance:de(),cost:de(),signerId:ze(()=>De())})}),ke({LackBalanceForState:ke({amount:de(),signerId:ze(()=>De())})}),we(["CostOverflow"]),we(["InvalidChain"]),we(["Expired"]),ke({ActionsValidation:ze(()=>Ve())}),ke({TransactionSizeExceeded:ke({limit:le(),size:le()})}),we(["InvalidTransactionVersion"]),ke({StorageError:ze(()=>to())}),ke({ShardCongested:ke({congestionLevel:le(),shardId:le()})}),ke({ShardStuck:ke({missedChunks:le(),shardId:le()})})]))})]),ho=()=>be([we(["NONE"]),we(["INCLUDED"]),we(["EXECUTED_OPTIMISTIC"]),we(["INCLUDED_FINAL"]),we(["EXECUTED"]),we(["FINAL"])]),mo=()=>ke({contractIdentifier:ze(()=>St())}),yo=()=>ke({discardCustomSections:he(),ethImplicitAccounts:he(),extCosts:ze(()=>ke({altBn128G1MultiexpBase:le(),altBn128G1MultiexpElement:le(),altBn128G1SumBase:le(),altBn128G1SumElement:le(),altBn128PairingCheckBase:le(),altBn128PairingCheckElement:le(),base:le(),bls12381G1MultiexpBase:le(),bls12381G1MultiexpElement:le(),bls12381G2MultiexpBase:le(),bls12381G2MultiexpElement:le(),bls12381MapFp2ToG2Base:le(),bls12381MapFp2ToG2Element:le(),bls12381MapFpToG1Base:le(),bls12381MapFpToG1Element:le(),bls12381P1DecompressBase:le(),bls12381P1DecompressElement:le(),bls12381P1SumBase:le(),bls12381P1SumElement:le(),bls12381P2DecompressBase:le(),bls12381P2DecompressElement:le(),bls12381P2SumBase:le(),bls12381P2SumElement:le(),bls12381PairingBase:le(),bls12381PairingElement:le(),contractCompileBase:le(),contractCompileBytes:le(),contractLoadingBase:le(),contractLoadingBytes:le(),ecrecoverBase:le(),ed25519VerifyBase:le(),ed25519VerifyByte:le(),keccak256Base:le(),keccak256Byte:le(),keccak512Base:le(),keccak512Byte:le(),logBase:le(),logByte:le(),promiseAndBase:le(),promiseAndPerPromise:le(),promiseReturn:le(),readCachedTrieNode:le(),readMemoryBase:le(),readMemoryByte:le(),readRegisterBase:le(),readRegisterByte:le(),ripemd160Base:le(),ripemd160Block:le(),sha256Base:le(),sha256Byte:le(),storageHasKeyBase:le(),storageHasKeyByte:le(),storageIterCreateFromByte:le(),storageIterCreatePrefixBase:le(),storageIterCreatePrefixByte:le(),storageIterCreateRangeBase:le(),storageIterCreateToByte:le(),storageIterNextBase:le(),storageIterNextKeyByte:le(),storageIterNextValueByte:le(),storageLargeReadOverheadBase:le(),storageLargeReadOverheadByte:le(),storageReadBase:le(),storageReadKeyByte:le(),storageReadValueByte:le(),storageRemoveBase:le(),storageRemoveKeyByte:le(),storageRemoveRetValueByte:le(),storageWriteBase:le(),storageWriteEvictedByte:le(),storageWriteKeyByte:le(),storageWriteValueByte:le(),touchingTrieNode:le(),utf16DecodingBase:le(),utf16DecodingByte:le(),utf8DecodingBase:le(),utf8DecodingByte:le(),validatorStakeBase:le(),validatorTotalStakeBase:le(),writeMemoryBase:le(),writeMemoryByte:le(),writeRegisterBase:le(),writeRegisterByte:le(),yieldCreateBase:le(),yieldCreateByte:le(),yieldResumeBase:le(),yieldResumeByte:le()})),fixContractLoadingCost:he(),globalContractHostFns:he(),growMemCost:le(),implicitAccountCreation:he(),limitConfig:ze(()=>Ct()),reftypesBulkMemory:he(),regularOpCost:le(),saturatingFloatToInt:he(),storageGetMode:ze(()=>we(["FlatStorage","Trie"])),vmKind:ze(()=>go())}),go=()=>be([we(["Wasmer0"]),we(["Wasmtime"]),we(["Wasmer2"]),we(["NearVm"]),we(["NearVm2"])]),_o=()=>ke({accountId:ze(()=>De())}),fo=()=>ke({accountId:ze(()=>De()),reason:ze(()=>be([we(["_UnusedSlashed"]),ke({NotEnoughBlocks:ke({expected:le(),produced:le()})}),ke({NotEnoughChunks:ke({expected:le(),produced:le()})}),we(["Unstaked"]),ke({NotEnoughStake:ke({stakeU128:de(),thresholdU128:de()})}),we(["DidNotGetASeat"]),ke({NotEnoughChunkEndorsements:ke({expected:le(),produced:le()})}),ke({ProtocolVersionTooOld:ke({networkVersion:le(),version:le()})})]))}),Io=()=>ze(()=>vo()),vo=()=>ke({accountId:ze(()=>De()),publicKey:ze(()=>Kt()),stake:de()}),ko=()=>ke({build:de(),commit:de(),rustcVersion:Ne(de()),version:de()}),Eo=()=>ke({proof:Ne(Ie(de())),values:Ie(ze(()=>ke({key:ze(()=>oo()),value:ze(()=>so())})))}),bo=()=>be([we(["Unreachable"]),we(["IncorrectCallIndirectSignature"]),we(["MemoryOutOfBounds"]),we(["CallIndirectOOB"]),we(["IllegalArithmetic"]),we(["MisalignedAtomicAccess"]),we(["IndirectCallToNull"]),we(["StackOverflow"]),we(["GenericTrap"])]),So=()=>ke({combinedTransactionsSizeLimit:le(),mainStorageProofSizeSoftLimit:le(),newTransactionsValidationStateSizeSoftLimit:le()}),Po={EXPERIMENTAL_changes:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_changes"]),params:ze(()=>Rn())})),responseSchema:()=>ze(()=>wt())},EXPERIMENTAL_changes_in_block:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_changes_in_block"]),params:ze(()=>wn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>xn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_congestion_level:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_congestion_level"]),params:ze(()=>Qt())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>en())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_genesis_config:{requestSchema:()=>ze(()=>Rt()),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Et())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_light_client_block_proof:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_light_client_block_proof"]),params:ze(()=>rn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>cn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_light_client_proof:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_light_client_proof"]),params:ze(()=>dn())})),responseSchema:()=>ze(()=>xt())},EXPERIMENTAL_maintenance_windows:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_maintenance_windows"]),params:ze(()=>hn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:Ie(ze(()=>$t()))}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_protocol_config:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_protocol_config"]),params:ze(()=>_n())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>fn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_receipt:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_receipt"]),params:ze(()=>kn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>En())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_split_storage_info:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_split_storage_info"]),params:ze(()=>Pn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Tn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},EXPERIMENTAL_tx_status:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_tx_status"]),params:ze(()=>Mn())})),responseSchema:()=>ze(()=>At())},EXPERIMENTAL_validators_ordered:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["EXPERIMENTAL_validators_ordered"]),params:ze(()=>qn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:Ie(ze(()=>Io()))}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},block:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["block"]),params:ze(()=>Gt())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Ut())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},broadcast_tx_async:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["broadcast_tx_async"]),params:ze(()=>Sn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>nt())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},broadcast_tx_commit:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["broadcast_tx_commit"]),params:ze(()=>Sn())})),responseSchema:()=>ze(()=>At())},changes:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["changes"]),params:ze(()=>Rn())})),responseSchema:()=>ze(()=>wt())},chunk:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["chunk"]),params:ze(()=>Zt())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Wt())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},client_config:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["client_config"]),params:ze(()=>Jt())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Yt())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},gas_price:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["gas_price"]),params:ze(()=>nn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>on())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},health:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["health"]),params:ze(()=>sn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:be([ze(()=>an()),ye()])}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},light_client_proof:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["light_client_proof"]),params:ze(()=>dn())})),responseSchema:()=>ze(()=>xt())},network_info:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["network_info"]),params:ze(()=>mn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>yn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},next_light_client_block:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["next_light_client_block"]),params:ze(()=>ln())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>pn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},query:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["query"]),params:ze(()=>In())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>vn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},send_tx:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["send_tx"]),params:ze(()=>Sn())})),responseSchema:()=>ze(()=>At())},status:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["status"]),params:ze(()=>Bn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Cn())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))},tx:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["tx"]),params:ze(()=>Mn())})),responseSchema:()=>ze(()=>At())},validators:{requestSchema:()=>ze(()=>ke({id:de(),jsonrpc:de(),method:we(["validators"]),params:ze(()=>zn())})),responseSchema:()=>ze(()=>Pe(be([ke({result:ze(()=>Ln())}),ke({error:ze(()=>tn())})]),ke({id:de(),jsonrpc:de()})))}},To=()=>ke({jsonrpc:Be("2.0"),id:de(),method:de(),params:Ne(_e())}),Ro=()=>ke({jsonrpc:Be("2.0"),id:de(),result:Ne(_e()),error:Ne(ke({code:le(),message:de(),data:Ne(_e())}))}),xo={"/EXPERIMENTAL_changes":"EXPERIMENTAL_changes","/EXPERIMENTAL_changes_in_block":"EXPERIMENTAL_changes_in_block","/EXPERIMENTAL_congestion_level":"EXPERIMENTAL_congestion_level","/EXPERIMENTAL_genesis_config":"EXPERIMENTAL_genesis_config","/EXPERIMENTAL_light_client_block_proof":"EXPERIMENTAL_light_client_block_proof","/EXPERIMENTAL_light_client_proof":"EXPERIMENTAL_light_client_proof","/EXPERIMENTAL_maintenance_windows":"EXPERIMENTAL_maintenance_windows","/EXPERIMENTAL_protocol_config":"EXPERIMENTAL_protocol_config","/EXPERIMENTAL_receipt":"EXPERIMENTAL_receipt","/EXPERIMENTAL_split_storage_info":"EXPERIMENTAL_split_storage_info","/EXPERIMENTAL_tx_status":"EXPERIMENTAL_tx_status","/EXPERIMENTAL_validators_ordered":"EXPERIMENTAL_validators_ordered","/block":"block","/broadcast_tx_async":"broadcast_tx_async","/broadcast_tx_commit":"broadcast_tx_commit","/changes":"changes","/chunk":"chunk","/client_config":"client_config","/gas_price":"gas_price","/health":"health","/light_client_proof":"light_client_proof","/network_info":"network_info","/next_light_client_block":"next_light_client_block","/query":"query","/send_tx":"send_tx","/status":"status","/tx":"tx","/validators":"validators"};Object.entries(xo).forEach(([e,t])=>{});var wo=Object.values(xo);async function Ao(e,t){return e.makeRequest("EXPERIMENTAL_changes",t)}async function Bo(e,t){return e.makeRequest("EXPERIMENTAL_changes_in_block",t)}async function Co(e,t){return e.makeRequest("EXPERIMENTAL_congestion_level",t)}async function No(e,t){return e.makeRequest("EXPERIMENTAL_genesis_config",t)}async function Mo(e,t){return e.makeRequest("EXPERIMENTAL_light_client_block_proof",t)}async function zo(e,t){return e.makeRequest("EXPERIMENTAL_light_client_proof",t)}async function Lo(e,t){return e.makeRequest("EXPERIMENTAL_maintenance_windows",t)}async function qo(e,t){return e.makeRequest("EXPERIMENTAL_protocol_config",t)}async function jo(e,t){return e.makeRequest("EXPERIMENTAL_receipt",t)}async function Oo(e,t){return e.makeRequest("EXPERIMENTAL_split_storage_info",t)}async function Do(e,t){return e.makeRequest("EXPERIMENTAL_tx_status",t)}async function Ho(e,t){return e.makeRequest("EXPERIMENTAL_validators_ordered",t)}async function Ko(e,t){return e.makeRequest("block",t)}async function $o(e,t){return e.makeRequest("broadcast_tx_async",t)}async function Xo(e,t){return e.makeRequest("broadcast_tx_commit",t)}async function Vo(e,t){return e.makeRequest("changes",t)}async function Fo(e,t){return e.makeRequest("chunk",t)}async function Go(e,t){return e.makeRequest("client_config",t)}async function Uo(e,t){return e.makeRequest("gas_price",t)}async function Zo(e,t){return e.makeRequest("health",t)}async function Wo(e,t){return e.makeRequest("light_client_proof",t)}async function Jo(e,t){return e.makeRequest("network_info",t)}async function Yo(e,t){return e.makeRequest("next_light_client_block",t)}async function Qo(e,t){return e.makeRequest("query",t)}async function es(e,t){return e.makeRequest("send_tx",t)}async function ts(e,t){return e.makeRequest("status",t)}async function ns(e,t){return e.makeRequest("tx",t)}async function os(e,t){return e.makeRequest("validators",t)}async function ss(e,t){return Qo(e,t.blockId?{requestType:"view_account",accountId:t.accountId,blockId:t.blockId}:{requestType:"view_account",accountId:t.accountId,finality:t.finality||"final"})}async function as(e,t){const n={requestType:"call_function",accountId:t.accountId,methodName:t.methodName,argsBase64:t.argsBase64??""};return Qo(e,t.blockId?{...n,blockId:t.blockId}:{...n,finality:t.finality||"final"})}async function rs(e,t){return Qo(e,t.blockId?{requestType:"view_access_key",accountId:t.accountId,publicKey:t.publicKey,blockId:t.blockId}:{requestType:"view_access_key",accountId:t.accountId,publicKey:t.publicKey,finality:t.finality||"final"})}function is(){const e=To(),t=Ro();return{validateRequest:t=>{try{e.parse(t)}catch(e){throw new a(`Invalid request format: ${e instanceof Error?e.message:"Unknown error"}`,e)}},validateResponse:e=>{try{t.parse(e)}catch(e){throw new s(`Invalid response format: ${e instanceof Error?e.message:"Unknown error"}`)}},validateMethodRequest:(t,n)=>{try{e.parse(n);const o=Po[t];if(o?.requestSchema){o.requestSchema().parse(n)}}catch(e){throw new a(`Invalid ${t} request: ${e instanceof Error?e.message:"Unknown error"}`,e)}},validateMethodResponse:(e,n)=>{try{t.parse(n);const o=Po[e];if(o?.responseSchema){o.responseSchema().parse(n)}}catch(t){throw new s(`Invalid ${e} response: ${t instanceof Error?t.message:"Unknown error"}`)}}}}export{s as JsonRpcClientError,a as JsonRpcNetworkError,To as JsonRpcRequestSchema,Ro as JsonRpcResponseSchema,r as NearRpcClient,c as NearRpcError,wo as RPC_METHODS,Ko as block,$o as broadcastTxAsync,Xo as broadcastTxCommit,Vo as changes,Fo as chunk,Go as clientConfig,r as default,i as defaultClient,is as enableValidation,Ao as experimentalChanges,Bo as experimentalChangesInBlock,Co as experimentalCongestionLevel,No as experimentalGenesisConfig,Mo as experimentalLightClientBlockProof,zo as experimentalLightClientProof,Lo as experimentalMaintenanceWindows,qo as experimentalProtocolConfig,jo as experimentalReceipt,Oo as experimentalSplitStorageInfo,Do as experimentalTxStatus,Ho as experimentalValidatorsOrdered,Uo as gasPrice,Zo as health,Wo as lightClientProof,Jo as networkInfo,Yo as nextLightClientBlock,Qo as query,es as sendTx,ts as status,ns as tx,os as validators,rs as viewAccessKey,ss as viewAccount,as as viewFunction};
|
package/dist/client.d.ts
CHANGED
@@ -30,7 +30,8 @@ export declare class JsonRpcClientError extends Error {
|
|
30
30
|
}
|
31
31
|
export declare class JsonRpcNetworkError extends Error {
|
32
32
|
originalError?: Error | undefined;
|
33
|
-
|
33
|
+
responseBody?: unknown | undefined;
|
34
|
+
constructor(message: string, originalError?: Error | undefined, responseBody?: unknown | undefined);
|
34
35
|
}
|
35
36
|
/**
|
36
37
|
* NEAR RPC Client with static function architecture
|
package/dist/client.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAiDxD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAGD,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,CAAC;CACZ;AAGD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAGD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAGD,qBAAa,kBAAmB,SAAQ,KAAK;IAGlC,IAAI,CAAC,EAAE,MAAM;IACb,IAAI,CAAC,EAAE,OAAO;gBAFrB,OAAO,EAAE,MAAM,EACR,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,IAAI,CAAC,EAAE,OAAO,YAAA;CAKxB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAGnC,aAAa,CAAC,EAAE,KAAK;
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAiDxD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC/B;AAGD,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,OAAO;IACzC,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,CAAC,CAAC;CACZ;AAGD,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,OAAO,EAAE,KAAK,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAGD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAGD,qBAAa,kBAAmB,SAAQ,KAAK;IAGlC,IAAI,CAAC,EAAE,MAAM;IACb,IAAI,CAAC,EAAE,OAAO;gBAFrB,OAAO,EAAE,MAAM,EACR,IAAI,CAAC,EAAE,MAAM,YAAA,EACb,IAAI,CAAC,EAAE,OAAO,YAAA;CAKxB;AAED,qBAAa,mBAAoB,SAAQ,KAAK;IAGnC,aAAa,CAAC,EAAE,KAAK;IACrB,YAAY,CAAC,EAAE,OAAO;gBAF7B,OAAO,EAAE,MAAM,EACR,aAAa,CAAC,EAAE,KAAK,YAAA,EACrB,YAAY,CAAC,EAAE,OAAO,YAAA;CAKhC;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,SAAgB,OAAO,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAmB;gBAEnC,MAAM,EAAE,MAAM,GAAG,YAAY;IAiBzC;;;OAGG;IACG,WAAW,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,EACpD,MAAM,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC;IAyHnB;;OAEG;IACH,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG,aAAa;CAazD;AAGD,eAAO,MAAM,aAAa,eAExB,CAAC"}
|
package/dist/index.d.mts
CHANGED
@@ -45,7 +45,8 @@ declare class JsonRpcClientError extends Error {
|
|
45
45
|
}
|
46
46
|
declare class JsonRpcNetworkError extends Error {
|
47
47
|
originalError?: Error | undefined;
|
48
|
-
|
48
|
+
responseBody?: unknown | undefined;
|
49
|
+
constructor(message: string, originalError?: Error | undefined, responseBody?: unknown | undefined);
|
49
50
|
}
|
50
51
|
/**
|
51
52
|
* NEAR RPC Client with static function architecture
|
package/dist/index.js
CHANGED
@@ -109,9 +109,10 @@ var JsonRpcClientError = class extends Error {
|
|
109
109
|
}
|
110
110
|
};
|
111
111
|
var JsonRpcNetworkError = class extends Error {
|
112
|
-
constructor(message, originalError) {
|
112
|
+
constructor(message, originalError, responseBody) {
|
113
113
|
super(message);
|
114
114
|
this.originalError = originalError;
|
115
|
+
this.responseBody = responseBody;
|
115
116
|
this.name = "JsonRpcNetworkError";
|
116
117
|
}
|
117
118
|
};
|
@@ -171,23 +172,21 @@ var NearRpcClient = class _NearRpcClient {
|
|
171
172
|
signal: controller.signal
|
172
173
|
});
|
173
174
|
clearTimeout(timeoutId);
|
174
|
-
if (!response.ok) {
|
175
|
-
throw new JsonRpcNetworkError(
|
176
|
-
`HTTP error! status: ${response.status}`
|
177
|
-
);
|
178
|
-
}
|
179
175
|
let jsonResponse;
|
180
176
|
try {
|
181
177
|
jsonResponse = await response.json();
|
182
178
|
} catch (parseError) {
|
179
|
+
if (!response.ok) {
|
180
|
+
throw new JsonRpcNetworkError(
|
181
|
+
`HTTP error! status: ${response.status} - Failed to parse JSON response`,
|
182
|
+
parseError
|
183
|
+
);
|
184
|
+
}
|
183
185
|
throw new JsonRpcNetworkError(
|
184
186
|
"Failed to parse JSON response",
|
185
187
|
parseError
|
186
188
|
);
|
187
189
|
}
|
188
|
-
if (this.validation) {
|
189
|
-
this.validation.validateResponse(jsonResponse);
|
190
|
-
}
|
191
190
|
if (jsonResponse.error) {
|
192
191
|
throw new JsonRpcClientError(
|
193
192
|
jsonResponse.error.message,
|
@@ -195,6 +194,16 @@ var NearRpcClient = class _NearRpcClient {
|
|
195
194
|
jsonResponse.error.data
|
196
195
|
);
|
197
196
|
}
|
197
|
+
if (!response.ok) {
|
198
|
+
throw new JsonRpcNetworkError(
|
199
|
+
`HTTP error! status: ${response.status}`,
|
200
|
+
void 0,
|
201
|
+
jsonResponse
|
202
|
+
);
|
203
|
+
}
|
204
|
+
if (this.validation) {
|
205
|
+
this.validation.validateResponse(jsonResponse);
|
206
|
+
}
|
198
207
|
const camelCaseResult = jsonResponse.result ? convertKeysToCamelCase(jsonResponse.result) : jsonResponse.result;
|
199
208
|
if (this.validation && "validateMethodResponse" in this.validation) {
|
200
209
|
const camelCaseResponse = {
|
package/dist/index.mjs
CHANGED
@@ -43,9 +43,10 @@ var JsonRpcClientError = class extends Error {
|
|
43
43
|
}
|
44
44
|
};
|
45
45
|
var JsonRpcNetworkError = class extends Error {
|
46
|
-
constructor(message, originalError) {
|
46
|
+
constructor(message, originalError, responseBody) {
|
47
47
|
super(message);
|
48
48
|
this.originalError = originalError;
|
49
|
+
this.responseBody = responseBody;
|
49
50
|
this.name = "JsonRpcNetworkError";
|
50
51
|
}
|
51
52
|
};
|
@@ -105,23 +106,21 @@ var NearRpcClient = class _NearRpcClient {
|
|
105
106
|
signal: controller.signal
|
106
107
|
});
|
107
108
|
clearTimeout(timeoutId);
|
108
|
-
if (!response.ok) {
|
109
|
-
throw new JsonRpcNetworkError(
|
110
|
-
`HTTP error! status: ${response.status}`
|
111
|
-
);
|
112
|
-
}
|
113
109
|
let jsonResponse;
|
114
110
|
try {
|
115
111
|
jsonResponse = await response.json();
|
116
112
|
} catch (parseError) {
|
113
|
+
if (!response.ok) {
|
114
|
+
throw new JsonRpcNetworkError(
|
115
|
+
`HTTP error! status: ${response.status} - Failed to parse JSON response`,
|
116
|
+
parseError
|
117
|
+
);
|
118
|
+
}
|
117
119
|
throw new JsonRpcNetworkError(
|
118
120
|
"Failed to parse JSON response",
|
119
121
|
parseError
|
120
122
|
);
|
121
123
|
}
|
122
|
-
if (this.validation) {
|
123
|
-
this.validation.validateResponse(jsonResponse);
|
124
|
-
}
|
125
124
|
if (jsonResponse.error) {
|
126
125
|
throw new JsonRpcClientError(
|
127
126
|
jsonResponse.error.message,
|
@@ -129,6 +128,16 @@ var NearRpcClient = class _NearRpcClient {
|
|
129
128
|
jsonResponse.error.data
|
130
129
|
);
|
131
130
|
}
|
131
|
+
if (!response.ok) {
|
132
|
+
throw new JsonRpcNetworkError(
|
133
|
+
`HTTP error! status: ${response.status}`,
|
134
|
+
void 0,
|
135
|
+
jsonResponse
|
136
|
+
);
|
137
|
+
}
|
138
|
+
if (this.validation) {
|
139
|
+
this.validation.validateResponse(jsonResponse);
|
140
|
+
}
|
132
141
|
const camelCaseResult = jsonResponse.result ? convertKeysToCamelCase(jsonResponse.result) : jsonResponse.result;
|
133
142
|
if (this.validation && "validateMethodResponse" in this.validation) {
|
134
143
|
const camelCaseResponse = {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@psalomo/jsonrpc-client",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.2",
|
4
4
|
"description": "TypeScript client for NEAR Protocol JSON-RPC API",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"module": "./dist/index.mjs",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"test:coverage": "vitest run --coverage"
|
31
31
|
},
|
32
32
|
"dependencies": {
|
33
|
-
"@psalomo/jsonrpc-types": "^1.0.
|
33
|
+
"@psalomo/jsonrpc-types": "^1.0.2"
|
34
34
|
},
|
35
35
|
"devDependencies": {
|
36
36
|
"@rollup/plugin-node-resolve": "^16.0.1",
|