New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@waves/marshall

Package Overview
Dependencies
Maintainers
16
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waves/marshall - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

2

dist/min/waves-marshall.min.js

@@ -1,1 +0,1 @@

var WavesMarshall=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(3),s=r(9);var o;!function(e){e[e.GENESIS=1]="GENESIS",e[e.PAYMENT=2]="PAYMENT",e[e.ISSUE=3]="ISSUE",e[e.TRANSFER=4]="TRANSFER",e[e.REISSUE=5]="REISSUE",e[e.BURN=6]="BURN",e[e.EXCHANGE=7]="EXCHANGE",e[e.LEASE=8]="LEASE",e[e.CANCEL_LEASE=9]="CANCEL_LEASE",e[e.ALIAS=10]="ALIAS",e[e.MASS_TRANSFER=11]="MASS_TRANSFER",e[e.DATA=12]="DATA",e[e.SET_SCRIPT=13]="SET_SCRIPT",e[e.SPONSORSHIP=14]="SPONSORSHIP",e[e.SET_ASSET_SCRIPT=15]="SET_ASSET_SCRIPT",e[e.INVOKE_SCRIPT=16]="INVOKE_SCRIPT"}(o=t.TRANSACTION_TYPE||(t.TRANSACTION_TYPE={}));const a={toBytes:n.SHORT,fromBytes:i.P_SHORT},u={toBytes:n.INT,fromBytes:i.P_INT};var h;!function(e){e.longField=(e=>[e,{toBytes:n.LONG,fromBytes:i.P_LONG}]),e.byteField=(e=>[e,{toBytes:n.BYTE,fromBytes:i.P_BYTE}]),e.booleanField=(e=>[e,{toBytes:n.BOOL,fromBytes:i.P_BOOLEAN}]),e.stringField=(e=>[e,{toBytes:n.LEN(n.SHORT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_SHORT)}]),e.base58field32=(e=>[e,{toBytes:n.BASE58_STRING,fromBytes:i.P_BASE58_FIXED(32)}]),e.base58Option32=(e=>[e,{toBytes:n.OPTION(n.BASE58_STRING),fromBytes:i.P_OPTION(i.P_BASE58_FIXED(32))}]),e.base64field=(e=>[e,{toBytes:n.LEN(n.SHORT)(n.BASE64_STRING),fromBytes:i.P_BASE64(i.P_SHORT)}]),e.byteConstant=(e=>["noname",{toBytes:()=>Uint8Array.from([e]),fromBytes:()=>({value:void 0,shift:1})}]),e.alias=["alias",{toBytes:n.LEN(n.SHORT)(n.STRING),fromBytes:i.byteNewAliasToString}],e.amount=e.longField("amount"),e.assetDescription=e.stringField("description"),e.assetId=e.base58field32("assetId"),e.assetName=e.stringField("name"),e.attachment=["attachment",{toBytes:n.LEN(n.SHORT)(n.BASE58_STRING),fromBytes:i.P_BASE58_VAR(i.P_SHORT)}],e.chainId=e.byteField("chainId"),e.decimals=e.byteField("decimals"),e.fee=e.longField("fee"),e.leaseAssetId=e.base58Option32("leaseAssetId"),e.leaseId=e.base58field32("leaseId"),e.optionalAssetId=e.base58Option32("assetId"),e.quantity=e.longField("quantity"),e.reissuable=e.booleanField("reissuable"),e.recipient=["recipient",{toBytes:n.ADDRESS_OR_ALIAS,fromBytes:i.byteToAddressOrAlias}],e.script=["script",{toBytes:n.SCRIPT,fromBytes:i.byteToScript}],e.senderPublicKey=e.base58field32("senderPublicKey"),e.signature=["signature",{toBytes:n.BASE58_STRING,fromBytes:i.P_BASE58_FIXED(64)}],e.timestamp=e.longField("timestamp"),e.type=e.byteField("type"),e.version=e.byteField("version"),e.proofs=["proofs",{type:"array",items:{toBytes:n.LEN(n.SHORT)(n.BASE58_STRING),fromBytes:i.P_BASE58_VAR(i.P_SHORT)}}];const t={type:"object",schema:[e.recipient,e.amount]};e.transfers=["transfers",{type:"array",items:t}];const r={type:"dataTxField",items:new Map([[s.DATA_FIELD_TYPE.INTEGER,{toBytes:n.LONG,fromBytes:i.P_LONG}],[s.DATA_FIELD_TYPE.BOOLEAN,{toBytes:n.BOOL,fromBytes:i.P_BOOLEAN}],[s.DATA_FIELD_TYPE.BINARY,{toBytes:n.LEN(n.SHORT)(n.BASE64_STRING),fromBytes:i.P_BASE64(i.P_SHORT)}],[s.DATA_FIELD_TYPE.STRING,{toBytes:n.LEN(n.SHORT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_SHORT)}]])};e.data=["data",{type:"array",items:r}];const o=s.anyOf([[0,{toBytes:n.LONG,fromBytes:i.P_LONG},"integer"],[1,{toBytes:n.LEN(n.INT)(n.BASE64_STRING),fromBytes:i.P_BASE64(i.P_INT)},"binary"],[2,{toBytes:n.LEN(n.INT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_INT)},"string"],[6,{toBytes:()=>Uint8Array.from([]),fromBytes:()=>({value:!0,shift:0})},"boolean"],[7,{toBytes:()=>Uint8Array.from([]),fromBytes:()=>({value:!1,shift:0})},"boolean"]],{valueField:"value"});e.functionCall=["call",{type:"object",optional:!0,schema:[e.byteConstant(9),e.byteConstant(1),["function",{toBytes:n.LEN(n.INT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_INT)}],["args",{type:"array",toBytes:n.INT,fromBytes:i.P_INT,items:o}]]}],e.payment={type:"object",withLength:a,schema:[e.amount,e.optionalAssetId]},e.payments=["payment",{type:"array",items:e.payment}]}(h=t.txFields||(t.txFields={})),t.orderSchemaV0={type:"object",schema:[h.senderPublicKey,h.base58field32("matcherPublicKey"),["assetPair",{type:"object",schema:[h.base58Option32("amountAsset"),h.base58Option32("priceAsset")]}],["orderType",{toBytes:e=>n.BYTE("sell"===e?1:0),fromBytes:(e,t=0)=>1===i.P_BYTE(e,t).value?{value:"sell",shift:1}:{value:"buy",shift:1}}],h.longField("price"),h.longField("amount"),h.timestamp,h.longField("expiration"),h.longField("matcherFee")]},t.orderSchemaV2={type:"object",schema:[h.version,...t.orderSchemaV0.schema]},t.aliasSchemaV2={type:"object",schema:[h.type,h.version,h.senderPublicKey,[["alias","chainId"],{type:"object",withLength:a,schema:[h.byteConstant(2),h.chainId,h.alias]}],h.fee,h.timestamp]},t.burnSchemaV2={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,h.assetId,h.quantity,h.fee,h.timestamp]},t.cancelLeaseSchemaV2={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,h.fee,h.timestamp,h.leaseId]},t.invokeScriptSchemaV1={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,["dApp",h.recipient[1]],h.functionCall,h.payments,h.fee,["feeAssetId",h.optionalAssetId[1]],h.timestamp]},t.dataSchemaV1={type:"object",schema:[h.type,h.version,h.senderPublicKey,h.data,h.timestamp,h.fee]},t.proofsSchemaV0={type:"object",schema:[["signature",{toBytes:n.BASE58_STRING,fromBytes:i.P_BASE58_FIXED(64)}]]},t.proofsSchemaV1={type:"object",schema:[h.byteConstant(1),h.proofs]},t.exchangeSchemaV0={type:"object",schema:[h.type,["order1",{type:"object",withLength:u,schema:[...t.orderSchemaV0.schema,h.signature]}],["order2",{type:"object",withLength:u,schema:[...t.orderSchemaV0.schema,h.signature]}],h.longField("price"),h.longField("amount"),h.longField("buyMatcherFee"),h.longField("sellMatcherFee"),h.longField("fee"),h.longField("timestamp")]};const c=s.anyOf([[1,{type:"object",withLength:u,schema:[h.byteConstant(1),...t.orderSchemaV0.schema,...t.proofsSchemaV0.schema]}],[2,{type:"object",withLength:u,schema:[...t.orderSchemaV2.schema,...t.proofsSchemaV1.schema]}]],{discriminatorField:"version",discriminatorBytePos:4});t.exchangeSchemaV2={type:"object",schema:[h.byteConstant(0),h.type,h.version,["order1",c],["order2",c],h.longField("price"),h.longField("amount"),h.longField("buyMatcherFee"),h.longField("sellMatcherFee"),h.longField("fee"),h.longField("timestamp")]},t.issueSchemaV2={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,h.assetName,h.assetDescription,h.quantity,h.decimals,h.reissuable,h.fee,h.timestamp,h.script]},t.leaseSchemaV2={type:"object",schema:[h.type,h.version,h.leaseAssetId,h.senderPublicKey,h.recipient,h.amount,h.fee,h.timestamp]},t.massTransferSchemaV1={type:"object",schema:[h.type,h.version,h.senderPublicKey,h.optionalAssetId,h.transfers,h.timestamp,h.fee,h.attachment]},t.reissueSchemaV2={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,h.assetId,h.quantity,h.reissuable,h.fee,h.timestamp]},t.setAssetScriptSchemaV1={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,h.assetId,h.fee,h.timestamp,h.script]},t.setScriptSchemaV1={type:"object",schema:[h.type,h.version,h.chainId,h.senderPublicKey,h.script,h.fee,h.timestamp]},t.sponsorshipSchemaV1={type:"object",schema:[h.type,h.version,h.senderPublicKey,h.assetId,h.longField("minSponsoredAssetFee"),h.fee,h.timestamp]},t.transferSchemaV2={type:"object",schema:[h.type,h.version,h.senderPublicKey,h.optionalAssetId,["feeAssetId",h.optionalAssetId[1]],h.timestamp,h.amount,h.fee,h.recipient,h.attachment]},t.schemasByTypeMap={[o.GENESIS]:{},[o.PAYMENT]:{},[o.ISSUE]:{2:t.issueSchemaV2},[o.TRANSFER]:{2:t.transferSchemaV2},[o.REISSUE]:{2:t.reissueSchemaV2},[o.BURN]:{2:t.burnSchemaV2},[o.EXCHANGE]:{0:t.exchangeSchemaV0,2:t.exchangeSchemaV2},[o.LEASE]:{2:t.leaseSchemaV2},[o.CANCEL_LEASE]:{2:t.cancelLeaseSchemaV2},[o.ALIAS]:{2:t.aliasSchemaV2},[o.MASS_TRANSFER]:{1:t.massTransferSchemaV1},[o.DATA]:{1:t.dataSchemaV1},[o.SET_SCRIPT]:{1:t.setScriptSchemaV1},[o.SPONSORSHIP]:{1:t.sponsorshipSchemaV1},[o.SET_ASSET_SCRIPT]:{1:t.setAssetScriptSchemaV1},[o.INVOKE_SCRIPT]:{1:t.invokeScriptSchemaV1}},t.getTransactionSchema=function(e,r){const n=t.schemasByTypeMap[e];if("object"!=typeof n)throw new Error(`Incorrect tx type: ${e}`);const i=n[r||0];if("object"!=typeof i)throw new Error(`Incorrect tx version: ${r}`);return i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5),i=r(6),s=r(2),o=r(7);t.empty=Uint8Array.from([]),t.zero=Uint8Array.from([0]),t.one=Uint8Array.from([1]),t.BASE58_STRING=(e=>n.default.decode(e)),t.BASE64_STRING=(e=>i.toByteArray(e.replace("base64:",""))),t.STRING=(e=>e?(e=>Uint8Array.from([...unescape(encodeURIComponent(e))].map(e=>e.charCodeAt(0))))(e):t.empty),t.BYTE=(e=>Uint8Array.from([e])),t.BOOL=(e=>t.BYTE(1==e?1:0)),t.BYTES=(e=>Uint8Array.from(e)),t.SHORT=(e=>{const t=o.fromNumber(e,!0);return Uint8Array.from(t.toBytesBE().slice(6))}),t.INT=(e=>{const t=o.fromNumber(e,!0);return Uint8Array.from(t.toBytesBE().slice(4))}),t.OPTION=(e=>r=>null==r||"string"==typeof r&&0==r.length?t.zero:s.concat(t.one,e(r))),t.LEN=(e=>t=>r=>{const n=t(r),i=e(n.length);return s.concat(i,n)}),t.COUNT=(e=>t=>r=>{const n=s.concat(...r.map(e=>t(e))),i=e(r.length);return s.concat(i,n)}),t.LONG=(e=>{let t;if("number"==typeof e){if(e>Math.pow(2,53)-1)throw new Error(`${e} is too big to be precisely represented as js number. Use string instead`);t=o.fromNumber(e)}else t=o.fromString(e.toString());return Uint8Array.from(t.toBytesBE())}),t.SCRIPT=(e=>t.OPTION(t.LEN(t.SHORT)(t.BASE64_STRING))(e?e.slice(7):null)),t.ALIAS=(e=>{const[r,n,i]=e.split(":");if(!n||1!==n.length)throw new Error("Invalid network byte in alias");if(!i||0===i.length)throw new Error("Invalid alias body");return s.concat([2],[n.charCodeAt(0)],t.LEN(t.SHORT)(t.STRING)(i))}),t.ADDRESS_OR_ALIAS=(e=>e.startsWith("alias")?t.ALIAS(e):t.BASE58_STRING(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=((...e)=>e.reduce((e,t)=>Uint8Array.from([...e,...t]),new Uint8Array(0))),t.range=((e,t,r=1)=>Array.from({length:t-e}).map((t,n)=>n*r+e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(7),i=r(8),s=r(5),o=r(6);t.ALIAS_VERSION=2;t.P_OPTION=(e=>(t,r=0)=>{if(0===t[r])return{value:null,shift:1};const n=e(t,r+1);return{value:n.value,shift:n.shift+1}}),t.P_BYTE=((e,t=0)=>({value:e[t],shift:1})),t.P_SHORT=((e,t=0)=>({value:256*e[t]+e[t+1],shift:2})),t.P_INT=((e,t=0)=>({value:Math.pow(2,24)*e[t]+Math.pow(2,16)*e[t+1]+Math.pow(2,8)*e[t+2]+e[t+3],shift:4})),t.P_LONG=((e,t=0)=>({value:n.fromBytesBE(Array.from(e.slice(t,t+8))).toString(),shift:8})),t.P_BOOLEAN=((e,t=0)=>{return{value:!!e[t],shift:1}}),t.P_STRING_FIXED=(e=>(t,r=0)=>{const n=i.Utf8ArrayToStr(t.slice(r,r+e));return{shift:e,value:n}}),t.P_STRING_VAR=(e=>(r,n=0)=>{const i=e(r,n),{value:s}=t.P_STRING_FIXED(i.value)(r,n+i.shift);return{shift:i.value+i.shift,value:s}}),t.P_BASE58_FIXED=(e=>(t,r=0)=>{return{value:s.default.encode(t.slice(r,r+e)),shift:e}}),t.P_BASE58_VAR=(e=>(r,n=0)=>{const i=e(r,n),{value:s}=t.P_BASE58_FIXED(i.value)(r,n+2);return{shift:i.value+2,value:s}}),t.P_BASE64=(e=>(t,r=0)=>{const n=e(t,r),i=`base64:${o.fromByteArray(t.slice(r+n.shift,r+n.shift+n.value))}`;return{shift:n.value+n.shift,value:i}});t.byteToStringWithLength=((e,r=0)=>{const n=t.P_SHORT(e,r),{value:s}=(e=>(t,r)=>{const n=i.Utf8ArrayToStr(t.slice(r,r+e));return{shift:e,value:n}})(n.value)(e,r+2);return{shift:n.value+2,value:s}}),t.byteToBase58=((e,t=0,r)=>{const n=r||32;return{value:s.default.encode(e.slice(t,t+n)),shift:n}}),t.byteToBase58WithLength=((e,r=0)=>{const n=t.P_SHORT(e,r);return{value:s.default.encode(e.slice(r+n.shift,r+n.shift+n.value)),shift:n.shift+n.value}}),t.byteToAddressOrAlias=((e,r=0)=>{if(e[r]===t.ALIAS_VERSION){const n=t.byteToStringWithLength(e,r+2);return{shift:n.shift+2,value:`alias:${String.fromCharCode(e[r+1])}:${n.value}`}}return t.byteToBase58(e,r,26)}),t.byteNewAliasToString=((e,r=0)=>{const n=t.P_SHORT(e,r).value+2,{value:i}=t.byteToStringWithLength(e,r);return{shift:n,value:i}}),t.byteToScript=((e,r=0)=>{if(0===e[r])return{shift:1,value:null};const n=t.P_SHORT(e,r+1),i=r+1+n.shift,s=r+1+n.shift+n.value;return{value:`base64:${o.fromByteArray(e.slice(i,s))}`,shift:s-r}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0),i=r(10),s=r(11),o=r(12);t.json=o;const a=r(1);t.serializePrimitives=a;const u=r(3);t.parsePrimitives=u;const h=r(0);t.schemas=h;const c={serializerFromSchema:i.serializerFromSchema,serializeTx:i.serializeTx,serializeOrder:i.serializeOrder,parserFromSchema:s.parserFromSchema,parseTx:s.parseTx,parseOrder:s.parseOrder};function l(e,t,r,n){const o=i.serializerFromSchema(t,n),a=s.parserFromSchema(t,r)(o(e)).value;return Object.assign({},e,a)}t.binary=c,t.convertLongFields=l,t.convertTxLongFields=function(e,t,r){const{type:i,version:s}=e;return l(e,n.getTransactionSchema(i,s),t,r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",i=n.split("").reduce((e,t,r)=>(e[t]=r,e),{});t.default={encode(e){if(!e.length)return"";const t=[0];for(let r=0;r<e.length;r++){for(let e=0;e<t.length;e++)t[e]<<=8;t[0]+=e[r];let n=0;for(let e=0;e<t.length;e++)t[e]+=n,n=t[e]/58|0,t[e]%=58;for(;n;)t.push(n%58),n=n/58|0}for(let r=0;0===e[r]&&r<e.length-1;r++)t.push(0);return t.reverse().map(function(e){return n[e]}).join("")},decode(e){if(!e.length)return new Uint8Array(0);const t=[0];for(let r=0;r<e.length;r++){const n=e[r];if(!(n in i))throw new Error(`There is no character "${n}" in the Base58 sequence!`);for(let e=0;e<t.length;e++)t[e]*=58;t[0]+=i[n];let s=0;for(let e=0;e<t.length;e++)t[e]+=s,s=t[e]>>8,t[e]&=255;for(;s;)t.push(255&s),s>>=8}for(let r=0;"1"===e[r]&&r<e.length-1;r++)t.push(0);return new Uint8Array(t.reverse())}}},function(e,t,r){"use strict";t.byteLength=function(e){var t=h(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){for(var t,r=h(e),n=r[0],o=r[1],a=new s(function(e,t,r){return 3*(t+r)/4-r}(0,n,o)),u=0,c=o>0?n-4:n,l=0;l<c;l+=4)t=i[e.charCodeAt(l)]<<18|i[e.charCodeAt(l+1)]<<12|i[e.charCodeAt(l+2)]<<6|i[e.charCodeAt(l+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===o&&(t=i[e.charCodeAt(l)]<<2|i[e.charCodeAt(l+1)]>>4,a[u++]=255&t);1===o&&(t=i[e.charCodeAt(l)]<<10|i[e.charCodeAt(l+1)]<<4|i[e.charCodeAt(l+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=0,a=r-i;o<a;o+=16383)s.push(c(e,o,o+16383>a?a:o+16383));1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)n[a]=o[a],i[o.charCodeAt(a)]=a;function h(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var s={},o={};function a(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=o[e])?n:(r=h(e,(0|e)<0?-1:0,!0),i&&(o[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=s[e])?n:(r=h(e,e<0?-1:0,!1),i&&(s[e]=r),r)}function u(e,t){if(isNaN(e))return t?S:p;if(t){if(e<0)return S;if(e>=m)return T}else{if(e<=-d)return B;if(e+1>=d)return A}return e<0?u(-e,t).neg():h(e%y|0,e/y|0,t)}function h(e,t,r){return new n(e,t,r)}n.fromInt=a,n.fromNumber=u,n.fromBits=h;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var i=u(c(r,8)),s=p,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),h=parseInt(e.substring(o,o+a),r);if(a<8){var f=u(c(r,a));s=s.mul(f).add(u(h))}else s=(s=s.mul(i)).add(u(h))}return s.unsigned=t,s}function f(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?l(e,t):h(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=l,n.fromValue=f;var y=4294967296,m=y*y,d=m/2,g=a(1<<24),p=a(0);n.ZERO=p;var S=a(0,!0);n.UZERO=S;var v=a(1);n.ONE=v;var E=a(1,!0);n.UONE=E;var b=a(-1);n.NEG_ONE=b;var A=h(-1,2147483647,!1);n.MAX_VALUE=A;var T=h(-1,-1,!0);n.MAX_UNSIGNED_VALUE=T;var B=h(0,-2147483648,!1);n.MIN_VALUE=B;var _=n.prototype;_.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var t=u(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=u(c(e,6),this.unsigned),s=this,o="";;){var a=s.div(i),h=(s.sub(a.mul(i)).toInt()>>>0).toString(e);if((s=a).isZero())return h+o;for(;h.length<6;)h="0"+h;o=""+h+o}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},_.isZero=function(){return 0===this.high&&0===this.low},_.eqz=_.isZero,_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return i(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.ne=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.le=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.ge=_.greaterThanOrEqual,_.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(v)},_.neg=_.negate,_.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,l=0,y=0,m=0;return y+=(m+=s+(65535&e.low))>>>16,l+=(y+=n+u)>>>16,c+=(l+=r+a)>>>16,c+=t+o,h((y&=65535)<<16|(m&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},_.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return p;if(i(e)||(e=f(e)),r)return h(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return p;if(this.eq(B))return e.isOdd()?B:p;if(e.eq(B))return this.isOdd()?B:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,s=this.low>>>16,o=65535&this.low,a=e.high>>>16,c=65535&e.high,l=e.low>>>16,y=65535&e.low,m=0,d=0,S=0,v=0;return S+=(v+=o*y)>>>16,d+=(S+=s*y)>>>16,S&=65535,d+=(S+=o*l)>>>16,m+=(d+=n*y)>>>16,d&=65535,m+=(d+=s*l)>>>16,d&=65535,m+=(d+=o*c)>>>16,m+=t*y+n*l+s*c+o*a,h((S&=65535)<<16|(v&=65535),(m&=65535)<<16|(d&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,n,s;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?h((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?S:p;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return S;if(e.gt(this.shru(1)))return E;s=S}else{if(this.eq(B))return e.eq(v)||e.eq(b)?B:e.eq(B)?v:(t=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?v:b:(n=this.sub(e.mul(t)),s=t.add(n.div(e)));if(e.eq(B))return this.unsigned?S:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=p}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),a=o<=48?1:c(2,o-48),l=u(t),y=l.mul(e);y.isNegative()||y.gt(n);)y=(l=u(t-=a,this.unsigned)).mul(e);l.isZero()&&(l=v),s=s.add(l),n=n.sub(y)}return s},_.div=_.divide,_.modulo=function(e){return i(e)||(e=f(e)),r?h((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.rem=_.modulo,_.not=function(){return h(~this.low,~this.high,this.unsigned)},_.and=function(e){return i(e)||(e=f(e)),h(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return i(e)||(e=f(e)),h(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return i(e)||(e=f(e)),h(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?h(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):h(0,this.low<<e-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?h(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):h(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?h(this.low>>>e|t<<32-e,t>>>e,this.unsigned):h(32===e?t:t>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.shr_u=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?h(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:h(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i,s;t.Utf8ArrayToStr=(n=new Array(128),i=String.fromCodePoint||String.fromCharCode,s=[],function(e){var t,r,o=e.length;s.length=0;for(var a=0;a<o;)(r=e[a++])<=127?t=r:r<=223?t=(31&r)<<6|63&e[a++]:r<=239?t=(15&r)<<12|(63&e[a++])<<6|63&e[a++]:String.fromCodePoint?t=(7&r)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++]:(t=63,a+=3),s.push(n[t]||(n[t]=i(t)));return s.join("")})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.INTEGER="integer",e.BOOLEAN="boolean",e.STRING="string",e.BINARY="binary"}(t.DATA_FIELD_TYPE||(t.DATA_FIELD_TYPE={})),t.anyOf=function(e,t){return new n(e,t)};class n{constructor(e,t){this._items=e,this.type="anyOf",this.discriminatorField="type",this.discriminatorBytePos=0,Object.assign(this,t)}itemByKey(e){const t=this._items.find(([t,r,n])=>n===e||t==e);return t&&{schema:t[1],key:t[0],strKey:t[2]}}itemByByteKey(e){const t=this._items.find(([t,r])=>t===e);return t&&{schema:t[1],key:t[0],strKey:t[2]||t[0].toString(10)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1),i=r(2),s=r(0);t.serializerFromSchema=((e,r)=>s=>{let o,a;if("array"===e.type)return o=t.serializerFromSchema(e.items,r),a=i.concat(...s.map(e=>o(e))),i.concat((e.toBytes||n.SHORT)(s.length),a);if("object"===e.type){let n=Uint8Array.from([]);if(e.optional&&null==s)return Uint8Array.from([0]);if(e.schema.forEach(e=>{const[u,h]=e;let c;c=Array.isArray(u)?u.reduce((e,t)=>Object.assign({},e,{[t]:s[t]}),{}):s[u],o=t.serializerFromSchema(h,r),a=o(c),n=i.concat(n,a)}),e.withLength){const t=e.withLength.toBytes(n.length);n=i.concat(t,n)}return e.optional&&(n=i.concat([1],n)),n}if("anyOf"===e.type){const u=s[e.discriminatorField],h=e.itemByKey(u);if(null==h)throw new Error(`Serializer Error: Unknown anyOf type: ${u}`);return"boolean"===h.strKey&&6===h.key&&!1===s.value&&(h.key=7),o=t.serializerFromSchema(h.schema,r),null==e.valueField?o(s):(a=o(s[e.valueField]),i.concat((e.toBytes||n.BYTE)(h.key),a))}if("primitive"===e.type||void 0===e.type)return e.toBytes(s);if("dataTxField"===e.type){const u=n.LEN(n.SHORT)(n.STRING)(s.key),h=s.type,c=e.items.get(h);if(null==c)throw new Error(`Serializer Error: Unknown dataTxField type: ${h}`);const l=[...e.items.values()].findIndex(e=>e===c);return o=t.serializerFromSchema(c,r),a=o(s.value),i.concat(u,n.BYTE(l),a)}throw new Error(`Serializer Error: Unknown schema type: ${e.type}`)}),t.serializeTx=function(e,r){const{type:n,version:i}=e,o=s.getTransactionSchema(n,i);return t.serializerFromSchema(o,r)(e)},t.serializeOrder=function(e,r){const{version:n}=e,i=2==n?s.orderSchemaV2:s.orderSchemaV0;return t.serializerFromSchema(i,r)(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3),i=r(2),s=r(0);t.parserFromSchema=((e,r)=>(s,o=0)=>{let a=o;if("array"===e.type){const u=[],{value:h,shift:c}=(e.fromBytes||n.P_SHORT)(s,o);return a+=c,i.range(0,h).forEach(n=>{const i=t.parserFromSchema(e.items,r),{value:o,shift:h}=i(s,a);u.push(o),a+=h}),{value:u,shift:a-o}}if("object"===e.type){if(e.optional){const e=1===s[a];if(a+=1,!e)return{value:void 0,shift:1}}if(e.withLength){const t=e.withLength.fromBytes(s,a);a+=t.shift}const n={};return e.schema.forEach(e=>{const[i,o]=e,u=t.parserFromSchema(o,r),{value:h,shift:c}=u(s,a);a+=c,void 0!==h&&(Array.isArray(i)?Object.assign(n,h):n[i]=h)}),{value:n,shift:a-o}}if("anyOf"===e.type){const i=(e.fromBytes||n.P_BYTE)(s,a+e.discriminatorBytePos);e.valueField&&0===e.discriminatorBytePos&&(a+=i.shift);const u=e.itemByByteKey(i.value);if(null==u)throw new Error(`Failed to get schema for item with bytecode: ${i.value}`);const h=t.parserFromSchema(u.schema,r),{value:c,shift:l}=h(s,a);return a+=l,{value:e.valueField?{[e.discriminatorField]:u.strKey,[e.valueField]:c}:c,shift:a-o}}if("dataTxField"===e.type){const i=n.byteToStringWithLength(s,a);a+=i.shift;let o=n.P_BYTE(s,a);a+=o.shift;const u=[...e.items].find((e,t)=>t===o.value);if(!u)throw new Error(`Parser Error: Unknown dataTxField type: ${o.value}`);const h=t.parserFromSchema(u[1],r)(s,a);return{value:{value:h.value,key:i.value,type:u[0]},shift:h.shift+i.shift+o.shift}}if("primitive"===e.type||void 0===e.type){const t=e.fromBytes;let{value:i,shift:a}=t(s,o);return t===n.P_LONG&&r&&(i=r(i)),{value:i,shift:a}}throw new Error(`Parser Error: Unknown schema type: ${e.type}`)}),t.parseHeader=(e=>{let t=0,r=n.P_BYTE(e,t);t+=r.shift,0===r.value&&(t+=(r=n.P_BYTE(e,t)).shift);let i=n.P_BYTE(e,t);return{type:r.value,version:i.value}}),t.parseTx=function(e,r){const{type:n,version:i}=t.parseHeader(e),o=s.getTransactionSchema(n,i);return t.parserFromSchema(o,r)(e).value},t.parseOrder=function(e,r){return t.parserFromSchema(s.orderSchemaV2,r)(e).value}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),{parse:i,stringify:s}=n(),o=r(0),a=r(1),u=r(4);function h(e,t){return 0===e.length?t:"object"==typeof t?h(e.slice(1),t[e[0]]):void 0}const c=(e,t,r)=>{return function t(n,i){if(null==i)return!1;if(0===n.length&&("primitive"===i.type||void 0===i.type))return i.toBytes===a.LONG;if("object"===i.type){const e=i.schema.find(([e,t])=>e===n[0]);return t(n.slice(1),e&&e[1])}if("array"===i.type)return t(n.slice(1),i.items);if("dataTxField"===i.type){if("value"!==n[0])return!1;const s=h(e.slice(0,e.length-1),r),o=i.items.get(s.type);return t(n.slice(1),o)}if("anyOf"===i.type){const s=h(e.slice(0,e.length-1),r)[i.discriminatorField],o=i.itemByKey(s);return!!o&&(null!=i.valueField&&e[e.length-1]===i.valueField?t(n.slice(1),o.schema):t(n,o.schema))}return!1}(e,t)};function l(e,t){const r=[],n=[];function i(o){return"string"==typeof o&&c(r,t,e)?o:"boolean"==typeof o||o instanceof Boolean||null===o||"number"==typeof o||o instanceof Number||"string"==typeof o||o instanceof String||o instanceof Date?JSON.stringify(o):Array.isArray(o)?function(e){let t="[";const s=n.length;n[s]=e;for(let n=0;n<e.length;n++){let o=n+"",a=e[n];void 0!==a&&"function"!=typeof a?(r[s]=o,t+=i(a)):t+="null",n<e.length-1&&(t+=",")}return n.length=s,r.length=s,t+="]"}(o):o&&"object"==typeof o?function(e){let t=!0,o="{";const a=n.length;n[a]=e;for(let n in e)if(e.hasOwnProperty(n)){let u=e[n];s(u)&&(t?t=!1:o+=",",o+='"'+n+'":',r[a]=n,o+=i(u))}return n.length=a,r.length=a,o+="}"}(o):void 0}function s(e){return void 0!==e&&"function"!=typeof e}return i(e)||""}t.stringifyWithSchema=l,t.parseTx=function(e,t){const r=i(e);return t?u.convertTxLongFields(r,t):r},t.stringifyTx=function(e,t){const{type:r,version:n}=e,i=o.getTransactionSchema(r,n);return l(u.convertLongFields(e,i,void 0,t),i)},t.parseOrder=function(e,t){const r=i(e),n=2===r.version?o.orderSchemaV2:o.orderSchemaV0;return t?u.convertLongFields(r,n,t):r},t.stringifyOrder=function(e,t){const r=2===e.version?o.orderSchemaV2:o.orderSchemaV0;return l(u.convertLongFields(e,r,void 0,t),r)}},function(e,t,r){"use strict";e.exports=function(e){var t={strict:!1};null!=e&&!0===e.strict&&(t.strict=!0);var r,n,i,s,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},a=function(e){throw{name:"SyntaxError",message:e,at:r,text:i}},u=function(e){return e&&e!==n&&a("Expected '"+e+"' instead of '"+n+"'"),n=i.charAt(r),r+=1,n},h=function(){var e,t="";for("-"===n&&(t="-",u("-"));n>="0"&&n<="9";)t+=n,u();if("."===n)for(t+=".";u()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,u(),"-"!==n&&"+"!==n||(t+=n,u());n>="0"&&n<="9";)t+=n,u();if(e=+t,isFinite(e))return t.length>15?t:e;a("Bad number")},c=function(){var e,t,r,i="";if('"'===n)for(;u();){if('"'===n)return u(),i;if("\\"===n)if(u(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof o[n])break;i+=o[n]}else i+=n}a("Bad string")},l=function(){for(;n&&n<=" ";)u()};s=function(){switch(l(),n){case"{":return function(){var e,r={};if("{"===n){if(u("{"),l(),"}"===n)return u("}"),r;for(;n;){if(e=c(),l(),u(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&a('Duplicate key "'+e+'"'),r[e]=s(),l(),"}"===n)return u("}"),r;u(","),l()}}a("Bad object")}();case"[":return function(){var e=[];if("["===n){if(u("["),l(),"]"===n)return u("]"),e;for(;n;){if(e.push(s()),l(),"]"===n)return u("]"),e;u(","),l()}}a("Bad array")}();case'"':return c();case"-":return h();default:return n>="0"&&n<="9"?h():function(){switch(n){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}a("Unexpected '"+n+"'")}()}};var f,y,m,d=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function p(e){return d.lastIndex=0,d.test(e)?'"'+e.replace(d,function(e){var t=g[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function S(t,r){var n,i,s,o,a,u,h=f,c=r[t],l=(u=c)&&!!e.BigNumber&&(u instanceof e.BigNumber||e.BigNumber.isBigNumber(u));switch(l&&!c.isFinite()&&(c=null),c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(t)),"function"==typeof m&&(c=m.call(r,t,c)),typeof c){case"string":return l?c:p(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";if(f+=y,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(o=c.length,n=0;n<o;n+=1)a[n]=S(n,c)||"null";return s=0===a.length?"[]":f?"[\n"+f+a.join(",\n"+f)+"\n"+h+"]":"["+a.join(",")+"]",f=h,s}if(m&&"object"==typeof m)for(o=m.length,n=0;n<o;n+=1)"string"==typeof m[n]&&(s=S(i=m[n],c))&&a.push(p(i)+(f?": ":":")+s);else for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(s=S(i,c))&&a.push(p(i)+(f?": ":":")+s);return s=0===a.length?"{}":f?"{\n"+f+a.join(",\n"+f)+"\n"+h+"}":"{"+a.join(",")+"}",f=h,s}}return{parse:function(e,t){var o;return i=e+"",r=0,n=" ",o=s(),l(),n&&a("Syntax error"),"function"==typeof t?function e(r,n){var i,s=r[n];return s&&"object"==typeof s&&Object.keys(s).forEach(function(t){void 0!==(i=e(s,t))?s[t]=i:delete s[t]}),t.call(r,n,s)}({"":o},""):o},stringify:function(e,t,r){var n;if(f="",y="","number"==typeof r)for(n=0;n<r;n+=1)y+=" ";else"string"==typeof r&&(y=r);if(m=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return S("",{"":e})}}}}]);
var WavesMarshall=function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(1),n=r(3),s=r(10),o=r(8);var a;!function(e){e[e.GENESIS=1]="GENESIS",e[e.PAYMENT=2]="PAYMENT",e[e.ISSUE=3]="ISSUE",e[e.TRANSFER=4]="TRANSFER",e[e.REISSUE=5]="REISSUE",e[e.BURN=6]="BURN",e[e.EXCHANGE=7]="EXCHANGE",e[e.LEASE=8]="LEASE",e[e.CANCEL_LEASE=9]="CANCEL_LEASE",e[e.ALIAS=10]="ALIAS",e[e.MASS_TRANSFER=11]="MASS_TRANSFER",e[e.DATA=12]="DATA",e[e.SET_SCRIPT=13]="SET_SCRIPT",e[e.SPONSORSHIP=14]="SPONSORSHIP",e[e.SET_ASSET_SCRIPT=15]="SET_ASSET_SCRIPT",e[e.INVOKE_SCRIPT=16]="INVOKE_SCRIPT"}(a=t.TRANSACTION_TYPE||(t.TRANSACTION_TYPE={}));const u={toBytes:i.SHORT,fromBytes:n.P_SHORT},h={toBytes:i.INT,fromBytes:n.P_INT};var c;!function(e){e.longField=(e=>[e,{toBytes:i.LONG,fromBytes:n.P_LONG}]),e.byteField=(e=>[e,{toBytes:i.BYTE,fromBytes:n.P_BYTE}]),e.booleanField=(e=>[e,{toBytes:i.BOOL,fromBytes:n.P_BOOLEAN}]),e.stringField=(e=>[e,{toBytes:i.LEN(i.SHORT)(i.STRING),fromBytes:n.P_STRING_VAR(n.P_SHORT)}]),e.base58field32=(e=>[e,{toBytes:i.BASE58_STRING,fromBytes:n.P_BASE58_FIXED(32)}]),e.base58Option32=(e=>[e,{toBytes:i.OPTION(i.BASE58_STRING),fromBytes:n.P_OPTION(n.P_BASE58_FIXED(32))}]),e.base64field=(e=>[e,{toBytes:i.LEN(i.SHORT)(i.BASE64_STRING),fromBytes:n.P_BASE64(n.P_SHORT)}]),e.byteConstant=(e=>["noname",{toBytes:()=>Uint8Array.from([e]),fromBytes:()=>({value:void 0,shift:1})}]),e.alias=["alias",{toBytes:i.LEN(i.SHORT)(i.STRING),fromBytes:n.byteNewAliasToString}],e.amount=e.longField("amount"),e.assetDescription=e.stringField("description"),e.assetId=e.base58field32("assetId"),e.assetName=e.stringField("name"),e.attachment=["attachment",{toBytes:i.LEN(i.SHORT)(i.BASE58_STRING),fromBytes:n.P_BASE58_VAR(n.P_SHORT)}],e.chainId=e.byteField("chainId"),e.decimals=e.byteField("decimals"),e.fee=e.longField("fee"),e.leaseAssetId=e.base58Option32("leaseAssetId"),e.leaseId=e.base58field32("leaseId"),e.optionalAssetId=e.base58Option32("assetId"),e.quantity=e.longField("quantity"),e.reissuable=e.booleanField("reissuable"),e.recipient=["recipient",{toBytes:i.ADDRESS_OR_ALIAS,fromBytes:n.byteToAddressOrAlias}],e.script=["script",{toBytes:i.SCRIPT,fromBytes:n.byteToScript}],e.senderPublicKey=e.base58field32("senderPublicKey"),e.signature=["signature",{toBytes:i.BASE58_STRING,fromBytes:n.P_BASE58_FIXED(64)}],e.timestamp=e.longField("timestamp"),e.type=e.byteField("type"),e.version=e.byteField("version"),e.proofs=["proofs",{type:"array",items:{toBytes:i.LEN(i.SHORT)(i.BASE58_STRING),fromBytes:n.P_BASE58_VAR(n.P_SHORT)}}];const t={type:"object",schema:[e.recipient,e.amount]};e.transfers=["transfers",{type:"array",items:t}];const r={type:"dataTxField",items:new Map([[s.DATA_FIELD_TYPE.INTEGER,{toBytes:i.LONG,fromBytes:n.P_LONG}],[s.DATA_FIELD_TYPE.BOOLEAN,{toBytes:i.BOOL,fromBytes:n.P_BOOLEAN}],[s.DATA_FIELD_TYPE.BINARY,{toBytes:i.LEN(i.SHORT)(i.BASE64_STRING),fromBytes:n.P_BASE64(n.P_SHORT)}],[s.DATA_FIELD_TYPE.STRING,{toBytes:i.LEN(i.SHORT)(i.STRING),fromBytes:n.P_STRING_VAR(n.P_SHORT)}]])};e.data=["data",{type:"array",items:r}];const o=s.anyOf([[0,{toBytes:i.LONG,fromBytes:n.P_LONG},"integer"],[1,{toBytes:i.LEN(i.INT)(i.BASE64_STRING),fromBytes:n.P_BASE64(n.P_INT)},"binary"],[2,{toBytes:i.LEN(i.INT)(i.STRING),fromBytes:n.P_STRING_VAR(n.P_INT)},"string"],[6,{toBytes:()=>Uint8Array.from([]),fromBytes:()=>({value:!0,shift:0})},"boolean"],[7,{toBytes:()=>Uint8Array.from([]),fromBytes:()=>({value:!1,shift:0})},"boolean"]],{valueField:"value"});e.functionCall=["call",{type:"object",optional:!0,schema:[e.byteConstant(9),e.byteConstant(1),["function",{toBytes:i.LEN(i.INT)(i.STRING),fromBytes:n.P_STRING_VAR(n.P_INT)}],["args",{type:"array",toBytes:i.INT,fromBytes:n.P_INT,items:o}]]}],e.payment={type:"object",withLength:u,schema:[e.amount,e.optionalAssetId]},e.payments=["payment",{type:"array",items:e.payment}]}(c=t.txFields||(t.txFields={})),t.orderSchemaV0={type:"object",schema:[c.senderPublicKey,c.base58field32("matcherPublicKey"),["assetPair",{type:"object",schema:[c.base58Option32("amountAsset"),c.base58Option32("priceAsset")]}],["orderType",{toBytes:e=>i.BYTE("sell"===e?1:0),fromBytes:(e,t=0)=>1===n.P_BYTE(e,t).value?{value:"sell",shift:1}:{value:"buy",shift:1}}],c.longField("price"),c.longField("amount"),c.timestamp,c.longField("expiration"),c.longField("matcherFee")]},t.orderSchemaV2={type:"object",schema:[c.version,...t.orderSchemaV0.schema]},t.aliasSchemaV2={type:"object",schema:[c.type,c.version,c.senderPublicKey,[["alias","chainId"],{type:"object",withLength:u,schema:[c.byteConstant(2),c.chainId,c.alias]}],c.fee,c.timestamp]},t.burnSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetId,c.quantity,c.fee,c.timestamp]},t.cancelLeaseSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.fee,c.timestamp,c.leaseId]},t.invokeScriptSchemaV1={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,["dApp",c.recipient[1]],c.functionCall,c.payments,c.fee,["feeAssetId",c.optionalAssetId[1]],c.timestamp]},t.dataSchemaV1={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.data,c.timestamp,c.fee]},t.proofsSchemaV0={type:"object",schema:[["signature",{toBytes:i.BASE58_STRING,fromBytes:n.P_BASE58_FIXED(64)}]]},t.proofsSchemaV1={type:"object",schema:[c.byteConstant(1),c.proofs]};const l={type:"object",schema:[...t.orderSchemaV0.schema,c.signature]};t.exchangeSchemaV1={type:"object",schema:[c.type,["order1",{fromBytes:()=>({value:void 0,shift:4}),toBytes:e=>i.INT(o.serializerFromSchema(l)(e).length)}],["order2",{fromBytes:()=>({value:void 0,shift:4}),toBytes:e=>i.INT(o.serializerFromSchema(l)(e).length)}],["order1",l],["order2",l],c.longField("price"),c.longField("amount"),c.longField("buyMatcherFee"),c.longField("sellMatcherFee"),c.longField("fee"),c.longField("timestamp")]};const f=s.anyOf([[1,{type:"object",withLength:h,schema:[c.byteConstant(1),...t.orderSchemaV0.schema,...t.proofsSchemaV0.schema]}],[2,{type:"object",withLength:h,schema:[...t.orderSchemaV2.schema,...t.proofsSchemaV1.schema]}]],{discriminatorField:"version",discriminatorBytePos:4});t.exchangeSchemaV2={type:"object",schema:[c.byteConstant(0),c.type,c.version,["order1",f],["order2",f],c.longField("price"),c.longField("amount"),c.longField("buyMatcherFee"),c.longField("sellMatcherFee"),c.longField("fee"),c.longField("timestamp")]},t.issueSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetName,c.assetDescription,c.quantity,c.decimals,c.reissuable,c.fee,c.timestamp,c.script]},t.leaseSchemaV2={type:"object",schema:[c.type,c.version,c.leaseAssetId,c.senderPublicKey,c.recipient,c.amount,c.fee,c.timestamp]},t.massTransferSchemaV1={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.optionalAssetId,c.transfers,c.timestamp,c.fee,c.attachment]},t.reissueSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetId,c.quantity,c.reissuable,c.fee,c.timestamp]},t.setAssetScriptSchemaV1={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetId,c.fee,c.timestamp,c.script]},t.setScriptSchemaV1={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.script,c.fee,c.timestamp]},t.sponsorshipSchemaV1={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.assetId,c.longField("minSponsoredAssetFee"),c.fee,c.timestamp]},t.transferSchemaV2={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.optionalAssetId,["feeAssetId",c.optionalAssetId[1]],c.timestamp,c.amount,c.fee,c.recipient,c.attachment]},t.schemasByTypeMap={[a.GENESIS]:{},[a.PAYMENT]:{},[a.ISSUE]:{2:t.issueSchemaV2},[a.TRANSFER]:{2:t.transferSchemaV2},[a.REISSUE]:{2:t.reissueSchemaV2},[a.BURN]:{2:t.burnSchemaV2},[a.EXCHANGE]:{1:t.exchangeSchemaV1,2:t.exchangeSchemaV2},[a.LEASE]:{2:t.leaseSchemaV2},[a.CANCEL_LEASE]:{2:t.cancelLeaseSchemaV2},[a.ALIAS]:{2:t.aliasSchemaV2},[a.MASS_TRANSFER]:{1:t.massTransferSchemaV1},[a.DATA]:{1:t.dataSchemaV1},[a.SET_SCRIPT]:{1:t.setScriptSchemaV1},[a.SPONSORSHIP]:{1:t.sponsorshipSchemaV1},[a.SET_ASSET_SCRIPT]:{1:t.setAssetScriptSchemaV1},[a.INVOKE_SCRIPT]:{1:t.invokeScriptSchemaV1}},t.getTransactionSchema=function(e,r){const i=t.schemasByTypeMap[e];if("object"!=typeof i)throw new Error(`Incorrect tx type: ${e}`);const n=i[r||1];if("object"!=typeof n)throw new Error(`Incorrect tx version: ${r}`);return n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(5),n=r(6),s=r(2),o=r(7);t.empty=Uint8Array.from([]),t.zero=Uint8Array.from([0]),t.one=Uint8Array.from([1]),t.BASE58_STRING=(e=>i.default.decode(e)),t.BASE64_STRING=(e=>n.toByteArray(e.replace("base64:",""))),t.STRING=(e=>e?(e=>Uint8Array.from([...unescape(encodeURIComponent(e))].map(e=>e.charCodeAt(0))))(e):t.empty),t.BYTE=(e=>Uint8Array.from([e])),t.BOOL=(e=>t.BYTE(1==e?1:0)),t.BYTES=(e=>Uint8Array.from(e)),t.SHORT=(e=>{const t=o.fromNumber(e,!0);return Uint8Array.from(t.toBytesBE().slice(6))}),t.INT=(e=>{const t=o.fromNumber(e,!0);return Uint8Array.from(t.toBytesBE().slice(4))}),t.OPTION=(e=>r=>null==r||"string"==typeof r&&0==r.length?t.zero:s.concat(t.one,e(r))),t.LEN=(e=>t=>r=>{const i=t(r),n=e(i.length);return s.concat(n,i)}),t.COUNT=(e=>t=>r=>{const i=s.concat(...r.map(e=>t(e))),n=e(r.length);return s.concat(n,i)}),t.LONG=(e=>{let t;if("number"==typeof e){if(e>Math.pow(2,53)-1)throw new Error(`${e} is too big to be precisely represented as js number. Use string instead`);t=o.fromNumber(e)}else t=o.fromString(e.toString());return Uint8Array.from(t.toBytesBE())}),t.SCRIPT=(e=>t.OPTION(t.LEN(t.SHORT)(t.BASE64_STRING))(e?e.slice(7):null)),t.ALIAS=(e=>{const[r,i,n]=e.split(":");if(!i||1!==i.length)throw new Error("Invalid network byte in alias");if(!n||0===n.length)throw new Error("Invalid alias body");return s.concat([2],[i.charCodeAt(0)],t.LEN(t.SHORT)(t.STRING)(n))}),t.ADDRESS_OR_ALIAS=(e=>e.startsWith("alias")?t.ALIAS(e):t.BASE58_STRING(e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=((...e)=>e.reduce((e,t)=>Uint8Array.from([...e,...t]),new Uint8Array(0))),t.range=((e,t,r=1)=>Array.from({length:t-e}).map((t,i)=>i*r+e))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(7),n=r(9),s=r(5),o=r(6);t.ALIAS_VERSION=2;t.P_OPTION=(e=>(t,r=0)=>{if(0===t[r])return{value:null,shift:1};const i=e(t,r+1);return{value:i.value,shift:i.shift+1}}),t.P_BYTE=((e,t=0)=>({value:e[t],shift:1})),t.P_SHORT=((e,t=0)=>({value:256*e[t]+e[t+1],shift:2})),t.P_INT=((e,t=0)=>({value:Math.pow(2,24)*e[t]+Math.pow(2,16)*e[t+1]+Math.pow(2,8)*e[t+2]+e[t+3],shift:4})),t.P_LONG=((e,t=0)=>({value:i.fromBytesBE(Array.from(e.slice(t,t+8))).toString(),shift:8})),t.P_BOOLEAN=((e,t=0)=>{return{value:!!e[t],shift:1}}),t.P_STRING_FIXED=(e=>(t,r=0)=>{const i=n.Utf8ArrayToStr(t.slice(r,r+e));return{shift:e,value:i}}),t.P_STRING_VAR=(e=>(r,i=0)=>{const n=e(r,i),{value:s}=t.P_STRING_FIXED(n.value)(r,i+n.shift);return{shift:n.value+n.shift,value:s}}),t.P_BASE58_FIXED=(e=>(t,r=0)=>{return{value:s.default.encode(t.slice(r,r+e)),shift:e}}),t.P_BASE58_VAR=(e=>(r,i=0)=>{const n=e(r,i),{value:s}=t.P_BASE58_FIXED(n.value)(r,i+2);return{shift:n.value+2,value:s}}),t.P_BASE64=(e=>(t,r=0)=>{const i=e(t,r),n=`base64:${o.fromByteArray(t.slice(r+i.shift,r+i.shift+i.value))}`;return{shift:i.value+i.shift,value:n}});t.byteToStringWithLength=((e,r=0)=>{const i=t.P_SHORT(e,r),{value:s}=(e=>(t,r)=>{const i=n.Utf8ArrayToStr(t.slice(r,r+e));return{shift:e,value:i}})(i.value)(e,r+2);return{shift:i.value+2,value:s}}),t.byteToBase58=((e,t=0,r)=>{const i=r||32;return{value:s.default.encode(e.slice(t,t+i)),shift:i}}),t.byteToBase58WithLength=((e,r=0)=>{const i=t.P_SHORT(e,r);return{value:s.default.encode(e.slice(r+i.shift,r+i.shift+i.value)),shift:i.shift+i.value}}),t.byteToAddressOrAlias=((e,r=0)=>{if(e[r]===t.ALIAS_VERSION){const i=t.byteToStringWithLength(e,r+2);return{shift:i.shift+2,value:`alias:${String.fromCharCode(e[r+1])}:${i.value}`}}return t.byteToBase58(e,r,26)}),t.byteNewAliasToString=((e,r=0)=>{const i=t.P_SHORT(e,r).value+2,{value:n}=t.byteToStringWithLength(e,r);return{shift:i,value:n}}),t.byteToScript=((e,r=0)=>{if(0===e[r])return{shift:1,value:null};const i=t.P_SHORT(e,r+1),n=r+1+i.shift,s=r+1+i.shift+i.value;return{value:`base64:${o.fromByteArray(e.slice(n,s))}`,shift:s-r}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(0),n=r(8),s=r(11),o=r(12);t.json=o;const a=r(1);t.serializePrimitives=a;const u=r(3);t.parsePrimitives=u;const h=r(0);t.schemas=h;const c={serializerFromSchema:n.serializerFromSchema,serializeTx:n.serializeTx,serializeOrder:n.serializeOrder,parserFromSchema:s.parserFromSchema,parseTx:s.parseTx,parseOrder:s.parseOrder};function l(e,t,r,i){const o=n.serializerFromSchema(t,i),a=s.parserFromSchema(t,r)(o(e)).value;return Object.assign({},e,a)}t.binary=c,t.convertLongFields=l,t.convertTxLongFields=function(e,t,r){const{type:n,version:s}=e;return l(e,i.getTransactionSchema(n,s),t,r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",n=i.split("").reduce((e,t,r)=>(e[t]=r,e),{});t.default={encode(e){if(!e.length)return"";const t=[0];for(let r=0;r<e.length;r++){for(let e=0;e<t.length;e++)t[e]<<=8;t[0]+=e[r];let i=0;for(let e=0;e<t.length;e++)t[e]+=i,i=t[e]/58|0,t[e]%=58;for(;i;)t.push(i%58),i=i/58|0}for(let r=0;0===e[r]&&r<e.length-1;r++)t.push(0);return t.reverse().map(function(e){return i[e]}).join("")},decode(e){if(!e.length)return new Uint8Array(0);const t=[0];for(let r=0;r<e.length;r++){const i=e[r];if(!(i in n))throw new Error(`There is no character "${i}" in the Base58 sequence!`);for(let e=0;e<t.length;e++)t[e]*=58;t[0]+=n[i];let s=0;for(let e=0;e<t.length;e++)t[e]+=s,s=t[e]>>8,t[e]&=255;for(;s;)t.push(255&s),s>>=8}for(let r=0;"1"===e[r]&&r<e.length-1;r++)t.push(0);return new Uint8Array(t.reverse())}}},function(e,t,r){"use strict";t.byteLength=function(e){var t=h(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){for(var t,r=h(e),i=r[0],o=r[1],a=new s(function(e,t,r){return 3*(t+r)/4-r}(0,i,o)),u=0,c=o>0?i-4:i,l=0;l<c;l+=4)t=n[e.charCodeAt(l)]<<18|n[e.charCodeAt(l+1)]<<12|n[e.charCodeAt(l+2)]<<6|n[e.charCodeAt(l+3)],a[u++]=t>>16&255,a[u++]=t>>8&255,a[u++]=255&t;2===o&&(t=n[e.charCodeAt(l)]<<2|n[e.charCodeAt(l+1)]>>4,a[u++]=255&t);1===o&&(t=n[e.charCodeAt(l)]<<10|n[e.charCodeAt(l+1)]<<4|n[e.charCodeAt(l+2)]>>2,a[u++]=t>>8&255,a[u++]=255&t);return a},t.fromByteArray=function(e){for(var t,r=e.length,n=r%3,s=[],o=0,a=r-n;o<a;o+=16383)s.push(c(e,o,o+16383>a?a:o+16383));1===n?(t=e[r-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return s.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)i[a]=o[a],n[o.charCodeAt(a)]=a;function h(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,s,o=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(i[(s=n)>>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(e,t){e.exports=i;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function i(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}i.prototype.__isLong__,Object.defineProperty(i.prototype,"__isLong__",{value:!0}),i.isLong=n;var s={},o={};function a(e,t){var r,i,n;return t?(n=0<=(e>>>=0)&&e<256)&&(i=o[e])?i:(r=h(e,(0|e)<0?-1:0,!0),n&&(o[e]=r),r):(n=-128<=(e|=0)&&e<128)&&(i=s[e])?i:(r=h(e,e<0?-1:0,!1),n&&(s[e]=r),r)}function u(e,t){if(isNaN(e))return t?S:p;if(t){if(e<0)return S;if(e>=m)return T}else{if(e<=-d)return B;if(e+1>=d)return A}return e<0?u(-e,t).neg():h(e%y|0,e/y|0,t)}function h(e,t,r){return new i(e,t,r)}i.fromInt=a,i.fromNumber=u,i.fromBits=h;var c=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return p;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return l(e.substring(1),t,r).neg();for(var n=u(c(r,8)),s=p,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),h=parseInt(e.substring(o,o+a),r);if(a<8){var f=u(c(r,a));s=s.mul(f).add(u(h))}else s=(s=s.mul(n)).add(u(h))}return s.unsigned=t,s}function f(e,t){return"number"==typeof e?u(e,t):"string"==typeof e?l(e,t):h(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}i.fromString=l,i.fromValue=f;var y=4294967296,m=y*y,d=m/2,g=a(1<<24),p=a(0);i.ZERO=p;var S=a(0,!0);i.UZERO=S;var v=a(1);i.ONE=v;var E=a(1,!0);i.UONE=E;var b=a(-1);i.NEG_ONE=b;var A=h(-1,2147483647,!1);i.MAX_VALUE=A;var T=h(-1,-1,!0);i.MAX_UNSIGNED_VALUE=T;var B=h(0,-2147483648,!1);i.MIN_VALUE=B;var _=i.prototype;_.toInt=function(){return this.unsigned?this.low>>>0:this.low},_.toNumber=function(){return this.unsigned?(this.high>>>0)*y+(this.low>>>0):this.high*y+(this.low>>>0)},_.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(B)){var t=u(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=u(c(e,6),this.unsigned),s=this,o="";;){var a=s.div(n),h=(s.sub(a.mul(n)).toInt()>>>0).toString(e);if((s=a).isZero())return h+o;for(;h.length<6;)h="0"+h;o=""+h+o}},_.getHighBits=function(){return this.high},_.getHighBitsUnsigned=function(){return this.high>>>0},_.getLowBits=function(){return this.low},_.getLowBitsUnsigned=function(){return this.low>>>0},_.getNumBitsAbs=function(){if(this.isNegative())return this.eq(B)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},_.isZero=function(){return 0===this.high&&0===this.low},_.eqz=_.isZero,_.isNegative=function(){return!this.unsigned&&this.high<0},_.isPositive=function(){return this.unsigned||this.high>=0},_.isOdd=function(){return 1==(1&this.low)},_.isEven=function(){return 0==(1&this.low)},_.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},_.eq=_.equals,_.notEquals=function(e){return!this.eq(e)},_.neq=_.notEquals,_.ne=_.notEquals,_.lessThan=function(e){return this.comp(e)<0},_.lt=_.lessThan,_.lessThanOrEqual=function(e){return this.comp(e)<=0},_.lte=_.lessThanOrEqual,_.le=_.lessThanOrEqual,_.greaterThan=function(e){return this.comp(e)>0},_.gt=_.greaterThan,_.greaterThanOrEqual=function(e){return this.comp(e)>=0},_.gte=_.greaterThanOrEqual,_.ge=_.greaterThanOrEqual,_.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},_.comp=_.compare,_.negate=function(){return!this.unsigned&&this.eq(B)?B:this.not().add(v)},_.neg=_.negate,_.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,u=e.low>>>16,c=0,l=0,y=0,m=0;return y+=(m+=s+(65535&e.low))>>>16,l+=(y+=i+u)>>>16,c+=(l+=r+a)>>>16,c+=t+o,h((y&=65535)<<16|(m&=65535),(c&=65535)<<16|(l&=65535),this.unsigned)},_.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},_.sub=_.subtract,_.multiply=function(e){if(this.isZero())return p;if(n(e)||(e=f(e)),r)return h(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return p;if(this.eq(B))return e.isOdd()?B:p;if(e.eq(B))return this.isOdd()?B:p;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return u(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,i=65535&this.high,s=this.low>>>16,o=65535&this.low,a=e.high>>>16,c=65535&e.high,l=e.low>>>16,y=65535&e.low,m=0,d=0,S=0,v=0;return S+=(v+=o*y)>>>16,d+=(S+=s*y)>>>16,S&=65535,d+=(S+=o*l)>>>16,m+=(d+=i*y)>>>16,d&=65535,m+=(d+=s*l)>>>16,d&=65535,m+=(d+=o*c)>>>16,m+=t*y+i*l+s*c+o*a,h((S&=65535)<<16|(v&=65535),(m&=65535)<<16|(d&=65535),this.unsigned)},_.mul=_.multiply,_.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,i,s;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?h((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?S:p;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return S;if(e.gt(this.shru(1)))return E;s=S}else{if(this.eq(B))return e.eq(v)||e.eq(b)?B:e.eq(B)?v:(t=this.shr(1).div(e).shl(1)).eq(p)?e.isNegative()?v:b:(i=this.sub(e.mul(t)),s=t.add(i.div(e)));if(e.eq(B))return this.unsigned?S:p;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=p}for(i=this;i.gte(e);){t=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(t)/Math.LN2),a=o<=48?1:c(2,o-48),l=u(t),y=l.mul(e);y.isNegative()||y.gt(i);)y=(l=u(t-=a,this.unsigned)).mul(e);l.isZero()&&(l=v),s=s.add(l),i=i.sub(y)}return s},_.div=_.divide,_.modulo=function(e){return n(e)||(e=f(e)),r?h((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},_.mod=_.modulo,_.rem=_.modulo,_.not=function(){return h(~this.low,~this.high,this.unsigned)},_.and=function(e){return n(e)||(e=f(e)),h(this.low&e.low,this.high&e.high,this.unsigned)},_.or=function(e){return n(e)||(e=f(e)),h(this.low|e.low,this.high|e.high,this.unsigned)},_.xor=function(e){return n(e)||(e=f(e)),h(this.low^e.low,this.high^e.high,this.unsigned)},_.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?h(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):h(0,this.low<<e-32,this.unsigned)},_.shl=_.shiftLeft,_.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?h(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):h(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},_.shr=_.shiftRight,_.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?h(this.low>>>e|t<<32-e,t>>>e,this.unsigned):h(32===e?t:t>>>e-32,0,this.unsigned)},_.shru=_.shiftRightUnsigned,_.shr_u=_.shiftRightUnsigned,_.toSigned=function(){return this.unsigned?h(this.low,this.high,!1):this},_.toUnsigned=function(){return this.unsigned?this:h(this.low,this.high,!0)},_.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},_.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},_.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},i.fromBytes=function(e,t,r){return r?i.fromBytesLE(e,t):i.fromBytesBE(e,t)},i.fromBytesLE=function(e,t){return new i(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},i.fromBytesBE=function(e,t){return new i(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(1),n=r(2),s=r(0);t.serializerFromSchema=((e,r)=>s=>{let o,a;if("array"===e.type)return o=t.serializerFromSchema(e.items,r),a=n.concat(...s.map(e=>o(e))),n.concat((e.toBytes||i.SHORT)(s.length),a);if("object"===e.type){let i=Uint8Array.from([]);if(e.optional&&null==s)return Uint8Array.from([0]);if(e.schema.forEach(e=>{const[u,h]=e;let c;c=Array.isArray(u)?u.reduce((e,t)=>Object.assign({},e,{[t]:s[t]}),{}):s[u],o=t.serializerFromSchema(h,r),a=o(c),i=n.concat(i,a)}),e.withLength){const t=e.withLength.toBytes(i.length);i=n.concat(t,i)}return e.optional&&(i=n.concat([1],i)),i}if("anyOf"===e.type){const u=s[e.discriminatorField],h=e.itemByKey(u);if(null==h)throw new Error(`Serializer Error: Unknown anyOf type: ${u}`);return"boolean"===h.strKey&&6===h.key&&!1===s.value&&(h.key=7),o=t.serializerFromSchema(h.schema,r),null==e.valueField?o(s):(a=o(s[e.valueField]),n.concat((e.toBytes||i.BYTE)(h.key),a))}if("primitive"===e.type||void 0===e.type)return e.toBytes(s);if("dataTxField"===e.type){const u=i.LEN(i.SHORT)(i.STRING)(s.key),h=s.type,c=e.items.get(h);if(null==c)throw new Error(`Serializer Error: Unknown dataTxField type: ${h}`);const l=[...e.items.values()].findIndex(e=>e===c);return o=t.serializerFromSchema(c,r),a=o(s.value),n.concat(u,i.BYTE(l),a)}throw new Error(`Serializer Error: Unknown schema type: ${e.type}`)}),t.serializeTx=function(e,r){const{type:i,version:n}=e,o=s.getTransactionSchema(i,n);return t.serializerFromSchema(o,r)(e)},t.serializeOrder=function(e,r){const{version:i}=e,n=2==i?s.orderSchemaV2:s.orderSchemaV0;return t.serializerFromSchema(n,r)(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,n,s;t.Utf8ArrayToStr=(i=new Array(128),n=String.fromCodePoint||String.fromCharCode,s=[],function(e){var t,r,o=e.length;s.length=0;for(var a=0;a<o;)(r=e[a++])<=127?t=r:r<=223?t=(31&r)<<6|63&e[a++]:r<=239?t=(15&r)<<12|(63&e[a++])<<6|63&e[a++]:String.fromCodePoint?t=(7&r)<<18|(63&e[a++])<<12|(63&e[a++])<<6|63&e[a++]:(t=63,a+=3),s.push(i[t]||(i[t]=n(t)));return s.join("")})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.INTEGER="integer",e.BOOLEAN="boolean",e.STRING="string",e.BINARY="binary"}(t.DATA_FIELD_TYPE||(t.DATA_FIELD_TYPE={})),t.anyOf=function(e,t){return new i(e,t)};class i{constructor(e,t){this._items=e,this.type="anyOf",this.discriminatorField="type",this.discriminatorBytePos=0,Object.assign(this,t)}itemByKey(e){const t=this._items.find(([t,r,i])=>i===e||t==e);return t&&{schema:t[1],key:t[0],strKey:t[2]}}itemByByteKey(e){const t=this._items.find(([t,r])=>t===e);return t&&{schema:t[1],key:t[0],strKey:t[2]||t[0].toString(10)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(3),n=r(2),s=r(0);t.parserFromSchema=((e,r)=>(s,o=0)=>{let a=o;if("array"===e.type){const u=[],{value:h,shift:c}=(e.fromBytes||i.P_SHORT)(s,o);return a+=c,n.range(0,h).forEach(i=>{const n=t.parserFromSchema(e.items,r),{value:o,shift:h}=n(s,a);u.push(o),a+=h}),{value:u,shift:a-o}}if("object"===e.type){if(e.optional){const e=1===s[a];if(a+=1,!e)return{value:void 0,shift:1}}if(e.withLength){const t=e.withLength.fromBytes(s,a);a+=t.shift}const i={};return e.schema.forEach(e=>{const[n,o]=e,u=t.parserFromSchema(o,r),{value:h,shift:c}=u(s,a);a+=c,void 0!==h&&(Array.isArray(n)?Object.assign(i,h):i[n]=h)}),{value:i,shift:a-o}}if("anyOf"===e.type){const n=(e.fromBytes||i.P_BYTE)(s,a+e.discriminatorBytePos);e.valueField&&0===e.discriminatorBytePos&&(a+=n.shift);const u=e.itemByByteKey(n.value);if(null==u)throw new Error(`Failed to get schema for item with bytecode: ${n.value}`);const h=t.parserFromSchema(u.schema,r),{value:c,shift:l}=h(s,a);return a+=l,{value:e.valueField?{[e.discriminatorField]:u.strKey,[e.valueField]:c}:c,shift:a-o}}if("dataTxField"===e.type){const n=i.byteToStringWithLength(s,a);a+=n.shift;let o=i.P_BYTE(s,a);a+=o.shift;const u=[...e.items].find((e,t)=>t===o.value);if(!u)throw new Error(`Parser Error: Unknown dataTxField type: ${o.value}`);const h=t.parserFromSchema(u[1],r)(s,a);return{value:{value:h.value,key:n.value,type:u[0]},shift:h.shift+n.shift+o.shift}}if("primitive"===e.type||void 0===e.type){const t=e.fromBytes;let{value:n,shift:a}=t(s,o);return t===i.P_LONG&&r&&(n=r(n)),{value:n,shift:a}}throw new Error(`Parser Error: Unknown schema type: ${e.type}`)}),t.parseHeader=(e=>{let t=0,r=i.P_BYTE(e,t);t+=r.shift,0===r.value&&(t+=(r=i.P_BYTE(e,t)).shift);let n=i.P_BYTE(e,t);return{type:r.value,version:n.value}}),t.parseTx=function(e,r){const{type:i,version:n}=t.parseHeader(e),o=s.getTransactionSchema(i,n);return t.parserFromSchema(o,r)(e).value},t.parseOrder=function(e,r){return t.parserFromSchema(s.orderSchemaV2,r)(e).value}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=r(13),{parse:n,stringify:s}=i(),o=r(0),a=r(1),u=r(4);function h(e,t){return 0===e.length?t:"object"==typeof t?h(e.slice(1),t[e[0]]):void 0}const c=(e,t,r)=>{return function t(i,n){if(null==n)return!1;if(0===i.length&&("primitive"===n.type||void 0===n.type))return n.toBytes===a.LONG;if("object"===n.type){const e=n.schema.find(([e,t])=>e===i[0]);return t(i.slice(1),e&&e[1])}if("array"===n.type)return t(i.slice(1),n.items);if("dataTxField"===n.type){if("value"!==i[0])return!1;const s=h(e.slice(0,e.length-1),r),o=n.items.get(s.type);return t(i.slice(1),o)}if("anyOf"===n.type){const s=h(e.slice(0,e.length-1),r)[n.discriminatorField],o=n.itemByKey(s);return!!o&&(null!=n.valueField&&e[e.length-1]===n.valueField?t(i.slice(1),o.schema):t(i,o.schema))}return!1}(e,t)};function l(e,t){const r=[],i=[];function n(o){return"string"==typeof o&&c(r,t,e)?o:"boolean"==typeof o||o instanceof Boolean||null===o||"number"==typeof o||o instanceof Number||"string"==typeof o||o instanceof String||o instanceof Date?JSON.stringify(o):Array.isArray(o)?function(e){let t="[";const s=i.length;i[s]=e;for(let i=0;i<e.length;i++){let o=i+"",a=e[i];void 0!==a&&"function"!=typeof a?(r[s]=o,t+=n(a)):t+="null",i<e.length-1&&(t+=",")}return i.length=s,r.length=s,t+="]"}(o):o&&"object"==typeof o?function(e){let t=!0,o="{";const a=i.length;i[a]=e;for(let i in e)if(e.hasOwnProperty(i)){let u=e[i];s(u)&&(t?t=!1:o+=",",o+='"'+i+'":',r[a]=i,o+=n(u))}return i.length=a,r.length=a,o+="}"}(o):void 0}function s(e){return void 0!==e&&"function"!=typeof e}return n(e)||""}t.stringifyWithSchema=l,t.parseTx=function(e,t){const r=n(e);return t?u.convertTxLongFields(r,t):r},t.stringifyTx=function(e,t){const{type:r,version:i}=e,n=o.getTransactionSchema(r,i);return l(u.convertLongFields(e,n,void 0,t),n)},t.parseOrder=function(e,t){const r=n(e),i=2===r.version?o.orderSchemaV2:o.orderSchemaV0;return t?u.convertLongFields(r,i,t):r},t.stringifyOrder=function(e,t){const r=2===e.version?o.orderSchemaV2:o.orderSchemaV0;return l(u.convertLongFields(e,r,void 0,t),r)}},function(e,t,r){"use strict";e.exports=function(e){var t={strict:!1};null!=e&&!0===e.strict&&(t.strict=!0);var r,i,n,s,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},a=function(e){throw{name:"SyntaxError",message:e,at:r,text:n}},u=function(e){return e&&e!==i&&a("Expected '"+e+"' instead of '"+i+"'"),i=n.charAt(r),r+=1,i},h=function(){var e,t="";for("-"===i&&(t="-",u("-"));i>="0"&&i<="9";)t+=i,u();if("."===i)for(t+=".";u()&&i>="0"&&i<="9";)t+=i;if("e"===i||"E"===i)for(t+=i,u(),"-"!==i&&"+"!==i||(t+=i,u());i>="0"&&i<="9";)t+=i,u();if(e=+t,isFinite(e))return t.length>15?t:e;a("Bad number")},c=function(){var e,t,r,n="";if('"'===i)for(;u();){if('"'===i)return u(),n;if("\\"===i)if(u(),"u"===i){for(r=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof o[i])break;n+=o[i]}else n+=i}a("Bad string")},l=function(){for(;i&&i<=" ";)u()};s=function(){switch(l(),i){case"{":return function(){var e,r={};if("{"===i){if(u("{"),l(),"}"===i)return u("}"),r;for(;i;){if(e=c(),l(),u(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&a('Duplicate key "'+e+'"'),r[e]=s(),l(),"}"===i)return u("}"),r;u(","),l()}}a("Bad object")}();case"[":return function(){var e=[];if("["===i){if(u("["),l(),"]"===i)return u("]"),e;for(;i;){if(e.push(s()),l(),"]"===i)return u("]"),e;u(","),l()}}a("Bad array")}();case'"':return c();case"-":return h();default:return i>="0"&&i<="9"?h():function(){switch(i){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}a("Unexpected '"+i+"'")}()}};var f,y,m,d=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,g={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function p(e){return d.lastIndex=0,d.test(e)?'"'+e.replace(d,function(e){var t=g[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function S(t,r){var i,n,s,o,a,u,h=f,c=r[t],l=(u=c)&&!!e.BigNumber&&(u instanceof e.BigNumber||e.BigNumber.isBigNumber(u));switch(l&&!c.isFinite()&&(c=null),c&&"object"==typeof c&&"function"==typeof c.toJSON&&(c=c.toJSON(t)),"function"==typeof m&&(c=m.call(r,t,c)),typeof c){case"string":return l?c:p(c);case"number":return isFinite(c)?String(c):"null";case"boolean":return String(c);case"object":if(!c)return"null";if(f+=y,a=[],"[object Array]"===Object.prototype.toString.apply(c)){for(o=c.length,i=0;i<o;i+=1)a[i]=S(i,c)||"null";return s=0===a.length?"[]":f?"[\n"+f+a.join(",\n"+f)+"\n"+h+"]":"["+a.join(",")+"]",f=h,s}if(m&&"object"==typeof m)for(o=m.length,i=0;i<o;i+=1)"string"==typeof m[i]&&(s=S(n=m[i],c))&&a.push(p(n)+(f?": ":":")+s);else for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(s=S(n,c))&&a.push(p(n)+(f?": ":":")+s);return s=0===a.length?"{}":f?"{\n"+f+a.join(",\n"+f)+"\n"+h+"}":"{"+a.join(",")+"}",f=h,s}}return{parse:function(e,t){var o;return n=e+"",r=0,i=" ",o=s(),l(),i&&a("Syntax error"),"function"==typeof t?function e(r,i){var n,s=r[i];return s&&"object"==typeof s&&Object.keys(s).forEach(function(t){void 0!==(n=e(s,t))?s[t]=n:delete s[t]}),t.call(r,i,s)}({"":o},""):o},stringify:function(e,t,r){var i;if(f="",y="","number"==typeof r)for(i=0;i<r;i+=1)y+=" ";else"string"==typeof r&&(y=r);if(m=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return S("",{"":e})}}}}]);

@@ -66,3 +66,3 @@ import { TObject, TSchema, TObjectField } from './schemaTypes';

export declare const proofsSchemaV1: TSchema;
export declare const exchangeSchemaV0: TSchema;
export declare const exchangeSchemaV1: TSchema;
export declare const exchangeSchemaV2: TSchema;

@@ -78,3 +78,3 @@ export declare const issueSchemaV2: TSchema;

/**
* Maps transaction types to schemas object. Schemas are written by keys. 0 - no version, n - version n
* Maps transaction types to schemas object. Schemas are written by keys. 1 equals no version or version 1
*/

@@ -97,3 +97,3 @@ export declare const schemasByTypeMap: {

[TRANSACTION_TYPE.EXCHANGE]: {
0: TObject;
1: TObject;
2: TObject;

@@ -100,0 +100,0 @@ };

@@ -6,2 +6,3 @@ "use strict";

const schemaTypes_1 = require("./schemaTypes");
const serialize_1 = require("./serialize");
//Todo: import this enums from ts-types package

@@ -287,16 +288,23 @@ var TRANSACTION_TYPE;

};
exports.exchangeSchemaV0 = {
const orderSchemaV0WithSignature = {
type: 'object',
schema: [...exports.orderSchemaV0.schema, txFields.signature],
};
//ExchangeV0 needs both orders length to be present before actual order bytes.
// That's why there are two separate rules for oder1 and order2 fields. First one serializes order and writes length.
// Seconds serializes and writes whole order. When deserialize, second rule overwrites order fields in js object
exports.exchangeSchemaV1 = {
type: 'object',
schema: [
txFields.type,
['order1', {
type: 'object',
withLength: intConverter,
schema: [...exports.orderSchemaV0.schema, txFields.signature],
fromBytes: () => ({ value: undefined, shift: 4 }),
toBytes: (order) => serializePrimitives_1.INT(serialize_1.serializerFromSchema(orderSchemaV0WithSignature)(order).length)
}],
['order2', {
type: 'object',
withLength: intConverter,
schema: [...exports.orderSchemaV0.schema, txFields.signature],
fromBytes: () => ({ value: undefined, shift: 4 }),
toBytes: (order) => serializePrimitives_1.INT(serialize_1.serializerFromSchema(orderSchemaV0WithSignature)(order).length)
}],
['order1', orderSchemaV0WithSignature],
['order2', orderSchemaV0WithSignature],
txFields.longField('price'),

@@ -311,3 +319,7 @@ txFields.longField('amount'),

const anyOrder = schemaTypes_1.anyOf([
[1, { type: 'object', withLength: intConverter, schema: [txFields.byteConstant(1), ...exports.orderSchemaV0.schema, ...exports.proofsSchemaV0.schema] }],
[1, {
type: 'object',
withLength: intConverter,
schema: [txFields.byteConstant(1), ...exports.orderSchemaV0.schema, ...exports.proofsSchemaV0.schema]
}],
[2, { type: 'object', withLength: intConverter, schema: [...exports.orderSchemaV2.schema, ...exports.proofsSchemaV1.schema] }],

@@ -441,3 +453,3 @@ ], { discriminatorField: 'version', discriminatorBytePos: 4 });

/**
* Maps transaction types to schemas object. Schemas are written by keys. 0 - no version, n - version n
* Maps transaction types to schemas object. Schemas are written by keys. 1 equals no version or version 1
*/

@@ -460,3 +472,3 @@ exports.schemasByTypeMap = {

[TRANSACTION_TYPE.EXCHANGE]: {
0: exports.exchangeSchemaV0,
1: exports.exchangeSchemaV1,
2: exports.exchangeSchemaV2,

@@ -497,3 +509,3 @@ },

}
const schema = schemas[version || 0];
const schema = schemas[version || 1];
if (typeof schema !== 'object') {

@@ -500,0 +512,0 @@ throw new Error(`Incorrect tx version: ${version}`);

{
"version": "0.7.2",
"version": "0.7.3",
"name": "@waves/marshall",

@@ -24,8 +24,8 @@ "main": "dist/index.js",

"devDependencies": {
"@types/jest": "^23.3.9",
"@types/jest": "^24.0.13",
"@types/node": "^10.12.10",
"bignumber.js": "^8.0.1",
"jest": "^24.7.1",
"jest": "^24.8.0",
"terser-webpack-plugin": "^1.2.3",
"ts-jest": "^23.10.5",
"ts-jest": "^24.0.2",
"ts-loader": "^5.3.3",

@@ -32,0 +32,0 @@ "ts-node": "^8.0.2",

@@ -25,2 +25,3 @@ import {

} from './schemaTypes'
import {serializerFromSchema} from './serialize'

@@ -59,7 +60,7 @@

//Field constructors
export const longField = (name: string): TObjectField => ([name, { toBytes: LONG, fromBytes: P_LONG }])
export const longField = (name: string): TObjectField => ([name, {toBytes: LONG, fromBytes: P_LONG}])
export const byteField = (name: string): TObjectField => ([name, { toBytes: BYTE, fromBytes: P_BYTE }])
export const byteField = (name: string): TObjectField => ([name, {toBytes: BYTE, fromBytes: P_BYTE}])
export const booleanField = (name: string): TObjectField => ([name, { toBytes: BOOL, fromBytes: P_BOOLEAN }])
export const booleanField = (name: string): TObjectField => ([name, {toBytes: BOOL, fromBytes: P_BOOLEAN}])

@@ -88,3 +89,3 @@ export const stringField = (name: string): TObjectField => ([name, {

toBytes: () => Uint8Array.from([byte]),
fromBytes: () => ({ value: undefined, shift: 1 }),
fromBytes: () => ({value: undefined, shift: 1}),
}])

@@ -175,6 +176,6 @@

items: new Map<DATA_FIELD_TYPE, TSchema>([
[DATA_FIELD_TYPE.INTEGER, { toBytes: LONG, fromBytes: P_LONG }],
[DATA_FIELD_TYPE.BOOLEAN, { toBytes: BOOL, fromBytes: P_BOOLEAN }],
[DATA_FIELD_TYPE.BINARY, { toBytes: LEN(SHORT)(BASE64_STRING), fromBytes: P_BASE64(P_SHORT) }],
[DATA_FIELD_TYPE.STRING, { toBytes: LEN(SHORT)(STRING), fromBytes: P_STRING_VAR(P_SHORT) }],
[DATA_FIELD_TYPE.INTEGER, {toBytes: LONG, fromBytes: P_LONG}],
[DATA_FIELD_TYPE.BOOLEAN, {toBytes: BOOL, fromBytes: P_BOOLEAN}],
[DATA_FIELD_TYPE.BINARY, {toBytes: LEN(SHORT)(BASE64_STRING), fromBytes: P_BASE64(P_SHORT)}],
[DATA_FIELD_TYPE.STRING, {toBytes: LEN(SHORT)(STRING), fromBytes: P_STRING_VAR(P_SHORT)}],
]),

@@ -189,8 +190,8 @@ }

const functionArgument = anyOf([
[0, { toBytes: LONG, fromBytes: P_LONG }, 'integer'],
[1, { toBytes: LEN(INT)(BASE64_STRING), fromBytes: P_BASE64(P_INT) }, 'binary'],
[2, { toBytes: LEN(INT)(STRING), fromBytes: P_STRING_VAR(P_INT) }, 'string'],
[6, { toBytes: () => Uint8Array.from([]), fromBytes: () => ({ value: true, shift: 0 }) }, 'boolean'],
[7, { toBytes: () => Uint8Array.from([]), fromBytes: () => ({ value: false, shift: 0 }) }, 'boolean'],
], { valueField: 'value' })
[0, {toBytes: LONG, fromBytes: P_LONG}, 'integer'],
[1, {toBytes: LEN(INT)(BASE64_STRING), fromBytes: P_BASE64(P_INT)}, 'binary'],
[2, {toBytes: LEN(INT)(STRING), fromBytes: P_STRING_VAR(P_INT)}, 'string'],
[6, {toBytes: () => Uint8Array.from([]), fromBytes: () => ({value: true, shift: 0})}, 'boolean'],
[7, {toBytes: () => Uint8Array.from([]), fromBytes: () => ({value: false, shift: 0})}, 'boolean'],
], {valueField: 'value'})

@@ -248,4 +249,4 @@

fromBytes: (bytes: Uint8Array, start = 0) => P_BYTE(bytes, start).value === 1 ?
{ value: 'sell', shift: 1 } :
{ value: 'buy', shift: 1 },
{value: 'sell', shift: 1} :
{value: 'buy', shift: 1},
}],

@@ -362,16 +363,24 @@ txFields.longField('price'),

export const exchangeSchemaV0: TSchema = {
const orderSchemaV0WithSignature: TObject = {
type: 'object',
schema: [...orderSchemaV0.schema, txFields.signature],
}
//ExchangeV0 needs both orders length to be present before actual order bytes.
// That's why there are two separate rules for oder1 and order2 fields. First one serializes order and writes length.
// Seconds serializes and writes whole order. When deserialize, second rule overwrites order fields in js object
export const exchangeSchemaV1: TSchema = {
type: 'object',
schema: [
txFields.type,
['order1', {
type: 'object',
withLength: intConverter,
schema: [...orderSchemaV0.schema, txFields.signature],
fromBytes: () => ({value: undefined, shift: 4}),
toBytes: (order: any) => INT(serializerFromSchema(orderSchemaV0WithSignature)(order).length)
}],
['order2', {
type: 'object',
withLength: intConverter,
schema: [...orderSchemaV0.schema, txFields.signature],
fromBytes: () => ({value: undefined, shift: 4}),
toBytes: (order: any) => INT(serializerFromSchema(orderSchemaV0WithSignature)(order).length)
}],
['order1', orderSchemaV0WithSignature],
['order2', orderSchemaV0WithSignature],
txFields.longField('price'),

@@ -387,5 +396,9 @@ txFields.longField('amount'),

const anyOrder = anyOf([
[1, { type: 'object', withLength: intConverter, schema: [txFields.byteConstant(1), ...orderSchemaV0.schema, ...proofsSchemaV0.schema] }],
[2, { type: 'object', withLength: intConverter, schema: [...orderSchemaV2.schema, ...proofsSchemaV1.schema] }],
], { discriminatorField: 'version', discriminatorBytePos: 4 })
[1, {
type: 'object',
withLength: intConverter,
schema: [txFields.byteConstant(1), ...orderSchemaV0.schema, ...proofsSchemaV0.schema]
}],
[2, {type: 'object', withLength: intConverter, schema: [...orderSchemaV2.schema, ...proofsSchemaV1.schema]}],
], {discriminatorField: 'version', discriminatorBytePos: 4})

@@ -528,3 +541,3 @@ export const exchangeSchemaV2: TSchema = {

/**
* Maps transaction types to schemas object. Schemas are written by keys. 0 - no version, n - version n
* Maps transaction types to schemas object. Schemas are written by keys. 1 equals no version or version 1
*/

@@ -547,3 +560,3 @@ export const schemasByTypeMap = {

[TRANSACTION_TYPE.EXCHANGE]: {
0: exchangeSchemaV0,
1: exchangeSchemaV1,
2: exchangeSchemaV2,

@@ -587,3 +600,3 @@ },

const schema = schemas[version || 0]
const schema = schemas[version || 1]
if (typeof schema !== 'object') {

@@ -590,0 +603,0 @@ throw new Error(`Incorrect tx version: ${version}`)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc