dino-market-ui-seedwork
Version:
mutual component for all package
1 lines • 8.62 MB
JavaScript
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,(()=>(()=>{var __webpack_modules__={84453:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decompress=t.compress=void 0;const r=n(10641);function o(e){const t=[],n=[],r=new Map;for(const o of e.entries)if(o.exist){const e={exist:i(o.exist,n,r)};t.push(e)}else{if(!o.nonexist)throw new Error("Unexpected batch entry during compress");{const e=o.nonexist,a={nonexist:{key:e.key,left:i(e.left,n,r),right:i(e.right,n,r)}};t.push(a)}}return{entries:t,lookupInners:n}}function i(e,t,n){if(!e)return;const o=e.path.map((e=>{const o=r.ics23.InnerOp.encode(e).finish();let i=n.get(o);return void 0===i&&(i=t.length,t.push(e),n.set(o,i)),i}));return{key:e.key,value:e.value,leaf:e.leaf,path:o}}function a(e){const t=e.lookupInners;return{entries:e.entries.map((e=>{if(e.exist)return{exist:s(e.exist,t)};if(e.nonexist){const n=e.nonexist;return{nonexist:{key:n.key,left:s(n.left,t),right:s(n.right,t)}}}throw new Error("Unexpected batch entry during compress")}))}}function s(e,t){if(!e)return;const{key:n,value:r,leaf:o,path:i}=e;return{key:n,value:r,leaf:o,path:(i||[]).map((e=>t[e]))}}t.compress=function(e){return e.batch?{compressed:o(e.batch)}:e},t.decompress=function(e){return e.compressed?{batch:a(e.compressed)}:e}},10641:(e,t,n)=>{"use strict";var r,o,i,a=n(62100),s=a.Reader,c=a.Writer,l=a.util,u=a.roots.default||(a.roots.default={});u.ics23=((i={}).HashOp=(r={},(o=Object.create(r))[r[0]="NO_HASH"]=0,o[r[1]="SHA256"]=1,o[r[2]="SHA512"]=2,o[r[3]="KECCAK"]=3,o[r[4]="RIPEMD160"]=4,o[r[5]="BITCOIN"]=5,o[r[6]="SHA512_256"]=6,o),i.LengthOp=function(){var e={},t=Object.create(e);return t[e[0]="NO_PREFIX"]=0,t[e[1]="VAR_PROTO"]=1,t[e[2]="VAR_RLP"]=2,t[e[3]="FIXED32_BIG"]=3,t[e[4]="FIXED32_LITTLE"]=4,t[e[5]="FIXED64_BIG"]=5,t[e[6]="FIXED64_LITTLE"]=6,t[e[7]="REQUIRE_32_BYTES"]=7,t[e[8]="REQUIRE_64_BYTES"]=8,t}(),i.ExistenceProof=function(){function e(e){if(this.path=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key=l.newBuffer([]),e.prototype.value=l.newBuffer([]),e.prototype.leaf=null,e.prototype.path=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=c.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).bytes(e.key),null!=e.value&&e.hasOwnProperty("value")&&t.uint32(18).bytes(e.value),null!=e.leaf&&e.hasOwnProperty("leaf")&&u.ics23.LeafOp.encode(e.leaf,t.uint32(26).fork()).ldelim(),null!=e.path&&e.path.length)for(var n=0;n<e.path.length;++n)u.ics23.InnerOp.encode(e.path[n],t.uint32(34).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.ExistenceProof;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.bytes();break;case 2:r.value=e.bytes();break;case 3:r.leaf=u.ics23.LeafOp.decode(e,e.uint32());break;case 4:r.path&&r.path.length||(r.path=[]),r.path.push(u.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||l.isString(e.key)))return"key: buffer expected";if(null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||l.isString(e.value)))return"value: buffer expected";if(null!=e.leaf&&e.hasOwnProperty("leaf")&&(n=u.ics23.LeafOp.verify(e.leaf)))return"leaf."+n;if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t){var n;if(n=u.ics23.InnerOp.verify(e.path[t]))return"path."+n}}return null},e.fromObject=function(e){if(e instanceof u.ics23.ExistenceProof)return e;var t=new u.ics23.ExistenceProof;if(null!=e.key&&("string"==typeof e.key?l.base64.decode(e.key,t.key=l.newBuffer(l.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.value&&("string"==typeof e.value?l.base64.decode(e.value,t.value=l.newBuffer(l.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),null!=e.leaf){if("object"!=typeof e.leaf)throw TypeError(".ics23.ExistenceProof.leaf: object expected");t.leaf=u.ics23.LeafOp.fromObject(e.leaf)}if(e.path){if(!Array.isArray(e.path))throw TypeError(".ics23.ExistenceProof.path: array expected");t.path=[];for(var n=0;n<e.path.length;++n){if("object"!=typeof e.path[n])throw TypeError(".ics23.ExistenceProof.path: object expected");t.path[n]=u.ics23.InnerOp.fromObject(e.path[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=l.newBuffer(n.key))),t.bytes===String?n.value="":(n.value=[],t.bytes!==Array&&(n.value=l.newBuffer(n.value))),n.leaf=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?l.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=t.bytes===String?l.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),null!=e.leaf&&e.hasOwnProperty("leaf")&&(n.leaf=u.ics23.LeafOp.toObject(e.leaf,t)),e.path&&e.path.length){n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=u.ics23.InnerOp.toObject(e.path[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.NonExistenceProof=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key=l.newBuffer([]),e.prototype.left=null,e.prototype.right=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).bytes(e.key),null!=e.left&&e.hasOwnProperty("left")&&u.ics23.ExistenceProof.encode(e.left,t.uint32(18).fork()).ldelim(),null!=e.right&&e.hasOwnProperty("right")&&u.ics23.ExistenceProof.encode(e.right,t.uint32(26).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.NonExistenceProof;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.bytes();break;case 2:r.left=u.ics23.ExistenceProof.decode(e,e.uint32());break;case 3:r.right=u.ics23.ExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||l.isString(e.key))?"key: buffer expected":null!=e.left&&e.hasOwnProperty("left")&&(t=u.ics23.ExistenceProof.verify(e.left))?"left."+t:null!=e.right&&e.hasOwnProperty("right")&&(t=u.ics23.ExistenceProof.verify(e.right))?"right."+t:null;var t},e.fromObject=function(e){if(e instanceof u.ics23.NonExistenceProof)return e;var t=new u.ics23.NonExistenceProof;if(null!=e.key&&("string"==typeof e.key?l.base64.decode(e.key,t.key=l.newBuffer(l.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.left){if("object"!=typeof e.left)throw TypeError(".ics23.NonExistenceProof.left: object expected");t.left=u.ics23.ExistenceProof.fromObject(e.left)}if(null!=e.right){if("object"!=typeof e.right)throw TypeError(".ics23.NonExistenceProof.right: object expected");t.right=u.ics23.ExistenceProof.fromObject(e.right)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=l.newBuffer(n.key))),n.left=null,n.right=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?l.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.left&&e.hasOwnProperty("left")&&(n.left=u.ics23.ExistenceProof.toObject(e.left,t)),null!=e.right&&e.hasOwnProperty("right")&&(n.right=u.ics23.ExistenceProof.toObject(e.right,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CommitmentProof=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.exist=null,e.prototype.nonexist=null,e.prototype.batch=null,e.prototype.compressed=null,Object.defineProperty(e.prototype,"proof",{get:l.oneOfGetter(t=["exist","nonexist","batch","compressed"]),set:l.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.exist&&e.hasOwnProperty("exist")&&u.ics23.ExistenceProof.encode(e.exist,t.uint32(10).fork()).ldelim(),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&u.ics23.NonExistenceProof.encode(e.nonexist,t.uint32(18).fork()).ldelim(),null!=e.batch&&e.hasOwnProperty("batch")&&u.ics23.BatchProof.encode(e.batch,t.uint32(26).fork()).ldelim(),null!=e.compressed&&e.hasOwnProperty("compressed")&&u.ics23.CompressedBatchProof.encode(e.compressed,t.uint32(34).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.CommitmentProof;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.exist=u.ics23.ExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=u.ics23.NonExistenceProof.decode(e,e.uint32());break;case 3:r.batch=u.ics23.BatchProof.decode(e,e.uint32());break;case 4:r.compressed=u.ics23.CompressedBatchProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=u.ics23.ExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";if(t.proof=1,n=u.ics23.NonExistenceProof.verify(e.nonexist))return"nonexist."+n}if(null!=e.batch&&e.hasOwnProperty("batch")){if(1===t.proof)return"proof: multiple values";if(t.proof=1,n=u.ics23.BatchProof.verify(e.batch))return"batch."+n}if(null!=e.compressed&&e.hasOwnProperty("compressed")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=u.ics23.CompressedBatchProof.verify(e.compressed))return"compressed."+n}return null},e.fromObject=function(e){if(e instanceof u.ics23.CommitmentProof)return e;var t=new u.ics23.CommitmentProof;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.CommitmentProof.exist: object expected");t.exist=u.ics23.ExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.CommitmentProof.nonexist: object expected");t.nonexist=u.ics23.NonExistenceProof.fromObject(e.nonexist)}if(null!=e.batch){if("object"!=typeof e.batch)throw TypeError(".ics23.CommitmentProof.batch: object expected");t.batch=u.ics23.BatchProof.fromObject(e.batch)}if(null!=e.compressed){if("object"!=typeof e.compressed)throw TypeError(".ics23.CommitmentProof.compressed: object expected");t.compressed=u.ics23.CompressedBatchProof.fromObject(e.compressed)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=u.ics23.ExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=u.ics23.NonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),null!=e.batch&&e.hasOwnProperty("batch")&&(n.batch=u.ics23.BatchProof.toObject(e.batch,t),t.oneofs&&(n.proof="batch")),null!=e.compressed&&e.hasOwnProperty("compressed")&&(n.compressed=u.ics23.CompressedBatchProof.toObject(e.compressed,t),t.oneofs&&(n.proof="compressed")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.LeafOp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hash=0,e.prototype.prehashKey=0,e.prototype.prehashValue=0,e.prototype.length=0,e.prototype.prefix=l.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.hash&&e.hasOwnProperty("hash")&&t.uint32(8).int32(e.hash),null!=e.prehashKey&&e.hasOwnProperty("prehashKey")&&t.uint32(16).int32(e.prehashKey),null!=e.prehashValue&&e.hasOwnProperty("prehashValue")&&t.uint32(24).int32(e.prehashValue),null!=e.length&&e.hasOwnProperty("length")&&t.uint32(32).int32(e.length),null!=e.prefix&&e.hasOwnProperty("prefix")&&t.uint32(42).bytes(e.prefix),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.LeafOp;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.hash=e.int32();break;case 2:r.prehashKey=e.int32();break;case 3:r.prehashValue=e.int32();break;case 4:r.length=e.int32();break;case 5:r.prefix=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.prehashKey&&e.hasOwnProperty("prehashKey"))switch(e.prehashKey){default:return"prehashKey: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.prehashValue&&e.hasOwnProperty("prehashValue"))switch(e.prehashValue){default:return"prehashValue: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.length&&e.hasOwnProperty("length"))switch(e.length){default:return"length: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return null!=e.prefix&&e.hasOwnProperty("prefix")&&!(e.prefix&&"number"==typeof e.prefix.length||l.isString(e.prefix))?"prefix: buffer expected":null},e.fromObject=function(e){if(e instanceof u.ics23.LeafOp)return e;var t=new u.ics23.LeafOp;switch(e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}switch(e.prehashKey){case"NO_HASH":case 0:t.prehashKey=0;break;case"SHA256":case 1:t.prehashKey=1;break;case"SHA512":case 2:t.prehashKey=2;break;case"KECCAK":case 3:t.prehashKey=3;break;case"RIPEMD160":case 4:t.prehashKey=4;break;case"BITCOIN":case 5:t.prehashKey=5;break;case"SHA512_256":case 6:t.prehashKey=6}switch(e.prehashValue){case"NO_HASH":case 0:t.prehashValue=0;break;case"SHA256":case 1:t.prehashValue=1;break;case"SHA512":case 2:t.prehashValue=2;break;case"KECCAK":case 3:t.prehashValue=3;break;case"RIPEMD160":case 4:t.prehashValue=4;break;case"BITCOIN":case 5:t.prehashValue=5;break;case"SHA512_256":case 6:t.prehashValue=6}switch(e.length){case"NO_PREFIX":case 0:t.length=0;break;case"VAR_PROTO":case 1:t.length=1;break;case"VAR_RLP":case 2:t.length=2;break;case"FIXED32_BIG":case 3:t.length=3;break;case"FIXED32_LITTLE":case 4:t.length=4;break;case"FIXED64_BIG":case 5:t.length=5;break;case"FIXED64_LITTLE":case 6:t.length=6;break;case"REQUIRE_32_BYTES":case 7:t.length=7;break;case"REQUIRE_64_BYTES":case 8:t.length=8}return null!=e.prefix&&("string"==typeof e.prefix?l.base64.decode(e.prefix,t.prefix=l.newBuffer(l.base64.length(e.prefix)),0):e.prefix.length&&(t.prefix=e.prefix)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hash=t.enums===String?"NO_HASH":0,n.prehashKey=t.enums===String?"NO_HASH":0,n.prehashValue=t.enums===String?"NO_HASH":0,n.length=t.enums===String?"NO_PREFIX":0,t.bytes===String?n.prefix="":(n.prefix=[],t.bytes!==Array&&(n.prefix=l.newBuffer(n.prefix)))),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?u.ics23.HashOp[e.hash]:e.hash),null!=e.prehashKey&&e.hasOwnProperty("prehashKey")&&(n.prehashKey=t.enums===String?u.ics23.HashOp[e.prehashKey]:e.prehashKey),null!=e.prehashValue&&e.hasOwnProperty("prehashValue")&&(n.prehashValue=t.enums===String?u.ics23.HashOp[e.prehashValue]:e.prehashValue),null!=e.length&&e.hasOwnProperty("length")&&(n.length=t.enums===String?u.ics23.LengthOp[e.length]:e.length),null!=e.prefix&&e.hasOwnProperty("prefix")&&(n.prefix=t.bytes===String?l.base64.encode(e.prefix,0,e.prefix.length):t.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.InnerOp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.hash=0,e.prototype.prefix=l.newBuffer([]),e.prototype.suffix=l.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.hash&&e.hasOwnProperty("hash")&&t.uint32(8).int32(e.hash),null!=e.prefix&&e.hasOwnProperty("prefix")&&t.uint32(18).bytes(e.prefix),null!=e.suffix&&e.hasOwnProperty("suffix")&&t.uint32(26).bytes(e.suffix),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.InnerOp;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.hash=e.int32();break;case 2:r.prefix=e.bytes();break;case 3:r.suffix=e.bytes();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}return null!=e.prefix&&e.hasOwnProperty("prefix")&&!(e.prefix&&"number"==typeof e.prefix.length||l.isString(e.prefix))?"prefix: buffer expected":null!=e.suffix&&e.hasOwnProperty("suffix")&&!(e.suffix&&"number"==typeof e.suffix.length||l.isString(e.suffix))?"suffix: buffer expected":null},e.fromObject=function(e){if(e instanceof u.ics23.InnerOp)return e;var t=new u.ics23.InnerOp;switch(e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}return null!=e.prefix&&("string"==typeof e.prefix?l.base64.decode(e.prefix,t.prefix=l.newBuffer(l.base64.length(e.prefix)),0):e.prefix.length&&(t.prefix=e.prefix)),null!=e.suffix&&("string"==typeof e.suffix?l.base64.decode(e.suffix,t.suffix=l.newBuffer(l.base64.length(e.suffix)),0):e.suffix.length&&(t.suffix=e.suffix)),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.hash=t.enums===String?"NO_HASH":0,t.bytes===String?n.prefix="":(n.prefix=[],t.bytes!==Array&&(n.prefix=l.newBuffer(n.prefix))),t.bytes===String?n.suffix="":(n.suffix=[],t.bytes!==Array&&(n.suffix=l.newBuffer(n.suffix)))),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?u.ics23.HashOp[e.hash]:e.hash),null!=e.prefix&&e.hasOwnProperty("prefix")&&(n.prefix=t.bytes===String?l.base64.encode(e.prefix,0,e.prefix.length):t.bytes===Array?Array.prototype.slice.call(e.prefix):e.prefix),null!=e.suffix&&e.hasOwnProperty("suffix")&&(n.suffix=t.bytes===String?l.base64.encode(e.suffix,0,e.suffix.length):t.bytes===Array?Array.prototype.slice.call(e.suffix):e.suffix),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.ProofSpec=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.leafSpec=null,e.prototype.innerSpec=null,e.prototype.maxDepth=0,e.prototype.minDepth=0,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&u.ics23.LeafOp.encode(e.leafSpec,t.uint32(10).fork()).ldelim(),null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&u.ics23.InnerSpec.encode(e.innerSpec,t.uint32(18).fork()).ldelim(),null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&t.uint32(24).int32(e.maxDepth),null!=e.minDepth&&e.hasOwnProperty("minDepth")&&t.uint32(32).int32(e.minDepth),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.ProofSpec;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.leafSpec=u.ics23.LeafOp.decode(e,e.uint32());break;case 2:r.innerSpec=u.ics23.InnerSpec.decode(e,e.uint32());break;case 3:r.maxDepth=e.int32();break;case 4:r.minDepth=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&(t=u.ics23.LeafOp.verify(e.leafSpec))?"leafSpec."+t:null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&(t=u.ics23.InnerSpec.verify(e.innerSpec))?"innerSpec."+t:null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&!l.isInteger(e.maxDepth)?"maxDepth: integer expected":null!=e.minDepth&&e.hasOwnProperty("minDepth")&&!l.isInteger(e.minDepth)?"minDepth: integer expected":null;var t},e.fromObject=function(e){if(e instanceof u.ics23.ProofSpec)return e;var t=new u.ics23.ProofSpec;if(null!=e.leafSpec){if("object"!=typeof e.leafSpec)throw TypeError(".ics23.ProofSpec.leafSpec: object expected");t.leafSpec=u.ics23.LeafOp.fromObject(e.leafSpec)}if(null!=e.innerSpec){if("object"!=typeof e.innerSpec)throw TypeError(".ics23.ProofSpec.innerSpec: object expected");t.innerSpec=u.ics23.InnerSpec.fromObject(e.innerSpec)}return null!=e.maxDepth&&(t.maxDepth=0|e.maxDepth),null!=e.minDepth&&(t.minDepth=0|e.minDepth),t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(n.leafSpec=null,n.innerSpec=null,n.maxDepth=0,n.minDepth=0),null!=e.leafSpec&&e.hasOwnProperty("leafSpec")&&(n.leafSpec=u.ics23.LeafOp.toObject(e.leafSpec,t)),null!=e.innerSpec&&e.hasOwnProperty("innerSpec")&&(n.innerSpec=u.ics23.InnerSpec.toObject(e.innerSpec,t)),null!=e.maxDepth&&e.hasOwnProperty("maxDepth")&&(n.maxDepth=e.maxDepth),null!=e.minDepth&&e.hasOwnProperty("minDepth")&&(n.minDepth=e.minDepth),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.InnerSpec=function(){function e(e){if(this.childOrder=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.childOrder=l.emptyArray,e.prototype.childSize=0,e.prototype.minPrefixLength=0,e.prototype.maxPrefixLength=0,e.prototype.emptyChild=l.newBuffer([]),e.prototype.hash=0,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=c.create()),null!=e.childOrder&&e.childOrder.length){t.uint32(10).fork();for(var n=0;n<e.childOrder.length;++n)t.int32(e.childOrder[n]);t.ldelim()}return null!=e.childSize&&e.hasOwnProperty("childSize")&&t.uint32(16).int32(e.childSize),null!=e.minPrefixLength&&e.hasOwnProperty("minPrefixLength")&&t.uint32(24).int32(e.minPrefixLength),null!=e.maxPrefixLength&&e.hasOwnProperty("maxPrefixLength")&&t.uint32(32).int32(e.maxPrefixLength),null!=e.emptyChild&&e.hasOwnProperty("emptyChild")&&t.uint32(42).bytes(e.emptyChild),null!=e.hash&&e.hasOwnProperty("hash")&&t.uint32(48).int32(e.hash),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.InnerSpec;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:if(r.childOrder&&r.childOrder.length||(r.childOrder=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos<i;)r.childOrder.push(e.int32());else r.childOrder.push(e.int32());break;case 2:r.childSize=e.int32();break;case 3:r.minPrefixLength=e.int32();break;case 4:r.maxPrefixLength=e.int32();break;case 5:r.emptyChild=e.bytes();break;case 6:r.hash=e.int32();break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.childOrder&&e.hasOwnProperty("childOrder")){if(!Array.isArray(e.childOrder))return"childOrder: array expected";for(var t=0;t<e.childOrder.length;++t)if(!l.isInteger(e.childOrder[t]))return"childOrder: integer[] expected"}if(null!=e.childSize&&e.hasOwnProperty("childSize")&&!l.isInteger(e.childSize))return"childSize: integer expected";if(null!=e.minPrefixLength&&e.hasOwnProperty("minPrefixLength")&&!l.isInteger(e.minPrefixLength))return"minPrefixLength: integer expected";if(null!=e.maxPrefixLength&&e.hasOwnProperty("maxPrefixLength")&&!l.isInteger(e.maxPrefixLength))return"maxPrefixLength: integer expected";if(null!=e.emptyChild&&e.hasOwnProperty("emptyChild")&&!(e.emptyChild&&"number"==typeof e.emptyChild.length||l.isString(e.emptyChild)))return"emptyChild: buffer expected";if(null!=e.hash&&e.hasOwnProperty("hash"))switch(e.hash){default:return"hash: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}return null},e.fromObject=function(e){if(e instanceof u.ics23.InnerSpec)return e;var t=new u.ics23.InnerSpec;if(e.childOrder){if(!Array.isArray(e.childOrder))throw TypeError(".ics23.InnerSpec.childOrder: array expected");t.childOrder=[];for(var n=0;n<e.childOrder.length;++n)t.childOrder[n]=0|e.childOrder[n]}switch(null!=e.childSize&&(t.childSize=0|e.childSize),null!=e.minPrefixLength&&(t.minPrefixLength=0|e.minPrefixLength),null!=e.maxPrefixLength&&(t.maxPrefixLength=0|e.maxPrefixLength),null!=e.emptyChild&&("string"==typeof e.emptyChild?l.base64.decode(e.emptyChild,t.emptyChild=l.newBuffer(l.base64.length(e.emptyChild)),0):e.emptyChild.length&&(t.emptyChild=e.emptyChild)),e.hash){case"NO_HASH":case 0:t.hash=0;break;case"SHA256":case 1:t.hash=1;break;case"SHA512":case 2:t.hash=2;break;case"KECCAK":case 3:t.hash=3;break;case"RIPEMD160":case 4:t.hash=4;break;case"BITCOIN":case 5:t.hash=5;break;case"SHA512_256":case 6:t.hash=6}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.childOrder=[]),t.defaults&&(n.childSize=0,n.minPrefixLength=0,n.maxPrefixLength=0,t.bytes===String?n.emptyChild="":(n.emptyChild=[],t.bytes!==Array&&(n.emptyChild=l.newBuffer(n.emptyChild))),n.hash=t.enums===String?"NO_HASH":0),e.childOrder&&e.childOrder.length){n.childOrder=[];for(var r=0;r<e.childOrder.length;++r)n.childOrder[r]=e.childOrder[r]}return null!=e.childSize&&e.hasOwnProperty("childSize")&&(n.childSize=e.childSize),null!=e.minPrefixLength&&e.hasOwnProperty("minPrefixLength")&&(n.minPrefixLength=e.minPrefixLength),null!=e.maxPrefixLength&&e.hasOwnProperty("maxPrefixLength")&&(n.maxPrefixLength=e.maxPrefixLength),null!=e.emptyChild&&e.hasOwnProperty("emptyChild")&&(n.emptyChild=t.bytes===String?l.base64.encode(e.emptyChild,0,e.emptyChild.length):t.bytes===Array?Array.prototype.slice.call(e.emptyChild):e.emptyChild),null!=e.hash&&e.hasOwnProperty("hash")&&(n.hash=t.enums===String?u.ics23.HashOp[e.hash]:e.hash),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.BatchProof=function(){function e(e){if(this.entries=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.entries=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=c.create()),null!=e.entries&&e.entries.length)for(var n=0;n<e.entries.length;++n)u.ics23.BatchEntry.encode(e.entries[n],t.uint32(10).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.BatchProof;e.pos<n;){var o=e.uint32();o>>>3==1?(r.entries&&r.entries.length||(r.entries=[]),r.entries.push(u.ics23.BatchEntry.decode(e,e.uint32()))):e.skipType(7&o)}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.entries&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var t=0;t<e.entries.length;++t){var n=u.ics23.BatchEntry.verify(e.entries[t]);if(n)return"entries."+n}}return null},e.fromObject=function(e){if(e instanceof u.ics23.BatchProof)return e;var t=new u.ics23.BatchProof;if(e.entries){if(!Array.isArray(e.entries))throw TypeError(".ics23.BatchProof.entries: array expected");t.entries=[];for(var n=0;n<e.entries.length;++n){if("object"!=typeof e.entries[n])throw TypeError(".ics23.BatchProof.entries: object expected");t.entries[n]=u.ics23.BatchEntry.fromObject(e.entries[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.entries=[]),e.entries&&e.entries.length){n.entries=[];for(var r=0;r<e.entries.length;++r)n.entries[r]=u.ics23.BatchEntry.toObject(e.entries[r],t)}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.BatchEntry=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.exist=null,e.prototype.nonexist=null,Object.defineProperty(e.prototype,"proof",{get:l.oneOfGetter(t=["exist","nonexist"]),set:l.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.exist&&e.hasOwnProperty("exist")&&u.ics23.ExistenceProof.encode(e.exist,t.uint32(10).fork()).ldelim(),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&u.ics23.NonExistenceProof.encode(e.nonexist,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.BatchEntry;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.exist=u.ics23.ExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=u.ics23.NonExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=u.ics23.ExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=u.ics23.NonExistenceProof.verify(e.nonexist))return"nonexist."+n}return null},e.fromObject=function(e){if(e instanceof u.ics23.BatchEntry)return e;var t=new u.ics23.BatchEntry;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.BatchEntry.exist: object expected");t.exist=u.ics23.ExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.BatchEntry.nonexist: object expected");t.nonexist=u.ics23.NonExistenceProof.fromObject(e.nonexist)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=u.ics23.ExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=u.ics23.NonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedBatchProof=function(){function e(e){if(this.entries=[],this.lookupInners=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.entries=l.emptyArray,e.prototype.lookupInners=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=c.create()),null!=e.entries&&e.entries.length)for(var n=0;n<e.entries.length;++n)u.ics23.CompressedBatchEntry.encode(e.entries[n],t.uint32(10).fork()).ldelim();if(null!=e.lookupInners&&e.lookupInners.length)for(n=0;n<e.lookupInners.length;++n)u.ics23.InnerOp.encode(e.lookupInners[n],t.uint32(18).fork()).ldelim();return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.CompressedBatchProof;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.entries&&r.entries.length||(r.entries=[]),r.entries.push(u.ics23.CompressedBatchEntry.decode(e,e.uint32()));break;case 2:r.lookupInners&&r.lookupInners.length||(r.lookupInners=[]),r.lookupInners.push(u.ics23.InnerOp.decode(e,e.uint32()));break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.entries&&e.hasOwnProperty("entries")){if(!Array.isArray(e.entries))return"entries: array expected";for(var t=0;t<e.entries.length;++t)if(n=u.ics23.CompressedBatchEntry.verify(e.entries[t]))return"entries."+n}if(null!=e.lookupInners&&e.hasOwnProperty("lookupInners")){if(!Array.isArray(e.lookupInners))return"lookupInners: array expected";for(t=0;t<e.lookupInners.length;++t){var n;if(n=u.ics23.InnerOp.verify(e.lookupInners[t]))return"lookupInners."+n}}return null},e.fromObject=function(e){if(e instanceof u.ics23.CompressedBatchProof)return e;var t=new u.ics23.CompressedBatchProof;if(e.entries){if(!Array.isArray(e.entries))throw TypeError(".ics23.CompressedBatchProof.entries: array expected");t.entries=[];for(var n=0;n<e.entries.length;++n){if("object"!=typeof e.entries[n])throw TypeError(".ics23.CompressedBatchProof.entries: object expected");t.entries[n]=u.ics23.CompressedBatchEntry.fromObject(e.entries[n])}}if(e.lookupInners){if(!Array.isArray(e.lookupInners))throw TypeError(".ics23.CompressedBatchProof.lookupInners: array expected");for(t.lookupInners=[],n=0;n<e.lookupInners.length;++n){if("object"!=typeof e.lookupInners[n])throw TypeError(".ics23.CompressedBatchProof.lookupInners: object expected");t.lookupInners[n]=u.ics23.InnerOp.fromObject(e.lookupInners[n])}}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.entries=[],n.lookupInners=[]),e.entries&&e.entries.length){n.entries=[];for(var r=0;r<e.entries.length;++r)n.entries[r]=u.ics23.CompressedBatchEntry.toObject(e.entries[r],t)}if(e.lookupInners&&e.lookupInners.length)for(n.lookupInners=[],r=0;r<e.lookupInners.length;++r)n.lookupInners[r]=u.ics23.InnerOp.toObject(e.lookupInners[r],t);return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedBatchEntry=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}var t;return e.prototype.exist=null,e.prototype.nonexist=null,Object.defineProperty(e.prototype,"proof",{get:l.oneOfGetter(t=["exist","nonexist"]),set:l.oneOfSetter(t)}),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.exist&&e.hasOwnProperty("exist")&&u.ics23.CompressedExistenceProof.encode(e.exist,t.uint32(10).fork()).ldelim(),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&u.ics23.CompressedNonExistenceProof.encode(e.nonexist,t.uint32(18).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.CompressedBatchEntry;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.exist=u.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 2:r.nonexist=u.ics23.CompressedNonExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.exist&&e.hasOwnProperty("exist")&&(t.proof=1,n=u.ics23.CompressedExistenceProof.verify(e.exist)))return"exist."+n;if(null!=e.nonexist&&e.hasOwnProperty("nonexist")){if(1===t.proof)return"proof: multiple values";var n;if(t.proof=1,n=u.ics23.CompressedNonExistenceProof.verify(e.nonexist))return"nonexist."+n}return null},e.fromObject=function(e){if(e instanceof u.ics23.CompressedBatchEntry)return e;var t=new u.ics23.CompressedBatchEntry;if(null!=e.exist){if("object"!=typeof e.exist)throw TypeError(".ics23.CompressedBatchEntry.exist: object expected");t.exist=u.ics23.CompressedExistenceProof.fromObject(e.exist)}if(null!=e.nonexist){if("object"!=typeof e.nonexist)throw TypeError(".ics23.CompressedBatchEntry.nonexist: object expected");t.nonexist=u.ics23.CompressedNonExistenceProof.fromObject(e.nonexist)}return t},e.toObject=function(e,t){t||(t={});var n={};return null!=e.exist&&e.hasOwnProperty("exist")&&(n.exist=u.ics23.CompressedExistenceProof.toObject(e.exist,t),t.oneofs&&(n.proof="exist")),null!=e.nonexist&&e.hasOwnProperty("nonexist")&&(n.nonexist=u.ics23.CompressedNonExistenceProof.toObject(e.nonexist,t),t.oneofs&&(n.proof="nonexist")),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedExistenceProof=function(){function e(e){if(this.path=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key=l.newBuffer([]),e.prototype.value=l.newBuffer([]),e.prototype.leaf=null,e.prototype.path=l.emptyArray,e.create=function(t){return new e(t)},e.encode=function(e,t){if(t||(t=c.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).bytes(e.key),null!=e.value&&e.hasOwnProperty("value")&&t.uint32(18).bytes(e.value),null!=e.leaf&&e.hasOwnProperty("leaf")&&u.ics23.LeafOp.encode(e.leaf,t.uint32(26).fork()).ldelim(),null!=e.path&&e.path.length){t.uint32(34).fork();for(var n=0;n<e.path.length;++n)t.int32(e.path[n]);t.ldelim()}return t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.CompressedExistenceProof;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.bytes();break;case 2:r.value=e.bytes();break;case 3:r.leaf=u.ics23.LeafOp.decode(e,e.uint32());break;case 4:if(r.path&&r.path.length||(r.path=[]),2==(7&o))for(var i=e.uint32()+e.pos;e.pos<i;)r.path.push(e.int32());else r.path.push(e.int32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||l.isString(e.key)))return"key: buffer expected";if(null!=e.value&&e.hasOwnProperty("value")&&!(e.value&&"number"==typeof e.value.length||l.isString(e.value)))return"value: buffer expected";if(null!=e.leaf&&e.hasOwnProperty("leaf")){var t=u.ics23.LeafOp.verify(e.leaf);if(t)return"leaf."+t}if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var n=0;n<e.path.length;++n)if(!l.isInteger(e.path[n]))return"path: integer[] expected"}return null},e.fromObject=function(e){if(e instanceof u.ics23.CompressedExistenceProof)return e;var t=new u.ics23.CompressedExistenceProof;if(null!=e.key&&("string"==typeof e.key?l.base64.decode(e.key,t.key=l.newBuffer(l.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.value&&("string"==typeof e.value?l.base64.decode(e.value,t.value=l.newBuffer(l.base64.length(e.value)),0):e.value.length&&(t.value=e.value)),null!=e.leaf){if("object"!=typeof e.leaf)throw TypeError(".ics23.CompressedExistenceProof.leaf: object expected");t.leaf=u.ics23.LeafOp.fromObject(e.leaf)}if(e.path){if(!Array.isArray(e.path))throw TypeError(".ics23.CompressedExistenceProof.path: array expected");t.path=[];for(var n=0;n<e.path.length;++n)t.path[n]=0|e.path[n]}return t},e.toObject=function(e,t){t||(t={});var n={};if((t.arrays||t.defaults)&&(n.path=[]),t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=l.newBuffer(n.key))),t.bytes===String?n.value="":(n.value=[],t.bytes!==Array&&(n.value=l.newBuffer(n.value))),n.leaf=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?l.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.value&&e.hasOwnProperty("value")&&(n.value=t.bytes===String?l.base64.encode(e.value,0,e.value.length):t.bytes===Array?Array.prototype.slice.call(e.value):e.value),null!=e.leaf&&e.hasOwnProperty("leaf")&&(n.leaf=u.ics23.LeafOp.toObject(e.leaf,t)),e.path&&e.path.length){n.path=[];for(var r=0;r<e.path.length;++r)n.path[r]=e.path[r]}return n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i.CompressedNonExistenceProof=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key=l.newBuffer([]),e.prototype.left=null,e.prototype.right=null,e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=c.create()),null!=e.key&&e.hasOwnProperty("key")&&t.uint32(10).bytes(e.key),null!=e.left&&e.hasOwnProperty("left")&&u.ics23.CompressedExistenceProof.encode(e.left,t.uint32(18).fork()).ldelim(),null!=e.right&&e.hasOwnProperty("right")&&u.ics23.CompressedExistenceProof.encode(e.right,t.uint32(26).fork()).ldelim(),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof s||(e=s.create(e));for(var n=void 0===t?e.len:e.pos+t,r=new u.ics23.CompressedNonExistenceProof;e.pos<n;){var o=e.uint32();switch(o>>>3){case 1:r.key=e.bytes();break;case 2:r.left=u.ics23.CompressedExistenceProof.decode(e,e.uint32());break;case 3:r.right=u.ics23.CompressedExistenceProof.decode(e,e.uint32());break;default:e.skipType(7&o)}}return r},e.decodeDelimited=function(e){return e instanceof s||(e=new s(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.key&&e.hasOwnProperty("key")&&!(e.key&&"number"==typeof e.key.length||l.isString(e.key))?"key: buffer expected":null!=e.left&&e.hasOwnProperty("left")&&(t=u.ics23.CompressedExistenceProof.verify(e.left))?"left."+t:null!=e.right&&e.hasOwnProperty("right")&&(t=u.ics23.CompressedExistenceProof.verify(e.right))?"right."+t:null;var t},e.fromObject=function(e){if(e instanceof u.ics23.CompressedNonExistenceProof)return e;var t=new u.ics23.CompressedNonExistenceProof;if(null!=e.key&&("string"==typeof e.key?l.base64.decode(e.key,t.key=l.newBuffer(l.base64.length(e.key)),0):e.key.length&&(t.key=e.key)),null!=e.left){if("object"!=typeof e.left)throw TypeError(".ics23.CompressedNonExistenceProof.left: object expected");t.left=u.ics23.CompressedExistenceProof.fromObject(e.left)}if(null!=e.right){if("object"!=typeof e.right)throw TypeError(".ics23.CompressedNonExistenceProof.right: object expected");t.right=u.ics23.CompressedExistenceProof.fromObject(e.right)}return t},e.toObject=function(e,t){t||(t={});var n={};return t.defaults&&(t.bytes===String?n.key="":(n.key=[],t.bytes!==Array&&(n.key=l.newBuffer(n.key))),n.left=null,n.right=null),null!=e.key&&e.hasOwnProperty("key")&&(n.key=t.bytes===String?l.base64.encode(e.key,0,e.key.length):t.bytes===Array?Array.prototype.slice.call(e.key):e.key),null!=e.left&&e.hasOwnProperty("left")&&(n.left=u.ics23.CompressedExistenceProof.toObject(e.left,t)),null!=e.right&&e.hasOwnProperty("right")&&(n.right=u.ics23.CompressedExistenceProof.toObject(e.right,t)),n},e.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},e}(),i),e.exports=u},21708:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.batchVerifyNonMembership=t.batchVerifyMembership=t.verifyNonMembership=t.verifyMembership=void 0;const r=n(84453),o=n(4659),i=n(23824);function a(e,t,n,a,s){const c=function(e,t){const n=e=>!!e&&(0,i.bytesEqual)(t,e.key);if(n(e.exist))return e.exist;if(e.batch)return e.batch.entries.map((e=>e.exist||null)).find(n);return}((0,r.decompress)(e),a);if(!c)return!1;try{return(0,o.verifyExistence)(c,t,n,a,s),!0}catch(e){return!1}}function s(e,t,n,a){const s=function(e,t){const n=e=>!!e&&(!e.left||(0,i.bytesBefore)(e.left.key,t))&&(!e.right||(0,i.bytesBefore)(t,e.right.key));if(n(e.nonexist))return e.nonexist;if(e.batch)return e.batch.entries.map((e=>e.nonexist||null)).find(n);return}((0,r.decompress)(e),a);if(!s)return!1;try{return(0,o.verifyNonExistence)(s,t,n,a),!0}catch(e){return!1}}t.verifyMembership=a,t.verifyNonMembership=s,t.batchVerifyMembership=function(e,t,n,o){const i=(0,r.decompress)(e);for(const[e,r]of o.entries())if(!a(i,t,n,e,r))return!1;return!0},t.batchVerifyNonMembership=function(e,t,n,o){const i=(0,r.decompress)(e);for(const e of o)if(!s(i,t,n,e))return!1;return!0}},55201:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.verifyNonExistence=t.verifyExistence=t.tendermintSpec=t.iavlSpec=t.calculateExistenceRoot=t.verifyNonMembership=t.verifyMembership=t.ics23=void 0;var r=n(10641);Object.defineProperty(t,"ics23",{enumerable:!0,get:function(){return r.ics23}});var o=n(21708);Object.defineProperty(t,"verifyMembership",{enumerable:!0,get:function(){return o.verifyMembership}}),Object.defineProperty(t,"verifyNonMembership",{enumerable:!0,get:function(){return o.verifyNonMembership}});var i=n(4659);Object.defineProperty(t,"calculateExistenceRoot",{enumerable:!0,get:function(){return i.calculateExistenceRoot}}),Object.defineProperty(t,"iavlSpec",{enumerable:!0,get:function(){return i.iavlSpec}}),Object.defineProperty(t,"tendermintSpec",{enumerable:!0,get:function(){return i.tendermintSpec}}),Object.defineProperty(t,"verifyExistence",{enumerable:!0,get:function(){return i.verifyExistence}}),Object.defineProperty(t,"verifyNonExistence",{enumerable:!0,get:function(){return i.verifyNonExistence}})},89768:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doHash=t.applyInner=t.applyLeaf=void 0;const r=n(70830),o=n(23061),i=n(86262),a=n(10641);function s(e,t){return null==e?t:e}t.applyLeaf=function(e,t,n){if(0===t.length)throw new Error("Missing key");if(0===n.length)throw new Error("Missing value");const r=d(c(e.prehashKey),l(e.length),t),o=d(c(e.prehashValue),l(e.length),n),i=new Uint8Array([...u(e.prefix),...r,...o]);return p(c(e.hash),i)},t.applyInner=function(e,t){if(0===t.length)throw new Error("Inner op needs child value");const n=new Uint8Array([...u(e.prefix),...t,...u(e.suffix)]);return p(c(e.hash),n)};const c=e=>s(e,a.ics23.HashOp.NO_HASH),l=e=>s(e,a.ics23.LengthOp.NO_PREFIX),u=e=>s(e,new Uint8Array([]));function d(e,t,n){const r=function(e,t){if(e===a.ics23.HashOp.NO_HASH)return t;return p(e,t)}(e,n);return function(e,t){switch(e){case a.ics23.LengthOp.NO_PREFIX:return t;case a.ics23.LengthOp.VAR_PROTO:return new Uint8Array([...f(t.length),...t]);case a.ics23.LengthOp.REQUIRE_32_BYTES:if(32!==t.length)throw new Error(`Length is ${t.length}, not 32 bytes`);return t;case a.ics23.LengthOp.REQUIRE_64_BYTES:if(64!==t.length)throw new Error(`Length is ${t.length}, not 64 bytes`);return t;case a.ics23.LengthOp.FIXED32_LITTLE:return new Uint8Array([...h(t.length),...t])}throw new Error(`Unsupported lengthop: ${e}`)}(t,r)}function p(e,t){switch(e){case a.ics23.HashOp.SHA256:return(0,o.sha256)(t);case a.ics23.HashOp.SHA512:return(0,i.sha512)(t);case a.ics23.HashOp.RIPEMD160:return(0,r.ripemd160)(t);case a.ics23.HashOp.BITCOIN:return(0,r.ripemd160)((0,o.sha256)(t));case a.ics23.HashOp.SHA512_256:return(0,i.sha512_256)(t)}throw new Error(`Unsupported hashop: ${e}`)}function f(e){let t=[],n=e;for(;n>=128;){const e=n%128+128;t=[...t,e],n/=128}return t=[...t,n],new Uint8Array(t)}function h(e){const t=new Uint8Array(4);let n=e;for(let e=t.length;e>0;e--)t[Math.abs(e-t.length)]=n%256,n=Math.floor(n/256);return t}t.doHash=p},4659:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ensureLeftNeighbor=t.ensureSpec=t.calculateExistenceRoot=t.verifyNonExistence=t.verifyExistence=t.smtSpec=t.tendermintSpec=t.iavlSpec=void 0;const r=n(10641),o=n(89768),i=n(23824);function a(e,t,n,r,o){c(e,t);const a=s(e);(0,i.ensureBytesEqual)(a,n),(0,i.ensureBytesEqual)(r,e.key),(0,i.ensureBytesEqual)(o,e.value)}function s(e){if(!e.key||!e.value)throw new Error("Existence proof needs key and value set");if(!e.leaf)throw new Error("Existence proof must start with a leaf operation");const t=e.path||[];let n=(0,o.applyLeaf)(e.leaf,e.key,e.value);for(const e of t)n=(0,o.applyInner)(e,n);return n}function c(e,t){if(!e.leaf)throw new Error("Existence proof must start with a leaf operation");if(!t.leafSpec)throw new Error("Spec must include leafSpec");if(!t.innerSpec)throw new Error("Spec must include innerSpec");(0,i.ensureLeaf)(e.leaf,t.leafSpec);const n=e.path||[];if(t.minDepth&&n.length<t.minDepth)throw new Error(`Too few inner nodes ${n.length}`);if(t.maxDepth&&n.length>t.maxDepth)throw new Error(`Too many inner nodes ${n.length}`);for(const e of n)(0,i.ensureInner)(e,t.leafSpec.prefix,t.innerSpec)}function l(e,t){const{minPrefix:n,maxPrefix:r,suffix:o}=h(e,0);for(const e of t)if(!f(e,n,r,o))throw new Error("Step not leftmost")}function u(e,t){const n=e.childOrder.length-1,{minPrefix:r,maxPrefix:o,suffix:i}=h(e,n);for(const e of t)if(!f(e,r,o,i))throw new Error("Step not leftmost")}function d(e,t,n){const r=[...t],o=[...n];let a=r.pop(),s=o.pop();for(;(0,i.bytesEqual)(a.prefix,s.prefix)&&(0,i.bytesEqual)(a.suffix,s.suffix);)a=r.pop(),s=o.pop();if(!function(e,t,n){const r=p(e,t),o=p(e,n);return o===r+1}(e,a,s))throw new Error("Not left neightbor at first divergent step");u(e,r